@hanzlaa/rcode 4.10.5 → 4.10.6

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/dist/rcode.js CHANGED
@@ -1,125 +1,126 @@
1
1
  #!/usr/bin/env node
2
2
  /* rcode — built with esbuild. Source: github.com/hanzlahabib/rihal-code */
3
- var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Jt=v((WF,Pc)=>{var my=require("crypto"),ot=require("fs"),fn=require("path");function Rc(t,e,r={}){let{encoding:n="utf8",mode:s}=r,i=fn.dirname(t);ot.mkdirSync(i,{recursive:!0});let o=fn.join(i,`.${fn.basename(t)}.tmp-${process.pid}-${my.randomBytes(8).toString("hex")}`),a;try{a=ot.openSync(o,"wx",s??420),ot.writeSync(a,e,0,n),ot.fsyncSync(a),ot.closeSync(a),a=null,ot.renameSync(o,t)}catch(u){if(a!=null)try{ot.closeSync(a)}catch{}try{ot.unlinkSync(o)}catch{}throw u}}function gy(t,e,r={}){let n=JSON.stringify(e,null,2)+`
4
- `;Rc(t,n,r)}function Dy(t,e){let r;try{r=ot.lstatSync(t)}catch(o){return o.code==="ENOENT"?{ok:!0,reason:"missing"}:{ok:!1,reason:`lstat: ${o.message}`}}if(r.isSymbolicLink())try{return ot.unlinkSync(t),{ok:!0,reason:"symlink-unlinked"}}catch(o){return{ok:!1,reason:`unlink: ${o.message}`}}let n;try{n=ot.realpathSync(e)}catch{n=fn.resolve(e)}let s;try{s=ot.realpathSync(t)}catch(o){return{ok:!1,reason:`realpath: ${o.message}`}}let i=fn.relative(n,s);if(i.startsWith("..")||fn.isAbsolute(i))return{ok:!1,reason:"outside-root"};try{return ot.rmSync(s,{recursive:!0,force:!0}),{ok:!0}}catch(o){return{ok:!1,reason:`rmSync: ${o.message}`}}}Pc.exports={writeFileAtomic:Rc,writeJsonAtomic:gy,safeRmSync:Dy}});var lr=v((HF,Oc)=>{"use strict";var yy=require("os");function vy(){return process.env.HOME||yy.homedir()}Oc.exports={homedir:vy}});var Pn=v((ZF,ei)=>{var Ss=process||{},Nc=Ss.argv||[],bs=Ss.env||{},_y=!(bs.NO_COLOR||Nc.includes("--no-color"))&&(!!bs.FORCE_COLOR||Nc.includes("--color")||Ss.platform==="win32"||(Ss.stdout||{}).isTTY&&bs.TERM!=="dumb"||!!bs.CI),Ey=(t,e,r=t)=>n=>{let s=""+n,i=s.indexOf(e,t.length);return~i?t+by(s,e,r,i)+e:t+s+e},by=(t,e,r,n)=>{let s="",i=0;do s+=t.substring(i,n)+r,i=n+e.length,n=t.indexOf(e,i);while(~n);return s+t.substring(i)},Lc=(t=_y)=>{let e=t?Ey:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};ei.exports=Lc();ei.exports.createColors=Lc});var qc=v(dr=>{"use strict";var Bc=dr&&dr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dr,"__esModule",{value:!0});dr.symbols=dr.isTTY=void 0;var Sy=Bc(require("node:tty")),Nt=Bc(require("node:process")),Cy=Nt.default.env.CI||Nt.default.env.WT_SESSION||Nt.default.env.ConEmuTask==="{cmd::Cmder}"||Nt.default.env.TERM_PROGRAM==="vscode"||Nt.default.env.TERM==="xterm-256color"||Nt.default.env.TERM==="alacritty",Mc=Sy.default.isatty(1)&&Nt.default.env.TERM!=="dumb"&&!("CI"in Nt.default.env);dr.isTTY=Mc;var On=Nt.default.platform!=="win32"?Nt.default.env.TERM!=="linux":Cy,wy={frames:Mc?On?["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]:["-","\\","|","/"]:["-"],tick:On?"\u2714":"\u221A",cross:On?"\u2716":"\xD7",warn:On?"\u26A0":"!!",info:On?"\u2139":"i"};dr.symbols=wy});var Hc=v(Nn=>{"use strict";var xy=Nn&&Nn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.createSpinner=ky;var Wc=xy(Pn()),Lt=qc();function $y(t="",e=80){return t.replace(/\u001b[^m]*?m/g,"").split(`
5
- `).reduce((r,n)=>r+=Math.max(1,Math.ceil(n.length/e)),0)}function ky(t="",e={}){let r=0,n=e.interval||50,s=e.stream||process.stderr,i=e.frames&&e.frames.length?e.frames:Lt.symbols.frames,o=e.color||"yellow",a=!1,u=0,c,l=(C={})=>typeof C=="string"?C:C.text||t,d=(C={})=>typeof C=="string"?!1:!!C.update,f=(C={})=>typeof C=="string"||!C.color?o:C.color,g=(C={},A)=>typeof C=="string"||!C.mark?A:C.mark,m=()=>{process.on("SIGINT",w),process.on("SIGTERM",w)},D=()=>{process.off("SIGINT",w),process.off("SIGTERM",w)},h={reset(){return r=0,u=0,a=!1,clearTimeout(c),c=void 0,h},clear(){h.write("\x1B[1G");for(let C=0;C<u;C++)C>0&&h.write("\x1B[1A"),h.write("\x1B[2K\x1B[1G");return u=0,h},write(C,A=!1){return A&&Lt.isTTY&&h.clear(),s.write(C),h},render(){let C=`${Wc.default[o](i[r])} ${t}`;return Lt.isTTY?h.write("\x1B[?25l"):C+=`
6
- `,h.write(C,!0),Lt.isTTY&&(u=$y(C,s.columns)),h},spin(){return h.render(),r=++r%i.length,h},update(C){return typeof C=="string"?t=C:(t=C.text||t,i=C.frames&&C.frames.length?C.frames:i,n=C.interval||n,o=C.color||o),i.length-1<r&&(r=0),h},loop(){return Lt.isTTY&&(c=setTimeout(()=>h.loop(),n)),h.spin()},start(C={}){return c&&h.reset(),a=!0,m(),h.update({text:l(C),color:f(C)}).loop()},stop(C){a=!1,clearTimeout(c),c=void 0,D();let A=d(C),T=Wc.default[f(C)](g(C,i[r])),G=l(C);return h.write(C?`${T} ${G}${A?"":`
7
- `}`:"",!0),Lt.isTTY&&!A?h.write("\x1B[?25h"):h},success(C={}){return h.stop({text:l(C),mark:g(C,Lt.symbols.tick),color:"green",update:d(C)})},error(C={}){return h.stop({text:l(C),mark:g(C,Lt.symbols.cross),color:"red",update:d(C)})},warn(C={}){return h.stop({text:l(C),mark:g(C,Lt.symbols.warn),color:"yellow",update:d(C)})},info(C={}){return h.stop({text:l(C),mark:g(C,Lt.symbols.info),color:"blue",update:d(C)})},isSpinning(){return a}};function w(C){a&&h.stop(),process.exit(C==="SIGINT"?130:C==="SIGTERM"?143:1)}return h}});var Zc=v(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.splitWhen=hn.flatten=void 0;function Ay(t){return t.reduce((e,r)=>[].concat(e,r),[])}hn.flatten=Ay;function Fy(t,e){let r=[[]],n=0;for(let s of t)e(s)?(n++,r[n]=[]):r[n].push(s);return r}hn.splitWhen=Fy});var Uc=v(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.isEnoentCodeError=void 0;function jy(t){return t.code==="ENOENT"}Cs.isEnoentCodeError=jy});var Vc=v(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.createDirentFromStats=void 0;var ti=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Iy(t,e){return new ti(t,e)}ws.createDirentFromStats=Iy});var Xc=v(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.convertPosixPathToPattern=je.convertWindowsPathToPattern=je.convertPathToPattern=je.escapePosixPath=je.escapeWindowsPath=je.escape=je.removeLeadingDotSegment=je.makeAbsolute=je.unixify=void 0;var Ty=require("os"),Ry=require("path"),Gc=Ty.platform()==="win32",Py=2,Oy=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Ny=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Ly=/^\\\\([.?])/,By=/\\(?![!()+@[\]{}])/g;function My(t){return t.replace(/\\/g,"/")}je.unixify=My;function qy(t,e){return Ry.resolve(t,e)}je.makeAbsolute=qy;function Wy(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(Py)}return t}je.removeLeadingDotSegment=Wy;je.escape=Gc?ri:ni;function ri(t){return t.replace(Ny,"\\$2")}je.escapeWindowsPath=ri;function ni(t){return t.replace(Oy,"\\$2")}je.escapePosixPath=ni;je.convertPathToPattern=Gc?zc:Yc;function zc(t){return ri(t).replace(Ly,"//$1").replace(By,"/")}je.convertWindowsPathToPattern=zc;function Yc(t){return ni(t)}je.convertPosixPathToPattern=Yc});var Kc=v((JF,Jc)=>{Jc.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var tl=v((KF,el)=>{var Hy=Kc(),Qc={"{":"}","(":")","[":"]"},Zy=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(i=t.indexOf(")",r),i>r&&(o=t.indexOf("\\",r),o===-1||o>i))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var u=Qc[a];if(u){var c=t.indexOf(u,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},Uy=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=Qc[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1)}if(t[e]==="!")return!0}else e++}return!1};el.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(Hy(e))return!0;var n=Zy;return r&&r.strict===!1&&(n=Uy),n(e)}});var nl=v((QF,rl)=>{"use strict";var Vy=tl(),Gy=require("path").posix.dirname,zy=require("os").platform()==="win32",si="/",Yy=/\\/g,Xy=/[\{\[].*[\}\]]$/,Jy=/(^|[^\\])([\{\[]|\([^\)]+$)/,Ky=/\\([\!\*\?\|\[\]\(\)\{\}])/g;rl.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&zy&&e.indexOf(si)<0&&(e=e.replace(Yy,si)),Xy.test(e)&&(e+=si),e+="a";do e=Gy(e);while(Vy(e)||Jy.test(e));return e.replace(Ky,"$1")}});var xs=v(lt=>{"use strict";lt.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;lt.find=(t,e)=>t.nodes.find(r=>r.type===e);lt.exceedsLimit=(t,e,r=1,n)=>n===!1||!lt.isInteger(t)||!lt.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;lt.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};lt.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;lt.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;lt.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;lt.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);lt.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s<n.length;s++){let i=n[s];if(Array.isArray(i)){r(i);continue}i!==void 0&&e.push(i)}return e};return r(t),e}});var $s=v((tj,ol)=>{"use strict";var sl=xs();ol.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&sl.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(i||o)&&sl.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)a+=r(u);return a};return r(t)}});var al=v((rj,il)=>{"use strict";il.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var gl=v((nj,ml)=>{"use strict";var ul=al(),Pr=(t,e,r)=>{if(ul(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(ul(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),a=String(n.wrap),u=t+":"+e+"="+s+i+o+a;if(Pr.cache.hasOwnProperty(u))return Pr.cache[u].result;let c=Math.min(t,e),l=Math.max(t,e);if(Math.abs(c-l)===1){let D=t+"|"+e;return n.capture?`(${D})`:n.wrap===!1?D:`(?:${D})`}let d=pl(t)||pl(e),f={min:t,max:e,a:c,b:l},g=[],m=[];if(d&&(f.isPadded=d,f.maxLen=String(f.max).length),c<0){let D=l<0?Math.abs(l):1;m=cl(D,Math.abs(c),f,n),c=f.a=0}return l>=0&&(g=cl(c,l,f,n)),f.negatives=m,f.positives=g,f.result=Qy(m,g,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&g.length+m.length>1&&(f.result=`(?:${f.result})`),Pr.cache[u]=f,f.result};function Qy(t,e,r){let n=oi(t,e,"-",!1,r)||[],s=oi(e,t,"",!1,r)||[],i=oi(t,e,"-?",!0,r)||[];return n.concat(i).concat(s).join("|")}function ev(t,e){let r=1,n=1,s=dl(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=dl(t,r);for(s=fl(e+1,n)-1;t<s&&s<=e;)i.add(s),n+=1,s=fl(e+1,n)-1;return i=[...i],i.sort(nv),i}function tv(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=rv(t,e),s=n.length,i="",o=0;for(let a=0;a<s;a++){let[u,c]=n[a];u===c?i+=u:u!=="0"||c!=="9"?i+=sv(u,c,r):o++}return o&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function cl(t,e,r,n){let s=ev(t,e),i=[],o=t,a;for(let u=0;u<s.length;u++){let c=s[u],l=tv(String(o),String(c),n),d="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+hl(a.count),o=c+1;continue}r.isPadded&&(d=ov(c,r,n)),l.string=d+l.pattern+hl(l.count),i.push(l),o=c+1,a=l}return i}function oi(t,e,r,n,s){let i=[];for(let o of t){let{string:a}=o;!n&&!ll(e,"string",a)&&i.push(r+a),n&&ll(e,"string",a)&&i.push(r+a)}return i}function rv(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function nv(t,e){return t>e?1:e>t?-1:0}function ll(t,e,r){return t.some(n=>n[e]===r)}function dl(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function fl(t,e){return t-t%Math.pow(10,e)}function hl(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function sv(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function pl(t){return/^-?(0+)\d/.test(t)}function ov(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}Pr.cache={};Pr.clearCache=()=>Pr.cache={};ml.exports=Pr});var ui=v((sj,Sl)=>{"use strict";var iv=require("util"),yl=gl(),Dl=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),av=t=>e=>t===!0?Number(e):String(e),ii=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ln=t=>Number.isInteger(+t),ai=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},uv=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,cv=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},As=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},lv=(t,e,r)=>{t.negatives.sort((a,u)=>a<u?-1:a>u?1:0),t.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=e.capture?"":"?:",s="",i="",o;return t.positives.length&&(s=t.positives.map(a=>As(String(a),r)).join("|")),t.negatives.length&&(i=`-(${n}${t.negatives.map(a=>As(String(a),r)).join("|")})`),s&&i?o=`${s}|${i}`:o=s||i,e.wrap?`(${n}${o})`:o},vl=(t,e,r,n)=>{if(r)return yl(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return`[${s}-${i}]`},_l=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return yl(t,e,r)},El=(...t)=>new RangeError("Invalid range arguments: "+iv.inspect(...t)),bl=(t,e,r)=>{if(r.strictRanges===!0)throw El([t,e]);return[]},dv=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},fv=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw El([t,e]);return[]}s===0&&(s=0),i===0&&(i=0);let o=s>i,a=String(t),u=String(e),c=String(r);r=Math.max(Math.abs(r),1);let l=ai(a)||ai(u)||ai(c),d=l?Math.max(a.length,u.length,c.length):0,f=l===!1&&uv(t,e,n)===!1,g=n.transform||av(f);if(n.toRegex&&r===1)return vl(As(t,d),As(e,d),!0,n);let m={negatives:[],positives:[]},D=C=>m[C<0?"negatives":"positives"].push(Math.abs(C)),h=[],w=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?D(s):h.push(cv(g(s,w),d,f)),s=o?s-r:s+r,w++;return n.toRegex===!0?r>1?lv(m,n,d):_l(h,null,{wrap:!1,...n}):h},hv=(t,e,r=1,n={})=>{if(!Ln(t)&&t.length>1||!Ln(e)&&e.length>1)return bl(t,e,n);let s=n.transform||(f=>String.fromCharCode(f)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=i>o,u=Math.min(i,o),c=Math.max(i,o);if(n.toRegex&&r===1)return vl(u,c,!1,n);let l=[],d=0;for(;a?i>=o:i<=o;)l.push(s(i,d)),i=a?i-r:i+r,d++;return n.toRegex===!0?_l(l,null,{wrap:!1,options:n}):l},ks=(t,e,r,n={})=>{if(e==null&&ii(t))return[t];if(!ii(t)||!ii(e))return bl(t,e,n);if(typeof r=="function")return ks(t,e,1,{transform:r});if(Dl(r))return ks(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Ln(r)?Ln(t)&&Ln(e)?fv(t,e,r,s):hv(t,e,Math.max(Math.abs(r),1),s):r!=null&&!Dl(r)?dv(r,s):ks(t,e,1,r)};Sl.exports=ks});var xl=v((oj,wl)=>{"use strict";var pv=ui(),Cl=xs(),mv=(t,e={})=>{let r=(n,s={})=>{let i=Cl.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a=i===!0||o===!0,u=e.escapeInvalid===!0?"\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return a?u+n.value:"(";if(n.type==="close")return a?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=Cl.reduce(n.nodes),d=pv(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return l.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(t)};wl.exports=mv});var Al=v((ij,kl)=>{"use strict";var gv=ui(),$l=$s(),pn=xs(),Or=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?pn.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(Or(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Or(s,i,r):s+i);return pn.flatten(n)},Dv=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,a=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(s.invalid||s.dollar){a.push(Or(a.pop(),$l(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){a.push(Or(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let d=pn.reduce(s.nodes);if(pn.exceedsLimit(...d,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=gv(...d,e);f.length===0&&(f=$l(s,e)),a.push(Or(a.pop(),f)),s.nodes=[];return}let u=pn.encloseBrace(s),c=s.queue,l=s;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let d=0;d<s.nodes.length;d++){let f=s.nodes[d];if(f.type==="comma"&&s.type==="brace"){d===1&&c.push(""),c.push("");continue}if(f.type==="close"){a.push(Or(a.pop(),c,u));continue}if(f.value&&f.type!=="open"){c.push(Or(c.pop(),f.value));continue}f.nodes&&n(f,s)}return c};return pn.flatten(n(t))};kl.exports=Dv});var jl=v((aj,Fl)=>{"use strict";Fl.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
8
- `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Ol=v((uj,Pl)=>{"use strict";var yv=$s(),{MAX_LENGTH:Il,CHAR_BACKSLASH:ci,CHAR_BACKTICK:vv,CHAR_COMMA:_v,CHAR_DOT:Ev,CHAR_LEFT_PARENTHESES:bv,CHAR_RIGHT_PARENTHESES:Sv,CHAR_LEFT_CURLY_BRACE:Cv,CHAR_RIGHT_CURLY_BRACE:wv,CHAR_LEFT_SQUARE_BRACKET:Tl,CHAR_RIGHT_SQUARE_BRACKET:Rl,CHAR_DOUBLE_QUOTE:xv,CHAR_SINGLE_QUOTE:$v,CHAR_NO_BREAK_SPACE:kv,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Av}=jl(),Fv=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(Il,r.maxLength):Il;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,a=s,u=0,c=t.length,l=0,d=0,f,g=()=>t[l++],m=D=>{if(D.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&D.type==="text"){a.value+=D.value;return}return o.nodes.push(D),D.parent=o,D.prev=a,a=D,D};for(m({type:"bos"});l<c;)if(o=i[i.length-1],f=g(),!(f===Av||f===kv)){if(f===ci){m({type:"text",value:(e.keepEscaping?f:"")+g()});continue}if(f===Rl){m({type:"text",value:"\\"+f});continue}if(f===Tl){u++;let D;for(;l<c&&(D=g());){if(f+=D,D===Tl){u++;continue}if(D===ci){f+=g();continue}if(D===Rl&&(u--,u===0))break}m({type:"text",value:f});continue}if(f===bv){o=m({type:"paren",nodes:[]}),i.push(o),m({type:"text",value:f});continue}if(f===Sv){if(o.type!=="paren"){m({type:"text",value:f});continue}o=i.pop(),m({type:"text",value:f}),o=i[i.length-1];continue}if(f===xv||f===$v||f===vv){let D=f,h;for(e.keepQuotes!==!0&&(f="");l<c&&(h=g());){if(h===ci){f+=h+g();continue}if(h===D){e.keepQuotes===!0&&(f+=h);break}f+=h}m({type:"text",value:f});continue}if(f===Cv){d++;let h={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};o=m(h),i.push(o),m({type:"open",value:f});continue}if(f===wv){if(o.type!=="brace"){m({type:"text",value:f});continue}let D="close";o=i.pop(),o.close=!0,m({type:D,value:f}),d--,o=i[i.length-1];continue}if(f===_v&&d>0){if(o.ranges>0){o.ranges=0;let D=o.nodes.shift();o.nodes=[D,{type:"text",value:yv(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===Ev&&d>0&&o.commas===0){let D=o.nodes;if(d===0||D.length===0){m({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){D.pop();let h=D[D.length-1];h.value+=a.value+f,a=h,o.ranges--;continue}m({type:"dot",value:f});continue}m({type:"text",value:f})}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});let D=i[i.length-1],h=D.nodes.indexOf(o);D.nodes.splice(h,1,...o.nodes)}while(i.length>0);return m({type:"eos"}),s};Pl.exports=Fv});var Bl=v((cj,Ll)=>{"use strict";var Nl=$s(),jv=xl(),Iv=Al(),Tv=Ol(),it=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=it.create(n,e);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(it.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};it.parse=(t,e={})=>Tv(t,e);it.stringify=(t,e={})=>Nl(typeof t=="string"?it.parse(t,e):t,e);it.compile=(t,e={})=>(typeof t=="string"&&(t=it.parse(t,e)),jv(t,e));it.expand=(t,e={})=>{typeof t=="string"&&(t=it.parse(t,e));let r=Iv(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};it.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?it.compile(t,e):it.expand(t,e);Ll.exports=it});var Bn=v((lj,Zl)=>{"use strict";var Rv=require("path"),Bt="\\\\/",Ml=`[^${Bt}]`,Pv=0,Kt="\\.",Ov="\\+",Nv="\\?",Fs="\\/",Lv="(?=.)",ql="[^/]",li=`(?:${Fs}|$)`,Wl=`(?:^|${Fs})`,di=`${Kt}{1,2}${li}`,Bv=`(?!${Kt})`,Mv=`(?!${Wl}${di})`,qv=`(?!${Kt}{0,1}${li})`,Wv=`(?!${di})`,Hv=`[^.${Fs}]`,Zv=`${ql}*?`,Hl={DOT_LITERAL:Kt,PLUS_LITERAL:Ov,QMARK_LITERAL:Nv,SLASH_LITERAL:Fs,ONE_CHAR:Lv,QMARK:ql,END_ANCHOR:li,DOTS_SLASH:di,NO_DOT:Bv,NO_DOTS:Mv,NO_DOT_SLASH:qv,NO_DOTS_SLASH:Wv,QMARK_NO_DOT:Hv,STAR:Zv,START_ANCHOR:Wl},Uv={...Hl,SLASH_LITERAL:`[${Bt}]`,QMARK:Ml,STAR:`${Ml}*?`,DOTS_SLASH:`${Kt}{1,2}(?:[${Bt}]|$)`,NO_DOT:`(?!${Kt})`,NO_DOTS:`(?!(?:^|[${Bt}])${Kt}{1,2}(?:[${Bt}]|$))`,NO_DOT_SLASH:`(?!${Kt}{0,1}(?:[${Bt}]|$))`,NO_DOTS_SLASH:`(?!${Kt}{1,2}(?:[${Bt}]|$))`,QMARK_NO_DOT:`[^.${Bt}]`,START_ANCHOR:`(?:^|[${Bt}])`,END_ANCHOR:`(?:[${Bt}]|$)`},Vv={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Zl.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Pv,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Vv,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Rv.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Uv:Hl}}});var Mn=v(Je=>{"use strict";var Gv=require("path"),zv=process.platform==="win32",{REGEX_BACKSLASH:Yv,REGEX_REMOVE_BACKSLASH:Xv,REGEX_SPECIAL_CHARS:Jv,REGEX_SPECIAL_CHARS_GLOBAL:Kv}=Bn();Je.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Je.hasRegexChars=t=>Jv.test(t);Je.isRegexChar=t=>t.length===1&&Je.hasRegexChars(t);Je.escapeRegex=t=>t.replace(Kv,"\\$1");Je.toPosixSlashes=t=>t.replace(Yv,"/");Je.removeBackslashes=t=>t.replace(Xv,e=>e==="\\"?"":e);Je.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Je.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:zv===!0||Gv.sep==="\\";Je.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Je.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Je.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Je.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Kl=v((fj,Jl)=>{"use strict";var Ul=Mn(),{CHAR_ASTERISK:fi,CHAR_AT:Qv,CHAR_BACKWARD_SLASH:qn,CHAR_COMMA:e0,CHAR_DOT:hi,CHAR_EXCLAMATION_MARK:pi,CHAR_FORWARD_SLASH:Xl,CHAR_LEFT_CURLY_BRACE:mi,CHAR_LEFT_PARENTHESES:gi,CHAR_LEFT_SQUARE_BRACKET:t0,CHAR_PLUS:r0,CHAR_QUESTION_MARK:Vl,CHAR_RIGHT_CURLY_BRACE:n0,CHAR_RIGHT_PARENTHESES:Gl,CHAR_RIGHT_SQUARE_BRACKET:s0}=Bn(),zl=t=>t===Xl||t===qn,Yl=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},o0=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],a=[],u=t,c=-1,l=0,d=0,f=!1,g=!1,m=!1,D=!1,h=!1,w=!1,C=!1,A=!1,T=!1,G=!1,I=0,Z,F,W={value:"",depth:0,isGlob:!1},P=()=>c>=n,E=()=>u.charCodeAt(c+1),Q=()=>(Z=F,u.charCodeAt(++c));for(;c<n;){F=Q();let he;if(F===qn){C=W.backslashes=!0,F=Q(),F===mi&&(w=!0);continue}if(w===!0||F===mi){for(I++;P()!==!0&&(F=Q());){if(F===qn){C=W.backslashes=!0,Q();continue}if(F===mi){I++;continue}if(w!==!0&&F===hi&&(F=Q())===hi){if(f=W.isBrace=!0,m=W.isGlob=!0,G=!0,s===!0)continue;break}if(w!==!0&&F===e0){if(f=W.isBrace=!0,m=W.isGlob=!0,G=!0,s===!0)continue;break}if(F===n0&&(I--,I===0)){w=!1,f=W.isBrace=!0,G=!0;break}}if(s===!0)continue;break}if(F===Xl){if(i.push(c),o.push(W),W={value:"",depth:0,isGlob:!1},G===!0)continue;if(Z===hi&&c===l+1){l+=2;continue}d=c+1;continue}if(r.noext!==!0&&(F===r0||F===Qv||F===fi||F===Vl||F===pi)===!0&&E()===gi){if(m=W.isGlob=!0,D=W.isExtglob=!0,G=!0,F===pi&&c===l&&(T=!0),s===!0){for(;P()!==!0&&(F=Q());){if(F===qn){C=W.backslashes=!0,F=Q();continue}if(F===Gl){m=W.isGlob=!0,G=!0;break}}continue}break}if(F===fi){if(Z===fi&&(h=W.isGlobstar=!0),m=W.isGlob=!0,G=!0,s===!0)continue;break}if(F===Vl){if(m=W.isGlob=!0,G=!0,s===!0)continue;break}if(F===t0){for(;P()!==!0&&(he=Q());){if(he===qn){C=W.backslashes=!0,Q();continue}if(he===s0){g=W.isBracket=!0,m=W.isGlob=!0,G=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&F===pi&&c===l){A=W.negated=!0,l++;continue}if(r.noparen!==!0&&F===gi){if(m=W.isGlob=!0,s===!0){for(;P()!==!0&&(F=Q());){if(F===gi){C=W.backslashes=!0,F=Q();continue}if(F===Gl){G=!0;break}}continue}break}if(m===!0){if(G=!0,s===!0)continue;break}}r.noext===!0&&(D=!1,m=!1);let re=u,le="",$="";l>0&&(le=u.slice(0,l),u=u.slice(l),d-=l),re&&m===!0&&d>0?(re=u.slice(0,d),$=u.slice(d)):m===!0?(re="",$=u):re=u,re&&re!==""&&re!=="/"&&re!==u&&zl(re.charCodeAt(re.length-1))&&(re=re.slice(0,-1)),r.unescape===!0&&($&&($=Ul.removeBackslashes($)),re&&C===!0&&(re=Ul.removeBackslashes(re)));let k={prefix:le,input:t,start:l,base:re,glob:$,isBrace:f,isBracket:g,isGlob:m,isExtglob:D,isGlobstar:h,negated:A,negatedExtglob:T};if(r.tokens===!0&&(k.maxDepth=0,zl(F)||o.push(W),k.tokens=o),r.parts===!0||r.tokens===!0){let he;for(let J=0;J<i.length;J++){let xe=he?he+1:l,st=i[J],Fe=t.slice(xe,st);r.tokens&&(J===0&&l!==0?(o[J].isPrefix=!0,o[J].value=le):o[J].value=Fe,Yl(o[J]),k.maxDepth+=o[J].depth),(J!==0||Fe!=="")&&a.push(Fe),he=st}if(he&&he+1<t.length){let J=t.slice(he+1);a.push(J),r.tokens&&(o[o.length-1].value=J,Yl(o[o.length-1]),k.maxDepth+=o[o.length-1].depth)}k.slashes=i,k.parts=a}return k};Jl.exports=o0});var nd=v((hj,rd)=>{"use strict";var Wn=Bn(),Pe=Mn(),{MAX_LENGTH:js,POSIX_REGEX_SOURCE:i0,REGEX_NON_SPECIAL_CHARS:a0,REGEX_SPECIAL_CHARS_BACKREF:u0,REPLACEMENTS:Ql}=Wn,c0=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(s=>Pe.escapeRegex(s)).join("..")}return r},mn=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,ed=t=>{let e=[],r=0,n=0,s=0,i="",o=!1;for(let a of t){if(o===!0){i+=a,o=!1;continue}if(a==="\\"){i+=a,o=!0;continue}if(a==='"'){s=s===1?0:1,i+=a;continue}if(s===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(i),i="";continue}}}i+=a}return e.push(i),e},l0=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},td=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(l0(e))return e.replace(/\\(.)/g,"$1")},d0=t=>{let e=t.map(td).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let s=e[r],i=e[n],o=s[0];if(!(!o||s!==o.repeat(s.length)||i!==o.repeat(i.length))&&(s===i||s.startsWith(i)||i.startsWith(s)))return!0}return!1},Di=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,s=0,i=!1;for(let o=1;o<t.length;o++){let a=t[o];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){s=s===1?0:1;continue}if(s!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==t.length-1?void 0:{type:t[0],body:t.slice(2,o),end:o}}}}},f0=t=>{let e=0,r=[];for(;e<t.length;){let s=Di(t.slice(e),!1);if(!s||s.type!=="*")return;let i=ed(s.body).map(a=>a.trim());if(i.length!==1)return;let o=td(i[0]);if(!o||o.length!==1)return;r.push(o),e+=s.end+1}return r.length<1?void 0:`${r.length===1?Pe.escapeRegex(r[0]):`[${r.map(s=>Pe.escapeRegex(s)).join("")}]`}*`},h0=t=>{let e=0,r=t.trim(),n=Di(r);for(;n;)e++,r=n.body.trim(),n=Di(r);return e},p0=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Wn.DEFAULT_MAX_EXTGLOB_RECURSION,n=ed(t).map(s=>s.trim());if(n.length>1&&(n.some(s=>s==="")||n.some(s=>/^[*?]+$/.test(s))||d0(n)))return{risky:!0};for(let s of n){let i=f0(s);if(i)return{risky:!0,safeOutput:i};if(h0(s)>r)return{risky:!0}}return{risky:!1}},yi=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Ql[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(js,r.maxLength):js,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],a=r.capture?"":"?:",u=Pe.isWindows(e),c=Wn.globChars(u),l=Wn.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:D,NO_DOT:h,NO_DOT_SLASH:w,NO_DOTS_SLASH:C,QMARK:A,QMARK_NO_DOT:T,STAR:G,START_ANCHOR:I}=c,Z=M=>`(${a}(?:(?!${I}${M.dot?D:d}).)*?)`,F=r.dot?"":h,W=r.dot?A:T,P=r.bash===!0?Z(r):G;r.capture&&(P=`(${P})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let E={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=Pe.removePrefix(t,E),s=t.length;let Q=[],re=[],le=[],$=i,k,he=()=>E.index===s-1,J=E.peek=(M=1)=>t[E.index+M],xe=E.advance=()=>t[++E.index]||"",st=()=>t.slice(E.index+1),Fe=(M="",ve=0)=>{E.consumed+=M,E.index+=ve},Ir=M=>{E.output+=M.output!=null?M.output:M.value,Fe(M.value)},_s=()=>{let M=1;for(;J()==="!"&&(J(2)!=="("||J(3)==="?");)xe(),E.start++,M++;return M%2===0?!1:(E.negated=!0,E.start++,!0)},bt=M=>{E[M]++,le.push(M)},Ze=M=>{E[M]--,le.pop()},ce=M=>{if($.type==="globstar"){let ve=E.braces>0&&(M.type==="comma"||M.type==="brace"),B=M.extglob===!0||Q.length&&(M.type==="pipe"||M.type==="paren");M.type!=="slash"&&M.type!=="paren"&&!ve&&!B&&(E.output=E.output.slice(0,-$.output.length),$.type="star",$.value="*",$.output=P,E.output+=$.output)}if(Q.length&&M.type!=="paren"&&(Q[Q.length-1].inner+=M.value),(M.value||M.output)&&Ir(M),$&&$.type==="text"&&M.type==="text"){$.value+=M.value,$.output=($.output||"")+M.value;return}M.prev=$,o.push(M),$=M},Tr=(M,ve)=>{let B={...l[ve],conditions:1,inner:""};B.prev=$,B.parens=E.parens,B.output=E.output,B.startIndex=E.index,B.tokensIndex=o.length;let x=(r.capture?"(":"")+B.open;bt("parens"),ce({type:M,value:ve,output:E.output?"":m}),ce({type:"paren",extglob:!0,value:xe(),output:x}),Q.push(B)},Rr=M=>{let ve=t.slice(M.startIndex,E.index+1),B=t.slice(M.startIndex+2,E.index),x=p0(B,r);if((M.type==="plus"||M.type==="star")&&x.risky){let N=x.safeOutput?(M.output?"":m)+(r.capture?`(${x.safeOutput})`:x.safeOutput):void 0,ee=o[M.tokensIndex];ee.type="text",ee.value=ve,ee.output=N||Pe.escapeRegex(ve);for(let de=M.tokensIndex+1;de<o.length;de++)o[de].value="",o[de].output="",delete o[de].suffix;E.output=M.output+ee.output,E.backtrack=!0,ce({type:"paren",extglob:!0,value:k,output:""}),Ze("parens");return}let j=M.close+(r.capture?")":""),R;if(M.type==="negate"){let N=P;if(M.inner&&M.inner.length>1&&M.inner.includes("/")&&(N=Z(r)),(N!==P||he()||/^\)+$/.test(st()))&&(j=M.close=`)$))${N}`),M.inner.includes("*")&&(R=st())&&/^\.[^\\/.]+$/.test(R)){let ee=yi(R,{...e,fastpaths:!1}).output;j=M.close=`)${ee})${N})`}M.prev.type==="bos"&&(E.negatedExtglob=!0)}ce({type:"paren",extglob:!0,value:k,output:j}),Ze("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let M=!1,ve=t.replace(u0,(B,x,j,R,N,ee)=>R==="\\"?(M=!0,B):R==="?"?x?x+R+(N?A.repeat(N.length):""):ee===0?W+(N?A.repeat(N.length):""):A.repeat(j.length):R==="."?d.repeat(j.length):R==="*"?x?x+R+(N?P:""):P:x?B:`\\${B}`);return M===!0&&(r.unescape===!0?ve=ve.replace(/\\/g,""):ve=ve.replace(/\\+/g,B=>B.length%2===0?"\\\\":B?"\\":"")),ve===t&&r.contains===!0?(E.output=t,E):(E.output=Pe.wrapOutput(ve,E,e),E)}for(;!he();){if(k=xe(),k==="\0")continue;if(k==="\\"){let B=J();if(B==="/"&&r.bash!==!0||B==="."||B===";")continue;if(!B){k+="\\",ce({type:"text",value:k});continue}let x=/^\\+/.exec(st()),j=0;if(x&&x[0].length>2&&(j=x[0].length,E.index+=j,j%2!==0&&(k+="\\")),r.unescape===!0?k=xe():k+=xe(),E.brackets===0){ce({type:"text",value:k});continue}}if(E.brackets>0&&(k!=="]"||$.value==="["||$.value==="[^")){if(r.posix!==!1&&k===":"){let B=$.value.slice(1);if(B.includes("[")&&($.posix=!0,B.includes(":"))){let x=$.value.lastIndexOf("["),j=$.value.slice(0,x),R=$.value.slice(x+2),N=i0[R];if(N){$.value=j+N,E.backtrack=!0,xe(),!i.output&&o.indexOf($)===1&&(i.output=m);continue}}}(k==="["&&J()!==":"||k==="-"&&J()==="]")&&(k=`\\${k}`),k==="]"&&($.value==="["||$.value==="[^")&&(k=`\\${k}`),r.posix===!0&&k==="!"&&$.value==="["&&(k="^"),$.value+=k,Ir({value:k});continue}if(E.quotes===1&&k!=='"'){k=Pe.escapeRegex(k),$.value+=k,Ir({value:k});continue}if(k==='"'){E.quotes=E.quotes===1?0:1,r.keepQuotes===!0&&ce({type:"text",value:k});continue}if(k==="("){bt("parens"),ce({type:"paren",value:k});continue}if(k===")"){if(E.parens===0&&r.strictBrackets===!0)throw new SyntaxError(mn("opening","("));let B=Q[Q.length-1];if(B&&E.parens===B.parens+1){Rr(Q.pop());continue}ce({type:"paren",value:k,output:E.parens?")":"\\)"}),Ze("parens");continue}if(k==="["){if(r.nobracket===!0||!st().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(mn("closing","]"));k=`\\${k}`}else bt("brackets");ce({type:"bracket",value:k});continue}if(k==="]"){if(r.nobracket===!0||$&&$.type==="bracket"&&$.value.length===1){ce({type:"text",value:k,output:`\\${k}`});continue}if(E.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(mn("opening","["));ce({type:"text",value:k,output:`\\${k}`});continue}Ze("brackets");let B=$.value.slice(1);if($.posix!==!0&&B[0]==="^"&&!B.includes("/")&&(k=`/${k}`),$.value+=k,Ir({value:k}),r.literalBrackets===!1||Pe.hasRegexChars(B))continue;let x=Pe.escapeRegex($.value);if(E.output=E.output.slice(0,-$.value.length),r.literalBrackets===!0){E.output+=x,$.value=x;continue}$.value=`(${a}${x}|${$.value})`,E.output+=$.value;continue}if(k==="{"&&r.nobrace!==!0){bt("braces");let B={type:"brace",value:k,output:"(",outputIndex:E.output.length,tokensIndex:E.tokens.length};re.push(B),ce(B);continue}if(k==="}"){let B=re[re.length-1];if(r.nobrace===!0||!B){ce({type:"text",value:k,output:k});continue}let x=")";if(B.dots===!0){let j=o.slice(),R=[];for(let N=j.length-1;N>=0&&(o.pop(),j[N].type!=="brace");N--)j[N].type!=="dots"&&R.unshift(j[N].value);x=c0(R,r),E.backtrack=!0}if(B.comma!==!0&&B.dots!==!0){let j=E.output.slice(0,B.outputIndex),R=E.tokens.slice(B.tokensIndex);B.value=B.output="\\{",k=x="\\}",E.output=j;for(let N of R)E.output+=N.output||N.value}ce({type:"brace",value:k,output:x}),Ze("braces"),re.pop();continue}if(k==="|"){Q.length>0&&Q[Q.length-1].conditions++,ce({type:"text",value:k});continue}if(k===","){let B=k,x=re[re.length-1];x&&le[le.length-1]==="braces"&&(x.comma=!0,B="|"),ce({type:"comma",value:k,output:B});continue}if(k==="/"){if($.type==="dot"&&E.index===E.start+1){E.start=E.index+1,E.consumed="",E.output="",o.pop(),$=i;continue}ce({type:"slash",value:k,output:g});continue}if(k==="."){if(E.braces>0&&$.type==="dot"){$.value==="."&&($.output=d);let B=re[re.length-1];$.type="dots",$.output+=k,$.value+=k,B.dots=!0;continue}if(E.braces+E.parens===0&&$.type!=="bos"&&$.type!=="slash"){ce({type:"text",value:k,output:d});continue}ce({type:"dot",value:k,output:d});continue}if(k==="?"){if(!($&&$.value==="(")&&r.noextglob!==!0&&J()==="("&&J(2)!=="?"){Tr("qmark",k);continue}if($&&$.type==="paren"){let x=J(),j=k;if(x==="<"&&!Pe.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");($.value==="("&&!/[!=<:]/.test(x)||x==="<"&&!/<([!=]|\w+>)/.test(st()))&&(j=`\\${k}`),ce({type:"text",value:k,output:j});continue}if(r.dot!==!0&&($.type==="slash"||$.type==="bos")){ce({type:"qmark",value:k,output:T});continue}ce({type:"qmark",value:k,output:A});continue}if(k==="!"){if(r.noextglob!==!0&&J()==="("&&(J(2)!=="?"||!/[!=<:]/.test(J(3)))){Tr("negate",k);continue}if(r.nonegate!==!0&&E.index===0){_s();continue}}if(k==="+"){if(r.noextglob!==!0&&J()==="("&&J(2)!=="?"){Tr("plus",k);continue}if($&&$.value==="("||r.regex===!1){ce({type:"plus",value:k,output:f});continue}if($&&($.type==="bracket"||$.type==="paren"||$.type==="brace")||E.parens>0){ce({type:"plus",value:k});continue}ce({type:"plus",value:f});continue}if(k==="@"){if(r.noextglob!==!0&&J()==="("&&J(2)!=="?"){ce({type:"at",extglob:!0,value:k,output:""});continue}ce({type:"text",value:k});continue}if(k!=="*"){(k==="$"||k==="^")&&(k=`\\${k}`);let B=a0.exec(st());B&&(k+=B[0],E.index+=B[0].length),ce({type:"text",value:k});continue}if($&&($.type==="globstar"||$.star===!0)){$.type="star",$.star=!0,$.value+=k,$.output=P,E.backtrack=!0,E.globstar=!0,Fe(k);continue}let M=st();if(r.noextglob!==!0&&/^\([^?]/.test(M)){Tr("star",k);continue}if($.type==="star"){if(r.noglobstar===!0){Fe(k);continue}let B=$.prev,x=B.prev,j=B.type==="slash"||B.type==="bos",R=x&&(x.type==="star"||x.type==="globstar");if(r.bash===!0&&(!j||M[0]&&M[0]!=="/")){ce({type:"star",value:k,output:""});continue}let N=E.braces>0&&(B.type==="comma"||B.type==="brace"),ee=Q.length&&(B.type==="pipe"||B.type==="paren");if(!j&&B.type!=="paren"&&!N&&!ee){ce({type:"star",value:k,output:""});continue}for(;M.slice(0,3)==="/**";){let de=t[E.index+4];if(de&&de!=="/")break;M=M.slice(3),Fe("/**",3)}if(B.type==="bos"&&he()){$.type="globstar",$.value+=k,$.output=Z(r),E.output=$.output,E.globstar=!0,Fe(k);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&!R&&he()){E.output=E.output.slice(0,-(B.output+$.output).length),B.output=`(?:${B.output}`,$.type="globstar",$.output=Z(r)+(r.strictSlashes?")":"|$)"),$.value+=k,E.globstar=!0,E.output+=B.output+$.output,Fe(k);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&M[0]==="/"){let de=M[1]!==void 0?"|$":"";E.output=E.output.slice(0,-(B.output+$.output).length),B.output=`(?:${B.output}`,$.type="globstar",$.output=`${Z(r)}${g}|${g}${de})`,$.value+=k,E.output+=B.output+$.output,E.globstar=!0,Fe(k+xe()),ce({type:"slash",value:"/",output:""});continue}if(B.type==="bos"&&M[0]==="/"){$.type="globstar",$.value+=k,$.output=`(?:^|${g}|${Z(r)}${g})`,E.output=$.output,E.globstar=!0,Fe(k+xe()),ce({type:"slash",value:"/",output:""});continue}E.output=E.output.slice(0,-$.output.length),$.type="globstar",$.output=Z(r),$.value+=k,E.output+=$.output,E.globstar=!0,Fe(k);continue}let ve={type:"star",value:k,output:P};if(r.bash===!0){ve.output=".*?",($.type==="bos"||$.type==="slash")&&(ve.output=F+ve.output),ce(ve);continue}if($&&($.type==="bracket"||$.type==="paren")&&r.regex===!0){ve.output=k,ce(ve);continue}(E.index===E.start||$.type==="slash"||$.type==="dot")&&($.type==="dot"?(E.output+=w,$.output+=w):r.dot===!0?(E.output+=C,$.output+=C):(E.output+=F,$.output+=F),J()!=="*"&&(E.output+=m,$.output+=m)),ce(ve)}for(;E.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(mn("closing","]"));E.output=Pe.escapeLast(E.output,"["),Ze("brackets")}for(;E.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(mn("closing",")"));E.output=Pe.escapeLast(E.output,"("),Ze("parens")}for(;E.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(mn("closing","}"));E.output=Pe.escapeLast(E.output,"{"),Ze("braces")}if(r.strictSlashes!==!0&&($.type==="star"||$.type==="bracket")&&ce({type:"maybe_slash",value:"",output:`${g}?`}),E.backtrack===!0){E.output="";for(let M of E.tokens)E.output+=M.output!=null?M.output:M.value,M.suffix&&(E.output+=M.suffix)}return E};yi.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(js,r.maxLength):js,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=Ql[t]||t;let i=Pe.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:g,START_ANCHOR:m}=Wn.globChars(i),D=r.dot?d:l,h=r.dot?f:l,w=r.capture?"":"?:",C={negated:!1,prefix:""},A=r.bash===!0?".*?":g;r.capture&&(A=`(${A})`);let T=F=>F.noglobstar===!0?A:`(${w}(?:(?!${m}${F.dot?c:o}).)*?)`,G=F=>{switch(F){case"*":return`${D}${u}${A}`;case".*":return`${o}${u}${A}`;case"*.*":return`${D}${A}${o}${u}${A}`;case"*/*":return`${D}${A}${a}${u}${h}${A}`;case"**":return D+T(r);case"**/*":return`(?:${D}${T(r)}${a})?${h}${u}${A}`;case"**/*.*":return`(?:${D}${T(r)}${a})?${h}${A}${o}${u}${A}`;case"**/.*":return`(?:${D}${T(r)}${a})?${o}${u}${A}`;default:{let W=/^(.*?)\.(\w+)$/.exec(F);if(!W)return;let P=G(W[1]);return P?P+o+W[2]:void 0}}},I=Pe.removePrefix(t,C),Z=G(I);return Z&&r.strictSlashes!==!0&&(Z+=`${a}?`),Z};rd.exports=yi});var od=v((pj,sd)=>{"use strict";var m0=require("path"),g0=Kl(),vi=nd(),_i=Mn(),D0=Bn(),y0=t=>t&&typeof t=="object"&&!Array.isArray(t),ke=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(f=>ke(f,e,r));return f=>{for(let g of l){let m=g(f);if(m)return m}return!1}}let n=y0(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=_i.isWindows(e),o=n?ke.compileRe(t,e):ke.makeRe(t,e,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(s.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=ke(s.ignore,l,r)}let c=(l,d=!1)=>{let{isMatch:f,match:g,output:m}=ke.test(l,o,e,{glob:t,posix:i}),D={glob:t,state:a,regex:o,posix:i,input:l,output:m,match:g,isMatch:f};return typeof s.onResult=="function"&&s.onResult(D),f===!1?(D.isMatch=!1,d?D:!1):u(l)?(typeof s.onIgnore=="function"&&s.onIgnore(D),D.isMatch=!1,d?D:!1):(typeof s.onMatch=="function"&&s.onMatch(D),d?D:!0)};return r&&(c.state=a),c};ke.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let i=r||{},o=i.format||(s?_i.toPosixSlashes:null),a=t===n,u=a&&o?o(t):t;return a===!1&&(u=o?o(t):t,a=u===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=ke.matchBase(t,e,r,s):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};ke.matchBase=(t,e,r,n=_i.isWindows(r))=>(e instanceof RegExp?e:ke.makeRe(e,r)).test(m0.basename(t));ke.isMatch=(t,e,r)=>ke(e,r)(t);ke.parse=(t,e)=>Array.isArray(t)?t.map(r=>ke.parse(r,e)):vi(t,{...e,fastpaths:!1});ke.scan=(t,e)=>g0(t,e);ke.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",a=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let u=ke.toRegex(a,e);return n===!0&&(u.state=t),u};ke.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=vi.fastpaths(t,e)),s.output||(s=vi(t,e)),ke.compileRe(s,e,r,n)};ke.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};ke.constants=D0;sd.exports=ke});var ad=v((mj,id)=>{"use strict";id.exports=od()});var hd=v((gj,fd)=>{"use strict";var cd=require("util"),ld=Bl(),Mt=ad(),Ei=Mn(),ud=t=>t===""||t==="./",dd=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Se=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,s=new Set,i=new Set,o=0,a=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let d=Mt(String(e[l]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&o++;for(let g of t){let m=d(g,!0);(f?!m.isMatch:m.isMatch)&&(f?n.add(m.output):(n.delete(m.output),s.add(m.output)))}}let c=(o===e.length?[...i]:[...s]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return c};Se.match=Se;Se.matcher=(t,e)=>Mt(t,e);Se.isMatch=(t,e,r)=>Mt(e,r)(t);Se.any=Se.isMatch;Se.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,s=[],i=a=>{r.onResult&&r.onResult(a),s.push(a.output)},o=new Set(Se(t,e,{...r,onResult:i}));for(let a of s)o.has(a)||n.add(a);return[...n]};Se.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${cd.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Se.contains(t,n,r));if(typeof e=="string"){if(ud(t)||ud(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Se.isMatch(t,e,{...r,contains:!0})};Se.matchKeys=(t,e,r)=>{if(!Ei.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Se(Object.keys(t),e,r),s={};for(let i of n)s[i]=t[i];return s};Se.some=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Mt(String(s),r);if(n.some(o=>i(o)))return!0}return!1};Se.every=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Mt(String(s),r);if(!n.every(o=>i(o)))return!1}return!0};Se.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${cd.inspect(t)}"`);return[].concat(e).every(n=>Mt(n,r)(t))};Se.capture=(t,e,r)=>{let n=Ei.isWindows(r),i=Mt.makeRe(String(t),{...r,capture:!0}).exec(n?Ei.toPosixSlashes(e):e);if(i)return i.slice(1).map(o=>o===void 0?"":o)};Se.makeRe=(...t)=>Mt.makeRe(...t);Se.scan=(...t)=>Mt.scan(...t);Se.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let s of ld(String(n),e))r.push(Mt.parse(s,e));return r};Se.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!dd(t)?[t]:ld(t,e)};Se.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Se.braces(t,{...e,expand:!0})};Se.hasBraces=dd;fd.exports=Se});var Sd=v(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.isAbsolute=ne.partitionAbsoluteAndRelative=ne.removeDuplicateSlashes=ne.matchAny=ne.convertPatternsToRe=ne.makeRe=ne.getPatternParts=ne.expandBraceExpansion=ne.expandPatternsWithBraceExpansion=ne.isAffectDepthOfReadingPattern=ne.endsWithSlashGlobStar=ne.hasGlobStar=ne.getBaseDirectory=ne.isPatternRelatedToParentDirectory=ne.getPatternsOutsideCurrentDirectory=ne.getPatternsInsideCurrentDirectory=ne.getPositivePatterns=ne.getNegativePatterns=ne.isPositivePattern=ne.isNegativePattern=ne.convertToNegativePattern=ne.convertToPositivePattern=ne.isDynamicPattern=ne.isStaticPattern=void 0;var pd=require("path"),v0=nl(),bi=hd(),md="**",_0="\\",E0=/[*?]|^!/,b0=/\[[^[]*]/,S0=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,C0=/[!*+?@]\([^(]*\)/,w0=/,|\.\./,x0=/(?!^)\/{2,}/g;function gd(t,e={}){return!Dd(t,e)}ne.isStaticPattern=gd;function Dd(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(_0)||E0.test(t)||b0.test(t)||S0.test(t)||e.extglob!==!1&&C0.test(t)||e.braceExpansion!==!1&&$0(t))}ne.isDynamicPattern=Dd;function $0(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return w0.test(n)}function k0(t){return Is(t)?t.slice(1):t}ne.convertToPositivePattern=k0;function A0(t){return"!"+t}ne.convertToNegativePattern=A0;function Is(t){return t.startsWith("!")&&t[1]!=="("}ne.isNegativePattern=Is;function yd(t){return!Is(t)}ne.isPositivePattern=yd;function F0(t){return t.filter(Is)}ne.getNegativePatterns=F0;function j0(t){return t.filter(yd)}ne.getPositivePatterns=j0;function I0(t){return t.filter(e=>!Si(e))}ne.getPatternsInsideCurrentDirectory=I0;function T0(t){return t.filter(Si)}ne.getPatternsOutsideCurrentDirectory=T0;function Si(t){return t.startsWith("..")||t.startsWith("./..")}ne.isPatternRelatedToParentDirectory=Si;function R0(t){return v0(t,{flipBackslashes:!1})}ne.getBaseDirectory=R0;function P0(t){return t.includes(md)}ne.hasGlobStar=P0;function vd(t){return t.endsWith("/"+md)}ne.endsWithSlashGlobStar=vd;function O0(t){let e=pd.basename(t);return vd(t)||gd(e)}ne.isAffectDepthOfReadingPattern=O0;function N0(t){return t.reduce((e,r)=>e.concat(_d(r)),[])}ne.expandPatternsWithBraceExpansion=N0;function _d(t){let e=bi.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}ne.expandBraceExpansion=_d;function L0(t,e){let{parts:r}=bi.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}ne.getPatternParts=L0;function Ed(t,e){return bi.makeRe(t,e)}ne.makeRe=Ed;function B0(t,e){return t.map(r=>Ed(r,e))}ne.convertPatternsToRe=B0;function M0(t,e){return e.some(r=>r.test(t))}ne.matchAny=M0;function q0(t){return t.replace(x0,"/")}ne.removeDuplicateSlashes=q0;function W0(t){let e=[],r=[];for(let n of t)bd(n)?e.push(n):r.push(n);return[e,r]}ne.partitionAbsoluteAndRelative=W0;function bd(t){return pd.isAbsolute(t)}ne.isAbsolute=bd});var $d=v((yj,xd)=>{"use strict";var H0=require("stream"),Cd=H0.PassThrough,Z0=Array.prototype.slice;xd.exports=U0;function U0(){let t=[],e=Z0.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let s=n.end!==!1,i=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let o=Cd(n);function a(){for(let l=0,d=arguments.length;l<d;l++)t.push(wd(arguments[l],n));return u(),this}function u(){if(r)return;r=!0;let l=t.shift();if(!l){process.nextTick(c);return}Array.isArray(l)||(l=[l]);let d=l.length+1;function f(){--d>0||(r=!1,u())}function g(m){function D(){m.removeListener("merge2UnpipeEnd",D),m.removeListener("end",D),i&&m.removeListener("error",h),f()}function h(w){o.emit("error",w)}if(m._readableState.endEmitted)return f();m.on("merge2UnpipeEnd",D),m.on("end",D),i&&m.on("error",h),m.pipe(o,{end:!1}),m.resume()}for(let m=0;m<l.length;m++)g(l[m]);f()}function c(){r=!1,o.emit("queueDrain"),s&&o.end()}return o.setMaxListeners(0),o.add=a,o.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),o}function wd(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=wd(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(Cd(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var Ad=v(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.merge=void 0;var V0=$d();function G0(t){let e=V0(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>kd(t)),e.once("end",()=>kd(t)),e}Ts.merge=G0;function kd(t){t.forEach(e=>e.emit("close"))}});var Fd=v(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.isEmpty=gn.isString=void 0;function z0(t){return typeof t=="string"}gn.isString=z0;function Y0(t){return t===""}gn.isEmpty=Y0});var Qt=v(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.string=Oe.stream=Oe.pattern=Oe.path=Oe.fs=Oe.errno=Oe.array=void 0;var X0=Zc();Oe.array=X0;var J0=Uc();Oe.errno=J0;var K0=Vc();Oe.fs=K0;var Q0=Xc();Oe.path=Q0;var e_=Sd();Oe.pattern=e_;var t_=Ad();Oe.stream=t_;var r_=Fd();Oe.string=r_});var Rd=v(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.convertPatternGroupToTask=Ne.convertPatternGroupsToTasks=Ne.groupPatternsByBaseDirectory=Ne.getNegativePatternsAsPositive=Ne.getPositivePatterns=Ne.convertPatternsToTasks=Ne.generate=void 0;var Ct=Qt();function n_(t,e){let r=jd(t,e),n=jd(e.ignore,e),s=Id(r),i=Td(r,n),o=s.filter(l=>Ct.pattern.isStaticPattern(l,e)),a=s.filter(l=>Ct.pattern.isDynamicPattern(l,e)),u=Ci(o,i,!1),c=Ci(a,i,!0);return u.concat(c)}Ne.generate=n_;function jd(t,e){let r=t;return e.braceExpansion&&(r=Ct.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Ct.pattern.removeDuplicateSlashes(n))}function Ci(t,e,r){let n=[],s=Ct.pattern.getPatternsOutsideCurrentDirectory(t),i=Ct.pattern.getPatternsInsideCurrentDirectory(t),o=wi(s),a=wi(i);return n.push(...xi(o,e,r)),"."in a?n.push($i(".",i,e,r)):n.push(...xi(a,e,r)),n}Ne.convertPatternsToTasks=Ci;function Id(t){return Ct.pattern.getPositivePatterns(t)}Ne.getPositivePatterns=Id;function Td(t,e){return Ct.pattern.getNegativePatterns(t).concat(e).map(Ct.pattern.convertToPositivePattern)}Ne.getNegativePatternsAsPositive=Td;function wi(t){let e={};return t.reduce((r,n)=>{let s=Ct.pattern.getBaseDirectory(n);return s in r?r[s].push(n):r[s]=[n],r},e)}Ne.groupPatternsByBaseDirectory=wi;function xi(t,e,r){return Object.keys(t).map(n=>$i(n,t[n],e,r))}Ne.convertPatternGroupsToTasks=xi;function $i(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Ct.pattern.convertToNegativePattern))}}Ne.convertPatternGroupToTask=$i});var Od=v(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.read=void 0;function s_(t,e,r){e.fs.lstat(t,(n,s)=>{if(n!==null){Pd(r,n);return}if(!s.isSymbolicLink()||!e.followSymbolicLink){ki(r,s);return}e.fs.stat(t,(i,o)=>{if(i!==null){if(e.throwErrorOnBrokenSymbolicLink){Pd(r,i);return}ki(r,s);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),ki(r,o)})})}Rs.read=s_;function Pd(t,e){t(e)}function ki(t,e){t(null,e)}});var Nd=v(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.read=void 0;function o_(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}Ps.read=o_});var Ld=v(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.createFileSystemAdapter=fr.FILE_SYSTEM_ADAPTER=void 0;var Os=require("fs");fr.FILE_SYSTEM_ADAPTER={lstat:Os.lstat,stat:Os.stat,lstatSync:Os.lstatSync,statSync:Os.statSync};function i_(t){return t===void 0?fr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},fr.FILE_SYSTEM_ADAPTER),t)}fr.createFileSystemAdapter=i_});var Bd=v(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var a_=Ld(),Ai=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=a_.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};Fi.default=Ai});var Nr=v(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.statSync=hr.stat=hr.Settings=void 0;var Md=Od(),u_=Nd(),ji=Bd();hr.Settings=ji.default;function c_(t,e,r){if(typeof e=="function"){Md.read(t,Ii(),e);return}Md.read(t,Ii(e),r)}hr.stat=c_;function l_(t,e){let r=Ii(e);return u_.read(t,r)}hr.statSync=l_;function Ii(t={}){return t instanceof ji.default?t:new ji.default(t)}});var Hd=v((kj,Wd)=>{var qd;Wd.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(qd||(qd=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Ud=v((Aj,Zd)=>{Zd.exports=f_;var d_=Hd();function f_(t,e){let r,n,s,i=!0;Array.isArray(t)?(r=[],n=t.length):(s=Object.keys(t),r={},n=s.length);function o(u){function c(){e&&e(u,r),e=null}i?d_(c):c()}function a(u,c,l){r[u]=l,(--n===0||c)&&o(c)}n?s?s.forEach(function(u){t[u](function(c,l){a(u,c,l)})}):t.forEach(function(u,c){u(function(l,d){a(c,l,d)})}):o(null),i=!1}});var Ti=v(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var Ns=process.versions.node.split(".");if(Ns[0]===void 0||Ns[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Vd=Number.parseInt(Ns[0],10),h_=Number.parseInt(Ns[1],10),Gd=10,p_=10,m_=Vd>Gd,g_=Vd===Gd&&h_>=p_;Ls.IS_SUPPORT_READDIR_WITH_FILE_TYPES=m_||g_});var zd=v(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.createDirentFromStats=void 0;var Ri=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function D_(t,e){return new Ri(t,e)}Bs.createDirentFromStats=D_});var Pi=v(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.fs=void 0;var y_=zd();Ms.fs=y_});var Oi=v(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.joinPathSegments=void 0;function v_(t,e,r){return t.endsWith(r)?t+e:t+r+e}qs.joinPathSegments=v_});var ef=v(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.readdir=pr.readdirWithFileTypes=pr.read=void 0;var __=Nr(),Yd=Ud(),E_=Ti(),Xd=Pi(),Jd=Oi();function b_(t,e,r){if(!e.stats&&E_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Kd(t,e,r);return}Qd(t,e,r)}pr.read=b_;function Kd(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,s)=>{if(n!==null){Ws(r,n);return}let i=s.map(a=>({dirent:a,name:a.name,path:Jd.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){Ni(r,i);return}let o=i.map(a=>S_(a,e));Yd(o,(a,u)=>{if(a!==null){Ws(r,a);return}Ni(r,u)})})}pr.readdirWithFileTypes=Kd;function S_(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,s)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=Xd.fs.createDirentFromStats(t.name,s),r(null,t)})}}function Qd(t,e,r){e.fs.readdir(t,(n,s)=>{if(n!==null){Ws(r,n);return}let i=s.map(o=>{let a=Jd.joinPathSegments(t,o,e.pathSegmentSeparator);return u=>{__.stat(a,e.fsStatSettings,(c,l)=>{if(c!==null){u(c);return}let d={name:o,path:a,dirent:Xd.fs.createDirentFromStats(o,l)};e.stats&&(d.stats=l),u(null,d)})}});Yd(i,(o,a)=>{if(o!==null){Ws(r,o);return}Ni(r,a)})})}pr.readdir=Qd;function Ws(t,e){t(e)}function Ni(t,e){t(null,e)}});var of=v(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.readdir=mr.readdirWithFileTypes=mr.read=void 0;var C_=Nr(),w_=Ti(),tf=Pi(),rf=Oi();function x_(t,e){return!e.stats&&w_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?nf(t,e):sf(t,e)}mr.read=x_;function nf(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let s={dirent:n,name:n.name,path:rf.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let i=e.fs.statSync(s.path);s.dirent=tf.fs.createDirentFromStats(s.name,i)}catch(i){if(e.throwErrorOnBrokenSymbolicLink)throw i}return s})}mr.readdirWithFileTypes=nf;function sf(t,e){return e.fs.readdirSync(t).map(n=>{let s=rf.joinPathSegments(t,n,e.pathSegmentSeparator),i=C_.statSync(s,e.fsStatSettings),o={name:n,path:s,dirent:tf.fs.createDirentFromStats(n,i)};return e.stats&&(o.stats=i),o})}mr.readdir=sf});var af=v(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.createFileSystemAdapter=gr.FILE_SYSTEM_ADAPTER=void 0;var Dn=require("fs");gr.FILE_SYSTEM_ADAPTER={lstat:Dn.lstat,stat:Dn.stat,lstatSync:Dn.lstatSync,statSync:Dn.statSync,readdir:Dn.readdir,readdirSync:Dn.readdirSync};function $_(t){return t===void 0?gr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},gr.FILE_SYSTEM_ADAPTER),t)}gr.createFileSystemAdapter=$_});var uf=v(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});var k_=require("path"),A_=Nr(),F_=af(),Li=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=F_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,k_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new A_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};Bi.default=Li});var Hs=v(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.Settings=Dr.scandirSync=Dr.scandir=void 0;var cf=ef(),j_=of(),Mi=uf();Dr.Settings=Mi.default;function I_(t,e,r){if(typeof e=="function"){cf.read(t,qi(),e);return}cf.read(t,qi(e),r)}Dr.scandir=I_;function T_(t,e){let r=qi(e);return j_.read(t,r)}Dr.scandirSync=T_;function qi(t={}){return t instanceof Mi.default?t:new Mi.default(t)}});var df=v((Bj,lf)=>{"use strict";function R_(t){var e=new t,r=e;function n(){var i=e;return i.next?e=i.next:(e=new t,r=e),i.next=null,i}function s(i){r.next=i,r=i}return{get:n,release:s}}lf.exports=R_});var hf=v((Mj,Wi)=>{"use strict";var P_=df();function ff(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=P_(O_),s=null,i=null,o=0,a=null,u={push:D,drain:Ke,saturated:Ke,pause:l,paused:!1,get concurrency(){return r},set concurrency(I){if(!(I>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=I,!u.paused)for(;s&&o<r;)o++,w()},running:c,resume:g,idle:m,length:d,getQueue:f,unshift:h,empty:Ke,kill:C,killAndDrain:A,error:G,abort:T};return u;function c(){return o}function l(){u.paused=!0}function d(){for(var I=s,Z=0;I;)I=I.next,Z++;return Z}function f(){for(var I=s,Z=[];I;)Z.push(I.value),I=I.next;return Z}function g(){if(u.paused){if(u.paused=!1,s===null){o++,w();return}for(;s&&o<r;)o++,w()}}function m(){return o===0&&u.length()===0}function D(I,Z){var F=n.get();F.context=t,F.release=w,F.value=I,F.callback=Z||Ke,F.errorHandler=a,o>=r||u.paused?i?(i.next=F,i=F):(s=F,i=F,u.saturated()):(o++,e.call(t,F.value,F.worked))}function h(I,Z){var F=n.get();F.context=t,F.release=w,F.value=I,F.callback=Z||Ke,F.errorHandler=a,o>=r||u.paused?s?(F.next=s,s=F):(s=F,i=F,u.saturated()):(o++,e.call(t,F.value,F.worked))}function w(I){I&&n.release(I);var Z=s;Z&&o<=r?u.paused?o--:(i===s&&(i=null),s=Z.next,Z.next=null,e.call(t,Z.value,Z.worked),i===null&&u.empty()):--o===0&&u.drain()}function C(){s=null,i=null,u.drain=Ke}function A(){s=null,i=null,u.drain(),u.drain=Ke}function T(){var I=s;for(s=null,i=null;I;){var Z=I.next,F=I.callback,W=I.errorHandler,P=I.value,E=I.context;I.value=null,I.callback=Ke,I.errorHandler=null,W&&W(new Error("abort"),P),F.call(E,new Error("abort")),I.release(I),I=Z}u.drain=Ke}function G(I){a=I}}function Ke(){}function O_(){this.value=null,this.callback=Ke,this.next=null,this.release=Ke,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var s=t.callback,i=t.errorHandler,o=t.value;t.value=null,t.callback=Ke,t.errorHandler&&i(r,o),s.call(t.context,r,n),t.release(t)}}function N_(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(l,d){e.call(this,l).then(function(f){d(null,f)},d)}var s=ff(t,n,r),i=s.push,o=s.unshift;return s.push=a,s.unshift=u,s.drained=c,s;function a(l){var d=new Promise(function(f,g){i(l,function(m,D){if(m){g(m);return}f(D)})});return d.catch(Ke),d}function u(l){var d=new Promise(function(f,g){o(l,function(m,D){if(m){g(m);return}f(D)})});return d.catch(Ke),d}function c(){var l=new Promise(function(d){process.nextTick(function(){if(s.idle())d();else{var f=s.drain;s.drain=function(){typeof f=="function"&&f(),d(),s.drain=f}}})});return l}}Wi.exports=ff;Wi.exports.promise=N_});var Zs=v(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.joinPathSegments=qt.replacePathSegmentSeparator=qt.isAppliedFilter=qt.isFatalError=void 0;function L_(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}qt.isFatalError=L_;function B_(t,e){return t===null||t(e)}qt.isAppliedFilter=B_;function M_(t,e){return t.split(/[/\\]/).join(e)}qt.replacePathSegmentSeparator=M_;function q_(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}qt.joinPathSegments=q_});var Ui=v(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var W_=Zs(),Hi=class{constructor(e,r){this._root=e,this._settings=r,this._root=W_.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};Zi.default=Hi});var zi=v(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var H_=require("events"),Z_=Hs(),U_=hf(),Us=Zs(),V_=Ui(),Vi=class extends V_.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=Z_.scandir,this._emitter=new H_.EventEmitter,this._queue=U_(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,s=>{s!==null&&this._handleError(s)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,s)=>{if(n!==null){r(n,void 0);return}for(let i of s)this._handleEntry(i,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!Us.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=Us.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Us.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&Us.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};Gi.default=Vi});var pf=v(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var G_=zi(),Yi=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new G_.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{z_(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{Y_(e,this._storage)}),this._reader.read()}};Xi.default=Yi;function z_(t,e){t(e)}function Y_(t,e){t(null,e)}});var mf=v(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});var X_=require("stream"),J_=zi(),Ji=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new J_.default(this._root,this._settings),this._stream=new X_.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};Ki.default=Ji});var gf=v(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var K_=Hs(),Vs=Zs(),Q_=Ui(),Qi=class extends Q_.default{constructor(){super(...arguments),this._scandir=K_.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let s of n)this._handleEntry(s,r)}catch(n){this._handleError(n)}}_handleError(e){if(Vs.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=Vs.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Vs.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&Vs.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};ea.default=Qi});var Df=v(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var eE=gf(),ta=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new eE.default(this._root,this._settings)}read(){return this._reader.read()}};ra.default=ta});var yf=v(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});var tE=require("path"),rE=Hs(),na=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,tE.sep),this.fsScandirSettings=new rE.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};sa.default=na});var zs=v(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.Settings=Wt.walkStream=Wt.walkSync=Wt.walk=void 0;var vf=pf(),nE=mf(),sE=Df(),oa=yf();Wt.Settings=oa.default;function oE(t,e,r){if(typeof e=="function"){new vf.default(t,Gs()).read(e);return}new vf.default(t,Gs(e)).read(r)}Wt.walk=oE;function iE(t,e){let r=Gs(e);return new sE.default(t,r).read()}Wt.walkSync=iE;function aE(t,e){let r=Gs(e);return new nE.default(t,r).read()}Wt.walkStream=aE;function Gs(t={}){return t instanceof oa.default?t:new oa.default(t)}});var Ys=v(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var uE=require("path"),cE=Nr(),_f=Qt(),ia=class{constructor(e){this._settings=e,this._fsStatSettings=new cE.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return uE.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:_f.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!_f.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};aa.default=ia});var la=v(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var lE=require("stream"),dE=Nr(),fE=zs(),hE=Ys(),ua=class extends hE.default{constructor(){super(...arguments),this._walkStream=fE.walkStream,this._stat=dE.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),s=new lE.PassThrough({objectMode:!0});s._write=(i,o,a)=>this._getEntry(n[i],e[i],r).then(u=>{u!==null&&r.entryFilter(u)&&s.push(u),i===n.length-1&&s.end(),a()}).catch(a);for(let i=0;i<n.length;i++)s.write(i);return s}_getEntry(e,r,n){return this._getStat(e).then(s=>this._makeEntry(s,r)).catch(s=>{if(n.errorFilter(s))return null;throw s})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(s,i)=>s===null?r(i):n(s))})}};ca.default=ua});var Ef=v(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var pE=zs(),mE=Ys(),gE=la(),da=class extends mE.default{constructor(){super(...arguments),this._walkAsync=pE.walk,this._readerStream=new gE.default(this._settings)}dynamic(e,r){return new Promise((n,s)=>{this._walkAsync(e,r,(i,o)=>{i===null?n(o):s(i)})})}async static(e,r){let n=[],s=this._readerStream.static(e,r);return new Promise((i,o)=>{s.once("error",o),s.on("data",a=>n.push(a)),s.once("end",()=>i(n))})}};fa.default=da});var bf=v(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var Hn=Qt(),ha=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return Hn.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Hn.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Hn.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Hn.array.splitWhen(e,r=>r.dynamic&&Hn.pattern.hasGlobStar(r.pattern))}};pa.default=ha});var Sf=v(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var DE=bf(),ma=class extends DE.default{match(e){let r=e.split("/"),n=r.length,s=this._storage.filter(i=>!i.complete||i.segments.length>n);for(let i of s){let o=i.sections[0];if(!i.complete&&n>o.length||r.every((u,c)=>{let l=i.segments[c];return!!(l.dynamic&&l.patternRe.test(u)||!l.dynamic&&l.pattern===u)}))return!0}return!1}};ga.default=ma});var Cf=v(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var Xs=Qt(),yE=Sf(),Da=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let s=this._getMatcher(r),i=this._getNegativePatternsRe(n);return o=>this._filter(e,o,s,i)}_getMatcher(e){return new yE.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(Xs.pattern.isAffectDepthOfReadingPattern);return Xs.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,s){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Xs.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(i,n)?!1:this._isSkippedByNegativePatterns(i,s)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let s=e.split("/").length;return n-s}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!Xs.pattern.matchAny(e,r)}};ya.default=Da});var wf=v(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var yr=Qt(),va=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,s]=yr.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:yr.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:yr.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:yr.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,i)}_filter(e,r){let n=yr.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let s=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&s&&this._createIndexRecord(n),s}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let s=yr.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(s,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let s=yr.pattern.matchAny(e,r);return!s&&n?yr.pattern.matchAny(e+"/",r):s}};_a.default=va});var xf=v(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var vE=Qt(),Ea=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return vE.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};ba.default=Ea});var kf=v(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var $f=Qt(),Sa=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=$f.path.makeAbsolute(this._settings.cwd,r),r=$f.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};Ca.default=Sa});var Js=v(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var _E=require("path"),EE=Cf(),bE=wf(),SE=xf(),CE=kf(),wa=class{constructor(e){this._settings=e,this.errorFilter=new SE.default(this._settings),this.entryFilter=new bE.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new EE.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new CE.default(this._settings)}_getRootDirectory(e){return _E.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};xa.default=wa});var Af=v(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var wE=Ef(),xE=Js(),$a=class extends xE.default{constructor(){super(...arguments),this._reader=new wE.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(i=>n.transform(i))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};ka.default=$a});var Ff=v(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var $E=require("stream"),kE=la(),AE=Js(),Aa=class extends AE.default{constructor(){super(...arguments),this._reader=new kE.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),s=this.api(r,e,n),i=new $E.Readable({objectMode:!0,read:()=>{}});return s.once("error",o=>i.emit("error",o)).on("data",o=>i.emit("data",n.transform(o))).once("end",()=>i.emit("end")),i.once("close",()=>s.destroy()),i}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};Fa.default=Aa});var jf=v(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var FE=Nr(),jE=zs(),IE=Ys(),ja=class extends IE.default{constructor(){super(...arguments),this._walkSync=jE.walkSync,this._statSync=FE.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let s of e){let i=this._getFullEntryPath(s),o=this._getEntry(i,s,r);o===null||!r.entryFilter(o)||n.push(o)}return n}_getEntry(e,r,n){try{let s=this._getStat(e);return this._makeEntry(s,r)}catch(s){if(n.errorFilter(s))return null;throw s}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};Ia.default=ja});var If=v(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var TE=jf(),RE=Js(),Ta=class extends RE.default{constructor(){super(...arguments),this._reader=new TE.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};Ra.default=Ta});var Tf=v(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var yn=require("fs"),PE=require("os"),OE=Math.max(PE.cpus().length,1);vn.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:yn.lstat,lstatSync:yn.lstatSync,stat:yn.stat,statSync:yn.statSync,readdir:yn.readdir,readdirSync:yn.readdirSync};var Pa=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,OE),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},vn.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};vn.default=Pa});var Of=v((d2,Pf)=>{"use strict";var Rf=Rd(),NE=Af(),LE=Ff(),BE=If(),Oa=Tf(),dt=Qt();async function Na(t,e){wt(t);let r=La(t,NE.default,e),n=await Promise.all(r);return dt.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(c,l){wt(c);let d=La(c,BE.default,l);return dt.array.flatten(d)}t.sync=e;function r(c,l){wt(c);let d=La(c,LE.default,l);return dt.stream.merge(d)}t.stream=r;function n(c,l){wt(c);let d=[].concat(c),f=new Oa.default(l);return Rf.generate(d,f)}t.generateTasks=n;function s(c,l){wt(c);let d=new Oa.default(l);return dt.pattern.isDynamicPattern(c,d)}t.isDynamicPattern=s;function i(c){return wt(c),dt.path.escape(c)}t.escapePath=i;function o(c){return wt(c),dt.path.convertPathToPattern(c)}t.convertPathToPattern=o;let a;(function(c){function l(f){return wt(f),dt.path.escapePosixPath(f)}c.escapePath=l;function d(f){return wt(f),dt.path.convertPosixPathToPattern(f)}c.convertPathToPattern=d})(a=t.posix||(t.posix={}));let u;(function(c){function l(f){return wt(f),dt.path.escapeWindowsPath(f)}c.escapePath=l;function d(f){return wt(f),dt.path.convertWindowsPathToPattern(f)}c.convertPathToPattern=d})(u=t.win32||(t.win32={}))})(Na||(Na={}));function La(t,e,r){let n=[].concat(t),s=new Oa.default(r),i=Rf.generate(n,s),o=new e(s);return i.map(o.read,o)}function wt(t){if(![].concat(t).every(n=>dt.string.isString(n)&&!dt.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Pf.exports=Na});var Zn=v(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.getParsedType=_e.ZodParsedType=_e.objectUtil=_e.util=void 0;var Ba;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let i={};for(let o of s)i[o]=o;return i},t.getValidEnumValues=s=>{let i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(let o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Ba||(_e.util=Ba={}));var Nf;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Nf||(_e.objectUtil=Nf={}));_e.ZodParsedType=Ba.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var ME=t=>{switch(typeof t){case"undefined":return _e.ZodParsedType.undefined;case"string":return _e.ZodParsedType.string;case"number":return Number.isNaN(t)?_e.ZodParsedType.nan:_e.ZodParsedType.number;case"boolean":return _e.ZodParsedType.boolean;case"function":return _e.ZodParsedType.function;case"bigint":return _e.ZodParsedType.bigint;case"symbol":return _e.ZodParsedType.symbol;case"object":return Array.isArray(t)?_e.ZodParsedType.array:t===null?_e.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?_e.ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?_e.ZodParsedType.map:typeof Set<"u"&&t instanceof Set?_e.ZodParsedType.set:typeof Date<"u"&&t instanceof Date?_e.ZodParsedType.date:_e.ZodParsedType.object;default:return _e.ZodParsedType.unknown}};_e.getParsedType=ME});var Ks=v(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.ZodError=vr.quotelessJson=vr.ZodIssueCode=void 0;var Lf=Zn();vr.ZodIssueCode=Lf.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var qE=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");vr.quotelessJson=qE;var Un=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Lf.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};vr.ZodError=Un;Un.create=t=>new Un(t)});var qa=v(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});var Le=Ks(),Lr=Zn(),WE=(t,e)=>{let r;switch(t.code){case Le.ZodIssueCode.invalid_type:t.received===Lr.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Le.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Lr.util.jsonStringifyReplacer)}`;break;case Le.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${Lr.util.joinValues(t.keys,", ")}`;break;case Le.ZodIssueCode.invalid_union:r="Invalid input";break;case Le.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Lr.util.joinValues(t.options)}`;break;case Le.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${Lr.util.joinValues(t.options)}, received '${t.received}'`;break;case Le.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case Le.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case Le.ZodIssueCode.invalid_date:r="Invalid date";break;case Le.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Lr.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Le.ZodIssueCode.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Le.ZodIssueCode.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Le.ZodIssueCode.custom:r="Invalid input";break;case Le.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case Le.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Le.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,Lr.util.assertNever(t)}return{message:r}};Ma.default=WE});var Qs=v(_r=>{"use strict";var HE=_r&&_r.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_r,"__esModule",{value:!0});_r.defaultErrorMap=void 0;_r.setErrorMap=ZE;_r.getErrorMap=UE;var Bf=HE(qa());_r.defaultErrorMap=Bf.default;var Mf=Bf.default;function ZE(t){Mf=t}function UE(){return Mf}});var Ha=v(ge=>{"use strict";var VE=ge&&ge.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ge,"__esModule",{value:!0});ge.isAsync=ge.isValid=ge.isDirty=ge.isAborted=ge.OK=ge.DIRTY=ge.INVALID=ge.ParseStatus=ge.EMPTY_PATH=ge.makeIssue=void 0;ge.addIssueToContext=YE;var GE=Qs(),qf=VE(qa()),zE=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}};ge.makeIssue=zE;ge.EMPTY_PATH=[];function YE(t,e){let r=(0,GE.getErrorMap)(),n=(0,ge.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===qf.default?void 0:qf.default].filter(s=>!!s)});t.common.issues.push(n)}var Wa=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return ge.INVALID;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let i=await s.key,o=await s.value;n.push({key:i,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return ge.INVALID;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}};ge.ParseStatus=Wa;ge.INVALID=Object.freeze({status:"aborted"});var XE=t=>({status:"dirty",value:t});ge.DIRTY=XE;var JE=t=>({status:"valid",value:t});ge.OK=JE;var KE=t=>t.status==="aborted";ge.isAborted=KE;var QE=t=>t.status==="dirty";ge.isDirty=QE;var eb=t=>t.status==="valid";ge.isValid=eb;var tb=t=>typeof Promise<"u"&&t instanceof Promise;ge.isAsync=tb});var Hf=v(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0})});var Uf=v(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.errorUtil=void 0;var Zf;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Zf||(eo.errorUtil=Zf={}))});var nh=v(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.discriminatedUnion=b.date=b.boolean=b.bigint=b.array=b.any=b.coerce=b.ZodFirstPartyTypeKind=b.late=b.ZodSchema=b.Schema=b.ZodReadonly=b.ZodPipeline=b.ZodBranded=b.BRAND=b.ZodNaN=b.ZodCatch=b.ZodDefault=b.ZodNullable=b.ZodOptional=b.ZodTransformer=b.ZodEffects=b.ZodPromise=b.ZodNativeEnum=b.ZodEnum=b.ZodLiteral=b.ZodLazy=b.ZodFunction=b.ZodSet=b.ZodMap=b.ZodRecord=b.ZodTuple=b.ZodIntersection=b.ZodDiscriminatedUnion=b.ZodUnion=b.ZodObject=b.ZodArray=b.ZodVoid=b.ZodNever=b.ZodUnknown=b.ZodAny=b.ZodNull=b.ZodUndefined=b.ZodSymbol=b.ZodDate=b.ZodBoolean=b.ZodBigInt=b.ZodNumber=b.ZodString=b.ZodType=void 0;b.NEVER=b.void=b.unknown=b.union=b.undefined=b.tuple=b.transformer=b.symbol=b.string=b.strictObject=b.set=b.record=b.promise=b.preprocess=b.pipeline=b.ostring=b.optional=b.onumber=b.oboolean=b.object=b.number=b.nullable=b.null=b.never=b.nativeEnum=b.nan=b.map=b.literal=b.lazy=b.intersection=b.instanceof=b.function=b.enum=b.effect=void 0;b.datetimeRegex=Xf;b.custom=Kf;var O=Ks(),to=Qs(),K=Uf(),S=Ha(),L=Zn(),ht=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Vf=(t,e)=>{if((0,S.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new O.ZodError(t.common.issues);return this._error=r,this._error}}};function ie(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{let{message:u}=t;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:u??r??a.defaultError}},description:s}}var ae=class{get description(){return this._def.description}_getType(e){return(0,L.getParsedType)(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:(0,L.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,L.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if((0,S.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,L.getParsedType)(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Vf(n,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,L.getParsedType)(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return(0,S.isValid)(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>(0,S.isValid)(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,L.getParsedType)(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await((0,S.isAsync)(s)?s:Promise.resolve(s));return Vf(n,i)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let o=e(s),a=()=>i.addIssue({code:O.ZodIssueCode.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new at({schema:this,typeName:se.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ft.create(this,this._def)}nullable(){return Zt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rr.create(this)}promise(){return Sr.create(this,this._def)}or(e){return Ur.create([this,e],this._def)}and(e){return Vr.create(this,e,this._def)}transform(e){return new at({...ie(this._def),schema:this,typeName:se.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Jr({...ie(this._def),innerType:this,defaultValue:r,typeName:se.ZodDefault})}brand(){return new Vn({typeName:se.ZodBranded,type:this,...ie(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Kr({...ie(this._def),innerType:this,catchValue:r,typeName:se.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Gn.create(this,e)}readonly(){return Qr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};b.ZodType=ae;b.Schema=ae;b.ZodSchema=ae;var rb=/^c[^\s-]{8,}$/i,nb=/^[0-9a-z]+$/,sb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ob=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ib=/^[a-z0-9_-]{21}$/i,ab=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ub=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Za,db=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,hb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,pb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Db=new RegExp(`^${zf}$`);function Yf(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function yb(t){return new RegExp(`^${Yf(t)}$`)}function Xf(t){let e=`${zf}T${Yf(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function vb(t,e){return!!((e==="v4"||!e)&&db.test(t)||(e==="v6"||!e)&&hb.test(t))}function _b(t,e){if(!ab.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function Eb(t,e){return!!((e==="v4"||!e)&&fb.test(t)||(e==="v6"||!e)&&pb.test(t))}var Er=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==L.ZodParsedType.string){let i=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.string,received:i.parsedType}),S.INVALID}let n=new S.ParseStatus,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")cb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"email",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Za||(Za=new RegExp(lb,"u")),Za.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"emoji",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")ob.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"uuid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")ib.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"nanoid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")rb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"cuid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")nb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"cuid2",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")sb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"ulid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"url",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"regex",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Xf(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?Db.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?yb(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?ub.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"duration",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?vb(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"ip",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?_b(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"jwt",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?Eb(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"cidr",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?mb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"base64",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?gb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"base64url",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):L.util.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:O.ZodIssueCode.invalid_string,...K.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...K.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...K.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...K.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...K.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...K.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...K.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...K.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...K.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...K.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...K.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...K.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...K.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...K.errorUtil.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...K.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...K.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...K.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...K.errorUtil.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...K.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...K.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...K.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...K.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...K.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,K.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};b.ZodString=Er;Er.create=t=>new Er({checks:[],typeName:se.ZodString,coerce:t?.coerce??!1,...ie(t)});function bb(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}var Br=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==L.ZodParsedType.number){let i=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.number,received:i.parsedType}),S.INVALID}let n,s=new S.ParseStatus;for(let i of this._def.checks)i.kind==="int"?L.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?bb(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.not_finite,message:i.message}),s.dirty()):L.util.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,K.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:K.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:K.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:K.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.errorUtil.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&L.util.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};b.ZodNumber=Br;Br.create=t=>new Br({checks:[],typeName:se.ZodNumber,coerce:t?.coerce||!1,...ie(t)});var Mr=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==L.ZodParsedType.bigint)return this._getInvalidInput(e);let n,s=new S.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):L.util.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.bigint,received:r.parsedType}),S.INVALID}gte(e,r){return this.setLimit("min",e,!0,K.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:K.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:K.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.errorUtil.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};b.ZodBigInt=Mr;Mr.create=t=>new Mr({checks:[],typeName:se.ZodBigInt,coerce:t?.coerce??!1,...ie(t)});var qr=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==L.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.boolean,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodBoolean=qr;qr.create=t=>new qr({typeName:se.ZodBoolean,coerce:t?.coerce||!1,...ie(t)});var Wr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==L.ZodParsedType.date){let i=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.date,received:i.parsedType}),S.INVALID}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_date}),S.INVALID}let n=new S.ParseStatus,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):L.util.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:K.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:K.errorUtil.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};b.ZodDate=Wr;Wr.create=t=>new Wr({checks:[],coerce:t?.coerce||!1,typeName:se.ZodDate,...ie(t)});var En=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.symbol,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodSymbol=En;En.create=t=>new En({typeName:se.ZodSymbol,...ie(t)});var Hr=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.undefined,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodUndefined=Hr;Hr.create=t=>new Hr({typeName:se.ZodUndefined,...ie(t)});var Zr=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.null,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodNull=Zr;Zr.create=t=>new Zr({typeName:se.ZodNull,...ie(t)});var br=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,S.OK)(e.data)}};b.ZodAny=br;br.create=t=>new br({typeName:se.ZodAny,...ie(t)});var tr=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,S.OK)(e.data)}};b.ZodUnknown=tr;tr.create=t=>new tr({typeName:se.ZodUnknown,...ie(t)});var xt=class extends ae{_parse(e){let r=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.never,received:r.parsedType}),S.INVALID}};b.ZodNever=xt;xt.create=t=>new xt({typeName:se.ZodNever,...ie(t)});var bn=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.void,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodVoid=bn;bn.create=t=>new bn({typeName:se.ZodVoid,...ie(t)});var rr=class t extends ae{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==L.ZodParsedType.array)return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.array,received:r.parsedType}),S.INVALID;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(o||a)&&((0,S.addIssueToContext)(r,{code:o?O.ZodIssueCode.too_big:O.ZodIssueCode.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&((0,S.addIssueToContext)(r,{code:O.ZodIssueCode.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&((0,S.addIssueToContext)(r,{code:O.ZodIssueCode.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new ht(r,o,r.path,a)))).then(o=>S.ParseStatus.mergeArray(n,o));let i=[...r.data].map((o,a)=>s.type._parseSync(new ht(r,o,r.path,a)));return S.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:K.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:K.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:K.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};b.ZodArray=rr;rr.create=(t,e)=>new rr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...ie(e)});function _n(t){if(t instanceof Qe){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ft.create(_n(n))}return new Qe({...t._def,shape:()=>e})}else return t instanceof rr?new rr({...t._def,type:_n(t.element)}):t instanceof ft?ft.create(_n(t.unwrap())):t instanceof Zt?Zt.create(_n(t.unwrap())):t instanceof Ht?Ht.create(t.items.map(e=>_n(e))):t}var Qe=class t extends ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=L.util.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==L.ZodParsedType.object){let c=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(c,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.object,received:c.parsedType}),S.INVALID}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof xt&&this._def.unknownKeys==="strip"))for(let c in s.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=i[c],d=s.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new ht(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof xt){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(c==="strict")a.length>0&&((0,S.addIssueToContext)(s,{code:O.ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let d=s.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new ht(s,d,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let d=await l.key,f=await l.value;c.push({key:d,value:f,alwaysSet:l.alwaysSet})}return c}).then(c=>S.ParseStatus.mergeObjectSync(n,c)):S.ParseStatus.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return K.errorUtil.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:K.errorUtil.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:se.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of L.util.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of L.util.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return _n(this)}partial(e){let r={};for(let n of L.util.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of L.util.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ft;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return Jf(L.util.objectKeys(this.shape))}};b.ZodObject=Qe;Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:xt.create(),typeName:se.ZodObject,...ie(e)});Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:xt.create(),typeName:se.ZodObject,...ie(e)});Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:xt.create(),typeName:se.ZodObject,...ie(e)});var Ur=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new O.ZodError(a.ctx.common.issues));return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union,unionErrors:o}),S.INVALID}if(r.common.async)return Promise.all(n.map(async i=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(u=>new O.ZodError(u));return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union,unionErrors:a}),S.INVALID}}get options(){return this._def.options}};b.ZodUnion=Ur;Ur.create=(t,e)=>new Ur({options:t,typeName:se.ZodUnion,...ie(e)});var er=t=>t instanceof Gr?er(t.schema):t instanceof at?er(t.innerType()):t instanceof zr?[t.value]:t instanceof Yr?t.options:t instanceof Xr?L.util.objectValues(t.enum):t instanceof Jr?er(t._def.innerType):t instanceof Hr?[void 0]:t instanceof Zr?[null]:t instanceof ft?[void 0,...er(t.unwrap())]:t instanceof Zt?[null,...er(t.unwrap())]:t instanceof Vn||t instanceof Qr?er(t.unwrap()):t instanceof Kr?er(t._def.innerType):[],ro=class t extends ae{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.ZodParsedType.object)return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.object,received:r.parsedType}),S.INVALID;let n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):((0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),S.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let i of r){let o=er(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,i)}}return new t({typeName:se.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...ie(n)})}};b.ZodDiscriminatedUnion=ro;function Ua(t,e){let r=(0,L.getParsedType)(t),n=(0,L.getParsedType)(e);if(t===e)return{valid:!0,data:t};if(r===L.ZodParsedType.object&&n===L.ZodParsedType.object){let s=L.util.objectKeys(e),i=L.util.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(let a of i){let u=Ua(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===L.ZodParsedType.array&&n===L.ZodParsedType.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<t.length;i++){let o=t[i],a=e[i],u=Ua(o,a);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return r===L.ZodParsedType.date&&n===L.ZodParsedType.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Vr=class extends ae{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(i,o)=>{if((0,S.isAborted)(i)||(0,S.isAborted)(o))return S.INVALID;let a=Ua(i.value,o.value);return a.valid?(((0,S.isDirty)(i)||(0,S.isDirty)(o))&&r.dirty(),{status:r.value,value:a.data}):((0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_intersection_types}),S.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};b.ZodIntersection=Vr;Vr.create=(t,e,r)=>new Vr({left:t,right:e,typeName:se.ZodIntersection,...ie(r)});var Ht=class t extends ae{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.array)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.array,received:n.parsedType}),S.INVALID;if(n.data.length<this._def.items.length)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new ht(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>S.ParseStatus.mergeArray(r,o)):S.ParseStatus.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};b.ZodTuple=Ht;Ht.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ht({items:t,typeName:se.ZodTuple,rest:null,...ie(e)})};var no=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.object)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.object,received:n.parsedType}),S.INVALID;let s=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:i._parse(new ht(n,a,n.path,a)),value:o._parse(new ht(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?S.ParseStatus.mergeObjectAsync(r,s):S.ParseStatus.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ae?new t({keyType:e,valueType:r,typeName:se.ZodRecord,...ie(n)}):new t({keyType:Er.create(),valueType:e,typeName:se.ZodRecord,...ie(r)})}};b.ZodRecord=no;var Sn=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.map)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.map,received:n.parsedType}),S.INVALID;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:s._parse(new ht(n,a,n.path,[c,"key"])),value:i._parse(new ht(n,u,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return S.INVALID;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return S.INVALID;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};b.ZodMap=Sn;Sn.create=(t,e,r)=>new Sn({valueType:e,keyType:t,typeName:se.ZodMap,...ie(r)});var Cn=class t extends ae{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.set)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.set,received:n.parsedType}),S.INVALID;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&((0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&((0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return S.INVALID;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((u,c)=>i._parse(new ht(n,u,n.path,c)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:K.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:K.errorUtil.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};b.ZodSet=Cn;Cn.create=(t,e)=>new Cn({valueType:t,minSize:null,maxSize:null,typeName:se.ZodSet,...ie(e)});var so=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.ZodParsedType.function)return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.function,received:r.parsedType}),S.INVALID;function n(a,u){return(0,S.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,to.getErrorMap)(),to.defaultErrorMap].filter(c=>!!c),issueData:{code:O.ZodIssueCode.invalid_arguments,argumentsError:u}})}function s(a,u){return(0,S.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,to.getErrorMap)(),to.defaultErrorMap].filter(c=>!!c),issueData:{code:O.ZodIssueCode.invalid_return_type,returnTypeError:u}})}let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Sr){let a=this;return(0,S.OK)(async function(...u){let c=new O.ZodError([]),l=await a._def.args.parseAsync(u,i).catch(g=>{throw c.addIssue(n(u,g)),c}),d=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(s(d,g)),c})})}else{let a=this;return(0,S.OK)(function(...u){let c=a._def.args.safeParse(u,i);if(!c.success)throw new O.ZodError([n(u,c.error)]);let l=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(l,i);if(!d.success)throw new O.ZodError([s(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ht.create(e).rest(tr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Ht.create([]).rest(tr.create()),returns:r||tr.create(),typeName:se.ZodFunction,...ie(n)})}};b.ZodFunction=so;var Gr=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};b.ZodLazy=Gr;Gr.create=(t,e)=>new Gr({getter:t,typeName:se.ZodLazy,...ie(e)});var zr=class extends ae{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(r,{received:r.data,code:O.ZodIssueCode.invalid_literal,expected:this._def.value}),S.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}};b.ZodLiteral=zr;zr.create=(t,e)=>new zr({value:t,typeName:se.ZodLiteral,...ie(e)});function Jf(t,e){return new Yr({values:t,typeName:se.ZodEnum,...ie(e)})}var Yr=class t extends ae{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,S.addIssueToContext)(r,{expected:L.util.joinValues(n),received:r.parsedType,code:O.ZodIssueCode.invalid_type}),S.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,S.addIssueToContext)(r,{received:r.data,code:O.ZodIssueCode.invalid_enum_value,options:n}),S.INVALID}return(0,S.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};b.ZodEnum=Yr;Yr.create=Jf;var Xr=class extends ae{_parse(e){let r=L.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==L.ZodParsedType.string&&n.parsedType!==L.ZodParsedType.number){let s=L.util.objectValues(r);return(0,S.addIssueToContext)(n,{expected:L.util.joinValues(s),received:n.parsedType,code:O.ZodIssueCode.invalid_type}),S.INVALID}if(this._cache||(this._cache=new Set(L.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=L.util.objectValues(r);return(0,S.addIssueToContext)(n,{received:n.data,code:O.ZodIssueCode.invalid_enum_value,options:s}),S.INVALID}return(0,S.OK)(e.data)}get enum(){return this._def.values}};b.ZodNativeEnum=Xr;Xr.create=(t,e)=>new Xr({values:t,typeName:se.ZodNativeEnum,...ie(e)});var Sr=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.ZodParsedType.promise&&r.common.async===!1)return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.promise,received:r.parsedType}),S.INVALID;let n=r.parsedType===L.ZodParsedType.promise?r.data:Promise.resolve(r.data);return(0,S.OK)(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};b.ZodPromise=Sr;Sr.create=(t,e)=>new Sr({type:t,typeName:se.ZodPromise,...ie(e)});var at=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{(0,S.addIssueToContext)(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return S.INVALID;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?S.INVALID:u.status==="dirty"||r.value==="dirty"?(0,S.DIRTY)(u.value):u});{if(r.value==="aborted")return S.INVALID;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?S.INVALID:a.status==="dirty"||r.value==="dirty"?(0,S.DIRTY)(a.value):a}}if(s.type==="refinement"){let o=a=>{let u=s.refinement(a,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?S.INVALID:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?S.INVALID:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,S.isValid)(o))return S.INVALID;let a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>(0,S.isValid)(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):S.INVALID);L.util.assertNever(s)}};b.ZodEffects=at;b.ZodTransformer=at;at.create=(t,e,r)=>new at({schema:t,typeName:se.ZodEffects,effect:e,...ie(r)});at.createWithPreprocess=(t,e,r)=>new at({schema:e,effect:{type:"preprocess",transform:t},typeName:se.ZodEffects,...ie(r)});var ft=class extends ae{_parse(e){return this._getType(e)===L.ZodParsedType.undefined?(0,S.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};b.ZodOptional=ft;ft.create=(t,e)=>new ft({innerType:t,typeName:se.ZodOptional,...ie(e)});var Zt=class extends ae{_parse(e){return this._getType(e)===L.ZodParsedType.null?(0,S.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};b.ZodNullable=Zt;Zt.create=(t,e)=>new Zt({innerType:t,typeName:se.ZodNullable,...ie(e)});var Jr=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===L.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};b.ZodDefault=Jr;Jr.create=(t,e)=>new Jr({innerType:t,typeName:se.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ie(e)});var Kr=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,S.isAsync)(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new O.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new O.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};b.ZodCatch=Kr;Kr.create=(t,e)=>new Kr({innerType:t,typeName:se.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ie(e)});var wn=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.nan,received:n.parsedType}),S.INVALID}return{status:"valid",value:e.data}}};b.ZodNaN=wn;wn.create=t=>new wn({typeName:se.ZodNaN,...ie(t)});b.BRAND=Symbol("zod_brand");var Vn=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};b.ZodBranded=Vn;var Gn=class t extends ae{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?S.INVALID:i.status==="dirty"?(r.dirty(),(0,S.DIRTY)(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?S.INVALID:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:se.ZodPipeline})}};b.ZodPipeline=Gn;var Qr=class extends ae{_parse(e){let r=this._def.innerType._parse(e),n=s=>((0,S.isValid)(s)&&(s.value=Object.freeze(s.value)),s);return(0,S.isAsync)(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};b.ZodReadonly=Qr;Qr.create=(t,e)=>new Qr({innerType:t,typeName:se.ZodReadonly,...ie(e)});function Gf(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Kf(t,e={},r){return t?br.create().superRefine((n,s)=>{let i=t(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=Gf(e,n),u=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:u})}});if(!i){let o=Gf(e,n),a=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:a})}}):br.create()}b.late={object:Qe.lazycreate};var se;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(se||(b.ZodFirstPartyTypeKind=se={}));var Sb=(t,e={message:`Input not instance of ${t.name}`})=>Kf(r=>r instanceof t,e);b.instanceof=Sb;var Qf=Er.create;b.string=Qf;var eh=Br.create;b.number=eh;var Cb=wn.create;b.nan=Cb;var wb=Mr.create;b.bigint=wb;var th=qr.create;b.boolean=th;var xb=Wr.create;b.date=xb;var $b=En.create;b.symbol=$b;var kb=Hr.create;b.undefined=kb;var Ab=Zr.create;b.null=Ab;var Fb=br.create;b.any=Fb;var jb=tr.create;b.unknown=jb;var Ib=xt.create;b.never=Ib;var Tb=bn.create;b.void=Tb;var Rb=rr.create;b.array=Rb;var Pb=Qe.create;b.object=Pb;var Ob=Qe.strictCreate;b.strictObject=Ob;var Nb=Ur.create;b.union=Nb;var Lb=ro.create;b.discriminatedUnion=Lb;var Bb=Vr.create;b.intersection=Bb;var Mb=Ht.create;b.tuple=Mb;var qb=no.create;b.record=qb;var Wb=Sn.create;b.map=Wb;var Hb=Cn.create;b.set=Hb;var Zb=so.create;b.function=Zb;var Ub=Gr.create;b.lazy=Ub;var Vb=zr.create;b.literal=Vb;var Gb=Yr.create;b.enum=Gb;var zb=Xr.create;b.nativeEnum=zb;var Yb=Sr.create;b.promise=Yb;var rh=at.create;b.effect=rh;b.transformer=rh;var Xb=ft.create;b.optional=Xb;var Jb=Zt.create;b.nullable=Jb;var Kb=at.createWithPreprocess;b.preprocess=Kb;var Qb=Gn.create;b.pipeline=Qb;var eS=()=>Qf().optional();b.ostring=eS;var tS=()=>eh().optional();b.onumber=tS;var rS=()=>th().optional();b.oboolean=rS;b.coerce={string:(t=>Er.create({...t,coerce:!0})),number:(t=>Br.create({...t,coerce:!0})),boolean:(t=>qr.create({...t,coerce:!0})),bigint:(t=>Mr.create({...t,coerce:!0})),date:(t=>Wr.create({...t,coerce:!0}))};b.NEVER=S.INVALID});var Va=v(pt=>{"use strict";var nS=pt&&pt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xn=pt&&pt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nS(e,t,r)};Object.defineProperty(pt,"__esModule",{value:!0});xn(Qs(),pt);xn(Ha(),pt);xn(Hf(),pt);xn(Zn(),pt);xn(nh(),pt);xn(Ks(),pt)});var Ga=v(et=>{"use strict";var sh=et&&et.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sS=et&&et.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oS=et&&et.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&sh(e,t,r);return sS(e,t),e},iS=et&&et.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sh(e,t,r)};Object.defineProperty(et,"__esModule",{value:!0});et.z=void 0;var oh=oS(Va());et.z=oh;iS(Va(),et);et.default=oh});var zn=v((b2,ih)=>{"use strict";var aS="2.0.0",uS=Number.MAX_SAFE_INTEGER||9007199254740991,cS=16,lS=250,dS=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ih.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:cS,MAX_SAFE_BUILD_LENGTH:lS,MAX_SAFE_INTEGER:uS,RELEASE_TYPES:dS,SEMVER_SPEC_VERSION:aS,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Yn=v((S2,ah)=>{"use strict";var fS=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};ah.exports=fS});var $n=v((Ut,uh)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:za,MAX_SAFE_BUILD_LENGTH:hS,MAX_LENGTH:pS}=zn(),mS=Yn();Ut=uh.exports={};var gS=Ut.re=[],DS=Ut.safeRe=[],U=Ut.src=[],yS=Ut.safeSrc=[],V=Ut.t={},vS=0,Ya="[a-zA-Z0-9-]",_S=[["\\s",1],["\\d",pS],[Ya,hS]],ES=t=>{for(let[e,r]of _S)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},oe=(t,e,r)=>{let n=ES(e),s=vS++;mS(t,s,e),V[t]=s,U[s]=e,yS[s]=n,gS[s]=new RegExp(e,r?"g":void 0),DS[s]=new RegExp(n,r?"g":void 0)};oe("NUMERICIDENTIFIER","0|[1-9]\\d*");oe("NUMERICIDENTIFIERLOOSE","\\d+");oe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ya}*`);oe("MAINVERSION",`(${U[V.NUMERICIDENTIFIER]})\\.(${U[V.NUMERICIDENTIFIER]})\\.(${U[V.NUMERICIDENTIFIER]})`);oe("MAINVERSIONLOOSE",`(${U[V.NUMERICIDENTIFIERLOOSE]})\\.(${U[V.NUMERICIDENTIFIERLOOSE]})\\.(${U[V.NUMERICIDENTIFIERLOOSE]})`);oe("PRERELEASEIDENTIFIER",`(?:${U[V.NONNUMERICIDENTIFIER]}|${U[V.NUMERICIDENTIFIER]})`);oe("PRERELEASEIDENTIFIERLOOSE",`(?:${U[V.NONNUMERICIDENTIFIER]}|${U[V.NUMERICIDENTIFIERLOOSE]})`);oe("PRERELEASE",`(?:-(${U[V.PRERELEASEIDENTIFIER]}(?:\\.${U[V.PRERELEASEIDENTIFIER]})*))`);oe("PRERELEASELOOSE",`(?:-?(${U[V.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${U[V.PRERELEASEIDENTIFIERLOOSE]})*))`);oe("BUILDIDENTIFIER",`${Ya}+`);oe("BUILD",`(?:\\+(${U[V.BUILDIDENTIFIER]}(?:\\.${U[V.BUILDIDENTIFIER]})*))`);oe("FULLPLAIN",`v?${U[V.MAINVERSION]}${U[V.PRERELEASE]}?${U[V.BUILD]}?`);oe("FULL",`^${U[V.FULLPLAIN]}$`);oe("LOOSEPLAIN",`[v=\\s]*${U[V.MAINVERSIONLOOSE]}${U[V.PRERELEASELOOSE]}?${U[V.BUILD]}?`);oe("LOOSE",`^${U[V.LOOSEPLAIN]}$`);oe("GTLT","((?:<|>)?=?)");oe("XRANGEIDENTIFIERLOOSE",`${U[V.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);oe("XRANGEIDENTIFIER",`${U[V.NUMERICIDENTIFIER]}|x|X|\\*`);oe("XRANGEPLAIN",`[v=\\s]*(${U[V.XRANGEIDENTIFIER]})(?:\\.(${U[V.XRANGEIDENTIFIER]})(?:\\.(${U[V.XRANGEIDENTIFIER]})(?:${U[V.PRERELEASE]})?${U[V.BUILD]}?)?)?`);oe("XRANGEPLAINLOOSE",`[v=\\s]*(${U[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[V.XRANGEIDENTIFIERLOOSE]})(?:${U[V.PRERELEASELOOSE]})?${U[V.BUILD]}?)?)?`);oe("XRANGE",`^${U[V.GTLT]}\\s*${U[V.XRANGEPLAIN]}$`);oe("XRANGELOOSE",`^${U[V.GTLT]}\\s*${U[V.XRANGEPLAINLOOSE]}$`);oe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${za}})(?:\\.(\\d{1,${za}}))?(?:\\.(\\d{1,${za}}))?`);oe("COERCE",`${U[V.COERCEPLAIN]}(?:$|[^\\d])`);oe("COERCEFULL",U[V.COERCEPLAIN]+`(?:${U[V.PRERELEASE]})?(?:${U[V.BUILD]})?(?:$|[^\\d])`);oe("COERCERTL",U[V.COERCE],!0);oe("COERCERTLFULL",U[V.COERCEFULL],!0);oe("LONETILDE","(?:~>?)");oe("TILDETRIM",`(\\s*)${U[V.LONETILDE]}\\s+`,!0);Ut.tildeTrimReplace="$1~";oe("TILDE",`^${U[V.LONETILDE]}${U[V.XRANGEPLAIN]}$`);oe("TILDELOOSE",`^${U[V.LONETILDE]}${U[V.XRANGEPLAINLOOSE]}$`);oe("LONECARET","(?:\\^)");oe("CARETTRIM",`(\\s*)${U[V.LONECARET]}\\s+`,!0);Ut.caretTrimReplace="$1^";oe("CARET",`^${U[V.LONECARET]}${U[V.XRANGEPLAIN]}$`);oe("CARETLOOSE",`^${U[V.LONECARET]}${U[V.XRANGEPLAINLOOSE]}$`);oe("COMPARATORLOOSE",`^${U[V.GTLT]}\\s*(${U[V.LOOSEPLAIN]})$|^$`);oe("COMPARATOR",`^${U[V.GTLT]}\\s*(${U[V.FULLPLAIN]})$|^$`);oe("COMPARATORTRIM",`(\\s*)${U[V.GTLT]}\\s*(${U[V.LOOSEPLAIN]}|${U[V.XRANGEPLAIN]})`,!0);Ut.comparatorTrimReplace="$1$2$3";oe("HYPHENRANGE",`^\\s*(${U[V.XRANGEPLAIN]})\\s+-\\s+(${U[V.XRANGEPLAIN]})\\s*$`);oe("HYPHENRANGELOOSE",`^\\s*(${U[V.XRANGEPLAINLOOSE]})\\s+-\\s+(${U[V.XRANGEPLAINLOOSE]})\\s*$`);oe("STAR","(<|>)?=?\\s*\\*");oe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");oe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var oo=v((C2,ch)=>{"use strict";var bS=Object.freeze({loose:!0}),SS=Object.freeze({}),CS=t=>t?typeof t!="object"?bS:t:SS;ch.exports=CS});var Xa=v((w2,fh)=>{"use strict";var lh=/^[0-9]+$/,dh=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=lh.test(t),n=lh.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},wS=(t,e)=>dh(e,t);fh.exports={compareIdentifiers:dh,rcompareIdentifiers:wS}});var Be=v((x2,ph)=>{"use strict";var io=Yn(),{MAX_LENGTH:hh,MAX_SAFE_INTEGER:ao}=zn(),{safeRe:uo,t:co}=$n(),xS=oo(),{compareIdentifiers:Ja}=Xa(),Ka=class t{constructor(e,r){if(r=xS(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>hh)throw new TypeError(`version is longer than ${hh} characters`);io("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?uo[co.LOOSE]:uo[co.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ao||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ao||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ao||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<ao)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(io("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(io("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ja(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(io("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ja(n,s)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?uo[co.PRERELEASELOOSE]:uo[co.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),Ja(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};ph.exports=Ka});var en=v(($2,gh)=>{"use strict";var mh=Be(),$S=(t,e,r=!1)=>{if(t instanceof mh)return t;try{return new mh(t,e)}catch(n){if(!r)return null;throw n}};gh.exports=$S});var yh=v((k2,Dh)=>{"use strict";var kS=en(),AS=(t,e)=>{let r=kS(t,e);return r?r.version:null};Dh.exports=AS});var _h=v((A2,vh)=>{"use strict";var FS=en(),jS=(t,e)=>{let r=FS(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};vh.exports=jS});var Sh=v((F2,bh)=>{"use strict";var Eh=Be(),IS=(t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Eh(t instanceof Eh?t.version:t,r).inc(e,n,s).version}catch{return null}};bh.exports=IS});var xh=v((j2,wh)=>{"use strict";var Ch=en(),TS=(t,e)=>{let r=Ch(t,null,!0),n=Ch(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,o=i?r:n,a=i?n:r,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};wh.exports=TS});var kh=v((I2,$h)=>{"use strict";var RS=Be(),PS=(t,e)=>new RS(t,e).major;$h.exports=PS});var Fh=v((T2,Ah)=>{"use strict";var OS=Be(),NS=(t,e)=>new OS(t,e).minor;Ah.exports=NS});var Ih=v((R2,jh)=>{"use strict";var LS=Be(),BS=(t,e)=>new LS(t,e).patch;jh.exports=BS});var Rh=v((P2,Th)=>{"use strict";var MS=en(),qS=(t,e)=>{let r=MS(t,e);return r&&r.prerelease.length?r.prerelease:null};Th.exports=qS});var mt=v((O2,Oh)=>{"use strict";var Ph=Be(),WS=(t,e,r)=>new Ph(t,r).compare(new Ph(e,r));Oh.exports=WS});var Lh=v((N2,Nh)=>{"use strict";var HS=mt(),ZS=(t,e,r)=>HS(e,t,r);Nh.exports=ZS});var Mh=v((L2,Bh)=>{"use strict";var US=mt(),VS=(t,e)=>US(t,e,!0);Bh.exports=VS});var lo=v((B2,Wh)=>{"use strict";var qh=Be(),GS=(t,e,r)=>{let n=new qh(t,r),s=new qh(e,r);return n.compare(s)||n.compareBuild(s)};Wh.exports=GS});var Zh=v((M2,Hh)=>{"use strict";var zS=lo(),YS=(t,e)=>t.sort((r,n)=>zS(r,n,e));Hh.exports=YS});var Vh=v((q2,Uh)=>{"use strict";var XS=lo(),JS=(t,e)=>t.sort((r,n)=>XS(n,r,e));Uh.exports=JS});var Xn=v((W2,Gh)=>{"use strict";var KS=mt(),QS=(t,e,r)=>KS(t,e,r)>0;Gh.exports=QS});var fo=v((H2,zh)=>{"use strict";var eC=mt(),tC=(t,e,r)=>eC(t,e,r)<0;zh.exports=tC});var Qa=v((Z2,Yh)=>{"use strict";var rC=mt(),nC=(t,e,r)=>rC(t,e,r)===0;Yh.exports=nC});var eu=v((U2,Xh)=>{"use strict";var sC=mt(),oC=(t,e,r)=>sC(t,e,r)!==0;Xh.exports=oC});var ho=v((V2,Jh)=>{"use strict";var iC=mt(),aC=(t,e,r)=>iC(t,e,r)>=0;Jh.exports=aC});var po=v((G2,Kh)=>{"use strict";var uC=mt(),cC=(t,e,r)=>uC(t,e,r)<=0;Kh.exports=cC});var tu=v((z2,Qh)=>{"use strict";var lC=Qa(),dC=eu(),fC=Xn(),hC=ho(),pC=fo(),mC=po(),gC=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return lC(t,r,n);case"!=":return dC(t,r,n);case">":return fC(t,r,n);case">=":return hC(t,r,n);case"<":return pC(t,r,n);case"<=":return mC(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Qh.exports=gC});var tp=v((Y2,ep)=>{"use strict";var DC=Be(),yC=en(),{safeRe:mo,t:go}=$n(),vC=(t,e)=>{if(t instanceof DC)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?mo[go.COERCEFULL]:mo[go.COERCE]);else{let u=e.includePrerelease?mo[go.COERCERTLFULL]:mo[go.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return yC(`${n}.${s}.${i}${o}${a}`,e)};ep.exports=vC});var np=v((X2,rp)=>{"use strict";var ru=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};rp.exports=ru});var gt=v((J2,ap)=>{"use strict";var _C=/\s+/g,nu=class t{constructor(e,r){if(r=bC(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof su)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(_C," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!op(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&AC(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&$C)|(this.options.loose&&kC))+":"+e,s=sp.get(n);if(s)return s;let i=this.options.loose,o=i?Ue[Me.HYPHENRANGELOOSE]:Ue[Me.HYPHENRANGE];e=e.replace(o,BC(this.options.includePrerelease)),Ce("hyphen replace",e),e=e.replace(Ue[Me.COMPARATORTRIM],CC),Ce("comparator trim",e),e=e.replace(Ue[Me.TILDETRIM],wC),Ce("tilde trim",e),e=e.replace(Ue[Me.CARETTRIM],xC),Ce("caret trim",e);let a=e.split(" ").map(d=>FC(d,this.options)).join(" ").split(/\s+/).map(d=>LC(d,this.options));i&&(a=a.filter(d=>(Ce("loose invalid filter",d,this.options),!!d.match(Ue[Me.COMPARATORLOOSE])))),Ce("range list",a);let u=new Map,c=a.map(d=>new su(d,this.options));for(let d of c){if(op(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return sp.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>ip(n,r)&&e.set.some(s=>ip(s,r)&&n.every(i=>s.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new SC(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(MC(this.set[r],e,this.options))return!0;return!1}};ap.exports=nu;var EC=np(),sp=new EC,bC=oo(),su=Jn(),Ce=Yn(),SC=Be(),{safeRe:Ue,t:Me,comparatorTrimReplace:CC,tildeTrimReplace:wC,caretTrimReplace:xC}=$n(),{FLAG_INCLUDE_PRERELEASE:$C,FLAG_LOOSE:kC}=zn(),op=t=>t.value==="<0.0.0-0",AC=t=>t.value==="",ip=(t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},FC=(t,e)=>(t=t.replace(Ue[Me.BUILD],""),Ce("comp",t,e),t=TC(t,e),Ce("caret",t),t=jC(t,e),Ce("tildes",t),t=PC(t,e),Ce("xrange",t),t=NC(t,e),Ce("stars",t),t),Ve=t=>!t||t.toLowerCase()==="x"||t==="*",jC=(t,e)=>t.trim().split(/\s+/).map(r=>IC(r,e)).join(" "),IC=(t,e)=>{let r=e.loose?Ue[Me.TILDELOOSE]:Ue[Me.TILDE];return t.replace(r,(n,s,i,o,a)=>{Ce("tilde",t,n,s,i,o,a);let u;return Ve(s)?u="":Ve(i)?u=`>=${s}.0.0 <${+s+1}.0.0-0`:Ve(o)?u=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(Ce("replaceTilde pr",a),u=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):u=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,Ce("tilde return",u),u})},TC=(t,e)=>t.trim().split(/\s+/).map(r=>RC(r,e)).join(" "),RC=(t,e)=>{Ce("caret",t,e);let r=e.loose?Ue[Me.CARETLOOSE]:Ue[Me.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,u)=>{Ce("caret",t,s,i,o,a,u);let c;return Ve(i)?c="":Ve(o)?c=`>=${i}.0.0${n} <${+i+1}.0.0-0`:Ve(a)?i==="0"?c=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:u?(Ce("replaceCaret pr",u),i==="0"?o==="0"?c=`>=${i}.${o}.${a}-${u} <${i}.${o}.${+a+1}-0`:c=`>=${i}.${o}.${a}-${u} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.${a}-${u} <${+i+1}.0.0-0`):(Ce("no pr"),i==="0"?o==="0"?c=`>=${i}.${o}.${a}${n} <${i}.${o}.${+a+1}-0`:c=`>=${i}.${o}.${a}${n} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),Ce("caret return",c),c})},PC=(t,e)=>(Ce("replaceXRanges",t,e),t.split(/\s+/).map(r=>OC(r,e)).join(" ")),OC=(t,e)=>{t=t.trim();let r=e.loose?Ue[Me.XRANGELOOSE]:Ue[Me.XRANGE];return t.replace(r,(n,s,i,o,a,u)=>{Ce("xRange",t,n,s,i,o,a,u);let c=Ve(i),l=c||Ve(o),d=l||Ve(a),f=d;return s==="="&&f&&(s=""),u=e.includePrerelease?"-0":"",c?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&f?(l&&(o=0),a=0,s===">"?(s=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):s==="<="&&(s="<",l?i=+i+1:o=+o+1),s==="<"&&(u="-0"),n=`${s+i}.${o}.${a}${u}`):l?n=`>=${i}.0.0${u} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${u} <${i}.${+o+1}.0-0`),Ce("xRange return",n),n})},NC=(t,e)=>(Ce("replaceStars",t,e),t.trim().replace(Ue[Me.STAR],"")),LC=(t,e)=>(Ce("replaceGTE0",t,e),t.trim().replace(Ue[e.includePrerelease?Me.GTE0PRE:Me.GTE0],"")),BC=t=>(e,r,n,s,i,o,a,u,c,l,d,f)=>(Ve(n)?r="":Ve(s)?r=`>=${n}.0.0${t?"-0":""}`:Ve(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ve(c)?u="":Ve(l)?u=`<${+c+1}.0.0-0`:Ve(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:t?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),MC=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Ce(t[n].semver),t[n].semver!==su.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Jn=v((K2,hp)=>{"use strict";var Kn=Symbol("SemVer ANY"),au=class t{static get ANY(){return Kn}constructor(e,r){if(r=up(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),iu("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Kn?this.value="":this.value=this.operator+this.semver.version,iu("comp",this)}parse(e){let r=this.options.loose?cp[lp.COMPARATORLOOSE]:cp[lp.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new dp(n[2],this.options.loose):this.semver=Kn}toString(){return this.value}test(e){if(iu("Comparator.test",e,this.options.loose),this.semver===Kn||e===Kn)return!0;if(typeof e=="string")try{e=new dp(e,this.options)}catch{return!1}return ou(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new fp(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new fp(this.value,r).test(e.semver):(r=up(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||ou(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||ou(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};hp.exports=au;var up=oo(),{safeRe:cp,t:lp}=$n(),ou=tu(),iu=Yn(),dp=Be(),fp=gt()});var Qn=v((Q2,pp)=>{"use strict";var qC=gt(),WC=(t,e,r)=>{try{e=new qC(e,r)}catch{return!1}return e.test(t)};pp.exports=WC});var gp=v((eI,mp)=>{"use strict";var HC=gt(),ZC=(t,e)=>new HC(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));mp.exports=ZC});var yp=v((tI,Dp)=>{"use strict";var UC=Be(),VC=gt(),GC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new VC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new UC(n,r))}),n};Dp.exports=GC});var _p=v((rI,vp)=>{"use strict";var zC=Be(),YC=gt(),XC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new YC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new zC(n,r))}),n};vp.exports=XC});var Sp=v((nI,bp)=>{"use strict";var uu=Be(),JC=gt(),Ep=Xn(),KC=(t,e)=>{t=new JC(t,e);let r=new uu("0.0.0");if(t.test(r)||(r=new uu("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(o=>{let a=new uu(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||Ep(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||Ep(r,i))&&(r=i)}return r&&t.test(r)?r:null};bp.exports=KC});var wp=v((sI,Cp)=>{"use strict";var QC=gt(),ew=(t,e)=>{try{return new QC(t,e).range||"*"}catch{return null}};Cp.exports=ew});var Do=v((oI,Ap)=>{"use strict";var tw=Be(),kp=Jn(),{ANY:rw}=kp,nw=gt(),sw=Qn(),xp=Xn(),$p=fo(),ow=po(),iw=ho(),aw=(t,e,r,n)=>{t=new tw(t,n),e=new nw(e,n);let s,i,o,a,u;switch(r){case">":s=xp,i=ow,o=$p,a=">",u=">=";break;case"<":s=$p,i=iw,o=xp,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(sw(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],d=null,f=null;if(l.forEach(g=>{g.semver===rw&&(g=new kp(">=0.0.0")),d=d||g,f=f||g,s(g.semver,d.semver,n)?d=g:o(g.semver,f.semver,n)&&(f=g)}),d.operator===a||d.operator===u||(!f.operator||f.operator===a)&&i(t,f.semver))return!1;if(f.operator===u&&o(t,f.semver))return!1}return!0};Ap.exports=aw});var jp=v((iI,Fp)=>{"use strict";var uw=Do(),cw=(t,e,r)=>uw(t,e,">",r);Fp.exports=cw});var Tp=v((aI,Ip)=>{"use strict";var lw=Do(),dw=(t,e,r)=>lw(t,e,"<",r);Ip.exports=dw});var Op=v((uI,Pp)=>{"use strict";var Rp=gt(),fw=(t,e,r)=>(t=new Rp(t,r),e=new Rp(e,r),t.intersects(e,r));Pp.exports=fw});var Lp=v((cI,Np)=>{"use strict";var hw=Qn(),pw=mt();Np.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((l,d)=>pw(l,d,r));for(let l of o)hw(l,e,r)?(i=l,s||(s=l)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===o[0]?a.push("*"):d?l===o[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var Zp=v((lI,Hp)=>{"use strict";var Bp=gt(),lu=Jn(),{ANY:cu}=lu,es=Qn(),du=mt(),mw=(t,e,r={})=>{if(t===e)return!0;t=new Bp(t,r),e=new Bp(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=Dw(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},gw=[new lu(">=0.0.0-0")],Mp=[new lu(">=0.0.0")],Dw=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===cu){if(e.length===1&&e[0].semver===cu)return!0;r.includePrerelease?t=gw:t=Mp}if(e.length===1&&e[0].semver===cu){if(r.includePrerelease)return!0;e=Mp}let n=new Set,s,i;for(let g of t)g.operator===">"||g.operator===">="?s=qp(s,g,r):g.operator==="<"||g.operator==="<="?i=Wp(i,g,r):n.add(g.semver);if(n.size>1)return null;let o;if(s&&i){if(o=du(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let g of n){if(s&&!es(g,String(s),r)||i&&!es(g,String(i),r))return null;for(let m of e)if(!es(g,String(m),r))return!1;return!0}let a,u,c,l,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let g of e){if(l=l||g.operator===">"||g.operator===">=",c=c||g.operator==="<"||g.operator==="<=",s){if(f&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===f.major&&g.semver.minor===f.minor&&g.semver.patch===f.patch&&(f=!1),g.operator===">"||g.operator===">="){if(a=qp(s,g,r),a===g&&a!==s)return!1}else if(s.operator===">="&&!es(s.semver,String(g),r))return!1}if(i){if(d&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===d.major&&g.semver.minor===d.minor&&g.semver.patch===d.patch&&(d=!1),g.operator==="<"||g.operator==="<="){if(u=Wp(i,g,r),u===g&&u!==i)return!1}else if(i.operator==="<="&&!es(i.semver,String(g),r))return!1}if(!g.operator&&(i||s)&&o!==0)return!1}return!(s&&c&&!i&&o!==0||i&&l&&!s&&o!==0||f||d)},qp=(t,e,r)=>{if(!t)return e;let n=du(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Wp=(t,e,r)=>{if(!t)return e;let n=du(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Hp.exports=mw});var zp=v((dI,Gp)=>{"use strict";var fu=$n(),Up=zn(),yw=Be(),Vp=Xa(),vw=en(),_w=yh(),Ew=_h(),bw=Sh(),Sw=xh(),Cw=kh(),ww=Fh(),xw=Ih(),$w=Rh(),kw=mt(),Aw=Lh(),Fw=Mh(),jw=lo(),Iw=Zh(),Tw=Vh(),Rw=Xn(),Pw=fo(),Ow=Qa(),Nw=eu(),Lw=ho(),Bw=po(),Mw=tu(),qw=tp(),Ww=Jn(),Hw=gt(),Zw=Qn(),Uw=gp(),Vw=yp(),Gw=_p(),zw=Sp(),Yw=wp(),Xw=Do(),Jw=jp(),Kw=Tp(),Qw=Op(),ex=Lp(),tx=Zp();Gp.exports={parse:vw,valid:_w,clean:Ew,inc:bw,diff:Sw,major:Cw,minor:ww,patch:xw,prerelease:$w,compare:kw,rcompare:Aw,compareLoose:Fw,compareBuild:jw,sort:Iw,rsort:Tw,gt:Rw,lt:Pw,eq:Ow,neq:Nw,gte:Lw,lte:Bw,cmp:Mw,coerce:qw,Comparator:Ww,Range:Hw,satisfies:Zw,toComparators:Uw,maxSatisfying:Vw,minSatisfying:Gw,minVersion:zw,validRange:Yw,outside:Xw,gtr:Jw,ltr:Kw,intersects:Qw,simplifyRange:ex,subset:tx,SemVer:yw,re:fu.re,src:fu.src,tokens:fu.t,SEMVER_SPEC_VERSION:Up.SEMVER_SPEC_VERSION,RELEASE_TYPES:Up.RELEASE_TYPES,compareIdentifiers:Vp.compareIdentifiers,rcompareIdentifiers:Vp.rcompareIdentifiers}});var nr=v(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});var rx=(function(){function t(){}return t.prototype.diff=function(e,r,n){n===void 0&&(n={});var s;typeof n=="function"?(s=n,n={}):"callback"in n&&(s=n.callback);var i=this.castInput(e,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(i,n)),u=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,u,n,s)},t.prototype.diffWithOptionsObj=function(e,r,n,s){var i=this,o,a=function(T){if(T=i.postProcess(T,n),s){setTimeout(function(){s(T)},0);return}else return T},u=r.length,c=e.length,l=1,d=u+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));var f=(o=n.timeout)!==null&&o!==void 0?o:1/0,g=Date.now()+f,m=[{oldPos:-1,lastComponent:void 0}],D=this.extractCommon(m[0],r,e,0,n);if(m[0].oldPos+1>=c&&D+1>=u)return a(this.buildValues(m[0].lastComponent,r,e));var h=-1/0,w=1/0,C=function(){for(var T=Math.max(h,-l);T<=Math.min(w,l);T+=2){var G=void 0,I=m[T-1],Z=m[T+1];I&&(m[T-1]=void 0);var F=!1;if(Z){var W=Z.oldPos-T;F=Z&&0<=W&&W<u}var P=I&&I.oldPos+1<c;if(!F&&!P){m[T]=void 0;continue}if(!P||F&&I.oldPos<Z.oldPos?G=i.addToPath(Z,!0,!1,0,n):G=i.addToPath(I,!1,!0,1,n),D=i.extractCommon(G,r,e,T,n),G.oldPos+1>=c&&D+1>=u)return a(i.buildValues(G.lastComponent,r,e))||!0;m[T]=G,G.oldPos+1>=c&&(w=Math.min(w,T-1)),D+1>=u&&(h=Math.max(h,T+1))}l++};if(s)(function T(){setTimeout(function(){if(l>d||Date.now()>g)return s(void 0);C()||T()},0)})();else for(;l<=d&&Date.now()<=g;){var A=C();if(A)return A}},t.prototype.addToPath=function(e,r,n,s,i){var o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}},t.prototype.extractCommon=function(e,r,n,s,i){for(var o=r.length,a=n.length,u=e.oldPos,c=u-s,l=0;c+1<o&&u+1<a&&this.equals(n[u+1],r[c+1],i);)c++,u++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=u,c},t.prototype.equals=function(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()},t.prototype.removeEmpty=function(e){for(var r=[],n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r},t.prototype.castInput=function(e,r){return e},t.prototype.tokenize=function(e,r){return Array.from(e)},t.prototype.join=function(e){return e.join("")},t.prototype.postProcess=function(e,r){return e},Object.defineProperty(t.prototype,"useLongestToken",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.buildValues=function(e,r,n){for(var s=[],i;e;)s.push(e),i=e.previousComponent,delete e.previousComponent,e=i;s.reverse();for(var o=s.length,a=0,u=0,c=0;a<o;a++){var l=s[a];if(l.removed)l.value=this.join(n.slice(c,c+l.count)),c+=l.count;else{if(!l.added&&this.useLongestToken){var d=r.slice(u,u+l.count);d=d.map(function(f,g){var m=n[c+g];return m.length>f.length?m:f}),l.value=this.join(d)}else l.value=this.join(r.slice(u,u+l.count));u+=l.count,l.added||(c+=l.count)}}return s},t})();hu.default=rx});var Yp=v(Cr=>{"use strict";var nx=Cr&&Cr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Cr,"__esModule",{value:!0});Cr.characterDiff=void 0;Cr.diffChars=ix;var sx=nr(),ox=(function(t){nx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(sx.default);Cr.characterDiff=new ox;function ix(t,e,r){return Cr.characterDiff.diff(t,e,r)}});var mu=v(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.longestCommonPrefix=ax;Ge.longestCommonSuffix=ux;Ge.replacePrefix=Xp;Ge.replaceSuffix=Jp;Ge.removePrefix=cx;Ge.removeSuffix=lx;Ge.maximumOverlap=dx;Ge.hasOnlyWinLineEndings=hx;Ge.hasOnlyUnixLineEndings=px;Ge.segment=Kp;Ge.trailingWs=Qp;Ge.leadingWs=em;Ge.leadingAndTrailingWs=pu;function ax(t,e){var r;for(r=0;r<t.length&&r<e.length;r++)if(t[r]!=e[r])return t.slice(0,r);return t.slice(0,r)}function ux(t,e){var r;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(r=0;r<t.length&&r<e.length;r++)if(t[t.length-(r+1)]!=e[e.length-(r+1)])return t.slice(-r);return t.slice(-r)}function Xp(t,e,r){if(t.slice(0,e.length)!=e)throw Error("string ".concat(JSON.stringify(t)," doesn't start with prefix ").concat(JSON.stringify(e),"; this is a bug"));return r+t.slice(e.length)}function Jp(t,e,r){if(!e)return t+r;if(t.slice(-e.length)!=e)throw Error("string ".concat(JSON.stringify(t)," doesn't end with suffix ").concat(JSON.stringify(e),"; this is a bug"));return t.slice(0,-e.length)+r}function cx(t,e){return Xp(t,e,"")}function lx(t,e){return Jp(t,e,"")}function dx(t,e){return e.slice(0,fx(t,e))}function fx(t,e){var r=0;t.length>e.length&&(r=t.length-e.length);var n=e.length;t.length<e.length&&(n=t.length);var s=Array(n),i=0;s[0]=0;for(var o=1;o<n;o++){for(e[o]==e[i]?s[o]=s[i]:s[o]=i;i>0&&e[o]!=e[i];)i=s[i];e[o]==e[i]&&i++}i=0;for(var a=r;a<t.length;a++){for(;i>0&&t[a]!=e[i];)i=s[i];t[a]==e[i]&&i++}return i}function hx(t){return t.includes(`\r
3
+ var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Kt=v((UF,Oc)=>{var gy=require("crypto"),it=require("fs"),fn=require("path");function Pc(t,e,r={}){let{encoding:n="utf8",mode:s}=r,i=fn.dirname(t);it.mkdirSync(i,{recursive:!0});let o=fn.join(i,`.${fn.basename(t)}.tmp-${process.pid}-${gy.randomBytes(8).toString("hex")}`),a;try{a=it.openSync(o,"wx",s??420),it.writeSync(a,e,0,n),it.fsyncSync(a),it.closeSync(a),a=null,it.renameSync(o,t)}catch(u){if(a!=null)try{it.closeSync(a)}catch{}try{it.unlinkSync(o)}catch{}throw u}}function Dy(t,e,r={}){let n=JSON.stringify(e,null,2)+`
4
+ `;Pc(t,n,r)}function yy(t,e){let r;try{r=it.lstatSync(t)}catch(o){return o.code==="ENOENT"?{ok:!0,reason:"missing"}:{ok:!1,reason:`lstat: ${o.message}`}}if(r.isSymbolicLink())try{return it.unlinkSync(t),{ok:!0,reason:"symlink-unlinked"}}catch(o){return{ok:!1,reason:`unlink: ${o.message}`}}let n;try{n=it.realpathSync(e)}catch{n=fn.resolve(e)}let s;try{s=it.realpathSync(t)}catch(o){return{ok:!1,reason:`realpath: ${o.message}`}}let i=fn.relative(n,s);if(i.startsWith("..")||fn.isAbsolute(i))return{ok:!1,reason:"outside-root"};try{return it.rmSync(s,{recursive:!0,force:!0}),{ok:!0}}catch(o){return{ok:!1,reason:`rmSync: ${o.message}`}}}Oc.exports={writeFileAtomic:Pc,writeJsonAtomic:Dy,safeRmSync:yy}});var dr=v((VF,Nc)=>{"use strict";var vy=require("os");function _y(){return process.env.HOME||vy.homedir()}Nc.exports={homedir:_y}});var Pn=v((GF,ti)=>{var Cs=process||{},Lc=Cs.argv||[],Es=Cs.env||{},by=!(Es.NO_COLOR||Lc.includes("--no-color"))&&(!!Es.FORCE_COLOR||Lc.includes("--color")||Cs.platform==="win32"||(Cs.stdout||{}).isTTY&&Es.TERM!=="dumb"||!!Es.CI),Sy=(t,e,r=t)=>n=>{let s=""+n,i=s.indexOf(e,t.length);return~i?t+Ey(s,e,r,i)+e:t+s+e},Ey=(t,e,r,n)=>{let s="",i=0;do s+=t.substring(i,n)+r,i=n+e.length,n=t.indexOf(e,i);while(~n);return s+t.substring(i)},Bc=(t=by)=>{let e=t?Sy:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};ti.exports=Bc();ti.exports.createColors=Bc});var Wc=v(fr=>{"use strict";var Mc=fr&&fr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fr,"__esModule",{value:!0});fr.symbols=fr.isTTY=void 0;var Cy=Mc(require("node:tty")),Lt=Mc(require("node:process")),wy=Lt.default.env.CI||Lt.default.env.WT_SESSION||Lt.default.env.ConEmuTask==="{cmd::Cmder}"||Lt.default.env.TERM_PROGRAM==="vscode"||Lt.default.env.TERM==="xterm-256color"||Lt.default.env.TERM==="alacritty",qc=Cy.default.isatty(1)&&Lt.default.env.TERM!=="dumb"&&!("CI"in Lt.default.env);fr.isTTY=qc;var On=Lt.default.platform!=="win32"?Lt.default.env.TERM!=="linux":wy,xy={frames:qc?On?["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]:["-","\\","|","/"]:["-"],tick:On?"\u2714":"\u221A",cross:On?"\u2716":"\xD7",warn:On?"\u26A0":"!!",info:On?"\u2139":"i"};fr.symbols=xy});var Zc=v(Nn=>{"use strict";var ky=Nn&&Nn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.createSpinner=Ay;var Hc=ky(Pn()),Bt=Wc();function $y(t="",e=80){return t.replace(/\u001b[^m]*?m/g,"").split(`
5
+ `).reduce((r,n)=>r+=Math.max(1,Math.ceil(n.length/e)),0)}function Ay(t="",e={}){let r=0,n=e.interval||50,s=e.stream||process.stderr,i=e.frames&&e.frames.length?e.frames:Bt.symbols.frames,o=e.color||"yellow",a=!1,u=0,c,l=(C={})=>typeof C=="string"?C:C.text||t,d=(C={})=>typeof C=="string"?!1:!!C.update,f=(C={})=>typeof C=="string"||!C.color?o:C.color,g=(C={},A)=>typeof C=="string"||!C.mark?A:C.mark,m=()=>{process.on("SIGINT",w),process.on("SIGTERM",w)},y=()=>{process.off("SIGINT",w),process.off("SIGTERM",w)},h={reset(){return r=0,u=0,a=!1,clearTimeout(c),c=void 0,h},clear(){h.write("\x1B[1G");for(let C=0;C<u;C++)C>0&&h.write("\x1B[1A"),h.write("\x1B[2K\x1B[1G");return u=0,h},write(C,A=!1){return A&&Bt.isTTY&&h.clear(),s.write(C),h},render(){let C=`${Hc.default[o](i[r])} ${t}`;return Bt.isTTY?h.write("\x1B[?25l"):C+=`
6
+ `,h.write(C,!0),Bt.isTTY&&(u=$y(C,s.columns)),h},spin(){return h.render(),r=++r%i.length,h},update(C){return typeof C=="string"?t=C:(t=C.text||t,i=C.frames&&C.frames.length?C.frames:i,n=C.interval||n,o=C.color||o),i.length-1<r&&(r=0),h},loop(){return Bt.isTTY&&(c=setTimeout(()=>h.loop(),n)),h.spin()},start(C={}){return c&&h.reset(),a=!0,m(),h.update({text:l(C),color:f(C)}).loop()},stop(C){a=!1,clearTimeout(c),c=void 0,y();let A=d(C),T=Hc.default[f(C)](g(C,i[r])),V=l(C);return h.write(C?`${T} ${V}${A?"":`
7
+ `}`:"",!0),Bt.isTTY&&!A?h.write("\x1B[?25h"):h},success(C={}){return h.stop({text:l(C),mark:g(C,Bt.symbols.tick),color:"green",update:d(C)})},error(C={}){return h.stop({text:l(C),mark:g(C,Bt.symbols.cross),color:"red",update:d(C)})},warn(C={}){return h.stop({text:l(C),mark:g(C,Bt.symbols.warn),color:"yellow",update:d(C)})},info(C={}){return h.stop({text:l(C),mark:g(C,Bt.symbols.info),color:"blue",update:d(C)})},isSpinning(){return a}};function w(C){a&&h.stop(),process.exit(C==="SIGINT"?130:C==="SIGTERM"?143:1)}return h}});var Uc=v(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.splitWhen=hn.flatten=void 0;function Fy(t){return t.reduce((e,r)=>[].concat(e,r),[])}hn.flatten=Fy;function jy(t,e){let r=[[]],n=0;for(let s of t)e(s)?(n++,r[n]=[]):r[n].push(s);return r}hn.splitWhen=jy});var Vc=v(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.isEnoentCodeError=void 0;function Iy(t){return t.code==="ENOENT"}ws.isEnoentCodeError=Iy});var Gc=v(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.createDirentFromStats=void 0;var ri=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Ty(t,e){return new ri(t,e)}xs.createDirentFromStats=Ty});var Xc=v(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.convertPosixPathToPattern=je.convertWindowsPathToPattern=je.convertPathToPattern=je.escapePosixPath=je.escapeWindowsPath=je.escape=je.removeLeadingDotSegment=je.makeAbsolute=je.unixify=void 0;var Ry=require("os"),Py=require("path"),zc=Ry.platform()==="win32",Oy=2,Ny=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Ly=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,By=/^\\\\([.?])/,My=/\\(?![!()+@[\]{}])/g;function qy(t){return t.replace(/\\/g,"/")}je.unixify=qy;function Wy(t,e){return Py.resolve(t,e)}je.makeAbsolute=Wy;function Hy(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(Oy)}return t}je.removeLeadingDotSegment=Hy;je.escape=zc?ni:si;function ni(t){return t.replace(Ly,"\\$2")}je.escapeWindowsPath=ni;function si(t){return t.replace(Ny,"\\$2")}je.escapePosixPath=si;je.convertPathToPattern=zc?Yc:Jc;function Yc(t){return ni(t).replace(By,"//$1").replace(My,"/")}je.convertWindowsPathToPattern=Yc;function Jc(t){return si(t)}je.convertPosixPathToPattern=Jc});var Qc=v((ej,Kc)=>{Kc.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var rl=v((tj,tl)=>{var Zy=Qc(),el={"{":"}","(":")","[":"]"},Uy=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(i=t.indexOf(")",r),i>r&&(o=t.indexOf("\\",r),o===-1||o>i))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var u=el[a];if(u){var c=t.indexOf(u,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},Vy=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=el[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1)}if(t[e]==="!")return!0}else e++}return!1};tl.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(Zy(e))return!0;var n=Uy;return r&&r.strict===!1&&(n=Vy),n(e)}});var sl=v((rj,nl)=>{"use strict";var Gy=rl(),zy=require("path").posix.dirname,Yy=require("os").platform()==="win32",oi="/",Jy=/\\/g,Xy=/[\{\[].*[\}\]]$/,Ky=/(^|[^\\])([\{\[]|\([^\)]+$)/,Qy=/\\([\!\*\?\|\[\]\(\)\{\}])/g;nl.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Yy&&e.indexOf(oi)<0&&(e=e.replace(Jy,oi)),Xy.test(e)&&(e+=oi),e+="a";do e=zy(e);while(Gy(e)||Ky.test(e));return e.replace(Qy,"$1")}});var ks=v(ft=>{"use strict";ft.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;ft.find=(t,e)=>t.nodes.find(r=>r.type===e);ft.exceedsLimit=(t,e,r=1,n)=>n===!1||!ft.isInteger(t)||!ft.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;ft.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};ft.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;ft.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;ft.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;ft.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);ft.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s<n.length;s++){let i=n[s];if(Array.isArray(i)){r(i);continue}i!==void 0&&e.push(i)}return e};return r(t),e}});var $s=v((sj,il)=>{"use strict";var ol=ks();il.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&ol.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(i||o)&&ol.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)a+=r(u);return a};return r(t)}});var ul=v((oj,al)=>{"use strict";al.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var Dl=v((ij,gl)=>{"use strict";var cl=ul(),Pr=(t,e,r)=>{if(cl(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(cl(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),a=String(n.wrap),u=t+":"+e+"="+s+i+o+a;if(Pr.cache.hasOwnProperty(u))return Pr.cache[u].result;let c=Math.min(t,e),l=Math.max(t,e);if(Math.abs(c-l)===1){let y=t+"|"+e;return n.capture?`(${y})`:n.wrap===!1?y:`(?:${y})`}let d=ml(t)||ml(e),f={min:t,max:e,a:c,b:l},g=[],m=[];if(d&&(f.isPadded=d,f.maxLen=String(f.max).length),c<0){let y=l<0?Math.abs(l):1;m=ll(y,Math.abs(c),f,n),c=f.a=0}return l>=0&&(g=ll(c,l,f,n)),f.negatives=m,f.positives=g,f.result=ev(m,g,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&g.length+m.length>1&&(f.result=`(?:${f.result})`),Pr.cache[u]=f,f.result};function ev(t,e,r){let n=ii(t,e,"-",!1,r)||[],s=ii(e,t,"",!1,r)||[],i=ii(t,e,"-?",!0,r)||[];return n.concat(i).concat(s).join("|")}function tv(t,e){let r=1,n=1,s=fl(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=fl(t,r);for(s=hl(e+1,n)-1;t<s&&s<=e;)i.add(s),n+=1,s=hl(e+1,n)-1;return i=[...i],i.sort(sv),i}function rv(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=nv(t,e),s=n.length,i="",o=0;for(let a=0;a<s;a++){let[u,c]=n[a];u===c?i+=u:u!=="0"||c!=="9"?i+=ov(u,c,r):o++}return o&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function ll(t,e,r,n){let s=tv(t,e),i=[],o=t,a;for(let u=0;u<s.length;u++){let c=s[u],l=rv(String(o),String(c),n),d="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+pl(a.count),o=c+1;continue}r.isPadded&&(d=iv(c,r,n)),l.string=d+l.pattern+pl(l.count),i.push(l),o=c+1,a=l}return i}function ii(t,e,r,n,s){let i=[];for(let o of t){let{string:a}=o;!n&&!dl(e,"string",a)&&i.push(r+a),n&&dl(e,"string",a)&&i.push(r+a)}return i}function nv(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function sv(t,e){return t>e?1:e>t?-1:0}function dl(t,e,r){return t.some(n=>n[e]===r)}function fl(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function hl(t,e){return t-t%Math.pow(10,e)}function pl(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function ov(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function ml(t){return/^-?(0+)\d/.test(t)}function iv(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}Pr.cache={};Pr.clearCache=()=>Pr.cache={};gl.exports=Pr});var ci=v((aj,Cl)=>{"use strict";var av=require("util"),vl=Dl(),yl=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),uv=t=>e=>t===!0?Number(e):String(e),ai=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ln=t=>Number.isInteger(+t),ui=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},cv=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,lv=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},Fs=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},dv=(t,e,r)=>{t.negatives.sort((a,u)=>a<u?-1:a>u?1:0),t.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=e.capture?"":"?:",s="",i="",o;return t.positives.length&&(s=t.positives.map(a=>Fs(String(a),r)).join("|")),t.negatives.length&&(i=`-(${n}${t.negatives.map(a=>Fs(String(a),r)).join("|")})`),s&&i?o=`${s}|${i}`:o=s||i,e.wrap?`(${n}${o})`:o},_l=(t,e,r,n)=>{if(r)return vl(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return`[${s}-${i}]`},bl=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return vl(t,e,r)},Sl=(...t)=>new RangeError("Invalid range arguments: "+av.inspect(...t)),El=(t,e,r)=>{if(r.strictRanges===!0)throw Sl([t,e]);return[]},fv=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},hv=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw Sl([t,e]);return[]}s===0&&(s=0),i===0&&(i=0);let o=s>i,a=String(t),u=String(e),c=String(r);r=Math.max(Math.abs(r),1);let l=ui(a)||ui(u)||ui(c),d=l?Math.max(a.length,u.length,c.length):0,f=l===!1&&cv(t,e,n)===!1,g=n.transform||uv(f);if(n.toRegex&&r===1)return _l(Fs(t,d),Fs(e,d),!0,n);let m={negatives:[],positives:[]},y=C=>m[C<0?"negatives":"positives"].push(Math.abs(C)),h=[],w=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?y(s):h.push(lv(g(s,w),d,f)),s=o?s-r:s+r,w++;return n.toRegex===!0?r>1?dv(m,n,d):bl(h,null,{wrap:!1,...n}):h},pv=(t,e,r=1,n={})=>{if(!Ln(t)&&t.length>1||!Ln(e)&&e.length>1)return El(t,e,n);let s=n.transform||(f=>String.fromCharCode(f)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=i>o,u=Math.min(i,o),c=Math.max(i,o);if(n.toRegex&&r===1)return _l(u,c,!1,n);let l=[],d=0;for(;a?i>=o:i<=o;)l.push(s(i,d)),i=a?i-r:i+r,d++;return n.toRegex===!0?bl(l,null,{wrap:!1,options:n}):l},As=(t,e,r,n={})=>{if(e==null&&ai(t))return[t];if(!ai(t)||!ai(e))return El(t,e,n);if(typeof r=="function")return As(t,e,1,{transform:r});if(yl(r))return As(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Ln(r)?Ln(t)&&Ln(e)?hv(t,e,r,s):pv(t,e,Math.max(Math.abs(r),1),s):r!=null&&!yl(r)?fv(r,s):As(t,e,1,r)};Cl.exports=As});var kl=v((uj,xl)=>{"use strict";var mv=ci(),wl=ks(),gv=(t,e={})=>{let r=(n,s={})=>{let i=wl.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a=i===!0||o===!0,u=e.escapeInvalid===!0?"\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return a?u+n.value:"(";if(n.type==="close")return a?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=wl.reduce(n.nodes),d=mv(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return l.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(t)};xl.exports=gv});var Fl=v((cj,Al)=>{"use strict";var Dv=ci(),$l=$s(),pn=ks(),Or=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?pn.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(Or(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Or(s,i,r):s+i);return pn.flatten(n)},yv=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,a=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(s.invalid||s.dollar){a.push(Or(a.pop(),$l(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){a.push(Or(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let d=pn.reduce(s.nodes);if(pn.exceedsLimit(...d,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=Dv(...d,e);f.length===0&&(f=$l(s,e)),a.push(Or(a.pop(),f)),s.nodes=[];return}let u=pn.encloseBrace(s),c=s.queue,l=s;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let d=0;d<s.nodes.length;d++){let f=s.nodes[d];if(f.type==="comma"&&s.type==="brace"){d===1&&c.push(""),c.push("");continue}if(f.type==="close"){a.push(Or(a.pop(),c,u));continue}if(f.value&&f.type!=="open"){c.push(Or(c.pop(),f.value));continue}f.nodes&&n(f,s)}return c};return pn.flatten(n(t))};Al.exports=yv});var Il=v((lj,jl)=>{"use strict";jl.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
8
+ `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Nl=v((dj,Ol)=>{"use strict";var vv=$s(),{MAX_LENGTH:Tl,CHAR_BACKSLASH:li,CHAR_BACKTICK:_v,CHAR_COMMA:bv,CHAR_DOT:Sv,CHAR_LEFT_PARENTHESES:Ev,CHAR_RIGHT_PARENTHESES:Cv,CHAR_LEFT_CURLY_BRACE:wv,CHAR_RIGHT_CURLY_BRACE:xv,CHAR_LEFT_SQUARE_BRACKET:Rl,CHAR_RIGHT_SQUARE_BRACKET:Pl,CHAR_DOUBLE_QUOTE:kv,CHAR_SINGLE_QUOTE:$v,CHAR_NO_BREAK_SPACE:Av,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Fv}=Il(),jv=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(Tl,r.maxLength):Tl;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,a=s,u=0,c=t.length,l=0,d=0,f,g=()=>t[l++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return o.nodes.push(y),y.parent=o,y.prev=a,a=y,y};for(m({type:"bos"});l<c;)if(o=i[i.length-1],f=g(),!(f===Fv||f===Av)){if(f===li){m({type:"text",value:(e.keepEscaping?f:"")+g()});continue}if(f===Pl){m({type:"text",value:"\\"+f});continue}if(f===Rl){u++;let y;for(;l<c&&(y=g());){if(f+=y,y===Rl){u++;continue}if(y===li){f+=g();continue}if(y===Pl&&(u--,u===0))break}m({type:"text",value:f});continue}if(f===Ev){o=m({type:"paren",nodes:[]}),i.push(o),m({type:"text",value:f});continue}if(f===Cv){if(o.type!=="paren"){m({type:"text",value:f});continue}o=i.pop(),m({type:"text",value:f}),o=i[i.length-1];continue}if(f===kv||f===$v||f===_v){let y=f,h;for(e.keepQuotes!==!0&&(f="");l<c&&(h=g());){if(h===li){f+=h+g();continue}if(h===y){e.keepQuotes===!0&&(f+=h);break}f+=h}m({type:"text",value:f});continue}if(f===wv){d++;let h={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};o=m(h),i.push(o),m({type:"open",value:f});continue}if(f===xv){if(o.type!=="brace"){m({type:"text",value:f});continue}let y="close";o=i.pop(),o.close=!0,m({type:y,value:f}),d--,o=i[i.length-1];continue}if(f===bv&&d>0){if(o.ranges>0){o.ranges=0;let y=o.nodes.shift();o.nodes=[y,{type:"text",value:vv(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===Sv&&d>0&&o.commas===0){let y=o.nodes;if(d===0||y.length===0){m({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){y.pop();let h=y[y.length-1];h.value+=a.value+f,a=h,o.ranges--;continue}m({type:"dot",value:f});continue}m({type:"text",value:f})}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});let y=i[i.length-1],h=y.nodes.indexOf(o);y.nodes.splice(h,1,...o.nodes)}while(i.length>0);return m({type:"eos"}),s};Ol.exports=jv});var Ml=v((fj,Bl)=>{"use strict";var Ll=$s(),Iv=kl(),Tv=Fl(),Rv=Nl(),at=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=at.create(n,e);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(at.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};at.parse=(t,e={})=>Rv(t,e);at.stringify=(t,e={})=>Ll(typeof t=="string"?at.parse(t,e):t,e);at.compile=(t,e={})=>(typeof t=="string"&&(t=at.parse(t,e)),Iv(t,e));at.expand=(t,e={})=>{typeof t=="string"&&(t=at.parse(t,e));let r=Tv(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};at.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?at.compile(t,e):at.expand(t,e);Bl.exports=at});var Bn=v((hj,Ul)=>{"use strict";var Pv=require("path"),Mt="\\\\/",ql=`[^${Mt}]`,Ov=0,Qt="\\.",Nv="\\+",Lv="\\?",js="\\/",Bv="(?=.)",Wl="[^/]",di=`(?:${js}|$)`,Hl=`(?:^|${js})`,fi=`${Qt}{1,2}${di}`,Mv=`(?!${Qt})`,qv=`(?!${Hl}${fi})`,Wv=`(?!${Qt}{0,1}${di})`,Hv=`(?!${fi})`,Zv=`[^.${js}]`,Uv=`${Wl}*?`,Zl={DOT_LITERAL:Qt,PLUS_LITERAL:Nv,QMARK_LITERAL:Lv,SLASH_LITERAL:js,ONE_CHAR:Bv,QMARK:Wl,END_ANCHOR:di,DOTS_SLASH:fi,NO_DOT:Mv,NO_DOTS:qv,NO_DOT_SLASH:Wv,NO_DOTS_SLASH:Hv,QMARK_NO_DOT:Zv,STAR:Uv,START_ANCHOR:Hl},Vv={...Zl,SLASH_LITERAL:`[${Mt}]`,QMARK:ql,STAR:`${ql}*?`,DOTS_SLASH:`${Qt}{1,2}(?:[${Mt}]|$)`,NO_DOT:`(?!${Qt})`,NO_DOTS:`(?!(?:^|[${Mt}])${Qt}{1,2}(?:[${Mt}]|$))`,NO_DOT_SLASH:`(?!${Qt}{0,1}(?:[${Mt}]|$))`,NO_DOTS_SLASH:`(?!${Qt}{1,2}(?:[${Mt}]|$))`,QMARK_NO_DOT:`[^.${Mt}]`,START_ANCHOR:`(?:^|[${Mt}])`,END_ANCHOR:`(?:[${Mt}]|$)`},Gv={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Ul.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Ov,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Gv,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Pv.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Vv:Zl}}});var Mn=v(Qe=>{"use strict";var zv=require("path"),Yv=process.platform==="win32",{REGEX_BACKSLASH:Jv,REGEX_REMOVE_BACKSLASH:Xv,REGEX_SPECIAL_CHARS:Kv,REGEX_SPECIAL_CHARS_GLOBAL:Qv}=Bn();Qe.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Qe.hasRegexChars=t=>Kv.test(t);Qe.isRegexChar=t=>t.length===1&&Qe.hasRegexChars(t);Qe.escapeRegex=t=>t.replace(Qv,"\\$1");Qe.toPosixSlashes=t=>t.replace(Jv,"/");Qe.removeBackslashes=t=>t.replace(Xv,e=>e==="\\"?"":e);Qe.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Qe.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:Yv===!0||zv.sep==="\\";Qe.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Qe.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Qe.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Qe.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Ql=v((mj,Kl)=>{"use strict";var Vl=Mn(),{CHAR_ASTERISK:hi,CHAR_AT:e0,CHAR_BACKWARD_SLASH:qn,CHAR_COMMA:t0,CHAR_DOT:pi,CHAR_EXCLAMATION_MARK:mi,CHAR_FORWARD_SLASH:Xl,CHAR_LEFT_CURLY_BRACE:gi,CHAR_LEFT_PARENTHESES:Di,CHAR_LEFT_SQUARE_BRACKET:r0,CHAR_PLUS:n0,CHAR_QUESTION_MARK:Gl,CHAR_RIGHT_CURLY_BRACE:s0,CHAR_RIGHT_PARENTHESES:zl,CHAR_RIGHT_SQUARE_BRACKET:o0}=Bn(),Yl=t=>t===Xl||t===qn,Jl=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},i0=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],a=[],u=t,c=-1,l=0,d=0,f=!1,g=!1,m=!1,y=!1,h=!1,w=!1,C=!1,A=!1,T=!1,V=!1,I=0,H,F,q={value:"",depth:0,isGlob:!1},P=()=>c>=n,b=()=>u.charCodeAt(c+1),Q=()=>(H=F,u.charCodeAt(++c));for(;c<n;){F=Q();let he;if(F===qn){C=q.backslashes=!0,F=Q(),F===gi&&(w=!0);continue}if(w===!0||F===gi){for(I++;P()!==!0&&(F=Q());){if(F===qn){C=q.backslashes=!0,Q();continue}if(F===gi){I++;continue}if(w!==!0&&F===pi&&(F=Q())===pi){if(f=q.isBrace=!0,m=q.isGlob=!0,V=!0,s===!0)continue;break}if(w!==!0&&F===t0){if(f=q.isBrace=!0,m=q.isGlob=!0,V=!0,s===!0)continue;break}if(F===s0&&(I--,I===0)){w=!1,f=q.isBrace=!0,V=!0;break}}if(s===!0)continue;break}if(F===Xl){if(i.push(c),o.push(q),q={value:"",depth:0,isGlob:!1},V===!0)continue;if(H===pi&&c===l+1){l+=2;continue}d=c+1;continue}if(r.noext!==!0&&(F===n0||F===e0||F===hi||F===Gl||F===mi)===!0&&b()===Di){if(m=q.isGlob=!0,y=q.isExtglob=!0,V=!0,F===mi&&c===l&&(T=!0),s===!0){for(;P()!==!0&&(F=Q());){if(F===qn){C=q.backslashes=!0,F=Q();continue}if(F===zl){m=q.isGlob=!0,V=!0;break}}continue}break}if(F===hi){if(H===hi&&(h=q.isGlobstar=!0),m=q.isGlob=!0,V=!0,s===!0)continue;break}if(F===Gl){if(m=q.isGlob=!0,V=!0,s===!0)continue;break}if(F===r0){for(;P()!==!0&&(he=Q());){if(he===qn){C=q.backslashes=!0,Q();continue}if(he===o0){g=q.isBracket=!0,m=q.isGlob=!0,V=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&F===mi&&c===l){A=q.negated=!0,l++;continue}if(r.noparen!==!0&&F===Di){if(m=q.isGlob=!0,s===!0){for(;P()!==!0&&(F=Q());){if(F===Di){C=q.backslashes=!0,F=Q();continue}if(F===zl){V=!0;break}}continue}break}if(m===!0){if(V=!0,s===!0)continue;break}}r.noext===!0&&(y=!1,m=!1);let re=u,de="",x="";l>0&&(de=u.slice(0,l),u=u.slice(l),d-=l),re&&m===!0&&d>0?(re=u.slice(0,d),x=u.slice(d)):m===!0?(re="",x=u):re=u,re&&re!==""&&re!=="/"&&re!==u&&Yl(re.charCodeAt(re.length-1))&&(re=re.slice(0,-1)),r.unescape===!0&&(x&&(x=Vl.removeBackslashes(x)),re&&C===!0&&(re=Vl.removeBackslashes(re)));let k={prefix:de,input:t,start:l,base:re,glob:x,isBrace:f,isBracket:g,isGlob:m,isExtglob:y,isGlobstar:h,negated:A,negatedExtglob:T};if(r.tokens===!0&&(k.maxDepth=0,Yl(F)||o.push(q),k.tokens=o),r.parts===!0||r.tokens===!0){let he;for(let X=0;X<i.length;X++){let Ee=he?he+1:l,ot=i[X],Oe=t.slice(Ee,ot);r.tokens&&(X===0&&l!==0?(o[X].isPrefix=!0,o[X].value=de):o[X].value=Oe,Jl(o[X]),k.maxDepth+=o[X].depth),(X!==0||Oe!=="")&&a.push(Oe),he=ot}if(he&&he+1<t.length){let X=t.slice(he+1);a.push(X),r.tokens&&(o[o.length-1].value=X,Jl(o[o.length-1]),k.maxDepth+=o[o.length-1].depth)}k.slashes=i,k.parts=a}return k};Kl.exports=i0});var sd=v((gj,nd)=>{"use strict";var Wn=Bn(),Ne=Mn(),{MAX_LENGTH:Is,POSIX_REGEX_SOURCE:a0,REGEX_NON_SPECIAL_CHARS:u0,REGEX_SPECIAL_CHARS_BACKREF:c0,REPLACEMENTS:ed}=Wn,l0=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(s=>Ne.escapeRegex(s)).join("..")}return r},mn=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,td=t=>{let e=[],r=0,n=0,s=0,i="",o=!1;for(let a of t){if(o===!0){i+=a,o=!1;continue}if(a==="\\"){i+=a,o=!0;continue}if(a==='"'){s=s===1?0:1,i+=a;continue}if(s===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(i),i="";continue}}}i+=a}return e.push(i),e},d0=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},rd=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(d0(e))return e.replace(/\\(.)/g,"$1")},f0=t=>{let e=t.map(rd).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let s=e[r],i=e[n],o=s[0];if(!(!o||s!==o.repeat(s.length)||i!==o.repeat(i.length))&&(s===i||s.startsWith(i)||i.startsWith(s)))return!0}return!1},yi=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,s=0,i=!1;for(let o=1;o<t.length;o++){let a=t[o];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){s=s===1?0:1;continue}if(s!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==t.length-1?void 0:{type:t[0],body:t.slice(2,o),end:o}}}}},h0=t=>{let e=0,r=[];for(;e<t.length;){let s=yi(t.slice(e),!1);if(!s||s.type!=="*")return;let i=td(s.body).map(a=>a.trim());if(i.length!==1)return;let o=rd(i[0]);if(!o||o.length!==1)return;r.push(o),e+=s.end+1}return r.length<1?void 0:`${r.length===1?Ne.escapeRegex(r[0]):`[${r.map(s=>Ne.escapeRegex(s)).join("")}]`}*`},p0=t=>{let e=0,r=t.trim(),n=yi(r);for(;n;)e++,r=n.body.trim(),n=yi(r);return e},m0=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Wn.DEFAULT_MAX_EXTGLOB_RECURSION,n=td(t).map(s=>s.trim());if(n.length>1&&(n.some(s=>s==="")||n.some(s=>/^[*?]+$/.test(s))||f0(n)))return{risky:!0};for(let s of n){let i=h0(s);if(i)return{risky:!0,safeOutput:i};if(p0(s)>r)return{risky:!0}}return{risky:!1}},vi=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=ed[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Is,r.maxLength):Is,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],a=r.capture?"":"?:",u=Ne.isWindows(e),c=Wn.globChars(u),l=Wn.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:y,NO_DOT:h,NO_DOT_SLASH:w,NO_DOTS_SLASH:C,QMARK:A,QMARK_NO_DOT:T,STAR:V,START_ANCHOR:I}=c,H=N=>`(${a}(?:(?!${I}${N.dot?y:d}).)*?)`,F=r.dot?"":h,q=r.dot?A:T,P=r.bash===!0?H(r):V;r.capture&&(P=`(${P})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let b={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=Ne.removePrefix(t,b),s=t.length;let Q=[],re=[],de=[],x=i,k,he=()=>b.index===s-1,X=b.peek=(N=1)=>t[b.index+N],Ee=b.advance=()=>t[++b.index]||"",ot=()=>t.slice(b.index+1),Oe=(N="",ve=0)=>{b.consumed+=N,b.index+=ve},Ct=N=>{b.output+=N.output!=null?N.output:N.value,Oe(N.value)},_s=()=>{let N=1;for(;X()==="!"&&(X(2)!=="("||X(3)==="?");)Ee(),b.start++,N++;return N%2===0?!1:(b.negated=!0,b.start++,!0)},Tr=N=>{b[N]++,de.push(N)},Ve=N=>{b[N]--,de.pop()},oe=N=>{if(x.type==="globstar"){let ve=b.braces>0&&(N.type==="comma"||N.type==="brace"),B=N.extglob===!0||Q.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!ve&&!B&&(b.output=b.output.slice(0,-x.output.length),x.type="star",x.value="*",x.output=P,b.output+=x.output)}if(Q.length&&N.type!=="paren"&&(Q[Q.length-1].inner+=N.value),(N.value||N.output)&&Ct(N),x&&x.type==="text"&&N.type==="text"){x.value+=N.value,x.output=(x.output||"")+N.value;return}N.prev=x,o.push(N),x=N},Rr=(N,ve)=>{let B={...l[ve],conditions:1,inner:""};B.prev=x,B.parens=b.parens,B.output=b.output,B.startIndex=b.index,B.tokensIndex=o.length;let le=(r.capture?"(":"")+B.open;Tr("parens"),oe({type:N,value:ve,output:b.output?"":m}),oe({type:"paren",extglob:!0,value:Ee(),output:le}),Q.push(B)},bs=N=>{let ve=t.slice(N.startIndex,b.index+1),B=t.slice(N.startIndex+2,b.index),le=m0(B,r);if((N.type==="plus"||N.type==="star")&&le.risky){let j=le.safeOutput?(N.output?"":m)+(r.capture?`(${le.safeOutput})`:le.safeOutput):void 0,z=o[N.tokensIndex];z.type="text",z.value=ve,z.output=j||Ne.escapeRegex(ve);for(let ee=N.tokensIndex+1;ee<o.length;ee++)o[ee].value="",o[ee].output="",delete o[ee].suffix;b.output=N.output+z.output,b.backtrack=!0,oe({type:"paren",extglob:!0,value:k,output:""}),Ve("parens");return}let $=N.close+(r.capture?")":""),R;if(N.type==="negate"){let j=P;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(j=H(r)),(j!==P||he()||/^\)+$/.test(ot()))&&($=N.close=`)$))${j}`),N.inner.includes("*")&&(R=ot())&&/^\.[^\\/.]+$/.test(R)){let z=vi(R,{...e,fastpaths:!1}).output;$=N.close=`)${z})${j})`}N.prev.type==="bos"&&(b.negatedExtglob=!0)}oe({type:"paren",extglob:!0,value:k,output:$}),Ve("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let N=!1,ve=t.replace(c0,(B,le,$,R,j,z)=>R==="\\"?(N=!0,B):R==="?"?le?le+R+(j?A.repeat(j.length):""):z===0?q+(j?A.repeat(j.length):""):A.repeat($.length):R==="."?d.repeat($.length):R==="*"?le?le+R+(j?P:""):P:le?B:`\\${B}`);return N===!0&&(r.unescape===!0?ve=ve.replace(/\\/g,""):ve=ve.replace(/\\+/g,B=>B.length%2===0?"\\\\":B?"\\":"")),ve===t&&r.contains===!0?(b.output=t,b):(b.output=Ne.wrapOutput(ve,b,e),b)}for(;!he();){if(k=Ee(),k==="\0")continue;if(k==="\\"){let B=X();if(B==="/"&&r.bash!==!0||B==="."||B===";")continue;if(!B){k+="\\",oe({type:"text",value:k});continue}let le=/^\\+/.exec(ot()),$=0;if(le&&le[0].length>2&&($=le[0].length,b.index+=$,$%2!==0&&(k+="\\")),r.unescape===!0?k=Ee():k+=Ee(),b.brackets===0){oe({type:"text",value:k});continue}}if(b.brackets>0&&(k!=="]"||x.value==="["||x.value==="[^")){if(r.posix!==!1&&k===":"){let B=x.value.slice(1);if(B.includes("[")&&(x.posix=!0,B.includes(":"))){let le=x.value.lastIndexOf("["),$=x.value.slice(0,le),R=x.value.slice(le+2),j=a0[R];if(j){x.value=$+j,b.backtrack=!0,Ee(),!i.output&&o.indexOf(x)===1&&(i.output=m);continue}}}(k==="["&&X()!==":"||k==="-"&&X()==="]")&&(k=`\\${k}`),k==="]"&&(x.value==="["||x.value==="[^")&&(k=`\\${k}`),r.posix===!0&&k==="!"&&x.value==="["&&(k="^"),x.value+=k,Ct({value:k});continue}if(b.quotes===1&&k!=='"'){k=Ne.escapeRegex(k),x.value+=k,Ct({value:k});continue}if(k==='"'){b.quotes=b.quotes===1?0:1,r.keepQuotes===!0&&oe({type:"text",value:k});continue}if(k==="("){Tr("parens"),oe({type:"paren",value:k});continue}if(k===")"){if(b.parens===0&&r.strictBrackets===!0)throw new SyntaxError(mn("opening","("));let B=Q[Q.length-1];if(B&&b.parens===B.parens+1){bs(Q.pop());continue}oe({type:"paren",value:k,output:b.parens?")":"\\)"}),Ve("parens");continue}if(k==="["){if(r.nobracket===!0||!ot().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(mn("closing","]"));k=`\\${k}`}else Tr("brackets");oe({type:"bracket",value:k});continue}if(k==="]"){if(r.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){oe({type:"text",value:k,output:`\\${k}`});continue}if(b.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(mn("opening","["));oe({type:"text",value:k,output:`\\${k}`});continue}Ve("brackets");let B=x.value.slice(1);if(x.posix!==!0&&B[0]==="^"&&!B.includes("/")&&(k=`/${k}`),x.value+=k,Ct({value:k}),r.literalBrackets===!1||Ne.hasRegexChars(B))continue;let le=Ne.escapeRegex(x.value);if(b.output=b.output.slice(0,-x.value.length),r.literalBrackets===!0){b.output+=le,x.value=le;continue}x.value=`(${a}${le}|${x.value})`,b.output+=x.value;continue}if(k==="{"&&r.nobrace!==!0){Tr("braces");let B={type:"brace",value:k,output:"(",outputIndex:b.output.length,tokensIndex:b.tokens.length};re.push(B),oe(B);continue}if(k==="}"){let B=re[re.length-1];if(r.nobrace===!0||!B){oe({type:"text",value:k,output:k});continue}let le=")";if(B.dots===!0){let $=o.slice(),R=[];for(let j=$.length-1;j>=0&&(o.pop(),$[j].type!=="brace");j--)$[j].type!=="dots"&&R.unshift($[j].value);le=l0(R,r),b.backtrack=!0}if(B.comma!==!0&&B.dots!==!0){let $=b.output.slice(0,B.outputIndex),R=b.tokens.slice(B.tokensIndex);B.value=B.output="\\{",k=le="\\}",b.output=$;for(let j of R)b.output+=j.output||j.value}oe({type:"brace",value:k,output:le}),Ve("braces"),re.pop();continue}if(k==="|"){Q.length>0&&Q[Q.length-1].conditions++,oe({type:"text",value:k});continue}if(k===","){let B=k,le=re[re.length-1];le&&de[de.length-1]==="braces"&&(le.comma=!0,B="|"),oe({type:"comma",value:k,output:B});continue}if(k==="/"){if(x.type==="dot"&&b.index===b.start+1){b.start=b.index+1,b.consumed="",b.output="",o.pop(),x=i;continue}oe({type:"slash",value:k,output:g});continue}if(k==="."){if(b.braces>0&&x.type==="dot"){x.value==="."&&(x.output=d);let B=re[re.length-1];x.type="dots",x.output+=k,x.value+=k,B.dots=!0;continue}if(b.braces+b.parens===0&&x.type!=="bos"&&x.type!=="slash"){oe({type:"text",value:k,output:d});continue}oe({type:"dot",value:k,output:d});continue}if(k==="?"){if(!(x&&x.value==="(")&&r.noextglob!==!0&&X()==="("&&X(2)!=="?"){Rr("qmark",k);continue}if(x&&x.type==="paren"){let le=X(),$=k;if(le==="<"&&!Ne.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(x.value==="("&&!/[!=<:]/.test(le)||le==="<"&&!/<([!=]|\w+>)/.test(ot()))&&($=`\\${k}`),oe({type:"text",value:k,output:$});continue}if(r.dot!==!0&&(x.type==="slash"||x.type==="bos")){oe({type:"qmark",value:k,output:T});continue}oe({type:"qmark",value:k,output:A});continue}if(k==="!"){if(r.noextglob!==!0&&X()==="("&&(X(2)!=="?"||!/[!=<:]/.test(X(3)))){Rr("negate",k);continue}if(r.nonegate!==!0&&b.index===0){_s();continue}}if(k==="+"){if(r.noextglob!==!0&&X()==="("&&X(2)!=="?"){Rr("plus",k);continue}if(x&&x.value==="("||r.regex===!1){oe({type:"plus",value:k,output:f});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.type==="brace")||b.parens>0){oe({type:"plus",value:k});continue}oe({type:"plus",value:f});continue}if(k==="@"){if(r.noextglob!==!0&&X()==="("&&X(2)!=="?"){oe({type:"at",extglob:!0,value:k,output:""});continue}oe({type:"text",value:k});continue}if(k!=="*"){(k==="$"||k==="^")&&(k=`\\${k}`);let B=u0.exec(ot());B&&(k+=B[0],b.index+=B[0].length),oe({type:"text",value:k});continue}if(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=k,x.output=P,b.backtrack=!0,b.globstar=!0,Oe(k);continue}let N=ot();if(r.noextglob!==!0&&/^\([^?]/.test(N)){Rr("star",k);continue}if(x.type==="star"){if(r.noglobstar===!0){Oe(k);continue}let B=x.prev,le=B.prev,$=B.type==="slash"||B.type==="bos",R=le&&(le.type==="star"||le.type==="globstar");if(r.bash===!0&&(!$||N[0]&&N[0]!=="/")){oe({type:"star",value:k,output:""});continue}let j=b.braces>0&&(B.type==="comma"||B.type==="brace"),z=Q.length&&(B.type==="pipe"||B.type==="paren");if(!$&&B.type!=="paren"&&!j&&!z){oe({type:"star",value:k,output:""});continue}for(;N.slice(0,3)==="/**";){let ee=t[b.index+4];if(ee&&ee!=="/")break;N=N.slice(3),Oe("/**",3)}if(B.type==="bos"&&he()){x.type="globstar",x.value+=k,x.output=H(r),b.output=x.output,b.globstar=!0,Oe(k);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&!R&&he()){b.output=b.output.slice(0,-(B.output+x.output).length),B.output=`(?:${B.output}`,x.type="globstar",x.output=H(r)+(r.strictSlashes?")":"|$)"),x.value+=k,b.globstar=!0,b.output+=B.output+x.output,Oe(k);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&N[0]==="/"){let ee=N[1]!==void 0?"|$":"";b.output=b.output.slice(0,-(B.output+x.output).length),B.output=`(?:${B.output}`,x.type="globstar",x.output=`${H(r)}${g}|${g}${ee})`,x.value+=k,b.output+=B.output+x.output,b.globstar=!0,Oe(k+Ee()),oe({type:"slash",value:"/",output:""});continue}if(B.type==="bos"&&N[0]==="/"){x.type="globstar",x.value+=k,x.output=`(?:^|${g}|${H(r)}${g})`,b.output=x.output,b.globstar=!0,Oe(k+Ee()),oe({type:"slash",value:"/",output:""});continue}b.output=b.output.slice(0,-x.output.length),x.type="globstar",x.output=H(r),x.value+=k,b.output+=x.output,b.globstar=!0,Oe(k);continue}let ve={type:"star",value:k,output:P};if(r.bash===!0){ve.output=".*?",(x.type==="bos"||x.type==="slash")&&(ve.output=F+ve.output),oe(ve);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&r.regex===!0){ve.output=k,oe(ve);continue}(b.index===b.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?(b.output+=w,x.output+=w):r.dot===!0?(b.output+=C,x.output+=C):(b.output+=F,x.output+=F),X()!=="*"&&(b.output+=m,x.output+=m)),oe(ve)}for(;b.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(mn("closing","]"));b.output=Ne.escapeLast(b.output,"["),Ve("brackets")}for(;b.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(mn("closing",")"));b.output=Ne.escapeLast(b.output,"("),Ve("parens")}for(;b.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(mn("closing","}"));b.output=Ne.escapeLast(b.output,"{"),Ve("braces")}if(r.strictSlashes!==!0&&(x.type==="star"||x.type==="bracket")&&oe({type:"maybe_slash",value:"",output:`${g}?`}),b.backtrack===!0){b.output="";for(let N of b.tokens)b.output+=N.output!=null?N.output:N.value,N.suffix&&(b.output+=N.suffix)}return b};vi.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Is,r.maxLength):Is,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=ed[t]||t;let i=Ne.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:g,START_ANCHOR:m}=Wn.globChars(i),y=r.dot?d:l,h=r.dot?f:l,w=r.capture?"":"?:",C={negated:!1,prefix:""},A=r.bash===!0?".*?":g;r.capture&&(A=`(${A})`);let T=F=>F.noglobstar===!0?A:`(${w}(?:(?!${m}${F.dot?c:o}).)*?)`,V=F=>{switch(F){case"*":return`${y}${u}${A}`;case".*":return`${o}${u}${A}`;case"*.*":return`${y}${A}${o}${u}${A}`;case"*/*":return`${y}${A}${a}${u}${h}${A}`;case"**":return y+T(r);case"**/*":return`(?:${y}${T(r)}${a})?${h}${u}${A}`;case"**/*.*":return`(?:${y}${T(r)}${a})?${h}${A}${o}${u}${A}`;case"**/.*":return`(?:${y}${T(r)}${a})?${o}${u}${A}`;default:{let q=/^(.*?)\.(\w+)$/.exec(F);if(!q)return;let P=V(q[1]);return P?P+o+q[2]:void 0}}},I=Ne.removePrefix(t,C),H=V(I);return H&&r.strictSlashes!==!0&&(H+=`${a}?`),H};nd.exports=vi});var id=v((Dj,od)=>{"use strict";var g0=require("path"),D0=Ql(),_i=sd(),bi=Mn(),y0=Bn(),v0=t=>t&&typeof t=="object"&&!Array.isArray(t),Ae=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(f=>Ae(f,e,r));return f=>{for(let g of l){let m=g(f);if(m)return m}return!1}}let n=v0(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=bi.isWindows(e),o=n?Ae.compileRe(t,e):Ae.makeRe(t,e,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(s.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=Ae(s.ignore,l,r)}let c=(l,d=!1)=>{let{isMatch:f,match:g,output:m}=Ae.test(l,o,e,{glob:t,posix:i}),y={glob:t,state:a,regex:o,posix:i,input:l,output:m,match:g,isMatch:f};return typeof s.onResult=="function"&&s.onResult(y),f===!1?(y.isMatch=!1,d?y:!1):u(l)?(typeof s.onIgnore=="function"&&s.onIgnore(y),y.isMatch=!1,d?y:!1):(typeof s.onMatch=="function"&&s.onMatch(y),d?y:!0)};return r&&(c.state=a),c};Ae.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let i=r||{},o=i.format||(s?bi.toPosixSlashes:null),a=t===n,u=a&&o?o(t):t;return a===!1&&(u=o?o(t):t,a=u===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=Ae.matchBase(t,e,r,s):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};Ae.matchBase=(t,e,r,n=bi.isWindows(r))=>(e instanceof RegExp?e:Ae.makeRe(e,r)).test(g0.basename(t));Ae.isMatch=(t,e,r)=>Ae(e,r)(t);Ae.parse=(t,e)=>Array.isArray(t)?t.map(r=>Ae.parse(r,e)):_i(t,{...e,fastpaths:!1});Ae.scan=(t,e)=>D0(t,e);Ae.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",a=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let u=Ae.toRegex(a,e);return n===!0&&(u.state=t),u};Ae.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=_i.fastpaths(t,e)),s.output||(s=_i(t,e)),Ae.compileRe(s,e,r,n)};Ae.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Ae.constants=y0;od.exports=Ae});var ud=v((yj,ad)=>{"use strict";ad.exports=id()});var pd=v((vj,hd)=>{"use strict";var ld=require("util"),dd=Ml(),qt=ud(),Si=Mn(),cd=t=>t===""||t==="./",fd=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Ce=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,s=new Set,i=new Set,o=0,a=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let d=qt(String(e[l]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&o++;for(let g of t){let m=d(g,!0);(f?!m.isMatch:m.isMatch)&&(f?n.add(m.output):(n.delete(m.output),s.add(m.output)))}}let c=(o===e.length?[...i]:[...s]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return c};Ce.match=Ce;Ce.matcher=(t,e)=>qt(t,e);Ce.isMatch=(t,e,r)=>qt(e,r)(t);Ce.any=Ce.isMatch;Ce.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,s=[],i=a=>{r.onResult&&r.onResult(a),s.push(a.output)},o=new Set(Ce(t,e,{...r,onResult:i}));for(let a of s)o.has(a)||n.add(a);return[...n]};Ce.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${ld.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Ce.contains(t,n,r));if(typeof e=="string"){if(cd(t)||cd(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Ce.isMatch(t,e,{...r,contains:!0})};Ce.matchKeys=(t,e,r)=>{if(!Si.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Ce(Object.keys(t),e,r),s={};for(let i of n)s[i]=t[i];return s};Ce.some=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=qt(String(s),r);if(n.some(o=>i(o)))return!0}return!1};Ce.every=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=qt(String(s),r);if(!n.every(o=>i(o)))return!1}return!0};Ce.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${ld.inspect(t)}"`);return[].concat(e).every(n=>qt(n,r)(t))};Ce.capture=(t,e,r)=>{let n=Si.isWindows(r),i=qt.makeRe(String(t),{...r,capture:!0}).exec(n?Si.toPosixSlashes(e):e);if(i)return i.slice(1).map(o=>o===void 0?"":o)};Ce.makeRe=(...t)=>qt.makeRe(...t);Ce.scan=(...t)=>qt.scan(...t);Ce.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let s of dd(String(n),e))r.push(qt.parse(s,e));return r};Ce.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!fd(t)?[t]:dd(t,e)};Ce.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Ce.braces(t,{...e,expand:!0})};Ce.hasBraces=fd;hd.exports=Ce});var Cd=v(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.isAbsolute=ne.partitionAbsoluteAndRelative=ne.removeDuplicateSlashes=ne.matchAny=ne.convertPatternsToRe=ne.makeRe=ne.getPatternParts=ne.expandBraceExpansion=ne.expandPatternsWithBraceExpansion=ne.isAffectDepthOfReadingPattern=ne.endsWithSlashGlobStar=ne.hasGlobStar=ne.getBaseDirectory=ne.isPatternRelatedToParentDirectory=ne.getPatternsOutsideCurrentDirectory=ne.getPatternsInsideCurrentDirectory=ne.getPositivePatterns=ne.getNegativePatterns=ne.isPositivePattern=ne.isNegativePattern=ne.convertToNegativePattern=ne.convertToPositivePattern=ne.isDynamicPattern=ne.isStaticPattern=void 0;var md=require("path"),_0=sl(),Ei=pd(),gd="**",b0="\\",S0=/[*?]|^!/,E0=/\[[^[]*]/,C0=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,w0=/[!*+?@]\([^(]*\)/,x0=/,|\.\./,k0=/(?!^)\/{2,}/g;function Dd(t,e={}){return!yd(t,e)}ne.isStaticPattern=Dd;function yd(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(b0)||S0.test(t)||E0.test(t)||C0.test(t)||e.extglob!==!1&&w0.test(t)||e.braceExpansion!==!1&&$0(t))}ne.isDynamicPattern=yd;function $0(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return x0.test(n)}function A0(t){return Ts(t)?t.slice(1):t}ne.convertToPositivePattern=A0;function F0(t){return"!"+t}ne.convertToNegativePattern=F0;function Ts(t){return t.startsWith("!")&&t[1]!=="("}ne.isNegativePattern=Ts;function vd(t){return!Ts(t)}ne.isPositivePattern=vd;function j0(t){return t.filter(Ts)}ne.getNegativePatterns=j0;function I0(t){return t.filter(vd)}ne.getPositivePatterns=I0;function T0(t){return t.filter(e=>!Ci(e))}ne.getPatternsInsideCurrentDirectory=T0;function R0(t){return t.filter(Ci)}ne.getPatternsOutsideCurrentDirectory=R0;function Ci(t){return t.startsWith("..")||t.startsWith("./..")}ne.isPatternRelatedToParentDirectory=Ci;function P0(t){return _0(t,{flipBackslashes:!1})}ne.getBaseDirectory=P0;function O0(t){return t.includes(gd)}ne.hasGlobStar=O0;function _d(t){return t.endsWith("/"+gd)}ne.endsWithSlashGlobStar=_d;function N0(t){let e=md.basename(t);return _d(t)||Dd(e)}ne.isAffectDepthOfReadingPattern=N0;function L0(t){return t.reduce((e,r)=>e.concat(bd(r)),[])}ne.expandPatternsWithBraceExpansion=L0;function bd(t){let e=Ei.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}ne.expandBraceExpansion=bd;function B0(t,e){let{parts:r}=Ei.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}ne.getPatternParts=B0;function Sd(t,e){return Ei.makeRe(t,e)}ne.makeRe=Sd;function M0(t,e){return t.map(r=>Sd(r,e))}ne.convertPatternsToRe=M0;function q0(t,e){return e.some(r=>r.test(t))}ne.matchAny=q0;function W0(t){return t.replace(k0,"/")}ne.removeDuplicateSlashes=W0;function H0(t){let e=[],r=[];for(let n of t)Ed(n)?e.push(n):r.push(n);return[e,r]}ne.partitionAbsoluteAndRelative=H0;function Ed(t){return md.isAbsolute(t)}ne.isAbsolute=Ed});var $d=v((bj,kd)=>{"use strict";var Z0=require("stream"),wd=Z0.PassThrough,U0=Array.prototype.slice;kd.exports=V0;function V0(){let t=[],e=U0.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let s=n.end!==!1,i=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let o=wd(n);function a(){for(let l=0,d=arguments.length;l<d;l++)t.push(xd(arguments[l],n));return u(),this}function u(){if(r)return;r=!0;let l=t.shift();if(!l){process.nextTick(c);return}Array.isArray(l)||(l=[l]);let d=l.length+1;function f(){--d>0||(r=!1,u())}function g(m){function y(){m.removeListener("merge2UnpipeEnd",y),m.removeListener("end",y),i&&m.removeListener("error",h),f()}function h(w){o.emit("error",w)}if(m._readableState.endEmitted)return f();m.on("merge2UnpipeEnd",y),m.on("end",y),i&&m.on("error",h),m.pipe(o,{end:!1}),m.resume()}for(let m=0;m<l.length;m++)g(l[m]);f()}function c(){r=!1,o.emit("queueDrain"),s&&o.end()}return o.setMaxListeners(0),o.add=a,o.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),o}function xd(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=xd(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(wd(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var Fd=v(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.merge=void 0;var G0=$d();function z0(t){let e=G0(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>Ad(t)),e.once("end",()=>Ad(t)),e}Rs.merge=z0;function Ad(t){t.forEach(e=>e.emit("close"))}});var jd=v(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.isEmpty=gn.isString=void 0;function Y0(t){return typeof t=="string"}gn.isString=Y0;function J0(t){return t===""}gn.isEmpty=J0});var er=v(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.string=Le.stream=Le.pattern=Le.path=Le.fs=Le.errno=Le.array=void 0;var X0=Uc();Le.array=X0;var K0=Vc();Le.errno=K0;var Q0=Gc();Le.fs=Q0;var e_=Xc();Le.path=e_;var t_=Cd();Le.pattern=t_;var r_=Fd();Le.stream=r_;var n_=jd();Le.string=n_});var Pd=v(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.convertPatternGroupToTask=Be.convertPatternGroupsToTasks=Be.groupPatternsByBaseDirectory=Be.getNegativePatternsAsPositive=Be.getPositivePatterns=Be.convertPatternsToTasks=Be.generate=void 0;var xt=er();function s_(t,e){let r=Id(t,e),n=Id(e.ignore,e),s=Td(r),i=Rd(r,n),o=s.filter(l=>xt.pattern.isStaticPattern(l,e)),a=s.filter(l=>xt.pattern.isDynamicPattern(l,e)),u=wi(o,i,!1),c=wi(a,i,!0);return u.concat(c)}Be.generate=s_;function Id(t,e){let r=t;return e.braceExpansion&&(r=xt.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>xt.pattern.removeDuplicateSlashes(n))}function wi(t,e,r){let n=[],s=xt.pattern.getPatternsOutsideCurrentDirectory(t),i=xt.pattern.getPatternsInsideCurrentDirectory(t),o=xi(s),a=xi(i);return n.push(...ki(o,e,r)),"."in a?n.push($i(".",i,e,r)):n.push(...ki(a,e,r)),n}Be.convertPatternsToTasks=wi;function Td(t){return xt.pattern.getPositivePatterns(t)}Be.getPositivePatterns=Td;function Rd(t,e){return xt.pattern.getNegativePatterns(t).concat(e).map(xt.pattern.convertToPositivePattern)}Be.getNegativePatternsAsPositive=Rd;function xi(t){let e={};return t.reduce((r,n)=>{let s=xt.pattern.getBaseDirectory(n);return s in r?r[s].push(n):r[s]=[n],r},e)}Be.groupPatternsByBaseDirectory=xi;function ki(t,e,r){return Object.keys(t).map(n=>$i(n,t[n],e,r))}Be.convertPatternGroupsToTasks=ki;function $i(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(xt.pattern.convertToNegativePattern))}}Be.convertPatternGroupToTask=$i});var Nd=v(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.read=void 0;function o_(t,e,r){e.fs.lstat(t,(n,s)=>{if(n!==null){Od(r,n);return}if(!s.isSymbolicLink()||!e.followSymbolicLink){Ai(r,s);return}e.fs.stat(t,(i,o)=>{if(i!==null){if(e.throwErrorOnBrokenSymbolicLink){Od(r,i);return}Ai(r,s);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),Ai(r,o)})})}Ps.read=o_;function Od(t,e){t(e)}function Ai(t,e){t(null,e)}});var Ld=v(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.read=void 0;function i_(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}Os.read=i_});var Bd=v(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.createFileSystemAdapter=hr.FILE_SYSTEM_ADAPTER=void 0;var Ns=require("fs");hr.FILE_SYSTEM_ADAPTER={lstat:Ns.lstat,stat:Ns.stat,lstatSync:Ns.lstatSync,statSync:Ns.statSync};function a_(t){return t===void 0?hr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},hr.FILE_SYSTEM_ADAPTER),t)}hr.createFileSystemAdapter=a_});var Md=v(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});var u_=Bd(),Fi=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=u_.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};ji.default=Fi});var Nr=v(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.statSync=pr.stat=pr.Settings=void 0;var qd=Nd(),c_=Ld(),Ii=Md();pr.Settings=Ii.default;function l_(t,e,r){if(typeof e=="function"){qd.read(t,Ti(),e);return}qd.read(t,Ti(e),r)}pr.stat=l_;function d_(t,e){let r=Ti(e);return c_.read(t,r)}pr.statSync=d_;function Ti(t={}){return t instanceof Ii.default?t:new Ii.default(t)}});var Zd=v((jj,Hd)=>{var Wd;Hd.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(Wd||(Wd=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Vd=v((Ij,Ud)=>{Ud.exports=h_;var f_=Zd();function h_(t,e){let r,n,s,i=!0;Array.isArray(t)?(r=[],n=t.length):(s=Object.keys(t),r={},n=s.length);function o(u){function c(){e&&e(u,r),e=null}i?f_(c):c()}function a(u,c,l){r[u]=l,(--n===0||c)&&o(c)}n?s?s.forEach(function(u){t[u](function(c,l){a(u,c,l)})}):t.forEach(function(u,c){u(function(l,d){a(c,l,d)})}):o(null),i=!1}});var Ri=v(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var Ls=process.versions.node.split(".");if(Ls[0]===void 0||Ls[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Gd=Number.parseInt(Ls[0],10),p_=Number.parseInt(Ls[1],10),zd=10,m_=10,g_=Gd>zd,D_=Gd===zd&&p_>=m_;Bs.IS_SUPPORT_READDIR_WITH_FILE_TYPES=g_||D_});var Yd=v(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.createDirentFromStats=void 0;var Pi=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function y_(t,e){return new Pi(t,e)}Ms.createDirentFromStats=y_});var Oi=v(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.fs=void 0;var v_=Yd();qs.fs=v_});var Ni=v(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.joinPathSegments=void 0;function __(t,e,r){return t.endsWith(r)?t+e:t+r+e}Ws.joinPathSegments=__});var tf=v(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.readdir=mr.readdirWithFileTypes=mr.read=void 0;var b_=Nr(),Jd=Vd(),S_=Ri(),Xd=Oi(),Kd=Ni();function E_(t,e,r){if(!e.stats&&S_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Qd(t,e,r);return}ef(t,e,r)}mr.read=E_;function Qd(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,s)=>{if(n!==null){Hs(r,n);return}let i=s.map(a=>({dirent:a,name:a.name,path:Kd.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){Li(r,i);return}let o=i.map(a=>C_(a,e));Jd(o,(a,u)=>{if(a!==null){Hs(r,a);return}Li(r,u)})})}mr.readdirWithFileTypes=Qd;function C_(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,s)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=Xd.fs.createDirentFromStats(t.name,s),r(null,t)})}}function ef(t,e,r){e.fs.readdir(t,(n,s)=>{if(n!==null){Hs(r,n);return}let i=s.map(o=>{let a=Kd.joinPathSegments(t,o,e.pathSegmentSeparator);return u=>{b_.stat(a,e.fsStatSettings,(c,l)=>{if(c!==null){u(c);return}let d={name:o,path:a,dirent:Xd.fs.createDirentFromStats(o,l)};e.stats&&(d.stats=l),u(null,d)})}});Jd(i,(o,a)=>{if(o!==null){Hs(r,o);return}Li(r,a)})})}mr.readdir=ef;function Hs(t,e){t(e)}function Li(t,e){t(null,e)}});var af=v(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.readdir=gr.readdirWithFileTypes=gr.read=void 0;var w_=Nr(),x_=Ri(),rf=Oi(),nf=Ni();function k_(t,e){return!e.stats&&x_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?sf(t,e):of(t,e)}gr.read=k_;function sf(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let s={dirent:n,name:n.name,path:nf.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let i=e.fs.statSync(s.path);s.dirent=rf.fs.createDirentFromStats(s.name,i)}catch(i){if(e.throwErrorOnBrokenSymbolicLink)throw i}return s})}gr.readdirWithFileTypes=sf;function of(t,e){return e.fs.readdirSync(t).map(n=>{let s=nf.joinPathSegments(t,n,e.pathSegmentSeparator),i=w_.statSync(s,e.fsStatSettings),o={name:n,path:s,dirent:rf.fs.createDirentFromStats(n,i)};return e.stats&&(o.stats=i),o})}gr.readdir=of});var uf=v(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.createFileSystemAdapter=Dr.FILE_SYSTEM_ADAPTER=void 0;var Dn=require("fs");Dr.FILE_SYSTEM_ADAPTER={lstat:Dn.lstat,stat:Dn.stat,lstatSync:Dn.lstatSync,statSync:Dn.statSync,readdir:Dn.readdir,readdirSync:Dn.readdirSync};function $_(t){return t===void 0?Dr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Dr.FILE_SYSTEM_ADAPTER),t)}Dr.createFileSystemAdapter=$_});var cf=v(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var A_=require("path"),F_=Nr(),j_=uf(),Bi=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=j_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,A_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new F_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};Mi.default=Bi});var Zs=v(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.Settings=yr.scandirSync=yr.scandir=void 0;var lf=tf(),I_=af(),qi=cf();yr.Settings=qi.default;function T_(t,e,r){if(typeof e=="function"){lf.read(t,Wi(),e);return}lf.read(t,Wi(e),r)}yr.scandir=T_;function R_(t,e){let r=Wi(e);return I_.read(t,r)}yr.scandirSync=R_;function Wi(t={}){return t instanceof qi.default?t:new qi.default(t)}});var ff=v((Wj,df)=>{"use strict";function P_(t){var e=new t,r=e;function n(){var i=e;return i.next?e=i.next:(e=new t,r=e),i.next=null,i}function s(i){r.next=i,r=i}return{get:n,release:s}}df.exports=P_});var pf=v((Hj,Hi)=>{"use strict";var O_=ff();function hf(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=O_(N_),s=null,i=null,o=0,a=null,u={push:y,drain:et,saturated:et,pause:l,paused:!1,get concurrency(){return r},set concurrency(I){if(!(I>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=I,!u.paused)for(;s&&o<r;)o++,w()},running:c,resume:g,idle:m,length:d,getQueue:f,unshift:h,empty:et,kill:C,killAndDrain:A,error:V,abort:T};return u;function c(){return o}function l(){u.paused=!0}function d(){for(var I=s,H=0;I;)I=I.next,H++;return H}function f(){for(var I=s,H=[];I;)H.push(I.value),I=I.next;return H}function g(){if(u.paused){if(u.paused=!1,s===null){o++,w();return}for(;s&&o<r;)o++,w()}}function m(){return o===0&&u.length()===0}function y(I,H){var F=n.get();F.context=t,F.release=w,F.value=I,F.callback=H||et,F.errorHandler=a,o>=r||u.paused?i?(i.next=F,i=F):(s=F,i=F,u.saturated()):(o++,e.call(t,F.value,F.worked))}function h(I,H){var F=n.get();F.context=t,F.release=w,F.value=I,F.callback=H||et,F.errorHandler=a,o>=r||u.paused?s?(F.next=s,s=F):(s=F,i=F,u.saturated()):(o++,e.call(t,F.value,F.worked))}function w(I){I&&n.release(I);var H=s;H&&o<=r?u.paused?o--:(i===s&&(i=null),s=H.next,H.next=null,e.call(t,H.value,H.worked),i===null&&u.empty()):--o===0&&u.drain()}function C(){s=null,i=null,u.drain=et}function A(){s=null,i=null,u.drain(),u.drain=et}function T(){var I=s;for(s=null,i=null;I;){var H=I.next,F=I.callback,q=I.errorHandler,P=I.value,b=I.context;I.value=null,I.callback=et,I.errorHandler=null,q&&q(new Error("abort"),P),F.call(b,new Error("abort")),I.release(I),I=H}u.drain=et}function V(I){a=I}}function et(){}function N_(){this.value=null,this.callback=et,this.next=null,this.release=et,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var s=t.callback,i=t.errorHandler,o=t.value;t.value=null,t.callback=et,t.errorHandler&&i(r,o),s.call(t.context,r,n),t.release(t)}}function L_(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(l,d){e.call(this,l).then(function(f){d(null,f)},d)}var s=hf(t,n,r),i=s.push,o=s.unshift;return s.push=a,s.unshift=u,s.drained=c,s;function a(l){var d=new Promise(function(f,g){i(l,function(m,y){if(m){g(m);return}f(y)})});return d.catch(et),d}function u(l){var d=new Promise(function(f,g){o(l,function(m,y){if(m){g(m);return}f(y)})});return d.catch(et),d}function c(){var l=new Promise(function(d){process.nextTick(function(){if(s.idle())d();else{var f=s.drain;s.drain=function(){typeof f=="function"&&f(),d(),s.drain=f}}})});return l}}Hi.exports=hf;Hi.exports.promise=L_});var Us=v(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.joinPathSegments=Wt.replacePathSegmentSeparator=Wt.isAppliedFilter=Wt.isFatalError=void 0;function B_(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}Wt.isFatalError=B_;function M_(t,e){return t===null||t(e)}Wt.isAppliedFilter=M_;function q_(t,e){return t.split(/[/\\]/).join(e)}Wt.replacePathSegmentSeparator=q_;function W_(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}Wt.joinPathSegments=W_});var Vi=v(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});var H_=Us(),Zi=class{constructor(e,r){this._root=e,this._settings=r,this._root=H_.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};Ui.default=Zi});var Yi=v(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});var Z_=require("events"),U_=Zs(),V_=pf(),Vs=Us(),G_=Vi(),Gi=class extends G_.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=U_.scandir,this._emitter=new Z_.EventEmitter,this._queue=V_(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,s=>{s!==null&&this._handleError(s)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,s)=>{if(n!==null){r(n,void 0);return}for(let i of s)this._handleEntry(i,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!Vs.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=Vs.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Vs.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&Vs.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};zi.default=Gi});var mf=v(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var z_=Yi(),Ji=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new z_.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{Y_(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{J_(e,this._storage)}),this._reader.read()}};Xi.default=Ji;function Y_(t,e){t(e)}function J_(t,e){t(null,e)}});var gf=v(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var X_=require("stream"),K_=Yi(),Ki=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new K_.default(this._root,this._settings),this._stream=new X_.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};Qi.default=Ki});var Df=v(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});var Q_=Zs(),Gs=Us(),eb=Vi(),ea=class extends eb.default{constructor(){super(...arguments),this._scandir=Q_.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let s of n)this._handleEntry(s,r)}catch(n){this._handleError(n)}}_handleError(e){if(Gs.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=Gs.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Gs.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&Gs.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};ta.default=ea});var yf=v(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var tb=Df(),ra=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new tb.default(this._root,this._settings)}read(){return this._reader.read()}};na.default=ra});var vf=v(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});var rb=require("path"),nb=Zs(),sa=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,rb.sep),this.fsScandirSettings=new nb.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};oa.default=sa});var Ys=v(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.Settings=Ht.walkStream=Ht.walkSync=Ht.walk=void 0;var _f=mf(),sb=gf(),ob=yf(),ia=vf();Ht.Settings=ia.default;function ib(t,e,r){if(typeof e=="function"){new _f.default(t,zs()).read(e);return}new _f.default(t,zs(e)).read(r)}Ht.walk=ib;function ab(t,e){let r=zs(e);return new ob.default(t,r).read()}Ht.walkSync=ab;function ub(t,e){let r=zs(e);return new sb.default(t,r).read()}Ht.walkStream=ub;function zs(t={}){return t instanceof ia.default?t:new ia.default(t)}});var Js=v(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var cb=require("path"),lb=Nr(),bf=er(),aa=class{constructor(e){this._settings=e,this._fsStatSettings=new lb.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return cb.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:bf.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!bf.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};ua.default=aa});var da=v(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var db=require("stream"),fb=Nr(),hb=Ys(),pb=Js(),ca=class extends pb.default{constructor(){super(...arguments),this._walkStream=hb.walkStream,this._stat=fb.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),s=new db.PassThrough({objectMode:!0});s._write=(i,o,a)=>this._getEntry(n[i],e[i],r).then(u=>{u!==null&&r.entryFilter(u)&&s.push(u),i===n.length-1&&s.end(),a()}).catch(a);for(let i=0;i<n.length;i++)s.write(i);return s}_getEntry(e,r,n){return this._getStat(e).then(s=>this._makeEntry(s,r)).catch(s=>{if(n.errorFilter(s))return null;throw s})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(s,i)=>s===null?r(i):n(s))})}};la.default=ca});var Sf=v(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});var mb=Ys(),gb=Js(),Db=da(),fa=class extends gb.default{constructor(){super(...arguments),this._walkAsync=mb.walk,this._readerStream=new Db.default(this._settings)}dynamic(e,r){return new Promise((n,s)=>{this._walkAsync(e,r,(i,o)=>{i===null?n(o):s(i)})})}async static(e,r){let n=[],s=this._readerStream.static(e,r);return new Promise((i,o)=>{s.once("error",o),s.on("data",a=>n.push(a)),s.once("end",()=>i(n))})}};ha.default=fa});var Ef=v(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});var Hn=er(),pa=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return Hn.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Hn.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Hn.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Hn.array.splitWhen(e,r=>r.dynamic&&Hn.pattern.hasGlobStar(r.pattern))}};ma.default=pa});var Cf=v(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});var yb=Ef(),ga=class extends yb.default{match(e){let r=e.split("/"),n=r.length,s=this._storage.filter(i=>!i.complete||i.segments.length>n);for(let i of s){let o=i.sections[0];if(!i.complete&&n>o.length||r.every((u,c)=>{let l=i.segments[c];return!!(l.dynamic&&l.patternRe.test(u)||!l.dynamic&&l.pattern===u)}))return!0}return!1}};Da.default=ga});var wf=v(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var Xs=er(),vb=Cf(),ya=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let s=this._getMatcher(r),i=this._getNegativePatternsRe(n);return o=>this._filter(e,o,s,i)}_getMatcher(e){return new vb.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(Xs.pattern.isAffectDepthOfReadingPattern);return Xs.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,s){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Xs.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(i,n)?!1:this._isSkippedByNegativePatterns(i,s)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let s=e.split("/").length;return n-s}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!Xs.pattern.matchAny(e,r)}};va.default=ya});var xf=v(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var vr=er(),_a=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,s]=vr.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:vr.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:vr.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:vr.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,i)}_filter(e,r){let n=vr.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let s=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&s&&this._createIndexRecord(n),s}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let s=vr.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(s,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let s=vr.pattern.matchAny(e,r);return!s&&n?vr.pattern.matchAny(e+"/",r):s}};ba.default=_a});var kf=v(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var _b=er(),Sa=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return _b.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};Ea.default=Sa});var Af=v(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var $f=er(),Ca=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=$f.path.makeAbsolute(this._settings.cwd,r),r=$f.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};wa.default=Ca});var Ks=v(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var bb=require("path"),Sb=wf(),Eb=xf(),Cb=kf(),wb=Af(),xa=class{constructor(e){this._settings=e,this.errorFilter=new Cb.default(this._settings),this.entryFilter=new Eb.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Sb.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new wb.default(this._settings)}_getRootDirectory(e){return bb.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};ka.default=xa});var Ff=v(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var xb=Sf(),kb=Ks(),$a=class extends kb.default{constructor(){super(...arguments),this._reader=new xb.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(i=>n.transform(i))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};Aa.default=$a});var jf=v(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var $b=require("stream"),Ab=da(),Fb=Ks(),Fa=class extends Fb.default{constructor(){super(...arguments),this._reader=new Ab.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),s=this.api(r,e,n),i=new $b.Readable({objectMode:!0,read:()=>{}});return s.once("error",o=>i.emit("error",o)).on("data",o=>i.emit("data",n.transform(o))).once("end",()=>i.emit("end")),i.once("close",()=>s.destroy()),i}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};ja.default=Fa});var If=v(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var jb=Nr(),Ib=Ys(),Tb=Js(),Ia=class extends Tb.default{constructor(){super(...arguments),this._walkSync=Ib.walkSync,this._statSync=jb.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let s of e){let i=this._getFullEntryPath(s),o=this._getEntry(i,s,r);o===null||!r.entryFilter(o)||n.push(o)}return n}_getEntry(e,r,n){try{let s=this._getStat(e);return this._makeEntry(s,r)}catch(s){if(n.errorFilter(s))return null;throw s}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};Ta.default=Ia});var Tf=v(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var Rb=If(),Pb=Ks(),Ra=class extends Pb.default{constructor(){super(...arguments),this._reader=new Rb.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};Pa.default=Ra});var Rf=v(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var yn=require("fs"),Ob=require("os"),Nb=Math.max(Ob.cpus().length,1);vn.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:yn.lstat,lstatSync:yn.lstatSync,stat:yn.stat,statSync:yn.statSync,readdir:yn.readdir,readdirSync:yn.readdirSync};var Oa=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,Nb),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},vn.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};vn.default=Oa});var Nf=v((p2,Of)=>{"use strict";var Pf=Pd(),Lb=Ff(),Bb=jf(),Mb=Tf(),Na=Rf(),ht=er();async function La(t,e){kt(t);let r=Ba(t,Lb.default,e),n=await Promise.all(r);return ht.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(c,l){kt(c);let d=Ba(c,Mb.default,l);return ht.array.flatten(d)}t.sync=e;function r(c,l){kt(c);let d=Ba(c,Bb.default,l);return ht.stream.merge(d)}t.stream=r;function n(c,l){kt(c);let d=[].concat(c),f=new Na.default(l);return Pf.generate(d,f)}t.generateTasks=n;function s(c,l){kt(c);let d=new Na.default(l);return ht.pattern.isDynamicPattern(c,d)}t.isDynamicPattern=s;function i(c){return kt(c),ht.path.escape(c)}t.escapePath=i;function o(c){return kt(c),ht.path.convertPathToPattern(c)}t.convertPathToPattern=o;let a;(function(c){function l(f){return kt(f),ht.path.escapePosixPath(f)}c.escapePath=l;function d(f){return kt(f),ht.path.convertPosixPathToPattern(f)}c.convertPathToPattern=d})(a=t.posix||(t.posix={}));let u;(function(c){function l(f){return kt(f),ht.path.escapeWindowsPath(f)}c.escapePath=l;function d(f){return kt(f),ht.path.convertWindowsPathToPattern(f)}c.convertPathToPattern=d})(u=t.win32||(t.win32={}))})(La||(La={}));function Ba(t,e,r){let n=[].concat(t),s=new Na.default(r),i=Pf.generate(n,s),o=new e(s);return i.map(o.read,o)}function kt(t){if(![].concat(t).every(n=>ht.string.isString(n)&&!ht.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Of.exports=La});var Zn=v(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.getParsedType=_e.ZodParsedType=_e.objectUtil=_e.util=void 0;var Ma;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let i={};for(let o of s)i[o]=o;return i},t.getValidEnumValues=s=>{let i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(let o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Ma||(_e.util=Ma={}));var Lf;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Lf||(_e.objectUtil=Lf={}));_e.ZodParsedType=Ma.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var qb=t=>{switch(typeof t){case"undefined":return _e.ZodParsedType.undefined;case"string":return _e.ZodParsedType.string;case"number":return Number.isNaN(t)?_e.ZodParsedType.nan:_e.ZodParsedType.number;case"boolean":return _e.ZodParsedType.boolean;case"function":return _e.ZodParsedType.function;case"bigint":return _e.ZodParsedType.bigint;case"symbol":return _e.ZodParsedType.symbol;case"object":return Array.isArray(t)?_e.ZodParsedType.array:t===null?_e.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?_e.ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?_e.ZodParsedType.map:typeof Set<"u"&&t instanceof Set?_e.ZodParsedType.set:typeof Date<"u"&&t instanceof Date?_e.ZodParsedType.date:_e.ZodParsedType.object;default:return _e.ZodParsedType.unknown}};_e.getParsedType=qb});var Qs=v(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.ZodError=_r.quotelessJson=_r.ZodIssueCode=void 0;var Bf=Zn();_r.ZodIssueCode=Bf.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Wb=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");_r.quotelessJson=Wb;var Un=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Bf.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};_r.ZodError=Un;Un.create=t=>new Un(t)});var Wa=v(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var Me=Qs(),Lr=Zn(),Hb=(t,e)=>{let r;switch(t.code){case Me.ZodIssueCode.invalid_type:t.received===Lr.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Me.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Lr.util.jsonStringifyReplacer)}`;break;case Me.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${Lr.util.joinValues(t.keys,", ")}`;break;case Me.ZodIssueCode.invalid_union:r="Invalid input";break;case Me.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Lr.util.joinValues(t.options)}`;break;case Me.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${Lr.util.joinValues(t.options)}, received '${t.received}'`;break;case Me.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case Me.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case Me.ZodIssueCode.invalid_date:r="Invalid date";break;case Me.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Lr.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Me.ZodIssueCode.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Me.ZodIssueCode.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Me.ZodIssueCode.custom:r="Invalid input";break;case Me.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case Me.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Me.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,Lr.util.assertNever(t)}return{message:r}};qa.default=Hb});var eo=v(br=>{"use strict";var Zb=br&&br.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(br,"__esModule",{value:!0});br.defaultErrorMap=void 0;br.setErrorMap=Ub;br.getErrorMap=Vb;var Mf=Zb(Wa());br.defaultErrorMap=Mf.default;var qf=Mf.default;function Ub(t){qf=t}function Vb(){return qf}});var Za=v(ge=>{"use strict";var Gb=ge&&ge.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ge,"__esModule",{value:!0});ge.isAsync=ge.isValid=ge.isDirty=ge.isAborted=ge.OK=ge.DIRTY=ge.INVALID=ge.ParseStatus=ge.EMPTY_PATH=ge.makeIssue=void 0;ge.addIssueToContext=Jb;var zb=eo(),Wf=Gb(Wa()),Yb=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}};ge.makeIssue=Yb;ge.EMPTY_PATH=[];function Jb(t,e){let r=(0,zb.getErrorMap)(),n=(0,ge.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Wf.default?void 0:Wf.default].filter(s=>!!s)});t.common.issues.push(n)}var Ha=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return ge.INVALID;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let i=await s.key,o=await s.value;n.push({key:i,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return ge.INVALID;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}};ge.ParseStatus=Ha;ge.INVALID=Object.freeze({status:"aborted"});var Xb=t=>({status:"dirty",value:t});ge.DIRTY=Xb;var Kb=t=>({status:"valid",value:t});ge.OK=Kb;var Qb=t=>t.status==="aborted";ge.isAborted=Qb;var eS=t=>t.status==="dirty";ge.isDirty=eS;var tS=t=>t.status==="valid";ge.isValid=tS;var rS=t=>typeof Promise<"u"&&t instanceof Promise;ge.isAsync=rS});var Zf=v(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0})});var Vf=v(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.errorUtil=void 0;var Uf;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Uf||(to.errorUtil=Uf={}))});var sh=v(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.discriminatedUnion=S.date=S.boolean=S.bigint=S.array=S.any=S.coerce=S.ZodFirstPartyTypeKind=S.late=S.ZodSchema=S.Schema=S.ZodReadonly=S.ZodPipeline=S.ZodBranded=S.BRAND=S.ZodNaN=S.ZodCatch=S.ZodDefault=S.ZodNullable=S.ZodOptional=S.ZodTransformer=S.ZodEffects=S.ZodPromise=S.ZodNativeEnum=S.ZodEnum=S.ZodLiteral=S.ZodLazy=S.ZodFunction=S.ZodSet=S.ZodMap=S.ZodRecord=S.ZodTuple=S.ZodIntersection=S.ZodDiscriminatedUnion=S.ZodUnion=S.ZodObject=S.ZodArray=S.ZodVoid=S.ZodNever=S.ZodUnknown=S.ZodAny=S.ZodNull=S.ZodUndefined=S.ZodSymbol=S.ZodDate=S.ZodBoolean=S.ZodBigInt=S.ZodNumber=S.ZodString=S.ZodType=void 0;S.NEVER=S.void=S.unknown=S.union=S.undefined=S.tuple=S.transformer=S.symbol=S.string=S.strictObject=S.set=S.record=S.promise=S.preprocess=S.pipeline=S.ostring=S.optional=S.onumber=S.oboolean=S.object=S.number=S.nullable=S.null=S.never=S.nativeEnum=S.nan=S.map=S.literal=S.lazy=S.intersection=S.instanceof=S.function=S.enum=S.effect=void 0;S.datetimeRegex=Xf;S.custom=Qf;var O=Qs(),ro=eo(),K=Vf(),E=Za(),L=Zn(),mt=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Gf=(t,e)=>{if((0,E.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new O.ZodError(t.common.issues);return this._error=r,this._error}}};function ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{let{message:u}=t;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:u??r??a.defaultError}},description:s}}var ue=class{get description(){return this._def.description}_getType(e){return(0,L.getParsedType)(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:(0,L.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new E.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,L.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if((0,E.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,L.getParsedType)(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Gf(n,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,L.getParsedType)(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return(0,E.isValid)(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>(0,E.isValid)(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,L.getParsedType)(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await((0,E.isAsync)(s)?s:Promise.resolve(s));return Gf(n,i)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let o=e(s),a=()=>i.addIssue({code:O.ZodIssueCode.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new ut({schema:this,typeName:se.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return pt.create(this,this._def)}nullable(){return Ut.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return nr.create(this)}promise(){return Cr.create(this,this._def)}or(e){return Ur.create([this,e],this._def)}and(e){return Vr.create(this,e,this._def)}transform(e){return new ut({...ae(this._def),schema:this,typeName:se.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Xr({...ae(this._def),innerType:this,defaultValue:r,typeName:se.ZodDefault})}brand(){return new Vn({typeName:se.ZodBranded,type:this,...ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Kr({...ae(this._def),innerType:this,catchValue:r,typeName:se.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Gn.create(this,e)}readonly(){return Qr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};S.ZodType=ue;S.Schema=ue;S.ZodSchema=ue;var nS=/^c[^\s-]{8,}$/i,sS=/^[0-9a-z]+$/,oS=/^[0-9A-HJKMNP-TV-Z]{26}$/i,iS=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,aS=/^[a-z0-9_-]{21}$/i,uS=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,cS=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lS=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ua,fS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,pS=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,mS=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gS=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DS=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",yS=new RegExp(`^${Yf}$`);function Jf(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function vS(t){return new RegExp(`^${Jf(t)}$`)}function Xf(t){let e=`${Yf}T${Jf(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function _S(t,e){return!!((e==="v4"||!e)&&fS.test(t)||(e==="v6"||!e)&&pS.test(t))}function bS(t,e){if(!uS.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function SS(t,e){return!!((e==="v4"||!e)&&hS.test(t)||(e==="v6"||!e)&&mS.test(t))}var Sr=class t extends ue{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==L.ZodParsedType.string){let i=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.string,received:i.parsedType}),E.INVALID}let n=new E.ParseStatus,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")lS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"email",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Ua||(Ua=new RegExp(dS,"u")),Ua.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"emoji",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")iS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"uuid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")aS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"nanoid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")nS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"cuid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")sS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"cuid2",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")oS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"ulid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"url",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"regex",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Xf(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?yS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?vS(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?cS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"duration",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?_S(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"ip",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?bS(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"jwt",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?SS(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"cidr",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?gS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"base64",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?DS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"base64url",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):L.util.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:O.ZodIssueCode.invalid_string,...K.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...K.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...K.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...K.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...K.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...K.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...K.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...K.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...K.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...K.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...K.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...K.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...K.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...K.errorUtil.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...K.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...K.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...K.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...K.errorUtil.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...K.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...K.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...K.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...K.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...K.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,K.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};S.ZodString=Sr;Sr.create=t=>new Sr({checks:[],typeName:se.ZodString,coerce:t?.coerce??!1,...ae(t)});function ES(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}var Br=class t extends ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==L.ZodParsedType.number){let i=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.number,received:i.parsedType}),E.INVALID}let n,s=new E.ParseStatus;for(let i of this._def.checks)i.kind==="int"?L.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?ES(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.not_finite,message:i.message}),s.dirty()):L.util.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,K.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:K.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:K.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:K.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.errorUtil.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&L.util.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};S.ZodNumber=Br;Br.create=t=>new Br({checks:[],typeName:se.ZodNumber,coerce:t?.coerce||!1,...ae(t)});var Mr=class t extends ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==L.ZodParsedType.bigint)return this._getInvalidInput(e);let n,s=new E.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):L.util.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.bigint,received:r.parsedType}),E.INVALID}gte(e,r){return this.setLimit("min",e,!0,K.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:K.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:K.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.errorUtil.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};S.ZodBigInt=Mr;Mr.create=t=>new Mr({checks:[],typeName:se.ZodBigInt,coerce:t?.coerce??!1,...ae(t)});var qr=class extends ue{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==L.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.boolean,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodBoolean=qr;qr.create=t=>new qr({typeName:se.ZodBoolean,coerce:t?.coerce||!1,...ae(t)});var Wr=class t extends ue{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==L.ZodParsedType.date){let i=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.date,received:i.parsedType}),E.INVALID}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_date}),E.INVALID}let n=new E.ParseStatus,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):L.util.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:K.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:K.errorUtil.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};S.ZodDate=Wr;Wr.create=t=>new Wr({checks:[],coerce:t?.coerce||!1,typeName:se.ZodDate,...ae(t)});var bn=class extends ue{_parse(e){if(this._getType(e)!==L.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.symbol,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodSymbol=bn;bn.create=t=>new bn({typeName:se.ZodSymbol,...ae(t)});var Hr=class extends ue{_parse(e){if(this._getType(e)!==L.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.undefined,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodUndefined=Hr;Hr.create=t=>new Hr({typeName:se.ZodUndefined,...ae(t)});var Zr=class extends ue{_parse(e){if(this._getType(e)!==L.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.null,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodNull=Zr;Zr.create=t=>new Zr({typeName:se.ZodNull,...ae(t)});var Er=class extends ue{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,E.OK)(e.data)}};S.ZodAny=Er;Er.create=t=>new Er({typeName:se.ZodAny,...ae(t)});var rr=class extends ue{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,E.OK)(e.data)}};S.ZodUnknown=rr;rr.create=t=>new rr({typeName:se.ZodUnknown,...ae(t)});var $t=class extends ue{_parse(e){let r=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.never,received:r.parsedType}),E.INVALID}};S.ZodNever=$t;$t.create=t=>new $t({typeName:se.ZodNever,...ae(t)});var Sn=class extends ue{_parse(e){if(this._getType(e)!==L.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.void,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodVoid=Sn;Sn.create=t=>new Sn({typeName:se.ZodVoid,...ae(t)});var nr=class t extends ue{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==L.ZodParsedType.array)return(0,E.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.array,received:r.parsedType}),E.INVALID;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(o||a)&&((0,E.addIssueToContext)(r,{code:o?O.ZodIssueCode.too_big:O.ZodIssueCode.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&((0,E.addIssueToContext)(r,{code:O.ZodIssueCode.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&((0,E.addIssueToContext)(r,{code:O.ZodIssueCode.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new mt(r,o,r.path,a)))).then(o=>E.ParseStatus.mergeArray(n,o));let i=[...r.data].map((o,a)=>s.type._parseSync(new mt(r,o,r.path,a)));return E.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:K.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:K.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:K.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};S.ZodArray=nr;nr.create=(t,e)=>new nr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...ae(e)});function _n(t){if(t instanceof tt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=pt.create(_n(n))}return new tt({...t._def,shape:()=>e})}else return t instanceof nr?new nr({...t._def,type:_n(t.element)}):t instanceof pt?pt.create(_n(t.unwrap())):t instanceof Ut?Ut.create(_n(t.unwrap())):t instanceof Zt?Zt.create(t.items.map(e=>_n(e))):t}var tt=class t extends ue{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=L.util.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==L.ZodParsedType.object){let c=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(c,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.object,received:c.parsedType}),E.INVALID}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof $t&&this._def.unknownKeys==="strip"))for(let c in s.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=i[c],d=s.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new mt(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof $t){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(c==="strict")a.length>0&&((0,E.addIssueToContext)(s,{code:O.ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let d=s.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new mt(s,d,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let d=await l.key,f=await l.value;c.push({key:d,value:f,alwaysSet:l.alwaysSet})}return c}).then(c=>E.ParseStatus.mergeObjectSync(n,c)):E.ParseStatus.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return K.errorUtil.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:K.errorUtil.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:se.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of L.util.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of L.util.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return _n(this)}partial(e){let r={};for(let n of L.util.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of L.util.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof pt;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return Kf(L.util.objectKeys(this.shape))}};S.ZodObject=tt;tt.create=(t,e)=>new tt({shape:()=>t,unknownKeys:"strip",catchall:$t.create(),typeName:se.ZodObject,...ae(e)});tt.strictCreate=(t,e)=>new tt({shape:()=>t,unknownKeys:"strict",catchall:$t.create(),typeName:se.ZodObject,...ae(e)});tt.lazycreate=(t,e)=>new tt({shape:t,unknownKeys:"strip",catchall:$t.create(),typeName:se.ZodObject,...ae(e)});var Ur=class extends ue{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new O.ZodError(a.ctx.common.issues));return(0,E.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union,unionErrors:o}),E.INVALID}if(r.common.async)return Promise.all(n.map(async i=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(u=>new O.ZodError(u));return(0,E.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union,unionErrors:a}),E.INVALID}}get options(){return this._def.options}};S.ZodUnion=Ur;Ur.create=(t,e)=>new Ur({options:t,typeName:se.ZodUnion,...ae(e)});var tr=t=>t instanceof Gr?tr(t.schema):t instanceof ut?tr(t.innerType()):t instanceof zr?[t.value]:t instanceof Yr?t.options:t instanceof Jr?L.util.objectValues(t.enum):t instanceof Xr?tr(t._def.innerType):t instanceof Hr?[void 0]:t instanceof Zr?[null]:t instanceof pt?[void 0,...tr(t.unwrap())]:t instanceof Ut?[null,...tr(t.unwrap())]:t instanceof Vn||t instanceof Qr?tr(t.unwrap()):t instanceof Kr?tr(t._def.innerType):[],no=class t extends ue{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.ZodParsedType.object)return(0,E.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.object,received:r.parsedType}),E.INVALID;let n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):((0,E.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),E.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let i of r){let o=tr(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,i)}}return new t({typeName:se.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...ae(n)})}};S.ZodDiscriminatedUnion=no;function Va(t,e){let r=(0,L.getParsedType)(t),n=(0,L.getParsedType)(e);if(t===e)return{valid:!0,data:t};if(r===L.ZodParsedType.object&&n===L.ZodParsedType.object){let s=L.util.objectKeys(e),i=L.util.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(let a of i){let u=Va(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===L.ZodParsedType.array&&n===L.ZodParsedType.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<t.length;i++){let o=t[i],a=e[i],u=Va(o,a);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return r===L.ZodParsedType.date&&n===L.ZodParsedType.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Vr=class extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(i,o)=>{if((0,E.isAborted)(i)||(0,E.isAborted)(o))return E.INVALID;let a=Va(i.value,o.value);return a.valid?(((0,E.isDirty)(i)||(0,E.isDirty)(o))&&r.dirty(),{status:r.value,value:a.data}):((0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_intersection_types}),E.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};S.ZodIntersection=Vr;Vr.create=(t,e,r)=>new Vr({left:t,right:e,typeName:se.ZodIntersection,...ae(r)});var Zt=class t extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.array)return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.array,received:n.parsedType}),E.INVALID;if(n.data.length<this._def.items.length)return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),E.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,E.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new mt(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>E.ParseStatus.mergeArray(r,o)):E.ParseStatus.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};S.ZodTuple=Zt;Zt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zt({items:t,typeName:se.ZodTuple,rest:null,...ae(e)})};var so=class t extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.object)return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.object,received:n.parsedType}),E.INVALID;let s=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:i._parse(new mt(n,a,n.path,a)),value:o._parse(new mt(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?E.ParseStatus.mergeObjectAsync(r,s):E.ParseStatus.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ue?new t({keyType:e,valueType:r,typeName:se.ZodRecord,...ae(n)}):new t({keyType:Sr.create(),valueType:e,typeName:se.ZodRecord,...ae(r)})}};S.ZodRecord=so;var En=class extends ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.map)return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.map,received:n.parsedType}),E.INVALID;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:s._parse(new mt(n,a,n.path,[c,"key"])),value:i._parse(new mt(n,u,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return E.INVALID;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return E.INVALID;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};S.ZodMap=En;En.create=(t,e,r)=>new En({valueType:e,keyType:t,typeName:se.ZodMap,...ae(r)});var Cn=class t extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.set)return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.set,received:n.parsedType}),E.INVALID;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&((0,E.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&((0,E.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return E.INVALID;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((u,c)=>i._parse(new mt(n,u,n.path,c)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:K.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:K.errorUtil.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};S.ZodSet=Cn;Cn.create=(t,e)=>new Cn({valueType:t,minSize:null,maxSize:null,typeName:se.ZodSet,...ae(e)});var oo=class t extends ue{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.ZodParsedType.function)return(0,E.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.function,received:r.parsedType}),E.INVALID;function n(a,u){return(0,E.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,ro.getErrorMap)(),ro.defaultErrorMap].filter(c=>!!c),issueData:{code:O.ZodIssueCode.invalid_arguments,argumentsError:u}})}function s(a,u){return(0,E.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,ro.getErrorMap)(),ro.defaultErrorMap].filter(c=>!!c),issueData:{code:O.ZodIssueCode.invalid_return_type,returnTypeError:u}})}let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Cr){let a=this;return(0,E.OK)(async function(...u){let c=new O.ZodError([]),l=await a._def.args.parseAsync(u,i).catch(g=>{throw c.addIssue(n(u,g)),c}),d=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(s(d,g)),c})})}else{let a=this;return(0,E.OK)(function(...u){let c=a._def.args.safeParse(u,i);if(!c.success)throw new O.ZodError([n(u,c.error)]);let l=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(l,i);if(!d.success)throw new O.ZodError([s(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Zt.create(e).rest(rr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Zt.create([]).rest(rr.create()),returns:r||rr.create(),typeName:se.ZodFunction,...ae(n)})}};S.ZodFunction=oo;var Gr=class extends ue{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};S.ZodLazy=Gr;Gr.create=(t,e)=>new Gr({getter:t,typeName:se.ZodLazy,...ae(e)});var zr=class extends ue{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(r,{received:r.data,code:O.ZodIssueCode.invalid_literal,expected:this._def.value}),E.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}};S.ZodLiteral=zr;zr.create=(t,e)=>new zr({value:t,typeName:se.ZodLiteral,...ae(e)});function Kf(t,e){return new Yr({values:t,typeName:se.ZodEnum,...ae(e)})}var Yr=class t extends ue{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,E.addIssueToContext)(r,{expected:L.util.joinValues(n),received:r.parsedType,code:O.ZodIssueCode.invalid_type}),E.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,E.addIssueToContext)(r,{received:r.data,code:O.ZodIssueCode.invalid_enum_value,options:n}),E.INVALID}return(0,E.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};S.ZodEnum=Yr;Yr.create=Kf;var Jr=class extends ue{_parse(e){let r=L.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==L.ZodParsedType.string&&n.parsedType!==L.ZodParsedType.number){let s=L.util.objectValues(r);return(0,E.addIssueToContext)(n,{expected:L.util.joinValues(s),received:n.parsedType,code:O.ZodIssueCode.invalid_type}),E.INVALID}if(this._cache||(this._cache=new Set(L.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=L.util.objectValues(r);return(0,E.addIssueToContext)(n,{received:n.data,code:O.ZodIssueCode.invalid_enum_value,options:s}),E.INVALID}return(0,E.OK)(e.data)}get enum(){return this._def.values}};S.ZodNativeEnum=Jr;Jr.create=(t,e)=>new Jr({values:t,typeName:se.ZodNativeEnum,...ae(e)});var Cr=class extends ue{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.ZodParsedType.promise&&r.common.async===!1)return(0,E.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.promise,received:r.parsedType}),E.INVALID;let n=r.parsedType===L.ZodParsedType.promise?r.data:Promise.resolve(r.data);return(0,E.OK)(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};S.ZodPromise=Cr;Cr.create=(t,e)=>new Cr({type:t,typeName:se.ZodPromise,...ae(e)});var ut=class extends ue{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{(0,E.addIssueToContext)(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return E.INVALID;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?E.INVALID:u.status==="dirty"||r.value==="dirty"?(0,E.DIRTY)(u.value):u});{if(r.value==="aborted")return E.INVALID;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?E.INVALID:a.status==="dirty"||r.value==="dirty"?(0,E.DIRTY)(a.value):a}}if(s.type==="refinement"){let o=a=>{let u=s.refinement(a,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?E.INVALID:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?E.INVALID:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,E.isValid)(o))return E.INVALID;let a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>(0,E.isValid)(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):E.INVALID);L.util.assertNever(s)}};S.ZodEffects=ut;S.ZodTransformer=ut;ut.create=(t,e,r)=>new ut({schema:t,typeName:se.ZodEffects,effect:e,...ae(r)});ut.createWithPreprocess=(t,e,r)=>new ut({schema:e,effect:{type:"preprocess",transform:t},typeName:se.ZodEffects,...ae(r)});var pt=class extends ue{_parse(e){return this._getType(e)===L.ZodParsedType.undefined?(0,E.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};S.ZodOptional=pt;pt.create=(t,e)=>new pt({innerType:t,typeName:se.ZodOptional,...ae(e)});var Ut=class extends ue{_parse(e){return this._getType(e)===L.ZodParsedType.null?(0,E.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};S.ZodNullable=Ut;Ut.create=(t,e)=>new Ut({innerType:t,typeName:se.ZodNullable,...ae(e)});var Xr=class extends ue{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===L.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};S.ZodDefault=Xr;Xr.create=(t,e)=>new Xr({innerType:t,typeName:se.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ae(e)});var Kr=class extends ue{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,E.isAsync)(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new O.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new O.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};S.ZodCatch=Kr;Kr.create=(t,e)=>new Kr({innerType:t,typeName:se.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ae(e)});var wn=class extends ue{_parse(e){if(this._getType(e)!==L.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.nan,received:n.parsedType}),E.INVALID}return{status:"valid",value:e.data}}};S.ZodNaN=wn;wn.create=t=>new wn({typeName:se.ZodNaN,...ae(t)});S.BRAND=Symbol("zod_brand");var Vn=class extends ue{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};S.ZodBranded=Vn;var Gn=class t extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?E.INVALID:i.status==="dirty"?(r.dirty(),(0,E.DIRTY)(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?E.INVALID:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:se.ZodPipeline})}};S.ZodPipeline=Gn;var Qr=class extends ue{_parse(e){let r=this._def.innerType._parse(e),n=s=>((0,E.isValid)(s)&&(s.value=Object.freeze(s.value)),s);return(0,E.isAsync)(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};S.ZodReadonly=Qr;Qr.create=(t,e)=>new Qr({innerType:t,typeName:se.ZodReadonly,...ae(e)});function zf(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Qf(t,e={},r){return t?Er.create().superRefine((n,s)=>{let i=t(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=zf(e,n),u=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:u})}});if(!i){let o=zf(e,n),a=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:a})}}):Er.create()}S.late={object:tt.lazycreate};var se;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(se||(S.ZodFirstPartyTypeKind=se={}));var CS=(t,e={message:`Input not instance of ${t.name}`})=>Qf(r=>r instanceof t,e);S.instanceof=CS;var eh=Sr.create;S.string=eh;var th=Br.create;S.number=th;var wS=wn.create;S.nan=wS;var xS=Mr.create;S.bigint=xS;var rh=qr.create;S.boolean=rh;var kS=Wr.create;S.date=kS;var $S=bn.create;S.symbol=$S;var AS=Hr.create;S.undefined=AS;var FS=Zr.create;S.null=FS;var jS=Er.create;S.any=jS;var IS=rr.create;S.unknown=IS;var TS=$t.create;S.never=TS;var RS=Sn.create;S.void=RS;var PS=nr.create;S.array=PS;var OS=tt.create;S.object=OS;var NS=tt.strictCreate;S.strictObject=NS;var LS=Ur.create;S.union=LS;var BS=no.create;S.discriminatedUnion=BS;var MS=Vr.create;S.intersection=MS;var qS=Zt.create;S.tuple=qS;var WS=so.create;S.record=WS;var HS=En.create;S.map=HS;var ZS=Cn.create;S.set=ZS;var US=oo.create;S.function=US;var VS=Gr.create;S.lazy=VS;var GS=zr.create;S.literal=GS;var zS=Yr.create;S.enum=zS;var YS=Jr.create;S.nativeEnum=YS;var JS=Cr.create;S.promise=JS;var nh=ut.create;S.effect=nh;S.transformer=nh;var XS=pt.create;S.optional=XS;var KS=Ut.create;S.nullable=KS;var QS=ut.createWithPreprocess;S.preprocess=QS;var eE=Gn.create;S.pipeline=eE;var tE=()=>eh().optional();S.ostring=tE;var rE=()=>th().optional();S.onumber=rE;var nE=()=>rh().optional();S.oboolean=nE;S.coerce={string:(t=>Sr.create({...t,coerce:!0})),number:(t=>Br.create({...t,coerce:!0})),boolean:(t=>qr.create({...t,coerce:!0})),bigint:(t=>Mr.create({...t,coerce:!0})),date:(t=>Wr.create({...t,coerce:!0}))};S.NEVER=E.INVALID});var Ga=v(gt=>{"use strict";var sE=gt&&gt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xn=gt&&gt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sE(e,t,r)};Object.defineProperty(gt,"__esModule",{value:!0});xn(eo(),gt);xn(Za(),gt);xn(Zf(),gt);xn(Zn(),gt);xn(sh(),gt);xn(Qs(),gt)});var za=v(rt=>{"use strict";var oh=rt&&rt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oE=rt&&rt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iE=rt&&rt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&oh(e,t,r);return oE(e,t),e},aE=rt&&rt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oh(e,t,r)};Object.defineProperty(rt,"__esModule",{value:!0});rt.z=void 0;var ih=iE(Ga());rt.z=ih;aE(Ga(),rt);rt.default=ih});var zn=v((w2,ah)=>{"use strict";var uE="2.0.0",cE=Number.MAX_SAFE_INTEGER||9007199254740991,lE=16,dE=250,fE=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ah.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:lE,MAX_SAFE_BUILD_LENGTH:dE,MAX_SAFE_INTEGER:cE,RELEASE_TYPES:fE,SEMVER_SPEC_VERSION:uE,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Yn=v((x2,uh)=>{"use strict";var hE=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};uh.exports=hE});var kn=v((Vt,ch)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ya,MAX_SAFE_BUILD_LENGTH:pE,MAX_LENGTH:mE}=zn(),gE=Yn();Vt=ch.exports={};var DE=Vt.re=[],yE=Vt.safeRe=[],Z=Vt.src=[],vE=Vt.safeSrc=[],U=Vt.t={},_E=0,Ja="[a-zA-Z0-9-]",bE=[["\\s",1],["\\d",mE],[Ja,pE]],SE=t=>{for(let[e,r]of bE)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ie=(t,e,r)=>{let n=SE(e),s=_E++;gE(t,s,e),U[t]=s,Z[s]=e,vE[s]=n,DE[s]=new RegExp(e,r?"g":void 0),yE[s]=new RegExp(n,r?"g":void 0)};ie("NUMERICIDENTIFIER","0|[1-9]\\d*");ie("NUMERICIDENTIFIERLOOSE","\\d+");ie("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ja}*`);ie("MAINVERSION",`(${Z[U.NUMERICIDENTIFIER]})\\.(${Z[U.NUMERICIDENTIFIER]})\\.(${Z[U.NUMERICIDENTIFIER]})`);ie("MAINVERSIONLOOSE",`(${Z[U.NUMERICIDENTIFIERLOOSE]})\\.(${Z[U.NUMERICIDENTIFIERLOOSE]})\\.(${Z[U.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASEIDENTIFIER",`(?:${Z[U.NONNUMERICIDENTIFIER]}|${Z[U.NUMERICIDENTIFIER]})`);ie("PRERELEASEIDENTIFIERLOOSE",`(?:${Z[U.NONNUMERICIDENTIFIER]}|${Z[U.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASE",`(?:-(${Z[U.PRERELEASEIDENTIFIER]}(?:\\.${Z[U.PRERELEASEIDENTIFIER]})*))`);ie("PRERELEASELOOSE",`(?:-?(${Z[U.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Z[U.PRERELEASEIDENTIFIERLOOSE]})*))`);ie("BUILDIDENTIFIER",`${Ja}+`);ie("BUILD",`(?:\\+(${Z[U.BUILDIDENTIFIER]}(?:\\.${Z[U.BUILDIDENTIFIER]})*))`);ie("FULLPLAIN",`v?${Z[U.MAINVERSION]}${Z[U.PRERELEASE]}?${Z[U.BUILD]}?`);ie("FULL",`^${Z[U.FULLPLAIN]}$`);ie("LOOSEPLAIN",`[v=\\s]*${Z[U.MAINVERSIONLOOSE]}${Z[U.PRERELEASELOOSE]}?${Z[U.BUILD]}?`);ie("LOOSE",`^${Z[U.LOOSEPLAIN]}$`);ie("GTLT","((?:<|>)?=?)");ie("XRANGEIDENTIFIERLOOSE",`${Z[U.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ie("XRANGEIDENTIFIER",`${Z[U.NUMERICIDENTIFIER]}|x|X|\\*`);ie("XRANGEPLAIN",`[v=\\s]*(${Z[U.XRANGEIDENTIFIER]})(?:\\.(${Z[U.XRANGEIDENTIFIER]})(?:\\.(${Z[U.XRANGEIDENTIFIER]})(?:${Z[U.PRERELEASE]})?${Z[U.BUILD]}?)?)?`);ie("XRANGEPLAINLOOSE",`[v=\\s]*(${Z[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Z[U.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Z[U.XRANGEIDENTIFIERLOOSE]})(?:${Z[U.PRERELEASELOOSE]})?${Z[U.BUILD]}?)?)?`);ie("XRANGE",`^${Z[U.GTLT]}\\s*${Z[U.XRANGEPLAIN]}$`);ie("XRANGELOOSE",`^${Z[U.GTLT]}\\s*${Z[U.XRANGEPLAINLOOSE]}$`);ie("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ya}})(?:\\.(\\d{1,${Ya}}))?(?:\\.(\\d{1,${Ya}}))?`);ie("COERCE",`${Z[U.COERCEPLAIN]}(?:$|[^\\d])`);ie("COERCEFULL",Z[U.COERCEPLAIN]+`(?:${Z[U.PRERELEASE]})?(?:${Z[U.BUILD]})?(?:$|[^\\d])`);ie("COERCERTL",Z[U.COERCE],!0);ie("COERCERTLFULL",Z[U.COERCEFULL],!0);ie("LONETILDE","(?:~>?)");ie("TILDETRIM",`(\\s*)${Z[U.LONETILDE]}\\s+`,!0);Vt.tildeTrimReplace="$1~";ie("TILDE",`^${Z[U.LONETILDE]}${Z[U.XRANGEPLAIN]}$`);ie("TILDELOOSE",`^${Z[U.LONETILDE]}${Z[U.XRANGEPLAINLOOSE]}$`);ie("LONECARET","(?:\\^)");ie("CARETTRIM",`(\\s*)${Z[U.LONECARET]}\\s+`,!0);Vt.caretTrimReplace="$1^";ie("CARET",`^${Z[U.LONECARET]}${Z[U.XRANGEPLAIN]}$`);ie("CARETLOOSE",`^${Z[U.LONECARET]}${Z[U.XRANGEPLAINLOOSE]}$`);ie("COMPARATORLOOSE",`^${Z[U.GTLT]}\\s*(${Z[U.LOOSEPLAIN]})$|^$`);ie("COMPARATOR",`^${Z[U.GTLT]}\\s*(${Z[U.FULLPLAIN]})$|^$`);ie("COMPARATORTRIM",`(\\s*)${Z[U.GTLT]}\\s*(${Z[U.LOOSEPLAIN]}|${Z[U.XRANGEPLAIN]})`,!0);Vt.comparatorTrimReplace="$1$2$3";ie("HYPHENRANGE",`^\\s*(${Z[U.XRANGEPLAIN]})\\s+-\\s+(${Z[U.XRANGEPLAIN]})\\s*$`);ie("HYPHENRANGELOOSE",`^\\s*(${Z[U.XRANGEPLAINLOOSE]})\\s+-\\s+(${Z[U.XRANGEPLAINLOOSE]})\\s*$`);ie("STAR","(<|>)?=?\\s*\\*");ie("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ie("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var io=v((k2,lh)=>{"use strict";var EE=Object.freeze({loose:!0}),CE=Object.freeze({}),wE=t=>t?typeof t!="object"?EE:t:CE;lh.exports=wE});var Xa=v(($2,hh)=>{"use strict";var dh=/^[0-9]+$/,fh=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=dh.test(t),n=dh.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},xE=(t,e)=>fh(e,t);hh.exports={compareIdentifiers:fh,rcompareIdentifiers:xE}});var qe=v((A2,mh)=>{"use strict";var ao=Yn(),{MAX_LENGTH:ph,MAX_SAFE_INTEGER:uo}=zn(),{safeRe:co,t:lo}=kn(),kE=io(),{compareIdentifiers:Ka}=Xa(),Qa=class t{constructor(e,r){if(r=kE(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ph)throw new TypeError(`version is longer than ${ph} characters`);ao("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?co[lo.LOOSE]:co[lo.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>uo||this.major<0)throw new TypeError("Invalid major version");if(this.minor>uo||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>uo||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<uo)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(ao("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(ao("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ka(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(ao("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ka(n,s)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?co[lo.PRERELEASELOOSE]:co[lo.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),Ka(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};mh.exports=Qa});var en=v((F2,Dh)=>{"use strict";var gh=qe(),$E=(t,e,r=!1)=>{if(t instanceof gh)return t;try{return new gh(t,e)}catch(n){if(!r)return null;throw n}};Dh.exports=$E});var vh=v((j2,yh)=>{"use strict";var AE=en(),FE=(t,e)=>{let r=AE(t,e);return r?r.version:null};yh.exports=FE});var bh=v((I2,_h)=>{"use strict";var jE=en(),IE=(t,e)=>{let r=jE(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};_h.exports=IE});var Ch=v((T2,Eh)=>{"use strict";var Sh=qe(),TE=(t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Sh(t instanceof Sh?t.version:t,r).inc(e,n,s).version}catch{return null}};Eh.exports=TE});var kh=v((R2,xh)=>{"use strict";var wh=en(),RE=(t,e)=>{let r=wh(t,null,!0),n=wh(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,o=i?r:n,a=i?n:r,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};xh.exports=RE});var Ah=v((P2,$h)=>{"use strict";var PE=qe(),OE=(t,e)=>new PE(t,e).major;$h.exports=OE});var jh=v((O2,Fh)=>{"use strict";var NE=qe(),LE=(t,e)=>new NE(t,e).minor;Fh.exports=LE});var Th=v((N2,Ih)=>{"use strict";var BE=qe(),ME=(t,e)=>new BE(t,e).patch;Ih.exports=ME});var Ph=v((L2,Rh)=>{"use strict";var qE=en(),WE=(t,e)=>{let r=qE(t,e);return r&&r.prerelease.length?r.prerelease:null};Rh.exports=WE});var Dt=v((B2,Nh)=>{"use strict";var Oh=qe(),HE=(t,e,r)=>new Oh(t,r).compare(new Oh(e,r));Nh.exports=HE});var Bh=v((M2,Lh)=>{"use strict";var ZE=Dt(),UE=(t,e,r)=>ZE(e,t,r);Lh.exports=UE});var qh=v((q2,Mh)=>{"use strict";var VE=Dt(),GE=(t,e)=>VE(t,e,!0);Mh.exports=GE});var fo=v((W2,Hh)=>{"use strict";var Wh=qe(),zE=(t,e,r)=>{let n=new Wh(t,r),s=new Wh(e,r);return n.compare(s)||n.compareBuild(s)};Hh.exports=zE});var Uh=v((H2,Zh)=>{"use strict";var YE=fo(),JE=(t,e)=>t.sort((r,n)=>YE(r,n,e));Zh.exports=JE});var Gh=v((Z2,Vh)=>{"use strict";var XE=fo(),KE=(t,e)=>t.sort((r,n)=>XE(n,r,e));Vh.exports=KE});var Jn=v((U2,zh)=>{"use strict";var QE=Dt(),eC=(t,e,r)=>QE(t,e,r)>0;zh.exports=eC});var ho=v((V2,Yh)=>{"use strict";var tC=Dt(),rC=(t,e,r)=>tC(t,e,r)<0;Yh.exports=rC});var eu=v((G2,Jh)=>{"use strict";var nC=Dt(),sC=(t,e,r)=>nC(t,e,r)===0;Jh.exports=sC});var tu=v((z2,Xh)=>{"use strict";var oC=Dt(),iC=(t,e,r)=>oC(t,e,r)!==0;Xh.exports=iC});var po=v((Y2,Kh)=>{"use strict";var aC=Dt(),uC=(t,e,r)=>aC(t,e,r)>=0;Kh.exports=uC});var mo=v((J2,Qh)=>{"use strict";var cC=Dt(),lC=(t,e,r)=>cC(t,e,r)<=0;Qh.exports=lC});var ru=v((X2,ep)=>{"use strict";var dC=eu(),fC=tu(),hC=Jn(),pC=po(),mC=ho(),gC=mo(),DC=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return dC(t,r,n);case"!=":return fC(t,r,n);case">":return hC(t,r,n);case">=":return pC(t,r,n);case"<":return mC(t,r,n);case"<=":return gC(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};ep.exports=DC});var rp=v((K2,tp)=>{"use strict";var yC=qe(),vC=en(),{safeRe:go,t:Do}=kn(),_C=(t,e)=>{if(t instanceof yC)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?go[Do.COERCEFULL]:go[Do.COERCE]);else{let u=e.includePrerelease?go[Do.COERCERTLFULL]:go[Do.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return vC(`${n}.${s}.${i}${o}${a}`,e)};tp.exports=_C});var sp=v((Q2,np)=>{"use strict";var nu=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};np.exports=nu});var yt=v((eI,up)=>{"use strict";var bC=/\s+/g,su=class t{constructor(e,r){if(r=EC(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof ou)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(bC," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!ip(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&FC(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&$C)|(this.options.loose&&AC))+":"+e,s=op.get(n);if(s)return s;let i=this.options.loose,o=i?Ge[We.HYPHENRANGELOOSE]:Ge[We.HYPHENRANGE];e=e.replace(o,MC(this.options.includePrerelease)),we("hyphen replace",e),e=e.replace(Ge[We.COMPARATORTRIM],wC),we("comparator trim",e),e=e.replace(Ge[We.TILDETRIM],xC),we("tilde trim",e),e=e.replace(Ge[We.CARETTRIM],kC),we("caret trim",e);let a=e.split(" ").map(d=>jC(d,this.options)).join(" ").split(/\s+/).map(d=>BC(d,this.options));i&&(a=a.filter(d=>(we("loose invalid filter",d,this.options),!!d.match(Ge[We.COMPARATORLOOSE])))),we("range list",a);let u=new Map,c=a.map(d=>new ou(d,this.options));for(let d of c){if(ip(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return op.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>ap(n,r)&&e.set.some(s=>ap(s,r)&&n.every(i=>s.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new CC(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(qC(this.set[r],e,this.options))return!0;return!1}};up.exports=su;var SC=sp(),op=new SC,EC=io(),ou=Xn(),we=Yn(),CC=qe(),{safeRe:Ge,t:We,comparatorTrimReplace:wC,tildeTrimReplace:xC,caretTrimReplace:kC}=kn(),{FLAG_INCLUDE_PRERELEASE:$C,FLAG_LOOSE:AC}=zn(),ip=t=>t.value==="<0.0.0-0",FC=t=>t.value==="",ap=(t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},jC=(t,e)=>(t=t.replace(Ge[We.BUILD],""),we("comp",t,e),t=RC(t,e),we("caret",t),t=IC(t,e),we("tildes",t),t=OC(t,e),we("xrange",t),t=LC(t,e),we("stars",t),t),ze=t=>!t||t.toLowerCase()==="x"||t==="*",IC=(t,e)=>t.trim().split(/\s+/).map(r=>TC(r,e)).join(" "),TC=(t,e)=>{let r=e.loose?Ge[We.TILDELOOSE]:Ge[We.TILDE];return t.replace(r,(n,s,i,o,a)=>{we("tilde",t,n,s,i,o,a);let u;return ze(s)?u="":ze(i)?u=`>=${s}.0.0 <${+s+1}.0.0-0`:ze(o)?u=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(we("replaceTilde pr",a),u=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):u=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,we("tilde return",u),u})},RC=(t,e)=>t.trim().split(/\s+/).map(r=>PC(r,e)).join(" "),PC=(t,e)=>{we("caret",t,e);let r=e.loose?Ge[We.CARETLOOSE]:Ge[We.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,u)=>{we("caret",t,s,i,o,a,u);let c;return ze(i)?c="":ze(o)?c=`>=${i}.0.0${n} <${+i+1}.0.0-0`:ze(a)?i==="0"?c=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:u?(we("replaceCaret pr",u),i==="0"?o==="0"?c=`>=${i}.${o}.${a}-${u} <${i}.${o}.${+a+1}-0`:c=`>=${i}.${o}.${a}-${u} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.${a}-${u} <${+i+1}.0.0-0`):(we("no pr"),i==="0"?o==="0"?c=`>=${i}.${o}.${a}${n} <${i}.${o}.${+a+1}-0`:c=`>=${i}.${o}.${a}${n} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),we("caret return",c),c})},OC=(t,e)=>(we("replaceXRanges",t,e),t.split(/\s+/).map(r=>NC(r,e)).join(" ")),NC=(t,e)=>{t=t.trim();let r=e.loose?Ge[We.XRANGELOOSE]:Ge[We.XRANGE];return t.replace(r,(n,s,i,o,a,u)=>{we("xRange",t,n,s,i,o,a,u);let c=ze(i),l=c||ze(o),d=l||ze(a),f=d;return s==="="&&f&&(s=""),u=e.includePrerelease?"-0":"",c?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&f?(l&&(o=0),a=0,s===">"?(s=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):s==="<="&&(s="<",l?i=+i+1:o=+o+1),s==="<"&&(u="-0"),n=`${s+i}.${o}.${a}${u}`):l?n=`>=${i}.0.0${u} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${u} <${i}.${+o+1}.0-0`),we("xRange return",n),n})},LC=(t,e)=>(we("replaceStars",t,e),t.trim().replace(Ge[We.STAR],"")),BC=(t,e)=>(we("replaceGTE0",t,e),t.trim().replace(Ge[e.includePrerelease?We.GTE0PRE:We.GTE0],"")),MC=t=>(e,r,n,s,i,o,a,u,c,l,d,f)=>(ze(n)?r="":ze(s)?r=`>=${n}.0.0${t?"-0":""}`:ze(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,ze(c)?u="":ze(l)?u=`<${+c+1}.0.0-0`:ze(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:t?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),qC=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(we(t[n].semver),t[n].semver!==ou.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Xn=v((tI,pp)=>{"use strict";var Kn=Symbol("SemVer ANY"),uu=class t{static get ANY(){return Kn}constructor(e,r){if(r=cp(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),au("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Kn?this.value="":this.value=this.operator+this.semver.version,au("comp",this)}parse(e){let r=this.options.loose?lp[dp.COMPARATORLOOSE]:lp[dp.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new fp(n[2],this.options.loose):this.semver=Kn}toString(){return this.value}test(e){if(au("Comparator.test",e,this.options.loose),this.semver===Kn||e===Kn)return!0;if(typeof e=="string")try{e=new fp(e,this.options)}catch{return!1}return iu(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new hp(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new hp(this.value,r).test(e.semver):(r=cp(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||iu(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||iu(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};pp.exports=uu;var cp=io(),{safeRe:lp,t:dp}=kn(),iu=ru(),au=Yn(),fp=qe(),hp=yt()});var Qn=v((rI,mp)=>{"use strict";var WC=yt(),HC=(t,e,r)=>{try{e=new WC(e,r)}catch{return!1}return e.test(t)};mp.exports=HC});var Dp=v((nI,gp)=>{"use strict";var ZC=yt(),UC=(t,e)=>new ZC(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));gp.exports=UC});var vp=v((sI,yp)=>{"use strict";var VC=qe(),GC=yt(),zC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new GC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new VC(n,r))}),n};yp.exports=zC});var bp=v((oI,_p)=>{"use strict";var YC=qe(),JC=yt(),XC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new JC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new YC(n,r))}),n};_p.exports=XC});var Cp=v((iI,Ep)=>{"use strict";var cu=qe(),KC=yt(),Sp=Jn(),QC=(t,e)=>{t=new KC(t,e);let r=new cu("0.0.0");if(t.test(r)||(r=new cu("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(o=>{let a=new cu(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||Sp(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||Sp(r,i))&&(r=i)}return r&&t.test(r)?r:null};Ep.exports=QC});var xp=v((aI,wp)=>{"use strict";var ew=yt(),tw=(t,e)=>{try{return new ew(t,e).range||"*"}catch{return null}};wp.exports=tw});var yo=v((uI,Fp)=>{"use strict";var rw=qe(),Ap=Xn(),{ANY:nw}=Ap,sw=yt(),ow=Qn(),kp=Jn(),$p=ho(),iw=mo(),aw=po(),uw=(t,e,r,n)=>{t=new rw(t,n),e=new sw(e,n);let s,i,o,a,u;switch(r){case">":s=kp,i=iw,o=$p,a=">",u=">=";break;case"<":s=$p,i=aw,o=kp,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ow(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],d=null,f=null;if(l.forEach(g=>{g.semver===nw&&(g=new Ap(">=0.0.0")),d=d||g,f=f||g,s(g.semver,d.semver,n)?d=g:o(g.semver,f.semver,n)&&(f=g)}),d.operator===a||d.operator===u||(!f.operator||f.operator===a)&&i(t,f.semver))return!1;if(f.operator===u&&o(t,f.semver))return!1}return!0};Fp.exports=uw});var Ip=v((cI,jp)=>{"use strict";var cw=yo(),lw=(t,e,r)=>cw(t,e,">",r);jp.exports=lw});var Rp=v((lI,Tp)=>{"use strict";var dw=yo(),fw=(t,e,r)=>dw(t,e,"<",r);Tp.exports=fw});var Np=v((dI,Op)=>{"use strict";var Pp=yt(),hw=(t,e,r)=>(t=new Pp(t,r),e=new Pp(e,r),t.intersects(e,r));Op.exports=hw});var Bp=v((fI,Lp)=>{"use strict";var pw=Qn(),mw=Dt();Lp.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((l,d)=>mw(l,d,r));for(let l of o)pw(l,e,r)?(i=l,s||(s=l)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===o[0]?a.push("*"):d?l===o[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var Up=v((hI,Zp)=>{"use strict";var Mp=yt(),du=Xn(),{ANY:lu}=du,es=Qn(),fu=Dt(),gw=(t,e,r={})=>{if(t===e)return!0;t=new Mp(t,r),e=new Mp(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=yw(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Dw=[new du(">=0.0.0-0")],qp=[new du(">=0.0.0")],yw=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===lu){if(e.length===1&&e[0].semver===lu)return!0;r.includePrerelease?t=Dw:t=qp}if(e.length===1&&e[0].semver===lu){if(r.includePrerelease)return!0;e=qp}let n=new Set,s,i;for(let g of t)g.operator===">"||g.operator===">="?s=Wp(s,g,r):g.operator==="<"||g.operator==="<="?i=Hp(i,g,r):n.add(g.semver);if(n.size>1)return null;let o;if(s&&i){if(o=fu(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let g of n){if(s&&!es(g,String(s),r)||i&&!es(g,String(i),r))return null;for(let m of e)if(!es(g,String(m),r))return!1;return!0}let a,u,c,l,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let g of e){if(l=l||g.operator===">"||g.operator===">=",c=c||g.operator==="<"||g.operator==="<=",s){if(f&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===f.major&&g.semver.minor===f.minor&&g.semver.patch===f.patch&&(f=!1),g.operator===">"||g.operator===">="){if(a=Wp(s,g,r),a===g&&a!==s)return!1}else if(s.operator===">="&&!es(s.semver,String(g),r))return!1}if(i){if(d&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===d.major&&g.semver.minor===d.minor&&g.semver.patch===d.patch&&(d=!1),g.operator==="<"||g.operator==="<="){if(u=Hp(i,g,r),u===g&&u!==i)return!1}else if(i.operator==="<="&&!es(i.semver,String(g),r))return!1}if(!g.operator&&(i||s)&&o!==0)return!1}return!(s&&c&&!i&&o!==0||i&&l&&!s&&o!==0||f||d)},Wp=(t,e,r)=>{if(!t)return e;let n=fu(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Hp=(t,e,r)=>{if(!t)return e;let n=fu(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Zp.exports=gw});var Yp=v((pI,zp)=>{"use strict";var hu=kn(),Vp=zn(),vw=qe(),Gp=Xa(),_w=en(),bw=vh(),Sw=bh(),Ew=Ch(),Cw=kh(),ww=Ah(),xw=jh(),kw=Th(),$w=Ph(),Aw=Dt(),Fw=Bh(),jw=qh(),Iw=fo(),Tw=Uh(),Rw=Gh(),Pw=Jn(),Ow=ho(),Nw=eu(),Lw=tu(),Bw=po(),Mw=mo(),qw=ru(),Ww=rp(),Hw=Xn(),Zw=yt(),Uw=Qn(),Vw=Dp(),Gw=vp(),zw=bp(),Yw=Cp(),Jw=xp(),Xw=yo(),Kw=Ip(),Qw=Rp(),ex=Np(),tx=Bp(),rx=Up();zp.exports={parse:_w,valid:bw,clean:Sw,inc:Ew,diff:Cw,major:ww,minor:xw,patch:kw,prerelease:$w,compare:Aw,rcompare:Fw,compareLoose:jw,compareBuild:Iw,sort:Tw,rsort:Rw,gt:Pw,lt:Ow,eq:Nw,neq:Lw,gte:Bw,lte:Mw,cmp:qw,coerce:Ww,Comparator:Hw,Range:Zw,satisfies:Uw,toComparators:Vw,maxSatisfying:Gw,minSatisfying:zw,minVersion:Yw,validRange:Jw,outside:Xw,gtr:Kw,ltr:Qw,intersects:ex,simplifyRange:tx,subset:rx,SemVer:vw,re:hu.re,src:hu.src,tokens:hu.t,SEMVER_SPEC_VERSION:Vp.SEMVER_SPEC_VERSION,RELEASE_TYPES:Vp.RELEASE_TYPES,compareIdentifiers:Gp.compareIdentifiers,rcompareIdentifiers:Gp.rcompareIdentifiers}});var sr=v(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});var nx=(function(){function t(){}return t.prototype.diff=function(e,r,n){n===void 0&&(n={});var s;typeof n=="function"?(s=n,n={}):"callback"in n&&(s=n.callback);var i=this.castInput(e,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(i,n)),u=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,u,n,s)},t.prototype.diffWithOptionsObj=function(e,r,n,s){var i=this,o,a=function(T){if(T=i.postProcess(T,n),s){setTimeout(function(){s(T)},0);return}else return T},u=r.length,c=e.length,l=1,d=u+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));var f=(o=n.timeout)!==null&&o!==void 0?o:1/0,g=Date.now()+f,m=[{oldPos:-1,lastComponent:void 0}],y=this.extractCommon(m[0],r,e,0,n);if(m[0].oldPos+1>=c&&y+1>=u)return a(this.buildValues(m[0].lastComponent,r,e));var h=-1/0,w=1/0,C=function(){for(var T=Math.max(h,-l);T<=Math.min(w,l);T+=2){var V=void 0,I=m[T-1],H=m[T+1];I&&(m[T-1]=void 0);var F=!1;if(H){var q=H.oldPos-T;F=H&&0<=q&&q<u}var P=I&&I.oldPos+1<c;if(!F&&!P){m[T]=void 0;continue}if(!P||F&&I.oldPos<H.oldPos?V=i.addToPath(H,!0,!1,0,n):V=i.addToPath(I,!1,!0,1,n),y=i.extractCommon(V,r,e,T,n),V.oldPos+1>=c&&y+1>=u)return a(i.buildValues(V.lastComponent,r,e))||!0;m[T]=V,V.oldPos+1>=c&&(w=Math.min(w,T-1)),y+1>=u&&(h=Math.max(h,T+1))}l++};if(s)(function T(){setTimeout(function(){if(l>d||Date.now()>g)return s(void 0);C()||T()},0)})();else for(;l<=d&&Date.now()<=g;){var A=C();if(A)return A}},t.prototype.addToPath=function(e,r,n,s,i){var o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}},t.prototype.extractCommon=function(e,r,n,s,i){for(var o=r.length,a=n.length,u=e.oldPos,c=u-s,l=0;c+1<o&&u+1<a&&this.equals(n[u+1],r[c+1],i);)c++,u++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=u,c},t.prototype.equals=function(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()},t.prototype.removeEmpty=function(e){for(var r=[],n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r},t.prototype.castInput=function(e,r){return e},t.prototype.tokenize=function(e,r){return Array.from(e)},t.prototype.join=function(e){return e.join("")},t.prototype.postProcess=function(e,r){return e},Object.defineProperty(t.prototype,"useLongestToken",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.buildValues=function(e,r,n){for(var s=[],i;e;)s.push(e),i=e.previousComponent,delete e.previousComponent,e=i;s.reverse();for(var o=s.length,a=0,u=0,c=0;a<o;a++){var l=s[a];if(l.removed)l.value=this.join(n.slice(c,c+l.count)),c+=l.count;else{if(!l.added&&this.useLongestToken){var d=r.slice(u,u+l.count);d=d.map(function(f,g){var m=n[c+g];return m.length>f.length?m:f}),l.value=this.join(d)}else l.value=this.join(r.slice(u,u+l.count));u+=l.count,l.added||(c+=l.count)}}return s},t})();pu.default=nx});var Jp=v(wr=>{"use strict";var sx=wr&&wr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(wr,"__esModule",{value:!0});wr.characterDiff=void 0;wr.diffChars=ax;var ox=sr(),ix=(function(t){sx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(ox.default);wr.characterDiff=new ix;function ax(t,e,r){return wr.characterDiff.diff(t,e,r)}});var gu=v(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.longestCommonPrefix=ux;Ye.longestCommonSuffix=cx;Ye.replacePrefix=Xp;Ye.replaceSuffix=Kp;Ye.removePrefix=lx;Ye.removeSuffix=dx;Ye.maximumOverlap=fx;Ye.hasOnlyWinLineEndings=px;Ye.hasOnlyUnixLineEndings=mx;Ye.segment=Qp;Ye.trailingWs=em;Ye.leadingWs=tm;Ye.leadingAndTrailingWs=mu;function ux(t,e){var r;for(r=0;r<t.length&&r<e.length;r++)if(t[r]!=e[r])return t.slice(0,r);return t.slice(0,r)}function cx(t,e){var r;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(r=0;r<t.length&&r<e.length;r++)if(t[t.length-(r+1)]!=e[e.length-(r+1)])return t.slice(-r);return t.slice(-r)}function Xp(t,e,r){if(t.slice(0,e.length)!=e)throw Error("string ".concat(JSON.stringify(t)," doesn't start with prefix ").concat(JSON.stringify(e),"; this is a bug"));return r+t.slice(e.length)}function Kp(t,e,r){if(!e)return t+r;if(t.slice(-e.length)!=e)throw Error("string ".concat(JSON.stringify(t)," doesn't end with suffix ").concat(JSON.stringify(e),"; this is a bug"));return t.slice(0,-e.length)+r}function lx(t,e){return Xp(t,e,"")}function dx(t,e){return Kp(t,e,"")}function fx(t,e){return e.slice(0,hx(t,e))}function hx(t,e){var r=0;t.length>e.length&&(r=t.length-e.length);var n=e.length;t.length<e.length&&(n=t.length);var s=Array(n),i=0;s[0]=0;for(var o=1;o<n;o++){for(e[o]==e[i]?s[o]=s[i]:s[o]=i;i>0&&e[o]!=e[i];)i=s[i];e[o]==e[i]&&i++}i=0;for(var a=r;a<t.length;a++){for(;i>0&&t[a]!=e[i];)i=s[i];t[a]==e[i]&&i++}return i}function px(t){return t.includes(`\r
9
9
  `)&&!t.startsWith(`
10
- `)&&!t.match(/[^\r]\n/)}function px(t){return!t.includes(`\r
10
+ `)&&!t.match(/[^\r]\n/)}function mx(t){return!t.includes(`\r
11
11
  `)&&t.includes(`
12
- `)}function Kp(t,e){for(var r=[],n=0,s=Array.from(e.segment(t));n<s.length;n++){var i=s[n],o=i.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(o)?r[r.length-1]+=o:r.push(o)}return r}function Qp(t,e){if(e)return pu(t,e)[1];var r;for(r=t.length-1;r>=0&&t[r].match(/\s/);r--);return t.substring(r+1)}function em(t,e){if(e)return pu(t,e)[0];var r=t.match(/^\s*/);return r?r[0]:""}function pu(t,e){if(!e)return[em(t),Qp(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');var r=Kp(t,e),n=r[0],s=r[r.length-1],i=/\s/.test(n)?n:"",o=/\s/.test(s)?s:"";return[i,o]}});var om=v(Dt=>{"use strict";var rm=Dt&&Dt.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Dt,"__esModule",{value:!0});Dt.wordsWithSpaceDiff=Dt.wordDiff=void 0;Dt.diffWords=Dx;Dt.diffWordsWithSpace=sm;var nm=nr(),me=mu(),yo="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",mx=new RegExp("[".concat(yo,"]+|\\s+|[^").concat(yo,"]"),"ug"),gx=(function(t){rm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.equals=function(r,n,s){return s.ignoreCase&&(r=r.toLowerCase(),n=n.toLowerCase()),r.trim()===n.trim()},e.prototype.tokenize=function(r,n){n===void 0&&(n={});var s;if(n.intlSegmenter){var i=n.intlSegmenter;if(i.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');s=(0,me.segment)(r,i)}else s=r.match(mx)||[];var o=[],a=null;return s.forEach(function(u){/\s/.test(u)?a==null?o.push(u):o.push(o.pop()+u):a!=null&&/\s/.test(a)?o[o.length-1]==a?o.push(o.pop()+u):o.push(a+u):o.push(u),a=u}),o},e.prototype.join=function(r){return r.map(function(n,s){return s==0?n:n.replace(/^\s+/,"")}).join("")},e.prototype.postProcess=function(r,n){if(!r||n.oneChangePerToken)return r;var s=null,i=null,o=null;return r.forEach(function(a){a.added?i=a:a.removed?o=a:((i||o)&&tm(s,o,i,a,n.intlSegmenter),s=a,i=null,o=null)}),(i||o)&&tm(s,o,i,null,n.intlSegmenter),r},e})(nm.default);Dt.wordDiff=new gx;function Dx(t,e,r){return r?.ignoreWhitespace!=null&&!r.ignoreWhitespace?sm(t,e,r):Dt.wordDiff.diff(t,e,r)}function tm(t,e,r,n,s){if(e&&r){var i=(0,me.leadingAndTrailingWs)(e.value,s),o=i[0],a=i[1],u=(0,me.leadingAndTrailingWs)(r.value,s),c=u[0],l=u[1];if(t){var d=(0,me.longestCommonPrefix)(o,c);t.value=(0,me.replaceSuffix)(t.value,c,d),e.value=(0,me.removePrefix)(e.value,d),r.value=(0,me.removePrefix)(r.value,d)}if(n){var f=(0,me.longestCommonSuffix)(a,l);n.value=(0,me.replacePrefix)(n.value,l,f),e.value=(0,me.removeSuffix)(e.value,f),r.value=(0,me.removeSuffix)(r.value,f)}}else if(r){if(t){var g=(0,me.leadingWs)(r.value,s);r.value=r.value.substring(g.length)}if(n){var g=(0,me.leadingWs)(n.value,s);n.value=n.value.substring(g.length)}}else if(t&&n){var m=(0,me.leadingWs)(n.value,s),D=(0,me.leadingAndTrailingWs)(e.value,s),h=D[0],w=D[1],C=(0,me.longestCommonPrefix)(m,h);e.value=(0,me.removePrefix)(e.value,C);var A=(0,me.longestCommonSuffix)((0,me.removePrefix)(m,C),w);e.value=(0,me.removeSuffix)(e.value,A),n.value=(0,me.replacePrefix)(n.value,m,A),t.value=(0,me.replaceSuffix)(t.value,m,m.slice(0,m.length-A.length))}else if(n){var T=(0,me.leadingWs)(n.value,s),G=(0,me.trailingWs)(e.value,s),I=(0,me.maximumOverlap)(G,T);e.value=(0,me.removeSuffix)(e.value,I)}else if(t){var Z=(0,me.trailingWs)(t.value,s),F=(0,me.leadingWs)(e.value,s),I=(0,me.maximumOverlap)(Z,F);e.value=(0,me.removePrefix)(e.value,I)}}var yx=(function(t){rm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){var n=new RegExp("(\\r?\\n)|[".concat(yo,"]+|[^\\S\\n\\r]+|[^").concat(yo,"]"),"ug");return r.match(n)||[]},e})(nm.default);Dt.wordsWithSpaceDiff=new yx;function sm(t,e,r){return Dt.wordsWithSpaceDiff.diff(t,e,r)}});var im=v(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.generateOptions=vx;function vx(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}});var vo=v($t=>{"use strict";var _x=$t&&$t.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty($t,"__esModule",{value:!0});$t.lineDiff=void 0;$t.diffLines=Cx;$t.diffTrimmedLines=wx;$t.tokenize=am;var Ex=nr(),bx=im(),Sx=(function(t){_x(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=am,r}return e.prototype.equals=function(r,n,s){return s.ignoreWhitespace?((!s.newlineIsToken||!r.includes(`
12
+ `)}function Qp(t,e){for(var r=[],n=0,s=Array.from(e.segment(t));n<s.length;n++){var i=s[n],o=i.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(o)?r[r.length-1]+=o:r.push(o)}return r}function em(t,e){if(e)return mu(t,e)[1];var r;for(r=t.length-1;r>=0&&t[r].match(/\s/);r--);return t.substring(r+1)}function tm(t,e){if(e)return mu(t,e)[0];var r=t.match(/^\s*/);return r?r[0]:""}function mu(t,e){if(!e)return[tm(t),em(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');var r=Qp(t,e),n=r[0],s=r[r.length-1],i=/\s/.test(n)?n:"",o=/\s/.test(s)?s:"";return[i,o]}});var im=v(vt=>{"use strict";var nm=vt&&vt.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(vt,"__esModule",{value:!0});vt.wordsWithSpaceDiff=vt.wordDiff=void 0;vt.diffWords=yx;vt.diffWordsWithSpace=om;var sm=sr(),me=gu(),vo="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",gx=new RegExp("[".concat(vo,"]+|\\s+|[^").concat(vo,"]"),"ug"),Dx=(function(t){nm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.equals=function(r,n,s){return s.ignoreCase&&(r=r.toLowerCase(),n=n.toLowerCase()),r.trim()===n.trim()},e.prototype.tokenize=function(r,n){n===void 0&&(n={});var s;if(n.intlSegmenter){var i=n.intlSegmenter;if(i.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');s=(0,me.segment)(r,i)}else s=r.match(gx)||[];var o=[],a=null;return s.forEach(function(u){/\s/.test(u)?a==null?o.push(u):o.push(o.pop()+u):a!=null&&/\s/.test(a)?o[o.length-1]==a?o.push(o.pop()+u):o.push(a+u):o.push(u),a=u}),o},e.prototype.join=function(r){return r.map(function(n,s){return s==0?n:n.replace(/^\s+/,"")}).join("")},e.prototype.postProcess=function(r,n){if(!r||n.oneChangePerToken)return r;var s=null,i=null,o=null;return r.forEach(function(a){a.added?i=a:a.removed?o=a:((i||o)&&rm(s,o,i,a,n.intlSegmenter),s=a,i=null,o=null)}),(i||o)&&rm(s,o,i,null,n.intlSegmenter),r},e})(sm.default);vt.wordDiff=new Dx;function yx(t,e,r){return r?.ignoreWhitespace!=null&&!r.ignoreWhitespace?om(t,e,r):vt.wordDiff.diff(t,e,r)}function rm(t,e,r,n,s){if(e&&r){var i=(0,me.leadingAndTrailingWs)(e.value,s),o=i[0],a=i[1],u=(0,me.leadingAndTrailingWs)(r.value,s),c=u[0],l=u[1];if(t){var d=(0,me.longestCommonPrefix)(o,c);t.value=(0,me.replaceSuffix)(t.value,c,d),e.value=(0,me.removePrefix)(e.value,d),r.value=(0,me.removePrefix)(r.value,d)}if(n){var f=(0,me.longestCommonSuffix)(a,l);n.value=(0,me.replacePrefix)(n.value,l,f),e.value=(0,me.removeSuffix)(e.value,f),r.value=(0,me.removeSuffix)(r.value,f)}}else if(r){if(t){var g=(0,me.leadingWs)(r.value,s);r.value=r.value.substring(g.length)}if(n){var g=(0,me.leadingWs)(n.value,s);n.value=n.value.substring(g.length)}}else if(t&&n){var m=(0,me.leadingWs)(n.value,s),y=(0,me.leadingAndTrailingWs)(e.value,s),h=y[0],w=y[1],C=(0,me.longestCommonPrefix)(m,h);e.value=(0,me.removePrefix)(e.value,C);var A=(0,me.longestCommonSuffix)((0,me.removePrefix)(m,C),w);e.value=(0,me.removeSuffix)(e.value,A),n.value=(0,me.replacePrefix)(n.value,m,A),t.value=(0,me.replaceSuffix)(t.value,m,m.slice(0,m.length-A.length))}else if(n){var T=(0,me.leadingWs)(n.value,s),V=(0,me.trailingWs)(e.value,s),I=(0,me.maximumOverlap)(V,T);e.value=(0,me.removeSuffix)(e.value,I)}else if(t){var H=(0,me.trailingWs)(t.value,s),F=(0,me.leadingWs)(e.value,s),I=(0,me.maximumOverlap)(H,F);e.value=(0,me.removePrefix)(e.value,I)}}var vx=(function(t){nm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){var n=new RegExp("(\\r?\\n)|[".concat(vo,"]+|[^\\S\\n\\r]+|[^").concat(vo,"]"),"ug");return r.match(n)||[]},e})(sm.default);vt.wordsWithSpaceDiff=new vx;function om(t,e,r){return vt.wordsWithSpaceDiff.diff(t,e,r)}});var am=v(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.generateOptions=_x;function _x(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}});var _o=v(At=>{"use strict";var bx=At&&At.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(At,"__esModule",{value:!0});At.lineDiff=void 0;At.diffLines=wx;At.diffTrimmedLines=xx;At.tokenize=um;var Sx=sr(),Ex=am(),Cx=(function(t){bx(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=um,r}return e.prototype.equals=function(r,n,s){return s.ignoreWhitespace?((!s.newlineIsToken||!r.includes(`
13
13
  `))&&(r=r.trim()),(!s.newlineIsToken||!n.includes(`
14
14
  `))&&(n=n.trim())):s.ignoreNewlineAtEof&&!s.newlineIsToken&&(r.endsWith(`
15
15
  `)&&(r=r.slice(0,-1)),n.endsWith(`
16
- `)&&(n=n.slice(0,-1))),t.prototype.equals.call(this,r,n,s)},e})(Ex.default);$t.lineDiff=new Sx;function Cx(t,e,r){return $t.lineDiff.diff(t,e,r)}function wx(t,e,r){return r=(0,bx.generateOptions)(r,{ignoreWhitespace:!0}),$t.lineDiff.diff(t,e,r)}function am(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
17
- `));var r=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var s=0;s<n.length;s++){var i=n[s];s%2&&!e.newlineIsToken?r[r.length-1]+=i:r.push(i)}return r}});var um=v(wr=>{"use strict";var xx=wr&&wr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(wr,"__esModule",{value:!0});wr.sentenceDiff=void 0;wr.diffSentences=Fx;var $x=nr();function kx(t){return t=="."||t=="!"||t=="?"}var Ax=(function(t){xx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){for(var n,s=[],i=0,o=0;o<r.length;o++){if(o==r.length-1){s.push(r.slice(i));break}if(kx(r[o])&&r[o+1].match(/\s/)){for(s.push(r.slice(i,o+1)),o=i=o+1;!((n=r[o+1])===null||n===void 0)&&n.match(/\s/);)o++;s.push(r.slice(i,o+1)),i=o+1}}return s},e})($x.default);wr.sentenceDiff=new Ax;function Fx(t,e,r){return wr.sentenceDiff.diff(t,e,r)}});var cm=v(xr=>{"use strict";var jx=xr&&xr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(xr,"__esModule",{value:!0});xr.cssDiff=void 0;xr.diffCss=Rx;var Ix=nr(),Tx=(function(t){jx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.split(/([{}:;,]|\s+)/)},e})(Ix.default);xr.cssDiff=new Tx;function Rx(t,e,r){return xr.cssDiff.diff(t,e,r)}});var lm=v(sr=>{"use strict";var Px=sr&&sr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(sr,"__esModule",{value:!0});sr.jsonDiff=void 0;sr.diffJson=Bx;sr.canonicalize=_o;var Ox=nr(),Nx=vo(),Lx=(function(t){Px(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=Nx.tokenize,r}return Object.defineProperty(e.prototype,"useLongestToken",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.castInput=function(r,n){var s=n.undefinedReplacement,i=n.stringifyReplacer,o=i===void 0?function(a,u){return typeof u>"u"?s:u}:i;return typeof r=="string"?r:JSON.stringify(_o(r,null,null,o),null," ")},e.prototype.equals=function(r,n,s){return t.prototype.equals.call(this,r.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),s)},e})(Ox.default);sr.jsonDiff=new Lx;function Bx(t,e,r){return sr.jsonDiff.diff(t,e,r)}function _o(t,e,r,n,s){e=e||[],r=r||[],n&&(t=n(s===void 0?"":s,t));var i;for(i=0;i<e.length;i+=1)if(e[i]===t)return r[i];var o;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),o=new Array(t.length),r.push(o),i=0;i<t.length;i+=1)o[i]=_o(t[i],e,r,n,String(i));return e.pop(),r.pop(),o}if(t&&t.toJSON&&(t=t.toJSON()),typeof t=="object"&&t!==null){e.push(t),o={},r.push(o);var a=[],u;for(u in t)Object.prototype.hasOwnProperty.call(t,u)&&a.push(u);for(a.sort(),i=0;i<a.length;i+=1)u=a[i],o[u]=_o(t[u],e,r,n,u);e.pop(),r.pop()}else o=t;return o}});var dm=v($r=>{"use strict";var Mx=$r&&$r.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty($r,"__esModule",{value:!0});$r.arrayDiff=void 0;$r.diffArrays=Hx;var qx=nr(),Wx=(function(t){Mx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.slice()},e.prototype.join=function(r){return r},e.prototype.removeEmpty=function(r){return r},e})(qx.default);$r.arrayDiff=new Wx;function Hx(t,e,r){return $r.arrayDiff.diff(t,e,r)}});var pm=v(kr=>{"use strict";var Vt=kr&&kr.__assign||function(){return Vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Vt.apply(this,arguments)};Object.defineProperty(kr,"__esModule",{value:!0});kr.unixToWin=fm;kr.winToUnix=hm;kr.isUnix=Zx;kr.isWin=Ux;function fm(t){return Array.isArray(t)?t.map(function(e){return fm(e)}):Vt(Vt({},t),{hunks:t.hunks.map(function(e){return Vt(Vt({},e),{lines:e.lines.map(function(r,n){var s;return r.startsWith("\\")||r.endsWith("\r")||!((s=e.lines[n+1])===null||s===void 0)&&s.startsWith("\\")?r:r+"\r"})})})})}function hm(t){return Array.isArray(t)?t.map(function(e){return hm(e)}):Vt(Vt({},t),{hunks:t.hunks.map(function(e){return Vt(Vt({},e),{lines:e.lines.map(function(r){return r.endsWith("\r")?r.substring(0,r.length-1):r})})})})}function Zx(t){return Array.isArray(t)||(t=[t]),!t.some(function(e){return e.hunks.some(function(r){return r.lines.some(function(n){return!n.startsWith("\\")&&n.endsWith("\r")})})})}function Ux(t){return Array.isArray(t)||(t=[t]),t.some(function(e){return e.hunks.some(function(r){return r.lines.some(function(n){return n.endsWith("\r")})})})&&t.every(function(e){return e.hunks.every(function(r){return r.lines.every(function(n,s){var i;return n.startsWith("\\")||n.endsWith("\r")||((i=r.lines[s+1])===null||i===void 0?void 0:i.startsWith("\\"))})})})}});var yu=v(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.parsePatch=Vx;function Vx(t){var e=t.split(/\n/),r=[],n=0;function s(){var a={};for(r.push(a);n<e.length;){var u=e[n];if(/^(---|\+\+\+|@@)\s/.test(u))break;var c=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(u);c&&(a.index=u.substring(c[0].length).trim()),n++}for(i(a),i(a),a.hunks=[];n<e.length;){var u=e[n];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(u))break;if(/^@@/.test(u))a.hunks.push(o());else{if(u)throw new Error("Unknown line "+(n+1)+" "+JSON.stringify(u));n++}}}function i(a){var u=/^(---|\+\+\+)\s+/.exec(e[n]);if(u){var c=u[1],l=e[n].substring(3).trim().split(" ",2),d=(l[1]||"").trim(),f=l[0].replace(/\\\\/g,"\\");f.startsWith('"')&&f.endsWith('"')&&(f=f.substr(1,f.length-2)),c==="---"?(a.oldFileName=f,a.oldHeader=d):(a.newFileName=f,a.newHeader=d),n++}}function o(){var a,u=n,c=e[n++],l=c.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),d={oldStart:+l[1],oldLines:typeof l[2]>"u"?1:+l[2],newStart:+l[3],newLines:typeof l[4]>"u"?1:+l[4],lines:[]};d.oldLines===0&&(d.oldStart+=1),d.newLines===0&&(d.newStart+=1);for(var f=0,g=0;n<e.length&&(g<d.oldLines||f<d.newLines||!((a=e[n])===null||a===void 0)&&a.startsWith("\\"));n++){var m=e[n].length==0&&n!=e.length-1?" ":e[n][0];if(m==="+"||m==="-"||m===" "||m==="\\")d.lines.push(e[n]),m==="+"?f++:m==="-"?g++:m===" "&&(f++,g++);else throw new Error("Hunk at line ".concat(u+1," contained invalid line ").concat(e[n]))}if(!f&&d.newLines===1&&(d.newLines=0),!g&&d.oldLines===1&&(d.oldLines=0),f!==d.newLines)throw new Error("Added line count did not match for hunk at line "+(u+1));if(g!==d.oldLines)throw new Error("Removed line count did not match for hunk at line "+(u+1));return d}for(;n<e.length;)s();return r}});var mm=v(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.default=Gx;function Gx(t,e,r){var n=!0,s=!1,i=!1,o=1;return function a(){if(n&&!i){if(s?o++:n=!1,t+o<=r)return t+o;i=!0}if(!s)return i||(n=!0),e<=t-o?t-o++:(s=!0,a())}}});var vm=v(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.applyPatch=ym;bo.applyPatches=Xx;var gm=mu(),Eo=pm(),Dm=yu(),zx=mm();function ym(t,e,r){r===void 0&&(r={});var n;if(typeof e=="string"?n=(0,Dm.parsePatch)(e):Array.isArray(e)?n=e:n=[e],n.length>1)throw new Error("applyPatch only works with a single input.");return Yx(t,n[0],r)}function Yx(t,e,r){r===void 0&&(r={}),(r.autoConvertLineEndings||r.autoConvertLineEndings==null)&&((0,gm.hasOnlyWinLineEndings)(t)&&(0,Eo.isUnix)(e)?e=(0,Eo.unixToWin)(e):(0,gm.hasOnlyUnixLineEndings)(t)&&(0,Eo.isWin)(e)&&(e=(0,Eo.winToUnix)(e)));var n=t.split(`
18
- `),s=e.hunks,i=r.compareLine||(function(F,W,P,E){return W===E}),o=r.fuzzFactor||0,a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return t;for(var u="",c=!1,l=!1,d=0;d<s[s.length-1].lines.length;d++){var f=s[s.length-1].lines[d];f[0]=="\\"&&(u[0]=="+"?c=!0:u[0]=="-"&&(l=!0)),u=f}if(c){if(l){if(!o&&n[n.length-1]=="")return!1}else if(n[n.length-1]=="")n.pop();else if(!o)return!1}else if(l){if(n[n.length-1]!="")n.push("");else if(!o)return!1}function g(F,W,P,E,Q,re,le){E===void 0&&(E=0),Q===void 0&&(Q=!0),re===void 0&&(re=[]),le===void 0&&(le=0);for(var $=0,k=!1;E<F.length;E++){var he=F[E],J=he.length>0?he[0]:" ",xe=he.length>0?he.substr(1):he;if(J==="-")if(i(W+1,n[W],J,xe))W++,$=0;else return!P||n[W]==null?null:(re[le]=n[W],g(F,W+1,P-1,E,!1,re,le+1));if(J==="+"){if(!Q)return null;re[le]=xe,le++,$=0,k=!0}if(J===" ")if($++,re[le]=n[W],i(W+1,n[W],J,xe))le++,Q=!0,k=!1,W++;else return k||!P?null:n[W]&&(g(F,W+1,P-1,E+1,!1,re,le+1)||g(F,W+1,P-1,E,!1,re,le+1))||g(F,W,P-1,E+1,!1,re,le)}return le-=$,W-=$,re.length=le,{patchedLines:re,oldLineLastI:W-1}}for(var m=[],D=0,d=0;d<s.length;d++){for(var h=s[d],w=void 0,C=n.length-h.oldLines+o,A=void 0,T=0;T<=o;T++){A=h.oldStart+D-1;for(var G=(0,zx.default)(A,a,C);A!==void 0&&(w=g(h.lines,A,T),!w);A=G());if(w)break}if(!w)return!1;for(var I=a;I<A;I++)m.push(n[I]);for(var Z=0;Z<w.patchedLines.length;Z++){var f=w.patchedLines[Z];m.push(f)}a=w.oldLineLastI+1,D=A+1-h.oldStart}for(var d=a;d<n.length;d++)m.push(n[d]);return m.join(`
19
- `)}function Xx(t,e){var r=typeof t=="string"?(0,Dm.parsePatch)(t):t,n=0;function s(){var i=r[n++];if(!i)return e.complete();e.loadFile(i,function(o,a){if(o)return e.complete(o);var u=ym(a,i,e);e.patched(i,u,function(c){if(c)return e.complete(c);s()})})}s()}});var Em=v(ts=>{"use strict";var So=ts&&ts.__assign||function(){return So=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},So.apply(this,arguments)};Object.defineProperty(ts,"__esModule",{value:!0});ts.reversePatch=_m;function _m(t){return Array.isArray(t)?t.map(function(e){return _m(e)}).reverse():So(So({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map(function(e){return{oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(function(r){return r.startsWith("-")?"+".concat(r.slice(1)):r.startsWith("+")?"-".concat(r.slice(1)):r})}})})}});var Cm=v(ze=>{"use strict";var kn=ze&&ze.__assign||function(){return kn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},kn.apply(this,arguments)};Object.defineProperty(ze,"__esModule",{value:!0});ze.OMIT_HEADERS=ze.FILE_HEADERS_ONLY=ze.INCLUDE_HEADERS=void 0;ze.structuredPatch=_u;ze.formatPatch=Co;ze.createTwoFilesPatch=Sm;ze.createPatch=Jx;var bm=vo();ze.INCLUDE_HEADERS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};ze.FILE_HEADERS_ONLY={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0};ze.OMIT_HEADERS={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function _u(t,e,r,n,s,i,o){var a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);var u=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){var c=a.callback;(0,bm.diffLines)(r,n,kn(kn({},a),{callback:function(d){var f=l(d);c(f)}}))}else return l((0,bm.diffLines)(r,n,a));function l(d){if(!d)return;d.push({value:"",lines:[]});function f(J){return J.map(function(xe){return" "+xe})}for(var g=[],m=0,D=0,h=[],w=1,C=1,A=0;A<d.length;A++){var T=d[A],G=T.lines||Kx(T.value);if(T.lines=G,T.added||T.removed){if(!m){var I=d[A-1];m=w,D=C,I&&(h=u>0?f(I.lines.slice(-u)):[],m-=h.length,D-=h.length)}for(var Z=0,F=G;Z<F.length;Z++){var W=F[Z];h.push((T.added?"+":"-")+W)}T.added?C+=G.length:w+=G.length}else{if(m)if(G.length<=u*2&&A<d.length-2)for(var P=0,E=f(G);P<E.length;P++){var W=E[P];h.push(W)}else{for(var Q=Math.min(G.length,u),re=0,le=f(G.slice(0,Q));re<le.length;re++){var W=le[re];h.push(W)}var $={oldStart:m,oldLines:w-m+Q,newStart:D,newLines:C-D+Q,lines:h};g.push($),m=0,D=0,h=[]}w+=G.length,C+=G.length}}for(var k=0,he=g;k<he.length;k++)for(var $=he[k],A=0;A<$.lines.length;A++)$.lines[A].endsWith(`
20
- `)?$.lines[A]=$.lines[A].slice(0,-1):($.lines.splice(A+1,0,"\"),A++);return{oldFileName:t,newFileName:e,oldHeader:s,newHeader:i,hunks:g}}}function Co(t,e){if(e||(e=ze.INCLUDE_HEADERS),Array.isArray(t)){if(t.length>1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(function(u){return Co(u,e)}).join(`
16
+ `)&&(n=n.slice(0,-1))),t.prototype.equals.call(this,r,n,s)},e})(Sx.default);At.lineDiff=new Cx;function wx(t,e,r){return At.lineDiff.diff(t,e,r)}function xx(t,e,r){return r=(0,Ex.generateOptions)(r,{ignoreWhitespace:!0}),At.lineDiff.diff(t,e,r)}function um(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
17
+ `));var r=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var s=0;s<n.length;s++){var i=n[s];s%2&&!e.newlineIsToken?r[r.length-1]+=i:r.push(i)}return r}});var cm=v(xr=>{"use strict";var kx=xr&&xr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(xr,"__esModule",{value:!0});xr.sentenceDiff=void 0;xr.diffSentences=jx;var $x=sr();function Ax(t){return t=="."||t=="!"||t=="?"}var Fx=(function(t){kx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){for(var n,s=[],i=0,o=0;o<r.length;o++){if(o==r.length-1){s.push(r.slice(i));break}if(Ax(r[o])&&r[o+1].match(/\s/)){for(s.push(r.slice(i,o+1)),o=i=o+1;!((n=r[o+1])===null||n===void 0)&&n.match(/\s/);)o++;s.push(r.slice(i,o+1)),i=o+1}}return s},e})($x.default);xr.sentenceDiff=new Fx;function jx(t,e,r){return xr.sentenceDiff.diff(t,e,r)}});var lm=v(kr=>{"use strict";var Ix=kr&&kr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(kr,"__esModule",{value:!0});kr.cssDiff=void 0;kr.diffCss=Px;var Tx=sr(),Rx=(function(t){Ix(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.split(/([{}:;,]|\s+)/)},e})(Tx.default);kr.cssDiff=new Rx;function Px(t,e,r){return kr.cssDiff.diff(t,e,r)}});var dm=v(or=>{"use strict";var Ox=or&&or.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(or,"__esModule",{value:!0});or.jsonDiff=void 0;or.diffJson=Mx;or.canonicalize=bo;var Nx=sr(),Lx=_o(),Bx=(function(t){Ox(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=Lx.tokenize,r}return Object.defineProperty(e.prototype,"useLongestToken",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.castInput=function(r,n){var s=n.undefinedReplacement,i=n.stringifyReplacer,o=i===void 0?function(a,u){return typeof u>"u"?s:u}:i;return typeof r=="string"?r:JSON.stringify(bo(r,null,null,o),null," ")},e.prototype.equals=function(r,n,s){return t.prototype.equals.call(this,r.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),s)},e})(Nx.default);or.jsonDiff=new Bx;function Mx(t,e,r){return or.jsonDiff.diff(t,e,r)}function bo(t,e,r,n,s){e=e||[],r=r||[],n&&(t=n(s===void 0?"":s,t));var i;for(i=0;i<e.length;i+=1)if(e[i]===t)return r[i];var o;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),o=new Array(t.length),r.push(o),i=0;i<t.length;i+=1)o[i]=bo(t[i],e,r,n,String(i));return e.pop(),r.pop(),o}if(t&&t.toJSON&&(t=t.toJSON()),typeof t=="object"&&t!==null){e.push(t),o={},r.push(o);var a=[],u;for(u in t)Object.prototype.hasOwnProperty.call(t,u)&&a.push(u);for(a.sort(),i=0;i<a.length;i+=1)u=a[i],o[u]=bo(t[u],e,r,n,u);e.pop(),r.pop()}else o=t;return o}});var fm=v($r=>{"use strict";var qx=$r&&$r.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty($r,"__esModule",{value:!0});$r.arrayDiff=void 0;$r.diffArrays=Zx;var Wx=sr(),Hx=(function(t){qx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.slice()},e.prototype.join=function(r){return r},e.prototype.removeEmpty=function(r){return r},e})(Wx.default);$r.arrayDiff=new Hx;function Zx(t,e,r){return $r.arrayDiff.diff(t,e,r)}});var mm=v(Ar=>{"use strict";var Gt=Ar&&Ar.__assign||function(){return Gt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Gt.apply(this,arguments)};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.unixToWin=hm;Ar.winToUnix=pm;Ar.isUnix=Ux;Ar.isWin=Vx;function hm(t){return Array.isArray(t)?t.map(function(e){return hm(e)}):Gt(Gt({},t),{hunks:t.hunks.map(function(e){return Gt(Gt({},e),{lines:e.lines.map(function(r,n){var s;return r.startsWith("\\")||r.endsWith("\r")||!((s=e.lines[n+1])===null||s===void 0)&&s.startsWith("\\")?r:r+"\r"})})})})}function pm(t){return Array.isArray(t)?t.map(function(e){return pm(e)}):Gt(Gt({},t),{hunks:t.hunks.map(function(e){return Gt(Gt({},e),{lines:e.lines.map(function(r){return r.endsWith("\r")?r.substring(0,r.length-1):r})})})})}function Ux(t){return Array.isArray(t)||(t=[t]),!t.some(function(e){return e.hunks.some(function(r){return r.lines.some(function(n){return!n.startsWith("\\")&&n.endsWith("\r")})})})}function Vx(t){return Array.isArray(t)||(t=[t]),t.some(function(e){return e.hunks.some(function(r){return r.lines.some(function(n){return n.endsWith("\r")})})})&&t.every(function(e){return e.hunks.every(function(r){return r.lines.every(function(n,s){var i;return n.startsWith("\\")||n.endsWith("\r")||((i=r.lines[s+1])===null||i===void 0?void 0:i.startsWith("\\"))})})})}});var vu=v(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.parsePatch=Gx;function Gx(t){var e=t.split(/\n/),r=[],n=0;function s(){var a={};for(r.push(a);n<e.length;){var u=e[n];if(/^(---|\+\+\+|@@)\s/.test(u))break;var c=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(u);c&&(a.index=u.substring(c[0].length).trim()),n++}for(i(a),i(a),a.hunks=[];n<e.length;){var u=e[n];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(u))break;if(/^@@/.test(u))a.hunks.push(o());else{if(u)throw new Error("Unknown line "+(n+1)+" "+JSON.stringify(u));n++}}}function i(a){var u=/^(---|\+\+\+)\s+/.exec(e[n]);if(u){var c=u[1],l=e[n].substring(3).trim().split(" ",2),d=(l[1]||"").trim(),f=l[0].replace(/\\\\/g,"\\");f.startsWith('"')&&f.endsWith('"')&&(f=f.substr(1,f.length-2)),c==="---"?(a.oldFileName=f,a.oldHeader=d):(a.newFileName=f,a.newHeader=d),n++}}function o(){var a,u=n,c=e[n++],l=c.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),d={oldStart:+l[1],oldLines:typeof l[2]>"u"?1:+l[2],newStart:+l[3],newLines:typeof l[4]>"u"?1:+l[4],lines:[]};d.oldLines===0&&(d.oldStart+=1),d.newLines===0&&(d.newStart+=1);for(var f=0,g=0;n<e.length&&(g<d.oldLines||f<d.newLines||!((a=e[n])===null||a===void 0)&&a.startsWith("\\"));n++){var m=e[n].length==0&&n!=e.length-1?" ":e[n][0];if(m==="+"||m==="-"||m===" "||m==="\\")d.lines.push(e[n]),m==="+"?f++:m==="-"?g++:m===" "&&(f++,g++);else throw new Error("Hunk at line ".concat(u+1," contained invalid line ").concat(e[n]))}if(!f&&d.newLines===1&&(d.newLines=0),!g&&d.oldLines===1&&(d.oldLines=0),f!==d.newLines)throw new Error("Added line count did not match for hunk at line "+(u+1));if(g!==d.oldLines)throw new Error("Removed line count did not match for hunk at line "+(u+1));return d}for(;n<e.length;)s();return r}});var gm=v(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.default=zx;function zx(t,e,r){var n=!0,s=!1,i=!1,o=1;return function a(){if(n&&!i){if(s?o++:n=!1,t+o<=r)return t+o;i=!0}if(!s)return i||(n=!0),e<=t-o?t-o++:(s=!0,a())}}});var _m=v(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.applyPatch=vm;Eo.applyPatches=Xx;var Dm=gu(),So=mm(),ym=vu(),Yx=gm();function vm(t,e,r){r===void 0&&(r={});var n;if(typeof e=="string"?n=(0,ym.parsePatch)(e):Array.isArray(e)?n=e:n=[e],n.length>1)throw new Error("applyPatch only works with a single input.");return Jx(t,n[0],r)}function Jx(t,e,r){r===void 0&&(r={}),(r.autoConvertLineEndings||r.autoConvertLineEndings==null)&&((0,Dm.hasOnlyWinLineEndings)(t)&&(0,So.isUnix)(e)?e=(0,So.unixToWin)(e):(0,Dm.hasOnlyUnixLineEndings)(t)&&(0,So.isWin)(e)&&(e=(0,So.winToUnix)(e)));var n=t.split(`
18
+ `),s=e.hunks,i=r.compareLine||(function(F,q,P,b){return q===b}),o=r.fuzzFactor||0,a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return t;for(var u="",c=!1,l=!1,d=0;d<s[s.length-1].lines.length;d++){var f=s[s.length-1].lines[d];f[0]=="\\"&&(u[0]=="+"?c=!0:u[0]=="-"&&(l=!0)),u=f}if(c){if(l){if(!o&&n[n.length-1]=="")return!1}else if(n[n.length-1]=="")n.pop();else if(!o)return!1}else if(l){if(n[n.length-1]!="")n.push("");else if(!o)return!1}function g(F,q,P,b,Q,re,de){b===void 0&&(b=0),Q===void 0&&(Q=!0),re===void 0&&(re=[]),de===void 0&&(de=0);for(var x=0,k=!1;b<F.length;b++){var he=F[b],X=he.length>0?he[0]:" ",Ee=he.length>0?he.substr(1):he;if(X==="-")if(i(q+1,n[q],X,Ee))q++,x=0;else return!P||n[q]==null?null:(re[de]=n[q],g(F,q+1,P-1,b,!1,re,de+1));if(X==="+"){if(!Q)return null;re[de]=Ee,de++,x=0,k=!0}if(X===" ")if(x++,re[de]=n[q],i(q+1,n[q],X,Ee))de++,Q=!0,k=!1,q++;else return k||!P?null:n[q]&&(g(F,q+1,P-1,b+1,!1,re,de+1)||g(F,q+1,P-1,b,!1,re,de+1))||g(F,q,P-1,b+1,!1,re,de)}return de-=x,q-=x,re.length=de,{patchedLines:re,oldLineLastI:q-1}}for(var m=[],y=0,d=0;d<s.length;d++){for(var h=s[d],w=void 0,C=n.length-h.oldLines+o,A=void 0,T=0;T<=o;T++){A=h.oldStart+y-1;for(var V=(0,Yx.default)(A,a,C);A!==void 0&&(w=g(h.lines,A,T),!w);A=V());if(w)break}if(!w)return!1;for(var I=a;I<A;I++)m.push(n[I]);for(var H=0;H<w.patchedLines.length;H++){var f=w.patchedLines[H];m.push(f)}a=w.oldLineLastI+1,y=A+1-h.oldStart}for(var d=a;d<n.length;d++)m.push(n[d]);return m.join(`
19
+ `)}function Xx(t,e){var r=typeof t=="string"?(0,ym.parsePatch)(t):t,n=0;function s(){var i=r[n++];if(!i)return e.complete();e.loadFile(i,function(o,a){if(o)return e.complete(o);var u=vm(a,i,e);e.patched(i,u,function(c){if(c)return e.complete(c);s()})})}s()}});var Sm=v(ts=>{"use strict";var Co=ts&&ts.__assign||function(){return Co=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Co.apply(this,arguments)};Object.defineProperty(ts,"__esModule",{value:!0});ts.reversePatch=bm;function bm(t){return Array.isArray(t)?t.map(function(e){return bm(e)}).reverse():Co(Co({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map(function(e){return{oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(function(r){return r.startsWith("-")?"+".concat(r.slice(1)):r.startsWith("+")?"-".concat(r.slice(1)):r})}})})}});var wm=v(Je=>{"use strict";var $n=Je&&Je.__assign||function(){return $n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},$n.apply(this,arguments)};Object.defineProperty(Je,"__esModule",{value:!0});Je.OMIT_HEADERS=Je.FILE_HEADERS_ONLY=Je.INCLUDE_HEADERS=void 0;Je.structuredPatch=bu;Je.formatPatch=wo;Je.createTwoFilesPatch=Cm;Je.createPatch=Kx;var Em=_o();Je.INCLUDE_HEADERS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};Je.FILE_HEADERS_ONLY={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0};Je.OMIT_HEADERS={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function bu(t,e,r,n,s,i,o){var a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);var u=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){var c=a.callback;(0,Em.diffLines)(r,n,$n($n({},a),{callback:function(d){var f=l(d);c(f)}}))}else return l((0,Em.diffLines)(r,n,a));function l(d){if(!d)return;d.push({value:"",lines:[]});function f(X){return X.map(function(Ee){return" "+Ee})}for(var g=[],m=0,y=0,h=[],w=1,C=1,A=0;A<d.length;A++){var T=d[A],V=T.lines||Qx(T.value);if(T.lines=V,T.added||T.removed){if(!m){var I=d[A-1];m=w,y=C,I&&(h=u>0?f(I.lines.slice(-u)):[],m-=h.length,y-=h.length)}for(var H=0,F=V;H<F.length;H++){var q=F[H];h.push((T.added?"+":"-")+q)}T.added?C+=V.length:w+=V.length}else{if(m)if(V.length<=u*2&&A<d.length-2)for(var P=0,b=f(V);P<b.length;P++){var q=b[P];h.push(q)}else{for(var Q=Math.min(V.length,u),re=0,de=f(V.slice(0,Q));re<de.length;re++){var q=de[re];h.push(q)}var x={oldStart:m,oldLines:w-m+Q,newStart:y,newLines:C-y+Q,lines:h};g.push(x),m=0,y=0,h=[]}w+=V.length,C+=V.length}}for(var k=0,he=g;k<he.length;k++)for(var x=he[k],A=0;A<x.lines.length;A++)x.lines[A].endsWith(`
20
+ `)?x.lines[A]=x.lines[A].slice(0,-1):(x.lines.splice(A+1,0,"\"),A++);return{oldFileName:t,newFileName:e,oldHeader:s,newHeader:i,hunks:g}}}function wo(t,e){if(e||(e=Je.INCLUDE_HEADERS),Array.isArray(t)){if(t.length>1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(function(u){return wo(u,e)}).join(`
21
21
  `)}var r=[];e.includeIndex&&t.oldFileName==t.newFileName&&r.push("Index: "+t.oldFileName),e.includeUnderline&&r.push("==================================================================="),e.includeFileHeaders&&(r.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),r.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader)));for(var n=0;n<t.hunks.length;n++){var s=t.hunks[n];s.oldLines===0&&(s.oldStart-=1),s.newLines===0&&(s.newStart-=1),r.push("@@ -"+s.oldStart+","+s.oldLines+" +"+s.newStart+","+s.newLines+" @@");for(var i=0,o=s.lines;i<o.length;i++){var a=o[i];r.push(a)}}return r.join(`
22
22
  `)+`
23
- `}function Sm(t,e,r,n,s,i,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){var u=o.callback;_u(t,e,r,n,s,i,kn(kn({},o),{callback:function(c){u(c?Co(c,o.headerOptions):void 0)}}))}else{var a=_u(t,e,r,n,s,i,o);return a?Co(a,o?.headerOptions):void 0}}function Jx(t,e,r,n,s,i){return Sm(t,t,e,r,n,s,i)}function Kx(t){var e=t.endsWith(`
23
+ `}function Cm(t,e,r,n,s,i,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){var u=o.callback;bu(t,e,r,n,s,i,$n($n({},o),{callback:function(c){u(c?wo(c,o.headerOptions):void 0)}}))}else{var a=bu(t,e,r,n,s,i,o);return a?wo(a,o?.headerOptions):void 0}}function Kx(t,e,r,n,s,i){return Cm(t,t,e,r,n,s,i)}function Qx(t){var e=t.endsWith(`
24
24
  `),r=t.split(`
25
25
  `).map(function(n){return n+`
26
- `});return e?r.pop():r.push(r.pop().slice(0,-1)),r}});var wm=v(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.convertChangesToDMP=Qx;function Qx(t){for(var e=[],r,n,s=0;s<t.length;s++)r=t[s],r.added?n=1:r.removed?n=-1:n=0,e.push([n,r.value]);return e}});var xm=v(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.convertChangesToXML=e$;function e$(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.added?e.push("<ins>"):n.removed&&e.push("<del>"),e.push(t$(n.value)),n.added?e.push("</ins>"):n.removed&&e.push("</del>")}return e.join("")}function t$(t){var e=t;return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e}});var Im=v(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.canonicalize=z.convertChangesToXML=z.convertChangesToDMP=z.reversePatch=z.parsePatch=z.applyPatches=z.applyPatch=z.OMIT_HEADERS=z.FILE_HEADERS_ONLY=z.INCLUDE_HEADERS=z.formatPatch=z.createPatch=z.createTwoFilesPatch=z.structuredPatch=z.arrayDiff=z.diffArrays=z.jsonDiff=z.diffJson=z.cssDiff=z.diffCss=z.sentenceDiff=z.diffSentences=z.diffTrimmedLines=z.lineDiff=z.diffLines=z.wordsWithSpaceDiff=z.diffWordsWithSpace=z.wordDiff=z.diffWords=z.characterDiff=z.diffChars=z.Diff=void 0;var r$=nr();z.Diff=r$.default;var $m=Yp();Object.defineProperty(z,"diffChars",{enumerable:!0,get:function(){return $m.diffChars}});Object.defineProperty(z,"characterDiff",{enumerable:!0,get:function(){return $m.characterDiff}});var wo=om();Object.defineProperty(z,"diffWords",{enumerable:!0,get:function(){return wo.diffWords}});Object.defineProperty(z,"diffWordsWithSpace",{enumerable:!0,get:function(){return wo.diffWordsWithSpace}});Object.defineProperty(z,"wordDiff",{enumerable:!0,get:function(){return wo.wordDiff}});Object.defineProperty(z,"wordsWithSpaceDiff",{enumerable:!0,get:function(){return wo.wordsWithSpaceDiff}});var Su=vo();Object.defineProperty(z,"diffLines",{enumerable:!0,get:function(){return Su.diffLines}});Object.defineProperty(z,"diffTrimmedLines",{enumerable:!0,get:function(){return Su.diffTrimmedLines}});Object.defineProperty(z,"lineDiff",{enumerable:!0,get:function(){return Su.lineDiff}});var km=um();Object.defineProperty(z,"diffSentences",{enumerable:!0,get:function(){return km.diffSentences}});Object.defineProperty(z,"sentenceDiff",{enumerable:!0,get:function(){return km.sentenceDiff}});var Am=cm();Object.defineProperty(z,"diffCss",{enumerable:!0,get:function(){return Am.diffCss}});Object.defineProperty(z,"cssDiff",{enumerable:!0,get:function(){return Am.cssDiff}});var Cu=lm();Object.defineProperty(z,"diffJson",{enumerable:!0,get:function(){return Cu.diffJson}});Object.defineProperty(z,"canonicalize",{enumerable:!0,get:function(){return Cu.canonicalize}});Object.defineProperty(z,"jsonDiff",{enumerable:!0,get:function(){return Cu.jsonDiff}});var Fm=dm();Object.defineProperty(z,"diffArrays",{enumerable:!0,get:function(){return Fm.diffArrays}});Object.defineProperty(z,"arrayDiff",{enumerable:!0,get:function(){return Fm.arrayDiff}});var jm=vm();Object.defineProperty(z,"applyPatch",{enumerable:!0,get:function(){return jm.applyPatch}});Object.defineProperty(z,"applyPatches",{enumerable:!0,get:function(){return jm.applyPatches}});var n$=yu();Object.defineProperty(z,"parsePatch",{enumerable:!0,get:function(){return n$.parsePatch}});var s$=Em();Object.defineProperty(z,"reversePatch",{enumerable:!0,get:function(){return s$.reversePatch}});var tn=Cm();Object.defineProperty(z,"structuredPatch",{enumerable:!0,get:function(){return tn.structuredPatch}});Object.defineProperty(z,"createTwoFilesPatch",{enumerable:!0,get:function(){return tn.createTwoFilesPatch}});Object.defineProperty(z,"createPatch",{enumerable:!0,get:function(){return tn.createPatch}});Object.defineProperty(z,"formatPatch",{enumerable:!0,get:function(){return tn.formatPatch}});Object.defineProperty(z,"INCLUDE_HEADERS",{enumerable:!0,get:function(){return tn.INCLUDE_HEADERS}});Object.defineProperty(z,"FILE_HEADERS_ONLY",{enumerable:!0,get:function(){return tn.FILE_HEADERS_ONLY}});Object.defineProperty(z,"OMIT_HEADERS",{enumerable:!0,get:function(){return tn.OMIT_HEADERS}});var o$=wm();Object.defineProperty(z,"convertChangesToDMP",{enumerable:!0,get:function(){return o$.convertChangesToDMP}});var i$=xm();Object.defineProperty(z,"convertChangesToXML",{enumerable:!0,get:function(){return i$.convertChangesToXML}})});var xu=v((jI,Tm)=>{"use strict";var wu={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},a$={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},u$={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?wu.up():"");return t&&(e+=wu.left),e}};Tm.exports={cursor:wu,scroll:a$,erase:u$,beep:"\x07"}});var Qm=v(yt=>{"use strict";var tt=xu(),Ao=require("node:process"),Vm=require("node:readline"),c$=require("node:tty"),l$=Pn();function Gm(t){return t&&typeof t=="object"&&"default"in t?t.default:t}function d$(t){if(t&&typeof t=="object"&&"default"in t)return t;let e=Object.create(null);if(t)for(let r in t)e[r]=t[r];return e.default=t,e}var xo=d$(Vm),Rm=Gm(Vm),ko=Gm(l$);function f$({onlyFirst:t=!1}={}){let e=["[\\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("|");return new RegExp(e,t?void 0:"g")}var h$=f$();function zm(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(h$,"")}function Ym(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xm={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var s=n.charCodeAt(0),i=n.length==2?n.charCodeAt(1):0,o=s;return 55296<=s&&s<=56319&&56320<=i&&i<=57343&&(s&=1023,i&=1023,o=s<<10|i,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(n){var s=this.eastAsianWidth(n);return s=="F"||s=="W"||s=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var s=r(n),i=0,o=0;o<s.length;o++)i=i+this.characterLength(s[o]);return i},e.slice=function(n,s,i){textLen=e.length(n),s=s||0,i=i||1,s<0&&(s=textLen+s),i<0&&(i=textLen+i);for(var o="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],d=e.length(l);if(a>=s-(d==2?1:0))if(a+d<=i)o+=l;else break;a+=d}return o}})(Xm);var p$=Xm.exports,m$=Ym(p$),g$=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},D$=Ym(g$);function rs(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=zm(t),t.length===0))return 0;t=t.replace(D$()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let s of t){let i=s.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(m$.eastAsianWidth(s)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var $u=10,Pm=(t=0)=>e=>`\x1B[${e+t}m`,Om=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Nm=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,we={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(we.modifier);var y$=Object.keys(we.color),v$=Object.keys(we.bgColor);[...y$,...v$];function _$(){let t=new Map;for(let[e,r]of Object.entries(we)){for(let[n,s]of Object.entries(r))we[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=we[n],t.set(s[0],s[1]);Object.defineProperty(we,e,{value:r,enumerable:!1})}return Object.defineProperty(we,"codes",{value:t,enumerable:!1}),we.color.close="\x1B[39m",we.bgColor.close="\x1B[49m",we.color.ansi=Pm(),we.color.ansi256=Om(),we.color.ansi16m=Nm(),we.bgColor.ansi=Pm($u),we.bgColor.ansi256=Om($u),we.bgColor.ansi16m=Nm($u),Object.defineProperties(we,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>we.rgbToAnsi256(...we.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,s;if(e>=232)r=((e-232)*10+8)/255,n=r,s=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,s=a%6/5}let i=Math.max(r,n,s)*2;if(i===0)return 30;let o=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>we.ansi256ToAnsi(we.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>we.ansi256ToAnsi(we.hexToAnsi256(e)),enumerable:!1}}),we}var E$=_$(),Fo=new Set(["\x1B","\x9B"]),b$=39,Pu="\x07",Jm="[",S$="]",Km="m",Ou=`${S$}8;;`,Lm=t=>`${Fo.values().next().value}${Jm}${t}${Km}`,Bm=t=>`${Fo.values().next().value}${Ou}${t}${Pu}`,C$=t=>t.split(" ").map(e=>rs(e)),ku=(t,e,r)=>{let n=[...e],s=!1,i=!1,o=rs(zm(t[t.length-1]));for(let[a,u]of n.entries()){let c=rs(u);if(o+c<=r?t[t.length-1]+=u:(t.push(u),o=0),Fo.has(u)&&(s=!0,i=n.slice(a+1).join("").startsWith(Ou)),s){i?u===Pu&&(s=!1,i=!1):u===Km&&(s=!1);continue}o+=c,o===r&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},w$=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(rs(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},x$=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",s,i,o=C$(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let d=rs(a[a.length-1]);if(c!==0&&(d>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),d=0),(d>0||r.trim===!1)&&(a[a.length-1]+=" ",d++)),r.hard&&o[c]>e){let f=e-d,g=1+Math.floor((o[c]-f-1)/e);Math.floor((o[c]-1)/e)<g&&a.push(""),ku(a,l,e);continue}if(d+o[c]>e&&d>0&&o[c]>0){if(r.wordWrap===!1&&d<e){ku(a,l,e);continue}a.push("")}if(d+o[c]>e&&r.wordWrap===!1){ku(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>w$(c)));let u=[...a.join(`
27
- `)];for(let[c,l]of u.entries()){if(n+=l,Fo.has(l)){let{groups:f}=new RegExp(`(?:\\${Jm}(?<code>\\d+)m|\\${Ou}(?<uri>.*)${Pu})`).exec(u.slice(c).join(""))||{groups:{}};if(f.code!==void 0){let g=Number.parseFloat(f.code);s=g===b$?void 0:g}else f.uri!==void 0&&(i=f.uri.length===0?void 0:f.uri)}let d=E$.codes.get(Number(s));u[c+1]===`
28
- `?(i&&(n+=Bm("")),s&&d&&(n+=Lm(d))):l===`
29
- `&&(s&&d&&(n+=Lm(s)),i&&(n+=Bm(i)))}return n};function Mm(t,e,r){return String(t).normalize().replace(/\r\n/g,`
26
+ `});return e?r.pop():r.push(r.pop().slice(0,-1)),r}});var xm=v(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.convertChangesToDMP=ek;function ek(t){for(var e=[],r,n,s=0;s<t.length;s++)r=t[s],r.added?n=1:r.removed?n=-1:n=0,e.push([n,r.value]);return e}});var km=v(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.convertChangesToXML=tk;function tk(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.added?e.push("<ins>"):n.removed&&e.push("<del>"),e.push(rk(n.value)),n.added?e.push("</ins>"):n.removed&&e.push("</del>")}return e.join("")}function rk(t){var e=t;return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e}});var Tm=v(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.canonicalize=G.convertChangesToXML=G.convertChangesToDMP=G.reversePatch=G.parsePatch=G.applyPatches=G.applyPatch=G.OMIT_HEADERS=G.FILE_HEADERS_ONLY=G.INCLUDE_HEADERS=G.formatPatch=G.createPatch=G.createTwoFilesPatch=G.structuredPatch=G.arrayDiff=G.diffArrays=G.jsonDiff=G.diffJson=G.cssDiff=G.diffCss=G.sentenceDiff=G.diffSentences=G.diffTrimmedLines=G.lineDiff=G.diffLines=G.wordsWithSpaceDiff=G.diffWordsWithSpace=G.wordDiff=G.diffWords=G.characterDiff=G.diffChars=G.Diff=void 0;var nk=sr();G.Diff=nk.default;var $m=Jp();Object.defineProperty(G,"diffChars",{enumerable:!0,get:function(){return $m.diffChars}});Object.defineProperty(G,"characterDiff",{enumerable:!0,get:function(){return $m.characterDiff}});var xo=im();Object.defineProperty(G,"diffWords",{enumerable:!0,get:function(){return xo.diffWords}});Object.defineProperty(G,"diffWordsWithSpace",{enumerable:!0,get:function(){return xo.diffWordsWithSpace}});Object.defineProperty(G,"wordDiff",{enumerable:!0,get:function(){return xo.wordDiff}});Object.defineProperty(G,"wordsWithSpaceDiff",{enumerable:!0,get:function(){return xo.wordsWithSpaceDiff}});var Cu=_o();Object.defineProperty(G,"diffLines",{enumerable:!0,get:function(){return Cu.diffLines}});Object.defineProperty(G,"diffTrimmedLines",{enumerable:!0,get:function(){return Cu.diffTrimmedLines}});Object.defineProperty(G,"lineDiff",{enumerable:!0,get:function(){return Cu.lineDiff}});var Am=cm();Object.defineProperty(G,"diffSentences",{enumerable:!0,get:function(){return Am.diffSentences}});Object.defineProperty(G,"sentenceDiff",{enumerable:!0,get:function(){return Am.sentenceDiff}});var Fm=lm();Object.defineProperty(G,"diffCss",{enumerable:!0,get:function(){return Fm.diffCss}});Object.defineProperty(G,"cssDiff",{enumerable:!0,get:function(){return Fm.cssDiff}});var wu=dm();Object.defineProperty(G,"diffJson",{enumerable:!0,get:function(){return wu.diffJson}});Object.defineProperty(G,"canonicalize",{enumerable:!0,get:function(){return wu.canonicalize}});Object.defineProperty(G,"jsonDiff",{enumerable:!0,get:function(){return wu.jsonDiff}});var jm=fm();Object.defineProperty(G,"diffArrays",{enumerable:!0,get:function(){return jm.diffArrays}});Object.defineProperty(G,"arrayDiff",{enumerable:!0,get:function(){return jm.arrayDiff}});var Im=_m();Object.defineProperty(G,"applyPatch",{enumerable:!0,get:function(){return Im.applyPatch}});Object.defineProperty(G,"applyPatches",{enumerable:!0,get:function(){return Im.applyPatches}});var sk=vu();Object.defineProperty(G,"parsePatch",{enumerable:!0,get:function(){return sk.parsePatch}});var ok=Sm();Object.defineProperty(G,"reversePatch",{enumerable:!0,get:function(){return ok.reversePatch}});var tn=wm();Object.defineProperty(G,"structuredPatch",{enumerable:!0,get:function(){return tn.structuredPatch}});Object.defineProperty(G,"createTwoFilesPatch",{enumerable:!0,get:function(){return tn.createTwoFilesPatch}});Object.defineProperty(G,"createPatch",{enumerable:!0,get:function(){return tn.createPatch}});Object.defineProperty(G,"formatPatch",{enumerable:!0,get:function(){return tn.formatPatch}});Object.defineProperty(G,"INCLUDE_HEADERS",{enumerable:!0,get:function(){return tn.INCLUDE_HEADERS}});Object.defineProperty(G,"FILE_HEADERS_ONLY",{enumerable:!0,get:function(){return tn.FILE_HEADERS_ONLY}});Object.defineProperty(G,"OMIT_HEADERS",{enumerable:!0,get:function(){return tn.OMIT_HEADERS}});var ik=xm();Object.defineProperty(G,"convertChangesToDMP",{enumerable:!0,get:function(){return ik.convertChangesToDMP}});var ak=km();Object.defineProperty(G,"convertChangesToXML",{enumerable:!0,get:function(){return ak.convertChangesToXML}})});var ku=v((RI,Rm)=>{"use strict";var xu={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},uk={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},ck={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?xu.up():"");return t&&(e+=xu.left),e}};Rm.exports={cursor:xu,scroll:uk,erase:ck,beep:"\x07"}});var eg=v(_t=>{"use strict";var nt=ku(),Fo=require("node:process"),Gm=require("node:readline"),lk=require("node:tty"),dk=Pn();function zm(t){return t&&typeof t=="object"&&"default"in t?t.default:t}function fk(t){if(t&&typeof t=="object"&&"default"in t)return t;let e=Object.create(null);if(t)for(let r in t)e[r]=t[r];return e.default=t,e}var ko=fk(Gm),Pm=zm(Gm),Ao=zm(dk);function hk({onlyFirst:t=!1}={}){let e=["[\\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("|");return new RegExp(e,t?void 0:"g")}var pk=hk();function Ym(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(pk,"")}function Jm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xm={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var s=n.charCodeAt(0),i=n.length==2?n.charCodeAt(1):0,o=s;return 55296<=s&&s<=56319&&56320<=i&&i<=57343&&(s&=1023,i&=1023,o=s<<10|i,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(n){var s=this.eastAsianWidth(n);return s=="F"||s=="W"||s=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var s=r(n),i=0,o=0;o<s.length;o++)i=i+this.characterLength(s[o]);return i},e.slice=function(n,s,i){textLen=e.length(n),s=s||0,i=i||1,s<0&&(s=textLen+s),i<0&&(i=textLen+i);for(var o="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],d=e.length(l);if(a>=s-(d==2?1:0))if(a+d<=i)o+=l;else break;a+=d}return o}})(Xm);var mk=Xm.exports,gk=Jm(mk),Dk=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},yk=Jm(Dk);function rs(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Ym(t),t.length===0))return 0;t=t.replace(yk()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let s of t){let i=s.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(gk.eastAsianWidth(s)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var $u=10,Om=(t=0)=>e=>`\x1B[${e+t}m`,Nm=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Lm=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,ke={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(ke.modifier);var vk=Object.keys(ke.color),_k=Object.keys(ke.bgColor);[...vk,..._k];function bk(){let t=new Map;for(let[e,r]of Object.entries(ke)){for(let[n,s]of Object.entries(r))ke[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=ke[n],t.set(s[0],s[1]);Object.defineProperty(ke,e,{value:r,enumerable:!1})}return Object.defineProperty(ke,"codes",{value:t,enumerable:!1}),ke.color.close="\x1B[39m",ke.bgColor.close="\x1B[49m",ke.color.ansi=Om(),ke.color.ansi256=Nm(),ke.color.ansi16m=Lm(),ke.bgColor.ansi=Om($u),ke.bgColor.ansi256=Nm($u),ke.bgColor.ansi16m=Lm($u),Object.defineProperties(ke,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>ke.rgbToAnsi256(...ke.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,s;if(e>=232)r=((e-232)*10+8)/255,n=r,s=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,s=a%6/5}let i=Math.max(r,n,s)*2;if(i===0)return 30;let o=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>ke.ansi256ToAnsi(ke.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>ke.ansi256ToAnsi(ke.hexToAnsi256(e)),enumerable:!1}}),ke}var Sk=bk(),jo=new Set(["\x1B","\x9B"]),Ek=39,Ou="\x07",Km="[",Ck="]",Qm="m",Nu=`${Ck}8;;`,Bm=t=>`${jo.values().next().value}${Km}${t}${Qm}`,Mm=t=>`${jo.values().next().value}${Nu}${t}${Ou}`,wk=t=>t.split(" ").map(e=>rs(e)),Au=(t,e,r)=>{let n=[...e],s=!1,i=!1,o=rs(Ym(t[t.length-1]));for(let[a,u]of n.entries()){let c=rs(u);if(o+c<=r?t[t.length-1]+=u:(t.push(u),o=0),jo.has(u)&&(s=!0,i=n.slice(a+1).join("").startsWith(Nu)),s){i?u===Ou&&(s=!1,i=!1):u===Qm&&(s=!1);continue}o+=c,o===r&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},xk=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(rs(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},kk=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",s,i,o=wk(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let d=rs(a[a.length-1]);if(c!==0&&(d>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),d=0),(d>0||r.trim===!1)&&(a[a.length-1]+=" ",d++)),r.hard&&o[c]>e){let f=e-d,g=1+Math.floor((o[c]-f-1)/e);Math.floor((o[c]-1)/e)<g&&a.push(""),Au(a,l,e);continue}if(d+o[c]>e&&d>0&&o[c]>0){if(r.wordWrap===!1&&d<e){Au(a,l,e);continue}a.push("")}if(d+o[c]>e&&r.wordWrap===!1){Au(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>xk(c)));let u=[...a.join(`
27
+ `)];for(let[c,l]of u.entries()){if(n+=l,jo.has(l)){let{groups:f}=new RegExp(`(?:\\${Km}(?<code>\\d+)m|\\${Nu}(?<uri>.*)${Ou})`).exec(u.slice(c).join(""))||{groups:{}};if(f.code!==void 0){let g=Number.parseFloat(f.code);s=g===Ek?void 0:g}else f.uri!==void 0&&(i=f.uri.length===0?void 0:f.uri)}let d=Sk.codes.get(Number(s));u[c+1]===`
28
+ `?(i&&(n+=Mm("")),s&&d&&(n+=Bm(d))):l===`
29
+ `&&(s&&d&&(n+=Bm(s)),i&&(n+=Mm(i)))}return n};function qm(t,e,r){return String(t).normalize().replace(/\r\n/g,`
30
30
  `).split(`
31
- `).map(n=>x$(n,e,r)).join(`
32
- `)}var $$=["up","down","left","right","space","enter","cancel"],An={actions:new Set($$),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function k$(t){for(let e in t){let r=e;if(!Object.hasOwn(t,r))continue;let n=t[r];switch(r){case"aliases":{for(let s in n)Object.hasOwn(n,s)&&(An.aliases.has(s)||An.aliases.set(s,n[s]));break}}}}function Nu(t,e){if(typeof t=="string")return An.aliases.get(t)===e;for(let r of t)if(r!==void 0&&Nu(r,e))return!0;return!1}function A$(t,e){if(t===e)return;let r=t.split(`
31
+ `).map(n=>kk(n,e,r)).join(`
32
+ `)}var $k=["up","down","left","right","space","enter","cancel"],An={actions:new Set($k),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Ak(t){for(let e in t){let r=e;if(!Object.hasOwn(t,r))continue;let n=t[r];switch(r){case"aliases":{for(let s in n)Object.hasOwn(n,s)&&(An.aliases.has(s)||An.aliases.set(s,n[s]));break}}}}function Lu(t,e){if(typeof t=="string")return An.aliases.get(t)===e;for(let r of t)if(r!==void 0&&Lu(r,e))return!0;return!1}function Fk(t,e){if(t===e)return;let r=t.split(`
33
33
  `),n=e.split(`
34
- `),s=[];for(let i=0;i<Math.max(r.length,n.length);i++)r[i]!==n[i]&&s.push(i);return s}var F$=globalThis.process.platform.startsWith("win"),Au=Symbol("clack:cancel");function j$(t){return t===Au}function $o(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function I$({input:t=Ao.stdin,output:e=Ao.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let s=xo.createInterface({input:t,output:e,prompt:"",tabSize:1});xo.emitKeypressEvents(t,s),t.isTTY&&t.setRawMode(!0);let i=(o,{name:a,sequence:u})=>{let c=String(o);if(Nu([c,a,u],"cancel")){n&&e.write(tt.cursor.show),process.exit(0);return}if(!r)return;let l=a==="return"?0:-1,d=a==="return"?-1:0;xo.moveCursor(e,l,d,()=>{xo.clearLine(e,1,()=>{t.once("keypress",i)})})};return n&&e.write(tt.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),n&&e.write(tt.cursor.show),t.isTTY&&!F$&&t.setRawMode(!1),s.terminal=!1,s.close()}}var T$=Object.defineProperty,R$=(t,e,r)=>e in t?T$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ut=(t,e,r)=>(R$(t,typeof e!="symbol"?e+"":e,r),r),Gt=class{constructor(e,r=!0){ut(this,"input"),ut(this,"output"),ut(this,"_abortSignal"),ut(this,"rl"),ut(this,"opts"),ut(this,"_render"),ut(this,"_track",!1),ut(this,"_prevFrame",""),ut(this,"_subscribers",new Map),ut(this,"_cursor",0),ut(this,"state","initial"),ut(this,"error",""),ut(this,"value");let{input:n=Ao.stdin,output:s=Ao.stdout,render:i,signal:o,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=r,this._abortSignal=o,this.input=n,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let n=this._subscribers.get(e)??[];n.push(r),this._subscribers.set(e,n)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let n=this._subscribers.get(e)??[],s=[];for(let i of n)i.cb(...r),i.once&&s.push(()=>n.splice(n.indexOf(i),1));for(let i of s)i()}prompt(){return new Promise((e,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Au);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new c$.WriteStream(0);n._write=(s,i,o)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),o()},this.input.pipe(n),this.rl=Rm.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50}),Rm.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),$o(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(tt.cursor.show),this.output.off("resize",this.render),$o(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(tt.cursor.show),this.output.off("resize",this.render),$o(this.input,!1),e(Au)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&An.aliases.has(r.name)&&this.emit("cursor",An.aliases.get(r.name)),An.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Nu([e,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
35
- `),$o(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Mm(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
36
- `).length-1;this.output.write(tt.cursor.move(-999,e*-1))}render(){let e=Mm(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(tt.cursor.hide);else{let r=A$(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(tt.cursor.move(0,n)),this.output.write(tt.erase.lines(1));let s=e.split(`
37
- `);this.output.write(s[n]),this._prevFrame=e,this.output.write(tt.cursor.move(0,s.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(tt.cursor.move(0,n)),this.output.write(tt.erase.down());let s=e.split(`
34
+ `),s=[];for(let i=0;i<Math.max(r.length,n.length);i++)r[i]!==n[i]&&s.push(i);return s}var jk=globalThis.process.platform.startsWith("win"),Fu=Symbol("clack:cancel");function Ik(t){return t===Fu}function $o(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function Tk({input:t=Fo.stdin,output:e=Fo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let s=ko.createInterface({input:t,output:e,prompt:"",tabSize:1});ko.emitKeypressEvents(t,s),t.isTTY&&t.setRawMode(!0);let i=(o,{name:a,sequence:u})=>{let c=String(o);if(Lu([c,a,u],"cancel")){n&&e.write(nt.cursor.show),process.exit(0);return}if(!r)return;let l=a==="return"?0:-1,d=a==="return"?-1:0;ko.moveCursor(e,l,d,()=>{ko.clearLine(e,1,()=>{t.once("keypress",i)})})};return n&&e.write(nt.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),n&&e.write(nt.cursor.show),t.isTTY&&!jk&&t.setRawMode(!1),s.terminal=!1,s.close()}}var Rk=Object.defineProperty,Pk=(t,e,r)=>e in t?Rk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ct=(t,e,r)=>(Pk(t,typeof e!="symbol"?e+"":e,r),r),zt=class{constructor(e,r=!0){ct(this,"input"),ct(this,"output"),ct(this,"_abortSignal"),ct(this,"rl"),ct(this,"opts"),ct(this,"_render"),ct(this,"_track",!1),ct(this,"_prevFrame",""),ct(this,"_subscribers",new Map),ct(this,"_cursor",0),ct(this,"state","initial"),ct(this,"error",""),ct(this,"value");let{input:n=Fo.stdin,output:s=Fo.stdout,render:i,signal:o,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=r,this._abortSignal=o,this.input=n,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let n=this._subscribers.get(e)??[];n.push(r),this._subscribers.set(e,n)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let n=this._subscribers.get(e)??[],s=[];for(let i of n)i.cb(...r),i.once&&s.push(()=>n.splice(n.indexOf(i),1));for(let i of s)i()}prompt(){return new Promise((e,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Fu);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new lk.WriteStream(0);n._write=(s,i,o)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),o()},this.input.pipe(n),this.rl=Pm.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50}),Pm.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),$o(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(nt.cursor.show),this.output.off("resize",this.render),$o(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(nt.cursor.show),this.output.off("resize",this.render),$o(this.input,!1),e(Fu)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&An.aliases.has(r.name)&&this.emit("cursor",An.aliases.get(r.name)),An.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Lu([e,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
35
+ `),$o(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=qm(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
36
+ `).length-1;this.output.write(nt.cursor.move(-999,e*-1))}render(){let e=qm(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(nt.cursor.hide);else{let r=Fk(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(nt.cursor.move(0,n)),this.output.write(nt.erase.lines(1));let s=e.split(`
37
+ `);this.output.write(s[n]),this._prevFrame=e,this.output.write(nt.cursor.move(0,s.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(nt.cursor.move(0,n)),this.output.write(nt.erase.down());let s=e.split(`
38
38
  `).slice(n);this.output.write(s.join(`
39
- `)),this._prevFrame=e;return}this.output.write(tt.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},Fu=class extends Gt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(tt.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},P$=Object.defineProperty,O$=(t,e,r)=>e in t?P$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qm=(t,e,r)=>(O$(t,typeof e!="symbol"?e+"":e,r),r),N$=class extends Gt{constructor(t){super(t,!1),qm(this,"options"),qm(this,"cursor",0);let{options:e}=t;this.options=Object.entries(e).flatMap(([r,n])=>[{value:r,group:!0,label:r},...n.map(s=>({...s,group:r}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),0),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}getGroupItems(t){return this.options.filter(e=>e.group===t)}isGroupSelected(t){return this.getGroupItems(t).every(e=>this.value.includes(e.value))}toggleValue(){let t=this.options[this.cursor];if(t.group===!0){let e=t.value,r=this.getGroupItems(e);this.isGroupSelected(e)?this.value=this.value.filter(n=>r.findIndex(s=>s.value===n)===-1):this.value=[...this.value,...r.map(n=>n.value)],this.value=Array.from(new Set(this.value))}else{let e=this.value.includes(t.value);this.value=e?this.value.filter(r=>r!==t.value):[...this.value,t.value]}}},L$=Object.defineProperty,B$=(t,e,r)=>e in t?L$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wm=(t,e,r)=>(B$(t,typeof e!="symbol"?e+"":e,r),r),M$=class extends Gt{constructor(t){super(t,!1),Wm(this,"options"),Wm(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map(e=>e.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter(e=>e!==this._value):[...this.value,this._value]}},q$=Object.defineProperty,W$=(t,e,r)=>e in t?q$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Hm=(t,e,r)=>(W$(t,typeof e!="symbol"?e+"":e,r),r),ju=class extends Gt{constructor({mask:e,...r}){super(r),Hm(this,"valueWithCursor",""),Hm(this,"_mask","\u2022"),this._mask=e??"\u2022",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${ko.inverse(ko.hidden("_"))}`;else{let n=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${n}${ko.inverse(s[0])}${s.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}},H$=Object.defineProperty,Z$=(t,e,r)=>e in t?H$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zm=(t,e,r)=>(Z$(t,typeof e!="symbol"?e+"":e,r),r),Iu=class extends Gt{constructor(e){super(e,!1),Zm(this,"options"),Zm(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},U$=Object.defineProperty,V$=(t,e,r)=>e in t?U$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Um=(t,e,r)=>(V$(t,typeof e!="symbol"?e+"":e,r),r),Tu=class extends Gt{constructor(e){super(e,!1),Um(this,"options"),Um(this,"cursor",0),this.options=e.options;let r=this.options.map(({value:[n]})=>n?.toLowerCase());this.cursor=Math.max(r.indexOf(e.initialValue),0),this.on("key",n=>{if(!r.includes(n))return;let s=this.options.find(({value:[i]})=>i?.toLowerCase()===n);s&&(this.value=s.value,this.state="submit",this.emit("submit"))})}},Ru=class extends Gt{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${ko.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};yt.ConfirmPrompt=Fu,yt.GroupMultiSelectPrompt=N$,yt.MultiSelectPrompt=M$,yt.PasswordPrompt=ju,yt.Prompt=Gt,yt.SelectKeyPrompt=Tu,yt.SelectPrompt=Iu,yt.TextPrompt=Ru,yt.block=I$,yt.isCancel=j$,yt.updateSettings=k$});var Zu=v(Te=>{"use strict";var Lu=require("node:util"),At=Qm(),G$=require("node:process"),z$=Pn(),eg=xu();function rg(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var kt=rg(G$),_=rg(z$);function Y$(){return kt.platform!=="win32"?kt.env.TERM!=="linux":!!kt.env.CI||!!kt.env.WT_SESSION||!!kt.env.TERMINUS_SUBLIME||kt.env.ConEmuTask==="{cmd::Cmder}"||kt.env.TERM_PROGRAM==="Terminus-Sublime"||kt.env.TERM_PROGRAM==="vscode"||kt.env.TERM==="xterm-256color"||kt.env.TERM==="alacritty"||kt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Bu=Y$(),Ae=(t,e)=>Bu?t:e,X$=Ae("\u25C6","*"),ng=Ae("\u25A0","x"),sg=Ae("\u25B2","x"),jo=Ae("\u25C7","o"),J$=Ae("\u250C","T"),te=Ae("\u2502","|"),rt=Ae("\u2514","\u2014"),Mu=Ae("\u25CF",">"),qu=Ae("\u25CB"," "),Wu=Ae("\u25FB","[\u2022]"),ns=Ae("\u25FC","[+]"),og=Ae("\u25FB","[ ]"),K$=Ae("\u25AA","\u2022"),tg=Ae("\u2500","-"),Q$=Ae("\u256E","+"),ek=Ae("\u251C","+"),tk=Ae("\u256F","+"),rk=Ae("\u25CF","\u2022"),nk=Ae("\u25C6","*"),sk=Ae("\u25B2","!"),ok=Ae("\u25A0","x"),nn=t=>{switch(t){case"initial":case"active":return _.cyan(X$);case"cancel":return _.red(ng);case"error":return _.yellow(sg);case"submit":return _.green(jo)}},Hu=t=>{let{cursor:e,options:r,style:n}=t,s=t.maxItems??Number.POSITIVE_INFINITY,i=Math.max(process.stdout.rows-4,0),o=Math.min(i,Math.max(s,5)),a=0;e>=a+o-3?a=Math.max(Math.min(e-o+3,r.length-o),0):e<a+2&&(a=Math.max(e-2,0));let u=o<r.length&&a>0,c=o<r.length&&a+o<r.length;return r.slice(a,a+o).map((l,d,f)=>{let g=d===0&&u,m=d===f.length-1&&c;return g||m?_.dim("..."):n(l,d+a===e)})},ik=t=>new At.TextPrompt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${_.gray(te)}
39
+ `)),this._prevFrame=e;return}this.output.write(nt.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},ju=class extends zt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(nt.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},Ok=Object.defineProperty,Nk=(t,e,r)=>e in t?Ok(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wm=(t,e,r)=>(Nk(t,typeof e!="symbol"?e+"":e,r),r),Lk=class extends zt{constructor(t){super(t,!1),Wm(this,"options"),Wm(this,"cursor",0);let{options:e}=t;this.options=Object.entries(e).flatMap(([r,n])=>[{value:r,group:!0,label:r},...n.map(s=>({...s,group:r}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),0),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}getGroupItems(t){return this.options.filter(e=>e.group===t)}isGroupSelected(t){return this.getGroupItems(t).every(e=>this.value.includes(e.value))}toggleValue(){let t=this.options[this.cursor];if(t.group===!0){let e=t.value,r=this.getGroupItems(e);this.isGroupSelected(e)?this.value=this.value.filter(n=>r.findIndex(s=>s.value===n)===-1):this.value=[...this.value,...r.map(n=>n.value)],this.value=Array.from(new Set(this.value))}else{let e=this.value.includes(t.value);this.value=e?this.value.filter(r=>r!==t.value):[...this.value,t.value]}}},Bk=Object.defineProperty,Mk=(t,e,r)=>e in t?Bk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Hm=(t,e,r)=>(Mk(t,typeof e!="symbol"?e+"":e,r),r),qk=class extends zt{constructor(t){super(t,!1),Hm(this,"options"),Hm(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map(e=>e.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter(e=>e!==this._value):[...this.value,this._value]}},Wk=Object.defineProperty,Hk=(t,e,r)=>e in t?Wk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zm=(t,e,r)=>(Hk(t,typeof e!="symbol"?e+"":e,r),r),Iu=class extends zt{constructor({mask:e,...r}){super(r),Zm(this,"valueWithCursor",""),Zm(this,"_mask","\u2022"),this._mask=e??"\u2022",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${Ao.inverse(Ao.hidden("_"))}`;else{let n=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${n}${Ao.inverse(s[0])}${s.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}},Zk=Object.defineProperty,Uk=(t,e,r)=>e in t?Zk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Um=(t,e,r)=>(Uk(t,typeof e!="symbol"?e+"":e,r),r),Tu=class extends zt{constructor(e){super(e,!1),Um(this,"options"),Um(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},Vk=Object.defineProperty,Gk=(t,e,r)=>e in t?Vk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vm=(t,e,r)=>(Gk(t,typeof e!="symbol"?e+"":e,r),r),Ru=class extends zt{constructor(e){super(e,!1),Vm(this,"options"),Vm(this,"cursor",0),this.options=e.options;let r=this.options.map(({value:[n]})=>n?.toLowerCase());this.cursor=Math.max(r.indexOf(e.initialValue),0),this.on("key",n=>{if(!r.includes(n))return;let s=this.options.find(({value:[i]})=>i?.toLowerCase()===n);s&&(this.value=s.value,this.state="submit",this.emit("submit"))})}},Pu=class extends zt{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${Ao.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};_t.ConfirmPrompt=ju,_t.GroupMultiSelectPrompt=Lk,_t.MultiSelectPrompt=qk,_t.PasswordPrompt=Iu,_t.Prompt=zt,_t.SelectKeyPrompt=Ru,_t.SelectPrompt=Tu,_t.TextPrompt=Pu,_t.block=Tk,_t.isCancel=Ik,_t.updateSettings=Ak});var Uu=v(Te=>{"use strict";var Bu=require("node:util"),jt=eg(),zk=require("node:process"),Yk=Pn(),tg=ku();function ng(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Ft=ng(zk),_=ng(Yk);function Jk(){return Ft.platform!=="win32"?Ft.env.TERM!=="linux":!!Ft.env.CI||!!Ft.env.WT_SESSION||!!Ft.env.TERMINUS_SUBLIME||Ft.env.ConEmuTask==="{cmd::Cmder}"||Ft.env.TERM_PROGRAM==="Terminus-Sublime"||Ft.env.TERM_PROGRAM==="vscode"||Ft.env.TERM==="xterm-256color"||Ft.env.TERM==="alacritty"||Ft.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Mu=Jk(),Fe=(t,e)=>Mu?t:e,Xk=Fe("\u25C6","*"),sg=Fe("\u25A0","x"),og=Fe("\u25B2","x"),Io=Fe("\u25C7","o"),Kk=Fe("\u250C","T"),te=Fe("\u2502","|"),st=Fe("\u2514","\u2014"),qu=Fe("\u25CF",">"),Wu=Fe("\u25CB"," "),Hu=Fe("\u25FB","[\u2022]"),ns=Fe("\u25FC","[+]"),ig=Fe("\u25FB","[ ]"),Qk=Fe("\u25AA","\u2022"),rg=Fe("\u2500","-"),e$=Fe("\u256E","+"),t$=Fe("\u251C","+"),r$=Fe("\u256F","+"),n$=Fe("\u25CF","\u2022"),s$=Fe("\u25C6","*"),o$=Fe("\u25B2","!"),i$=Fe("\u25A0","x"),nn=t=>{switch(t){case"initial":case"active":return _.cyan(Xk);case"cancel":return _.red(sg);case"error":return _.yellow(og);case"submit":return _.green(Io)}},Zu=t=>{let{cursor:e,options:r,style:n}=t,s=t.maxItems??Number.POSITIVE_INFINITY,i=Math.max(process.stdout.rows-4,0),o=Math.min(i,Math.max(s,5)),a=0;e>=a+o-3?a=Math.max(Math.min(e-o+3,r.length-o),0):e<a+2&&(a=Math.max(e-2,0));let u=o<r.length&&a>0,c=o<r.length&&a+o<r.length;return r.slice(a,a+o).map((l,d,f)=>{let g=d===0&&u,m=d===f.length-1&&c;return g||m?_.dim("..."):n(l,d+a===e)})},a$=t=>new jt.TextPrompt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${_.gray(te)}
40
40
  ${nn(this.state)} ${t.message}
41
41
  `,r=t.placeholder?_.inverse(t.placeholder[0])+_.dim(t.placeholder.slice(1)):_.inverse(_.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
42
42
  ${_.yellow(te)} ${n}
43
- ${_.yellow(rt)} ${_.yellow(this.error)}
43
+ ${_.yellow(st)} ${_.yellow(this.error)}
44
44
  `;case"submit":return`${e}${_.gray(te)} ${_.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${_.gray(te)} ${_.strikethrough(_.dim(this.value??""))}${this.value?.trim()?`
45
45
  ${_.gray(te)}`:""}`;default:return`${e}${_.cyan(te)} ${n}
46
- ${_.cyan(rt)}
47
- `}}}).prompt(),ak=t=>new At.PasswordPrompt({validate:t.validate,mask:t.mask??K$,render(){let e=`${_.gray(te)}
46
+ ${_.cyan(st)}
47
+ `}}}).prompt(),u$=t=>new jt.PasswordPrompt({validate:t.validate,mask:t.mask??Qk,render(){let e=`${_.gray(te)}
48
48
  ${nn(this.state)} ${t.message}
49
49
  `,r=this.valueWithCursor,n=this.masked;switch(this.state){case"error":return`${e.trim()}
50
50
  ${_.yellow(te)} ${n}
51
- ${_.yellow(rt)} ${_.yellow(this.error)}
51
+ ${_.yellow(st)} ${_.yellow(this.error)}
52
52
  `;case"submit":return`${e}${_.gray(te)} ${_.dim(n)}`;case"cancel":return`${e}${_.gray(te)} ${_.strikethrough(_.dim(n??""))}${n?`
53
53
  ${_.gray(te)}`:""}`;default:return`${e}${_.cyan(te)} ${r}
54
- ${_.cyan(rt)}
55
- `}}}).prompt(),uk=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new At.ConfirmPrompt({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${_.gray(te)}
54
+ ${_.cyan(st)}
55
+ `}}}).prompt(),c$=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new jt.ConfirmPrompt({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${_.gray(te)}
56
56
  ${nn(this.state)} ${t.message}
57
57
  `,s=this.value?e:r;switch(this.state){case"submit":return`${n}${_.gray(te)} ${_.dim(s)}`;case"cancel":return`${n}${_.gray(te)} ${_.strikethrough(_.dim(s))}
58
- ${_.gray(te)}`;default:return`${n}${_.cyan(te)} ${this.value?`${_.green(Mu)} ${e}`:`${_.dim(qu)} ${_.dim(e)}`} ${_.dim("/")} ${this.value?`${_.dim(qu)} ${_.dim(r)}`:`${_.green(Mu)} ${r}`}
59
- ${_.cyan(rt)}
60
- `}}}).prompt()},ck=t=>{let e=(r,n)=>{let s=r.label??String(r.value);switch(n){case"selected":return`${_.dim(s)}`;case"active":return`${_.green(Mu)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`;case"cancelled":return`${_.strikethrough(_.dim(s))}`;default:return`${_.dim(qu)} ${_.dim(s)}`}};return new At.SelectPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(te)}
58
+ ${_.gray(te)}`;default:return`${n}${_.cyan(te)} ${this.value?`${_.green(qu)} ${e}`:`${_.dim(Wu)} ${_.dim(e)}`} ${_.dim("/")} ${this.value?`${_.dim(Wu)} ${_.dim(r)}`:`${_.green(qu)} ${r}`}
59
+ ${_.cyan(st)}
60
+ `}}}).prompt()},l$=t=>{let e=(r,n)=>{let s=r.label??String(r.value);switch(n){case"selected":return`${_.dim(s)}`;case"active":return`${_.green(qu)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`;case"cancelled":return`${_.strikethrough(_.dim(s))}`;default:return`${_.dim(Wu)} ${_.dim(s)}`}};return new jt.SelectPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(te)}
61
61
  ${nn(this.state)} ${t.message}
62
62
  `;switch(this.state){case"submit":return`${r}${_.gray(te)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${_.gray(te)} ${e(this.options[this.cursor],"cancelled")}
63
- ${_.gray(te)}`;default:return`${r}${_.cyan(te)} ${Hu({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,s)=>e(n,s?"active":"inactive")}).join(`
63
+ ${_.gray(te)}`;default:return`${r}${_.cyan(te)} ${Zu({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,s)=>e(n,s?"active":"inactive")}).join(`
64
64
  ${_.cyan(te)} `)}
65
- ${_.cyan(rt)}
66
- `}}}).prompt()},lk=t=>{let e=(r,n="inactive")=>{let s=r.label??String(r.value);return n==="selected"?`${_.dim(s)}`:n==="cancelled"?`${_.strikethrough(_.dim(s))}`:n==="active"?`${_.bgCyan(_.gray(` ${r.value} `))} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:`${_.gray(_.bgWhite(_.inverse(` ${r.value} `)))} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`};return new At.SelectKeyPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(te)}
65
+ ${_.cyan(st)}
66
+ `}}}).prompt()},d$=t=>{let e=(r,n="inactive")=>{let s=r.label??String(r.value);return n==="selected"?`${_.dim(s)}`:n==="cancelled"?`${_.strikethrough(_.dim(s))}`:n==="active"?`${_.bgCyan(_.gray(` ${r.value} `))} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:`${_.gray(_.bgWhite(_.inverse(` ${r.value} `)))} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`};return new jt.SelectKeyPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(te)}
67
67
  ${nn(this.state)} ${t.message}
68
68
  `;switch(this.state){case"submit":return`${r}${_.gray(te)} ${e(this.options.find(n=>n.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${r}${_.gray(te)} ${e(this.options[0],"cancelled")}
69
69
  ${_.gray(te)}`;default:return`${r}${_.cyan(te)} ${this.options.map((n,s)=>e(n,s===this.cursor?"active":"inactive")).join(`
70
70
  ${_.cyan(te)} `)}
71
- ${_.cyan(rt)}
72
- `}}}).prompt()},dk=t=>{let e=(r,n)=>{let s=r.label??String(r.value);return n==="active"?`${_.cyan(Wu)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="selected"?`${_.green(ns)} ${_.dim(s)}`:n==="cancelled"?`${_.strikethrough(_.dim(s))}`:n==="active-selected"?`${_.green(ns)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(s)}`:`${_.dim(og)} ${_.dim(s)}`};return new At.MultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
71
+ ${_.cyan(st)}
72
+ `}}}).prompt()},f$=t=>{let e=(r,n)=>{let s=r.label??String(r.value);return n==="active"?`${_.cyan(Hu)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="selected"?`${_.green(ns)} ${_.dim(s)}`:n==="cancelled"?`${_.strikethrough(_.dim(s))}`:n==="active-selected"?`${_.green(ns)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(s)}`:`${_.dim(ig)} ${_.dim(s)}`};return new jt.MultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
73
73
  ${_.reset(_.dim(`Press ${_.gray(_.bgWhite(_.inverse(" space ")))} to select, ${_.gray(_.bgWhite(_.inverse(" enter ")))} to submit`))}`},render(){let r=`${_.gray(te)}
74
74
  ${nn(this.state)} ${t.message}
75
75
  `,n=(s,i)=>{let o=this.value.includes(s.value);return i&&o?e(s,"active-selected"):o?e(s,"selected"):e(s,i?"active":"inactive")};switch(this.state){case"submit":return`${r}${_.gray(te)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"submitted")).join(_.dim(", "))||_.dim("none")}`;case"cancel":{let s=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>e(i,"cancelled")).join(_.dim(", "));return`${r}${_.gray(te)} ${s.trim()?`${s}
76
76
  ${_.gray(te)}`:""}`}case"error":{let s=this.error.split(`
77
- `).map((i,o)=>o===0?`${_.yellow(rt)} ${_.yellow(i)}`:` ${i}`).join(`
78
- `);return`${r+_.yellow(te)} ${Hu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
77
+ `).map((i,o)=>o===0?`${_.yellow(st)} ${_.yellow(i)}`:` ${i}`).join(`
78
+ `);return`${r+_.yellow(te)} ${Zu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
79
79
  ${_.yellow(te)} `)}
80
80
  ${s}
81
- `}default:return`${r}${_.cyan(te)} ${Hu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
81
+ `}default:return`${r}${_.cyan(te)} ${Zu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
82
82
  ${_.cyan(te)} `)}
83
- ${_.cyan(rt)}
84
- `}}}).prompt()},fk=t=>{let e=(r,n,s=[])=>{let i=r.label??String(r.value),o=typeof r.group=="string",a=o&&(s[s.indexOf(r)+1]??{group:!0}),u=o&&a.group===!0,c=o?`${u?rt:te} `:"";return n==="active"?`${_.dim(c)}${_.cyan(Wu)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="group-active"?`${c}${_.cyan(Wu)} ${_.dim(i)}`:n==="group-active-selected"?`${c}${_.green(ns)} ${_.dim(i)}`:n==="selected"?`${_.dim(c)}${_.green(ns)} ${_.dim(i)}`:n==="cancelled"?`${_.strikethrough(_.dim(i))}`:n==="active-selected"?`${_.dim(c)}${_.green(ns)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(i)}`:`${_.dim(c)}${_.dim(og)} ${_.dim(i)}`};return new At.GroupMultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
83
+ ${_.cyan(st)}
84
+ `}}}).prompt()},h$=t=>{let e=(r,n,s=[])=>{let i=r.label??String(r.value),o=typeof r.group=="string",a=o&&(s[s.indexOf(r)+1]??{group:!0}),u=o&&a.group===!0,c=o?`${u?st:te} `:"";return n==="active"?`${_.dim(c)}${_.cyan(Hu)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="group-active"?`${c}${_.cyan(Hu)} ${_.dim(i)}`:n==="group-active-selected"?`${c}${_.green(ns)} ${_.dim(i)}`:n==="selected"?`${_.dim(c)}${_.green(ns)} ${_.dim(i)}`:n==="cancelled"?`${_.strikethrough(_.dim(i))}`:n==="active-selected"?`${_.dim(c)}${_.green(ns)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(i)}`:`${_.dim(c)}${_.dim(ig)} ${_.dim(i)}`};return new jt.GroupMultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
85
85
  ${_.reset(_.dim(`Press ${_.gray(_.bgWhite(_.inverse(" space ")))} to select, ${_.gray(_.bgWhite(_.inverse(" enter ")))} to submit`))}`},render(){let r=`${_.gray(te)}
86
86
  ${nn(this.state)} ${t.message}
87
87
  `;switch(this.state){case"submit":return`${r}${_.gray(te)} ${this.options.filter(({value:n})=>this.value.includes(n)).map(n=>e(n,"submitted")).join(_.dim(", "))}`;case"cancel":{let n=this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"cancelled")).join(_.dim(", "));return`${r}${_.gray(te)} ${n.trim()?`${n}
88
88
  ${_.gray(te)}`:""}`}case"error":{let n=this.error.split(`
89
- `).map((s,i)=>i===0?`${_.yellow(rt)} ${_.yellow(s)}`:` ${s}`).join(`
89
+ `).map((s,i)=>i===0?`${_.yellow(st)} ${_.yellow(s)}`:` ${s}`).join(`
90
90
  `);return`${r}${_.yellow(te)} ${this.options.map((s,i,o)=>{let a=this.value.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),u=i===this.cursor;return!u&&typeof s.group=="string"&&this.options[this.cursor].value===s.group?e(s,a?"group-active-selected":"group-active",o):u&&a?e(s,"active-selected",o):a?e(s,"selected",o):e(s,u?"active":"inactive",o)}).join(`
91
91
  ${_.yellow(te)} `)}
92
92
  ${n}
93
93
  `}default:return`${r}${_.cyan(te)} ${this.options.map((n,s,i)=>{let o=this.value.includes(n.value)||n.group===!0&&this.isGroupSelected(`${n.value}`),a=s===this.cursor;return!a&&typeof n.group=="string"&&this.options[this.cursor].value===n.group?e(n,o?"group-active-selected":"group-active",i):a&&o?e(n,"active-selected",i):o?e(n,"selected",i):e(n,a?"active":"inactive",i)}).join(`
94
94
  ${_.cyan(te)} `)}
95
- ${_.cyan(rt)}
96
- `}}}).prompt()},hk=(t="",e="")=>{let r=`
95
+ ${_.cyan(st)}
96
+ `}}}).prompt()},p$=(t="",e="")=>{let r=`
97
97
  ${t}
98
98
  `.split(`
99
- `),n=Lu.stripVTControlCharacters(e).length,s=Math.max(r.reduce((o,a)=>{let u=Lu.stripVTControlCharacters(a);return u.length>o?u.length:o},0),n)+2,i=r.map(o=>`${_.gray(te)} ${_.dim(o)}${" ".repeat(s-Lu.stripVTControlCharacters(o).length)}${_.gray(te)}`).join(`
99
+ `),n=Bu.stripVTControlCharacters(e).length,s=Math.max(r.reduce((o,a)=>{let u=Bu.stripVTControlCharacters(a);return u.length>o?u.length:o},0),n)+2,i=r.map(o=>`${_.gray(te)} ${_.dim(o)}${" ".repeat(s-Bu.stripVTControlCharacters(o).length)}${_.gray(te)}`).join(`
100
100
  `);process.stdout.write(`${_.gray(te)}
101
- ${_.green(jo)} ${_.reset(e)} ${_.gray(tg.repeat(Math.max(s-n-1,1))+Q$)}
101
+ ${_.green(Io)} ${_.reset(e)} ${_.gray(rg.repeat(Math.max(s-n-1,1))+e$)}
102
102
  ${i}
103
- ${_.gray(ek+tg.repeat(s+2)+tk)}
104
- `)},pk=(t="")=>{process.stdout.write(`${_.gray(rt)} ${_.red(t)}
103
+ ${_.gray(t$+rg.repeat(s+2)+r$)}
104
+ `)},m$=(t="")=>{process.stdout.write(`${_.gray(st)} ${_.red(t)}
105
105
 
106
- `)},mk=(t="")=>{process.stdout.write(`${_.gray(J$)} ${t}
107
- `)},gk=(t="")=>{process.stdout.write(`${_.gray(te)}
108
- ${_.gray(rt)} ${t}
106
+ `)},g$=(t="")=>{process.stdout.write(`${_.gray(Kk)} ${t}
107
+ `)},D$=(t="")=>{process.stdout.write(`${_.gray(te)}
108
+ ${_.gray(st)} ${t}
109
109
 
110
110
  `)},rn={message:(t="",{symbol:e=_.gray(te)}={})=>{let r=[`${_.gray(te)}`];if(t){let[n,...s]=t.split(`
111
111
  `);r.push(`${e} ${n}`,...s.map(i=>`${_.gray(te)} ${i}`))}process.stdout.write(`${r.join(`
112
112
  `)}
113
- `)},info:t=>{rn.message(t,{symbol:_.blue(rk)})},success:t=>{rn.message(t,{symbol:_.green(nk)})},step:t=>{rn.message(t,{symbol:_.green(jo)})},warn:t=>{rn.message(t,{symbol:_.yellow(sk)})},warning:t=>{rn.warn(t)},error:t=>{rn.message(t,{symbol:_.red(ok)})}},ig=()=>{let t=Bu?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=Bu?80:120,r=process.env.CI==="true",n,s,i=!1,o="",a,u=w=>{let C=w>1?"Something went wrong":"Canceled";i&&h(C,w)},c=()=>u(2),l=()=>u(1),d=()=>{process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",l),process.on("SIGTERM",l),process.on("exit",u)},f=()=>{process.removeListener("uncaughtExceptionMonitor",c),process.removeListener("unhandledRejection",c),process.removeListener("SIGINT",l),process.removeListener("SIGTERM",l),process.removeListener("exit",u)},g=()=>{if(a===void 0)return;r&&process.stdout.write(`
113
+ `)},info:t=>{rn.message(t,{symbol:_.blue(n$)})},success:t=>{rn.message(t,{symbol:_.green(s$)})},step:t=>{rn.message(t,{symbol:_.green(Io)})},warn:t=>{rn.message(t,{symbol:_.yellow(o$)})},warning:t=>{rn.warn(t)},error:t=>{rn.message(t,{symbol:_.red(i$)})}},ag=()=>{let t=Mu?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=Mu?80:120,r=process.env.CI==="true",n,s,i=!1,o="",a,u=w=>{let C=w>1?"Something went wrong":"Canceled";i&&h(C,w)},c=()=>u(2),l=()=>u(1),d=()=>{process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",l),process.on("SIGTERM",l),process.on("exit",u)},f=()=>{process.removeListener("uncaughtExceptionMonitor",c),process.removeListener("unhandledRejection",c),process.removeListener("SIGINT",l),process.removeListener("SIGTERM",l),process.removeListener("exit",u)},g=()=>{if(a===void 0)return;r&&process.stdout.write(`
114
114
  `);let w=a.split(`
115
- `);process.stdout.write(eg.cursor.move(-999,w.length-1)),process.stdout.write(eg.erase.down(w.length))},m=w=>w.replace(/\.+$/,""),D=(w="")=>{i=!0,n=At.block(),o=m(w),process.stdout.write(`${_.gray(te)}
116
- `);let C=0,A=0;d(),s=setInterval(()=>{if(r&&o===a)return;g(),a=o;let T=_.magenta(t[C]),G=r?"...":".".repeat(Math.floor(A)).slice(0,3);process.stdout.write(`${T} ${o}${G}`),C=C+1<t.length?C+1:0,A=A<t.length?A+.125:0},e)},h=(w="",C=0)=>{i=!1,clearInterval(s),g();let A=C===0?_.green(jo):C===1?_.red(ng):_.red(sg);o=m(w??o),process.stdout.write(`${A} ${o}
117
- `),f(),n()};return{start:D,stop:h,message:(w="")=>{o=m(w??o)}}},Dk=async(t,e)=>{let r={},n=Object.keys(t);for(let s of n){let i=t[s],o=await i({results:r})?.catch(a=>{throw a});if(typeof e?.onCancel=="function"&&At.isCancel(o)){r[s]="canceled",e.onCancel({results:r});continue}r[s]=o}return r},yk=async t=>{for(let e of t){if(e.enabled===!1)continue;let r=ig();r.start(e.title);let n=await e.task(r.message);r.stop(n||e.title)}};Te.isCancel=At.isCancel,Te.updateSettings=At.updateSettings,Te.cancel=pk,Te.confirm=uk,Te.group=Dk,Te.groupMultiselect=fk,Te.intro=mk,Te.log=rn,Te.multiselect=dk,Te.note=hk,Te.outro=gk,Te.password=ak,Te.select=ck,Te.selectKey=lk,Te.spinner=ig,Te.tasks=yk,Te.text=ik});var ss=v((OI,lg)=>{var qe=require("fs"),vt=require("path");function To(t){let e=vt.join(t,"rcode/skills"),r={agents:new Set,actions:new Set},n=vt.join(t,"rcode/agents");if(qe.existsSync(n))for(let o of qe.readdirSync(n,{withFileTypes:!0}))o.isFile()&&(!o.name.startsWith("rcode-")||!o.name.endsWith(".md")||r.agents.add(o.name.replace(/^rcode-/,"").replace(/\.md$/,"")));function s(o){try{let a=qe.readFileSync(vt.join(o,"SKILL.md"),"utf8");return/^internal:\s*true\s*$/m.test(a)}catch{return!1}}function i(o){if(qe.existsSync(o))for(let a of qe.readdirSync(o,{withFileTypes:!0})){if(!a.isDirectory())continue;let u=vt.join(o,a.name);if(qe.existsSync(vt.join(u,"SKILL.md"))){if(s(u))continue;let c=a.name.startsWith("rcode-")?a.name:`rcode-${a.name}`;r.actions.add(c)}else i(u)}}return i(vt.join(e,"actions")),r}function ag(t,e=null){if(!qe.existsSync(t))return new Set;let r=new Set;for(let n of qe.readdirSync(t,{withFileTypes:!0}))n.isDirectory()&&(e&&!n.name.startsWith(e)||r.add(e?n.name.slice(e.length):n.name));return r}function Io(t,e,r,n){let s=[...r].filter(o=>!n.has(o)).sort(),i=[...n].filter(o=>!r.has(o)).sort();return{editor:t,kind:e,expectedCount:r.size,installedCount:n.size,missing:s,extra:i}}function ug(t,e,r={}){let n=r.globalFallback!==!1,s=To(e),i=vt.join(t,".claude/agents"),o=vt.join(t,".claude/skills"),a=new Set;if(qe.existsSync(i))for(let l of qe.readdirSync(i))l.startsWith("rcode-")&&l.endsWith(".md")&&a.add(l.replace(/^rcode-/,"").replace(/\.md$/,""));if(a.size===0&&n)try{let l=require("os"),d=vt.join(l.homedir(),".claude/agents");if(qe.existsSync(d))for(let f of qe.readdirSync(d))f.startsWith("rcode-")&&f.endsWith(".md")&&a.add(f.replace(/^rcode-/,"").replace(/\.md$/,""))}catch{}let u=ag(o),c=new Set([...u].filter(l=>s.actions.has(l)));if(c.size===0&&n)try{let l=require("os"),d=vt.join(l.homedir(),".claude/skills"),f=ag(d);c=new Set([...f].filter(g=>s.actions.has(g)))}catch{}return[Io("claude","agents",s.agents,a),Io("claude","actions",s.actions,c)]}function Uu(t,e,r){let n=To(r),s=t==="cursor"?".cursor/rules":".windsurf/rules",i=vt.join(e,s,"rcode","agents"),o=new Set;if(qe.existsSync(i))for(let a of qe.readdirSync(i,{withFileTypes:!0}))a.isFile()&&(!a.name.startsWith("rcode-")||!a.name.endsWith(".mdc")||o.add(a.name.replace(/^rcode-/,"").replace(/\.mdc$/,"")));return[Io(t,"agents",n.agents,o)]}function cg(t,e){let r=To(e),n=vt.join(t,".antigravity/rcode/agents"),s=new Set;if(qe.existsSync(n))for(let i of qe.readdirSync(n,{withFileTypes:!0}))i.isFile()&&(!i.name.startsWith("rcode-")||!i.name.endsWith(".md")||s.add(i.name.replace(/^rcode-/,"").replace(/\.md$/,"")));return[Io("antigravity","agents",r.agents,s)]}function vk(t,e,r){let n=[];r.includes("claude")&&n.push(...ug(t,e)),r.includes("cursor")&&n.push(...Uu("cursor",t,e)),r.includes("windsurf")&&n.push(...Uu("windsurf",t,e)),r.includes("antigravity")&&n.push(...cg(t,e));let s=n.some(i=>i.missing.length>0||i.extra.length>0);return{reports:n,hasDrift:s}}function _k(t){let e=[];for(let r of t){let n=r.missing.length===0&&r.extra.length===0?"\u2713":"\u26A0";e.push(` ${n} ${r.editor.padEnd(12)} ${r.kind.padEnd(8)} ${r.installedCount}/${r.expectedCount}`),r.missing.length>0&&e.push(` missing: ${r.missing.join(", ")}`),r.extra.length>0&&e.push(` extra: ${r.extra.join(", ")}`)}return e.join(`
118
- `)}lg.exports={readPackageManifest:To,verifyInstall:vk,verifyClaudeInstall:ug,verifyRulesInstall:Uu,verifyAntigravityInstall:cg,formatReport:_k}});var is=v((NI,ct)=>{var y=require("fs"),p=require("path"),Ek=require("crypto"),bk=require("os"),{writeFileAtomic:It,safeRmSync:zu}=Jt(),{homedir:Ye}=lr(),X=Pn(),{createSpinner:Sk}=Hc(),Ck=Of(),{z:Ie}=Ga(),Fn=zp(),{createTwoFilesPatch:dg}=Im(),nt=Zu(),or=t=>X.green("\u2713")+" "+t,fg=t=>X.red("\u2717")+" "+t,_t=t=>X.yellow("\u26A0")+" "+t,Ro=t=>X.cyan("\u2192")+" "+t,Y=t=>X.dim(t),Ft=t=>X.bold(t),Et=p.resolve(__dirname,".."),$e=p.join(Et,"rcode"),os=Object.freeze(["claude","cursor","gemini","vscode","antigravity","windsurf","codex","grok"]);function wk(t){let e=t;for(;;){if(y.existsSync(p.join(e,"pnpm-workspace.yaml")))return e;let r=p.dirname(e);if(r===e)return null;e=r}}var xk=Ie.object({user_name:Ie.string().min(1),project_name:Ie.string().min(1),communication_language:Ie.string().default("English"),mode:Ie.enum(["guided","yolo"],{errorMap:()=>({message:'expected "guided" or "yolo"'})}).default("guided"),model_profile:Ie.string().optional(),commit_planning:Ie.boolean().optional(),rcode_source_path:Ie.string().optional(),workflow:Ie.object({research_by_default:Ie.boolean().optional(),plan_checker:Ie.boolean().optional(),post_execute_gates:Ie.boolean().optional(),ui_safety_gate:Ie.boolean().optional(),nyquist_validation:Ie.boolean().optional()}).optional(),output:Ie.object({verbose:Ie.boolean().optional()}).optional(),git:Ie.object({branching_strategy:Ie.string().optional()}).optional(),prompt_nudge:Ie.enum(["every","once-per-intent","when-stale","off"]).optional()}).passthrough();function Yu(t){let e={target:process.cwd(),targetProvided:!1,force:!1,reset:!1,yes:!1,userName:bk.userInfo().username||"User",projectName:null,language:"English",mode:"guided",ide:"claude",ideProvided:!1,help:!1,modules:[],commitPlanning:null,nonDestructive:!1,forceOverwrite:!1,showDiff:!1,diffStat:!1,acceptAll:!1,noUpdateCheck:!1,noBackup:!1,gitHooks:null,global:!1,silent:!1,noPrompt:!1,localOnly:!1,dryRun:!1,listFiles:!1},r=[];for(let n=0;n<t.length;n++){let s=t[n];s==="--help"||s==="-h"?e.help=!0:s==="--force"?e.force=!0:s==="--reset"?e.reset=!0:s==="--yes"||s==="-y"?e.yes=!0:s==="--user"?e.userName=t[++n]:s==="--project"?e.projectName=t[++n]:s==="--language"?e.language=t[++n]:s==="--mode"?e.mode=t[++n]:s==="--ide"?(e.ide=t[++n],e.ide==="claude-code"&&(e.ide="claude"),e.ideProvided=!0):s==="--module"?e.modules.push(t[++n]):s==="--commit-planning"?e.commitPlanning=!0:s==="--no-commit-planning"||s==="--ignore-planning"?e.commitPlanning=!1:s==="--non-destructive"?e.nonDestructive=!0:s==="--force-overwrite"?e.forceOverwrite=!0:s==="--show-diff"?e.showDiff=!0:s==="--diff-stat"?e.diffStat=!0:s==="--accept-all"?e.acceptAll=!0:s==="--no-update-check"?e.noUpdateCheck=!0:s==="--no-backup"?e.noBackup=!0:s==="--no-git-hooks"?e.gitHooks=!1:s==="--git-hooks"?e.gitHooks=!0:s==="--global"?e.global=!0:s==="--local-only"?e.localOnly=!0:s==="--silent"?e.silent=!0:s==="--no-prompt"?e.noPrompt=!0:s==="--dry-run"?e.dryRun=!0:s==="--list-files"?e.listFiles=!0:s.startsWith("--")||r.push(s)}if(r[0]&&(e.target=p.resolve(r[0]),e.targetProvided=!0),e.global&&!e.targetProvided&&(e.target=Ye()),!e.targetProvided&&!e.global){let n=process.cwd(),s=y.existsSync(p.join(n,"pnpm-workspace.yaml")),i=process.env.INIT_CWD;s&&i&&p.resolve(i)!==p.resolve(n)?e.target=p.resolve(i):wk(p.dirname(n))&&(e.target=n)}return e.projectName||(e.projectName=p.basename(e.target)),e}function $k(t,e){let{spawnSync:r}=require("child_process"),n=[];for(let c of e){let l=c.rel||c.dest;if(!l)continue;let d=p.join(t,l);y.existsSync(d)&&n.push(l)}for(let c of[".rcode/config.yaml",".rcode/state.json",".rcode/_config/manifest.yaml",".rcode/_config/files-manifest.csv"])y.existsSync(p.join(t,c))&&n.push(c);if(n.length===0)return{ok:!1,warning:"no existing files to back up \u2014 fresh install",fileCount:0};let s=p.join(t,".rcode/backups");try{y.mkdirSync(s,{recursive:!0})}catch(c){return{ok:!1,warning:`could not create .rcode/backups/: ${c.message}`,fileCount:0}}let i=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),o=p.join(s,`install-force-${i}.tgz`),a=p.relative(t,o),u=r("tar",["-czf",o,"-C",t,"--files-from=-"],{input:n.join(`
115
+ `);process.stdout.write(tg.cursor.move(-999,w.length-1)),process.stdout.write(tg.erase.down(w.length))},m=w=>w.replace(/\.+$/,""),y=(w="")=>{i=!0,n=jt.block(),o=m(w),process.stdout.write(`${_.gray(te)}
116
+ `);let C=0,A=0;d(),s=setInterval(()=>{if(r&&o===a)return;g(),a=o;let T=_.magenta(t[C]),V=r?"...":".".repeat(Math.floor(A)).slice(0,3);process.stdout.write(`${T} ${o}${V}`),C=C+1<t.length?C+1:0,A=A<t.length?A+.125:0},e)},h=(w="",C=0)=>{i=!1,clearInterval(s),g();let A=C===0?_.green(Io):C===1?_.red(sg):_.red(og);o=m(w??o),process.stdout.write(`${A} ${o}
117
+ `),f(),n()};return{start:y,stop:h,message:(w="")=>{o=m(w??o)}}},y$=async(t,e)=>{let r={},n=Object.keys(t);for(let s of n){let i=t[s],o=await i({results:r})?.catch(a=>{throw a});if(typeof e?.onCancel=="function"&&jt.isCancel(o)){r[s]="canceled",e.onCancel({results:r});continue}r[s]=o}return r},v$=async t=>{for(let e of t){if(e.enabled===!1)continue;let r=ag();r.start(e.title);let n=await e.task(r.message);r.stop(n||e.title)}};Te.isCancel=jt.isCancel,Te.updateSettings=jt.updateSettings,Te.cancel=m$,Te.confirm=c$,Te.group=y$,Te.groupMultiselect=h$,Te.intro=g$,Te.log=rn,Te.multiselect=f$,Te.note=p$,Te.outro=D$,Te.password=u$,Te.select=l$,Te.selectKey=d$,Te.spinner=ag,Te.tasks=v$,Te.text=a$});var ss=v((BI,dg)=>{var He=require("fs"),bt=require("path");function Ro(t){let e=bt.join(t,"rcode/skills"),r={agents:new Set,actions:new Set},n=bt.join(t,"rcode/agents");if(He.existsSync(n))for(let o of He.readdirSync(n,{withFileTypes:!0}))o.isFile()&&(!o.name.startsWith("rcode-")||!o.name.endsWith(".md")||r.agents.add(o.name.replace(/^rcode-/,"").replace(/\.md$/,"")));function s(o){try{let a=He.readFileSync(bt.join(o,"SKILL.md"),"utf8");return/^internal:\s*true\s*$/m.test(a)}catch{return!1}}function i(o){if(He.existsSync(o))for(let a of He.readdirSync(o,{withFileTypes:!0})){if(!a.isDirectory())continue;let u=bt.join(o,a.name);if(He.existsSync(bt.join(u,"SKILL.md"))){if(s(u))continue;let c=a.name.startsWith("rcode-")?a.name:`rcode-${a.name}`;r.actions.add(c)}else i(u)}}return i(bt.join(e,"actions")),r}function ug(t,e=null){if(!He.existsSync(t))return new Set;let r=new Set;for(let n of He.readdirSync(t,{withFileTypes:!0}))n.isDirectory()&&(e&&!n.name.startsWith(e)||r.add(e?n.name.slice(e.length):n.name));return r}function To(t,e,r,n){let s=[...r].filter(o=>!n.has(o)).sort(),i=[...n].filter(o=>!r.has(o)).sort();return{editor:t,kind:e,expectedCount:r.size,installedCount:n.size,missing:s,extra:i}}function cg(t,e,r={}){let n=r.globalFallback!==!1,s=Ro(e),i=bt.join(t,".claude/agents"),o=bt.join(t,".claude/skills"),a=new Set;if(He.existsSync(i))for(let l of He.readdirSync(i))l.startsWith("rcode-")&&l.endsWith(".md")&&a.add(l.replace(/^rcode-/,"").replace(/\.md$/,""));if(a.size===0&&n)try{let l=require("os"),d=bt.join(l.homedir(),".claude/agents");if(He.existsSync(d))for(let f of He.readdirSync(d))f.startsWith("rcode-")&&f.endsWith(".md")&&a.add(f.replace(/^rcode-/,"").replace(/\.md$/,""))}catch{}let u=ug(o),c=new Set([...u].filter(l=>s.actions.has(l)));if(c.size===0&&n)try{let l=require("os"),d=bt.join(l.homedir(),".claude/skills"),f=ug(d);c=new Set([...f].filter(g=>s.actions.has(g)))}catch{}return[To("claude","agents",s.agents,a),To("claude","actions",s.actions,c)]}function Vu(t,e,r){let n=Ro(r),s=t==="cursor"?".cursor/rules":".windsurf/rules",i=bt.join(e,s,"rcode","agents"),o=new Set;if(He.existsSync(i))for(let a of He.readdirSync(i,{withFileTypes:!0}))a.isFile()&&(!a.name.startsWith("rcode-")||!a.name.endsWith(".mdc")||o.add(a.name.replace(/^rcode-/,"").replace(/\.mdc$/,"")));return[To(t,"agents",n.agents,o)]}function lg(t,e){let r=Ro(e),n=bt.join(t,".antigravity/rcode/agents"),s=new Set;if(He.existsSync(n))for(let i of He.readdirSync(n,{withFileTypes:!0}))i.isFile()&&(!i.name.startsWith("rcode-")||!i.name.endsWith(".md")||s.add(i.name.replace(/^rcode-/,"").replace(/\.md$/,"")));return[To("antigravity","agents",r.agents,s)]}function _$(t,e,r){let n=[];r.includes("claude")&&n.push(...cg(t,e)),r.includes("cursor")&&n.push(...Vu("cursor",t,e)),r.includes("windsurf")&&n.push(...Vu("windsurf",t,e)),r.includes("antigravity")&&n.push(...lg(t,e));let s=n.some(i=>i.missing.length>0||i.extra.length>0);return{reports:n,hasDrift:s}}function b$(t){let e=[];for(let r of t){let n=r.missing.length===0&&r.extra.length===0?"\u2713":"\u26A0";e.push(` ${n} ${r.editor.padEnd(12)} ${r.kind.padEnd(8)} ${r.installedCount}/${r.expectedCount}`),r.missing.length>0&&e.push(` missing: ${r.missing.join(", ")}`),r.extra.length>0&&e.push(` extra: ${r.extra.join(", ")}`)}return e.join(`
118
+ `)}dg.exports={readPackageManifest:Ro,verifyInstall:_$,verifyClaudeInstall:cg,verifyRulesInstall:Vu,verifyAntigravityInstall:lg,formatReport:b$}});var is=v((MI,dt)=>{var D=require("fs"),p=require("path"),S$=require("crypto"),E$=require("os"),{writeFileAtomic:Et,safeRmSync:Yu}=Kt(),{homedir:Xe}=dr(),J=Pn(),{createSpinner:C$}=Zc(),w$=Nf(),{z:Ie}=za(),Fn=Yp(),{createTwoFilesPatch:fg}=Tm(),Re=Uu(),ir=t=>J.green("\u2713")+" "+t,hg=t=>J.red("\u2717")+" "+t,St=t=>J.yellow("\u26A0")+" "+t,Po=t=>J.cyan("\u2192")+" "+t,Y=t=>J.dim(t),It=t=>J.bold(t),lt=p.resolve(__dirname,".."),$e=p.join(lt,"rcode"),os=Object.freeze(["claude","cursor","gemini","vscode","antigravity","windsurf","codex","grok"]);function x$(t){let e=t;for(;;){if(D.existsSync(p.join(e,"pnpm-workspace.yaml")))return e;let r=p.dirname(e);if(r===e)return null;e=r}}var k$=Ie.object({user_name:Ie.string().min(1),project_name:Ie.string().min(1),communication_language:Ie.string().default("English"),mode:Ie.enum(["guided","yolo"],{errorMap:()=>({message:'expected "guided" or "yolo"'})}).default("guided"),model_profile:Ie.string().optional(),commit_planning:Ie.boolean().optional(),rcode_source_path:Ie.string().optional(),workflow:Ie.object({research_by_default:Ie.boolean().optional(),plan_checker:Ie.boolean().optional(),post_execute_gates:Ie.boolean().optional(),ui_safety_gate:Ie.boolean().optional(),nyquist_validation:Ie.boolean().optional()}).optional(),output:Ie.object({verbose:Ie.boolean().optional()}).optional(),git:Ie.object({branching_strategy:Ie.string().optional()}).optional(),prompt_nudge:Ie.enum(["every","once-per-intent","when-stale","off"]).optional()}).passthrough();function Ju(t){let e={target:process.cwd(),targetProvided:!1,force:!1,reset:!1,yes:!1,userName:E$.userInfo().username||"User",projectName:null,language:"English",mode:"guided",ide:"claude",ideProvided:!1,help:!1,modules:[],commitPlanning:null,nonDestructive:!1,forceOverwrite:!1,showDiff:!1,diffStat:!1,acceptAll:!1,noUpdateCheck:!1,noBackup:!1,gitHooks:null,enableHooks:null,global:!1,silent:!1,noPrompt:!1,localOnly:!1,dryRun:!1,listFiles:!1},r=[];for(let n=0;n<t.length;n++){let s=t[n];s==="--help"||s==="-h"?e.help=!0:s==="--force"?e.force=!0:s==="--reset"?e.reset=!0:s==="--yes"||s==="-y"?e.yes=!0:s==="--user"?e.userName=t[++n]:s==="--project"?e.projectName=t[++n]:s==="--language"?e.language=t[++n]:s==="--mode"?e.mode=t[++n]:s==="--ide"?(e.ide=t[++n],e.ide==="claude-code"&&(e.ide="claude"),e.ideProvided=!0):s==="--module"?e.modules.push(t[++n]):s==="--commit-planning"?e.commitPlanning=!0:s==="--no-commit-planning"||s==="--ignore-planning"?e.commitPlanning=!1:s==="--non-destructive"?e.nonDestructive=!0:s==="--force-overwrite"?e.forceOverwrite=!0:s==="--show-diff"?e.showDiff=!0:s==="--diff-stat"?e.diffStat=!0:s==="--accept-all"?e.acceptAll=!0:s==="--no-update-check"?e.noUpdateCheck=!0:s==="--no-backup"?e.noBackup=!0:s==="--no-git-hooks"?e.gitHooks=!1:s==="--git-hooks"?e.gitHooks=!0:s==="--no-hooks"?e.enableHooks=!1:s==="--enable-hooks"?e.enableHooks=!0:s==="--global"?e.global=!0:s==="--local-only"?e.localOnly=!0:s==="--silent"?e.silent=!0:s==="--no-prompt"?e.noPrompt=!0:s==="--dry-run"?e.dryRun=!0:s==="--list-files"?e.listFiles=!0:s.startsWith("--")||r.push(s)}if(r[0]&&(e.target=p.resolve(r[0]),e.targetProvided=!0),e.global&&!e.targetProvided&&(e.target=Xe()),!e.targetProvided&&!e.global){let n=process.cwd(),s=D.existsSync(p.join(n,"pnpm-workspace.yaml")),i=process.env.INIT_CWD;s&&i&&p.resolve(i)!==p.resolve(n)?e.target=p.resolve(i):x$(p.dirname(n))&&(e.target=n)}return e.projectName||(e.projectName=p.basename(e.target)),e}function $$(t,e){let{spawnSync:r}=require("child_process"),n=[];for(let c of e){let l=c.rel||c.dest;if(!l)continue;let d=p.join(t,l);D.existsSync(d)&&n.push(l)}for(let c of[".rcode/config.yaml",".rcode/state.json",".rcode/_config/manifest.yaml",".rcode/_config/files-manifest.csv"])D.existsSync(p.join(t,c))&&n.push(c);if(n.length===0)return{ok:!1,warning:"no existing files to back up \u2014 fresh install",fileCount:0};let s=p.join(t,".rcode/backups");try{D.mkdirSync(s,{recursive:!0})}catch(c){return{ok:!1,warning:`could not create .rcode/backups/: ${c.message}`,fileCount:0}}let i=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),o=p.join(s,`install-force-${i}.tgz`),a=p.relative(t,o),u=r("tar",["-czf",o,"-C",t,"--files-from=-"],{input:n.join(`
119
119
  `)+`
120
120
  `,encoding:"utf8"});return u.status!==0?{ok:!1,warning:`tar failed: ${(u.stderr||"").trim().split(`
121
- `)[0]}`,fileCount:n.length}:{ok:!0,path:a,fileCount:n.length}}function kk(t){let e=t||We(),r=["",X.cyan("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"),X.cyan("\u2502")+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+X.bold(X.yellow("\u{1F54C} rcode Memory Bank"))+" "+Y("\u2014 installer")+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+Y("A persistent context-brain for your editor")+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+Y("version ")+X.green("v"+e)+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+Y("docs ")+"github.com/hanzlahabib/rcode "+X.cyan("\u2502"),X.cyan("\u2502")+" "+Y("by ")+"Hanzla Habib "+X.cyan("\u2502"),X.cyan("\u2502")+" "+X.cyan("\u2502"),X.cyan("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"),""];console.log(r.join(`
122
- `))}function hg(t){let e={claude:!1,cursor:!1,gemini:!1,vscode:!1,antigravity:!1,windsurf:!1,codex:!1};y.existsSync(p.join(t,".claude"))&&(e.claude=!0),y.existsSync(p.join(t,".cursor"))&&(e.cursor=!0),y.existsSync(p.join(t,".gemini"))&&(e.gemini=!0),y.existsSync(p.join(t,".vscode"))&&(e.vscode=!0),y.existsSync(p.join(t,".antigravity"))&&(e.antigravity=!0),y.existsSync(p.join(t,".windsurf"))&&(e.windsurf=!0);let r=Ye();return y.existsSync(p.join(r,".claude"))&&(e.claude=!0),y.existsSync(p.join(r,".cursor"))&&(e.cursor=!0),y.existsSync(p.join(r,".config","Cursor"))&&(e.cursor=!0),y.existsSync(p.join(r,".gemini"))&&(e.gemini=!0),y.existsSync(p.join(r,".vscode"))&&(e.vscode=!0),y.existsSync(p.join(r,".config","Code"))&&(e.vscode=!0),y.existsSync(p.join(r,".antigravity"))&&(e.antigravity=!0),y.existsSync(p.join(r,".windsurf"))&&(e.windsurf=!0),y.existsSync(p.join(r,".codeium","windsurf"))&&(e.windsurf=!0),(process.env.CURSOR_TRACE_ID||/cursor/i.test(process.env.TERM_PROGRAM||""))&&(e.cursor=!0),(process.env.CLAUDECODE==="1"||process.env.CLAUDE_CODE_ENTRYPOINT)&&(e.claude=!0),(process.env.VSCODE_PID||/vscode/i.test(process.env.TERM_PROGRAM||""))&&(e.vscode=!0),/windsurf/i.test(process.env.TERM_PROGRAM||"")&&(e.windsurf=!0),(process.env.CODEX_ENV||/codex/i.test(process.env.TERM_PROGRAM||""))&&(e.codex=!0),e}async function Ak(t){if(Array.isArray(t.ides)&&t.ides.length>0)return t.ides;if(t.ideProvided)return[t.ide];if(t.noPrompt||t.global)return["claude"];if(t.yes||!process.stdin.isTTY){let i=hg(t.target),o=os.filter(a=>i[a]);return o.length>0?o:["claude"]}let e=hg(t.target),r=os.filter(i=>i!=="antigravity"&&e[i]),n=r.length>0?r:["claude"],s=await nt.multiselect({message:"\u{1F3AF} Which editor(s) will you use rcode with?",initialValues:n,options:[{value:"claude",label:"Claude Code",hint:e.claude?"(detected)":void 0},{value:"cursor",label:"Cursor",hint:e.cursor?"(detected)":void 0},{value:"codex",label:"Codex (OpenAI CLI)",hint:e.codex?"(detected)":"(uses AGENTS.md + workflow bridge)"},{value:"gemini",label:"Gemini CLI",hint:e.gemini?"(detected)":"(beta \u2014 limited)"},{value:"vscode",label:"VS Code",hint:e.vscode?"(detected)":"(via Continue / Copilot extensions)"},{value:"antigravity",label:"Antigravity",hint:"(experimental \u2014 installs to .antigravity/)"}],required:!0});return nt.isCancel(s)&&(nt.cancel("Install cancelled."),process.exit(0)),s}async function Fk(t){if(t.commitPlanning!==null)return t.commitPlanning;if(t.global)return!1;if(t.noPrompt)return!0;let e=null;try{let s=p.join(t.target,".rcode","config.yaml");if(y.existsSync(s)){let o=y.readFileSync(s,"utf8").match(/^commit_planning:\s*(true|false)\s*$/m);o&&(e=o[1]==="true")}}catch{}if(t.yes||!process.stdin.isTTY)return e!==null?e:!0;let r=e===!1?"gitignore":"commit",n=await nt.select({message:e!==null?"\u{1F4CB} .planning/ tracking \u2014 current setting preserved unless you change it.":"\u{1F4CB} .planning/ holds PRDs, roadmaps, sprints, SUMMARY files. How should they be tracked?",initialValue:r,options:[{value:"commit",label:"Commit",hint:"collaborators see the same plans (recommended)"},{value:"gitignore",label:"Gitignore",hint:"planning stays local (good for sensitive PRDs)"}]});return nt.isCancel(n)&&(nt.cancel("Install cancelled."),process.exit(0)),n==="commit"}function gg(){console.log(`
121
+ `)[0]}`,fileCount:n.length}:{ok:!0,path:a,fileCount:n.length}}function A$(t){let e=t||Ze(),r=["",J.cyan("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"),J.cyan("\u2502")+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+J.bold(J.yellow("\u{1F54C} rcode Memory Bank"))+" "+Y("\u2014 installer")+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+Y("A persistent context-brain for your editor")+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+Y("version ")+J.green("v"+e)+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+Y("docs ")+"github.com/hanzlahabib/rcode "+J.cyan("\u2502"),J.cyan("\u2502")+" "+Y("by ")+"Hanzla Habib "+J.cyan("\u2502"),J.cyan("\u2502")+" "+J.cyan("\u2502"),J.cyan("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"),""];console.log(r.join(`
122
+ `))}function pg(t){let e={claude:!1,cursor:!1,gemini:!1,vscode:!1,antigravity:!1,windsurf:!1,codex:!1};D.existsSync(p.join(t,".claude"))&&(e.claude=!0),D.existsSync(p.join(t,".cursor"))&&(e.cursor=!0),D.existsSync(p.join(t,".gemini"))&&(e.gemini=!0),D.existsSync(p.join(t,".vscode"))&&(e.vscode=!0),D.existsSync(p.join(t,".antigravity"))&&(e.antigravity=!0),D.existsSync(p.join(t,".windsurf"))&&(e.windsurf=!0);let r=Xe();return D.existsSync(p.join(r,".claude"))&&(e.claude=!0),D.existsSync(p.join(r,".cursor"))&&(e.cursor=!0),D.existsSync(p.join(r,".config","Cursor"))&&(e.cursor=!0),D.existsSync(p.join(r,".gemini"))&&(e.gemini=!0),D.existsSync(p.join(r,".vscode"))&&(e.vscode=!0),D.existsSync(p.join(r,".config","Code"))&&(e.vscode=!0),D.existsSync(p.join(r,".antigravity"))&&(e.antigravity=!0),D.existsSync(p.join(r,".windsurf"))&&(e.windsurf=!0),D.existsSync(p.join(r,".codeium","windsurf"))&&(e.windsurf=!0),(process.env.CURSOR_TRACE_ID||/cursor/i.test(process.env.TERM_PROGRAM||""))&&(e.cursor=!0),(process.env.CLAUDECODE==="1"||process.env.CLAUDE_CODE_ENTRYPOINT)&&(e.claude=!0),(process.env.VSCODE_PID||/vscode/i.test(process.env.TERM_PROGRAM||""))&&(e.vscode=!0),/windsurf/i.test(process.env.TERM_PROGRAM||"")&&(e.windsurf=!0),(process.env.CODEX_ENV||/codex/i.test(process.env.TERM_PROGRAM||""))&&(e.codex=!0),e}async function F$(t){if(Array.isArray(t.ides)&&t.ides.length>0)return t.ides;if(t.ideProvided)return[t.ide];if(t.noPrompt||t.global)return["claude"];if(t.yes||!process.stdin.isTTY){let i=pg(t.target),o=os.filter(a=>i[a]);return o.length>0?o:["claude"]}let e=pg(t.target),r=os.filter(i=>i!=="antigravity"&&e[i]),n=r.length>0?r:["claude"],s=await Re.multiselect({message:"\u{1F3AF} Which editor(s) will you use rcode with?",initialValues:n,options:[{value:"claude",label:"Claude Code",hint:e.claude?"(detected)":void 0},{value:"cursor",label:"Cursor",hint:e.cursor?"(detected)":void 0},{value:"codex",label:"Codex (OpenAI CLI)",hint:e.codex?"(detected)":"(uses AGENTS.md + workflow bridge)"},{value:"gemini",label:"Gemini CLI",hint:e.gemini?"(detected)":"(beta \u2014 limited)"},{value:"vscode",label:"VS Code",hint:e.vscode?"(detected)":"(via Continue / Copilot extensions)"},{value:"antigravity",label:"Antigravity",hint:"(experimental \u2014 installs to .antigravity/)"}],required:!0});return Re.isCancel(s)&&(Re.cancel("Install cancelled."),process.exit(0)),s}async function j$(t){if(t.commitPlanning!==null)return t.commitPlanning;if(t.global)return!1;if(t.noPrompt)return!0;let e=null;try{let s=p.join(t.target,".rcode","config.yaml");if(D.existsSync(s)){let o=D.readFileSync(s,"utf8").match(/^commit_planning:\s*(true|false)\s*$/m);o&&(e=o[1]==="true")}}catch{}if(t.yes||!process.stdin.isTTY)return e!==null?e:!0;let r=e===!1?"gitignore":"commit",n=await Re.select({message:e!==null?"\u{1F4CB} .planning/ tracking \u2014 current setting preserved unless you change it.":"\u{1F4CB} .planning/ holds PRDs, roadmaps, sprints, SUMMARY files. How should they be tracked?",initialValue:r,options:[{value:"commit",label:"Commit",hint:"collaborators see the same plans (recommended)"},{value:"gitignore",label:"Gitignore",hint:"planning stays local (good for sensitive PRDs)"}]});return Re.isCancel(n)&&(Re.cancel("Install cancelled."),process.exit(0)),n==="commit"}async function I$(t){if(t.enableHooks!==null)return t.enableHooks;if(t.global||!t.ides.includes("claude"))return!1;if(t.noPrompt||t.yes||!process.stdin.isTTY)return!0;let e=await Re.confirm({message:"\u{1F6E1}\uFE0F Enable rcode guardrail hooks in .claude/settings.json? (pre-edit checks, bash-guard, prompt-router, etc.)",initialValue:!0});return Re.isCancel(e)&&(Re.cancel("Install cancelled."),process.exit(0)),e}function T$(t,e={}){if(e.enableHooks!==!0)return{action:"skipped-flag"};let r=p.join(lt,"rcode","templates","settings-hooks.json");if(!D.existsSync(r))return{action:"skipped-template-missing"};let n;try{n=JSON.parse(D.readFileSync(r,"utf8"))}catch{return{action:"skipped-error"}}let s=p.join(t,".claude"),i=p.join(s,"settings.json"),o={};if(D.existsSync(i))try{o=JSON.parse(D.readFileSync(i,"utf8"))}catch{return{action:"skipped-error"}}o.hooks=o.hooks||{};for(let[a,u]of Object.entries(n.hooks||{})){o.hooks[a]=o.hooks[a]||[];for(let c of u){let l=o.hooks[a].find(d=>d.matcher===c.matcher);l||(l={matcher:c.matcher,hooks:[]},o.hooks[a].push(l));for(let d of c.hooks)l.hooks.some(g=>g.command===d.command&&g.type===d.type)||l.hooks.push(d)}}try{return D.mkdirSync(s,{recursive:!0}),Et(i,JSON.stringify(o,null,2)+`
123
+ `),{action:"merged"}}catch{return{action:"skipped-error"}}}function Dg(){console.log(`
123
124
  rcode installer
124
125
 
125
126
  Usage:
@@ -134,6 +135,8 @@ Options:
134
135
  --language <lang> set communication_language (default: English)
135
136
  --mode <guided|yolo> default mode (default: guided)
136
137
  --ide <name> target IDE (claude, cursor, gemini; default: claude)
138
+ --enable-hooks merge rcode guardrail hooks into .claude/settings.json (default: on)
139
+ --no-hooks skip guardrail hooks; enable later via /rcode-enable-hooks
137
140
  --dry-run preview what would be written; exit without writing any files
138
141
  --list-files alias for --dry-run
139
142
  --help this text
@@ -145,10 +148,10 @@ Installs (IDE-specific):
145
148
  cursor: target/.cursor/rules/rcode/ Cursor-specific rules + agents
146
149
  gemini: target/.gemini/rcode/ Gemini CLI commands + agents
147
150
  target/.planning/ artifact output dir (all IDEs)
148
- `)}function Xu(t,e){switch(t){case"claude":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"cursor":return{agentsDir:p.join(e,".cursor","rules","rcode","agents"),commandsDir:p.join(e,".cursor","rules","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"gemini":return{agentsDir:p.join(e,".gemini","rcode","agents"),commandsDir:p.join(e,".gemini","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"vscode":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin"),markerDir:p.join(e,".vscode","rcode")};case"antigravity":return{agentsDir:p.join(e,".antigravity","rcode","agents"),commandsDir:p.join(e,".antigravity","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"windsurf":return{agentsDir:p.join(e,".windsurf","rules","rcode","agents"),commandsDir:p.join(e,".windsurf","rules","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"codex":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"grok":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};default:throw new Error(`Unknown IDE: ${t}. Supported: ${os.join(", ")}`)}}function Ar(t,e=[]){return y.existsSync(t)?Ck.sync("**/*",{cwd:t,dot:!0,onlyFiles:!0,followSymbolicLinks:!1,ignore:e}).map(r=>p.join(t,r)):[]}function jn(t){return Ek.createHash("sha256").update(t).digest("hex")}function jt(t){y.mkdirSync(t,{recursive:!0})}function Dg(t,e){if(y.existsSync(t)){y.existsSync(e)||y.mkdirSync(e,{recursive:!0});for(let r of y.readdirSync(t,{withFileTypes:!0})){let n=p.join(t,r.name),s=p.join(e,r.name);r.isDirectory()?Dg(n,s):r.isFile()&&y.copyFileSync(n,s)}}}function jk(t,e){let r=p.join(t,".planning"),n=p.join(r,"ROADMAP.md"),s=p.join(r,"STATE.md"),i=p.join(r,"PROJECT.md");if(y.existsSync(n))return!1;y.mkdirSync(r,{recursive:!0});let o=new Date().toISOString().slice(0,10),a=e||p.basename(t),u=`<!-- INSTALL STUB \u2014 overwritten by /rcode-new-project. Delete this file or run
151
+ `)}function Xu(t,e){switch(t){case"claude":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"cursor":return{agentsDir:p.join(e,".cursor","rules","rcode","agents"),commandsDir:p.join(e,".cursor","rules","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"gemini":return{agentsDir:p.join(e,".gemini","rcode","agents"),commandsDir:p.join(e,".gemini","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"vscode":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin"),markerDir:p.join(e,".vscode","rcode")};case"antigravity":return{agentsDir:p.join(e,".antigravity","rcode","agents"),commandsDir:p.join(e,".antigravity","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"windsurf":return{agentsDir:p.join(e,".windsurf","rules","rcode","agents"),commandsDir:p.join(e,".windsurf","rules","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"codex":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"grok":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};default:throw new Error(`Unknown IDE: ${t}. Supported: ${os.join(", ")}`)}}function Fr(t,e=[]){return D.existsSync(t)?w$.sync("**/*",{cwd:t,dot:!0,onlyFiles:!0,followSymbolicLinks:!1,ignore:e}).map(r=>p.join(t,r)):[]}function jn(t){return S$.createHash("sha256").update(t).digest("hex")}function Tt(t){D.mkdirSync(t,{recursive:!0})}function yg(t,e){if(D.existsSync(t)){D.existsSync(e)||D.mkdirSync(e,{recursive:!0});for(let r of D.readdirSync(t,{withFileTypes:!0})){let n=p.join(t,r.name),s=p.join(e,r.name);r.isDirectory()?yg(n,s):r.isFile()&&D.copyFileSync(n,s)}}}function R$(t,e){let r=p.join(t,".planning"),n=p.join(r,"ROADMAP.md"),s=p.join(r,"STATE.md"),i=p.join(r,"PROJECT.md");if(D.existsSync(n))return!1;D.mkdirSync(r,{recursive:!0});let o=new Date().toISOString().slice(0,10),a=e||p.basename(t),u=`<!-- INSTALL STUB \u2014 overwritten by /rcode-new-project. Delete this file or run
149
152
  /rcode-new-project before committing. See https://github.com/hanzlahabib/rcode/issues/670 -->
150
153
 
151
- `;y.writeFileSync(i,u+`# ${a}
154
+ `;D.writeFileSync(i,u+`# ${a}
152
155
 
153
156
  **One-line:** Describe what this project is in one sentence.
154
157
 
@@ -161,7 +164,7 @@ What this project delivers and who it serves.
161
164
  - Language/framework
162
165
  - Key dependencies
163
166
  - Deployment target
164
- `),y.writeFileSync(n,u+`# ${a} \u2014 Roadmap
167
+ `),D.writeFileSync(n,u+`# ${a} \u2014 Roadmap
165
168
 
166
169
  **Milestone: M1 \u2014 Initial Delivery** (v1.0)
167
170
  Started: ${o} \xB7 Current
@@ -176,7 +179,7 @@ Started: ${o} \xB7 Current
176
179
  ## Backlog
177
180
 
178
181
  Ideas and future phases go here.
179
- `),y.writeFileSync(s,u+`# ${a} \u2014 State
182
+ `),D.writeFileSync(s,u+`# ${a} \u2014 State
180
183
 
181
184
  **Last updated:** ${o}
182
185
  **Milestone:** M1 \u2014 Initial Delivery
@@ -196,171 +199,171 @@ _None._
196
199
  ## Next Action
197
200
 
198
201
  Run \`/rcode-new-project <description>\` to bootstrap, or \`/rcode-sprint-planning\` once a real phase exists.
199
- `);let c=p.join(t,".rcode","state.json");function l(){let d=p.join(t,".planning","ROADMAP.md");if(!y.existsSync(d))return!0;try{return y.readFileSync(d,"utf8").includes("<!-- INSTALL STUB")}catch{return!0}}if(!y.existsSync(c)){let d=new Date().toISOString(),f=l(),g=null,m=p.join(t,".rcode","config.yaml");if(y.existsSync(m))try{let A=y.readFileSync(m,"utf8").match(/^project_name:\s*"?([^"\n]+)"?/m);A&&(g=A[1].trim())}catch{}let D=null,h=p.join(t,".planning","ROADMAP.md");if(!f&&y.existsSync(h))try{let C=y.readFileSync(h,"utf8"),A=C.match(/^\|\s*(\d+(?:\.\d+)?)\s*\|/m);if(A)D=String(parseInt(A[1],10));else{let T=C.match(/^#{2,4}\s*Phase\s+(\d+(?:\.\d+)?)/im);T&&(D=String(parseInt(T[1],10)))}}catch{}let w={version:"1",schema_version:2,project:g||p.basename(t),...f?{_seeded_stub:!0}:{},created:d,updated:d,current_phase:D,current_plan:0,current_sprint:null,phases:[],milestones:[],executions:[],decisions:[],blockers:[],council_sessions:[],chains:[],workstreams:[],active_workstream:null,last_session:null,velocity_history:[]};y.mkdirSync(p.dirname(c),{recursive:!0}),It(c,JSON.stringify(w,null,2)+`
200
- `)}return!0}function Ik(t,e={}){let r=e.commitPlanning!==!1,n="# ===== rcode-managed gitignore block (npx @hanzlaa/rcode install) =====",s="# ===== end rcode-managed gitignore block =====",i=["",n,"# Added automatically on first rcode install. Idempotent \u2014 safe to re-run.","# Edit `commit_planning` in .rcode/config.yaml to flip planning-artifact tracking.","","# Installed methodology files (regenerate with: npx @hanzlaa/rcode install)",".claude/",".rcode/bin/",".rcode/data/",".rcode/workflows/",".rcode/references/",".rcode/commands/",".rcode/skills/","","# Pulled rcode brain content (refresh with: rcode brain pull)",".rcode/brain/rcode-github/",".rcode/brain/rcode-docs/",".rcode/brain/best-practices/","","# Runtime noise","node_modules/",".rcode/state.json.lock",".planning/debug/",".planning/_backup/"];r||i.push("","# Planning artifacts \u2014 kept local (commit_planning: false)",".planning/"),i.push("","# What you DO commit:","# .rcode/config.yaml - project mode/language/profile/commit_planning","# .rcode/state.json - decisions, roadmap pointer, blockers","# .rcode/brain/sources.yaml - brain source manifest",r?"# .planning/ - PRD, roadmap, sprints, SUMMARY.md files":"# (planning artifacts are NOT committed \u2014 see commit_planning in config)",s,"");let o=i.join(`
202
+ `);let c=p.join(t,".rcode","state.json");function l(){let d=p.join(t,".planning","ROADMAP.md");if(!D.existsSync(d))return!0;try{return D.readFileSync(d,"utf8").includes("<!-- INSTALL STUB")}catch{return!0}}if(!D.existsSync(c)){let d=new Date().toISOString(),f=l(),g=null,m=p.join(t,".rcode","config.yaml");if(D.existsSync(m))try{let A=D.readFileSync(m,"utf8").match(/^project_name:\s*"?([^"\n]+)"?/m);A&&(g=A[1].trim())}catch{}let y=null,h=p.join(t,".planning","ROADMAP.md");if(!f&&D.existsSync(h))try{let C=D.readFileSync(h,"utf8"),A=C.match(/^\|\s*(\d+(?:\.\d+)?)\s*\|/m);if(A)y=String(parseInt(A[1],10));else{let T=C.match(/^#{2,4}\s*Phase\s+(\d+(?:\.\d+)?)/im);T&&(y=String(parseInt(T[1],10)))}}catch{}let w={version:"1",schema_version:2,project:g||p.basename(t),...f?{_seeded_stub:!0}:{},created:d,updated:d,current_phase:y,current_plan:0,current_sprint:null,phases:[],milestones:[],executions:[],decisions:[],blockers:[],council_sessions:[],chains:[],workstreams:[],active_workstream:null,last_session:null,velocity_history:[]};D.mkdirSync(p.dirname(c),{recursive:!0}),Et(c,JSON.stringify(w,null,2)+`
203
+ `)}return!0}function P$(t,e={}){let r=e.commitPlanning!==!1,n="# ===== rcode-managed gitignore block (npx @hanzlaa/rcode install) =====",s="# ===== end rcode-managed gitignore block =====",i=["",n,"# Added automatically on first rcode install. Idempotent \u2014 safe to re-run.","# Edit `commit_planning` in .rcode/config.yaml to flip planning-artifact tracking.","","# Installed methodology files (regenerate with: npx @hanzlaa/rcode install)",".claude/",".rcode/bin/",".rcode/data/",".rcode/workflows/",".rcode/references/",".rcode/commands/",".rcode/skills/","","# Pulled rcode brain content (refresh with: rcode brain pull)",".rcode/brain/rcode-github/",".rcode/brain/rcode-docs/",".rcode/brain/best-practices/","","# Runtime noise","node_modules/",".rcode/state.json.lock",".planning/debug/",".planning/_backup/"];r||i.push("","# Planning artifacts \u2014 kept local (commit_planning: false)",".planning/"),i.push("","# What you DO commit:","# .rcode/config.yaml - project mode/language/profile/commit_planning","# .rcode/state.json - decisions, roadmap pointer, blockers","# .rcode/brain/sources.yaml - brain source manifest",r?"# .planning/ - PRD, roadmap, sprints, SUMMARY.md files":"# (planning artifacts are NOT committed \u2014 see commit_planning in config)",s,"");let o=i.join(`
201
204
  `),a=p.join(t,".gitignore");try{let l=function(d,f){let g=d.indexOf(n);if(g<0)return null;let m=d.indexOf(s,g);if(m<0){let w=g;return w>0&&d[w-1]===`
202
- `&&(w-=1),d.slice(0,w)+f}let D=g;D>0&&d[D-1]===`
203
- `&&(D-=1);let h=m+s.length;return d[h]===`
204
- `&&(h+=1),d.slice(0,D)+f+d.slice(h)};var u=l;if(!y.existsSync(a))return It(a,o),{action:"created"};let c=y.readFileSync(a,"utf8");if(c.includes(n)){let d=l(c,o);return d!==null&&d!==c?(It(a,d),{action:"updated"}):{action:"already-present"}}return It(a,c+o),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function Tk(t,e={}){if(e.gitHooks===!1)return{action:"skipped-flag"};let r=p.join(t,".git");if(!y.existsSync(r)||!y.statSync(r).isDirectory())return{action:"skipped-no-git"};let n="# ===== rcode-managed pre-commit block =====",s="# ===== end rcode pre-commit block =====",i=["",n,"# Auto-syncs .rcode/state.json when planning files change.","# Added by rcode install \u2014 safe to re-run (idempotent).",'if git diff --cached --name-only | grep -qE "^\\.planning/|^\\.rcode/brain/sources\\.yaml$"; then'," if [ -x .rcode/bin/rcode-tools.cjs ]; then"," node .rcode/bin/rcode-tools.cjs state sync --from-disk > /dev/null 2>&1 || true"," git add .rcode/state.json 2>/dev/null || true"," fi","fi",s,""].join(`
205
+ `&&(w-=1),d.slice(0,w)+f}let y=g;y>0&&d[y-1]===`
206
+ `&&(y-=1);let h=m+s.length;return d[h]===`
207
+ `&&(h+=1),d.slice(0,y)+f+d.slice(h)};var u=l;if(!D.existsSync(a))return Et(a,o),{action:"created"};let c=D.readFileSync(a,"utf8");if(c.includes(n)){let d=l(c,o);return d!==null&&d!==c?(Et(a,d),{action:"updated"}):{action:"already-present"}}return Et(a,c+o),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function O$(t,e={}){if(e.gitHooks===!1)return{action:"skipped-flag"};let r=p.join(t,".git");if(!D.existsSync(r)||!D.statSync(r).isDirectory())return{action:"skipped-no-git"};let n="# ===== rcode-managed pre-commit block =====",s="# ===== end rcode pre-commit block =====",i=["",n,"# Auto-syncs .rcode/state.json when planning files change.","# Added by rcode install \u2014 safe to re-run (idempotent).",'if git diff --cached --name-only | grep -qE "^\\.planning/|^\\.rcode/brain/sources\\.yaml$"; then'," if [ -x .rcode/bin/rcode-tools.cjs ]; then"," node .rcode/bin/rcode-tools.cjs state sync --from-disk > /dev/null 2>&1 || true"," git add .rcode/state.json 2>/dev/null || true"," fi","fi",s,""].join(`
205
208
  `),o=p.join(r,"hooks"),a=p.join(o,"pre-commit");try{let l=function(d,f){let g=d.indexOf(n);if(g<0)return null;let m=d.indexOf(s,g);if(m<0){let w=g;return w>0&&d[w-1]===`
206
- `&&(w-=1),d.slice(0,w)+f}let D=g;D>0&&d[D-1]===`
207
- `&&(D-=1);let h=m+s.length;return d[h]===`
208
- `&&(h+=1),d.slice(0,D)+f+d.slice(h)};var u=l;if(y.mkdirSync(o,{recursive:!0}),!y.existsSync(a))return It(a,`#!/bin/sh
209
- ${i}`,{mode:493}),{action:"created"};let c=y.readFileSync(a,"utf8");if(c.includes(n)){let d=l(c,i);return d!==null&&d!==c?(It(a,d,{mode:493}),{action:"updated"}):{action:"already-present"}}return It(a,c+i,{mode:493}),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function Rk(t,e){let r=p.join(t,"rcode","brain"),n=p.join(e,".rcode","brain");y.mkdirSync(n,{recursive:!0});let s=0;for(let o of["sources.yaml","README.md"]){let a=p.join(r,o),u=p.join(n,o);y.existsSync(a)&&!y.existsSync(u)&&(y.copyFileSync(a,u),s++)}let i=p.join(t,"rcode","skills","_shared");if(y.existsSync(i)){let o=p.join(n,"best-practices");y.mkdirSync(o,{recursive:!0});for(let a of y.readdirSync(i,{withFileTypes:!0}))if(a.isFile()&&a.name.endsWith(".md")){let u=p.join(o,a.name);y.existsSync(u)||(y.copyFileSync(p.join(i,a.name),u),s++)}}return s}function pg(t,e,r={}){let n=p.join(t,"rcode/skills"),s=p.join(e,".claude/skills"),i=p.join(e,".rcode/skills");if(!y.existsSync(n))return{count:0,skippedGlobal:0};y.mkdirSync(s,{recursive:!0}),y.mkdirSync(i,{recursive:!0});let o=p.join(Ye(),".claude","skills"),a=r.skipGlobalDuplicates&&y.existsSync(o)?new Set(y.readdirSync(o).filter(m=>m.startsWith("rcode-"))):new Set,u=0,c=0,l=new Map;function d(m){if(l.has(m))return l.get(m);let D=p.join(m,"SKILL.md");if(!y.existsSync(D))return l.set(m,!1),!1;let h=y.readFileSync(D,"utf8"),w=/^internal:\s*true\s*$/m.test(h);return l.set(m,w),w}function f(m){if(!y.existsSync(m))return!1;try{return y.readdirSync(m).some(D=>D.endsWith(".local.md"))}catch{return!1}}function g(m){if(y.existsSync(m))for(let D of y.readdirSync(m,{withFileTypes:!0})){if(!D.isDirectory())continue;let h=p.join(m,D.name);if(y.existsSync(p.join(h,"SKILL.md"))){let C=D.name.startsWith("rcode-")?D.name:`rcode-${D.name}`,A=d(h),T=A?p.join(i,C):p.join(s,C);if(!A&&a.has(C)&&!f(T)){if(y.existsSync(T))try{zu(T,e)}catch{}c++;continue}Dg(h,T),u++}else g(h)}}for(let m of["agents","actions","core"])g(p.join(n,m));return{count:u,skippedGlobal:c}}function Vu(t){if(!t.startsWith(`---
209
+ `&&(w-=1),d.slice(0,w)+f}let y=g;y>0&&d[y-1]===`
210
+ `&&(y-=1);let h=m+s.length;return d[h]===`
211
+ `&&(h+=1),d.slice(0,y)+f+d.slice(h)};var u=l;if(D.mkdirSync(o,{recursive:!0}),!D.existsSync(a))return Et(a,`#!/bin/sh
212
+ ${i}`,{mode:493}),{action:"created"};let c=D.readFileSync(a,"utf8");if(c.includes(n)){let d=l(c,i);return d!==null&&d!==c?(Et(a,d,{mode:493}),{action:"updated"}):{action:"already-present"}}return Et(a,c+i,{mode:493}),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function N$(t,e){let r=p.join(t,"rcode","brain"),n=p.join(e,".rcode","brain");D.mkdirSync(n,{recursive:!0});let s=0;for(let o of["sources.yaml","README.md"]){let a=p.join(r,o),u=p.join(n,o);D.existsSync(a)&&!D.existsSync(u)&&(D.copyFileSync(a,u),s++)}let i=p.join(t,"rcode","skills","_shared");if(D.existsSync(i)){let o=p.join(n,"best-practices");D.mkdirSync(o,{recursive:!0});for(let a of D.readdirSync(i,{withFileTypes:!0}))if(a.isFile()&&a.name.endsWith(".md")){let u=p.join(o,a.name);D.existsSync(u)||(D.copyFileSync(p.join(i,a.name),u),s++)}}return s}function mg(t,e,r={}){let n=p.join(t,"rcode/skills"),s=p.join(e,".claude/skills"),i=p.join(e,".rcode/skills");if(!D.existsSync(n))return{count:0,skippedGlobal:0};D.mkdirSync(s,{recursive:!0}),D.mkdirSync(i,{recursive:!0});let o=p.join(Xe(),".claude","skills"),a=r.skipGlobalDuplicates&&D.existsSync(o)?new Set(D.readdirSync(o).filter(m=>m.startsWith("rcode-"))):new Set,u=0,c=0,l=new Map;function d(m){if(l.has(m))return l.get(m);let y=p.join(m,"SKILL.md");if(!D.existsSync(y))return l.set(m,!1),!1;let h=D.readFileSync(y,"utf8"),w=/^internal:\s*true\s*$/m.test(h);return l.set(m,w),w}function f(m){if(!D.existsSync(m))return!1;try{return D.readdirSync(m).some(y=>y.endsWith(".local.md"))}catch{return!1}}function g(m){if(D.existsSync(m))for(let y of D.readdirSync(m,{withFileTypes:!0})){if(!y.isDirectory())continue;let h=p.join(m,y.name);if(D.existsSync(p.join(h,"SKILL.md"))){let C=y.name.startsWith("rcode-")?y.name:`rcode-${y.name}`,A=d(h),T=A?p.join(i,C):p.join(s,C);if(!A&&a.has(C)&&!f(T)){if(D.existsSync(T))try{Yu(T,e)}catch{}c++;continue}yg(h,T),u++}else g(h)}}for(let m of["agents","actions","core"])g(p.join(n,m));return{count:u,skippedGlobal:c}}function Gu(t){if(!t.startsWith(`---
210
213
  `))return{frontmatter:{},body:t};let e=t.indexOf(`
211
214
  ---
212
215
  `,4);if(e===-1)return{frontmatter:{},body:t};let r=t.slice(4,e),n=t.slice(e+5),s={};for(let i of r.split(`
213
- `)){let o=i.replace(/^#.*$/,"").trimEnd();if(!o)continue;let a=o.indexOf(":");if(a===-1)continue;let u=o.slice(0,a).trim(),c=o.slice(a+1).trim();!u||!c||(c.startsWith('"')&&c.endsWith('"')&&(c=c.slice(1,-1)),c.startsWith("'")&&c.endsWith("'")&&(c=c.slice(1,-1)),s[u]=c)}return{frontmatter:s,body:n}}function yg(t){let e=p.join(t,".claude","commands","rcode"),r=p.join(t,".claude","commands");if(!y.existsSync(e)||!y.statSync(e).isDirectory())return{moved:0,removed_dir:!1};let n=0;for(let i of y.readdirSync(e)){let o=p.join(e,i);if(!y.statSync(o).isFile()||!i.endsWith(".md"))continue;let u=p.basename(i,".md").startsWith("rcode-")?i:`rcode-${i}`,c=p.join(r,u);if(y.existsSync(c)){y.unlinkSync(o);continue}y.renameSync(o,c),n++}let s=!1;try{y.rmdirSync(e),s=!0}catch{}return{moved:n,removed_dir:s}}function Ju(t="claude",e=process.cwd()){if(Array.isArray(t)){let f=new Set,g=[];for(let m of t)for(let D of Ju(m,e)){let h=D.rel;f.has(h)||(f.add(h),g.push(D))}return g}let r=[],n=Xu(t,e),s=p.relative(e,n.workflowsDir),i=p.relative(e,n.referencesDir),o=p.relative(e,n.binDir),a=p.relative(e,n.agentsDir),u=p.relative(e,n.commandsDir);for(let f of Ar(p.join($e,"workflows"))){let g=p.relative(p.join($e,"workflows"),f);r.push({src:f,rel:p.join(s,g)})}for(let f of Ar(p.join($e,"references"))){let g=p.relative(p.join($e,"references"),f);r.push({src:f,rel:p.join(i,g)})}for(let f of Ar(p.join($e,"bin"))){let g=p.relative(p.join($e,"bin"),f);r.push({src:f,rel:p.join(o,g),executable:f.endsWith(".cjs")})}for(let f of Ar(p.join($e,"data"))){let g=p.relative(p.join($e,"data"),f);r.push({src:f,rel:p.join(".rcode","data",g)})}let c=p.join($e,"templates","projects"),l=p.relative(e,p.join(e,".rcode","templates","projects"));for(let f of Ar(c)){let g=p.relative(c,f);r.push({src:f,rel:p.join(l,g)})}for(let f of Ar(p.join($e,"agents"))){let g=p.relative(p.join($e,"agents"),f),m=t==="cursor"?".mdc":".md",D=p.basename(f,".md")+m;r.push({src:f,rel:p.join(a,p.dirname(g),D),ide:t,cursor:t==="cursor"})}for(let f of Ar(p.join($e,"commands"))){let g=p.relative(p.join($e,"commands"),f),m=t==="cursor"?".mdc":".md",D=p.basename(f,".md"),h=t==="claude"||t==="vscode"||t==="grok"?`rcode-${D}${m}`:D+m;r.push({src:f,rel:p.join(u,p.dirname(g),h),ide:t,cursor:t==="cursor"})}let d=p.join(e,".rcode","agents-rules");for(let f of Ar(p.join($e,"agents","rules"))){let g=p.relative(p.join($e,"agents","rules"),f);r.push({src:f,rel:p.join(".rcode","agents-rules",g)})}return r}function Pk(t){let e=p.join($e,"modules",`${t}.yaml`);if(!y.existsSync(e))return null;let r=y.readFileSync(e,"utf8"),n={name:t,requires:[],agents:[],workflows:[],commands:[],references:[]},s=null;for(let i of r.split(`
214
- `)){let o=i.replace(/#.*$/,"").trimEnd();if(!o.trim())continue;let a=o.match(/^(\w+):/);if(a&&!o.startsWith(" ")&&!o.startsWith("-")){let u=a[1],c=o.slice(o.indexOf(":")+1).trim();["agents","workflows","commands","references","requires"].includes(u)?(s=u,c&&c!=="[]"&&(n[u]=c.replace(/^\[|\]$/g,"").split(",").map(l=>l.trim().replace(/^["']|["']$/g,"")).filter(Boolean))):(s=null,u==="name"&&(n.name=c.replace(/^["']|["']$/g,"")));continue}if(s&&o.trim().startsWith("-")){let u=o.trim().slice(1).trim().replace(/^["']|["']$/g,"");u&&n[s].push(u)}}return n}function vg(){let t=p.join($e,"modules");return y.existsSync(t)?y.readdirSync(t).filter(e=>e.endsWith(".yaml")).map(e=>e.replace(".yaml","")):[]}function Ok(t,e){if(e.length===0)return t;let r=new Set;for(let n of e){let s=Pk(n);if(!s){console.warn(` \u26A0 Unknown module: ${n}`);continue}for(let i of s.agents)r.add(p.join(".claude","agents",i));for(let i of s.workflows)r.add(p.join(".rcode","workflows",i));for(let i of s.commands)r.add(p.join(".claude","commands",`rcode-${i}`));for(let i of s.references)r.add(p.join(".rcode","references",i))}return t.filter(n=>n.rel.startsWith(p.join(".rcode","bin"))||n.rel.startsWith(p.join(".rcode","data"))?!0:r.has(n.rel))}function Nk(t,e){let r=[["id","file","name","description","color"]],n=new Set,s=new Map,i=u=>(s.has(u)||s.set(u,y.readFileSync(u,"utf8")),s.get(u));for(let u of t){if(!u.rel.startsWith(p.join(".claude","agents"))||!u.rel.match(/^\.claude[\/\\]agents[\/\\][^\/\\]+\.md$/))continue;let c=p.join(e,u.rel),l=i(c),{frontmatter:d}=Vu(l),f=d.name||p.basename(u.rel,".md"),g=f.replace(/^rcode-/,"");if(n.has(g))continue;n.add(g);let m=(d.description||"").replace(/"/g,'""');r.push([g,u.rel,f,`"${m}"`,d.color||""])}let o=p.join(e,".claude","agents");if(y.existsSync(o)){let u=y.readdirSync(o).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md")),c=new Set(t.filter(l=>l.rel.startsWith(p.join(".claude","agents"))).map(l=>p.basename(l.rel)));for(let l of u){if(c.has(l))continue;let d=p.join(o,l),f=i(d),{frontmatter:g}=Vu(f),m=g.name||p.basename(l,".md"),D=m.replace(/^rcode-/,"");if(n.has(D))continue;n.add(D);let h=(g.description||"").replace(/"/g,'""');r.push([D,p.join(".claude","agents",l),m,`"${h}"`,g.color||""])}}let a=[p.join(Ye(),".claude","agents"),p.join(Ye(),".rcode","agents")];try{let u=p.join($e,"agents");y.existsSync(u)&&a.push(u)}catch{}for(let u of a){if(!y.existsSync(u))continue;let c;try{c=y.readdirSync(u).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md"))}catch{continue}for(let l of c){let d=p.join(u,l),f;try{f=i(d)}catch{continue}let{frontmatter:g}=Vu(f),m=g.name||p.basename(l,".md"),D=m.replace(/^rcode-/,"");if(n.has(D))continue;n.add(D);let h=(g.description||"").replace(/"/g,'""');r.push([D,p.join(".claude","agents",l),m,`"${h}"`,g.color||""])}}return r.map(u=>u.join(",")).join(`
216
+ `)){let o=i.replace(/^#.*$/,"").trimEnd();if(!o)continue;let a=o.indexOf(":");if(a===-1)continue;let u=o.slice(0,a).trim(),c=o.slice(a+1).trim();!u||!c||(c.startsWith('"')&&c.endsWith('"')&&(c=c.slice(1,-1)),c.startsWith("'")&&c.endsWith("'")&&(c=c.slice(1,-1)),s[u]=c)}return{frontmatter:s,body:n}}function vg(t){let e=p.join(t,".claude","commands","rcode"),r=p.join(t,".claude","commands");if(!D.existsSync(e)||!D.statSync(e).isDirectory())return{moved:0,removed_dir:!1};let n=0;for(let i of D.readdirSync(e)){let o=p.join(e,i);if(!D.statSync(o).isFile()||!i.endsWith(".md"))continue;let u=p.basename(i,".md").startsWith("rcode-")?i:`rcode-${i}`,c=p.join(r,u);if(D.existsSync(c)){D.unlinkSync(o);continue}D.renameSync(o,c),n++}let s=!1;try{D.rmdirSync(e),s=!0}catch{}return{moved:n,removed_dir:s}}function Ku(t="claude",e=process.cwd()){if(Array.isArray(t)){let f=new Set,g=[];for(let m of t)for(let y of Ku(m,e)){let h=y.rel;f.has(h)||(f.add(h),g.push(y))}return g}let r=[],n=Xu(t,e),s=p.relative(e,n.workflowsDir),i=p.relative(e,n.referencesDir),o=p.relative(e,n.binDir),a=p.relative(e,n.agentsDir),u=p.relative(e,n.commandsDir);for(let f of Fr(p.join($e,"workflows"))){let g=p.relative(p.join($e,"workflows"),f);r.push({src:f,rel:p.join(s,g)})}for(let f of Fr(p.join($e,"references"))){let g=p.relative(p.join($e,"references"),f);r.push({src:f,rel:p.join(i,g)})}for(let f of Fr(p.join($e,"bin"))){let g=p.relative(p.join($e,"bin"),f);r.push({src:f,rel:p.join(o,g),executable:f.endsWith(".cjs")})}for(let f of Fr(p.join($e,"data"))){let g=p.relative(p.join($e,"data"),f);r.push({src:f,rel:p.join(".rcode","data",g)})}let c=p.join($e,"templates","projects"),l=p.relative(e,p.join(e,".rcode","templates","projects"));for(let f of Fr(c)){let g=p.relative(c,f);r.push({src:f,rel:p.join(l,g)})}for(let f of Fr(p.join($e,"agents"))){let g=p.relative(p.join($e,"agents"),f),m=t==="cursor"?".mdc":".md",y=p.basename(f,".md")+m;r.push({src:f,rel:p.join(a,p.dirname(g),y),ide:t,cursor:t==="cursor"})}for(let f of Fr(p.join($e,"commands"))){let g=p.relative(p.join($e,"commands"),f),m=t==="cursor"?".mdc":".md",y=p.basename(f,".md"),h=t==="claude"||t==="vscode"||t==="grok"?`rcode-${y}${m}`:y+m;r.push({src:f,rel:p.join(u,p.dirname(g),h),ide:t,cursor:t==="cursor"})}let d=p.join(e,".rcode","agents-rules");for(let f of Fr(p.join($e,"agents","rules"))){let g=p.relative(p.join($e,"agents","rules"),f);r.push({src:f,rel:p.join(".rcode","agents-rules",g)})}return r}function L$(t){let e=p.join($e,"modules",`${t}.yaml`);if(!D.existsSync(e))return null;let r=D.readFileSync(e,"utf8"),n={name:t,requires:[],agents:[],workflows:[],commands:[],references:[]},s=null;for(let i of r.split(`
217
+ `)){let o=i.replace(/#.*$/,"").trimEnd();if(!o.trim())continue;let a=o.match(/^(\w+):/);if(a&&!o.startsWith(" ")&&!o.startsWith("-")){let u=a[1],c=o.slice(o.indexOf(":")+1).trim();["agents","workflows","commands","references","requires"].includes(u)?(s=u,c&&c!=="[]"&&(n[u]=c.replace(/^\[|\]$/g,"").split(",").map(l=>l.trim().replace(/^["']|["']$/g,"")).filter(Boolean))):(s=null,u==="name"&&(n.name=c.replace(/^["']|["']$/g,"")));continue}if(s&&o.trim().startsWith("-")){let u=o.trim().slice(1).trim().replace(/^["']|["']$/g,"");u&&n[s].push(u)}}return n}function _g(){let t=p.join($e,"modules");return D.existsSync(t)?D.readdirSync(t).filter(e=>e.endsWith(".yaml")).map(e=>e.replace(".yaml","")):[]}function B$(t,e){if(e.length===0)return t;let r=new Set;for(let n of e){let s=L$(n);if(!s){console.warn(` \u26A0 Unknown module: ${n}`);continue}for(let i of s.agents)r.add(p.join(".claude","agents",i));for(let i of s.workflows)r.add(p.join(".rcode","workflows",i));for(let i of s.commands)r.add(p.join(".claude","commands",`rcode-${i}`));for(let i of s.references)r.add(p.join(".rcode","references",i))}return t.filter(n=>n.rel.startsWith(p.join(".rcode","bin"))||n.rel.startsWith(p.join(".rcode","data"))?!0:r.has(n.rel))}function M$(t,e){let r=[["id","file","name","description","color"]],n=new Set,s=new Map,i=u=>(s.has(u)||s.set(u,D.readFileSync(u,"utf8")),s.get(u));for(let u of t){if(!u.rel.startsWith(p.join(".claude","agents"))||!u.rel.match(/^\.claude[\/\\]agents[\/\\][^\/\\]+\.md$/))continue;let c=p.join(e,u.rel),l=i(c),{frontmatter:d}=Gu(l),f=d.name||p.basename(u.rel,".md"),g=f.replace(/^rcode-/,"");if(n.has(g))continue;n.add(g);let m=(d.description||"").replace(/"/g,'""');r.push([g,u.rel,f,`"${m}"`,d.color||""])}let o=p.join(e,".claude","agents");if(D.existsSync(o)){let u=D.readdirSync(o).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md")),c=new Set(t.filter(l=>l.rel.startsWith(p.join(".claude","agents"))).map(l=>p.basename(l.rel)));for(let l of u){if(c.has(l))continue;let d=p.join(o,l),f=i(d),{frontmatter:g}=Gu(f),m=g.name||p.basename(l,".md"),y=m.replace(/^rcode-/,"");if(n.has(y))continue;n.add(y);let h=(g.description||"").replace(/"/g,'""');r.push([y,p.join(".claude","agents",l),m,`"${h}"`,g.color||""])}}let a=[p.join(Xe(),".claude","agents"),p.join(Xe(),".rcode","agents")];try{let u=p.join($e,"agents");D.existsSync(u)&&a.push(u)}catch{}for(let u of a){if(!D.existsSync(u))continue;let c;try{c=D.readdirSync(u).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md"))}catch{continue}for(let l of c){let d=p.join(u,l),f;try{f=i(d)}catch{continue}let{frontmatter:g}=Gu(f),m=g.name||p.basename(l,".md"),y=m.replace(/^rcode-/,"");if(n.has(y))continue;n.add(y);let h=(g.description||"").replace(/"/g,'""');r.push([y,p.join(".claude","agents",l),m,`"${h}"`,g.color||""])}}return r.map(u=>u.join(",")).join(`
215
218
  `)+`
216
- `}function Lk(t,e,{mergeExistingManifest:r=!1,extraScanDirs:n=[]}={}){let s=[["rel","sha256","size"]],i=new Set,o=new Map,a=c=>(o.has(c)||o.set(c,y.readFileSync(c)),o.get(c));for(let c of t){let l=p.join(e,c.rel);if(!y.existsSync(l))continue;let d=a(l),f=c.rel.split(p.sep).join("/");s.push([f,jn(d),String(d.length)]),i.add(f)}function u(c){if(y.existsSync(c))for(let l of y.readdirSync(c,{withFileTypes:!0})){let d=p.join(c,l.name);if(l.isDirectory())u(d);else if(l.isFile()){let f=p.relative(e,d).split(p.sep).join("/");if(i.has(f)||f.startsWith("..")||p.isAbsolute(f))continue;try{let g=a(d);s.push([f,jn(g),String(g.length)]),i.add(f)}catch{}}}}for(let c of n)u(c);if(r){let c=p.join(e,".rcode","_config","files-manifest.csv");if(y.existsSync(c))try{let l=y.readFileSync(c,"utf8").split(`
217
- `).slice(1).filter(Boolean);for(let d of l){let[f]=d.split(",");if(!f||i.has(f))continue;let g=p.join(e,f);if(!y.existsSync(g))continue;let m=a(g);s.push([f,jn(m),String(m.length)]),i.add(f)}}catch{}}return s.map(c=>c.join(",")).join(`
219
+ `}function q$(t,e,{mergeExistingManifest:r=!1,extraScanDirs:n=[]}={}){let s=[["rel","sha256","size"]],i=new Set,o=new Map,a=c=>(o.has(c)||o.set(c,D.readFileSync(c)),o.get(c));for(let c of t){let l=p.join(e,c.rel);if(!D.existsSync(l))continue;let d=a(l),f=c.rel.split(p.sep).join("/");s.push([f,jn(d),String(d.length)]),i.add(f)}function u(c){if(D.existsSync(c))for(let l of D.readdirSync(c,{withFileTypes:!0})){let d=p.join(c,l.name);if(l.isDirectory())u(d);else if(l.isFile()){let f=p.relative(e,d).split(p.sep).join("/");if(i.has(f)||f.startsWith("..")||p.isAbsolute(f))continue;try{let g=a(d);s.push([f,jn(g),String(g.length)]),i.add(f)}catch{}}}}for(let c of n)u(c);if(r){let c=p.join(e,".rcode","_config","files-manifest.csv");if(D.existsSync(c))try{let l=D.readFileSync(c,"utf8").split(`
220
+ `).slice(1).filter(Boolean);for(let d of l){let[f]=d.split(",");if(!f||i.has(f))continue;let g=p.join(e,f);if(!D.existsSync(g))continue;let m=a(g);s.push([f,jn(m),String(m.length)]),i.add(f)}}catch{}}return s.map(c=>c.join(",")).join(`
218
221
  `)+`
219
- `}function Bk(t,e){let r=p.join(t,".rcode","_config","files-manifest.csv");if(!y.existsSync(r))return 0;let n;try{n=y.readFileSync(r,"utf8").split(`
220
- `).slice(1).filter(Boolean).map(f=>f.split(",")[0]).filter(Boolean)}catch{return 0}let s=new Set(e.map(d=>d.rel.split(p.sep).join("/"))),i=/^(\.rcode\/config\.yaml|\.rcode\/state\.json|\.rcode\/state\.json\.lock|\.planning\/|\.rcode\/brain\/sources\.yaml)/,o=d=>/\.local\.(md|mdc|json|yaml|yml|toml|js|ts)$/.test(d),a=0,u=new Set,c=p.resolve(t);for(let d of n){if(s.has(d)||i.test(d)||o(d)||d.includes("..")||p.isAbsolute(d))continue;let f=p.join(t,d);if(!y.existsSync(f))continue;zu(f,c).ok&&(u.add(p.dirname(f)),a+=1)}let l=Array.from(u).sort((d,f)=>f.length-d.length);for(let d of l)try{y.existsSync(d)&&y.readdirSync(d).length===0&&y.rmdirSync(d)}catch(f){console.error("[install] sweepStaleInstalledFiles: failed to remove empty dir",d+":",f?.message||f)}return a}function Mk(t){let e=p.join(t,"package.json"),r=p.join(t,"pnpm-lock.yaml");if(!y.existsSync(e)||!y.existsSync(r))return{ok:!0};try{let n=JSON.parse(y.readFileSync(e,"utf8")),s=Object.prototype.hasOwnProperty.call(n.dependencies||{},"@hanzlaa/rcode"),i=Object.prototype.hasOwnProperty.call(n.devDependencies||{},"@hanzlaa/rcode");return!s&&!i?{ok:!1,message:"@hanzlaa/rcode not found in package.json \u2014 if you ran `pnpm add -D @hanzlaa/rcode` and it reported success, your lockfile may be corrupted.\n Fix: pnpm install --fix-lockfile && pnpm add -D @hanzlaa/rcode"}:{ok:!0}}catch{return{ok:!0}}}function We(){try{return JSON.parse(y.readFileSync(p.join(Et,"package.json"),"utf8")).version||"0.0.0"}catch{return"0.0.0"}}function mg(t){let e=We(),r=t.modules.length>0?t.modules:vg(),n=[],s=null,i=p.join(t.target,".rcode","_config","manifest.yaml");if(y.existsSync(i)){let c=y.readFileSync(i,"utf8"),l=!1;for(let d of c.split(`
222
+ `}function W$(t,e){let r=p.join(t,".rcode","_config","files-manifest.csv");if(!D.existsSync(r))return 0;let n;try{n=D.readFileSync(r,"utf8").split(`
223
+ `).slice(1).filter(Boolean).map(f=>f.split(",")[0]).filter(Boolean)}catch{return 0}let s=new Set(e.map(d=>d.rel.split(p.sep).join("/"))),i=/^(\.rcode\/config\.yaml|\.rcode\/state\.json|\.rcode\/state\.json\.lock|\.planning\/|\.rcode\/brain\/sources\.yaml)/,o=d=>/\.local\.(md|mdc|json|yaml|yml|toml|js|ts)$/.test(d),a=0,u=new Set,c=p.resolve(t);for(let d of n){if(s.has(d)||i.test(d)||o(d)||d.includes("..")||p.isAbsolute(d))continue;let f=p.join(t,d);if(!D.existsSync(f))continue;Yu(f,c).ok&&(u.add(p.dirname(f)),a+=1)}let l=Array.from(u).sort((d,f)=>f.length-d.length);for(let d of l)try{D.existsSync(d)&&D.readdirSync(d).length===0&&D.rmdirSync(d)}catch(f){console.error("[install] sweepStaleInstalledFiles: failed to remove empty dir",d+":",f?.message||f)}return a}function H$(t){let e=p.join(t,"package.json"),r=p.join(t,"pnpm-lock.yaml");if(!D.existsSync(e)||!D.existsSync(r))return{ok:!0};try{let n=JSON.parse(D.readFileSync(e,"utf8")),s=Object.prototype.hasOwnProperty.call(n.dependencies||{},"@hanzlaa/rcode"),i=Object.prototype.hasOwnProperty.call(n.devDependencies||{},"@hanzlaa/rcode");return!s&&!i?{ok:!1,message:"@hanzlaa/rcode not found in package.json \u2014 if you ran `pnpm add -D @hanzlaa/rcode` and it reported success, your lockfile may be corrupted.\n Fix: pnpm install --fix-lockfile && pnpm add -D @hanzlaa/rcode"}:{ok:!0}}catch{return{ok:!0}}}function Ze(){try{return JSON.parse(D.readFileSync(p.join(lt,"package.json"),"utf8")).version||"0.0.0"}catch{return"0.0.0"}}function gg(t){let e=Ze(),r=t.modules.length>0?t.modules:_g(),n=[],s=null,i=p.join(t.target,".rcode","_config","manifest.yaml");if(D.existsSync(i)){let c=D.readFileSync(i,"utf8"),l=!1;for(let d of c.split(`
221
224
  `)){if(d.startsWith("version:")){let f=d.replace("version:","").trim();Fn.valid(f)&&f!==e&&(s=f)}if(d.startsWith("modules:")){l=!0;continue}l&&d.trim().startsWith("-")?n.push(d.trim().slice(1).trim()):l&&!d.startsWith(" ")&&(l=!1)}}let a=[...new Set([...n,...r])].map(c=>` - ${c}`).join(`
222
225
  `),u=["# rcode v2 install manifest",`version: ${e}`,`installDate: ${new Date().toISOString()}`];return s&&u.push(`previous_version: ${s}`),u.push("modules:",a,"ides:"," - claude-code",""),u.join(`
223
- `)}function Po(t){return(t||"").replace(/[\n\r]/g," ").replace(/"/g,'\\"')}function qk(t){return["# rcode v2 project config","# Generated by install. Safe to edit.",`user_name: "${Po(t.userName)}"`,`project_name: "${Po(t.projectName)}"`,`communication_language: "${Po(t.language)}"`,`mode: "${Po(t.mode)}"`,'model_profile: "balanced"',`commit_planning: ${t.commitPlanning!==!1}`,"workflow:"," research_by_default: false"," plan_checker: true"," post_execute_gates: true"," ui_safety_gate: true","git:",' branching_strategy: "none"',""].join(`
224
- `)}function Wk(t){let e=xk.safeParse(t);return e.success?{valid:!0}:{valid:!1,errors:e.error.issues.map(n=>` ${n.path.join(".")||"(root)"}: ${n.message}`)}}function Hk(t){let e={},r=null;for(let n of t.split(`
225
- `)){let s=n.replace(/#.*$/,"");if(!s.trim())continue;let i=s.match(/^(\s*)/)[1].length;if(i===0){let o=s.indexOf(":");if(o===-1)continue;let a=s.slice(0,o).trim(),u=s.slice(o+1).trim();if(u===""){r=a,e[a]={};continue}r=null,u.startsWith('"')&&u.endsWith('"')&&(u=u.slice(1,-1)),u.startsWith("'")&&u.endsWith("'")&&(u=u.slice(1,-1)),u==="true"?u=!0:u==="false"&&(u=!1),e[a]=u}else if(r&&i>0){let o=s.indexOf(":");if(o===-1)continue;let a=s.slice(0,o).trim(),u=s.slice(o+1).trim();u.startsWith('"')&&u.endsWith('"')&&(u=u.slice(1,-1)),u==="true"?u=!0:u==="false"&&(u=!1),e[r][a]=u}}return e}async function Ku(t){if(t.help)return gg(),0;if(t.reset&&!t.force)return console.log(""),console.log(" "+_t("--reset has no effect without --force.")),console.log(" "+Y(" --reset wipes config.yaml and state.json. To prevent accidental data loss,")),console.log(" "+Y(" it must be paired with --force. Re-run as:")),console.log(" "+Y(" rcode install --reset --force")),console.log(""),2;let e=()=>{};if(!t.global){let r=Zk(t.target);if(!r.ok)return console.log(""),console.log(" "+_t(`Another install is already running here (PID ${r.pid}).`)),console.log(" "+Y(` Lock: ${r.lockPath}`)),console.log(" "+Y(" If the other process crashed, delete the lock file and retry:")),console.log(" "+Y(` rm ${r.lockPath}`)),console.log(""),3;e=r.release,process.on("exit",e)}try{return await Uk(t)}finally{e(),process.removeListener("exit",e)}}function Zk(t){let e=p.join(t,".rcode"),r=p.join(e,".install.lock");try{y.mkdirSync(e,{recursive:!0})}catch{}function n(s){try{return process.kill(s,0),!0}catch{return!1}}for(let s=0;s<2;s++)try{let i=y.openSync(r,"wx");return y.writeSync(i,String(process.pid)),y.closeSync(i),{ok:!0,release:()=>{try{y.unlinkSync(r)}catch(o){console.error("[install] acquireInstallLock: failed to release lock",r+":",o?.message||o)}}}}catch(i){if(i.code!=="EEXIST")throw i;let o=0;try{o=parseInt(y.readFileSync(r,"utf8"),10)}catch(a){console.error("[install] acquireInstallLock: failed to read lock pid from",r+":",a?.message||a)}if(o&&!n(o)){try{y.unlinkSync(r)}catch{}continue}return{ok:!1,pid:o,lockPath:r}}return{ok:!1,pid:0,lockPath:r}}function Qu(t){let e=Ye(),r=p.join(e,".rcode","slash-commands"),n=p.join(e,".rcode","bin");jt(r),jt(n);let s=p.join($e,"commands"),i=0;for(let u of y.readdirSync(s))u.endsWith(".md")&&(y.copyFileSync(p.join(s,u),p.join(r,u)),i++);let o=p.join(Et,"cli","rcode-slash-router.cjs"),a=p.join(n,"rcode-slash-router.cjs");return y.copyFileSync(o,a),t&&t.global!=="silent"&&console.log(" "+or(`Slash-router: ${i} command bodies \u2192 ~/.rcode/slash-commands/ + router \u2192 ~/.rcode/bin/`)),a}function _g(){return`node "${p.join(Ye(),".rcode","bin","rcode-slash-router.cjs")}"`}function Eg(t,e,r,n){let s={};if(y.existsSync(t))try{s=JSON.parse(y.readFileSync(t,"utf8"))||{}}catch{return console.log(" "+_t(`${n}: ${t} is not valid JSON \u2014 skipped slash-router wiring.`)),!1}return(!s.hooks||typeof s.hooks!="object")&&(s.hooks={}),Array.isArray(s.hooks[e])||(s.hooks[e]=[]),s.hooks[e].some(o=>Array.isArray(o?.hooks)&&o.hooks.some(a=>typeof a?.command=="string"&&a.command.includes("rcode-slash-router.cjs")))?(console.log(" "+or(`${n}: slash-router hook already present (idempotent).`)),!1):(s.hooks[e].push({hooks:[{type:"command",command:r,timeout:10}]}),jt(p.dirname(t)),y.writeFileSync(t,JSON.stringify(s,null,2)+`
226
- `),console.log(" "+or(`${n}: wired slash-router into ${e} hook (existing hooks preserved).`)),!0)}function bg(t){Qu(t);let e=p.join(Ye(),".codex","hooks.json");Eg(e,"UserPromptSubmit",_g(),"Codex")}function Sg(t){Qu(t);let e=p.join(Ye(),".gemini","antigravity","settings.json");Eg(e,"UserPrompt",_g(),"Antigravity")}function Gu(t){if(!t||!t.global)return;let e=Array.isArray(t.ides)?t.ides:[t.ide].filter(Boolean);for(let r of e)switch(r){case"codex":bg(t);break;case"antigravity":Sg(t);break;default:break}}async function Uk(t){let e=We();process.stdin.isTTY&&!t.yes&&kk(e),t.ides=await Ak(t),t.commitPlanning=await Fk(t),console.log(`
227
- \u{1F54C} ${Ft("rcode")} ${X.cyan("v"+e)} ${Y("\u2192")} ${t.target}`);let n=p.join(t.target,".rcode","_config","manifest.yaml");if(y.existsSync(n)){let x=y.readFileSync(n,"utf8").match(/^version:\s*(.+)$/m),j=x?x[1].trim():"unknown",R=Fn.valid(j)&&Fn.valid(e)?Fn.lt(j,e):j!==e;console.log(R?" "+Ro(`Upgrading ${X.dim("v"+j)} \u2192 ${X.green("v"+e)} (config + state + .planning preserved)`):" "+Ro(`Refreshing v${j} (config + state + .planning preserved)`)),t.force||console.log(Y(" Pass --force to also sweep orphaned files from the previous version."))}if(!y.existsSync($e))return console.error(`\u2716 Source tree not found at ${$e}. Running from wrong dir?`),1;t.ides=t.ides.map(x=>x==="claude-code"?"claude":x);let s=t.ides.filter(x=>!os.includes(x));if(s.length>0)return console.error(`\u2716 --ide ${s.join(", ")} is not supported in v${We()}.`),console.error(""),console.error(" Currently supported:"),console.error(" claude \u2014 Claude Code native (recommended)"),console.error(" cursor \u2014 Cursor IDE"),console.error(" codex \u2014 Codex CLI"),console.error(" gemini \u2014 Gemini CLI (planned \u2014 not yet implemented)"),console.error(" vscode \u2014 VS Code (with Claude Code / Continue / Copilot extension)"),console.error(" windsurf \u2014 Windsurf (Codeium)"),console.error(" antigravity \u2014 Antigravity (experimental)"),console.error(" grok \u2014 Grok Build (xAI CLI, Claude-Code-compatible)"),console.error(""),console.error(" Tracked for future:"),console.error(" jetbrains \u2014 IntelliJ / PyCharm"),console.error(" zed \u2014 Zed editor"),console.error(""),1;if(t.ides.includes("vscode")&&console.log(" "+Y("VS Code \u2192 installing to .claude/ paths (read by Claude Code / Continue / Copilot extensions).")),t.ides.includes("codex")&&(console.log(" "+Y("Codex \u2192 installing to .claude/ paths + AGENTS.md. Use `rcode workflow show <name>` to feed workflows to Codex.")),t.global||console.log(" "+_t("Codex /rcode-* slash commands need a GLOBAL install \u2014 re-run with `--global` to wire the ~/.codex/hooks.json router. This project-local install does NOT enable them."))),t.ides.includes("gemini")&&(console.log(`
226
+ `)}function Oo(t){return(t||"").replace(/[\n\r]/g," ").replace(/"/g,'\\"')}function Z$(t){return["# rcode v2 project config","# Generated by install. Safe to edit.",`user_name: "${Oo(t.userName)}"`,`project_name: "${Oo(t.projectName)}"`,`communication_language: "${Oo(t.language)}"`,`mode: "${Oo(t.mode)}"`,'model_profile: "balanced"',`commit_planning: ${t.commitPlanning!==!1}`,"workflow:"," research_by_default: false"," plan_checker: true"," post_execute_gates: true"," ui_safety_gate: true","git:",' branching_strategy: "none"',""].join(`
227
+ `)}function U$(t){let e=k$.safeParse(t);return e.success?{valid:!0}:{valid:!1,errors:e.error.issues.map(n=>` ${n.path.join(".")||"(root)"}: ${n.message}`)}}function V$(t){let e={},r=null;for(let n of t.split(`
228
+ `)){let s=n.replace(/#.*$/,"");if(!s.trim())continue;let i=s.match(/^(\s*)/)[1].length;if(i===0){let o=s.indexOf(":");if(o===-1)continue;let a=s.slice(0,o).trim(),u=s.slice(o+1).trim();if(u===""){r=a,e[a]={};continue}r=null,u.startsWith('"')&&u.endsWith('"')&&(u=u.slice(1,-1)),u.startsWith("'")&&u.endsWith("'")&&(u=u.slice(1,-1)),u==="true"?u=!0:u==="false"&&(u=!1),e[a]=u}else if(r&&i>0){let o=s.indexOf(":");if(o===-1)continue;let a=s.slice(0,o).trim(),u=s.slice(o+1).trim();u.startsWith('"')&&u.endsWith('"')&&(u=u.slice(1,-1)),u==="true"?u=!0:u==="false"&&(u=!1),e[r][a]=u}}return e}async function Qu(t){if(t.help)return Dg(),0;if(t.reset&&!t.force)return console.log(""),console.log(" "+St("--reset has no effect without --force.")),console.log(" "+Y(" --reset wipes config.yaml and state.json. To prevent accidental data loss,")),console.log(" "+Y(" it must be paired with --force. Re-run as:")),console.log(" "+Y(" rcode install --reset --force")),console.log(""),2;let e=()=>{};if(!t.global){let r=G$(t.target);if(!r.ok)return console.log(""),console.log(" "+St(`Another install is already running here (PID ${r.pid}).`)),console.log(" "+Y(` Lock: ${r.lockPath}`)),console.log(" "+Y(" If the other process crashed, delete the lock file and retry:")),console.log(" "+Y(` rm ${r.lockPath}`)),console.log(""),3;e=r.release,process.on("exit",e)}try{return await z$(t)}finally{e(),process.removeListener("exit",e)}}function G$(t){let e=p.join(t,".rcode"),r=p.join(e,".install.lock");try{D.mkdirSync(e,{recursive:!0})}catch{}function n(s){try{return process.kill(s,0),!0}catch{return!1}}for(let s=0;s<2;s++)try{let i=D.openSync(r,"wx");return D.writeSync(i,String(process.pid)),D.closeSync(i),{ok:!0,release:()=>{try{D.unlinkSync(r)}catch(o){console.error("[install] acquireInstallLock: failed to release lock",r+":",o?.message||o)}}}}catch(i){if(i.code!=="EEXIST")throw i;let o=0;try{o=parseInt(D.readFileSync(r,"utf8"),10)}catch(a){console.error("[install] acquireInstallLock: failed to read lock pid from",r+":",a?.message||a)}if(o&&!n(o)){try{D.unlinkSync(r)}catch{}continue}return{ok:!1,pid:o,lockPath:r}}return{ok:!1,pid:0,lockPath:r}}function ec(t){let e=Xe(),r=p.join(e,".rcode","slash-commands"),n=p.join(e,".rcode","bin");Tt(r),Tt(n);let s=p.join($e,"commands"),i=0;for(let u of D.readdirSync(s))u.endsWith(".md")&&(D.copyFileSync(p.join(s,u),p.join(r,u)),i++);let o=p.join(lt,"cli","rcode-slash-router.cjs"),a=p.join(n,"rcode-slash-router.cjs");return D.copyFileSync(o,a),t&&t.global!=="silent"&&console.log(" "+ir(`Slash-router: ${i} command bodies \u2192 ~/.rcode/slash-commands/ + router \u2192 ~/.rcode/bin/`)),a}function bg(){return`node "${p.join(Xe(),".rcode","bin","rcode-slash-router.cjs")}"`}function Sg(t,e,r,n){let s={};if(D.existsSync(t))try{s=JSON.parse(D.readFileSync(t,"utf8"))||{}}catch{return console.log(" "+St(`${n}: ${t} is not valid JSON \u2014 skipped slash-router wiring.`)),!1}return(!s.hooks||typeof s.hooks!="object")&&(s.hooks={}),Array.isArray(s.hooks[e])||(s.hooks[e]=[]),s.hooks[e].some(o=>Array.isArray(o?.hooks)&&o.hooks.some(a=>typeof a?.command=="string"&&a.command.includes("rcode-slash-router.cjs")))?(console.log(" "+ir(`${n}: slash-router hook already present (idempotent).`)),!1):(s.hooks[e].push({hooks:[{type:"command",command:r,timeout:10}]}),Tt(p.dirname(t)),D.writeFileSync(t,JSON.stringify(s,null,2)+`
229
+ `),console.log(" "+ir(`${n}: wired slash-router into ${e} hook (existing hooks preserved).`)),!0)}function Eg(t){ec(t);let e=p.join(Xe(),".codex","hooks.json");Sg(e,"UserPromptSubmit",bg(),"Codex")}function Cg(t){ec(t);let e=p.join(Xe(),".gemini","antigravity","settings.json");Sg(e,"UserPrompt",bg(),"Antigravity")}function zu(t){if(!t||!t.global)return;let e=Array.isArray(t.ides)?t.ides:[t.ide].filter(Boolean);for(let r of e)switch(r){case"codex":Eg(t);break;case"antigravity":Cg(t);break;default:break}}async function z$(t){let e=Ze();process.stdin.isTTY&&!t.yes&&A$(e),t.ides=await F$(t),t.commitPlanning=await j$(t),t.enableHooks=await I$(t),console.log(`
230
+ \u{1F54C} ${It("rcode")} ${J.cyan("v"+e)} ${Y("\u2192")} ${t.target}`);let n=p.join(t.target,".rcode","_config","manifest.yaml");if(D.existsSync(n)){let $=D.readFileSync(n,"utf8").match(/^version:\s*(.+)$/m),R=$?$[1].trim():"unknown",j=Fn.valid(R)&&Fn.valid(e)?Fn.lt(R,e):R!==e;console.log(j?" "+Po(`Upgrading ${J.dim("v"+R)} \u2192 ${J.green("v"+e)} (config + state + .planning preserved)`):" "+Po(`Refreshing v${R} (config + state + .planning preserved)`)),t.force||console.log(Y(" Pass --force to also sweep orphaned files from the previous version."))}if(!D.existsSync($e))return console.error(`\u2716 Source tree not found at ${$e}. Running from wrong dir?`),1;t.ides=t.ides.map($=>$==="claude-code"?"claude":$);let s=t.ides.filter($=>!os.includes($));if(s.length>0)return console.error(`\u2716 --ide ${s.join(", ")} is not supported in v${Ze()}.`),console.error(""),console.error(" Currently supported:"),console.error(" claude \u2014 Claude Code native (recommended)"),console.error(" cursor \u2014 Cursor IDE"),console.error(" codex \u2014 Codex CLI"),console.error(" gemini \u2014 Gemini CLI (planned \u2014 not yet implemented)"),console.error(" vscode \u2014 VS Code (with Claude Code / Continue / Copilot extension)"),console.error(" windsurf \u2014 Windsurf (Codeium)"),console.error(" antigravity \u2014 Antigravity (experimental)"),console.error(" grok \u2014 Grok Build (xAI CLI, Claude-Code-compatible)"),console.error(""),console.error(" Tracked for future:"),console.error(" jetbrains \u2014 IntelliJ / PyCharm"),console.error(" zed \u2014 Zed editor"),console.error(""),1;if(t.ides.includes("vscode")&&console.log(" "+Y("VS Code \u2192 installing to .claude/ paths (read by Claude Code / Continue / Copilot extensions).")),t.ides.includes("codex")&&(console.log(" "+Y("Codex \u2192 installing to .claude/ paths + AGENTS.md. Use `rcode workflow show <name>` to feed workflows to Codex.")),t.global||console.log(" "+St("Codex /rcode-* slash commands need a GLOBAL install \u2014 re-run with `--global` to wire the ~/.codex/hooks.json router. This project-local install does NOT enable them."))),t.ides.includes("gemini")&&(console.log(`
228
231
  \u26A0\uFE0F Gemini CLI install not yet implemented
229
232
  `),console.log("Gemini IDE requires aggregating all agents and commands into a single GEMINI.md file."),console.log(`This feature is planned but not yet available.
230
233
  `),console.log(`For now, use: --ide claude or --ide cursor
231
- `),t.ides=t.ides.filter(x=>x!=="gemini"),t.ides.length===0))return 1;if(t.ides.includes("antigravity")&&(t.global?(console.log(" "+_t("Antigravity install is experimental. Files land at .antigravity/rcode/{agents,commands}/.")),console.log(" "+Y("If Antigravity expects a different path, adjust .rcode/config.yaml and re-run."))):console.log(" "+_t("Antigravity /rcode-* slash commands need a GLOBAL install \u2014 re-run with `--global`. Skipping .antigravity/ files on this project-local install (they would be inert)."))),t.modules.length>0){let x=vg(),j=t.modules.filter(R=>!x.includes(R));if(j.length>0)return console.error(`\u2716 Unknown module(s): ${j.join(", ")}`),console.error(` Available modules: ${x.join(", ")}`),1}if(Array.isArray(t.ides)&&t.ides.includes("vscode")||t.ide==="vscode"){let x=yg(t.target);x.moved>0&&console.log(` \u21BB Migrated ${x.moved} legacy vscode-layout command(s) to .claude/commands/rcode-{name}.md`)}let i=!t.global&&Array.isArray(t.ides)?t.ides.filter(x=>x!=="antigravity"):t.ides,o=Ju(i,t.target),a=Ok(o,t.modules);if(a.length===0)return Array.isArray(t.ides)&&t.ides.includes("antigravity")&&!t.global?(console.error("\u2716 Nothing to install \u2014 Antigravity was the only target IDE, and its files need a GLOBAL install."),console.error(" Re-run with --global, or pick another --ide."),1):(console.error("\u2716 Nothing to install \u2014 install plan is empty."),t.modules.length>0&&console.error(` Modules requested: ${t.modules.join(", ")}`),1);if(t.modules.length>0&&console.log(` Modules: ${t.modules.join(", ")}`),t.dryRun||t.listFiles){console.log("DRY RUN: the following paths would be written:");for(let x of a)console.log(" + "+x.rel);return 0}if(t.forceOverwrite&&!t.noBackup){let x=$k(t.target,a);if(x.ok)console.log(" "+Ro(`${X.dim("--force-overwrite")} backup: ${X.cyan(x.path)} ${X.dim("("+x.fileCount+" files \u2014 restore with: tar -xzf "+x.path+")")}`));else if(x.fileCount>0)return console.error(""),console.error(`\u2716 Could not create backup: ${x.warning}`),console.error(" Refusing to --force-overwrite without a backup. Pass --no-backup to override."),console.error(""),1}let u=0;t.force&&(u=Bk(t.target,a));let c=new Map;if(t.nonDestructive){let x=p.join(t.target,".rcode","_config","files-manifest.csv");if(y.existsSync(x))try{let j=y.readFileSync(x,"utf8").split(`
232
- `).slice(1).filter(Boolean);for(let R of j){let[N,ee]=R.split(",");N&&ee&&c.set(N,ee)}}catch{}}let l=0,d=0,f=0,g=0,m=[],D=[],h=[],w=Sk(Y(`Installing ${a.length} files\u2026`),{color:"cyan"}).start();for(let x of a){let j=p.join(t.target,x.rel),R=x.rel.split(p.sep).join("/");jt(p.dirname(j));let N=null,ee=null,de=()=>(N||(N=y.readFileSync(j)),N),St=()=>(ee||(ee=y.readFileSync(x.src)),ee);if(t.nonDestructive&&!t.forceOverwrite&&!t.acceptAll&&y.existsSync(j)){let Ot=c.get(R);if(Ot){let ur=de().toString("utf8");if(jn(de())!==Ot){let Xt=St().toString("utf8"),jc=dg(R,R,ur,Xt,"installed","source"),Ic=0,Tc=0;for(let Es of jc.split(`
233
- `))Es.startsWith("+")&&!Es.startsWith("+++")&&Ic++,Es.startsWith("-")&&!Es.startsWith("---")&&Tc++;f+=1,m.push(R),D.push({rel:R,insertions:Ic,deletions:Tc,patch:jc}),d+=1;continue}}}if(y.existsSync(j)&&!t.force&&!t.forceOverwrite){let Ot=jn(de()),ur=jn(St());if(Ot===ur){d++;continue}if(!t.yes&&!t.nonDestructive){h.push({rel:R,src:x.src,destPath:j,existingContent:de().toString("utf8"),sourceContent:St().toString("utf8")}),d++;continue}}if(y.existsSync(j)&&t.forceOverwrite){let Ot=de(),ur=St();Ot.equals(ur)||w.update({text:Y(`overwriting ${x.rel}`)})}let Pt=St().toString("utf8");x.cursor&&(Pt=Pt),y.writeFileSync(j,Pt,"utf8"),x.executable&&y.chmodSync(j,493),l++}if(w.success({text:or(`${l} files installed`)}),h.length>0){let x={workflows:[],agents:[],commands:[],skills:[],references:[],other:[]};for(let j of h)j.rel.includes("/workflows/")?x.workflows.push(j):j.rel.includes("/agents/")?x.agents.push(j):j.rel.includes("/commands/")?x.commands.push(j):j.rel.includes("/skills/")?x.skills.push(j):j.rel.includes("/references/")?x.references.push(j):x.other.push(j);console.log(""),console.log(" "+_t(`${h.length} file${h.length===1?"":"s"} have local edits AND v${We()} updates:`));for(let[j,R]of Object.entries(x))R.length!==0&&console.log(" "+Y(`${R.length} ${j}`));if(console.log(""),!t.yes&&process.stdin.isTTY){let j=await nt.select({message:"How should we handle these?",initialValue:"review",options:[{value:"review",label:"Review each one",hint:"see the diff, decide per file"},{value:"upstream",label:"Take v"+We()+" for all",hint:"lose local edits, get all bug fixes"},{value:"keep",label:"Keep my local edits",hint:"skip v"+We()+" updates for these files (current behaviour)"}]});if(nt.isCancel(j))nt.note("Skipped \u2014 local edits preserved.");else if(j==="upstream"){let R=0;for(let N of h)y.writeFileSync(N.destPath,N.sourceContent,"utf8"),R++;g+=R,console.log(" "+or(`Applied v${We()} to ${R} file${R===1?"":"s"}.`))}else if(j==="review"){let R=0,N=0;for(let ee of h){let de=dg(ee.rel,ee.rel,ee.existingContent,ee.sourceContent,"local","v"+We()),St=0,Pt=0;for(let cr of de.split(`
234
- `))cr.startsWith("+")&&!cr.startsWith("+++")&&St++,cr.startsWith("-")&&!cr.startsWith("---")&&Pt++;console.log(""),console.log(" "+X.bold(ee.rel)+Y(" ")+X.green(`+${St}`)+" "+X.red(`-${Pt}`));let Ot=await nt.select({message:"Take upstream, keep local, or view diff?",initialValue:"view",options:[{value:"upstream",label:"Take v"+We()},{value:"keep",label:"Keep local"},{value:"view",label:"View diff first"}]}),ur=Ot;if(nt.isCancel(Ot)||Ot==="view"){for(let Xt of de.split(`
235
- `).slice(4))Xt.startsWith("+")?process.stdout.write(X.green(Xt)+`
236
- `):Xt.startsWith("-")?process.stdout.write(X.red(Xt)+`
237
- `):Xt.startsWith("@")?process.stdout.write(X.cyan(Xt)+`
234
+ `),t.ides=t.ides.filter($=>$!=="gemini"),t.ides.length===0))return 1;if(t.ides.includes("antigravity")&&(t.global?(console.log(" "+St("Antigravity install is experimental. Files land at .antigravity/rcode/{agents,commands}/.")),console.log(" "+Y("If Antigravity expects a different path, adjust .rcode/config.yaml and re-run."))):console.log(" "+St("Antigravity /rcode-* slash commands need a GLOBAL install \u2014 re-run with `--global`. Skipping .antigravity/ files on this project-local install (they would be inert)."))),t.modules.length>0){let $=_g(),R=t.modules.filter(j=>!$.includes(j));if(R.length>0)return console.error(`\u2716 Unknown module(s): ${R.join(", ")}`),console.error(` Available modules: ${$.join(", ")}`),1}if(Array.isArray(t.ides)&&t.ides.includes("vscode")||t.ide==="vscode"){let $=vg(t.target);$.moved>0&&console.log(` \u21BB Migrated ${$.moved} legacy vscode-layout command(s) to .claude/commands/rcode-{name}.md`)}let i=!t.global&&Array.isArray(t.ides)?t.ides.filter($=>$!=="antigravity"):t.ides,o=Ku(i,t.target),a=B$(o,t.modules);if(a.length===0)return Array.isArray(t.ides)&&t.ides.includes("antigravity")&&!t.global?(console.error("\u2716 Nothing to install \u2014 Antigravity was the only target IDE, and its files need a GLOBAL install."),console.error(" Re-run with --global, or pick another --ide."),1):(console.error("\u2716 Nothing to install \u2014 install plan is empty."),t.modules.length>0&&console.error(` Modules requested: ${t.modules.join(", ")}`),1);if(t.modules.length>0&&console.log(` Modules: ${t.modules.join(", ")}`),t.dryRun||t.listFiles){console.log("DRY RUN: the following paths would be written:");for(let $ of a)console.log(" + "+$.rel);return 0}if(t.forceOverwrite&&!t.noBackup){let $=$$(t.target,a);if($.ok)console.log(" "+Po(`${J.dim("--force-overwrite")} backup: ${J.cyan($.path)} ${J.dim("("+$.fileCount+" files \u2014 restore with: tar -xzf "+$.path+")")}`));else if($.fileCount>0)return console.error(""),console.error(`\u2716 Could not create backup: ${$.warning}`),console.error(" Refusing to --force-overwrite without a backup. Pass --no-backup to override."),console.error(""),1}let u=0;t.force&&(u=W$(t.target,a));let c=new Map;if(t.nonDestructive){let $=p.join(t.target,".rcode","_config","files-manifest.csv");if(D.existsSync($))try{let R=D.readFileSync($,"utf8").split(`
235
+ `).slice(1).filter(Boolean);for(let j of R){let[z,ee]=j.split(",");z&&ee&&c.set(z,ee)}}catch{}}let l=0,d=0,f=0,g=0,m=[],y=[],h=[],w=C$(Y(`Installing ${a.length} files\u2026`),{color:"cyan"}).start();for(let $ of a){let R=p.join(t.target,$.rel),j=$.rel.split(p.sep).join("/");Tt(p.dirname(R));let z=null,ee=null,xe=()=>(z||(z=D.readFileSync(R)),z),wt=()=>(ee||(ee=D.readFileSync($.src)),ee);if(t.nonDestructive&&!t.forceOverwrite&&!t.acceptAll&&D.existsSync(R)){let Nt=c.get(j);if(Nt){let cr=xe().toString("utf8");if(jn(xe())!==Nt){let Xt=wt().toString("utf8"),Ic=fg(j,j,cr,Xt,"installed","source"),Tc=0,Rc=0;for(let Ss of Ic.split(`
236
+ `))Ss.startsWith("+")&&!Ss.startsWith("+++")&&Tc++,Ss.startsWith("-")&&!Ss.startsWith("---")&&Rc++;f+=1,m.push(j),y.push({rel:j,insertions:Tc,deletions:Rc,patch:Ic}),d+=1;continue}}}if(D.existsSync(R)&&!t.force&&!t.forceOverwrite){let Nt=jn(xe()),cr=jn(wt());if(Nt===cr){d++;continue}if(!t.yes&&!t.nonDestructive){h.push({rel:j,src:$.src,destPath:R,existingContent:xe().toString("utf8"),sourceContent:wt().toString("utf8")}),d++;continue}}if(D.existsSync(R)&&t.forceOverwrite){let Nt=xe(),cr=wt();Nt.equals(cr)||w.update({text:Y(`overwriting ${$.rel}`)})}let Ot=wt().toString("utf8");$.cursor&&(Ot=Ot),D.writeFileSync(R,Ot,"utf8"),$.executable&&D.chmodSync(R,493),l++}if(w.success({text:ir(`${l} files installed`)}),h.length>0){let $={workflows:[],agents:[],commands:[],skills:[],references:[],other:[]};for(let R of h)R.rel.includes("/workflows/")?$.workflows.push(R):R.rel.includes("/agents/")?$.agents.push(R):R.rel.includes("/commands/")?$.commands.push(R):R.rel.includes("/skills/")?$.skills.push(R):R.rel.includes("/references/")?$.references.push(R):$.other.push(R);console.log(""),console.log(" "+St(`${h.length} file${h.length===1?"":"s"} have local edits AND v${Ze()} updates:`));for(let[R,j]of Object.entries($))j.length!==0&&console.log(" "+Y(`${j.length} ${R}`));if(console.log(""),!t.yes&&process.stdin.isTTY){let R=await Re.select({message:"How should we handle these?",initialValue:"review",options:[{value:"review",label:"Review each one",hint:"see the diff, decide per file"},{value:"upstream",label:"Take v"+Ze()+" for all",hint:"lose local edits, get all bug fixes"},{value:"keep",label:"Keep my local edits",hint:"skip v"+Ze()+" updates for these files (current behaviour)"}]});if(Re.isCancel(R))Re.note("Skipped \u2014 local edits preserved.");else if(R==="upstream"){let j=0;for(let z of h)D.writeFileSync(z.destPath,z.sourceContent,"utf8"),j++;g+=j,console.log(" "+ir(`Applied v${Ze()} to ${j} file${j===1?"":"s"}.`))}else if(R==="review"){let j=0,z=0;for(let ee of h){let xe=fg(ee.rel,ee.rel,ee.existingContent,ee.sourceContent,"local","v"+Ze()),wt=0,Ot=0;for(let lr of xe.split(`
237
+ `))lr.startsWith("+")&&!lr.startsWith("+++")&&wt++,lr.startsWith("-")&&!lr.startsWith("---")&&Ot++;console.log(""),console.log(" "+J.bold(ee.rel)+Y(" ")+J.green(`+${wt}`)+" "+J.red(`-${Ot}`));let Nt=await Re.select({message:"Take upstream, keep local, or view diff?",initialValue:"view",options:[{value:"upstream",label:"Take v"+Ze()},{value:"keep",label:"Keep local"},{value:"view",label:"View diff first"}]}),cr=Nt;if(Re.isCancel(Nt)||Nt==="view"){for(let Xt of xe.split(`
238
+ `).slice(4))Xt.startsWith("+")?process.stdout.write(J.green(Xt)+`
239
+ `):Xt.startsWith("-")?process.stdout.write(J.red(Xt)+`
240
+ `):Xt.startsWith("@")?process.stdout.write(J.cyan(Xt)+`
238
241
  `):process.stdout.write(Y(Xt)+`
239
- `);let cr=await nt.select({message:"Now: take upstream or keep local?",initialValue:"keep",options:[{value:"upstream",label:"Take v"+We()},{value:"keep",label:"Keep local"}]});ur=nt.isCancel(cr)?"keep":cr}ur==="upstream"?(y.writeFileSync(ee.destPath,ee.sourceContent,"utf8"),R++):N++}g+=R,console.log(" "+or(`Review complete: ${R} applied, ${N} kept local.`))}else console.log(" "+Y(`${h.length} file${h.length===1?"":"s"} kept local. Re-run with --force-overwrite or 'rcode update' anytime.`))}else console.log(" "+Y(`Re-run with --force-overwrite to apply v${We()} updates, or pipe through an interactive shell to resolve per-file.`));console.log("")}if(g>0&&(console.log(" "+or(`Total this run: ${l} installed \xB7 ${g} updated \xB7 ${f+d} unchanged.`)),console.log("")),t.global){let x=p.join(t.target,".rcode","_config");jt(x),y.writeFileSync(p.join(x,"manifest.yaml"),mg(t));let R=pg(Et,t.target).count;try{let{main:N}=require(p.join(Et,"cli","generate-command-skills.cjs")),ee=p.join(t.target,".claude","skills"),de=N(Et,ee,We(),{skipGlobalDuplicates:!0});R+=de.generated}catch{}console.log(""),console.log(` ${Y(`${R} skills installed globally`)}`);try{Gu(t)}catch(N){process.stderr.write(X.yellow(`WARNING: native slash-command install skipped: ${N?.message||N}`)+`
240
- `)}return 0}let C=p.join(Ye(),".claude","commands"),A=p.join(t.target,".claude","commands"),T=t.target!==Ye()&&!t.localOnly;if(T&&!t.forceOverwrite)try{let x=y.existsSync(C)&&(y.readdirSync(C).some(R=>R.startsWith("rcode-")&&R.endsWith(".md"))||y.existsSync(p.join(C,"rcode"))),j=y.existsSync(A)&&(y.readdirSync(A).some(R=>R.startsWith("rcode-")&&R.endsWith(".md"))||y.existsSync(p.join(A,"rcode")));if(x&&!j){let R=a.length,N=a.filter(ee=>!ee.rel.split(p.sep).join("/").startsWith(".claude/commands/"));N.length<R&&(a.length=0,N.forEach(ee=>a.push(ee)),console.log(" "+Y("Global rcode commands detected in ~/.claude/ \u2014 skipping project-level command install to avoid duplicates.")),console.log(" "+Y("Use --force-overwrite to install locally anyway.")))}else if(x&&j){try{let N=y.readdirSync(A).filter(de=>de.startsWith("rcode-")&&de.endsWith(".md"));for(let de of N)y.unlinkSync(p.join(A,de));let ee=p.join(A,"rcode");y.existsSync(ee)&&zu(ee,t.target),console.log(" "+Y("Removed duplicate project-level rcode commands (global ones in ~/.claude/ take precedence)."))}catch{}let R=a.filter(N=>!N.rel.split(p.sep).join("/").startsWith(".claude/commands/"));a.length=0,R.forEach(N=>a.push(N))}}catch{}let G=p.join(t.target,".rcode","_config");jt(G),jt(p.join(t.target,".planning")),y.writeFileSync(p.join(G,"manifest.yaml"),mg(t)),y.writeFileSync(p.join(G,"agent-manifest.csv"),Nk(a,t.target));let I=p.join(t.target,".rcode","config.yaml"),Z=p.join(t.target,".rcode","state.json"),F=!1;if(t.reset&&t.force?(y.existsSync(I)&&y.unlinkSync(I),y.existsSync(Z)&&y.unlinkSync(Z)):t.force&&(y.existsSync(I)||y.existsSync(Z))&&(F=!0),!y.existsSync(I))It(I,qk(t));else try{let x=y.readFileSync(I,"utf8"),j=t.commitPlanning!==!1,R=/^commit_planning:\s*(true|false)\s*$/m,N=x.match(R),ee=N?N[1]==="true":null;if(N&&ee!==j){let de=x.replace(R,`commit_planning: ${j}`);It(I,de),console.log(" "+Y(`Updated commit_planning in config.yaml (${ee} \u2192 ${j}) \u2014 closes #685.`))}else if(!N){let de=x.replace(/\n*$/,"")+`
241
- commit_planning: ${j}
242
- `;It(I,de)}}catch{}try{let x=y.readFileSync(I,"utf8"),j=Hk(x),R=Wk(j);if(!R.valid){console.log(""),console.log(" "+_t("config.yaml has validation errors:"));for(let N of R.errors)console.log(X.yellow(N));console.log(Y(" \u2192 Edit .rcode/config.yaml to fix, then run /rcode-status"))}}catch{}if(!y.existsSync(Z)){let x=p.join($e,"state.json");if(y.existsSync(x)){let j=new Date().toISOString(),R=JSON.stringify(String(t.projectName||p.basename(t.target))).slice(1,-1),N=y.readFileSync(x,"utf8").replace(/__PROJECT_NAME__/g,R).replace(/__INSTALL_DATE__/g,j),ee=p.join(t.target,".planning","ROADMAP.md");if(y.existsSync(ee))try{y.readFileSync(ee,"utf8").includes("<!-- INSTALL STUB")||(N=N.replace(/^\s*"_seeded_stub":\s*true,?\s*\n/m,""))}catch{}jt(p.dirname(Z)),It(Z,N)}}jt(p.join(t.target,".planning","council-sessions"));let W=p.join(t.target,".rcode","context");jt(W);let P=p.join(W,"active.md"),E=p.join(W,"project-brief.md");y.existsSync(P)||y.writeFileSync(P,`# Active Context
242
+ `);let lr=await Re.select({message:"Now: take upstream or keep local?",initialValue:"keep",options:[{value:"upstream",label:"Take v"+Ze()},{value:"keep",label:"Keep local"}]});cr=Re.isCancel(lr)?"keep":lr}cr==="upstream"?(D.writeFileSync(ee.destPath,ee.sourceContent,"utf8"),j++):z++}g+=j,console.log(" "+ir(`Review complete: ${j} applied, ${z} kept local.`))}else console.log(" "+Y(`${h.length} file${h.length===1?"":"s"} kept local. Re-run with --force-overwrite or 'rcode update' anytime.`))}else console.log(" "+Y(`Re-run with --force-overwrite to apply v${Ze()} updates, or pipe through an interactive shell to resolve per-file.`));console.log("")}if(g>0&&(console.log(" "+ir(`Total this run: ${l} installed \xB7 ${g} updated \xB7 ${f+d} unchanged.`)),console.log("")),t.global){let $=p.join(t.target,".rcode","_config");Tt($),D.writeFileSync(p.join($,"manifest.yaml"),gg(t));let j=mg(lt,t.target).count;try{let{main:z}=require(p.join(lt,"cli","generate-command-skills.cjs")),ee=p.join(t.target,".claude","skills"),xe=z(lt,ee,Ze(),{skipGlobalDuplicates:!0});j+=xe.generated}catch{}console.log(""),console.log(` ${Y(`${j} skills installed globally`)}`);try{zu(t)}catch(z){process.stderr.write(J.yellow(`WARNING: native slash-command install skipped: ${z?.message||z}`)+`
243
+ `)}return 0}let C=p.join(Xe(),".claude","commands"),A=p.join(t.target,".claude","commands"),T=t.target!==Xe()&&!t.localOnly;if(T&&!t.forceOverwrite)try{let $=D.existsSync(C)&&(D.readdirSync(C).some(j=>j.startsWith("rcode-")&&j.endsWith(".md"))||D.existsSync(p.join(C,"rcode"))),R=D.existsSync(A)&&(D.readdirSync(A).some(j=>j.startsWith("rcode-")&&j.endsWith(".md"))||D.existsSync(p.join(A,"rcode")));if($&&!R){let j=a.length,z=a.filter(ee=>!ee.rel.split(p.sep).join("/").startsWith(".claude/commands/"));z.length<j&&(a.length=0,z.forEach(ee=>a.push(ee)),console.log(" "+Y("Global rcode commands detected in ~/.claude/ \u2014 skipping project-level command install to avoid duplicates.")),console.log(" "+Y("Use --force-overwrite to install locally anyway.")))}else if($&&R){try{let z=D.readdirSync(A).filter(xe=>xe.startsWith("rcode-")&&xe.endsWith(".md"));for(let xe of z)D.unlinkSync(p.join(A,xe));let ee=p.join(A,"rcode");D.existsSync(ee)&&Yu(ee,t.target),console.log(" "+Y("Removed duplicate project-level rcode commands (global ones in ~/.claude/ take precedence)."))}catch{}let j=a.filter(z=>!z.rel.split(p.sep).join("/").startsWith(".claude/commands/"));a.length=0,j.forEach(z=>a.push(z))}}catch{}let V=p.join(t.target,".rcode","_config");Tt(V),Tt(p.join(t.target,".planning")),D.writeFileSync(p.join(V,"manifest.yaml"),gg(t)),D.writeFileSync(p.join(V,"agent-manifest.csv"),M$(a,t.target));let I=p.join(t.target,".rcode","config.yaml"),H=p.join(t.target,".rcode","state.json"),F=!1;if(t.reset&&t.force?(D.existsSync(I)&&D.unlinkSync(I),D.existsSync(H)&&D.unlinkSync(H)):t.force&&(D.existsSync(I)||D.existsSync(H))&&(F=!0),!D.existsSync(I))Et(I,Z$(t));else try{let $=D.readFileSync(I,"utf8"),R=t.commitPlanning!==!1,j=/^commit_planning:\s*(true|false)\s*$/m,z=$.match(j),ee=z?z[1]==="true":null;if(z&&ee!==R){let xe=$.replace(j,`commit_planning: ${R}`);Et(I,xe),console.log(" "+Y(`Updated commit_planning in config.yaml (${ee} \u2192 ${R}) \u2014 closes #685.`))}else if(!z){let xe=$.replace(/\n*$/,"")+`
244
+ commit_planning: ${R}
245
+ `;Et(I,xe)}}catch{}try{let $=D.readFileSync(I,"utf8"),R=V$($),j=U$(R);if(!j.valid){console.log(""),console.log(" "+St("config.yaml has validation errors:"));for(let z of j.errors)console.log(J.yellow(z));console.log(Y(" \u2192 Edit .rcode/config.yaml to fix, then run /rcode-status"))}}catch{}if(!D.existsSync(H)){let $=p.join($e,"state.json");if(D.existsSync($)){let R=new Date().toISOString(),j=JSON.stringify(String(t.projectName||p.basename(t.target))).slice(1,-1),z=D.readFileSync($,"utf8").replace(/__PROJECT_NAME__/g,j).replace(/__INSTALL_DATE__/g,R),ee=p.join(t.target,".planning","ROADMAP.md");if(D.existsSync(ee))try{D.readFileSync(ee,"utf8").includes("<!-- INSTALL STUB")||(z=z.replace(/^\s*"_seeded_stub":\s*true,?\s*\n/m,""))}catch{}Tt(p.dirname(H)),Et(H,z)}}Tt(p.join(t.target,".planning","council-sessions"));let q=p.join(t.target,".rcode","context");Tt(q);let P=p.join(q,"active.md"),b=p.join(q,"project-brief.md");D.existsSync(P)||D.writeFileSync(P,`# Active Context
243
246
 
244
247
  _Run \`/rcode-init\` inside your AI editor to populate this file._
245
- `),y.existsSync(E)||y.writeFileSync(E,`# Project Brief
248
+ `),D.existsSync(b)||D.writeFileSync(b,`# Project Brief
246
249
 
247
250
  _Run \`/rcode-init\` inside your AI editor to populate this file._
248
- `);let Q=p.join(Ye(),".rcode","agents");jt(Q);let re=pg(Et,t.target,{skipGlobalDuplicates:T}),le=re.count;re.skippedGlobal>0&&(console.log(" "+Y(`Skipped ${re.skippedGlobal} project-level rcode skills (global ones in ~/.claude/skills/ take precedence) \u2014 closes #679.`)),console.log(" "+Y(" \u21B3 This project now depends on your GLOBAL rcode install for those skills.")),console.log(" "+Y(" For a self-contained project (e.g. for collaborators/CI), reinstall with --local-only.")));try{let{main:x}=require(p.join(Et,"cli","generate-command-skills.cjs")),j=p.join(t.target,".claude","skills"),R=x(Et,j,We(),{skipGlobalDuplicates:T});R.generated>0&&(console.log(" "+Y(`${R.generated} sidebar skill stub${R.generated===1?"":"s"} generated for command discoverability`)),le+=R.generated),R.skippedGlobal>0&&console.log(" "+Y(`Skipped ${R.skippedGlobal} sidebar stub${R.skippedGlobal===1?"":"s"} that duplicate global ~/.claude/skills/ \u2014 closes #679.`))}catch(x){console.log(" "+Y(`(sidebar stub generation skipped: ${x.message})`))}y.writeFileSync(p.join(G,"files-manifest.csv"),Lk(a,t.target,{mergeExistingManifest:!t.force,extraScanDirs:[p.join(t.target,".claude","skills"),p.join(t.target,".rcode","skills")]}));let $=jk(t.target,t.projectName);Rk(Et,t.target);let k=Ik(t.target,{commitPlanning:t.commitPlanning}),he=Tk(t.target,{gitHooks:t.gitHooks}),J=null,xe=!1;try{let{spawn:x}=require("child_process"),j=p.join(t.target,".rcode","bin","rcode-tools.cjs");y.existsSync(j)&&(x("node",[j,"brain","pull"],{cwd:t.target,stdio:"ignore",detached:!0}).unref(),xe=!0)}catch(x){J={ok:!1,error:String(x.message||x).slice(0,200)}}if(console.log(""),t.force&&u>0&&console.log(" "+Ro(`${u} stale files swept`)),t.force&&F&&console.log(" "+_t("config.yaml and state.json preserved (pass --reset to wipe)")),xe?console.log(" "+Y("Brain: pulling in background (may take up to a minute on a cold cache; run `rcode brain status` to check)")):J&&J.error&&console.log(" "+Y(`Brain: skipped (${J.error})`)),k){let x={created:".gitignore created with rcode block",appended:".gitignore updated \u2014 rcode block appended","already-present":".gitignore rcode block already present",updated:".gitignore rcode block refreshed","skipped-error":`.gitignore skipped (${k.error})`}[k.action]||".gitignore unchanged";console.log(" "+Y(x))}if(he){let x={created:"pre-commit hook installed (.git/hooks/pre-commit)",appended:"pre-commit hook updated \u2014 rcode block appended","already-present":"pre-commit hook rcode block already present",updated:"pre-commit hook rcode block refreshed","skipped-flag":"pre-commit hook skipped (--no-git-hooks)","skipped-no-git":"pre-commit hook skipped (no .git/ directory)","skipped-error":`pre-commit hook skipped (${he.error})`}[he.action]||"pre-commit hook unchanged";console.log(" "+Y(x))}if(d>0&&console.log(" "+Y(`${d} files skipped (unchanged)`)),f>0&&t.nonDestructive){console.log(""),console.log(" "+_t(`${f} file${f===1?"":"s"} preserved (modified since install):`));for(let x of D.slice(0,10)){let j=X.green(`+${x.insertions}`)+" "+X.red(`-${x.deletions}`);if(console.log(` ${Y(x.rel)} ${j}`),t.showDiff&&x.patch)for(let R of x.patch.split(`
249
- `).slice(4))R.startsWith("+")?process.stdout.write(X.green(R)+`
250
- `):R.startsWith("-")?process.stdout.write(X.red(R)+`
251
- `):R.startsWith("@")?process.stdout.write(X.cyan(R)+`
252
- `):process.stdout.write(Y(R)+`
253
- `)}D.length>10&&console.log(Y(` \u2026 and ${D.length-10} more`)),console.log(Y(" To overwrite: re-run with --force-overwrite | To see full diffs: --show-diff")),console.log("")}let st=t.ides.includes("claude")?"claude":t.ides[0],Fe=Xu(st,t.target),Ir=Fe.agentsDir,_s=Fe.commandsDir,bt=0,Ze=0,ce=!1,Tr=!1;try{if(y.existsSync(Ir)&&(bt=y.readdirSync(Ir).filter(x=>(x.startsWith("rcode-")||x.startsWith("rcode-"))&&(x.endsWith(".md")||x.endsWith(".mdc"))).length),y.existsSync(_s)){let x=st==="claude"?j=>j.startsWith("rcode-")&&(j.endsWith(".md")||j.endsWith(".mdc")):j=>j.endsWith(".md")||j.endsWith(".mdc");Ze=y.readdirSync(_s).filter(x).length}if(bt===0||Ze===0||le<20){let x=p.join(Ye(),".claude/agents"),j=p.join(Ye(),".claude/commands"),R=p.join(Ye(),".claude/skills");if(bt===0&&y.existsSync(x)){let N=y.readdirSync(x).filter(ee=>(ee.startsWith("rcode-")||ee.startsWith("rcode-"))&&ee.endsWith(".md")).length;N>0&&(bt=N,ce=!0)}if(Ze===0&&y.existsSync(j)){let N=y.readdirSync(j).filter(ee=>(ee.startsWith("rcode-")||ee.startsWith("rcode-"))&&ee.endsWith(".md")).length;N>0&&(Ze=N,Tr=!0)}if(le<20&&y.existsSync(R))try{let N=y.readdirSync(R,{withFileTypes:!0}).filter(ee=>ee.isDirectory()&&ee.name.startsWith("rcode-")).length;N>le&&(le=N)}catch{}}}catch(x){console.error("[install] installInner: failed to count installed agents/commands:",x?.message||x)}try{let x=p.join(t.target,".rcode","skills"),j=p.join(t.target,".claude","commands"),R=[x,j],N=!1,ee=!1;for(let de of R){if(!y.existsSync(de))continue;let St=y.readdirSync(de);St.some(Pt=>Pt.startsWith("rcode-"))&&(N=!0),St.some(Pt=>Pt.startsWith("rihal-"))&&(ee=!0)}N&&ee&&process.stderr.write(X.yellow("WARNING: rcode-* and rihal-* namespaces both detected \u2014 consider removing one to reduce roster size.")+`
254
- `)}catch{}try{Gu(t)}catch(x){process.stderr.write(X.yellow(`WARNING: native slash-command install skipped: ${x?.message||x}`)+`
255
- `)}let Rr=We();console.log(""),console.log(` ${Ft("Version:")} ${X.cyan("@hanzlaa/rcode@"+Rr)}`),console.log(` ${Ft("IDE:")} ${t.ides.join(", ")}`),console.log(` ${Ft("Language:")} ${t.language} ${Y("(change in .rcode/config.yaml)")}`),console.log(` ${Ft("Mode:")} ${t.mode} ${Y("(guided=confirm at gates, yolo=autonomous)")}`),console.log(` ${Ft("Planning:")} ${t.commitPlanning!==!1?"committed":"gitignored"} ${Y("(flip: rcode-tools gitignore refresh)")}`),console.log("");let M=p.relative(t.target,Fe.agentsDir)||Fe.agentsDir,ve=p.relative(t.target,Fe.commandsDir)||Fe.commandsDir;if(console.log(` ${Ft("Agents:")} ${X.green(String(bt))} in ${ce?"~/.claude/agents/ (global)":M+"/"}`),console.log(` ${Ft("Commands:")} ${X.green(String(Ze))} slash commands in ${Tr?"~/.claude/commands/ (global)":ve+"/"}`),le>0&&console.log(` ${Ft("Skills:")} ${X.green(String(le))} phrase-activated`),console.log(""),$&&(console.log(" "+or("Starter planning scaffolded in .planning/ (ROADMAP, STATE, PROJECT)")),console.log("")),console.log(` ${Ft("Next:")}`),console.log(` cd ${t.target}`),console.log(" claude # start Claude Code (reload window if already open)"),console.log(" /rcode-progress # where you are, what's next"),console.log(" /rcode-do # interactive command picker"),console.log(" /rcode-council <q> # multi-agent strategic answer"),console.log(""),(t.global||t.noPrompt)&&(console.log(` ${Y("Configure interactively (one-time, per project):")}`),console.log(` ${Y("rcode install # pick IDE + planning policy for THIS project")}`),console.log(` ${Y("rcode config # adjust defaults later")}`),console.log("")),console.log(Y(" Refresh anytime:")),console.log(Y(" pnpm dlx @hanzlaa/rcode@latest install # recommended (avoids npm 11.x npx issues)")),console.log(Y(" npx @hanzlaa/rcode@latest install # npm / yarn")),console.log(Y(` /rcode-update v${Rr} # pin rcode to a specific version`)),console.log(""),console.log(Y(" Want the rcode CLI on your PATH? (optional \u2014 needed for rcode version / rcode update):")),console.log(Y(" npm install -g @hanzlaa/rcode # installs rcode, rcode, rcode commands")),console.log(Y(" rcode version # verify")),console.log(""),console.log(Y(" Customize without losing changes on update:")),console.log(Y(" Create <name>.local.md siblings (e.g. .claude/agents/rcode-waleed.local.md)")),console.log(Y(" *.local.md files are NEVER touched by install / --force-overwrite / uninstall.")),console.log(""),console.log(" "+_t("If your IDE is already open, reload the window to refresh skills/commands.")),console.log(Y(" Claude Code / VS Code / Cursor: Cmd+Shift+P \u2192 Reload Window")),console.log(""),!t.noUpdateCheck&&process.stdout.isTTY&&!process.env.CI&&!process.env.RCODE_NO_UPDATE_NOTIFIER){let{execFile:x}=require("child_process");x("npm",["view","@hanzlaa/rcode","version","--json"],{timeout:4e3},(j,R)=>{if(!j)try{let N=JSON.parse(R.trim());Fn.valid(N)&&Fn.gt(N,Rr)&&(console.log(""),console.log(" \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"),console.log(` \u2502 ${X.yellow("Update available:")} ${X.dim(Rr)} \u2192 ${X.green(N)}${" ".repeat(Math.max(0,20-Rr.length-N.length))} \u2502`),console.log(" \u2502 Run: npx @hanzlaa/rcode@latest install . \u2502"),console.log(" \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"),console.log(""))}catch{}})}if(!t.global){let x=Mk(t.target);x.ok||(console.log(" "+_t(x.message)),console.log(""))}return Vk(t.target,{agentCount:bt,commandCount:Ze,skillsInstalled:le})?0:1}function Vk(t,e){console.log(` ${Ft("Health check:")}`);let{execFileSync:r}=require("child_process"),n=0,s={agents:20,skills:20,commands:20};try{let{readPackageManifest:o}=ss(),a=o(Et);if(a&&a.agents instanceof Set&&a.actions instanceof Set){let u=l=>Math.max(1,Math.floor(l*.9));s.agents=u(a.agents.size),s.skills=u(a.actions.size);let c=p.join(Et,"rcode","commands");if(y.existsSync(c)){let l=y.readdirSync(c).filter(d=>d.endsWith(".md")&&!d.startsWith("_")).length;s.commands=u(l)}}}catch{}function i(o,a){try{let u=a();console.log(` ${or(o)}${u?Y(" \u2014 "+u):""}`)}catch(u){n+=1,console.log(` ${fg(o)} ${X.red("\u2014")} ${String(u.message||u).slice(0,120)}`)}}return i("rcode-tools.cjs runs",()=>{let o=p.join(t,".rcode","bin","rcode-tools.cjs");if(!y.existsSync(o))throw new Error("bin/rcode-tools.cjs not installed");return r("node",["-c",o],{stdio:"pipe"}),"syntax ok"}),i(".rcode/config.yaml present",()=>{let o=p.join(t,".rcode","config.yaml");if(!y.existsSync(o))throw new Error("missing");let a=y.readFileSync(o,"utf8");if(!/user_name:|project_name:/.test(a))throw new Error("config.yaml incomplete");return`${y.statSync(o).size} bytes`}),i(".rcode/state.json parses",()=>{let o=p.join(t,".rcode","state.json");if(!y.existsSync(o))throw new Error("missing");return JSON.parse(y.readFileSync(o,"utf8")),"valid JSON"}),i("agents installed",()=>{if((e.agentCount||0)<s.agents)throw new Error(`only ${e.agentCount} agents (expected \u2265 ${s.agents})`);return`${e.agentCount}`}),i("skills + commands installed",()=>{let o=[];if((e.skillsInstalled||0)<s.skills&&o.push(`${e.skillsInstalled} skills (expected \u2265 ${s.skills})`),(e.commandCount||0)<s.commands&&o.push(`${e.commandCount} commands (expected \u2265 ${s.commands})`),o.length)throw new Error(`low count: ${o.join(", ")}`);return`${e.skillsInstalled} skills + ${e.commandCount} commands`}),n>0?(console.log(""),console.log(" "+fg(`${n} health check${n===1?"":"s"} failed \u2014 install may be broken.`)),console.log(Y(" Debug: node .rcode/bin/rcode-tools.cjs state read && ls -la .rcode/")),console.log(Y(" Reinstall: rcode install . --force")),console.log(""),!1):(console.log(""),!0)}async function Gk(){let t=process.argv.slice(2),e=Yu(t);if(e.help){gg();return}!e.yes&&process.stdin.isTTY&&!process.env.CI&&await zk(e);try{let n=await Ku(e);process.exit(n)}catch(n){(n.code==="EACCES"||n.code==="EPERM")&&(console.error(`\u2716 Permission denied: ${n.path||n.message}`),process.exit(1)),n.code==="ENOENT"&&(console.error(`\u2716 Path not found: ${n.path||n.message}`),process.exit(1)),console.error(`\u2716 Install failed: ${n.message}`),process.env.DEBUG&&console.error(n.stack),process.exit(1)}}async function zk(t){let{intro:e,outro:r,text:n,select:s,multiselect:i,confirm:o,isCancel:a,cancel:u,note:c}=nt,l=We();if(console.log(""),e(X.bold("\u{1F54C} rcode")+X.dim(` v${l}`)),!t.targetProvided){let h=await n({message:"Install directory?",placeholder:t.target,defaultValue:t.target,initialValue:t.target});a(h)&&(u("Installation cancelled."),process.exit(0));let w=p.resolve((h||t.target).trim());t.target=w,t.projectName=p.basename(w)}let d=await i({message:"Which editor(s) are you installing for?",options:[{value:"claude",label:"Claude Code",hint:"recommended"},{value:"cursor",label:"Cursor"},{value:"codex",label:"Codex (OpenAI CLI)",hint:"AGENTS.md + workflow bridge"},{value:"gemini",label:"Gemini CLI",hint:"coming soon"},{value:"vscode",label:"VS Code",hint:"via Continue / Copilot extensions"},{value:"antigravity",label:"Antigravity",hint:"experimental"}],initialValues:t.ide?[t.ide]:["claude"],required:!0});a(d)&&(u("Installation cancelled."),process.exit(0)),t.ides=d,t.ide=d[0],t.ideProvided=!0;let f=await s({message:"Communication language?",options:[{value:"English",label:"English"},{value:"Arabic",label:"Arabic (\u0627\u0644\u0639\u0631\u0628\u064A\u0629)"},{value:"French",label:"French (Fran\xE7ais)"},{value:"Spanish",label:"Spanish (Espa\xF1ol)"},{value:"Urdu",label:"Urdu (\u0627\u0631\u062F\u0648)"}],initialValue:t.language||"English"});a(f)&&(u("Installation cancelled."),process.exit(0)),t.language=f;let g=await s({message:"Agent mode?",options:[{value:"guided",label:"Guided",hint:"confirm at key decision gates"},{value:"yolo",label:"Yolo",hint:"fully autonomous \u2014 no confirmation"}],initialValue:t.mode||"guided"});a(g)&&(u("Installation cancelled."),process.exit(0)),t.mode=g;let m=await s({message:"Where should planning artifacts (.planning/) be saved?",options:[{value:!0,label:"Commit to git",hint:"recommended \u2014 team sees the same plans"},{value:!1,label:"Keep local",hint:"gitignore \u2014 good for sensitive PRDs"}],initialValue:!0});a(m)&&(u("Installation cancelled."),process.exit(0)),t.commitPlanning=m;let D=await n({message:"Your name? (used in agent responses)",placeholder:t.userName,defaultValue:t.userName,initialValue:t.userName});a(D)&&(u("Installation cancelled."),process.exit(0)),t.userName=(D||t.userName).trim(),c([`${X.dim("Directory:")} ${t.target}`,`${X.dim("Editor:")} ${t.ides.join(", ")}`,`${X.dim("Language:")} ${t.language}`,`${X.dim("Mode:")} ${t.mode}`,`${X.dim("Planning:")} ${t.commitPlanning?"committed to git":"kept local (gitignored)"}`,`${X.dim("User:")} ${t.userName}`].join(`
256
- `),"Installing with these settings"),console.log("")}require.main===ct&&Gk();async function Yk(t){let e=Array.isArray(t)?t:[],r=Yu(e),n=await Ku(r);n!==0&&process.exit(n)}ct.exports=Yk;ct.exports.parseArgs=Yu;ct.exports.buildInstallPlan=Ju;ct.exports.install=Ku;ct.exports.SUPPORTED_IDES=os;ct.exports.migrateVscodeCommandsLayout=yg;ct.exports.getPathsForIde=Xu;ct.exports.installSlashRouterCommands=Qu;ct.exports.installCodexSlashRouterHook=bg;ct.exports.installAntigravitySlashRouterHook=Sg;ct.exports.installNativeHomeSlashCommands=Gu});var as=v((LI,wg)=>{var Xk=require("readline"),zt=class extends Error{constructor(e="Prompt aborted"){super(e),this.name="PromptAbortError"}},Cg=!1;function Jk(){Cg||(Cg=!0,process.on("SIGINT",()=>{process.stdout.write(`
251
+ `);let Q=p.join(Xe(),".rcode","agents");Tt(Q);let re=mg(lt,t.target,{skipGlobalDuplicates:T}),de=re.count;re.skippedGlobal>0&&(console.log(" "+Y(`Skipped ${re.skippedGlobal} project-level rcode skills (global ones in ~/.claude/skills/ take precedence) \u2014 closes #679.`)),console.log(" "+Y(" \u21B3 This project now depends on your GLOBAL rcode install for those skills.")),console.log(" "+Y(" For a self-contained project (e.g. for collaborators/CI), reinstall with --local-only.")));try{let{main:$}=require(p.join(lt,"cli","generate-command-skills.cjs")),R=p.join(t.target,".claude","skills"),j=$(lt,R,Ze(),{skipGlobalDuplicates:T});j.generated>0&&(console.log(" "+Y(`${j.generated} sidebar skill stub${j.generated===1?"":"s"} generated for command discoverability`)),de+=j.generated),j.skippedGlobal>0&&console.log(" "+Y(`Skipped ${j.skippedGlobal} sidebar stub${j.skippedGlobal===1?"":"s"} that duplicate global ~/.claude/skills/ \u2014 closes #679.`))}catch($){console.log(" "+Y(`(sidebar stub generation skipped: ${$.message})`))}D.writeFileSync(p.join(V,"files-manifest.csv"),q$(a,t.target,{mergeExistingManifest:!t.force,extraScanDirs:[p.join(t.target,".claude","skills"),p.join(t.target,".rcode","skills")]}));let x=R$(t.target,t.projectName);N$(lt,t.target);let k=P$(t.target,{commitPlanning:t.commitPlanning}),he=O$(t.target,{gitHooks:t.gitHooks}),X=T$(t.target,{enableHooks:t.enableHooks}),Ee=null,ot=!1;try{let{spawn:$}=require("child_process"),R=p.join(t.target,".rcode","bin","rcode-tools.cjs");D.existsSync(R)&&($("node",[R,"brain","pull"],{cwd:t.target,stdio:"ignore",detached:!0}).unref(),ot=!0)}catch($){Ee={ok:!1,error:String($.message||$).slice(0,200)}}if(console.log(""),t.force&&u>0&&console.log(" "+Po(`${u} stale files swept`)),t.force&&F&&console.log(" "+St("config.yaml and state.json preserved (pass --reset to wipe)")),ot?console.log(" "+Y("Brain: pulling in background (may take up to a minute on a cold cache; run `rcode brain status` to check)")):Ee&&Ee.error&&console.log(" "+Y(`Brain: skipped (${Ee.error})`)),k){let $={created:".gitignore created with rcode block",appended:".gitignore updated \u2014 rcode block appended","already-present":".gitignore rcode block already present",updated:".gitignore rcode block refreshed","skipped-error":`.gitignore skipped (${k.error})`}[k.action]||".gitignore unchanged";console.log(" "+Y($))}if(he){let $={created:"pre-commit hook installed (.git/hooks/pre-commit)",appended:"pre-commit hook updated \u2014 rcode block appended","already-present":"pre-commit hook rcode block already present",updated:"pre-commit hook rcode block refreshed","skipped-flag":"pre-commit hook skipped (--no-git-hooks)","skipped-no-git":"pre-commit hook skipped (no .git/ directory)","skipped-error":`pre-commit hook skipped (${he.error})`}[he.action]||"pre-commit hook unchanged";console.log(" "+Y($))}if(X){let $={merged:"guardrail hooks enabled (.claude/settings.json)","skipped-flag":"guardrail hooks skipped (--no-hooks or declined)","skipped-template-missing":"guardrail hooks skipped (settings-hooks.json template missing)","skipped-error":"guardrail hooks skipped (error merging .claude/settings.json)"}[X.action]||"guardrail hooks unchanged";console.log(" "+Y($))}if(d>0&&console.log(" "+Y(`${d} files skipped (unchanged)`)),f>0&&t.nonDestructive){console.log(""),console.log(" "+St(`${f} file${f===1?"":"s"} preserved (modified since install):`));for(let $ of y.slice(0,10)){let R=J.green(`+${$.insertions}`)+" "+J.red(`-${$.deletions}`);if(console.log(` ${Y($.rel)} ${R}`),t.showDiff&&$.patch)for(let j of $.patch.split(`
252
+ `).slice(4))j.startsWith("+")?process.stdout.write(J.green(j)+`
253
+ `):j.startsWith("-")?process.stdout.write(J.red(j)+`
254
+ `):j.startsWith("@")?process.stdout.write(J.cyan(j)+`
255
+ `):process.stdout.write(Y(j)+`
256
+ `)}y.length>10&&console.log(Y(` \u2026 and ${y.length-10} more`)),console.log(Y(" To overwrite: re-run with --force-overwrite | To see full diffs: --show-diff")),console.log("")}let Oe=t.ides.includes("claude")?"claude":t.ides[0],Ct=Xu(Oe,t.target),_s=Ct.agentsDir,Tr=Ct.commandsDir,Ve=0,oe=0,Rr=!1,bs=!1;try{if(D.existsSync(_s)&&(Ve=D.readdirSync(_s).filter($=>($.startsWith("rcode-")||$.startsWith("rcode-"))&&($.endsWith(".md")||$.endsWith(".mdc"))).length),D.existsSync(Tr)){let $=Oe==="claude"?R=>R.startsWith("rcode-")&&(R.endsWith(".md")||R.endsWith(".mdc")):R=>R.endsWith(".md")||R.endsWith(".mdc");oe=D.readdirSync(Tr).filter($).length}if(Ve===0||oe===0||de<20){let $=p.join(Xe(),".claude/agents"),R=p.join(Xe(),".claude/commands"),j=p.join(Xe(),".claude/skills");if(Ve===0&&D.existsSync($)){let z=D.readdirSync($).filter(ee=>(ee.startsWith("rcode-")||ee.startsWith("rcode-"))&&ee.endsWith(".md")).length;z>0&&(Ve=z,Rr=!0)}if(oe===0&&D.existsSync(R)){let z=D.readdirSync(R).filter(ee=>(ee.startsWith("rcode-")||ee.startsWith("rcode-"))&&ee.endsWith(".md")).length;z>0&&(oe=z,bs=!0)}if(de<20&&D.existsSync(j))try{let z=D.readdirSync(j,{withFileTypes:!0}).filter(ee=>ee.isDirectory()&&ee.name.startsWith("rcode-")).length;z>de&&(de=z)}catch{}}}catch($){console.error("[install] installInner: failed to count installed agents/commands:",$?.message||$)}try{let $=p.join(t.target,".rcode","skills"),R=p.join(t.target,".claude","commands"),j=[$,R],z=!1,ee=!1;for(let xe of j){if(!D.existsSync(xe))continue;let wt=D.readdirSync(xe);wt.some(Ot=>Ot.startsWith("rcode-"))&&(z=!0),wt.some(Ot=>Ot.startsWith("rihal-"))&&(ee=!0)}z&&ee&&process.stderr.write(J.yellow("WARNING: rcode-* and rihal-* namespaces both detected \u2014 consider removing one to reduce roster size.")+`
257
+ `)}catch{}try{zu(t)}catch($){process.stderr.write(J.yellow(`WARNING: native slash-command install skipped: ${$?.message||$}`)+`
258
+ `)}let N=Ze();console.log(""),console.log(` ${It("Version:")} ${J.cyan("@hanzlaa/rcode@"+N)}`),console.log(` ${It("IDE:")} ${t.ides.join(", ")}`),console.log(` ${It("Language:")} ${t.language} ${Y("(change in .rcode/config.yaml)")}`),console.log(` ${It("Mode:")} ${t.mode} ${Y("(guided=confirm at gates, yolo=autonomous)")}`),console.log(` ${It("Planning:")} ${t.commitPlanning!==!1?"committed":"gitignored"} ${Y("(flip: rcode-tools gitignore refresh)")}`),console.log("");let ve=p.relative(t.target,Ct.agentsDir)||Ct.agentsDir,B=p.relative(t.target,Ct.commandsDir)||Ct.commandsDir;if(console.log(` ${It("Agents:")} ${J.green(String(Ve))} in ${Rr?"~/.claude/agents/ (global)":ve+"/"}`),console.log(` ${It("Commands:")} ${J.green(String(oe))} slash commands in ${bs?"~/.claude/commands/ (global)":B+"/"}`),de>0&&console.log(` ${It("Skills:")} ${J.green(String(de))} phrase-activated`),console.log(""),x&&(console.log(" "+ir("Starter planning scaffolded in .planning/ (ROADMAP, STATE, PROJECT)")),console.log("")),console.log(` ${It("Next:")}`),console.log(` cd ${t.target}`),console.log(" claude # start Claude Code (reload window if already open)"),console.log(" /rcode-progress # where you are, what's next"),console.log(" /rcode-do # interactive command picker"),console.log(" /rcode-council <q> # multi-agent strategic answer"),console.log(""),(t.global||t.noPrompt)&&(console.log(` ${Y("Configure interactively (one-time, per project):")}`),console.log(` ${Y("rcode install # pick IDE + planning policy for THIS project")}`),console.log(` ${Y("rcode config # adjust defaults later")}`),console.log("")),console.log(Y(" Refresh anytime:")),console.log(Y(" pnpm dlx @hanzlaa/rcode@latest install # recommended (avoids npm 11.x npx issues)")),console.log(Y(" npx @hanzlaa/rcode@latest install # npm / yarn")),console.log(Y(` /rcode-update v${N} # pin rcode to a specific version`)),console.log(""),console.log(Y(" Want the rcode CLI on your PATH? (optional \u2014 needed for rcode version / rcode update):")),console.log(Y(" npm install -g @hanzlaa/rcode # installs rcode, rcode, rcode commands")),console.log(Y(" rcode version # verify")),console.log(""),console.log(Y(" Customize without losing changes on update:")),console.log(Y(" Create <name>.local.md siblings (e.g. .claude/agents/rcode-waleed.local.md)")),console.log(Y(" *.local.md files are NEVER touched by install / --force-overwrite / uninstall.")),console.log(""),console.log(" "+St("If your IDE is already open, reload the window to refresh skills/commands.")),console.log(Y(" Claude Code / VS Code / Cursor: Cmd+Shift+P \u2192 Reload Window")),console.log(""),!t.noUpdateCheck&&process.stdout.isTTY&&!process.env.CI&&!process.env.RCODE_NO_UPDATE_NOTIFIER){let{execFile:$}=require("child_process");$("npm",["view","@hanzlaa/rcode","version","--json"],{timeout:4e3},(R,j)=>{if(!R)try{let z=JSON.parse(j.trim());Fn.valid(z)&&Fn.gt(z,N)&&(console.log(""),console.log(" \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"),console.log(` \u2502 ${J.yellow("Update available:")} ${J.dim(N)} \u2192 ${J.green(z)}${" ".repeat(Math.max(0,20-N.length-z.length))} \u2502`),console.log(" \u2502 Run: npx @hanzlaa/rcode@latest install . \u2502"),console.log(" \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"),console.log(""))}catch{}})}if(!t.global){let $=H$(t.target);$.ok||(console.log(" "+St($.message)),console.log(""))}return Y$(t.target,{agentCount:Ve,commandCount:oe,skillsInstalled:de})?0:1}function Y$(t,e){console.log(` ${It("Health check:")}`);let{execFileSync:r}=require("child_process"),n=0,s={agents:20,skills:20,commands:20};try{let{readPackageManifest:o}=ss(),a=o(lt);if(a&&a.agents instanceof Set&&a.actions instanceof Set){let u=l=>Math.max(1,Math.floor(l*.9));s.agents=u(a.agents.size),s.skills=u(a.actions.size);let c=p.join(lt,"rcode","commands");if(D.existsSync(c)){let l=D.readdirSync(c).filter(d=>d.endsWith(".md")&&!d.startsWith("_")).length;s.commands=u(l)}}}catch{}function i(o,a){try{let u=a();console.log(` ${ir(o)}${u?Y(" \u2014 "+u):""}`)}catch(u){n+=1,console.log(` ${hg(o)} ${J.red("\u2014")} ${String(u.message||u).slice(0,120)}`)}}return i("rcode-tools.cjs runs",()=>{let o=p.join(t,".rcode","bin","rcode-tools.cjs");if(!D.existsSync(o))throw new Error("bin/rcode-tools.cjs not installed");return r("node",["-c",o],{stdio:"pipe"}),"syntax ok"}),i(".rcode/config.yaml present",()=>{let o=p.join(t,".rcode","config.yaml");if(!D.existsSync(o))throw new Error("missing");let a=D.readFileSync(o,"utf8");if(!/user_name:|project_name:/.test(a))throw new Error("config.yaml incomplete");return`${D.statSync(o).size} bytes`}),i(".rcode/state.json parses",()=>{let o=p.join(t,".rcode","state.json");if(!D.existsSync(o))throw new Error("missing");return JSON.parse(D.readFileSync(o,"utf8")),"valid JSON"}),i("agents installed",()=>{if((e.agentCount||0)<s.agents)throw new Error(`only ${e.agentCount} agents (expected \u2265 ${s.agents})`);return`${e.agentCount}`}),i("skills + commands installed",()=>{let o=[];if((e.skillsInstalled||0)<s.skills&&o.push(`${e.skillsInstalled} skills (expected \u2265 ${s.skills})`),(e.commandCount||0)<s.commands&&o.push(`${e.commandCount} commands (expected \u2265 ${s.commands})`),o.length)throw new Error(`low count: ${o.join(", ")}`);return`${e.skillsInstalled} skills + ${e.commandCount} commands`}),n>0?(console.log(""),console.log(" "+hg(`${n} health check${n===1?"":"s"} failed \u2014 install may be broken.`)),console.log(Y(" Debug: node .rcode/bin/rcode-tools.cjs state read && ls -la .rcode/")),console.log(Y(" Reinstall: rcode install . --force")),console.log(""),!1):(console.log(""),!0)}async function J$(){let t=process.argv.slice(2),e=Ju(t);if(e.help){Dg();return}!e.yes&&process.stdin.isTTY&&!process.env.CI&&await X$(e);try{let n=await Qu(e);process.exit(n)}catch(n){(n.code==="EACCES"||n.code==="EPERM")&&(console.error(`\u2716 Permission denied: ${n.path||n.message}`),process.exit(1)),n.code==="ENOENT"&&(console.error(`\u2716 Path not found: ${n.path||n.message}`),process.exit(1)),console.error(`\u2716 Install failed: ${n.message}`),process.env.DEBUG&&console.error(n.stack),process.exit(1)}}async function X$(t){let{intro:e,outro:r,text:n,select:s,multiselect:i,confirm:o,isCancel:a,cancel:u,note:c}=Re,l=Ze();if(console.log(""),e(J.bold("\u{1F54C} rcode")+J.dim(` v${l}`)),!t.targetProvided){let h=await n({message:"Install directory?",placeholder:t.target,defaultValue:t.target,initialValue:t.target});a(h)&&(u("Installation cancelled."),process.exit(0));let w=p.resolve((h||t.target).trim());t.target=w,t.projectName=p.basename(w)}let d=await i({message:"Which editor(s) are you installing for?",options:[{value:"claude",label:"Claude Code",hint:"recommended"},{value:"cursor",label:"Cursor"},{value:"codex",label:"Codex (OpenAI CLI)",hint:"AGENTS.md + workflow bridge"},{value:"gemini",label:"Gemini CLI",hint:"coming soon"},{value:"vscode",label:"VS Code",hint:"via Continue / Copilot extensions"},{value:"antigravity",label:"Antigravity",hint:"experimental"}],initialValues:t.ide?[t.ide]:["claude"],required:!0});a(d)&&(u("Installation cancelled."),process.exit(0)),t.ides=d,t.ide=d[0],t.ideProvided=!0;let f=await s({message:"Communication language?",options:[{value:"English",label:"English"},{value:"Arabic",label:"Arabic (\u0627\u0644\u0639\u0631\u0628\u064A\u0629)"},{value:"French",label:"French (Fran\xE7ais)"},{value:"Spanish",label:"Spanish (Espa\xF1ol)"},{value:"Urdu",label:"Urdu (\u0627\u0631\u062F\u0648)"}],initialValue:t.language||"English"});a(f)&&(u("Installation cancelled."),process.exit(0)),t.language=f;let g=await s({message:"Agent mode?",options:[{value:"guided",label:"Guided",hint:"confirm at key decision gates"},{value:"yolo",label:"Yolo",hint:"fully autonomous \u2014 no confirmation"}],initialValue:t.mode||"guided"});a(g)&&(u("Installation cancelled."),process.exit(0)),t.mode=g;let m=await s({message:"Where should planning artifacts (.planning/) be saved?",options:[{value:!0,label:"Commit to git",hint:"recommended \u2014 team sees the same plans"},{value:!1,label:"Keep local",hint:"gitignore \u2014 good for sensitive PRDs"}],initialValue:!0});a(m)&&(u("Installation cancelled."),process.exit(0)),t.commitPlanning=m;let y=await n({message:"Your name? (used in agent responses)",placeholder:t.userName,defaultValue:t.userName,initialValue:t.userName});a(y)&&(u("Installation cancelled."),process.exit(0)),t.userName=(y||t.userName).trim(),c([`${J.dim("Directory:")} ${t.target}`,`${J.dim("Editor:")} ${t.ides.join(", ")}`,`${J.dim("Language:")} ${t.language}`,`${J.dim("Mode:")} ${t.mode}`,`${J.dim("Planning:")} ${t.commitPlanning?"committed to git":"kept local (gitignored)"}`,`${J.dim("User:")} ${t.userName}`].join(`
259
+ `),"Installing with these settings"),console.log("")}require.main===dt&&J$();async function K$(t){let e=Array.isArray(t)?t:[],r=Ju(e),n=await Qu(r);n!==0&&process.exit(n)}dt.exports=K$;dt.exports.parseArgs=Ju;dt.exports.buildInstallPlan=Ku;dt.exports.install=Qu;dt.exports.SUPPORTED_IDES=os;dt.exports.migrateVscodeCommandsLayout=vg;dt.exports.getPathsForIde=Xu;dt.exports.installSlashRouterCommands=ec;dt.exports.installCodexSlashRouterHook=Eg;dt.exports.installAntigravitySlashRouterHook=Cg;dt.exports.installNativeHomeSlashCommands=zu});var as=v((qI,xg)=>{var Q$=require("readline"),Yt=class extends Error{constructor(e="Prompt aborted"){super(e),this.name="PromptAbortError"}},wg=!1;function eA(){wg||(wg=!0,process.on("SIGINT",()=>{process.stdout.write(`
257
260
 
258
261
  Cancelled.
259
- `),process.exit(0)}))}var sn=null;function ec(){return sn||(sn=Kk(),sn)}function Kk(){Jk();let t=!!process.stdin.isTTY,e=Xk.createInterface({input:process.stdin,output:process.stdout,terminal:t}),r=!1,n=!1;e.on("close",()=>{n=!0});let s=[],i=[];t||(e.on("line",u=>{if(i.length>0){let{resolve:c}=i.shift();c(u)}else s.push(u)}),e.on("close",()=>{for(;i.length>0;){let{reject:u}=i.shift();r||u(new zt("Input stream closed"))}}));function o(u){return t?n?Promise.reject(new zt("Input stream closed")):new Promise((c,l)=>{let d=!1,f=()=>{!d&&!r&&(d=!0,l(new zt("Input stream closed")))};e.once("close",f),e.question(u,g=>{d||(d=!0,e.removeListener("close",f),c((g||"").trim()))})}):(process.stdout.write(u),s.length>0?Promise.resolve((s.shift()||"").trim()):n?Promise.reject(new zt("Input stream closed")):new Promise((c,l)=>{i.push({resolve:d=>c((d||"").trim()),reject:l})}))}function a(){r=!0,e.close()}return{ask:o,close:a}}async function Qk(t,{choices:e,default:r="",allowMulti:n=!0,expand:s=null,maxAttempts:i=3}={}){if(!Array.isArray(e)||e.length===0)throw new Error("askChoice: `choices` must be a non-empty array");let o=e.map(l=>l.key),a=e.map(l=>l.id),u=`Valid options: ${o.join(", ")} (or ${a.join(", ")})`,c=ec();for(let l=0;l<i;l++){let d=await c.ask(t),f=d===""?r:d;if(f===""){console.log(` \u26A0 No input and no default. ${u}`);continue}let g=f.split(",").map(h=>h.trim()).filter(Boolean);if(!n&&g.length>1){console.log(` \u26A0 Only one choice allowed, you typed ${g.length}.`);continue}let m=[],D=[];for(let h of g){let w=e.find(C=>C.key===h||C.id===h);if(!w)D.push(h);else if(s)for(let C of s(w.id))m.push(C);else m.push(w.id)}if(m.length===0){console.log(` \u26A0 Didn't recognize: ${D.map(h=>`"${h}"`).join(", ")}`),console.log(` ${u}`),console.log();continue}return D.length>0&&console.log(` \u26A0 Skipping unknown: ${D.map(h=>`"${h}"`).join(", ")}`),[...new Set(m)]}throw new zt(`No valid selection after ${i} attempts`)}async function eA(t,{default:e="n",maxAttempts:r=3}={}){let n=e.toLowerCase()==="y"?"y":"n",s=ec();for(let i=0;i<r;i++){let o=(await s.ask(t)).toLowerCase(),a=o===""?n:o;if(a==="y"||a==="yes")return!0;if(a==="n"||a==="no")return!1;console.log(' \u26A0 Please answer "y" or "n".')}throw new zt(`No valid yes/no answer after ${r} attempts`)}async function tA(t,{default:e="",validate:r=null,maxAttempts:n=3}={}){let s=ec();for(let i=0;i<n;i++){let o=await s.ask(t),a=o===""?e:o;if(r){let u=r(a);if(u!==!0){console.log(` \u26A0 ${typeof u=="string"?u:"Invalid input."}`);continue}}else if(a===""){console.log(" \u26A0 Please enter a value.");continue}return a}throw new zt(`No valid text input after ${n} attempts`)}function rA(){sn&&(sn.close(),sn=null)}wg.exports={askChoice:Qk,askConfirm:eA,askText:tA,closeSession:rA,PromptAbortError:zt}});var Oo=v((BI,Ag)=>{"use strict";var Tt=require("fs"),ye=require("path");function on(t){if(!Tt.existsSync(t))return[];try{return Tt.readdirSync(t,{withFileTypes:!0})}catch{return[]}}function tc(t){let e=[],r=ye.join(t,"skills");for(let a of on(r)){if(!a.isDirectory()||!a.name.startsWith("rihal-"))continue;let u="rcode-"+a.name.slice(6);Tt.existsSync(ye.join(r,u))&&e.push({name:a.name,twin:u,srcPath:ye.join(r,a.name),kind:"skill"})}let n=[],s=ye.join(t,"commands");for(let a of on(s)){if(!a.isFile()||!a.name.startsWith("rihal-")||!a.name.endsWith(".md"))continue;let u="rcode-"+a.name.slice(6);Tt.existsSync(ye.join(s,u))&&n.push({name:a.name,twin:u,srcPath:ye.join(s,a.name),kind:"command"})}let i=[],o=ye.join(t,"agents");for(let a of on(o)){if(!a.isFile()||!a.name.startsWith("rihal-")||!a.name.endsWith(".md"))continue;let u="rcode-"+a.name.slice(6);Tt.existsSync(ye.join(o,u))&&i.push({name:a.name,twin:u,srcPath:ye.join(o,a.name),kind:"agent"})}return{skills:e,commands:n,agents:i}}function rc(t){let e=[],r=ye.join(t,"commands");for(let n of on(r)){if(!n.isFile()||!n.name.endsWith(".md")||n.name.startsWith("rcode-")||n.name.startsWith("rihal-"))continue;let s="rcode-"+n.name;Tt.existsSync(ye.join(r,s))&&e.push({name:n.name,twin:s,srcPath:ye.join(r,n.name),kind:"command"})}return e}function xg(t,e){let r=[];if(ye.resolve(t)===ye.resolve(e))return r;let n=ye.join(t,"commands"),s=ye.join(e,"commands"),i=new Set(on(n).filter(o=>o.isFile()&&o.name.endsWith(".md")).map(o=>o.name));for(let o of on(s))!o.isFile()||!o.name.endsWith(".md")||i.has(o.name)&&r.push({name:o.name,srcPath:ye.join(s,o.name),keptPath:ye.join(n,o.name),kind:"command"});return r}function $g(t){let e=[],r=ye.join(t,".rcode","slash-commands");for(let n of on(r)){if(!n.isFile()||!n.name.startsWith("rihal-")||!n.name.endsWith(".md"))continue;let s="rcode-"+n.name.slice(6);Tt.existsSync(ye.join(r,s))&&e.push({name:n.name,twin:s,srcPath:ye.join(r,n.name),kind:"command"})}return e}function kg(t,e){let r=ye.join(t,".claude"),n=ye.join(e,".claude"),s=tc(r),i=tc(n),o=rc(r),a=rc(n),u=xg(r,n),c=$g(e),l=s.skills.length+i.skills.length,d=s.commands.length+i.commands.length,f=s.agents.length+i.agents.length,g=o.length+a.length,m=u.length,D=c.length;return{legacySkillCount:l,legacyCommandCount:d,legacyAgentCount:f,unprefixedCount:g,crossScopeCount:m,legacyCodexCommandCount:D,totalCount:l+d+f+g+m+D,detail:{projectLegacy:s,globalLegacy:i,projectUnprefixed:o,globalUnprefixed:a,crossScope:u,codexSlashCommands:c}}}function nA(t,e,r,n){if(!Tt.existsSync(t))return!1;let s=n==="skill"?"skills":n==="agent"?"agents":"commands",i=ye.join(e,r,s);Tt.mkdirSync(i,{recursive:!0});let o=ye.join(i,ye.basename(t));return Tt.cpSync(t,o,{recursive:!0}),Tt.rmSync(t,{recursive:!0,force:!0}),!0}function sA(t,e){let r=kg(t,e),n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),s=ye.join(e,".claude",".rcode-backup",n),i={backupDir:null,removed:{legacySkills:0,legacyCommands:0,legacyAgents:0,unprefixedDupes:0,crossScopeDupes:0,legacyCodexCommands:0}},o=(u,c,l)=>{let d=0;for(let f of u)nA(f.srcPath,s,c,l)&&d++;return d};return i.removed.legacySkills=o(r.detail.projectLegacy.skills,"project","skill")+o(r.detail.globalLegacy.skills,"global","skill"),i.removed.legacyCommands=o(r.detail.projectLegacy.commands,"project","command")+o(r.detail.globalLegacy.commands,"global","command"),i.removed.legacyAgents=o(r.detail.projectLegacy.agents,"project","agent")+o(r.detail.globalLegacy.agents,"global","agent"),i.removed.unprefixedDupes=o(r.detail.projectUnprefixed,"project","command")+o(r.detail.globalUnprefixed,"global","command"),i.removed.crossScopeDupes=o(r.detail.crossScope,"global","command"),i.removed.legacyCodexCommands=o(r.detail.codexSlashCommands,"global","command"),Object.values(i.removed).reduce((u,c)=>u+c,0)>0&&(i.backupDir=s),i}Ag.exports={findLegacyRihalArtifacts:tc,findUnprefixedTwinDupes:rc,findCrossScopeDupes:xg,findLegacyCodexSlashCommands:$g,scanNamespaceDuplication:kg,migrateNamespace:sA}});var Tg=v((MI,No)=>{var ue=require("fs"),fe=require("path"),{spawnSync:Fg}=require("child_process"),us=Zu(),{PromptAbortError:oA}=as(),{writeFileAtomic:iA}=Jt(),{homedir:aA}=lr(),{verifyInstall:uA,formatReport:cA}=ss(),lA=is();function dA(t){let e=ue.readFileSync(t,"utf8"),r={};for(let n of e.split(/\r?\n/)){let s=n.replace(/#.*$/,"").trimEnd();if(!s||s.startsWith(" "))continue;let i=s.indexOf(":");if(i===-1)continue;let o=s.slice(0,i).trim(),a=s.slice(i+1).trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.slice(1,-1)),a==="true"?a=!0:a==="false"&&(a=!1),r[o]=a}return{obj:r,raw:e}}function fA(t,e,r){let n=new RegExp(`^${e}:[^\\S\\n]*[^\\r\\n]*$`,"m"),s=typeof r=="string"?`${e}: "${r.replace(/"/g,'\\"')}"`:`${e}: ${r}`;return n.test(t)?t.replace(n,s):t.replace(/(?:\r?\n)*$/,"")+`
262
+ `),process.exit(0)}))}var sn=null;function tc(){return sn||(sn=tA(),sn)}function tA(){eA();let t=!!process.stdin.isTTY,e=Q$.createInterface({input:process.stdin,output:process.stdout,terminal:t}),r=!1,n=!1;e.on("close",()=>{n=!0});let s=[],i=[];t||(e.on("line",u=>{if(i.length>0){let{resolve:c}=i.shift();c(u)}else s.push(u)}),e.on("close",()=>{for(;i.length>0;){let{reject:u}=i.shift();r||u(new Yt("Input stream closed"))}}));function o(u){return t?n?Promise.reject(new Yt("Input stream closed")):new Promise((c,l)=>{let d=!1,f=()=>{!d&&!r&&(d=!0,l(new Yt("Input stream closed")))};e.once("close",f),e.question(u,g=>{d||(d=!0,e.removeListener("close",f),c((g||"").trim()))})}):(process.stdout.write(u),s.length>0?Promise.resolve((s.shift()||"").trim()):n?Promise.reject(new Yt("Input stream closed")):new Promise((c,l)=>{i.push({resolve:d=>c((d||"").trim()),reject:l})}))}function a(){r=!0,e.close()}return{ask:o,close:a}}async function rA(t,{choices:e,default:r="",allowMulti:n=!0,expand:s=null,maxAttempts:i=3}={}){if(!Array.isArray(e)||e.length===0)throw new Error("askChoice: `choices` must be a non-empty array");let o=e.map(l=>l.key),a=e.map(l=>l.id),u=`Valid options: ${o.join(", ")} (or ${a.join(", ")})`,c=tc();for(let l=0;l<i;l++){let d=await c.ask(t),f=d===""?r:d;if(f===""){console.log(` \u26A0 No input and no default. ${u}`);continue}let g=f.split(",").map(h=>h.trim()).filter(Boolean);if(!n&&g.length>1){console.log(` \u26A0 Only one choice allowed, you typed ${g.length}.`);continue}let m=[],y=[];for(let h of g){let w=e.find(C=>C.key===h||C.id===h);if(!w)y.push(h);else if(s)for(let C of s(w.id))m.push(C);else m.push(w.id)}if(m.length===0){console.log(` \u26A0 Didn't recognize: ${y.map(h=>`"${h}"`).join(", ")}`),console.log(` ${u}`),console.log();continue}return y.length>0&&console.log(` \u26A0 Skipping unknown: ${y.map(h=>`"${h}"`).join(", ")}`),[...new Set(m)]}throw new Yt(`No valid selection after ${i} attempts`)}async function nA(t,{default:e="n",maxAttempts:r=3}={}){let n=e.toLowerCase()==="y"?"y":"n",s=tc();for(let i=0;i<r;i++){let o=(await s.ask(t)).toLowerCase(),a=o===""?n:o;if(a==="y"||a==="yes")return!0;if(a==="n"||a==="no")return!1;console.log(' \u26A0 Please answer "y" or "n".')}throw new Yt(`No valid yes/no answer after ${r} attempts`)}async function sA(t,{default:e="",validate:r=null,maxAttempts:n=3}={}){let s=tc();for(let i=0;i<n;i++){let o=await s.ask(t),a=o===""?e:o;if(r){let u=r(a);if(u!==!0){console.log(` \u26A0 ${typeof u=="string"?u:"Invalid input."}`);continue}}else if(a===""){console.log(" \u26A0 Please enter a value.");continue}return a}throw new Yt(`No valid text input after ${n} attempts`)}function oA(){sn&&(sn.close(),sn=null)}xg.exports={askChoice:rA,askConfirm:nA,askText:sA,closeSession:oA,PromptAbortError:Yt}});var No=v((WI,Fg)=>{"use strict";var Rt=require("fs"),ye=require("path");function on(t){if(!Rt.existsSync(t))return[];try{return Rt.readdirSync(t,{withFileTypes:!0})}catch{return[]}}function rc(t){let e=[],r=ye.join(t,"skills");for(let a of on(r)){if(!a.isDirectory()||!a.name.startsWith("rihal-"))continue;let u="rcode-"+a.name.slice(6);Rt.existsSync(ye.join(r,u))&&e.push({name:a.name,twin:u,srcPath:ye.join(r,a.name),kind:"skill"})}let n=[],s=ye.join(t,"commands");for(let a of on(s)){if(!a.isFile()||!a.name.startsWith("rihal-")||!a.name.endsWith(".md"))continue;let u="rcode-"+a.name.slice(6);Rt.existsSync(ye.join(s,u))&&n.push({name:a.name,twin:u,srcPath:ye.join(s,a.name),kind:"command"})}let i=[],o=ye.join(t,"agents");for(let a of on(o)){if(!a.isFile()||!a.name.startsWith("rihal-")||!a.name.endsWith(".md"))continue;let u="rcode-"+a.name.slice(6);Rt.existsSync(ye.join(o,u))&&i.push({name:a.name,twin:u,srcPath:ye.join(o,a.name),kind:"agent"})}return{skills:e,commands:n,agents:i}}function nc(t){let e=[],r=ye.join(t,"commands");for(let n of on(r)){if(!n.isFile()||!n.name.endsWith(".md")||n.name.startsWith("rcode-")||n.name.startsWith("rihal-"))continue;let s="rcode-"+n.name;Rt.existsSync(ye.join(r,s))&&e.push({name:n.name,twin:s,srcPath:ye.join(r,n.name),kind:"command"})}return e}function kg(t,e){let r=[];if(ye.resolve(t)===ye.resolve(e))return r;let n=ye.join(t,"commands"),s=ye.join(e,"commands"),i=new Set(on(n).filter(o=>o.isFile()&&o.name.endsWith(".md")).map(o=>o.name));for(let o of on(s))!o.isFile()||!o.name.endsWith(".md")||i.has(o.name)&&r.push({name:o.name,srcPath:ye.join(s,o.name),keptPath:ye.join(n,o.name),kind:"command"});return r}function $g(t){let e=[],r=ye.join(t,".rcode","slash-commands");for(let n of on(r)){if(!n.isFile()||!n.name.startsWith("rihal-")||!n.name.endsWith(".md"))continue;let s="rcode-"+n.name.slice(6);Rt.existsSync(ye.join(r,s))&&e.push({name:n.name,twin:s,srcPath:ye.join(r,n.name),kind:"command"})}return e}function Ag(t,e){let r=ye.join(t,".claude"),n=ye.join(e,".claude"),s=rc(r),i=rc(n),o=nc(r),a=nc(n),u=kg(r,n),c=$g(e),l=s.skills.length+i.skills.length,d=s.commands.length+i.commands.length,f=s.agents.length+i.agents.length,g=o.length+a.length,m=u.length,y=c.length;return{legacySkillCount:l,legacyCommandCount:d,legacyAgentCount:f,unprefixedCount:g,crossScopeCount:m,legacyCodexCommandCount:y,totalCount:l+d+f+g+m+y,detail:{projectLegacy:s,globalLegacy:i,projectUnprefixed:o,globalUnprefixed:a,crossScope:u,codexSlashCommands:c}}}function iA(t,e,r,n){if(!Rt.existsSync(t))return!1;let s=n==="skill"?"skills":n==="agent"?"agents":"commands",i=ye.join(e,r,s);Rt.mkdirSync(i,{recursive:!0});let o=ye.join(i,ye.basename(t));return Rt.cpSync(t,o,{recursive:!0}),Rt.rmSync(t,{recursive:!0,force:!0}),!0}function aA(t,e){let r=Ag(t,e),n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),s=ye.join(e,".claude",".rcode-backup",n),i={backupDir:null,removed:{legacySkills:0,legacyCommands:0,legacyAgents:0,unprefixedDupes:0,crossScopeDupes:0,legacyCodexCommands:0}},o=(u,c,l)=>{let d=0;for(let f of u)iA(f.srcPath,s,c,l)&&d++;return d};return i.removed.legacySkills=o(r.detail.projectLegacy.skills,"project","skill")+o(r.detail.globalLegacy.skills,"global","skill"),i.removed.legacyCommands=o(r.detail.projectLegacy.commands,"project","command")+o(r.detail.globalLegacy.commands,"global","command"),i.removed.legacyAgents=o(r.detail.projectLegacy.agents,"project","agent")+o(r.detail.globalLegacy.agents,"global","agent"),i.removed.unprefixedDupes=o(r.detail.projectUnprefixed,"project","command")+o(r.detail.globalUnprefixed,"global","command"),i.removed.crossScopeDupes=o(r.detail.crossScope,"global","command"),i.removed.legacyCodexCommands=o(r.detail.codexSlashCommands,"global","command"),Object.values(i.removed).reduce((u,c)=>u+c,0)>0&&(i.backupDir=s),i}Fg.exports={findLegacyRihalArtifacts:rc,findUnprefixedTwinDupes:nc,findCrossScopeDupes:kg,findLegacyCodexSlashCommands:$g,scanNamespaceDuplication:Ag,migrateNamespace:aA}});var Rg=v((HI,Lo)=>{var ce=require("fs"),fe=require("path"),{spawnSync:jg}=require("child_process"),us=Uu(),{PromptAbortError:uA}=as(),{writeFileAtomic:cA}=Kt(),{homedir:lA}=dr(),{verifyInstall:dA,formatReport:fA}=ss(),hA=is();function pA(t){let e=ce.readFileSync(t,"utf8"),r={};for(let n of e.split(/\r?\n/)){let s=n.replace(/#.*$/,"").trimEnd();if(!s||s.startsWith(" "))continue;let i=s.indexOf(":");if(i===-1)continue;let o=s.slice(0,i).trim(),a=s.slice(i+1).trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.slice(1,-1)),a==="true"?a=!0:a==="false"&&(a=!1),r[o]=a}return{obj:r,raw:e}}function mA(t,e,r){let n=new RegExp(`^${e}:[^\\S\\n]*[^\\r\\n]*$`,"m"),s=typeof r=="string"?`${e}: "${r.replace(/"/g,'\\"')}"`:`${e}: ${r}`;return n.test(t)?t.replace(n,s):t.replace(/(?:\r?\n)*$/,"")+`
260
263
  ${s}
261
- `}function jg(t){let e={yes:!1};for(let r of t)(r==="--yes"||r==="-y")&&(e.yes=!0);return e}function Ig(t){let e=[],r=fe.join(aA(),".claude/skills"),n=ue.existsSync(fe.join(t,".claude/skills"))&&ue.readdirSync(fe.join(t,".claude/skills")).some(o=>o.startsWith("rcode-"))||ue.existsSync(fe.join(t,".claude/agents"))&&ue.readdirSync(fe.join(t,".claude/agents")).some(o=>o.startsWith("rcode-"))||ue.existsSync(fe.join(t,".claude/commands"))&&ue.readdirSync(fe.join(t,".claude/commands")).some(o=>o.startsWith("rcode-")),s=ue.existsSync(r)&&ue.readdirSync(r).some(o=>o.startsWith("rcode-")),i=ue.existsSync(fe.join(t,".rcode/config.yaml"));return(n||i&&s)&&e.push("claude"),ue.existsSync(fe.join(t,".cursor/rules"))&&ue.readdirSync(fe.join(t,".cursor/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("cursor"),ue.existsSync(fe.join(t,".windsurf/rules"))&&ue.readdirSync(fe.join(t,".windsurf/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("windsurf"),ue.existsSync(fe.join(t,".antigravity/agents"))&&ue.readdirSync(fe.join(t,".antigravity/agents")).some(a=>a.startsWith("rcode-"))&&e.push("antigravity"),e}function hA(t,e){let r=[];e.includes("claude")&&r.push(".claude/skills",".claude/commands/rcode"),e.includes("cursor")&&r.push(".cursor/rules"),e.includes("windsurf")&&r.push(".windsurf/rules"),e.includes("antigravity")&&r.push(".antigravity/agents"),ue.existsSync(fe.join(t,"AGENTS.md"))&&r.push("AGENTS.md");let n=r.filter(l=>ue.existsSync(fe.join(t,l)));if(n.length===0)return{ok:!1,warning:"nothing to back up"};if(Fg("tar",["--version"],{stdio:"ignore"}).status!==0)return{ok:!1,warning:"tar not available"};let i=fe.join(t,".rcode/backups");try{ue.mkdirSync(i,{recursive:!0})}catch(l){return{ok:!1,warning:`could not create backups dir: ${l.message}`}}let o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),a=fe.join(i,`update-${o}.tgz`),u=fe.relative(t,a),c=Fg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
264
+ `}function Ig(t){let e={yes:!1};for(let r of t)(r==="--yes"||r==="-y")&&(e.yes=!0);return e}function Tg(t){let e=[],r=fe.join(lA(),".claude/skills"),n=ce.existsSync(fe.join(t,".claude/skills"))&&ce.readdirSync(fe.join(t,".claude/skills")).some(o=>o.startsWith("rcode-"))||ce.existsSync(fe.join(t,".claude/agents"))&&ce.readdirSync(fe.join(t,".claude/agents")).some(o=>o.startsWith("rcode-"))||ce.existsSync(fe.join(t,".claude/commands"))&&ce.readdirSync(fe.join(t,".claude/commands")).some(o=>o.startsWith("rcode-")),s=ce.existsSync(r)&&ce.readdirSync(r).some(o=>o.startsWith("rcode-")),i=ce.existsSync(fe.join(t,".rcode/config.yaml"));return(n||i&&s)&&e.push("claude"),ce.existsSync(fe.join(t,".cursor/rules"))&&ce.readdirSync(fe.join(t,".cursor/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("cursor"),ce.existsSync(fe.join(t,".windsurf/rules"))&&ce.readdirSync(fe.join(t,".windsurf/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("windsurf"),ce.existsSync(fe.join(t,".antigravity/agents"))&&ce.readdirSync(fe.join(t,".antigravity/agents")).some(a=>a.startsWith("rcode-"))&&e.push("antigravity"),e}function gA(t,e){let r=[];e.includes("claude")&&r.push(".claude/skills",".claude/commands/rcode"),e.includes("cursor")&&r.push(".cursor/rules"),e.includes("windsurf")&&r.push(".windsurf/rules"),e.includes("antigravity")&&r.push(".antigravity/agents"),ce.existsSync(fe.join(t,"AGENTS.md"))&&r.push("AGENTS.md");let n=r.filter(l=>ce.existsSync(fe.join(t,l)));if(n.length===0)return{ok:!1,warning:"nothing to back up"};if(jg("tar",["--version"],{stdio:"ignore"}).status!==0)return{ok:!1,warning:"tar not available"};let i=fe.join(t,".rcode/backups");try{ce.mkdirSync(i,{recursive:!0})}catch(l){return{ok:!1,warning:`could not create backups dir: ${l.message}`}}let o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),a=fe.join(i,`update-${o}.tgz`),u=fe.relative(t,a),c=jg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
262
265
  `)+`
263
- `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar failed: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function pA(t,e){let r={claude:0,cursor:0,windsurf:0,antigravity:0};if(e.includes("claude")){let n=fe.join(t,".claude/skills");if(ue.existsSync(n))for(let o of ue.readdirSync(n))o.startsWith("rcode-")&&(ue.rmSync(fe.join(n,o),{recursive:!0,force:!0}),r.claude++);let s=fe.join(t,".claude/commands/rcode");ue.existsSync(s)&&ue.rmSync(s,{recursive:!0,force:!0});let i=fe.join(t,".claude/commands");if(ue.existsSync(i))for(let o of ue.readdirSync(i))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&ue.unlinkSync(fe.join(i,o))}if(e.includes("cursor")){let n=fe.join(t,".cursor/rules");if(ue.existsSync(n))for(let s of ue.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(ue.rmSync(fe.join(n,s)),r.cursor++)}if(e.includes("windsurf")){let n=fe.join(t,".windsurf/rules");if(ue.existsSync(n))for(let s of ue.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(ue.rmSync(fe.join(n,s)),r.windsurf++)}if(e.includes("antigravity")){let n=fe.join(t,".antigravity/agents");if(ue.existsSync(n))for(let s of ue.readdirSync(n))s.startsWith("rcode-")&&(ue.rmSync(fe.join(n,s)),r.antigravity++)}return r}function mA(t){let e=fe.join(t,"AGENTS.md");if(!ue.existsSync(e))return;let r=ue.readFileSync(e,"utf8"),n=[/\n*---\n+## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/],s=!1;for(let i of n)i.test(r)&&(r=r.replace(i,""),s=!0);if(s){r=r.replace(/\n---\n+$/,`
264
- `);let{writeFileAtomic:i}=Jt();i(e,r)}}No.exports=async function(e,{packageRoot:r,packageJson:n}){try{return await gA(e,{packageRoot:r,packageJson:n})}catch(s){throw s instanceof oA&&(console.log(`
265
- \u274C Update cancelled \u2014 ${s.message}.`),process.exit(0)),s}};async function gA(t,{packageRoot:e,packageJson:r}){let n=process.cwd(),s=jg(t),i=r?.version||"0.0.0",o=fe.join(n,".rcode/config.yaml"),a=fe.join(n,".rcode/config.json"),u=ue.existsSync(o)?o:a;ue.existsSync(u)||(console.error(`
266
+ `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar failed: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function DA(t,e){let r={claude:0,cursor:0,windsurf:0,antigravity:0};if(e.includes("claude")){let n=fe.join(t,".claude/skills");if(ce.existsSync(n))for(let o of ce.readdirSync(n))o.startsWith("rcode-")&&(ce.rmSync(fe.join(n,o),{recursive:!0,force:!0}),r.claude++);let s=fe.join(t,".claude/commands/rcode");ce.existsSync(s)&&ce.rmSync(s,{recursive:!0,force:!0});let i=fe.join(t,".claude/commands");if(ce.existsSync(i))for(let o of ce.readdirSync(i))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&ce.unlinkSync(fe.join(i,o))}if(e.includes("cursor")){let n=fe.join(t,".cursor/rules");if(ce.existsSync(n))for(let s of ce.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(ce.rmSync(fe.join(n,s)),r.cursor++)}if(e.includes("windsurf")){let n=fe.join(t,".windsurf/rules");if(ce.existsSync(n))for(let s of ce.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(ce.rmSync(fe.join(n,s)),r.windsurf++)}if(e.includes("antigravity")){let n=fe.join(t,".antigravity/agents");if(ce.existsSync(n))for(let s of ce.readdirSync(n))s.startsWith("rcode-")&&(ce.rmSync(fe.join(n,s)),r.antigravity++)}return r}function yA(t){let e=fe.join(t,"AGENTS.md");if(!ce.existsSync(e))return;let r=ce.readFileSync(e,"utf8"),n=[/\n*---\n+## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/],s=!1;for(let i of n)i.test(r)&&(r=r.replace(i,""),s=!0);if(s){r=r.replace(/\n---\n+$/,`
267
+ `);let{writeFileAtomic:i}=Kt();i(e,r)}}Lo.exports=async function(e,{packageRoot:r,packageJson:n}){try{return await vA(e,{packageRoot:r,packageJson:n})}catch(s){throw s instanceof uA&&(console.log(`
268
+ \u274C Update cancelled \u2014 ${s.message}.`),process.exit(0)),s}};async function vA(t,{packageRoot:e,packageJson:r}){let n=process.cwd(),s=Ig(t),i=r?.version||"0.0.0",o=fe.join(n,".rcode/config.yaml"),a=fe.join(n,".rcode/config.json"),u=ce.existsSync(o)?o:a;ce.existsSync(u)||(console.error(`
266
269
  \u274C rcode is not installed in this directory.`),console.error(` To install: rcode install
267
- `),process.exit(1));let c,l="",d=u.endsWith(".yaml");try{if(d){let T=dA(u);c=T.obj,l=T.raw}else c=JSON.parse(ue.readFileSync(u,"utf8"))}catch(T){console.error(`
270
+ `),process.exit(1));let c,l="",d=u.endsWith(".yaml");try{if(d){let T=pA(u);c=T.obj,l=T.raw}else c=JSON.parse(ce.readFileSync(u,"utf8"))}catch(T){console.error(`
268
271
  \u274C ${fe.basename(u)} is not parseable: ${T.message}
269
- `),process.exit(1)}let f=c.installed_version||"(unknown, pre-tracking)",g=Ig(n);if(g.length===0&&(console.error(`
272
+ `),process.exit(1)}let f=c.installed_version||"(unknown, pre-tracking)",g=Tg(n);if(g.length===0&&(console.error(`
270
273
  \u274C No editor install detected.`),console.error(` Run 'rcode install' to set up at least one editor first.
271
274
  `),process.exit(1)),console.log(`
272
275
  \u{1F54C} rcode \u2014 Update
273
- `),console.log(` Installed: ${f}`),console.log(` Package: ${i}`),console.log(` Editors: ${g.join(", ")}`),console.log(),f===i&&(console.log(" \u2139 Already at the current package version."),console.log(" Refreshing files will overwrite any manual changes to"),console.log(" installed skill/command files with the package copies."),console.log()),!s.yes){let G=["claude","cursor","gemini"].filter(I=>!g.includes(I));if(G.length>0){let I={claude:"Claude Code",cursor:"Cursor",gemini:"Gemini CLI"},Z=await us.multiselect({message:"Add support for additional editors?",options:G.map(F=>({value:F,label:I[F]||F})),required:!1});us.isCancel(Z)&&(us.cancel("Update cancelled."),process.exit(0));for(let F of Z)g.push(F);console.log(` Editors to update: ${g.join(", ")}`),console.log()}}if(!s.yes){let T=await us.confirm({message:"Proceed with update?",initialValue:!1});if(us.isCancel(T)||!T){console.log(`
274
- \u274C Update cancelled. Nothing changed.`);return}}console.log();let m=hA(n,g);m.ok?console.log(` \u{1F4BE} backup: ${m.path}`):console.log(` \u26A0 no backup created (${m.warning}) \u2014 continuing anyway`);let D=pA(n,g),h=D.claude+D.cursor+D.windsurf+D.antigravity;console.log(` \u{1F9F9} cleaned ${h} old skill files`),mA(n),console.log();let w=g.filter(T=>["claude","cursor","gemini"].includes(T));if(w.length>0){if(g.some(T=>!["claude","cursor","gemini"].includes(T))){let T=g.filter(G=>!["claude","cursor","gemini"].includes(G));console.log(` \u26A0 ${T.join(", ")} refresh not yet supported by installer \u2014 skipping`)}lA.install({target:n,force:!0,yes:!0,userName:c.user_name||require("os").userInfo().username,projectName:c.project_name||require("path").basename(n),language:c.language||"English",mode:c.mode||"guided",ides:w,modules:[],help:!1}),console.log(` \u2713 [${w.join(", ")}] \u2192 refreshed via install.js`)}if(d){let T=fA(l,"installed_version",i);iA(u,T)}else{c.installed_version=i;let{writeJsonAtomic:T}=Jt();T(u,c)}console.log(` \u2713 ${fe.relative(n,u)} \u2192 installed_version: ${i}`);try{let{migrateNamespace:T}=Oo(),{homedir:G}=lr(),I=T(n,G()),Z=Object.values(I.removed).reduce((F,W)=>F+W,0);Z>0&&(console.log(` \u{1F9F9} migrated ${Z} legacy rihal-*/duplicate command registration(s)`),I.backupDir&&console.log(` backup: ${I.backupDir}`))}catch(T){console.log(` \u26A0 namespace migration skipped: ${T.message}`)}console.log();let{reports:C,hasDrift:A}=uA(n,e,g);A?(console.log("\u26A0 Post-update verification found drift:"),console.log(cA(C)),console.log(`
275
- Run 'rcode doctor' for details, or re-run update to retry.`)):console.log(" \u2713 Post-update verification passed."),console.log(),console.log(f===i?`\u2705 rcode ${i} refreshed.`:`\u2705 rcode updated: ${f} \u2192 ${i}`),m.ok&&console.log(` Rollback: tar -xzf ${m.path}`),console.log()}No.exports.parseArgs=jg;No.exports.detectInstalledEditors=Ig});var ic=v((qI,ir)=>{var H=require("fs"),nc=require("os"),q=require("path"),{spawnSync:Rg}=require("child_process"),{askConfirm:Pg,PromptAbortError:Og}=as(),{writeFileAtomic:oc,safeRmSync:Fr}=Jt();function DA(t){let e={editor:null,keepState:!1,deleteState:!1,yes:!1,purge:!1};for(let r of t)r.startsWith("--editor=")?e.editor=r.slice(9):r==="--keep-state"?e.keepState=!0:r==="--delete-state"?e.deleteState=!0:r==="--yes"||r==="-y"?e.yes=!0:(r==="--purge"||r==="--all")&&(e.purge=!0,e.deleteState=!0);return e}function Ng(t){return/\.local\.(md|mdc|json|yaml|yml|toml|js|ts)$/.test(t)}function Lg(t){return t.replace(/\n?# ===== rcode-managed gitignore block[\s\S]*?# ===== end rcode-managed gitignore block =====\n?/g,`
276
+ `),console.log(` Installed: ${f}`),console.log(` Package: ${i}`),console.log(` Editors: ${g.join(", ")}`),console.log(),f===i&&(console.log(" \u2139 Already at the current package version."),console.log(" Refreshing files will overwrite any manual changes to"),console.log(" installed skill/command files with the package copies."),console.log()),!s.yes){let V=["claude","cursor","gemini"].filter(I=>!g.includes(I));if(V.length>0){let I={claude:"Claude Code",cursor:"Cursor",gemini:"Gemini CLI"},H=await us.multiselect({message:"Add support for additional editors?",options:V.map(F=>({value:F,label:I[F]||F})),required:!1});us.isCancel(H)&&(us.cancel("Update cancelled."),process.exit(0));for(let F of H)g.push(F);console.log(` Editors to update: ${g.join(", ")}`),console.log()}}if(!s.yes){let T=await us.confirm({message:"Proceed with update?",initialValue:!1});if(us.isCancel(T)||!T){console.log(`
277
+ \u274C Update cancelled. Nothing changed.`);return}}console.log();let m=gA(n,g);m.ok?console.log(` \u{1F4BE} backup: ${m.path}`):console.log(` \u26A0 no backup created (${m.warning}) \u2014 continuing anyway`);let y=DA(n,g),h=y.claude+y.cursor+y.windsurf+y.antigravity;console.log(` \u{1F9F9} cleaned ${h} old skill files`),yA(n),console.log();let w=g.filter(T=>["claude","cursor","gemini"].includes(T));if(w.length>0){if(g.some(T=>!["claude","cursor","gemini"].includes(T))){let T=g.filter(V=>!["claude","cursor","gemini"].includes(V));console.log(` \u26A0 ${T.join(", ")} refresh not yet supported by installer \u2014 skipping`)}hA.install({target:n,force:!0,yes:!0,userName:c.user_name||require("os").userInfo().username,projectName:c.project_name||require("path").basename(n),language:c.language||"English",mode:c.mode||"guided",ides:w,modules:[],help:!1}),console.log(` \u2713 [${w.join(", ")}] \u2192 refreshed via install.js`)}if(d){let T=mA(l,"installed_version",i);cA(u,T)}else{c.installed_version=i;let{writeJsonAtomic:T}=Kt();T(u,c)}console.log(` \u2713 ${fe.relative(n,u)} \u2192 installed_version: ${i}`);try{let{migrateNamespace:T}=No(),{homedir:V}=dr(),I=T(n,V()),H=Object.values(I.removed).reduce((F,q)=>F+q,0);H>0&&(console.log(` \u{1F9F9} migrated ${H} legacy rihal-*/duplicate command registration(s)`),I.backupDir&&console.log(` backup: ${I.backupDir}`))}catch(T){console.log(` \u26A0 namespace migration skipped: ${T.message}`)}console.log();let{reports:C,hasDrift:A}=dA(n,e,g);A?(console.log("\u26A0 Post-update verification found drift:"),console.log(fA(C)),console.log(`
278
+ Run 'rcode doctor' for details, or re-run update to retry.`)):console.log(" \u2713 Post-update verification passed."),console.log(),console.log(f===i?`\u2705 rcode ${i} refreshed.`:`\u2705 rcode updated: ${f} \u2192 ${i}`),m.ok&&console.log(` Rollback: tar -xzf ${m.path}`),console.log()}Lo.exports.parseArgs=Ig;Lo.exports.detectInstalledEditors=Tg});var ac=v((ZI,ar)=>{var W=require("fs"),sc=require("os"),M=require("path"),{spawnSync:Pg}=require("child_process"),{askConfirm:Og,PromptAbortError:Ng}=as(),{writeFileAtomic:ic,safeRmSync:jr}=Kt();function _A(t){let e={editor:null,keepState:!1,deleteState:!1,yes:!1,purge:!1};for(let r of t)r.startsWith("--editor=")?e.editor=r.slice(9):r==="--keep-state"?e.keepState=!0:r==="--delete-state"?e.deleteState=!0:r==="--yes"||r==="-y"?e.yes=!0:(r==="--purge"||r==="--all")&&(e.purge=!0,e.deleteState=!0);return e}function Lg(t){return/\.local\.(md|mdc|json|yaml|yml|toml|js|ts)$/.test(t)}function Bg(t){return t.replace(/\n?# ===== rcode-managed gitignore block[\s\S]*?# ===== end rcode-managed gitignore block =====\n?/g,`
276
279
  `).replace(/\n?# >>> rcode >>>[\s\S]*?# <<< rcode <<<\n?/g,`
277
280
  `).replace(/\n{3,}/g,`
278
281
 
279
- `)}function yA(t){let e=q.join(t,".git","hooks","pre-commit");if(!H.existsSync(e))return"skipped";let r="# ===== rcode-managed pre-commit block =====",n="# ===== end rcode pre-commit block =====",s;try{s=H.readFileSync(e,"utf8")}catch{return"skipped"}if(!s.includes(r))return"unchanged";let i=s.indexOf(r),o=s.indexOf(n,i);if(o<0)return"unchanged";let a=i;a>0&&s[a-1]===`
282
+ `)}function bA(t){let e=M.join(t,".git","hooks","pre-commit");if(!W.existsSync(e))return"skipped";let r="# ===== rcode-managed pre-commit block =====",n="# ===== end rcode pre-commit block =====",s;try{s=W.readFileSync(e,"utf8")}catch{return"skipped"}if(!s.includes(r))return"unchanged";let i=s.indexOf(r),o=s.indexOf(n,i);if(o<0)return"unchanged";let a=i;a>0&&s[a-1]===`
280
283
  `&&a--;let u=o+n.length;u<s.length&&s[u]===`
281
- `&&u++;let c=s.slice(0,a)+s.slice(u),l=c.trim();if(l===""||l==="#!/bin/sh"||l==="#!/bin/bash")try{return H.unlinkSync(e),"removed"}catch{return"skipped"}try{return oc(e,c,{mode:493}),"stripped"}catch{return"skipped"}}function sc(t,e){if(!H.existsSync(t))return"skipped";let r;try{r=JSON.parse(H.readFileSync(t,"utf8"))}catch{return"skipped"}if(!r||typeof r!="object"||!r.hooks||!Array.isArray(r.hooks[e]))return"unchanged";let n=r.hooks[e].length;if(r.hooks[e]=r.hooks[e].filter(s=>!(Array.isArray(s?.hooks)&&s.hooks.some(i=>typeof i?.command=="string"&&i.command.includes("rcode-slash-router.cjs")))),r.hooks[e].length===n)return"unchanged";r.hooks[e].length===0&&delete r.hooks[e];try{return oc(t,JSON.stringify(r,null,2)+`
282
- `),"removed"}catch{return"skipped"}}function In(t,e){if(!H.existsSync(t))return 0;let r=0,n=q.resolve(process.cwd());for(let s of H.readdirSync(t,{withFileTypes:!0})){if(Ng(s.name)||!e(s.name))continue;let i=q.join(t,s.name),o=Fr(i,n);if(!o.ok&&o.reason==="outside-root"){console.log(` \u26A0 refused to remove ${i} \u2014 symlink resolves outside project root`);continue}r++}return r}function vA(t){if(!H.existsSync(t))return!1;try{if(H.readdirSync(t).length===0)return H.rmdirSync(t),!0}catch{}return!1}function _A(t,e){for(let r of e)vA(q.join(t,r))}function EA(t,e){let r={claude:{skills:[],commands:[],agents:[],agentsRulesDir:!1},cursor:[],windsurf:[],antigravity:[],gemini:[],vscode:[],agentsMd:null,stateDir:null,planningDir:null};if(e.includes("vscode")){e.includes("claude")||e.push("claude");let o=q.join(t,".vscode/rcode");H.existsSync(o)&&r.vscode.push(".vscode/rcode")}if(e.includes("claude")){let o=q.join(t,".claude/skills");H.existsSync(o)&&(r.claude.skills=H.readdirSync(o).filter(l=>l.startsWith("rcode-")||Mg(l)));let a=q.join(t,".claude/commands/rcode");H.existsSync(a)&&(r.claude.commands=H.readdirSync(a));let u=q.join(t,".claude/commands");if(H.existsSync(u)){let l=H.readdirSync(u).filter(d=>d.startsWith("rcode-")&&(d.endsWith(".md")||d.endsWith(".mdc")));r.claude.commands=[...r.claude.commands,...l]}let c=q.join(t,".claude/agents");if(H.existsSync(c)){let l=H.readdirSync(c);r.claude.agents=l.filter(d=>d.startsWith("rcode-")&&d.endsWith(".md")),r.claude.agents=[...r.claude.agents,...l.filter(d=>d.startsWith("rihal-")&&d.endsWith(".md"))]}H.existsSync(q.join(t,".claude/agents/rules"))&&(r.claude.agentsRulesDir=!0)}if(e.includes("cursor")){let o=q.join(t,".cursor/rules");H.existsSync(o)&&(r.cursor=H.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"||a==="rcode"))}if(e.includes("windsurf")){let o=q.join(t,".windsurf/rules");H.existsSync(o)&&(r.windsurf=H.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"))}if(e.includes("antigravity")){let o=q.join(t,".antigravity/agents");H.existsSync(o)&&(r.antigravity=H.readdirSync(o).filter(a=>a.startsWith("rcode-")))}if(e.includes("gemini"))for(let o of["agents","commands"]){let a=q.join(t,".gemini","rcode",o);if(H.existsSync(a))for(let u of H.readdirSync(a))(u.startsWith("rcode-")||u.endsWith(".md"))&&r.gemini.push(q.join(".gemini/rcode",o,u))}let n=q.join(t,"AGENTS.md");if(H.existsSync(n)){let o=H.readFileSync(n,"utf8");(o.includes("## rcode Agents (installed)")||o.includes("## rcode Method Agents (installed)"))&&(r.agentsMd="present")}let s=q.join(t,".rcode");if(H.existsSync(s)){let a=function(u){for(let c of H.readdirSync(u,{withFileTypes:!0}))c.isDirectory()?a(q.join(u,c.name)):o++};var i=a;let o=0;try{a(s)}catch{}r.stateDir={files:o}}return r}function Bg(){try{let{readPackageManifest:t}=ss(),e=q.resolve(__dirname,".."),r=t(e);if(r&&r.actions instanceof Set&&r.actions.size>0)return Array.from(r.actions)}catch{}return[]}var bA=Bg();function Mg(t){return bA.includes(t)}function qg(t,e,r={}){let n=[];for(let i of t.claude.skills)n.push(q.join(".claude/skills",i));for(let i of t.claude.commands)i.startsWith("rcode-")&&i.endsWith(".md")&&n.push(q.join(".claude/commands",i));t.claude.commands.some(i=>!i.startsWith("rcode-"))&&n.push(".claude/commands/rcode");for(let i of t.claude.agents)n.push(q.join(".claude/agents",i));t.claude.agentsRulesDir&&n.push(".claude/agents/rules");for(let i of t.cursor)n.push(q.join(".cursor/rules",i));for(let i of t.windsurf)n.push(q.join(".windsurf/rules",i));for(let i of t.antigravity)n.push(q.join(".antigravity/agents",i));if(Array.isArray(t.gemini))for(let i of t.gemini)n.push(i);if(Array.isArray(t.vscode))for(let i of t.vscode)n.push(i);if(t.agentsMd&&H.existsSync(q.join(e,"AGENTS.md"))&&n.push("AGENTS.md"),r.purge){let i=q.join(e,".rcode");if(H.existsSync(i))try{for(let o of H.readdirSync(i))o!=="backups"&&n.push(q.join(".rcode",o))}catch{}H.existsSync(q.join(e,".planning"))&&n.push(".planning")}return n}function SA(t,e,r={}){let n=qg(e,t,{purge:r.purge===!0}).map(l=>l.split(q.sep).join("/"));if(n.length===0)return{ok:!1,warning:"nothing to back up"};if(Rg("tar",["--version"],{stdio:"ignore"}).status!==0)return{ok:!1,warning:"tar not available on this system"};let i=r.purge?q.join(t,".rcode-backups"):q.join(t,".rcode/backups");try{H.mkdirSync(i,{recursive:!0})}catch(l){return{ok:!1,warning:`could not create ${q.relative(t,i)}/: ${l.message}`}}let o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),a=q.join(i,`uninstall-${o}.tgz`),u=q.relative(t,a),c=Rg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
284
+ `&&u++;let c=s.slice(0,a)+s.slice(u),l=c.trim();if(l===""||l==="#!/bin/sh"||l==="#!/bin/bash")try{return W.unlinkSync(e),"removed"}catch{return"skipped"}try{return ic(e,c,{mode:493}),"stripped"}catch{return"skipped"}}function oc(t,e){if(!W.existsSync(t))return"skipped";let r;try{r=JSON.parse(W.readFileSync(t,"utf8"))}catch{return"skipped"}if(!r||typeof r!="object"||!r.hooks||!Array.isArray(r.hooks[e]))return"unchanged";let n=r.hooks[e].length;if(r.hooks[e]=r.hooks[e].filter(s=>!(Array.isArray(s?.hooks)&&s.hooks.some(i=>typeof i?.command=="string"&&i.command.includes("rcode-slash-router.cjs")))),r.hooks[e].length===n)return"unchanged";r.hooks[e].length===0&&delete r.hooks[e];try{return ic(t,JSON.stringify(r,null,2)+`
285
+ `),"removed"}catch{return"skipped"}}function In(t,e){if(!W.existsSync(t))return 0;let r=0,n=M.resolve(process.cwd());for(let s of W.readdirSync(t,{withFileTypes:!0})){if(Lg(s.name)||!e(s.name))continue;let i=M.join(t,s.name),o=jr(i,n);if(!o.ok&&o.reason==="outside-root"){console.log(` \u26A0 refused to remove ${i} \u2014 symlink resolves outside project root`);continue}r++}return r}function SA(t){if(!W.existsSync(t))return!1;try{if(W.readdirSync(t).length===0)return W.rmdirSync(t),!0}catch{}return!1}function EA(t,e){for(let r of e)SA(M.join(t,r))}function CA(t,e){let r={claude:{skills:[],commands:[],agents:[],agentsRulesDir:!1},cursor:[],windsurf:[],antigravity:[],gemini:[],vscode:[],agentsMd:null,stateDir:null,planningDir:null};if(e.includes("vscode")){e.includes("claude")||e.push("claude");let o=M.join(t,".vscode/rcode");W.existsSync(o)&&r.vscode.push(".vscode/rcode")}if(e.includes("claude")){let o=M.join(t,".claude/skills");W.existsSync(o)&&(r.claude.skills=W.readdirSync(o).filter(l=>l.startsWith("rcode-")||qg(l)));let a=M.join(t,".claude/commands/rcode");W.existsSync(a)&&(r.claude.commands=W.readdirSync(a));let u=M.join(t,".claude/commands");if(W.existsSync(u)){let l=W.readdirSync(u).filter(d=>d.startsWith("rcode-")&&(d.endsWith(".md")||d.endsWith(".mdc")));r.claude.commands=[...r.claude.commands,...l]}let c=M.join(t,".claude/agents");if(W.existsSync(c)){let l=W.readdirSync(c);r.claude.agents=l.filter(d=>d.startsWith("rcode-")&&d.endsWith(".md")),r.claude.agents=[...r.claude.agents,...l.filter(d=>d.startsWith("rihal-")&&d.endsWith(".md"))]}W.existsSync(M.join(t,".claude/agents/rules"))&&(r.claude.agentsRulesDir=!0)}if(e.includes("cursor")){let o=M.join(t,".cursor/rules");W.existsSync(o)&&(r.cursor=W.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"||a==="rcode"))}if(e.includes("windsurf")){let o=M.join(t,".windsurf/rules");W.existsSync(o)&&(r.windsurf=W.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"))}if(e.includes("antigravity")){let o=M.join(t,".antigravity/agents");W.existsSync(o)&&(r.antigravity=W.readdirSync(o).filter(a=>a.startsWith("rcode-")))}if(e.includes("gemini"))for(let o of["agents","commands"]){let a=M.join(t,".gemini","rcode",o);if(W.existsSync(a))for(let u of W.readdirSync(a))(u.startsWith("rcode-")||u.endsWith(".md"))&&r.gemini.push(M.join(".gemini/rcode",o,u))}let n=M.join(t,"AGENTS.md");if(W.existsSync(n)){let o=W.readFileSync(n,"utf8");(o.includes("## rcode Agents (installed)")||o.includes("## rcode Method Agents (installed)"))&&(r.agentsMd="present")}let s=M.join(t,".rcode");if(W.existsSync(s)){let a=function(u){for(let c of W.readdirSync(u,{withFileTypes:!0}))c.isDirectory()?a(M.join(u,c.name)):o++};var i=a;let o=0;try{a(s)}catch{}r.stateDir={files:o}}return r}function Mg(){try{let{readPackageManifest:t}=ss(),e=M.resolve(__dirname,".."),r=t(e);if(r&&r.actions instanceof Set&&r.actions.size>0)return Array.from(r.actions)}catch{}return[]}var wA=Mg();function qg(t){return wA.includes(t)}function Wg(t,e,r={}){let n=[];for(let i of t.claude.skills)n.push(M.join(".claude/skills",i));for(let i of t.claude.commands)i.startsWith("rcode-")&&i.endsWith(".md")&&n.push(M.join(".claude/commands",i));t.claude.commands.some(i=>!i.startsWith("rcode-"))&&n.push(".claude/commands/rcode");for(let i of t.claude.agents)n.push(M.join(".claude/agents",i));t.claude.agentsRulesDir&&n.push(".claude/agents/rules");for(let i of t.cursor)n.push(M.join(".cursor/rules",i));for(let i of t.windsurf)n.push(M.join(".windsurf/rules",i));for(let i of t.antigravity)n.push(M.join(".antigravity/agents",i));if(Array.isArray(t.gemini))for(let i of t.gemini)n.push(i);if(Array.isArray(t.vscode))for(let i of t.vscode)n.push(i);if(t.agentsMd&&W.existsSync(M.join(e,"AGENTS.md"))&&n.push("AGENTS.md"),r.purge){let i=M.join(e,".rcode");if(W.existsSync(i))try{for(let o of W.readdirSync(i))o!=="backups"&&n.push(M.join(".rcode",o))}catch{}W.existsSync(M.join(e,".planning"))&&n.push(".planning")}return n}function xA(t,e,r={}){let n=Wg(e,t,{purge:r.purge===!0}).map(l=>l.split(M.sep).join("/"));if(n.length===0)return{ok:!1,warning:"nothing to back up"};if(Pg("tar",["--version"],{stdio:"ignore"}).status!==0)return{ok:!1,warning:"tar not available on this system"};let i=r.purge?M.join(t,".rcode-backups"):M.join(t,".rcode/backups");try{W.mkdirSync(i,{recursive:!0})}catch(l){return{ok:!1,warning:`could not create ${M.relative(t,i)}/: ${l.message}`}}let o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),a=M.join(i,`uninstall-${o}.tgz`),u=M.relative(t,a),c=Pg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
283
286
  `)+`
284
- `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar exited ${c.status}: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function CA(t){if(!H.existsSync(t))return!1;let e=H.readFileSync(t,"utf8"),r=!1,n=[/\n*---\n+## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*---\n+## rcode Method Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Method Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/];for(let s of n)s.test(e)&&(e=e.replace(s,""),r=!0);return r&&(e=e.replace(/\n---\n+$/,`
285
- `),oc(t,e)),r}ir.exports=async function(e){try{return await wA(e)}catch(r){throw r instanceof Og&&(console.log(`
286
- \u274C Uninstall cancelled \u2014 ${r.message}.`),process.exit(0)),r}};async function wA(t){let e=DA(t),r=process.cwd(),{SUPPORTED_IDES:n}=is(),s=e.editor?e.editor==="all"?Array.from(n):[e.editor]:Array.from(n);console.log(`
287
+ `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar exited ${c.status}: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function kA(t){if(!W.existsSync(t))return!1;let e=W.readFileSync(t,"utf8"),r=!1,n=[/\n*---\n+## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*---\n+## rcode Method Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Method Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/];for(let s of n)s.test(e)&&(e=e.replace(s,""),r=!0);return r&&(e=e.replace(/\n---\n+$/,`
288
+ `),ic(t,e)),r}ar.exports=async function(e){try{return await $A(e)}catch(r){throw r instanceof Ng&&(console.log(`
289
+ \u274C Uninstall cancelled \u2014 ${r.message}.`),process.exit(0)),r}};async function $A(t){let e=_A(t),r=process.cwd(),{SUPPORTED_IDES:n}=is(),s=e.editor?e.editor==="all"?Array.from(n):[e.editor]:Array.from(n);console.log(`
287
290
  \u{1F54C} rcode \u2014 Uninstall
288
- `),console.log(` Project: ${r}`),console.log(` Scope: ${s.join(", ")}`),console.log();let i=H.existsSync(q.join(r,".rcode/config.yaml"))||H.existsSync(q.join(r,".rcode/config.json")),o=H.existsSync(q.join(r,".claude/skills"))||H.existsSync(q.join(r,".cursor/rules"))||H.existsSync(q.join(r,".windsurf/rules"))||H.existsSync(q.join(r,".antigravity/agents"));if(!i&&!o){console.log(`
289
- \u274C rcode is not installed in this directory.`),console.log(" Nothing to uninstall."),console.log(),console.log(" To install: rcode install"),console.log();return}let a=EA(r,s),u=a.claude.skills.length,c=a.claude.commands.length,l=a.cursor.length,d=a.windsurf.length,f=a.antigravity.length,g=a.claude.agents.length,m=u+c+g+l+d+f;if(m===0&&!a.agentsMd&&!a.stateDir){console.log(`
291
+ `),console.log(` Project: ${r}`),console.log(` Scope: ${s.join(", ")}`),console.log();let i=W.existsSync(M.join(r,".rcode/config.yaml"))||W.existsSync(M.join(r,".rcode/config.json")),o=W.existsSync(M.join(r,".claude/skills"))||W.existsSync(M.join(r,".cursor/rules"))||W.existsSync(M.join(r,".windsurf/rules"))||W.existsSync(M.join(r,".antigravity/agents"));if(!i&&!o){console.log(`
292
+ \u274C rcode is not installed in this directory.`),console.log(" Nothing to uninstall."),console.log(),console.log(" To install: rcode install"),console.log();return}let a=CA(r,s),u=a.claude.skills.length,c=a.claude.commands.length,l=a.cursor.length,d=a.windsurf.length,f=a.antigravity.length,g=a.claude.agents.length,m=u+c+g+l+d+f;if(m===0&&!a.agentsMd&&!a.stateDir){console.log(`
290
293
  \u274C No rcode files found to remove.`),console.log(" The install markers are present but all files have already been deleted."),console.log();return}if(console.log(`What will be removed:
291
- `),s.includes("claude")&&(console.log(" Claude Code"),console.log(` .claude/skills/ (rcode-*): ${u} skills`),console.log(` .claude/commands/rcode/: ${c} slash commands`),console.log(` .claude/agents/rcode-*.md: ${g} agents`)),s.includes("cursor")&&(console.log(" Cursor"),console.log(` .cursor/rules/rcode-*.mdc: ${l} rules`)),s.includes("windsurf")&&(console.log(" Windsurf"),console.log(` .windsurf/rules/rcode-*.mdc: ${d} rules`)),s.includes("antigravity")&&(console.log(" Antigravity"),console.log(` .antigravity/agents/rcode-*: ${f} agents`)),a.agentsMd&&(console.log(" AGENTS.md"),console.log(" rcode section will be stripped (file preserved)")),a.stateDir&&(console.log(),console.log("\u26A0\uFE0F .rcode/ state directory detected"),console.log(` Contains ${a.stateDir.files} files (phases, decisions, progress, artifacts)`),console.log(" This is YOUR PROJECT DATA \u2014 not the skill files."),e.deleteState?console.log(" \u2192 Will be DELETED (--delete-state flag)"):e.keepState?console.log(" \u2192 Will be KEPT (--keep-state flag)"):console.log(" \u2192 Will ask separately after the main confirmation.")),console.log(),!e.yes&&!await Pg(`Proceed with removing ${m} skill/command files${a.agentsMd?" + AGENTS.md section":""}? [y/N] `,{default:"n"})){console.log(`
292
- \u274C Aborted. Nothing was removed.`);return}console.log();let D=SA(r,a,{purge:e.purge===!0});D.ok?(console.log(` \u{1F4BE} backup created: ${D.path}`),e.purge&&console.log(" includes .rcode/ and .planning/ (state, decisions, planning artifacts)")):console.log(` \u26A0 no backup created (${D.warning}) \u2014 continuing anyway`),console.log();let h=0;if(s.includes("claude")){let P=q.join(r,".claude/skills"),E=In(P,J=>J.startsWith("rcode-")||Mg(J));h+=E,E>0&&console.log(` \u2713 removed ${E} Claude skills`);let Q=q.join(r,".claude/commands/rcode");if(H.existsSync(Q)){let J=Fr(Q,q.resolve(r));!J.ok&&J.reason==="outside-root"&&console.log(` \u26A0 refused to remove ${Q} \u2014 symlink resolves outside project root`)}let re=q.join(r,".claude/commands"),le=0;if(H.existsSync(re))for(let J of H.readdirSync(re))J.startsWith("rcode-")&&(J.endsWith(".md")||J.endsWith(".mdc"))&&(H.unlinkSync(q.join(re,J)),le++);let $=a.claude.commands.length;h+=$,$>0&&console.log(` \u2713 removed ${$} slash commands from .claude/commands/`);let k=q.join(r,".claude/agents"),he=In(k,J=>J.startsWith("rcode-")&&J.endsWith(".md"));if(h+=he,he>0&&console.log(` \u2713 removed ${he} Claude agents`),a.claude.agentsRulesDir){let J=q.join(r,".claude/agents/rules"),xe=Fr(J,q.resolve(r));xe.ok&&xe.reason!=="missing"?console.log(" \u2713 removed .claude/agents/rules/ (agent reference rules)"):xe.reason==="outside-root"&&console.log(" \u26A0 refused to remove .claude/agents/rules/ \u2014 symlink resolves outside project root")}try{H.existsSync(q.join(r,".claude/commands"))&&H.readdirSync(q.join(r,".claude/commands")).length===0&&H.rmdirSync(q.join(r,".claude/commands")),H.existsSync(k)&&H.readdirSync(k).length===0&&H.rmdirSync(k)}catch{}}if(s.includes("cursor")){let P=q.join(r,".cursor/rules"),E=In(P,Q=>Q.startsWith("rcode-")||Q==="rcode.mdc"||Q==="rcode-method.mdc"||Q==="rcode");h+=E,E>0&&console.log(` \u2713 removed ${E} Cursor rules`)}if(s.includes("windsurf")){let P=q.join(r,".windsurf/rules"),E=In(P,Q=>Q.startsWith("rcode-")||Q==="rcode.mdc"||Q==="rcode-method.mdc");h+=E,E>0&&console.log(` \u2713 removed ${E} Windsurf rules`)}if(s.includes("antigravity")){let P=q.join(r,".antigravity/agents"),E=In(P,Q=>Q.startsWith("rcode-"));h+=E,E>0&&console.log(` \u2713 removed ${E} Antigravity agents`)}if(s.includes("codex")&&sc(q.join(nc.homedir(),".codex","hooks.json"),"UserPromptSubmit")==="removed"&&console.log(" \u2713 removed rcode slash-router hook from ~/.codex/hooks.json"),s.includes("antigravity")&&sc(q.join(nc.homedir(),".gemini","antigravity","settings.json"),"UserPrompt")==="removed"&&console.log(" \u2713 removed rcode slash-router hook from ~/.gemini/antigravity/settings.json"),s.includes("codex")||s.includes("antigravity")){let P=nc.homedir();for(let E of[q.join(P,".rcode","slash-commands"),q.join(P,".rcode","bin")])H.existsSync(E)&&Fr(E,P).ok&&console.log(` \u2713 removed ${E}`)}if(s.includes("gemini")){let P=0;for(let E of["agents","commands"]){let Q=q.join(r,".gemini","rcode",E);P+=In(Q,re=>re.startsWith("rcode-")||re.endsWith(".md"))}h+=P,P>0&&console.log(` \u2713 removed ${P} Gemini files`)}if(s.includes("vscode")){let P=q.join(r,".vscode/rcode");H.existsSync(P)&&Fr(P,q.resolve(r)).ok&&(h+=1,console.log(" \u2713 removed .vscode/rcode/ marker"))}if(a.agentsMd){let P=q.join(r,"AGENTS.md");CA(P)&&console.log(" \u2713 stripped rcode section from AGENTS.md")}let w=q.join(r,".gitignore");if(H.existsSync(w))try{let P=H.readFileSync(w,"utf8"),E=Lg(P);E!==P&&(H.writeFileSync(w,E),console.log(" \u2713 stripped rcode block from .gitignore"))}catch(P){console.log(` \u26A0 could not strip .gitignore block: ${P.message}`)}let C=yA(r);C==="removed"?console.log(" \u2713 removed .git/hooks/pre-commit (was rcode-only)"):C==="stripped"&&console.log(" \u2713 stripped rcode block from .git/hooks/pre-commit"),_A(r,[".claude/skills",".claude/commands",".claude",".cursor/rules",".cursor",".windsurf/rules",".windsurf",".antigravity/agents",".antigravity"]);let A=q.join(r,".rcode","brain");if(H.existsSync(A)){let P=Fr(A,q.resolve(r));P.ok?console.log(" \u2713 removed .rcode/brain/ (pulled content, will refresh on reinstall)"):P.reason==="outside-root"&&console.log(" \u26A0 refused to remove .rcode/brain/ \u2014 symlink resolves outside project root")}if(a.stateDir){let P=q.join(r,".rcode"),E=e.deleteState;if(!e.deleteState&&!e.keepState&&!e.yes&&(console.log(),console.log("\u26A0\uFE0F The .rcode/ state directory contains your project data:"),console.log(" - config.yaml, state.json, JOURNEY.md"),console.log(" - phases, decisions, progress, artifacts, context"),console.log(` - ${a.stateDir.files} files total`),console.log(),console.log(' If you keep it: /rcode-init will report "already configured"'),console.log(" and reuse your existing config + history on next install."),console.log(" If you delete it: next install starts fresh \u2014 no carry-over."),console.log(),E=await Pg("Also delete .rcode/ state? This is destructive and cannot be undone. [y/N] ",{default:"n"})),E){let Q=Fr(P,q.resolve(r));Q.ok?console.log(" \u2713 removed .rcode/ state directory"):Q.reason==="outside-root"?console.log(" \u26A0 refused to remove .rcode/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .rcode/: ${Q.reason}`)}else console.log(" \u2139 kept .rcode/ state directory (your project data is preserved)")}if(e.purge){let P=q.join(r,".planning");if(H.existsSync(P)){let E=Fr(P,q.resolve(r));E.ok?console.log(" \u2713 removed .planning/ (--purge)"):E.reason==="outside-root"?console.log(" \u26A0 refused to remove .planning/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .planning/: ${E.reason}`)}}console.log(`
293
- \u2705 Uninstall complete. Removed ${h} files.`),D.ok&&console.log(` Backup: ${D.path} (restore with: tar -xzf ${D.path})`);let T=a.stateDir&&H.existsSync(q.join(r,".rcode")),G=!e.purge&&H.existsSync(q.join(r,".planning")),I=!e.purge&&H.existsSync(q.join(r,".claude/agents/rules")),Z=!e.purge&&(()=>{let P=q.join(r,".cursor/rules");if(!H.existsSync(P))return!1;try{return H.readdirSync(P).some(E=>E.startsWith("rcode-")||E==="rcode.mdc"||E==="rcode-method.mdc"||E==="rcode")}catch{return!1}})(),F=!e.purge&&(()=>{try{let P=q.join(r,".gitignore");if(!H.existsSync(P))return!1;let E=H.readFileSync(P,"utf8");return E.includes("# ===== rcode-managed gitignore block")||E.includes("# >>> rcode >>>")}catch{return!1}})(),W=!e.purge&&(()=>{let P=q.join(r,".git/hooks/pre-commit");if(!H.existsSync(P))return!1;try{return H.readFileSync(P,"utf8").includes("# ===== rcode-managed pre-commit block =====")}catch{return!1}})();(T||G||I||Z||F||W)&&(console.log(),console.log("\u2139 Preserved (use --purge to remove all of these):"),T&&console.log(" .rcode/ project state, config, decisions"),G&&console.log(" .planning/ ROADMAP, STATE, PROJECT scaffolds"),I&&console.log(" .claude/agents/rules/ agent rule files"),Z&&console.log(" .cursor/ Cursor IDE integration"),F&&console.log(" .gitignore rcode-managed block still present"),W&&console.log(" .git/hooks/ pre-commit hook still present"),console.log(),console.log(" Full cleanup: rcode uninstall --purge")),console.log(),console.log("\u{1F4A1} IDE reload required:"),console.log(' VS Code / Cursor: Cmd+Shift+P \u2192 "Developer: Reload Window"'),console.log(" If commands still appear after reload, check ~/.claude/commands/ for"),console.log(" any globally-installed rcode-* items (rcode does not touch global installs)."),console.log(`
294
- To reinstall later:`),console.log(" rcode install")}ir.exports.isLocalOverride=Ng;ir.exports.planToPathList=qg;ir.exports.discoverKnownActionSkills=Bg;ir.exports.stripRcodeGitignoreBlock=Lg;ir.exports.removeSlashRouterHook=sc;require.main===ir&&ir.exports(process.argv.slice(2)).catch(t=>{t instanceof Og&&(console.log(`
294
+ `),s.includes("claude")&&(console.log(" Claude Code"),console.log(` .claude/skills/ (rcode-*): ${u} skills`),console.log(` .claude/commands/rcode/: ${c} slash commands`),console.log(` .claude/agents/rcode-*.md: ${g} agents`)),s.includes("cursor")&&(console.log(" Cursor"),console.log(` .cursor/rules/rcode-*.mdc: ${l} rules`)),s.includes("windsurf")&&(console.log(" Windsurf"),console.log(` .windsurf/rules/rcode-*.mdc: ${d} rules`)),s.includes("antigravity")&&(console.log(" Antigravity"),console.log(` .antigravity/agents/rcode-*: ${f} agents`)),a.agentsMd&&(console.log(" AGENTS.md"),console.log(" rcode section will be stripped (file preserved)")),a.stateDir&&(console.log(),console.log("\u26A0\uFE0F .rcode/ state directory detected"),console.log(` Contains ${a.stateDir.files} files (phases, decisions, progress, artifacts)`),console.log(" This is YOUR PROJECT DATA \u2014 not the skill files."),e.deleteState?console.log(" \u2192 Will be DELETED (--delete-state flag)"):e.keepState?console.log(" \u2192 Will be KEPT (--keep-state flag)"):console.log(" \u2192 Will ask separately after the main confirmation.")),console.log(),!e.yes&&!await Og(`Proceed with removing ${m} skill/command files${a.agentsMd?" + AGENTS.md section":""}? [y/N] `,{default:"n"})){console.log(`
295
+ \u274C Aborted. Nothing was removed.`);return}console.log();let y=xA(r,a,{purge:e.purge===!0});y.ok?(console.log(` \u{1F4BE} backup created: ${y.path}`),e.purge&&console.log(" includes .rcode/ and .planning/ (state, decisions, planning artifacts)")):console.log(` \u26A0 no backup created (${y.warning}) \u2014 continuing anyway`),console.log();let h=0;if(s.includes("claude")){let P=M.join(r,".claude/skills"),b=In(P,X=>X.startsWith("rcode-")||qg(X));h+=b,b>0&&console.log(` \u2713 removed ${b} Claude skills`);let Q=M.join(r,".claude/commands/rcode");if(W.existsSync(Q)){let X=jr(Q,M.resolve(r));!X.ok&&X.reason==="outside-root"&&console.log(` \u26A0 refused to remove ${Q} \u2014 symlink resolves outside project root`)}let re=M.join(r,".claude/commands"),de=0;if(W.existsSync(re))for(let X of W.readdirSync(re))X.startsWith("rcode-")&&(X.endsWith(".md")||X.endsWith(".mdc"))&&(W.unlinkSync(M.join(re,X)),de++);let x=a.claude.commands.length;h+=x,x>0&&console.log(` \u2713 removed ${x} slash commands from .claude/commands/`);let k=M.join(r,".claude/agents"),he=In(k,X=>X.startsWith("rcode-")&&X.endsWith(".md"));if(h+=he,he>0&&console.log(` \u2713 removed ${he} Claude agents`),a.claude.agentsRulesDir){let X=M.join(r,".claude/agents/rules"),Ee=jr(X,M.resolve(r));Ee.ok&&Ee.reason!=="missing"?console.log(" \u2713 removed .claude/agents/rules/ (agent reference rules)"):Ee.reason==="outside-root"&&console.log(" \u26A0 refused to remove .claude/agents/rules/ \u2014 symlink resolves outside project root")}try{W.existsSync(M.join(r,".claude/commands"))&&W.readdirSync(M.join(r,".claude/commands")).length===0&&W.rmdirSync(M.join(r,".claude/commands")),W.existsSync(k)&&W.readdirSync(k).length===0&&W.rmdirSync(k)}catch{}}if(s.includes("cursor")){let P=M.join(r,".cursor/rules"),b=In(P,Q=>Q.startsWith("rcode-")||Q==="rcode.mdc"||Q==="rcode-method.mdc"||Q==="rcode");h+=b,b>0&&console.log(` \u2713 removed ${b} Cursor rules`)}if(s.includes("windsurf")){let P=M.join(r,".windsurf/rules"),b=In(P,Q=>Q.startsWith("rcode-")||Q==="rcode.mdc"||Q==="rcode-method.mdc");h+=b,b>0&&console.log(` \u2713 removed ${b} Windsurf rules`)}if(s.includes("antigravity")){let P=M.join(r,".antigravity/agents"),b=In(P,Q=>Q.startsWith("rcode-"));h+=b,b>0&&console.log(` \u2713 removed ${b} Antigravity agents`)}if(s.includes("codex")&&oc(M.join(sc.homedir(),".codex","hooks.json"),"UserPromptSubmit")==="removed"&&console.log(" \u2713 removed rcode slash-router hook from ~/.codex/hooks.json"),s.includes("antigravity")&&oc(M.join(sc.homedir(),".gemini","antigravity","settings.json"),"UserPrompt")==="removed"&&console.log(" \u2713 removed rcode slash-router hook from ~/.gemini/antigravity/settings.json"),s.includes("codex")||s.includes("antigravity")){let P=sc.homedir();for(let b of[M.join(P,".rcode","slash-commands"),M.join(P,".rcode","bin")])W.existsSync(b)&&jr(b,P).ok&&console.log(` \u2713 removed ${b}`)}if(s.includes("gemini")){let P=0;for(let b of["agents","commands"]){let Q=M.join(r,".gemini","rcode",b);P+=In(Q,re=>re.startsWith("rcode-")||re.endsWith(".md"))}h+=P,P>0&&console.log(` \u2713 removed ${P} Gemini files`)}if(s.includes("vscode")){let P=M.join(r,".vscode/rcode");W.existsSync(P)&&jr(P,M.resolve(r)).ok&&(h+=1,console.log(" \u2713 removed .vscode/rcode/ marker"))}if(a.agentsMd){let P=M.join(r,"AGENTS.md");kA(P)&&console.log(" \u2713 stripped rcode section from AGENTS.md")}let w=M.join(r,".gitignore");if(W.existsSync(w))try{let P=W.readFileSync(w,"utf8"),b=Bg(P);b!==P&&(W.writeFileSync(w,b),console.log(" \u2713 stripped rcode block from .gitignore"))}catch(P){console.log(` \u26A0 could not strip .gitignore block: ${P.message}`)}let C=bA(r);C==="removed"?console.log(" \u2713 removed .git/hooks/pre-commit (was rcode-only)"):C==="stripped"&&console.log(" \u2713 stripped rcode block from .git/hooks/pre-commit"),EA(r,[".claude/skills",".claude/commands",".claude",".cursor/rules",".cursor",".windsurf/rules",".windsurf",".antigravity/agents",".antigravity"]);let A=M.join(r,".rcode","brain");if(W.existsSync(A)){let P=jr(A,M.resolve(r));P.ok?console.log(" \u2713 removed .rcode/brain/ (pulled content, will refresh on reinstall)"):P.reason==="outside-root"&&console.log(" \u26A0 refused to remove .rcode/brain/ \u2014 symlink resolves outside project root")}if(a.stateDir){let P=M.join(r,".rcode"),b=e.deleteState;if(!e.deleteState&&!e.keepState&&!e.yes&&(console.log(),console.log("\u26A0\uFE0F The .rcode/ state directory contains your project data:"),console.log(" - config.yaml, state.json, JOURNEY.md"),console.log(" - phases, decisions, progress, artifacts, context"),console.log(` - ${a.stateDir.files} files total`),console.log(),console.log(' If you keep it: /rcode-init will report "already configured"'),console.log(" and reuse your existing config + history on next install."),console.log(" If you delete it: next install starts fresh \u2014 no carry-over."),console.log(),b=await Og("Also delete .rcode/ state? This is destructive and cannot be undone. [y/N] ",{default:"n"})),b){let Q=jr(P,M.resolve(r));Q.ok?console.log(" \u2713 removed .rcode/ state directory"):Q.reason==="outside-root"?console.log(" \u26A0 refused to remove .rcode/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .rcode/: ${Q.reason}`)}else console.log(" \u2139 kept .rcode/ state directory (your project data is preserved)")}if(e.purge){let P=M.join(r,".planning");if(W.existsSync(P)){let b=jr(P,M.resolve(r));b.ok?console.log(" \u2713 removed .planning/ (--purge)"):b.reason==="outside-root"?console.log(" \u26A0 refused to remove .planning/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .planning/: ${b.reason}`)}}console.log(`
296
+ \u2705 Uninstall complete. Removed ${h} files.`),y.ok&&console.log(` Backup: ${y.path} (restore with: tar -xzf ${y.path})`);let T=a.stateDir&&W.existsSync(M.join(r,".rcode")),V=!e.purge&&W.existsSync(M.join(r,".planning")),I=!e.purge&&W.existsSync(M.join(r,".claude/agents/rules")),H=!e.purge&&(()=>{let P=M.join(r,".cursor/rules");if(!W.existsSync(P))return!1;try{return W.readdirSync(P).some(b=>b.startsWith("rcode-")||b==="rcode.mdc"||b==="rcode-method.mdc"||b==="rcode")}catch{return!1}})(),F=!e.purge&&(()=>{try{let P=M.join(r,".gitignore");if(!W.existsSync(P))return!1;let b=W.readFileSync(P,"utf8");return b.includes("# ===== rcode-managed gitignore block")||b.includes("# >>> rcode >>>")}catch{return!1}})(),q=!e.purge&&(()=>{let P=M.join(r,".git/hooks/pre-commit");if(!W.existsSync(P))return!1;try{return W.readFileSync(P,"utf8").includes("# ===== rcode-managed pre-commit block =====")}catch{return!1}})();(T||V||I||H||F||q)&&(console.log(),console.log("\u2139 Preserved (use --purge to remove all of these):"),T&&console.log(" .rcode/ project state, config, decisions"),V&&console.log(" .planning/ ROADMAP, STATE, PROJECT scaffolds"),I&&console.log(" .claude/agents/rules/ agent rule files"),H&&console.log(" .cursor/ Cursor IDE integration"),F&&console.log(" .gitignore rcode-managed block still present"),q&&console.log(" .git/hooks/ pre-commit hook still present"),console.log(),console.log(" Full cleanup: rcode uninstall --purge")),console.log(),console.log("\u{1F4A1} IDE reload required:"),console.log(' VS Code / Cursor: Cmd+Shift+P \u2192 "Developer: Reload Window"'),console.log(" If commands still appear after reload, check ~/.claude/commands/ for"),console.log(" any globally-installed rcode-* items (rcode does not touch global installs)."),console.log(`
297
+ To reinstall later:`),console.log(" rcode install")}ar.exports.isLocalOverride=Lg;ar.exports.planToPathList=Wg;ar.exports.discoverKnownActionSkills=Mg;ar.exports.stripRcodeGitignoreBlock=Bg;ar.exports.removeSlashRouterHook=oc;require.main===ar&&ar.exports(process.argv.slice(2)).catch(t=>{t instanceof Ng&&(console.log(`
295
298
  \u274C Aborted.`),process.exit(1)),console.error(`
296
- \u274C Uninstall failed: ${t.message}`),process.env.DEBUG&&console.error(t.stack),process.exit(1)})});var Zg=v((WI,Hg)=>{"use strict";var cs=require("fs"),Ee=require("path"),{spawnSync:ar}=require("child_process"),{homedir:ac}=lr();function He(t){try{return cs.accessSync(t),!0}catch{return!1}}function Tn(t){try{return cs.readdirSync(t)}catch{return[]}}function xA(){let t=ac(),e=[];try{let n=ar("npm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"npm",dir:n.stdout.trim()})}catch{}try{let n=ar("pnpm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"pnpm",dir:n.stdout.trim()})}catch{}try{let n=ar("yarn",["global","dir"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"yarn",dir:Ee.join(n.stdout.trim(),"node_modules")})}catch{}try{let n=ar("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"bun",dir:Ee.join(t,".bun","install","global","node_modules")})}catch{}let r=Ee.join(t,".nvm","versions","node");if(He(r))for(let n of Tn(r)){let s=Ee.join(r,n,"lib","node_modules");He(s)&&!e.some(i=>i.dir===s)&&e.push({manager:`nvm/${n}`,dir:s})}return e}function $A(t){let e=[];for(let r of["@hanzlaa","@hanzlahabib"]){let n=Ee.join(t,r);if(He(n))for(let s of Tn(n))(s==="rcode"||s==="rcode"||s.startsWith("rcode"))&&e.push({scope:r,pkg:s,dir:Ee.join(n,s)})}return e}function kA(){let t=ac(),e=new Set;try{let n=ar("npm",["prefix","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(Ee.join(n.stdout.trim(),"bin"))}catch{}try{let n=ar("pnpm",["bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=ar("yarn",["global","bin"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=ar("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}e.add(Ee.join(t,".local","share","pnpm")),e.add(Ee.join(t,".local","bin")),e.add(Ee.join(t,".bun","bin"));let r=Ee.join(t,".nvm","versions","node");if(He(r))for(let n of Tn(r))e.add(Ee.join(r,n,"bin"));return[...e].filter(He)}var AA=["rcode","rcode","rcode"];function FA(t){let e=[];for(let r of AA){let n=Ee.join(t,r);if(He(n)){let s=null;try{s=cs.readlinkSync(n)}catch{}(!s||/rcode|rcode|@hanzlaa|@hanzlahabib/.test(s))&&e.push({name:r,path:n,target:s})}}return e}function Wg(t){let e=[];if(!He(t))return e;let r=Ee.join(t,"commands");if(He(r)){for(let o of Tn(r))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&e.push({kind:"command",path:Ee.join(r,o)});let i=Ee.join(r,"rcode");He(i)&&e.push({kind:"commands-dir",path:i})}let n=Ee.join(t,"agents");if(He(n))for(let i of Tn(n))i.startsWith("rcode-")&&(i.endsWith(".md")||i.endsWith(".mdc"))&&e.push({kind:"agent",path:Ee.join(n,i)});let s=Ee.join(t,"skills");if(He(s))for(let i of Tn(s))i.startsWith("rcode-")&&e.push({kind:"skill-dir",path:Ee.join(s,i)});return e}function jA({includePlanning:t}){let e=ac(),r=process.cwd(),n={packages:[],bins:[],globalClaude:[],globalrcode:null,projectClaude:[],projectrcode:null,projectPlanning:null};for(let{manager:o,dir:a}of xA())for(let u of $A(a))n.packages.push({manager:o,...u});for(let o of kA())for(let a of FA(o))n.bins.push({binDir:o,...a});n.globalClaude=Wg(Ee.join(e,".claude"));let s=Ee.join(e,".rcode");He(s)&&(n.globalrcode=s),n.projectClaude=Wg(Ee.join(r,".claude"));let i=Ee.join(r,".rcode");if(He(i)&&r!==e&&(n.projectrcode=i),t){let o=Ee.join(r,".planning");He(o)&&r!==e&&(n.projectPlanning=o)}return n}function IA(t,{dryRun:e}){console.log(`
299
+ \u274C Uninstall failed: ${t.message}`),process.env.DEBUG&&console.error(t.stack),process.exit(1)})});var Ug=v((UI,Zg)=>{"use strict";var cs=require("fs"),be=require("path"),{spawnSync:ur}=require("child_process"),{homedir:uc}=dr();function Ue(t){try{return cs.accessSync(t),!0}catch{return!1}}function Tn(t){try{return cs.readdirSync(t)}catch{return[]}}function AA(){let t=uc(),e=[];try{let n=ur("npm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"npm",dir:n.stdout.trim()})}catch{}try{let n=ur("pnpm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"pnpm",dir:n.stdout.trim()})}catch{}try{let n=ur("yarn",["global","dir"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"yarn",dir:be.join(n.stdout.trim(),"node_modules")})}catch{}try{let n=ur("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"bun",dir:be.join(t,".bun","install","global","node_modules")})}catch{}let r=be.join(t,".nvm","versions","node");if(Ue(r))for(let n of Tn(r)){let s=be.join(r,n,"lib","node_modules");Ue(s)&&!e.some(i=>i.dir===s)&&e.push({manager:`nvm/${n}`,dir:s})}return e}function FA(t){let e=[];for(let r of["@hanzlaa","@hanzlahabib"]){let n=be.join(t,r);if(Ue(n))for(let s of Tn(n))(s==="rcode"||s==="rcode"||s.startsWith("rcode"))&&e.push({scope:r,pkg:s,dir:be.join(n,s)})}return e}function jA(){let t=uc(),e=new Set;try{let n=ur("npm",["prefix","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(be.join(n.stdout.trim(),"bin"))}catch{}try{let n=ur("pnpm",["bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=ur("yarn",["global","bin"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=ur("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}e.add(be.join(t,".local","share","pnpm")),e.add(be.join(t,".local","bin")),e.add(be.join(t,".bun","bin"));let r=be.join(t,".nvm","versions","node");if(Ue(r))for(let n of Tn(r))e.add(be.join(r,n,"bin"));return[...e].filter(Ue)}var IA=["rcode","rcode","rcode"];function TA(t){let e=[];for(let r of IA){let n=be.join(t,r);if(Ue(n)){let s=null;try{s=cs.readlinkSync(n)}catch{}(!s||/rcode|rcode|@hanzlaa|@hanzlahabib/.test(s))&&e.push({name:r,path:n,target:s})}}return e}function Hg(t){let e=[];if(!Ue(t))return e;let r=be.join(t,"commands");if(Ue(r)){for(let o of Tn(r))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&e.push({kind:"command",path:be.join(r,o)});let i=be.join(r,"rcode");Ue(i)&&e.push({kind:"commands-dir",path:i})}let n=be.join(t,"agents");if(Ue(n))for(let i of Tn(n))i.startsWith("rcode-")&&(i.endsWith(".md")||i.endsWith(".mdc"))&&e.push({kind:"agent",path:be.join(n,i)});let s=be.join(t,"skills");if(Ue(s))for(let i of Tn(s))i.startsWith("rcode-")&&e.push({kind:"skill-dir",path:be.join(s,i)});return e}function RA({includePlanning:t}){let e=uc(),r=process.cwd(),n={packages:[],bins:[],globalClaude:[],globalrcode:null,projectClaude:[],projectrcode:null,projectPlanning:null};for(let{manager:o,dir:a}of AA())for(let u of FA(a))n.packages.push({manager:o,...u});for(let o of jA())for(let a of TA(o))n.bins.push({binDir:o,...a});n.globalClaude=Hg(be.join(e,".claude"));let s=be.join(e,".rcode");Ue(s)&&(n.globalrcode=s),n.projectClaude=Hg(be.join(r,".claude"));let i=be.join(r,".rcode");if(Ue(i)&&r!==e&&(n.projectrcode=i),t){let o=be.join(r,".planning");Ue(o)&&r!==e&&(n.projectPlanning=o)}return n}function PA(t,{dryRun:e}){console.log(`
297
300
  \u{1F525} rcode nuke \xB7 by Hanzla Habib ${e?"[DRY RUN \u2014 pass --yes to remove]":"[REMOVING]"}
298
301
  `);let n=0,s=(i,o)=>{if(!(!o||Array.isArray(o)&&o.length===0)){if(console.log(`${i}`),Array.isArray(o))for(let a of o)console.log(` \u2022 ${a.description||a.path||a.dir||JSON.stringify(a)}`),n++;else console.log(` \u2022 ${o}`),n++;console.log("")}};return s("\u{1F4E6} Global packages (node_modules):",t.packages.map(i=>({description:`[${i.manager}] ${i.scope}/${i.pkg} \u2192 ${i.dir}`}))),s("\u{1F517} Global binaries:",t.bins.map(i=>({description:`${i.path}${i.target?` \u2192 ${i.target}`:""}`}))),s("\u{1F916} ~/.claude/ artifacts:",t.globalClaude.map(i=>({description:`[${i.kind}] ${i.path}`}))),t.globalrcode&&s("\u{1F5C2}\uFE0F ~/.rcode/ (global state):",t.globalrcode),s("\u{1F916} ./.claude/ artifacts (current project):",t.projectClaude.map(i=>({description:`[${i.kind}] ${i.path}`}))),t.projectrcode&&s("\u{1F5C2}\uFE0F ./.rcode/ (project state):",t.projectrcode),t.projectPlanning&&s("\u{1F4CB} ./.planning/ (your work \u2014 only with --include-planning):",t.projectPlanning),console.log(n===0?` \u2713 nothing to remove \u2014 system is clean.
299
302
  `:` Total: ${n} item(s).
300
- `),n}function an(t){try{return cs.rmSync(t,{recursive:!0,force:!0}),!0}catch(e){return console.warn(` \u26A0 failed to remove ${t}: ${e.message}`),!1}}function TA(t,e,r){let n=`${e}/${r}`,s=t==="pnpm"?["pnpm",["remove","-g",n]]:t==="yarn"?["yarn",["global","remove",n]]:t==="bun"?["bun",["remove","-g",n]]:["npm",["uninstall","-g",n]];try{return ar(s[0],s[1],{stdio:"pipe",encoding:"utf8"}).status===0}catch{return!1}}function RA(t){let e=0;for(let r of t.packages){let n=r.manager.startsWith("nvm/")?"npm":r.manager;process.stdout.write(` ${n} uninstall ${r.scope}/${r.pkg} ... `);let s=TA(n,r.scope,r.pkg);console.log(s?"\u2713":"\u26A0 failed via PM, falling back to rm"),s||an(r.dir),e++}for(let r of t.bins)He(r.path)&&an(r.path)&&(console.log(` \u2713 removed bin ${r.path}`),e++);for(let r of t.globalClaude)an(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);t.globalrcode&&an(t.globalrcode)&&(console.log(` \u2713 removed ${t.globalrcode}`),e++);for(let r of t.projectClaude)an(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);return t.projectrcode&&an(t.projectrcode)&&(console.log(` \u2713 removed ${t.projectrcode}`),e++),t.projectPlanning&&an(t.projectPlanning)&&(console.log(` \u2713 removed ${t.projectPlanning}`),e++),e}Hg.exports=function(e=[]){let r=!e.includes("--yes")&&!e.includes("-y"),n=e.includes("--include-planning"),s=Ee.join(process.cwd(),"package.json");if(He(s))try{let u=JSON.parse(cs.readFileSync(s,"utf8"));if((u.name==="@hanzlaa/rcode"||u.name==="@hanzlahabib/rihal-code")&&(console.log(`
303
+ `),n}function an(t){try{return cs.rmSync(t,{recursive:!0,force:!0}),!0}catch(e){return console.warn(` \u26A0 failed to remove ${t}: ${e.message}`),!1}}function OA(t,e,r){let n=`${e}/${r}`,s=t==="pnpm"?["pnpm",["remove","-g",n]]:t==="yarn"?["yarn",["global","remove",n]]:t==="bun"?["bun",["remove","-g",n]]:["npm",["uninstall","-g",n]];try{return ur(s[0],s[1],{stdio:"pipe",encoding:"utf8"}).status===0}catch{return!1}}function NA(t){let e=0;for(let r of t.packages){let n=r.manager.startsWith("nvm/")?"npm":r.manager;process.stdout.write(` ${n} uninstall ${r.scope}/${r.pkg} ... `);let s=OA(n,r.scope,r.pkg);console.log(s?"\u2713":"\u26A0 failed via PM, falling back to rm"),s||an(r.dir),e++}for(let r of t.bins)Ue(r.path)&&an(r.path)&&(console.log(` \u2713 removed bin ${r.path}`),e++);for(let r of t.globalClaude)an(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);t.globalrcode&&an(t.globalrcode)&&(console.log(` \u2713 removed ${t.globalrcode}`),e++);for(let r of t.projectClaude)an(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);return t.projectrcode&&an(t.projectrcode)&&(console.log(` \u2713 removed ${t.projectrcode}`),e++),t.projectPlanning&&an(t.projectPlanning)&&(console.log(` \u2713 removed ${t.projectPlanning}`),e++),e}Zg.exports=function(e=[]){let r=!e.includes("--yes")&&!e.includes("-y"),n=e.includes("--include-planning"),s=be.join(process.cwd(),"package.json");if(Ue(s))try{let u=JSON.parse(cs.readFileSync(s,"utf8"));if((u.name==="@hanzlaa/rcode"||u.name==="@hanzlahabib/rihal-code")&&(console.log(`
301
304
  \u26A0 You are inside the rcode source repo.`),console.log(" Nuke would remove this repo's .claude/, .rcode/, and possibly .planning/."),console.log(" That is your source code \u2014 almost certainly not what you want."),console.log(` Run nuke from a different directory, or pass --i-know-what-im-doing to override.
302
- `),!e.includes("--i-know-what-im-doing")))return}catch{}let i=jA({includePlanning:n}),o=IA(i,{dryRun:r});if(o===0||r){r&&o>0&&(console.log("To actually remove these, re-run with: rcode nuke --yes"),console.log(`To also remove .planning/ (your work): rcode nuke --yes --include-planning
305
+ `),!e.includes("--i-know-what-im-doing")))return}catch{}let i=RA({includePlanning:n}),o=PA(i,{dryRun:r});if(o===0||r){r&&o>0&&(console.log("To actually remove these, re-run with: rcode nuke --yes"),console.log(`To also remove .planning/ (your work): rcode nuke --yes --include-planning
303
306
  `));return}console.log(`Executing...
304
- `);let a=RA(i);console.log(`
307
+ `);let a=NA(i);console.log(`
305
308
  \u2705 Done. Removed ${a} item(s). Reinstall: npm install -g @hanzlaa/rcode
306
- `)}});var Vg=v((HI,uc)=>{var PA=require("path"),{homedir:OA}=lr(),{scanNamespaceDuplication:NA,migrateNamespace:LA}=Oo();function Ug(t){return{yes:t.includes("--yes")||t.includes("-y")}}function BA(t){if(console.log(`
309
+ `)}});var Gg=v((VI,cc)=>{var LA=require("path"),{homedir:BA}=dr(),{scanNamespaceDuplication:MA,migrateNamespace:qA}=No();function Vg(t){return{yes:t.includes("--yes")||t.includes("-y")}}function WA(t){if(console.log(`
307
310
  \u{1F54C} rcode \u2014 Namespace Migration
308
311
  `),t.totalCount===0){console.log(` \u2713 No legacy rihal-* or duplicate command registrations found.
309
- `);return}console.log(` Found ${t.totalCount} artifact(s) to migrate:`),console.log(` legacy rihal-* skills: ${t.legacySkillCount}`),console.log(` legacy rihal-* commands: ${t.legacyCommandCount}`),console.log(` legacy rihal-* agents: ${t.legacyAgentCount}`),console.log(` unprefixed dupes: ${t.unprefixedCount}`),console.log(` cross-scope dupes: ${t.crossScopeCount} (global copy shadowed by project)`),console.log(` legacy Codex commands: ${t.legacyCodexCommandCount} (~/.rcode/slash-commands/)`),console.log()}uc.exports=function(e=[]){let r=Ug(e),n=process.cwd(),s=OA(),i=NA(n,s);if(BA(i),i.totalCount===0)return;if(!r.yes){console.log(` [DRY RUN] Nothing removed. Pass --yes to back up and remove these files.
310
- `);return}let o=LA(n,s),a=Object.values(o.removed).reduce((u,c)=>u+c,0);console.log(` \u2713 Removed ${a} artifact(s):`),console.log(` legacy skills: ${o.removed.legacySkills}`),console.log(` legacy commands: ${o.removed.legacyCommands}`),console.log(` legacy agents: ${o.removed.legacyAgents}`),console.log(` unprefixed: ${o.removed.unprefixedDupes}`),console.log(` cross-scope: ${o.removed.crossScopeDupes}`),console.log(` codex commands: ${o.removed.legacyCodexCommands}`),o.backupDir&&console.log(` \u{1F4BE} backup: ${PA.relative(s,o.backupDir)} (under ~/.claude/.rcode-backup/)`),console.log()};uc.exports.parseArgs=Ug});var cc=v((ZI,zg)=>{var Gg=require("path"),{spawn:MA}=require("child_process");zg.exports=function(e,{packageRoot:r}){let n=Gg.join(r,"server/dashboard.js"),s=process.cwd(),i=Gg.join(s,".rcode");console.log(`
311
- \u{1F54C} Starting Diwan dashboard...`),console.log(` Scanning: ${i}`);let o=MA("node",[n],{stdio:"inherit",env:{...process.env,RCODE_DIR:i}});o.on("error",u=>{console.error("Failed to start dashboard:",u.message),process.exit(1)});let a=()=>{console.log(`
312
- Stopping dashboard...`),o.kill("SIGTERM"),process.exit(0)};process.on("SIGINT",a),process.on("SIGTERM",a)}});var Kg=v((UI,Jg)=>{var jr=require("fs"),Lo=require("path");function qA(t){let e=t.replace(/^rcode-/,"");if(e.includes("..")||e.includes("/")||e.includes("\\"))throw new Error(`Invalid agent name: '${t}'`);return e}function Yg(t,e){let r=jr.existsSync(t)?jr.readdirSync(t).filter(s=>s.endsWith(".md")&&s!=="README.md").map(s=>s.replace(".md","")):[],n=jr.existsSync(e)?jr.readdirSync(e).filter(s=>s.endsWith(".md")&&s.startsWith("rcode-")).map(s=>s.replace(/^rcode-/,"").replace(".md","")):[];return Array.from(new Set([...r,...n])).sort()}function Xg(t,e,r){let n=Lo.join(e,`${t}.md`);if(jr.existsSync(n))return{file:n,source:"digest"};let s=Lo.join(r,`rcode-${t}.md`);return jr.existsSync(s)?{file:s,source:"agent"}:null}Jg.exports=function(e,{packageRoot:r}){let n=Lo.join(r,"rcode/digests"),s=Lo.join(r,"rcode/agents"),i=e[0];if(i){let a=qA(i),u=Xg(a,n,s);u||(console.error(`No digest or agent found for: ${i}`),console.error(`Available: ${Yg(n,s).join(", ")}`),process.exit(1)),u.source==="agent"&&console.log(`# (fallback: full agent file \u2014 no curated digest exists)
313
- `),console.log(jr.readFileSync(u.file,"utf8"));return}let o=Yg(n,s);console.log(`
312
+ `);return}console.log(` Found ${t.totalCount} artifact(s) to migrate:`),console.log(` legacy rihal-* skills: ${t.legacySkillCount}`),console.log(` legacy rihal-* commands: ${t.legacyCommandCount}`),console.log(` legacy rihal-* agents: ${t.legacyAgentCount}`),console.log(` unprefixed dupes: ${t.unprefixedCount}`),console.log(` cross-scope dupes: ${t.crossScopeCount} (global copy shadowed by project)`),console.log(` legacy Codex commands: ${t.legacyCodexCommandCount} (~/.rcode/slash-commands/)`),console.log()}cc.exports=function(e=[]){let r=Vg(e),n=process.cwd(),s=BA(),i=MA(n,s);if(WA(i),i.totalCount===0)return;if(!r.yes){console.log(` [DRY RUN] Nothing removed. Pass --yes to back up and remove these files.
313
+ `);return}let o=qA(n,s),a=Object.values(o.removed).reduce((u,c)=>u+c,0);console.log(` \u2713 Removed ${a} artifact(s):`),console.log(` legacy skills: ${o.removed.legacySkills}`),console.log(` legacy commands: ${o.removed.legacyCommands}`),console.log(` legacy agents: ${o.removed.legacyAgents}`),console.log(` unprefixed: ${o.removed.unprefixedDupes}`),console.log(` cross-scope: ${o.removed.crossScopeDupes}`),console.log(` codex commands: ${o.removed.legacyCodexCommands}`),o.backupDir&&console.log(` \u{1F4BE} backup: ${LA.relative(s,o.backupDir)} (under ~/.claude/.rcode-backup/)`),console.log()};cc.exports.parseArgs=Vg});var lc=v((GI,Yg)=>{var zg=require("path"),{spawn:HA}=require("child_process");Yg.exports=function(e,{packageRoot:r}){let n=zg.join(r,"server/dashboard.js"),s=process.cwd(),i=zg.join(s,".rcode");console.log(`
314
+ \u{1F54C} Starting Diwan dashboard...`),console.log(` Scanning: ${i}`);let o=HA("node",[n],{stdio:"inherit",env:{...process.env,RCODE_DIR:i}});o.on("error",u=>{console.error("Failed to start dashboard:",u.message),process.exit(1)});let a=()=>{console.log(`
315
+ Stopping dashboard...`),o.kill("SIGTERM"),process.exit(0)};process.on("SIGINT",a),process.on("SIGTERM",a)}});var Qg=v((zI,Kg)=>{var Ir=require("fs"),Bo=require("path");function ZA(t){let e=t.replace(/^rcode-/,"");if(e.includes("..")||e.includes("/")||e.includes("\\"))throw new Error(`Invalid agent name: '${t}'`);return e}function Jg(t,e){let r=Ir.existsSync(t)?Ir.readdirSync(t).filter(s=>s.endsWith(".md")&&s!=="README.md").map(s=>s.replace(".md","")):[],n=Ir.existsSync(e)?Ir.readdirSync(e).filter(s=>s.endsWith(".md")&&s.startsWith("rcode-")).map(s=>s.replace(/^rcode-/,"").replace(".md","")):[];return Array.from(new Set([...r,...n])).sort()}function Xg(t,e,r){let n=Bo.join(e,`${t}.md`);if(Ir.existsSync(n))return{file:n,source:"digest"};let s=Bo.join(r,`rcode-${t}.md`);return Ir.existsSync(s)?{file:s,source:"agent"}:null}Kg.exports=function(e,{packageRoot:r}){let n=Bo.join(r,"rcode/digests"),s=Bo.join(r,"rcode/agents"),i=e[0];if(i){let a=ZA(i),u=Xg(a,n,s);u||(console.error(`No digest or agent found for: ${i}`),console.error(`Available: ${Jg(n,s).join(", ")}`),process.exit(1)),u.source==="agent"&&console.log(`# (fallback: full agent file \u2014 no curated digest exists)
316
+ `),console.log(Ir.readFileSync(u.file,"utf8"));return}let o=Jg(n,s);console.log(`
314
317
  \u{1F54C} All rcode Agent Digests
315
- `);for(let a of o){let u=Xg(a,n,s);u&&(console.log(jr.readFileSync(u.file,"utf8")),console.log(`
318
+ `);for(let a of o){let u=Xg(a,n,s);u&&(console.log(Ir.readFileSync(u.file,"utf8")),console.log(`
316
319
  `+"\u2550".repeat(80)+`
317
- `))}}});var tD=v((VI,eD)=>{var lc=require("fs"),Qg=require("path");eD.exports=function(e,{packageRoot:r}){let n=Qg.join(r,"rcode/digests");lc.existsSync(n)||(console.error("Agent digests not found. Is the package installed correctly?"),process.exit(1));let s=lc.readdirSync(n).filter(i=>i.endsWith(".md")&&i!=="README.md");console.log(`
320
+ `))}}});var rD=v((YI,tD)=>{var dc=require("fs"),eD=require("path");tD.exports=function(e,{packageRoot:r}){let n=eD.join(r,"rcode/digests");dc.existsSync(n)||(console.error("Agent digests not found. Is the package installed correctly?"),process.exit(1));let s=dc.readdirSync(n).filter(i=>i.endsWith(".md")&&i!=="README.md");console.log(`
318
321
  \u{1F54C} rcode Team Roster (${s.length} agents)
319
- `),console.log("\u2500".repeat(80));for(let i of s.sort()){let o=lc.readFileSync(Qg.join(n,i),"utf8"),a=o.split(`
322
+ `),console.log("\u2500".repeat(80));for(let i of s.sort()){let o=dc.readFileSync(eD.join(n,i),"utf8"),a=o.split(`
320
323
  `)[0].replace(/^#\s*/,""),u=(o.match(/\*\*Arabic:\*\*\s*(.+)/)||[])[1]||"",c=(o.match(/\*\*Authority:\*\*\s*(.+)/)||[])[1]||"";console.log(`${a.padEnd(45)} ${u.padEnd(15)}`),c&&console.log(` \u2192 ${c.slice(0,70)}`),console.log()}console.log("\u2500".repeat(80)),console.log(`
321
324
  For full agent details: cat rcode/digests/{agent}.md`),console.log(`For full skill: rcode/skills/agents/{agent-dir}/SKILL.md
322
- `)}});var oD=v((GI,sD)=>{var{spawnSync:rD}=require("child_process"),dc=require("fs"),nD=require("path");sD.exports=function(e,{packageRoot:r}){let n=nD.join(r,"rcode/agents");if(e.includes("--list")||e.length===0){let g=dc.readdirSync(n).filter(m=>m.startsWith("rcode-")&&m.endsWith(".md")).map(m=>m.replace(/^rcode-/,"").replace(/\.md$/,"")).sort();e.length===0&&console.log(`Usage: rcode agent <name> [-- extra args]
325
+ `)}});var iD=v((JI,oD)=>{var{spawnSync:nD}=require("child_process"),fc=require("fs"),sD=require("path");oD.exports=function(e,{packageRoot:r}){let n=sD.join(r,"rcode/agents");if(e.includes("--list")||e.length===0){let g=fc.readdirSync(n).filter(m=>m.startsWith("rcode-")&&m.endsWith(".md")).map(m=>m.replace(/^rcode-/,"").replace(/\.md$/,"")).sort();e.length===0&&console.log(`Usage: rcode agent <name> [-- extra args]
323
326
  `),console.log(`Available agents (${g.length}):
324
- `),g.forEach(m=>console.log(` rcode agent ${m}`));return}let s=e[0],o=`rcode-${s.startsWith("rcode-")?s.slice(6):s}`,a=nD.join(n,`${o}.md`);if(!dc.existsSync(a)){let g=dc.readdirSync(n).filter(m=>m.startsWith("rcode-")&&m.endsWith(".md")).map(m=>m.replace(/^rcode-/,"").replace(/\.md$/,"")).sort().join(", ");console.error(`Error: No agent named '${o}' found.`),console.error(`Available: ${g}`),process.exit(1)}let u=process.platform==="win32"?"where":"which";rD(u,["claude"],{encoding:"utf8"}).status!==0&&(console.error("Error: claude binary not found. Install Claude Code: https://claude.ai/code"),process.exit(1));let l=e.indexOf("--"),d=l!==-1?e.slice(l+1):[],f=rD("claude",["--agent",o,...d],{stdio:"inherit"});process.exit(f.status??0)}});var pc=v((zI,fD)=>{var un=require("fs"),Bo=require("path"),WA=require("crypto"),{spawnSync:fc}=require("child_process"),{writeJsonAtomic:HA}=Jt(),ls={commitsSinceInit:20,daysSinceInit:14},iD=["package-lock.json","pnpm-lock.yaml","yarn.lock","package.json","pyproject.toml","poetry.lock","requirements.txt","Pipfile.lock","Cargo.lock","Cargo.toml","go.sum","go.mod","Gemfile.lock","Gemfile","composer.lock","composer.json","pom.xml","build.gradle","build.gradle.kts"];function aD(t){return WA.createHash("sha256").update(t).digest("hex").slice(0,16)}function ZA(t){if(!un.existsSync(t))return null;try{let e=un.readFileSync(t);return aD(e)}catch(e){return console.error("[memory-bank] hashFileIfExists: failed to read",t+":",e?.message||e),null}}function UA(t){for(let e of iD){let r=Bo.join(t,e),n=ZA(r);if(n)return{name:e,hash:n}}return null}function VA(t){try{let e=un.readdirSync(t,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>r.name).filter(r=>!r.startsWith(".")&&r!=="node_modules"&&r!=="dist"&&r!=="build").sort();return{dirs:e,hash:aD(e.join("|"))}}catch(e){return console.error("[memory-bank] structureFingerprint: failed to read directory:",e?.message||e),{dirs:[],hash:null}}}function GA(t){try{let e=fc("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8"});if(e.status!==0)return null;let r=fc("git",["branch","--show-current"],{cwd:t,encoding:"utf8"});return{head:e.stdout.trim(),branch:r.status===0?r.stdout.trim():null}}catch(e){return console.error("[memory-bank] gitFingerprint: git command failed:",e?.message||e),null}}function uD(t,e,r){if(!e||!r)return null;try{let n=fc("git",["rev-list","--count",`${e}..${r}`],{cwd:t,encoding:"utf8"});return n.status!==0?null:parseInt(n.stdout.trim(),10)}catch(n){return console.error("[memory-bank] commitsBetween: git rev-list failed:",n?.message||n),null}}function hc(t){let e=GA(t),r=UA(t),n=VA(t);return{timestamp:new Date().toISOString(),git_head:e?e.head:null,git_branch:e?e.branch:null,manifest_name:r?r.name:null,manifest_hash:r?r.hash:null,structure_hash:n.hash,structure_dirs:n.dirs}}function cD(t){return Bo.join(t,".rcode","state.json")}function lD(t){let e=cD(t);if(!un.existsSync(e))return null;try{return JSON.parse(un.readFileSync(e,"utf8"))}catch(r){return console.error("[memory-bank] readState: failed to parse state.json at",e+":",r?.message||r),null}}function zA(t){let e=lD(t)||{},r=hc(t);return e.memory_bank={...e.memory_bank,last_init:r},HA(cD(t),e),r}function dD(t){return lD(t)?.memory_bank?.last_init||null}function YA(t){let e=hc(t),r=dD(t),n=Bo.join(t,".rcode/context/active.md"),s=Bo.join(t,".rcode/context/project-brief.md"),i={active:un.existsSync(n),brief:un.existsSync(s)};if(!i.active&&!i.brief)return{status:"never",reasons:["memory bank has never been initialized \u2014 run /rcode-init"],current:e,stored:r,context_files:i};if(!i.active||!i.brief){let a=[];return i.active||a.push(".rcode/context/active.md"),i.brief||a.push(".rcode/context/project-brief.md"),{status:"stale",reasons:[`incomplete memory bank \u2014 missing: ${a.join(", ")}`],current:e,stored:r,context_files:i}}if(!r)return{status:"stale",reasons:["run /rcode-init in your editor to populate project context"],current:e,stored:r,context_files:i};let o=[];if(e.manifest_hash&&r.manifest_hash&&e.manifest_hash!==r.manifest_hash&&o.push(`${e.manifest_name||"dependency manifest"} changed since last init`),e.structure_hash&&r.structure_hash&&e.structure_hash!==r.structure_hash){let a=new Set(r.structure_dirs||[]),u=new Set(e.structure_dirs||[]),c=[...u].filter(f=>!a.has(f)),l=[...a].filter(f=>!u.has(f)),d=[];c.length&&d.push(`added: ${c.join(", ")}`),l.length&&d.push(`removed: ${l.join(", ")}`),o.push(`top-level structure changed (${d.join("; ")||"reorganized"})`)}if(e.git_head&&r.git_head&&e.git_head!==r.git_head){let a=uD(t,r.git_head,e.git_head);a!==null&&a>=ls.commitsSinceInit&&o.push(`${a} commits since last init (threshold: ${ls.commitsSinceInit})`)}if(r.timestamp){let a=Date.parse(r.timestamp);if(!Number.isNaN(a)){let u=(Date.now()-a)/864e5;u>=ls.daysSinceInit&&o.push(`${Math.floor(u)} days since last init (threshold: ${ls.daysSinceInit})`)}}return{status:o.length>0?"stale":"fresh",reasons:o,current:e,stored:r,context_files:i}}fD.exports={computeFingerprint:hc,writeFingerprint:zA,readFingerprint:dD,checkStaleness:YA,commitsBetween:uD,STALE_THRESHOLDS:ls,MANIFEST_CANDIDATES:iD}});var yD=v((YI,DD)=>{var{z:De}=Ga();function XA(t){if(typeof t!="string")return{frontmatter:{},body:t||""};if(t=t.replace(/\r\n/g,`
327
+ `),g.forEach(m=>console.log(` rcode agent ${m}`));return}let s=e[0],o=`rcode-${s.startsWith("rcode-")?s.slice(6):s}`,a=sD.join(n,`${o}.md`);if(!fc.existsSync(a)){let g=fc.readdirSync(n).filter(m=>m.startsWith("rcode-")&&m.endsWith(".md")).map(m=>m.replace(/^rcode-/,"").replace(/\.md$/,"")).sort().join(", ");console.error(`Error: No agent named '${o}' found.`),console.error(`Available: ${g}`),process.exit(1)}let u=process.platform==="win32"?"where":"which";nD(u,["claude"],{encoding:"utf8"}).status!==0&&(console.error("Error: claude binary not found. Install Claude Code: https://claude.ai/code"),process.exit(1));let l=e.indexOf("--"),d=l!==-1?e.slice(l+1):[],f=nD("claude",["--agent",o,...d],{stdio:"inherit"});process.exit(f.status??0)}});var mc=v((XI,hD)=>{var un=require("fs"),Mo=require("path"),UA=require("crypto"),{spawnSync:hc}=require("child_process"),{writeJsonAtomic:VA}=Kt(),ls={commitsSinceInit:20,daysSinceInit:14},aD=["package-lock.json","pnpm-lock.yaml","yarn.lock","package.json","pyproject.toml","poetry.lock","requirements.txt","Pipfile.lock","Cargo.lock","Cargo.toml","go.sum","go.mod","Gemfile.lock","Gemfile","composer.lock","composer.json","pom.xml","build.gradle","build.gradle.kts"];function uD(t){return UA.createHash("sha256").update(t).digest("hex").slice(0,16)}function GA(t){if(!un.existsSync(t))return null;try{let e=un.readFileSync(t);return uD(e)}catch(e){return console.error("[memory-bank] hashFileIfExists: failed to read",t+":",e?.message||e),null}}function zA(t){for(let e of aD){let r=Mo.join(t,e),n=GA(r);if(n)return{name:e,hash:n}}return null}function YA(t){try{let e=un.readdirSync(t,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>r.name).filter(r=>!r.startsWith(".")&&r!=="node_modules"&&r!=="dist"&&r!=="build").sort();return{dirs:e,hash:uD(e.join("|"))}}catch(e){return console.error("[memory-bank] structureFingerprint: failed to read directory:",e?.message||e),{dirs:[],hash:null}}}function JA(t){try{let e=hc("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8"});if(e.status!==0)return null;let r=hc("git",["branch","--show-current"],{cwd:t,encoding:"utf8"});return{head:e.stdout.trim(),branch:r.status===0?r.stdout.trim():null}}catch(e){return console.error("[memory-bank] gitFingerprint: git command failed:",e?.message||e),null}}function cD(t,e,r){if(!e||!r)return null;try{let n=hc("git",["rev-list","--count",`${e}..${r}`],{cwd:t,encoding:"utf8"});return n.status!==0?null:parseInt(n.stdout.trim(),10)}catch(n){return console.error("[memory-bank] commitsBetween: git rev-list failed:",n?.message||n),null}}function pc(t){let e=JA(t),r=zA(t),n=YA(t);return{timestamp:new Date().toISOString(),git_head:e?e.head:null,git_branch:e?e.branch:null,manifest_name:r?r.name:null,manifest_hash:r?r.hash:null,structure_hash:n.hash,structure_dirs:n.dirs}}function lD(t){return Mo.join(t,".rcode","state.json")}function dD(t){let e=lD(t);if(!un.existsSync(e))return null;try{return JSON.parse(un.readFileSync(e,"utf8"))}catch(r){return console.error("[memory-bank] readState: failed to parse state.json at",e+":",r?.message||r),null}}function XA(t){let e=dD(t)||{},r=pc(t);return e.memory_bank={...e.memory_bank,last_init:r},VA(lD(t),e),r}function fD(t){return dD(t)?.memory_bank?.last_init||null}function KA(t){let e=pc(t),r=fD(t),n=Mo.join(t,".rcode/context/active.md"),s=Mo.join(t,".rcode/context/project-brief.md"),i={active:un.existsSync(n),brief:un.existsSync(s)};if(!i.active&&!i.brief)return{status:"never",reasons:["memory bank has never been initialized \u2014 run /rcode-init"],current:e,stored:r,context_files:i};if(!i.active||!i.brief){let a=[];return i.active||a.push(".rcode/context/active.md"),i.brief||a.push(".rcode/context/project-brief.md"),{status:"stale",reasons:[`incomplete memory bank \u2014 missing: ${a.join(", ")}`],current:e,stored:r,context_files:i}}if(!r)return{status:"stale",reasons:["run /rcode-init in your editor to populate project context"],current:e,stored:r,context_files:i};let o=[];if(e.manifest_hash&&r.manifest_hash&&e.manifest_hash!==r.manifest_hash&&o.push(`${e.manifest_name||"dependency manifest"} changed since last init`),e.structure_hash&&r.structure_hash&&e.structure_hash!==r.structure_hash){let a=new Set(r.structure_dirs||[]),u=new Set(e.structure_dirs||[]),c=[...u].filter(f=>!a.has(f)),l=[...a].filter(f=>!u.has(f)),d=[];c.length&&d.push(`added: ${c.join(", ")}`),l.length&&d.push(`removed: ${l.join(", ")}`),o.push(`top-level structure changed (${d.join("; ")||"reorganized"})`)}if(e.git_head&&r.git_head&&e.git_head!==r.git_head){let a=cD(t,r.git_head,e.git_head);a!==null&&a>=ls.commitsSinceInit&&o.push(`${a} commits since last init (threshold: ${ls.commitsSinceInit})`)}if(r.timestamp){let a=Date.parse(r.timestamp);if(!Number.isNaN(a)){let u=(Date.now()-a)/864e5;u>=ls.daysSinceInit&&o.push(`${Math.floor(u)} days since last init (threshold: ${ls.daysSinceInit})`)}}return{status:o.length>0?"stale":"fresh",reasons:o,current:e,stored:r,context_files:i}}hD.exports={computeFingerprint:pc,writeFingerprint:XA,readFingerprint:fD,checkStaleness:KA,commitsBetween:cD,STALE_THRESHOLDS:ls,MANIFEST_CANDIDATES:aD}});var vD=v((KI,yD)=>{var{z:De}=za();function QA(t){if(typeof t!="string")return{frontmatter:{},body:t||""};if(t=t.replace(/\r\n/g,`
325
328
  `),!t.startsWith(`---
326
329
  `))return{frontmatter:{},body:t};let e=t.indexOf(`
327
330
  ---
328
331
  `,4);if(e===-1)return{frontmatter:{},body:t};let r=t.slice(4,e),n=t.slice(e+5),s={},i=r.split(`
329
- `),o=0;for(;o<i.length;){let a=i[o];if(!a.trim()||a.trim().startsWith("#")){o++;continue}let u=a.match(/^([A-Za-z0-9_-]+):(.*)$/);if(!u){o++;continue}let c=u[1].trim(),l=u[2].trim();if(l=l.replace(/\s+#.*$/,"").trim(),l===">"||l==="|"||l===">-"||l==="|-"){let d=[];for(o++;o<i.length;){let f=i[o];if(f.trim()===""){d.push(""),o++;continue}if(/^\s/.test(f)){d.push(f.trim()),o++;continue}break}s[c]=d.join(" ").replace(/\s+/g," ").trim();continue}if(l===""){let d=[],f=o+1;for(;f<i.length;){let g=i[f];if(g.trim()===""||g.trim().startsWith("#")){f++;continue}let m=g.match(/^\s+-\s+(.*)$/);if(!m)break;let D=m[1].trim();D.startsWith('"')&&D.endsWith('"')&&(D=D.slice(1,-1)),D.startsWith("'")&&D.endsWith("'")&&(D=D.slice(1,-1)),d.push(D),f++}if(d.length){s[c]=d,o=f;continue}s[c]="",o++;continue}l.startsWith('"')&&l.endsWith('"')&&(l=l.slice(1,-1)),l.startsWith("'")&&l.endsWith("'")&&(l=l.slice(1,-1)),s[c]=l,o++}return{frontmatter:s,body:n}}function hD(t){let r=(typeof t.description=="string"?t.description:"").match(/"[^"]+"/g)||[];return r.length>0?r.length:Array.isArray(t.triggers)?t.triggers.filter(n=>typeof n=="string"&&n.trim()).length:typeof t.triggers=="string"&&t.triggers.trim()?t.triggers.split(",").map(n=>n.trim()).filter(Boolean).length:0}var pD=De.object({name:De.string().min(1,"name is required"),description:De.string().min(1,"description is required")}),JA=/not for|do not|does not|don't|never\b|audit-only|negative/i;function KA(t,e=""){let r=[],n=[],s=pD.safeParse(t||{});if(!s.success)for(let i of s.error.issues){let o=i.path.length?i.path.join("."):"(root)";r.push(`${o}: ${i.message}`)}if(t&&typeof t=="object"){let i=hD(t);i<5?r.push(`too few trigger phrases: found ${i}, need at least 5`):i>12&&n.push(`many trigger phrases: found ${i}, recommended max is 12`);let o=typeof t.description=="string"?t.description:"",a=typeof e=="string"?e:"";JA.test(o)||/##[^\n]*\bnot\b/i.test(a)||/\bdo not (use|include)\b/i.test(a)||/\bdon't touch\b/i.test(a)||r.push('missing negative-boundary clause (e.g. "Do NOT use for: ..." in the description or a "## Do NOT use" section)')}return{ok:r.length===0,errors:r,warnings:n}}var mD=De.object({name:De.string().min(1,"name is required").refine(t=>t.startsWith("rcode-"),'name must start with the "rcode-" prefix'),description:De.string().min(1,"description is required"),color:De.string().min(1,"color is required")});function QA(t){let e=[],r=mD.safeParse(t||{});if(!r.success)for(let n of r.error.issues){let s=n.path.length?n.path.join("."):"(root)";e.push(`${s}: ${n.message}`)}if(t&&typeof t=="object"){let n=t.tools;(Array.isArray(n)?n.length>0:typeof n=="string"&&n.trim().length>0)||e.push("tools is required (comma-separated string or array)")}else e.push("tools is required (comma-separated string or array)");return{ok:e.length===0,errors:e}}var gD=De.object({version:De.union([De.string(),De.number()]),project:De.string().min(1),phases:De.array(De.any()),schema_version:De.number(),current_phase:De.union([De.string(),De.number()]).optional(),current_plan:De.union([De.string(),De.number()]).optional(),current_sprint:De.union([De.string(),De.number()]).nullable().optional(),velocity_history:De.array(De.any()).optional(),milestones:De.array(De.any()).optional()}).passthrough();function e1(t){let e=[],r=gD.safeParse(t||{});if(!r.success)for(let n of r.error.issues){let s=n.path.length?n.path.join("."):"(root)";e.push(`${s}: ${n.message}`)}return{ok:e.length===0,errors:e}}DD.exports={parseFrontmatter:XA,countTriggerPhrases:hD,skillFrontmatterSchema:pD,agentFrontmatterSchema:mD,stateSchema:gD,validateSkillFrontmatter:KA,validateAgentFrontmatter:QA,validateState:e1}});var bD=v((XI,qo)=>{var pe=require("fs"),be=require("path"),{spawnSync:vD}=require("child_process"),{verifyInstall:t1,formatReport:r1}=ss(),{checkStaleness:n1}=pc(),{homedir:s1}=lr(),{scanNamespaceDuplication:o1}=Oo(),{parseFrontmatter:mc,validateSkillFrontmatter:i1,validateAgentFrontmatter:a1}=yD();function gc(t){let e=[];if(!pe.existsSync(t))return e;for(let r of pe.readdirSync(t,{withFileTypes:!0})){let n=be.join(t,r.name);r.isDirectory()?e.push(...gc(n)):r.isFile()&&r.name==="SKILL.md"&&e.push(n)}return e}function u1(t){return pe.existsSync(t)?pe.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".md")).map(e=>be.join(t,e.name)):[]}var c1=/not for|do not|does not|don't|never\b|audit-only|negative/i;function l1(t){let e=pe.readFileSync(t,"utf8"),{frontmatter:r,body:n}=mc(e),s=[];/^name:/m.test(e)||s.push("name"),/^description:/m.test(e)||s.push("description"),/^## Overview/m.test(e)||s.push("Overview section"),/^## Output Format/m.test(e)||s.push("Output Format"),/^## Examples/m.test(e)||s.push("Examples");let i=r["not-for"],o=Array.isArray(i)&&i.length>0,a=typeof r.description=="string"?r.description:"";return o||c1.test(a)||/##[^\n]*\bnot\b/i.test(n)||/\bdo not (use|include)\b/i.test(n)||s.push("negative-boundary clause"),s}function d1(t){try{return pe.accessSync(t,pe.constants.W_OK),!0}catch{return!1}}function Mo(t){let e=process.platform==="win32"?"where":"which";return vD(e,[t],{stdio:"ignore"}).status===0}function _D(t){let e=Array.isArray(t?.phases)?t.phases:[],r=e.filter(s=>s&&s.status==="executing");if(r.length===0)return[];let n=e.filter(s=>s&&s.status==="complete").map(s=>parseFloat(s.number)).filter(s=>!Number.isNaN(s)).reduce((s,i)=>Math.max(s,i),-1/0);return n===-1/0?[]:r.filter(s=>{let i=parseFloat(s.number);return!Number.isNaN(i)&&i<n})}function ED(t,e){let r=[],n=process.versions.node,s=parseInt(n.split(".")[0],10);r.push({label:"Node.js \u2265 18",status:s>=18?"ok":"fail",message:`v${n}${s<18?" \u2014 upgrade to 18 LTS or newer":""}`});let i=be.join(t,".rcode");pe.existsSync(i)?r.push({label:".rcode/ writable",status:d1(i)?"ok":"fail",message:i}):r.push({label:".rcode/ state",status:"warn",message:"not initialized in this directory (run `rcode install`)"});let o=be.join(e,"rcode/config/model-profiles.json");if(pe.existsSync(o))try{let a=JSON.parse(pe.readFileSync(o,"utf8")),u=["quality","balanced","budget","inherit"],c=Object.keys(a.profiles||a),l=u.filter(d=>!c.includes(d));l.length===0?r.push({label:"model-profiles.json",status:"ok",message:`${c.length} profiles (${c.join(", ")})`}):r.push({label:"model-profiles.json",status:"fail",message:`missing expected profiles: ${l.join(", ")}`})}catch(a){r.push({label:"model-profiles.json",status:"fail",message:`invalid JSON: ${a.message}`})}else r.push({label:"model-profiles.json",status:"fail",message:"missing from package"});r.push({label:"git CLI",status:Mo("git")?"ok":"warn",message:Mo("git")?"available":"not found (some features disabled)"}),r.push({label:"gh CLI",status:Mo("gh")?"ok":"warn",message:Mo("gh")?"available (github-sync ready)":"not found (github-sync unavailable)"});try{let a=o1(t,s1());a.totalCount>0?r.push({label:"Namespace duplication",status:"warn",message:`${a.totalCount} duplicate registration(s) \u2014 legacy skills: ${a.legacySkillCount}, legacy commands: ${a.legacyCommandCount}, legacy agents: ${a.legacyAgentCount}, unprefixed: ${a.unprefixedCount}, cross-scope: ${a.crossScopeCount}, legacy Codex commands: ${a.legacyCodexCommandCount} (run \`rcode migrate-namespace --yes\` or \`rcode update\`)`}):r.push({label:"Namespace duplication",status:"ok",message:"no duplicate rihal-*/rcode-* registrations found"})}catch(a){r.push({label:"Namespace duplication",status:"warn",message:`could not scan: ${a.message}`})}if(pe.existsSync(i)){let a=[],u=be.join(t,".claude/commands");if((pe.existsSync(u)&&pe.readdirSync(u).some(m=>m.startsWith("rcode-")&&m.endsWith(".md"))||pe.existsSync(be.join(t,".claude/skills")))&&a.push("claude"),pe.existsSync(be.join(t,".cursor/rules"))&&a.push("cursor"),pe.existsSync(be.join(t,".windsurf/rules"))&&a.push("windsurf"),pe.existsSync(be.join(t,".antigravity/agents"))&&a.push("antigravity"),a.length>0){let{reports:m,hasDrift:D}=t1(t,e,a);if(D)r.push({label:"Agent manifest",status:"fail",message:`drift detected across ${a.join(", ")}`,detail:r1(m)});else{let h=m.map(w=>`${w.editor}:${w.installedCount}`).join(" ");r.push({label:"Agent manifest",status:"ok",message:h})}}let l=n1(t);l.status==="fresh"?r.push({label:"Memory bank",status:"ok",message:"fresh"}):l.status==="never"?r.push({label:"Memory bank",status:"warn",message:"never initialized (run /rcode-init to populate)"}):r.push({label:"Memory bank",status:"warn",message:`STALE \u2014 ${l.reasons[0]}${l.reasons.length>1?` (+${l.reasons.length-1} more)`:""}`});let d=be.join(i,"data","intent-table.json");r.push({label:"intent-table.json",status:pe.existsSync(d)?"ok":"warn",message:pe.existsSync(d)?be.relative(t,d):"missing \u2014 run `npx @hanzlaa/rcode update` to sync .rcode/data/"});let f=be.join(i,"state.json");if(pe.existsSync(f))try{let m=JSON.parse(pe.readFileSync(f,"utf8")),D=_D(m);r.push({label:"Phase state",status:D.length>0?"warn":"ok",message:D.length>0?`${D.length} phase(s) stuck 'executing' while a later phase is complete: ${D.map(h=>h.number).join(", ")}`:"no stuck phases"})}catch(m){r.push({label:"Phase state",status:"warn",message:`state.json unreadable: ${m.message}`})}let g=be.join(i,"memory","INDEX.md");if(pe.existsSync(g)){let m=Math.floor((Date.now()-pe.statSync(g).mtimeMs)/864e5);r.push({label:"Memory INDEX.md",status:m>30?"warn":"ok",message:m>30?`STALE \u2014 last updated ${m}d ago (run /rcode-memory-update)`:`fresh \u2014 updated ${m}d ago`})}else r.push({label:"Memory INDEX.md",status:"warn",message:"missing (run /rcode-memory-init)"})}return r}function f1(t){let e=0;for(let r of t){let n=r.status==="ok"?"\u2713":r.status==="warn"?"\u26A0":"\u2717";console.log(` ${n} ${r.label.padEnd(22)} ${r.message}`),r.detail&&console.log(r.detail),r.status==="fail"&&e++}return e}function h1(t){let e=[be.join(t,"rcode/skills/agents"),be.join(t,"rcode/skills/actions")],r=0,n=0,s=[];for(let i of e){let o=gc(i);for(let a of o){r++;let u=l1(a);if(u.length>0){n++;let c=be.relative(t,a);s.push({file:c,missing:u})}}}if(s.length>0){console.log(` \u2717 ${n} / ${r} skills are non-compliant:
330
- `);for(let i of s)console.log(` ${i.file}`),console.log(` missing: ${i.missing.join(", ")}`)}else console.log(` \u2713 All ${r} skills compliant with 5-component standard`);return n}function p1(t){let e=[be.join(t,"rcode/skills/agents"),be.join(t,"rcode/skills/actions")],r=0,n=0,s=0,i=0;for(let o of e)for(let a of gc(o)){r++;let{frontmatter:u,body:c}=mc(pe.readFileSync(a,"utf8")),l=i1(u,c),d=be.relative(t,a);if(!l.ok){s++,console.log(` \u2717 ${d}`);for(let f of l.errors)console.log(` ${f}`)}if(l.warnings&&l.warnings.length>0){i++;for(let f of l.warnings)console.log(` \u26A0 ${d}: ${f}`)}}for(let o of u1(be.join(t,"rcode/agents"))){n++;let{frontmatter:a}=mc(pe.readFileSync(o,"utf8")),u=a1(a);if(!u.ok){s++;let c=be.relative(t,o);console.log(` \u2717 ${c}`);for(let l of u.errors)console.log(` ${l}`)}}return console.log(s===0?` \u2713 ${r} skill + ${n} agent frontmatter blocks pass schema validation`+(i>0?` (${i} with advisory warnings)`:""):` \u2717 ${s} artifact(s) failed schema validation`),s}function m1(){let e=require("os").homedir(),r=[],n=[];for(let i of[["npm",["root","-g"]],["pnpm",["root","-g"]]])try{let o=vD(i[0],i[1],{encoding:"utf8"});o.status===0&&o.stdout.trim()&&n.push({manager:i[0],dir:o.stdout.trim()})}catch{}let s=be.join(e,".nvm","versions","node");if(pe.existsSync(s))for(let i of pe.readdirSync(s)){let o=be.join(s,i,"lib","node_modules");pe.existsSync(o)&&!n.some(a=>a.dir===o)&&n.push({manager:`nvm/${i}`,dir:o})}for(let{manager:i,dir:o}of n)for(let a of["@hanzlaa","@hanzlahabib"]){let u=be.join(o,a);if(pe.existsSync(u)){for(let c of pe.readdirSync(u))if(c==="rcode"||c==="rcode"||c.startsWith("rcode")){let l="unknown";try{l=JSON.parse(pe.readFileSync(be.join(u,c,"package.json"),"utf8")).version}catch{}r.push({manager:i,scope:a,pkg:c,version:l,dir:be.join(u,c)})}}}return{count:r.length,installs:r}}function g1(t){if(t.count===0)return console.log(" \u2713 No global rcode installs found"),0;if(t.count===1){let e=t.installs[0];return console.log(` \u2713 Single global install: [${e.manager}] ${e.scope}/${e.pkg}@${e.version}`),0}console.log(` \u2717 ${t.count} global installs detected \u2014 this causes duplicate slash commands!`);for(let e of t.installs)console.log(` [${e.manager}] ${e.scope}/${e.pkg}@${e.version}`),console.log(` ${e.dir}`);return console.log(`
331
- Fix: rcode nuke --yes && npm install -g @hanzlaa/rcode`),1}qo.exports=function(e,{packageRoot:r}){let n=process.cwd();console.log(`
332
+ `),o=0;for(;o<i.length;){let a=i[o];if(!a.trim()||a.trim().startsWith("#")){o++;continue}let u=a.match(/^([A-Za-z0-9_-]+):(.*)$/);if(!u){o++;continue}let c=u[1].trim(),l=u[2].trim();if(l=l.replace(/\s+#.*$/,"").trim(),l===">"||l==="|"||l===">-"||l==="|-"){let d=[];for(o++;o<i.length;){let f=i[o];if(f.trim()===""){d.push(""),o++;continue}if(/^\s/.test(f)){d.push(f.trim()),o++;continue}break}s[c]=d.join(" ").replace(/\s+/g," ").trim();continue}if(l===""){let d=[],f=o+1;for(;f<i.length;){let g=i[f];if(g.trim()===""||g.trim().startsWith("#")){f++;continue}let m=g.match(/^\s+-\s+(.*)$/);if(!m)break;let y=m[1].trim();y.startsWith('"')&&y.endsWith('"')&&(y=y.slice(1,-1)),y.startsWith("'")&&y.endsWith("'")&&(y=y.slice(1,-1)),d.push(y),f++}if(d.length){s[c]=d,o=f;continue}s[c]="",o++;continue}l.startsWith('"')&&l.endsWith('"')&&(l=l.slice(1,-1)),l.startsWith("'")&&l.endsWith("'")&&(l=l.slice(1,-1)),s[c]=l,o++}return{frontmatter:s,body:n}}function pD(t){let r=(typeof t.description=="string"?t.description:"").match(/"[^"]+"/g)||[];return r.length>0?r.length:Array.isArray(t.triggers)?t.triggers.filter(n=>typeof n=="string"&&n.trim()).length:typeof t.triggers=="string"&&t.triggers.trim()?t.triggers.split(",").map(n=>n.trim()).filter(Boolean).length:0}var mD=De.object({name:De.string().min(1,"name is required"),description:De.string().min(1,"description is required")}),e1=/not for|do not|does not|don't|never\b|audit-only|negative/i;function t1(t,e=""){let r=[],n=[],s=mD.safeParse(t||{});if(!s.success)for(let i of s.error.issues){let o=i.path.length?i.path.join("."):"(root)";r.push(`${o}: ${i.message}`)}if(t&&typeof t=="object"){let i=pD(t);i<5?r.push(`too few trigger phrases: found ${i}, need at least 5`):i>12&&n.push(`many trigger phrases: found ${i}, recommended max is 12`);let o=typeof t.description=="string"?t.description:"",a=typeof e=="string"?e:"";e1.test(o)||/##[^\n]*\bnot\b/i.test(a)||/\bdo not (use|include)\b/i.test(a)||/\bdon't touch\b/i.test(a)||r.push('missing negative-boundary clause (e.g. "Do NOT use for: ..." in the description or a "## Do NOT use" section)')}return{ok:r.length===0,errors:r,warnings:n}}var gD=De.object({name:De.string().min(1,"name is required").refine(t=>t.startsWith("rcode-"),'name must start with the "rcode-" prefix'),description:De.string().min(1,"description is required"),color:De.string().min(1,"color is required")});function r1(t){let e=[],r=gD.safeParse(t||{});if(!r.success)for(let n of r.error.issues){let s=n.path.length?n.path.join("."):"(root)";e.push(`${s}: ${n.message}`)}if(t&&typeof t=="object"){let n=t.tools;(Array.isArray(n)?n.length>0:typeof n=="string"&&n.trim().length>0)||e.push("tools is required (comma-separated string or array)")}else e.push("tools is required (comma-separated string or array)");return{ok:e.length===0,errors:e}}var DD=De.object({version:De.union([De.string(),De.number()]),project:De.string().min(1),phases:De.array(De.any()),schema_version:De.number(),current_phase:De.union([De.string(),De.number()]).optional(),current_plan:De.union([De.string(),De.number()]).optional(),current_sprint:De.union([De.string(),De.number()]).nullable().optional(),velocity_history:De.array(De.any()).optional(),milestones:De.array(De.any()).optional()}).passthrough();function n1(t){let e=[],r=DD.safeParse(t||{});if(!r.success)for(let n of r.error.issues){let s=n.path.length?n.path.join("."):"(root)";e.push(`${s}: ${n.message}`)}return{ok:e.length===0,errors:e}}yD.exports={parseFrontmatter:QA,countTriggerPhrases:pD,skillFrontmatterSchema:mD,agentFrontmatterSchema:gD,stateSchema:DD,validateSkillFrontmatter:t1,validateAgentFrontmatter:r1,validateState:n1}});var ED=v((QI,Wo)=>{var pe=require("fs"),Se=require("path"),{spawnSync:_D}=require("child_process"),{verifyInstall:s1,formatReport:o1}=ss(),{checkStaleness:i1}=mc(),{homedir:a1}=dr(),{scanNamespaceDuplication:u1}=No(),{parseFrontmatter:gc,validateSkillFrontmatter:c1,validateAgentFrontmatter:l1}=vD();function Dc(t){let e=[];if(!pe.existsSync(t))return e;for(let r of pe.readdirSync(t,{withFileTypes:!0})){let n=Se.join(t,r.name);r.isDirectory()?e.push(...Dc(n)):r.isFile()&&r.name==="SKILL.md"&&e.push(n)}return e}function d1(t){return pe.existsSync(t)?pe.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".md")).map(e=>Se.join(t,e.name)):[]}var f1=/not for|do not|does not|don't|never\b|audit-only|negative/i;function h1(t){let e=pe.readFileSync(t,"utf8"),{frontmatter:r,body:n}=gc(e),s=[];/^name:/m.test(e)||s.push("name"),/^description:/m.test(e)||s.push("description"),/^## Overview/m.test(e)||s.push("Overview section"),/^## Output Format/m.test(e)||s.push("Output Format"),/^## Examples/m.test(e)||s.push("Examples");let i=r["not-for"],o=Array.isArray(i)&&i.length>0,a=typeof r.description=="string"?r.description:"";return o||f1.test(a)||/##[^\n]*\bnot\b/i.test(n)||/\bdo not (use|include)\b/i.test(n)||s.push("negative-boundary clause"),s}function p1(t){try{return pe.accessSync(t,pe.constants.W_OK),!0}catch{return!1}}function qo(t){let e=process.platform==="win32"?"where":"which";return _D(e,[t],{stdio:"ignore"}).status===0}function bD(t){let e=Array.isArray(t?.phases)?t.phases:[],r=e.filter(s=>s&&s.status==="executing");if(r.length===0)return[];let n=e.filter(s=>s&&s.status==="complete").map(s=>parseFloat(s.number)).filter(s=>!Number.isNaN(s)).reduce((s,i)=>Math.max(s,i),-1/0);return n===-1/0?[]:r.filter(s=>{let i=parseFloat(s.number);return!Number.isNaN(i)&&i<n})}function SD(t,e){let r=[],n=process.versions.node,s=parseInt(n.split(".")[0],10);r.push({label:"Node.js \u2265 18",status:s>=18?"ok":"fail",message:`v${n}${s<18?" \u2014 upgrade to 18 LTS or newer":""}`});let i=Se.join(t,".rcode");pe.existsSync(i)?r.push({label:".rcode/ writable",status:p1(i)?"ok":"fail",message:i}):r.push({label:".rcode/ state",status:"warn",message:"not initialized in this directory (run `rcode install`)"});let o=Se.join(e,"rcode/config/model-profiles.json");if(pe.existsSync(o))try{let a=JSON.parse(pe.readFileSync(o,"utf8")),u=["quality","balanced","budget","inherit"],c=Object.keys(a.profiles||a),l=u.filter(d=>!c.includes(d));l.length===0?r.push({label:"model-profiles.json",status:"ok",message:`${c.length} profiles (${c.join(", ")})`}):r.push({label:"model-profiles.json",status:"fail",message:`missing expected profiles: ${l.join(", ")}`})}catch(a){r.push({label:"model-profiles.json",status:"fail",message:`invalid JSON: ${a.message}`})}else r.push({label:"model-profiles.json",status:"fail",message:"missing from package"});r.push({label:"git CLI",status:qo("git")?"ok":"warn",message:qo("git")?"available":"not found (some features disabled)"}),r.push({label:"gh CLI",status:qo("gh")?"ok":"warn",message:qo("gh")?"available (github-sync ready)":"not found (github-sync unavailable)"});try{let a=u1(t,a1());a.totalCount>0?r.push({label:"Namespace duplication",status:"warn",message:`${a.totalCount} duplicate registration(s) \u2014 legacy skills: ${a.legacySkillCount}, legacy commands: ${a.legacyCommandCount}, legacy agents: ${a.legacyAgentCount}, unprefixed: ${a.unprefixedCount}, cross-scope: ${a.crossScopeCount}, legacy Codex commands: ${a.legacyCodexCommandCount} (run \`rcode migrate-namespace --yes\` or \`rcode update\`)`}):r.push({label:"Namespace duplication",status:"ok",message:"no duplicate rihal-*/rcode-* registrations found"})}catch(a){r.push({label:"Namespace duplication",status:"warn",message:`could not scan: ${a.message}`})}if(pe.existsSync(i)){let a=[],u=Se.join(t,".claude/commands");if((pe.existsSync(u)&&pe.readdirSync(u).some(m=>m.startsWith("rcode-")&&m.endsWith(".md"))||pe.existsSync(Se.join(t,".claude/skills")))&&a.push("claude"),pe.existsSync(Se.join(t,".cursor/rules"))&&a.push("cursor"),pe.existsSync(Se.join(t,".windsurf/rules"))&&a.push("windsurf"),pe.existsSync(Se.join(t,".antigravity/agents"))&&a.push("antigravity"),a.length>0){let{reports:m,hasDrift:y}=s1(t,e,a);if(y)r.push({label:"Agent manifest",status:"fail",message:`drift detected across ${a.join(", ")}`,detail:o1(m)});else{let h=m.map(w=>`${w.editor}:${w.installedCount}`).join(" ");r.push({label:"Agent manifest",status:"ok",message:h})}}let l=i1(t);l.status==="fresh"?r.push({label:"Memory bank",status:"ok",message:"fresh"}):l.status==="never"?r.push({label:"Memory bank",status:"warn",message:"never initialized (run /rcode-init to populate)"}):r.push({label:"Memory bank",status:"warn",message:`STALE \u2014 ${l.reasons[0]}${l.reasons.length>1?` (+${l.reasons.length-1} more)`:""}`});let d=Se.join(i,"data","intent-table.json");r.push({label:"intent-table.json",status:pe.existsSync(d)?"ok":"warn",message:pe.existsSync(d)?Se.relative(t,d):"missing \u2014 run `npx @hanzlaa/rcode update` to sync .rcode/data/"});let f=Se.join(i,"state.json");if(pe.existsSync(f))try{let m=JSON.parse(pe.readFileSync(f,"utf8")),y=bD(m);r.push({label:"Phase state",status:y.length>0?"warn":"ok",message:y.length>0?`${y.length} phase(s) stuck 'executing' while a later phase is complete: ${y.map(h=>h.number).join(", ")}`:"no stuck phases"})}catch(m){r.push({label:"Phase state",status:"warn",message:`state.json unreadable: ${m.message}`})}let g=Se.join(i,"memory","INDEX.md");if(pe.existsSync(g)){let m=Math.floor((Date.now()-pe.statSync(g).mtimeMs)/864e5);r.push({label:"Memory INDEX.md",status:m>30?"warn":"ok",message:m>30?`STALE \u2014 last updated ${m}d ago (run /rcode-memory-update)`:`fresh \u2014 updated ${m}d ago`})}else r.push({label:"Memory INDEX.md",status:"warn",message:"missing (run /rcode-memory-init)"})}return r}function m1(t){let e=0;for(let r of t){let n=r.status==="ok"?"\u2713":r.status==="warn"?"\u26A0":"\u2717";console.log(` ${n} ${r.label.padEnd(22)} ${r.message}`),r.detail&&console.log(r.detail),r.status==="fail"&&e++}return e}function g1(t){let e=[Se.join(t,"rcode/skills/agents"),Se.join(t,"rcode/skills/actions")],r=0,n=0,s=[];for(let i of e){let o=Dc(i);for(let a of o){r++;let u=h1(a);if(u.length>0){n++;let c=Se.relative(t,a);s.push({file:c,missing:u})}}}if(s.length>0){console.log(` \u2717 ${n} / ${r} skills are non-compliant:
333
+ `);for(let i of s)console.log(` ${i.file}`),console.log(` missing: ${i.missing.join(", ")}`)}else console.log(` \u2713 All ${r} skills compliant with 5-component standard`);return n}function D1(t){let e=[Se.join(t,"rcode/skills/agents"),Se.join(t,"rcode/skills/actions")],r=0,n=0,s=0,i=0;for(let o of e)for(let a of Dc(o)){r++;let{frontmatter:u,body:c}=gc(pe.readFileSync(a,"utf8")),l=c1(u,c),d=Se.relative(t,a);if(!l.ok){s++,console.log(` \u2717 ${d}`);for(let f of l.errors)console.log(` ${f}`)}if(l.warnings&&l.warnings.length>0){i++;for(let f of l.warnings)console.log(` \u26A0 ${d}: ${f}`)}}for(let o of d1(Se.join(t,"rcode/agents"))){n++;let{frontmatter:a}=gc(pe.readFileSync(o,"utf8")),u=l1(a);if(!u.ok){s++;let c=Se.relative(t,o);console.log(` \u2717 ${c}`);for(let l of u.errors)console.log(` ${l}`)}}return console.log(s===0?` \u2713 ${r} skill + ${n} agent frontmatter blocks pass schema validation`+(i>0?` (${i} with advisory warnings)`:""):` \u2717 ${s} artifact(s) failed schema validation`),s}function y1(){let e=require("os").homedir(),r=[],n=[];for(let i of[["npm",["root","-g"]],["pnpm",["root","-g"]]])try{let o=_D(i[0],i[1],{encoding:"utf8"});o.status===0&&o.stdout.trim()&&n.push({manager:i[0],dir:o.stdout.trim()})}catch{}let s=Se.join(e,".nvm","versions","node");if(pe.existsSync(s))for(let i of pe.readdirSync(s)){let o=Se.join(s,i,"lib","node_modules");pe.existsSync(o)&&!n.some(a=>a.dir===o)&&n.push({manager:`nvm/${i}`,dir:o})}for(let{manager:i,dir:o}of n)for(let a of["@hanzlaa","@hanzlahabib"]){let u=Se.join(o,a);if(pe.existsSync(u)){for(let c of pe.readdirSync(u))if(c==="rcode"||c==="rcode"||c.startsWith("rcode")){let l="unknown";try{l=JSON.parse(pe.readFileSync(Se.join(u,c,"package.json"),"utf8")).version}catch{}r.push({manager:i,scope:a,pkg:c,version:l,dir:Se.join(u,c)})}}}return{count:r.length,installs:r}}function v1(t){if(t.count===0)return console.log(" \u2713 No global rcode installs found"),0;if(t.count===1){let e=t.installs[0];return console.log(` \u2713 Single global install: [${e.manager}] ${e.scope}/${e.pkg}@${e.version}`),0}console.log(` \u2717 ${t.count} global installs detected \u2014 this causes duplicate slash commands!`);for(let e of t.installs)console.log(` [${e.manager}] ${e.scope}/${e.pkg}@${e.version}`),console.log(` ${e.dir}`);return console.log(`
334
+ Fix: rcode nuke --yes && npm install -g @hanzlaa/rcode`),1}Wo.exports=function(e,{packageRoot:r}){let n=process.cwd();console.log(`
332
335
  \u{1F54C} rcode \u2014 Doctor
333
- `),console.log("Preflight:");let s=ED(n,r),i=f1(s);console.log(`
334
- Duplicate installations:`);let o=m1(),a=g1(o);console.log(`
335
- Package compliance:`);let u=h1(r);console.log(`
336
- Artifact schema validation:`);let c=p1(r),l=i+u+a+c;console.log(),console.log(l===0?"\u2705 All checks passed.":`\u274C ${l} check(s) failed \u2014 see above.`),console.log(),process.exit(l>0?1:0)};qo.exports.findStuckExecutingPhases=_D;qo.exports.runPreflight=ED});var yc=v((JI,wD)=>{var Wo=require("fs"),Dc=require("path"),SD=["new-project","create-prd","discuss-phase","plan","execute-sprint","verify-phase","retrospective","ship"];wD.exports=function(e,{packageRoot:r}){let n=Dc.join(r,"rcode","workflows"),s=e[0];if(!s||s==="list"||s==="--list")return D1(n);if(s==="show"||s==="get"||s==="run"){let i=e[1];return i||(console.error("Usage: rcode workflow show <name>"),console.error(" rcode workflow list"),process.exit(1)),CD(n,i)}return CD(n,s)};function D1(t){let e=Wo.readdirSync(t).filter(s=>s.endsWith(".md")).map(s=>s.replace(/\.md$/,"")).sort(),r=SD.filter(s=>e.includes(s)),n=e.filter(s=>!SD.includes(s));console.log(`\u{1F54C} rcode lifecycle workflows
336
+ `),console.log("Preflight:");let s=SD(n,r),i=m1(s);console.log(`
337
+ Duplicate installations:`);let o=y1(),a=v1(o);console.log(`
338
+ Package compliance:`);let u=g1(r);console.log(`
339
+ Artifact schema validation:`);let c=D1(r),l=i+u+a+c;console.log(),console.log(l===0?"\u2705 All checks passed.":`\u274C ${l} check(s) failed \u2014 see above.`),console.log(),process.exit(l>0?1:0)};Wo.exports.findStuckExecutingPhases=bD;Wo.exports.runPreflight=SD});var vc=v((eT,xD)=>{var Ho=require("fs"),yc=require("path"),CD=["new-project","create-prd","discuss-phase","plan","execute-sprint","verify-phase","retrospective","ship"];xD.exports=function(e,{packageRoot:r}){let n=yc.join(r,"rcode","workflows"),s=e[0];if(!s||s==="list"||s==="--list")return _1(n);if(s==="show"||s==="get"||s==="run"){let i=e[1];return i||(console.error("Usage: rcode workflow show <name>"),console.error(" rcode workflow list"),process.exit(1)),wD(n,i)}return wD(n,s)};function _1(t){let e=Ho.readdirSync(t).filter(s=>s.endsWith(".md")).map(s=>s.replace(/\.md$/,"")).sort(),r=CD.filter(s=>e.includes(s)),n=e.filter(s=>!CD.includes(s));console.log(`\u{1F54C} rcode lifecycle workflows
337
340
  `),console.log("Core lifecycle (in order):"),r.forEach(s=>console.log(` rcode workflow show ${s}`)),n.length&&(console.log(`
338
341
  Other workflows:`),n.forEach(s=>console.log(` rcode workflow show ${s}`))),console.log(`
339
- Usage: rcode workflow show <name> \u2014 print the full workflow instructions`)}function CD(t,e){let r=e.startsWith("rcode-")?e.slice(6):e,n=[Dc.join(t,`${r}.md`),Dc.join(t,`${e}.md`)];for(let i of n)if(Wo.existsSync(i)){process.stdout.write(Wo.readFileSync(i,"utf8"));return}let s=Wo.readdirSync(t).filter(i=>i.endsWith(".md")).map(i=>i.replace(/\.md$/,"")).sort().join(", ");console.error(`Error: workflow '${e}' not found.`),console.error(`Available: ${s}`),process.exit(1)}});var Ec=v((KI,FD)=>{var ds=require("fs"),Zo=require("path");function y1(t){for(;t!==require("path").parse(t).root;){if(ds.existsSync(Zo.join(t,"package.json")))return t;t=Zo.dirname(t)}throw new Error("Could not find package root")}var v1=y1(__dirname),vc=Zo.join(v1,"rcode/config/model-profiles.json"),Ho=null;function fs(){if(Ho)return Ho;if(!ds.existsSync(vc))throw new Error(`Model profiles not found at ${vc}`);return Ho=JSON.parse(ds.readFileSync(vc,"utf8")),Ho}function $D(){let t=fs();return Object.keys(t.profiles)}function _c(t){let r=fs().profiles[t];if(!r)throw new Error(`Unknown profile '${t}'. Valid: ${$D().join(", ")}`);return r}function Uo(){return fs().default_profile}function kD(){return fs().model_aliases}function AD(t,e={}){let{profile:r=Uo(),overrides:n={}}=e;if(n[t])return xD(n[t]);let i=_c(r).agents[t];if(!i)throw new Error(`Agent '${t}' not mapped in profile '${r}'. Check rcode/config/model-profiles.json.`);return xD(i)}function xD(t){if(t==="inherit")return null;let e=kD();return e[t]!==void 0?e[t]:t}function _1(t){let e=_c(t),r={};for(let n of Object.keys(e.agents))r[n]=AD(n,{profile:t});return r}function E1(t){let e=Object.keys(t);if(e.length===0)return"(empty)";let r=Math.max(5,...e.map(o=>o.length)),n=Math.max(5,...Object.values(t).map(o=>(o??"inherit").length)),s="\u2500".repeat(r+2)+"\u253C"+"\u2500".repeat(n+2),i=" "+"Agent".padEnd(r)+" \u2502 "+"Model".padEnd(n)+`
342
+ Usage: rcode workflow show <name> \u2014 print the full workflow instructions`)}function wD(t,e){let r=e.startsWith("rcode-")?e.slice(6):e,n=[yc.join(t,`${r}.md`),yc.join(t,`${e}.md`)];for(let i of n)if(Ho.existsSync(i)){process.stdout.write(Ho.readFileSync(i,"utf8"));return}let s=Ho.readdirSync(t).filter(i=>i.endsWith(".md")).map(i=>i.replace(/\.md$/,"")).sort().join(", ");console.error(`Error: workflow '${e}' not found.`),console.error(`Available: ${s}`),process.exit(1)}});var Sc=v((tT,jD)=>{var ds=require("fs"),Uo=require("path");function b1(t){for(;t!==require("path").parse(t).root;){if(ds.existsSync(Uo.join(t,"package.json")))return t;t=Uo.dirname(t)}throw new Error("Could not find package root")}var S1=b1(__dirname),_c=Uo.join(S1,"rcode/config/model-profiles.json"),Zo=null;function fs(){if(Zo)return Zo;if(!ds.existsSync(_c))throw new Error(`Model profiles not found at ${_c}`);return Zo=JSON.parse(ds.readFileSync(_c,"utf8")),Zo}function $D(){let t=fs();return Object.keys(t.profiles)}function bc(t){let r=fs().profiles[t];if(!r)throw new Error(`Unknown profile '${t}'. Valid: ${$D().join(", ")}`);return r}function Vo(){return fs().default_profile}function AD(){return fs().model_aliases}function FD(t,e={}){let{profile:r=Vo(),overrides:n={}}=e;if(n[t])return kD(n[t]);let i=bc(r).agents[t];if(!i)throw new Error(`Agent '${t}' not mapped in profile '${r}'. Check rcode/config/model-profiles.json.`);return kD(i)}function kD(t){if(t==="inherit")return null;let e=AD();return e[t]!==void 0?e[t]:t}function E1(t){let e=bc(t),r={};for(let n of Object.keys(e.agents))r[n]=FD(n,{profile:t});return r}function C1(t){let e=Object.keys(t);if(e.length===0)return"(empty)";let r=Math.max(5,...e.map(o=>o.length)),n=Math.max(5,...Object.values(t).map(o=>(o??"inherit").length)),s="\u2500".repeat(r+2)+"\u253C"+"\u2500".repeat(n+2),i=" "+"Agent".padEnd(r)+" \u2502 "+"Model".padEnd(n)+`
340
343
  `;i+=s+`
341
344
  `;for(let[o,a]of Object.entries(t))i+=" "+o.padEnd(r)+" \u2502 "+(a??"inherit").padEnd(n)+`
342
- `;return i}function b1(t=process.cwd()){let e=Zo.join(t,".rcode","config.json");if(ds.existsSync(e))try{let r=JSON.parse(ds.readFileSync(e,"utf8"));return{profile:r.model_profile||Uo(),overrides:r.model_overrides||{}}}catch{console.warn("Warning: .rcode/config.json is invalid JSON. Using defaults.")}return{profile:Uo(),overrides:{}}}FD.exports={loadProfiles:fs,listProfiles:$D,getProfile:_c,getDefaultProfile:Uo,getModelAliases:kD,resolveModelForAgent:AD,getResolvedMapForProfile:_1,formatMapAsTable:E1,getProjectProfile:b1}});var gs=v((QI,RD)=>{var hs=require("fs"),ps=require("path"),{writeJsonAtomic:bc}=Jt(),{homedir:S1}=lr(),Sc=1,Cc={schema_version:Sc,installed_version:null,project_name:null,user_name:"Team",communication_language:"English",document_output_language:"English",output_folder:".rcode",planning_artifacts:".planning/phases",project_knowledge:".rcode/context",model_profile:"balanced",communication_mode:"guided"},Yo=new Set(["schema_version","installed_version","project_name","user_name","communication_language","document_output_language","output_folder","planning_artifacts","project_knowledge","model_profile","communication_mode"]),C1={profile:"model_profile","model-profile":"model_profile",language:"communication_language",user:"user_name",project:"project_name",output:"output_folder",planning:"planning_artifacts",knowledge:"project_knowledge"},Vo=new Set(["quality","balanced","budget","inherit"]),Go=new Set(["guided","yolo"]);function Xo(){return ps.join(S1(),".rcode","defaults.json")}function Jo(t){return ps.join(t,".rcode","config.json")}function jD(t){return ps.join(t,".rcode","config.yaml")}function ID(t){if(!hs.existsSync(t))return null;try{return JSON.parse(hs.readFileSync(t,"utf8"))}catch{return null}}function ms(){return ID(Xo())||{}}var w1={mode:"communication_mode"};function x1(t){if(!hs.existsSync(t))return null;try{let e={};for(let r of hs.readFileSync(t,"utf8").split(`
343
- `)){let n=r.match(/^([a-zA-Z_]+):\s*["']?([^"'\n#]+?)["']?\s*(?:#.*)?$/);if(!n)continue;let s=w1[n[1].trim()]||n[1].trim(),i=n[2].trim();e[s]=i==="true"?!0:i==="false"?!1:i}return Object.keys(e).length?e:null}catch{return null}}function wc(t){let e=ID(Jo(t));return e||x1(jD(t))||{}}function TD(t){let e={...Cc};e.project_name===null&&(e.project_name=ps.basename(t));let r=ms(),n=wc(t);return{...e,...r,...n}}function $1(t,e){return Yo.has(e)?TD(t)[e]:void 0}function k1(t,e={}){let r=Jo(t);if(hs.existsSync(r))return!1;let n=ms(),s=o=>e[o]!==void 0?e[o]:n[o]!==void 0?n[o]:Cc[o],i={schema_version:Sc,installed_version:e.installed_version||null,project_name:e.project_name||ps.basename(t),user_name:s("user_name"),communication_language:s("communication_language"),document_output_language:s("document_output_language"),output_folder:s("output_folder"),planning_artifacts:s("planning_artifacts"),project_knowledge:s("project_knowledge"),model_profile:s("model_profile")};return bc(r,i),!0}function A1(t){let r={...ms(),...t};bc(Xo(),r)}function F1(t,e,r,{scope:n="project"}={}){if(!Yo.has(e)){let a=C1[e.toLowerCase()]||zo(e,[...Yo]);return{ok:!1,error:`Unknown config key '${e}'`,suggestion:a}}if(e==="model_profile"&&!Vo.has(r))return{ok:!1,error:`Invalid model_profile '${r}' (valid: ${[...Vo].join(", ")})`,suggestion:zo(r,[...Vo])};if(e==="communication_mode"&&!Go.has(r))return{ok:!1,error:`Invalid communication_mode '${r}' (valid: ${[...Go].join(", ")})`,suggestion:zo(r,[...Go])};if(e==="schema_version"){let a=Number(r);if(Number.isNaN(a))return{ok:!1,error:"schema_version must be a number"};r=a}let s,i;n==="global"?(s=Xo(),i=ms()):(s=Jo(t),i=wc(t));let o={...i,[e]:r};return bc(s,o),{ok:!0,scope:n,target:s}}function zo(t,e){if(!t)return null;let r=t.toLowerCase(),n=null,s=1/0;for(let o of e){let a=j1(r,o.toLowerCase());a<s&&(s=a,n=o)}let i=Math.max(1,Math.floor(t.length/3));return s<=i?n:null}function j1(t,e){if(t===e)return 0;if(!t.length)return e.length;if(!e.length)return t.length;let r=new Array(e.length+1),n=new Array(e.length+1);for(let s=0;s<=e.length;s++)r[s]=s;for(let s=1;s<=t.length;s++){n[0]=s;for(let i=1;i<=e.length;i++){let o=t[s-1]===e[i-1]?0:1;n[i]=Math.min(n[i-1]+1,r[i]+1,r[i-1]+o)}for(let i=0;i<=e.length;i++)r[i]=n[i]}return r[e.length]}RD.exports={SCHEMA_VERSION:Sc,HARDCODED_DEFAULTS:Cc,VALID_CONFIG_KEYS:Yo,VALID_MODEL_PROFILES:Vo,VALID_COMMUNICATION_MODES:Go,loadConfig:TD,getConfigValue:$1,setConfigValue:F1,initProjectConfig:k1,writeUserDefaults:A1,loadUserDefaults:ms,loadProjectConfig:wc,userLevelPath:Xo,projectLevelPath:Jo,projectYamlPath:jD,suggestClosest:zo}});var OD=v((eT,PD)=>{var I1=require("fs"),T1=require("path"),{listProfiles:R1,getProfile:P1,getResolvedMapForProfile:O1,formatMapAsTable:N1,getProjectProfile:L1}=Ec(),{setConfigValue:B1,getConfigValue:M1}=gs();PD.exports=function(e){let r=process.cwd(),n=T1.join(r,".rcode");I1.existsSync(n)||(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first."),process.exit(1));let s=e[0],i=R1();if((s==="--help"||s==="-h")&&(console.log("Usage: rcode set-profile [<name>]"),console.log(),console.log(" rcode set-profile show current profile + available options"),console.log(" rcode set-profile <name> switch to profile <name>"),console.log(),console.log(`Available profiles: ${i.join(", ")}`),process.exit(0)),!s){let c=L1(r);if(console.log(`
345
+ `;return i}function w1(t=process.cwd()){let e=Uo.join(t,".rcode","config.json");if(ds.existsSync(e))try{let r=JSON.parse(ds.readFileSync(e,"utf8"));return{profile:r.model_profile||Vo(),overrides:r.model_overrides||{}}}catch{console.warn("Warning: .rcode/config.json is invalid JSON. Using defaults.")}return{profile:Vo(),overrides:{}}}jD.exports={loadProfiles:fs,listProfiles:$D,getProfile:bc,getDefaultProfile:Vo,getModelAliases:AD,resolveModelForAgent:FD,getResolvedMapForProfile:E1,formatMapAsTable:C1,getProjectProfile:w1}});var gs=v((rT,PD)=>{var hs=require("fs"),ps=require("path"),{writeJsonAtomic:Ec}=Kt(),{homedir:x1}=dr(),Cc=1,wc={schema_version:Cc,installed_version:null,project_name:null,user_name:"Team",communication_language:"English",document_output_language:"English",output_folder:".rcode",planning_artifacts:".planning/phases",project_knowledge:".rcode/context",model_profile:"balanced",communication_mode:"guided"},Jo=new Set(["schema_version","installed_version","project_name","user_name","communication_language","document_output_language","output_folder","planning_artifacts","project_knowledge","model_profile","communication_mode"]),k1={profile:"model_profile","model-profile":"model_profile",language:"communication_language",user:"user_name",project:"project_name",output:"output_folder",planning:"planning_artifacts",knowledge:"project_knowledge"},Go=new Set(["quality","balanced","budget","inherit"]),zo=new Set(["guided","yolo"]);function Xo(){return ps.join(x1(),".rcode","defaults.json")}function Ko(t){return ps.join(t,".rcode","config.json")}function ID(t){return ps.join(t,".rcode","config.yaml")}function TD(t){if(!hs.existsSync(t))return null;try{return JSON.parse(hs.readFileSync(t,"utf8"))}catch{return null}}function ms(){return TD(Xo())||{}}var $1={mode:"communication_mode"};function A1(t){if(!hs.existsSync(t))return null;try{let e={};for(let r of hs.readFileSync(t,"utf8").split(`
346
+ `)){let n=r.match(/^([a-zA-Z_]+):\s*["']?([^"'\n#]+?)["']?\s*(?:#.*)?$/);if(!n)continue;let s=$1[n[1].trim()]||n[1].trim(),i=n[2].trim();e[s]=i==="true"?!0:i==="false"?!1:i}return Object.keys(e).length?e:null}catch{return null}}function xc(t){let e=TD(Ko(t));return e||A1(ID(t))||{}}function RD(t){let e={...wc};e.project_name===null&&(e.project_name=ps.basename(t));let r=ms(),n=xc(t);return{...e,...r,...n}}function F1(t,e){return Jo.has(e)?RD(t)[e]:void 0}function j1(t,e={}){let r=Ko(t);if(hs.existsSync(r))return!1;let n=ms(),s=o=>e[o]!==void 0?e[o]:n[o]!==void 0?n[o]:wc[o],i={schema_version:Cc,installed_version:e.installed_version||null,project_name:e.project_name||ps.basename(t),user_name:s("user_name"),communication_language:s("communication_language"),document_output_language:s("document_output_language"),output_folder:s("output_folder"),planning_artifacts:s("planning_artifacts"),project_knowledge:s("project_knowledge"),model_profile:s("model_profile")};return Ec(r,i),!0}function I1(t){let r={...ms(),...t};Ec(Xo(),r)}function T1(t,e,r,{scope:n="project"}={}){if(!Jo.has(e)){let a=k1[e.toLowerCase()]||Yo(e,[...Jo]);return{ok:!1,error:`Unknown config key '${e}'`,suggestion:a}}if(e==="model_profile"&&!Go.has(r))return{ok:!1,error:`Invalid model_profile '${r}' (valid: ${[...Go].join(", ")})`,suggestion:Yo(r,[...Go])};if(e==="communication_mode"&&!zo.has(r))return{ok:!1,error:`Invalid communication_mode '${r}' (valid: ${[...zo].join(", ")})`,suggestion:Yo(r,[...zo])};if(e==="schema_version"){let a=Number(r);if(Number.isNaN(a))return{ok:!1,error:"schema_version must be a number"};r=a}let s,i;n==="global"?(s=Xo(),i=ms()):(s=Ko(t),i=xc(t));let o={...i,[e]:r};return Ec(s,o),{ok:!0,scope:n,target:s}}function Yo(t,e){if(!t)return null;let r=t.toLowerCase(),n=null,s=1/0;for(let o of e){let a=R1(r,o.toLowerCase());a<s&&(s=a,n=o)}let i=Math.max(1,Math.floor(t.length/3));return s<=i?n:null}function R1(t,e){if(t===e)return 0;if(!t.length)return e.length;if(!e.length)return t.length;let r=new Array(e.length+1),n=new Array(e.length+1);for(let s=0;s<=e.length;s++)r[s]=s;for(let s=1;s<=t.length;s++){n[0]=s;for(let i=1;i<=e.length;i++){let o=t[s-1]===e[i-1]?0:1;n[i]=Math.min(n[i-1]+1,r[i]+1,r[i-1]+o)}for(let i=0;i<=e.length;i++)r[i]=n[i]}return r[e.length]}PD.exports={SCHEMA_VERSION:Cc,HARDCODED_DEFAULTS:wc,VALID_CONFIG_KEYS:Jo,VALID_MODEL_PROFILES:Go,VALID_COMMUNICATION_MODES:zo,loadConfig:RD,getConfigValue:F1,setConfigValue:T1,initProjectConfig:j1,writeUserDefaults:I1,loadUserDefaults:ms,loadProjectConfig:xc,userLevelPath:Xo,projectLevelPath:Ko,projectYamlPath:ID,suggestClosest:Yo}});var ND=v((nT,OD)=>{var P1=require("fs"),O1=require("path"),{listProfiles:N1,getProfile:L1,getResolvedMapForProfile:B1,formatMapAsTable:M1,getProjectProfile:q1}=Sc(),{setConfigValue:W1,getConfigValue:H1}=gs();OD.exports=function(e){let r=process.cwd(),n=O1.join(r,".rcode");P1.existsSync(n)||(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first."),process.exit(1));let s=e[0],i=N1();if((s==="--help"||s==="-h")&&(console.log("Usage: rcode set-profile [<name>]"),console.log(),console.log(" rcode set-profile show current profile + available options"),console.log(" rcode set-profile <name> switch to profile <name>"),console.log(),console.log(`Available profiles: ${i.join(", ")}`),process.exit(0)),!s){let c=q1(r);if(console.log(`
344
347
  \u{1F54C} Current profile: ${c.profile}
345
- `),Object.keys(c.overrides).length>0){console.log(" Overrides:");for(let[l,d]of Object.entries(c.overrides))console.log(` ${l} \u2192 ${d}`);console.log()}console.log("Available profiles:");for(let l of i){let d=P1(l),f=l===c.profile?" \u2190 current":"";console.log(` \u2022 ${l}${f}`),console.log(` ${d.description}`)}console.log(`
346
- Usage: rcode set-profile <name>`);return}let o=M1(r,"model_profile")||"(default)",a=B1(r,"model_profile",s);a.ok||(console.error(`\u274C ${a.error}`),a.suggestion&&console.error(` Did you mean '${a.suggestion}'?`),console.error(` Available: ${i.join(", ")}`),process.exit(1)),console.log(`
348
+ `),Object.keys(c.overrides).length>0){console.log(" Overrides:");for(let[l,d]of Object.entries(c.overrides))console.log(` ${l} \u2192 ${d}`);console.log()}console.log("Available profiles:");for(let l of i){let d=L1(l),f=l===c.profile?" \u2190 current":"";console.log(` \u2022 ${l}${f}`),console.log(` ${d.description}`)}console.log(`
349
+ Usage: rcode set-profile <name>`);return}let o=H1(r,"model_profile")||"(default)",a=W1(r,"model_profile",s);a.ok||(console.error(`\u274C ${a.error}`),a.suggestion&&console.error(` Did you mean '${a.suggestion}'?`),console.error(` Available: ${i.join(", ")}`),process.exit(1)),console.log(`
347
350
  \u2705 Profile changed: ${o} \u2192 ${s}
348
- `);let u=O1(s);console.log(N1(u)),console.log()}});var MD=v((tT,BD)=>{var q1=require("fs"),W1=require("path"),{loadConfig:ND,setConfigValue:H1,VALID_COMMUNICATION_MODES:xc}=gs(),LD={guided:`Ask questions, confirm at every major gate, halt at decision menus.
351
+ `);let u=B1(s);console.log(M1(u)),console.log()}});var qD=v((sT,MD)=>{var Z1=require("fs"),U1=require("path"),{loadConfig:LD,setConfigValue:V1,VALID_COMMUNICATION_MODES:kc}=gs(),BD={guided:`Ask questions, confirm at every major gate, halt at decision menus.
349
352
  Recommended for: first-time use, critical projects, new domains.`,yolo:`Skip menus, use sensible defaults, report decisions in the final summary.
350
353
  Destructive ops (github push, rm, force-push) STILL require
351
354
  explicit confirmation unless you also pass --force-yolo.
352
- Recommended for: experienced solo projects, prototypes, CI.`};BD.exports=function(e){let r=process.cwd(),n=W1.join(r,".rcode");q1.existsSync(n)||(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first."),process.exit(1));let s=e[0];if((s==="--help"||s==="-h")&&(console.log("Usage: rcode set-mode [<mode>]"),console.log(),console.log(" rcode set-mode show current mode + explanation"),console.log(" rcode set-mode <mode> switch to mode <mode>"),console.log(),console.log(`Available modes: ${[...xc].join(", ")}`),process.exit(0)),!s){let u=ND(r).communication_mode||"guided";console.log(`
355
+ Recommended for: experienced solo projects, prototypes, CI.`};MD.exports=function(e){let r=process.cwd(),n=U1.join(r,".rcode");Z1.existsSync(n)||(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first."),process.exit(1));let s=e[0];if((s==="--help"||s==="-h")&&(console.log("Usage: rcode set-mode [<mode>]"),console.log(),console.log(" rcode set-mode show current mode + explanation"),console.log(" rcode set-mode <mode> switch to mode <mode>"),console.log(),console.log(`Available modes: ${[...kc].join(", ")}`),process.exit(0)),!s){let u=LD(r).communication_mode||"guided";console.log(`
353
356
  \u{1F54C} Communication mode: ${u}
354
- `);for(let c of xc)console.log(` \u2022 ${c}${c===u?" \u2190 current":""}`),console.log(` ${LD[c]}`),console.log();console.log(`Usage: rcode set-mode <${[...xc].join("|")}>`),console.log();return}let i=ND(r).communication_mode||"guided",o=H1(r,"communication_mode",s);o.ok||(console.error(`
357
+ `);for(let c of kc)console.log(` \u2022 ${c}${c===u?" \u2190 current":""}`),console.log(` ${BD[c]}`),console.log();console.log(`Usage: rcode set-mode <${[...kc].join("|")}>`),console.log();return}let i=LD(r).communication_mode||"guided",o=V1(r,"communication_mode",s);o.ok||(console.error(`
355
358
  \u274C ${o.error}`),o.suggestion&&console.error(` Did you mean '${o.suggestion}'?`),console.error(),process.exit(1)),console.log(`
356
- \u2705 Communication mode: ${i} \u2192 ${s}`),console.log(),console.log(` ${LD[s]}`),console.log(),s==="yolo"&&(console.log(" \u26A0 Note: destructive operations (github-sync, uninstall,"),console.log(" force push) still require explicit confirmation unless"),console.log(" --force-yolo / --yes is passed."),console.log())}});var VD=v((nT,UD)=>{var qD=require("fs"),WD=require("path"),{loadConfig:Z1,loadUserDefaults:U1,loadProjectConfig:V1,setConfigValue:G1,getConfigValue:z1,VALID_CONFIG_KEYS:$c,HARDCODED_DEFAULTS:rT,userLevelPath:HD,projectLevelPath:ZD}=gs();function Y1(t){let e={global:!1,list:!1,positional:[]};for(let r of t)r==="--global"||r==="-g"?e.global=!0:r==="--list"||r==="-l"?e.list=!0:e.positional.push(r);return e}function X1(t,e){let r=V1(t);if(e in r)return"project";let n=U1();return e in n?"user":"default"}function J1(t){let e=Z1(t),r=[...$c],n=Math.max(...r.map(i=>i.length)),s=Math.max(...r.map(i=>String(e[i]??"").length),5);console.log(`
359
+ \u2705 Communication mode: ${i} \u2192 ${s}`),console.log(),console.log(` ${BD[s]}`),console.log(),s==="yolo"&&(console.log(" \u26A0 Note: destructive operations (github-sync, uninstall,"),console.log(" force push) still require explicit confirmation unless"),console.log(" --force-yolo / --yes is passed."),console.log())}});var GD=v((iT,VD)=>{var WD=require("fs"),HD=require("path"),{loadConfig:G1,loadUserDefaults:z1,loadProjectConfig:Y1,setConfigValue:J1,getConfigValue:X1,VALID_CONFIG_KEYS:$c,HARDCODED_DEFAULTS:oT,userLevelPath:ZD,projectLevelPath:UD}=gs();function K1(t){let e={global:!1,list:!1,positional:[]};for(let r of t)r==="--global"||r==="-g"?e.global=!0:r==="--list"||r==="-l"?e.list=!0:e.positional.push(r);return e}function Q1(t,e){let r=Y1(t);if(e in r)return"project";let n=z1();return e in n?"user":"default"}function eF(t){let e=G1(t),r=[...$c],n=Math.max(...r.map(i=>i.length)),s=Math.max(...r.map(i=>String(e[i]??"").length),5);console.log(`
357
360
  \u{1F54C} rcode \u2014 configuration
358
- `),console.log(` Project: ${ZD(t)}`),console.log(` User: ${HD()}
359
- `),console.log(` ${"key".padEnd(n)} ${"value".padEnd(s)} source`),console.log(` ${"-".repeat(n)} ${"-".repeat(s)} ------`);for(let i of r){let o=e[i],a=X1(t,i);console.log(` ${i.padEnd(n)} ${String(o??"").padEnd(s)} ${a}`)}console.log()}UD.exports=function(e){let r=process.cwd(),n=Y1(e);if(n.positional.length===0||n.list){let s=WD.join(r,".rcode");!qD.existsSync(s)&&!n.global&&(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first, or use --global to manage user defaults."),process.exit(1)),J1(r);return}if(n.positional.length===1){let s=n.positional[0];$c.has(s)||(console.error(`\u274C Unknown config key '${s}'`),console.error(` Valid keys: ${[...$c].join(", ")}`),process.exit(1));let i=z1(r,s);console.log(i??"");return}if(n.positional.length===2){let[s,i]=n.positional,o=n.global?"global":"project";o==="project"&&!qD.existsSync(WD.join(r,".rcode"))&&(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first, or use --global."),process.exit(1));let a=G1(r,s,i,{scope:o});a.ok||(console.error(`\u274C ${a.error}`),a.suggestion&&console.error(` Did you mean '${a.suggestion}'?`),process.exit(1));let u=o==="global"?HD():ZD(r);console.log(`\u2705 ${s} = ${i} (${o}: ${u})`);return}console.error("\u274C Too many arguments."),console.error(" Usage: rcode config [--global] [key] [value]"),process.exit(1)}});var XD=v((oT,YD)=>{var cn=require("fs"),Ko=require("path"),{computeFingerprint:sT,writeFingerprint:K1,checkStaleness:GD,commitsBetween:Q1,STALE_THRESHOLDS:eF}=pc();function tF(t){let e={check:!1,refresh:!1,installHook:!1};for(let r of t)r==="--check"?e.check=!0:r==="--refresh"?e.refresh=!0:r==="--install-hook"?e.installHook=!0:(console.error(`Unknown flag: ${r}`),console.error("Usage: rcode context [--check|--refresh|--install-hook]"),process.exit(1));return e}function zD(t){cn.existsSync(Ko.join(t,".rcode"))||(console.error(`\u274C No .rcode/ directory found in ${t}`),console.error(" Run 'rcode install' first."),process.exit(1))}function rF(t){let e=GD(t),r=e.status==="fresh"?"\u2713":e.status==="stale"?"\u26A0":"\u2717",n=e.status.toUpperCase();if(console.log(`
361
+ `),console.log(` Project: ${UD(t)}`),console.log(` User: ${ZD()}
362
+ `),console.log(` ${"key".padEnd(n)} ${"value".padEnd(s)} source`),console.log(` ${"-".repeat(n)} ${"-".repeat(s)} ------`);for(let i of r){let o=e[i],a=Q1(t,i);console.log(` ${i.padEnd(n)} ${String(o??"").padEnd(s)} ${a}`)}console.log()}VD.exports=function(e){let r=process.cwd(),n=K1(e);if(n.positional.length===0||n.list){let s=HD.join(r,".rcode");!WD.existsSync(s)&&!n.global&&(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first, or use --global to manage user defaults."),process.exit(1)),eF(r);return}if(n.positional.length===1){let s=n.positional[0];$c.has(s)||(console.error(`\u274C Unknown config key '${s}'`),console.error(` Valid keys: ${[...$c].join(", ")}`),process.exit(1));let i=X1(r,s);console.log(i??"");return}if(n.positional.length===2){let[s,i]=n.positional,o=n.global?"global":"project";o==="project"&&!WD.existsSync(HD.join(r,".rcode"))&&(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first, or use --global."),process.exit(1));let a=J1(r,s,i,{scope:o});a.ok||(console.error(`\u274C ${a.error}`),a.suggestion&&console.error(` Did you mean '${a.suggestion}'?`),process.exit(1));let u=o==="global"?ZD():UD(r);console.log(`\u2705 ${s} = ${i} (${o}: ${u})`);return}console.error("\u274C Too many arguments."),console.error(" Usage: rcode config [--global] [key] [value]"),process.exit(1)}});var XD=v((uT,JD)=>{var cn=require("fs"),Qo=require("path"),{computeFingerprint:aT,writeFingerprint:tF,checkStaleness:zD,commitsBetween:rF,STALE_THRESHOLDS:nF}=mc();function sF(t){let e={check:!1,refresh:!1,installHook:!1};for(let r of t)r==="--check"?e.check=!0:r==="--refresh"?e.refresh=!0:r==="--install-hook"?e.installHook=!0:(console.error(`Unknown flag: ${r}`),console.error("Usage: rcode context [--check|--refresh|--install-hook]"),process.exit(1));return e}function YD(t){cn.existsSync(Qo.join(t,".rcode"))||(console.error(`\u274C No .rcode/ directory found in ${t}`),console.error(" Run 'rcode install' first."),process.exit(1))}function oF(t){let e=zD(t),r=e.status==="fresh"?"\u2713":e.status==="stale"?"\u26A0":"\u2717",n=e.status.toUpperCase();if(console.log(`
360
363
  \u{1F9E0} Memory bank status: ${r} ${n}
361
- `),e.reasons.length>0){console.log(" Reasons:");for(let o of e.reasons)console.log(` \u2022 ${o}`);console.log()}console.log(" Context files:");let s=e.context_files.active?"\u2713":"\u2717",i=e.context_files.brief?"\u2713":"\u2717";if(console.log(` ${s} .rcode/context/active.md`),console.log(` ${i} .rcode/context/project-brief.md`),console.log(),e.stored){if(console.log(` Last init: ${e.stored.timestamp||"unknown"}`),e.stored.git_head){let o=e.stored.git_head.slice(0,7),a=e.stored.git_branch||"detached";console.log(` ${o} on ${a}`)}e.stored.manifest_name&&console.log(` ${e.stored.manifest_name} (${e.stored.manifest_hash})`)}else console.log(" Last init: (never)");if(console.log(` Current: ${e.current.timestamp}`),e.current.git_head){let o=e.current.git_head.slice(0,7),a=e.current.git_branch||"detached";console.log(` ${o} on ${a}`)}if(e.current.manifest_name&&console.log(` ${e.current.manifest_name} (${e.current.manifest_hash})`),e.stored?.git_head&&e.current.git_head){let o=Q1(t,e.stored.git_head,e.current.git_head);o!==null&&console.log(`
362
- Commits since init: ${o} (threshold: ${eF.commitsSinceInit})`)}console.log(),e.status!=="fresh"&&(console.log(" \u27A1 Refresh with: /rcode-init (in your editor)"),console.log())}function nF(t){zD(t);let e=K1(t);console.log(`
363
- \u2705 Fingerprint saved to .rcode/state.json`),console.log(` git: ${e.git_head?e.git_head.slice(0,7):"(no git)"}`),console.log(` manifest: ${e.manifest_name||"(none)"}`),console.log(` structure: ${e.structure_dirs.length} top-level dirs`),console.log()}function sF(t){let e=Ko.join(t,".git");cn.existsSync(e)||(console.error("\u274C Not a git repository (no .git/ found)."),console.error(" The post-commit hook requires git."),process.exit(1));let r=Ko.join(e,"hooks");cn.mkdirSync(r,{recursive:!0});let n=Ko.join(r,"post-commit"),s=`#!/bin/sh
364
+ `),e.reasons.length>0){console.log(" Reasons:");for(let o of e.reasons)console.log(` \u2022 ${o}`);console.log()}console.log(" Context files:");let s=e.context_files.active?"\u2713":"\u2717",i=e.context_files.brief?"\u2713":"\u2717";if(console.log(` ${s} .rcode/context/active.md`),console.log(` ${i} .rcode/context/project-brief.md`),console.log(),e.stored){if(console.log(` Last init: ${e.stored.timestamp||"unknown"}`),e.stored.git_head){let o=e.stored.git_head.slice(0,7),a=e.stored.git_branch||"detached";console.log(` ${o} on ${a}`)}e.stored.manifest_name&&console.log(` ${e.stored.manifest_name} (${e.stored.manifest_hash})`)}else console.log(" Last init: (never)");if(console.log(` Current: ${e.current.timestamp}`),e.current.git_head){let o=e.current.git_head.slice(0,7),a=e.current.git_branch||"detached";console.log(` ${o} on ${a}`)}if(e.current.manifest_name&&console.log(` ${e.current.manifest_name} (${e.current.manifest_hash})`),e.stored?.git_head&&e.current.git_head){let o=rF(t,e.stored.git_head,e.current.git_head);o!==null&&console.log(`
365
+ Commits since init: ${o} (threshold: ${nF.commitsSinceInit})`)}console.log(),e.status!=="fresh"&&(console.log(" \u27A1 Refresh with: /rcode-init (in your editor)"),console.log())}function iF(t){YD(t);let e=tF(t);console.log(`
366
+ \u2705 Fingerprint saved to .rcode/state.json`),console.log(` git: ${e.git_head?e.git_head.slice(0,7):"(no git)"}`),console.log(` manifest: ${e.manifest_name||"(none)"}`),console.log(` structure: ${e.structure_dirs.length} top-level dirs`),console.log()}function aF(t){let e=Qo.join(t,".git");cn.existsSync(e)||(console.error("\u274C Not a git repository (no .git/ found)."),console.error(" The post-commit hook requires git."),process.exit(1));let r=Qo.join(e,"hooks");cn.mkdirSync(r,{recursive:!0});let n=Qo.join(r,"post-commit"),s=`#!/bin/sh
364
367
  # rcode \u2014 memory bank freshness check
365
368
  # Installed by: rcode context --install-hook
366
369
  # Non-blocking: prints a one-line warning if the memory bank is stale.
@@ -372,39 +375,39 @@ if command -v rcode >/dev/null 2>&1; then
372
375
  echo " $(echo "$output" | grep '\u2022' | head -1 | sed 's/^ *//')"
373
376
  fi
374
377
  fi
375
- `;if(cn.existsSync(n)){if(cn.readFileSync(n,"utf8").includes("rcode \u2014 memory bank freshness")){console.log(`\u2713 post-commit hook already installed at ${n}`);return}console.error(`\u274C A post-commit hook already exists at ${n}`),console.error(" Refusing to overwrite. Merge manually or remove the existing hook first."),process.exit(1)}cn.writeFileSync(n,s),cn.chmodSync(n,493),console.log(`\u2705 Installed post-commit hook at ${n}`),console.log(" After each commit, you'll see a warning if the memory bank goes stale."),console.log(` To remove: rm ${n}`)}YD.exports=function(e){let r=process.cwd(),n=tF(e);if(n.installHook){sF(r);return}if(n.refresh){nF(r);return}zD(r),rF(r),n.check&&GD(r).status!=="fresh"&&process.exit(1)}});var ey=v((iT,QD)=>{var{listProfiles:JD,getProfile:oF,resolveModelForAgent:KD,getResolvedMapForProfile:iF,formatMapAsTable:aF,getProjectProfile:uF}=Ec();function cF(t){let e={agent:null,profile:null};for(let r of t)r.startsWith("--profile=")?e.profile=r.slice(10):r.startsWith("--agent=")?e.agent=r.slice(8):r.startsWith("--")||(e.agent=r);return e}QD.exports=function(e){let r=cF(e),n=uF(),s=r.profile||n.profile;JD().includes(s)||(console.error(`\u274C Unknown profile '${s}'`),console.error(` Available: ${JD().join(", ")}`),process.exit(1));let i=oF(s);if(r.agent){try{let a=KD(r.agent,{profile:s,overrides:r.profile?{}:n.overrides});console.log(`${r.agent} (profile: ${s}) \u2192 ${a??"inherit (runtime picks)"}`)}catch(a){console.error(`\u274C ${a.message}`),process.exit(1)}return}console.log(`
378
+ `;if(cn.existsSync(n)){if(cn.readFileSync(n,"utf8").includes("rcode \u2014 memory bank freshness")){console.log(`\u2713 post-commit hook already installed at ${n}`);return}console.error(`\u274C A post-commit hook already exists at ${n}`),console.error(" Refusing to overwrite. Merge manually or remove the existing hook first."),process.exit(1)}cn.writeFileSync(n,s),cn.chmodSync(n,493),console.log(`\u2705 Installed post-commit hook at ${n}`),console.log(" After each commit, you'll see a warning if the memory bank goes stale."),console.log(` To remove: rm ${n}`)}JD.exports=function(e){let r=process.cwd(),n=sF(e);if(n.installHook){aF(r);return}if(n.refresh){iF(r);return}YD(r),oF(r),n.check&&zD(r).status!=="fresh"&&process.exit(1)}});var ty=v((cT,ey)=>{var{listProfiles:KD,getProfile:uF,resolveModelForAgent:QD,getResolvedMapForProfile:cF,formatMapAsTable:lF,getProjectProfile:dF}=Sc();function fF(t){let e={agent:null,profile:null};for(let r of t)r.startsWith("--profile=")?e.profile=r.slice(10):r.startsWith("--agent=")?e.agent=r.slice(8):r.startsWith("--")||(e.agent=r);return e}ey.exports=function(e){let r=fF(e),n=dF(),s=r.profile||n.profile;KD().includes(s)||(console.error(`\u274C Unknown profile '${s}'`),console.error(` Available: ${KD().join(", ")}`),process.exit(1));let i=uF(s);if(r.agent){try{let a=QD(r.agent,{profile:s,overrides:r.profile?{}:n.overrides});console.log(`${r.agent} (profile: ${s}) \u2192 ${a??"inherit (runtime picks)"}`)}catch(a){console.error(`\u274C ${a.message}`),process.exit(1)}return}console.log(`
376
379
  \u{1F54C} Profile: ${s}`),console.log(` ${i.description}
377
- `);let o=iF(s);if(!r.profile&&Object.keys(n.overrides).length>0){console.log(" Overrides applied:");for(let[a,u]of Object.entries(n.overrides)){let c=KD(a,{profile:s,overrides:n.overrides});o[a]=c,console.log(` ${a} \u2192 ${u} (resolved: ${c??"inherit"})`)}console.log()}console.log(aF(o))}});var ny=v((uT,ry)=>{var{execSync:aT,spawnSync:ty}=require("child_process");function lF(t){return t?t.replace(/\b(ghp_|ghs_|github_pat_)[A-Za-z0-9_]{10,}\b/g,"[REDACTED]").slice(0,2e3):""}function Xe(t,{input:e=null,allowFailure:r=!1}={}){let n=ty("gh",t,{encoding:"utf8",input:e,stdio:e?["pipe","pipe","pipe"]:["ignore","pipe","pipe"]});if(n.status!==0&&!r){let s=lF(n.stderr||n.stdout||"(no output)");throw new Error(`gh ${t.join(" ")} failed:
378
- ${s}`)}return{status:n.status,stdout:n.stdout||"",stderr:n.stderr||""}}function dF(){try{let t=Xe(["auth","status"],{allowFailure:!0});if(t.status!==0)return{authenticated:!1,error:t.stderr};let e=(t.stderr+t.stdout).match(/Logged in to github\.com account (\S+)/);return{authenticated:!0,account:e?e[1]:"unknown"}}catch(t){return{authenticated:!1,error:t.message}}}function fF(t=process.cwd()){try{let e=ty("gh",["repo","view","--json","owner,name,nameWithOwner,url"],{cwd:t,encoding:"utf8"});return e.status!==0?null:JSON.parse(e.stdout)}catch{return null}}function hF(t,e,r,{execute:n=!1,dryRun:s=!0}={}){if(s||!n)return console.log(` [dry-run] would ensure label: ${t} (${e})`),{dryRun:!0};let i=Xe(["label","list","--search",t,"--json","name"],{allowFailure:!0});if(i.status===0){let u;try{u=JSON.parse(i.stdout||"[]")}catch{u=[]}if(u.some(c=>c.name===t))return{existed:!0,name:t}}let o=["label","create",t,"--color",e];r&&o.push("--description",r);let a=Xe(o,{allowFailure:!0});return{created:a.status===0,name:t,error:a.status!==0?a.stderr:null}}function pF(t,e,r,{execute:n=!1,dryRun:s=!0,repo:i=null}={}){if(s||!n)return console.log(` [dry-run] would create milestone: "${t}"`),{dryRun:!0,title:t};let a=["api","--method","POST",`${i?`/repos/${i}`:"/repos/{owner}/{repo}"}/milestones`,"-f",`title=${t}`,"-f",`description=${e||""}`,"-f","state=open"];r&&a.push("-f",`due_on=${r}`);let u=Xe(a,{allowFailure:!0});if(u.status!==0)return{error:u.stderr};let c;try{c=JSON.parse(u.stdout)}catch{return{error:"failed to parse milestone response"}}return{created:!0,number:c.number,id:c.id,title:c.title,url:c.html_url}}function mF(t,{repo:e=null}={}){let r=["issue","view",String(t),"--json","number,title,body,labels,milestone,state,url"];e&&r.push("--repo",e);let n=Xe(r,{allowFailure:!0});if(n.status!==0)return{error:n.stderr};try{return JSON.parse(n.stdout)}catch{return{error:"failed to parse issue response"}}}function gF({title:t,body:e,labels:r=[],milestone:n=null,assignees:s=[]},{execute:i=!1,dryRun:o=!0,repo:a=null}={}){if(o||!i)return console.log(` [dry-run] would create issue: "${t}" (labels: ${r.join(",")})`),{dryRun:!0,title:t};let u=["issue","create","--title",t,"--body",e||""];for(let f of r)u.push("--label",f);n&&u.push("--milestone",String(n));for(let f of s)u.push("--assignee",f);a&&u.push("--repo",a);let c=Xe(u,{allowFailure:!0});if(c.status!==0)return{error:c.stderr};let l=c.stdout.trim(),d=l.match(/\/issues\/(\d+)/);return{created:!0,url:l,number:d?parseInt(d[1],10):null}}function DF(t,{title:e,body:r,addLabels:n,removeLabels:s,milestone:i,state:o},{execute:a=!1,dryRun:u=!0,repo:c=null}={}){if(u||!a){let f=[];return e!==void 0&&f.push("title"),r!==void 0&&f.push("body"),n&&n.length&&f.push(`+labels:${n.join(",")}`),s&&s.length&&f.push(`-labels:${s.join(",")}`),i!==void 0&&f.push("milestone"),o!==void 0&&f.push(`state:${o}`),console.log(` [dry-run] would update issue #${t} (${f.join(", ")})`),{dryRun:!0,number:t}}let l=[],d=["issue","edit",String(t)];if(c&&d.push("--repo",c),e!==void 0&&d.push("--title",e),r!==void 0&&d.push("--body",r),i!==void 0&&(i===null?d.push("--remove-milestone"):d.push("--milestone",String(i))),n&&n.length)for(let f of n)d.push("--add-label",f);if(s&&s.length)for(let f of s)d.push("--remove-label",f);if(d.length>3+(c?2:0)){let f=Xe(d,{allowFailure:!0});f.status!==0&&l.push(`edit: ${f.stderr}`)}if(o==="closed"){let f=["issue","close",String(t)];c&&f.push("--repo",c);let g=Xe(f,{allowFailure:!0});g.status!==0&&l.push(`close: ${g.stderr}`)}else if(o==="open"){let f=["issue","reopen",String(t)];c&&f.push("--repo",c);let g=Xe(f,{allowFailure:!0});g.status!==0&&l.push(`reopen: ${g.stderr}`)}return l.length>0?{error:l.join("; ")}:{updated:!0,number:t}}function yF(t,{title:e,description:r,state:n,dueDate:s},{execute:i=!1,dryRun:o=!0,repo:a=null}={}){if(o||!i)return console.log(` [dry-run] would update milestone #${t}`),{dryRun:!0,number:t};let c=["api","--method","PATCH",`${a?`/repos/${a}`:"/repos/{owner}/{repo}"}/milestones/${t}`];e!==void 0&&c.push("-f",`title=${e}`),r!==void 0&&c.push("-f",`description=${r}`),n!==void 0&&c.push("-f",`state=${n}`),s!==void 0&&(s===null?c.push("-f","due_on="):c.push("-f",`due_on=${s}`));let l=Xe(c,{allowFailure:!0});return l.status!==0?{error:l.stderr}:{updated:!0,number:t}}function vF(t,{execute:e=!0}={}){let r=Xe(["project","list","--owner",t,"--format","json"],{allowFailure:!0});if(r.status!==0)return null;try{return JSON.parse(r.stdout)}catch{return null}}function _F(t,e,{execute:r=!1,dryRun:n=!0}={}){if(n||!r)return console.log(` [dry-run] would create Project v2: "${e}" (owner: ${t})`),{dryRun:!0,title:e};let s=Xe(["project","create","--owner",t,"--title",e,"--format","json"],{allowFailure:!0});if(s.status!==0)return{error:s.stderr};try{return JSON.parse(s.stdout)}catch{return{error:"failed to parse project response"}}}function EF(t,e,r,{execute:n=!1,dryRun:s=!0}={}){if(s||!n)return console.log(` [dry-run] would add ${r} to project ${t}`),{dryRun:!0};let i=Xe(["project","item-add","--owner",e,String(t),"--url",r,"--format","json"],{allowFailure:!0});if(i.status!==0)return{error:i.stderr};try{return JSON.parse(i.stdout)}catch{return{error:"failed to parse project item response"}}}function bF(){try{let t=Xe(["api","rate_limit"],{allowFailure:!0});return t.status!==0?null:JSON.parse(t.stdout)}catch{return null}}ry.exports={runGh:Xe,checkAuth:dF,detectRepo:fF,ensureLabel:hF,createMilestone:pF,updateMilestone:yF,getIssue:mF,createIssue:gF,updateIssue:DF,listProjects:vF,createProject:_F,addIssueToProject:EF,getRateLimit:bF}});var uy=v((cT,ay)=>{var Yt=require("fs"),ln=require("path");function sy(t){let e=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return{};let r={};for(let n of e[1].split(/\r?\n/)){let s=n.match(/^([\w_-]+)\s*:\s*(.*)$/);s&&(r[s[1].trim()]=s[2].trim().replace(/^["']|["']$/g,""))}return r}function kc(t){let e=t.match(/^#\s+(.+)$/m);return e?e[1].trim():null}function SF(t,e,r,n){let s=[],i=/<task\b([^>]*)>([\s\S]*?)<\/task>/g,o,a=0;for(;o=i.exec(t);){a+=1;let u=o[1].match(/id="([^"]+)"/),c=o[1].match(/title="([^"]*)"/),l=o[2].match(/<title>([\s\S]*?)<\/title>/);s.push({id:u?u[1]:`${e}-task-${a}`,file:r,content:o[0],title:c&&c[1].trim()||l&&l[1].trim()||`Task ${a}`,parentEpic:null,sprintId:e,frontmatter:{},sourcePath:`${n}/${r}`})}if(s.length===0){let u=/^#{2,4}\s+(?:Story|Task)\s+([^\s—–-]+)\s*[—–-]\s*(.+?)\s*$/gm,c;for(;c=u.exec(t);)s.push({id:c[1].trim(),file:r,content:c[0],title:c[2].trim(),parentEpic:null,sprintId:e,frontmatter:{},sourcePath:`${n}/${r}`})}return s}function oy(t){let e=ln.join(t,".planning","phases");if(!Yt.existsSync(e))return[];let r=[];for(let n of Yt.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let s=n.name.match(/^(\d+)-/),i=s?s[1]:null,o=ln.join(e,n.name),a=`.planning/phases/${n.name}`,u=Yt.readdirSync(o).filter(l=>/-SPRINT\.md$/i.test(l)).sort((l,d)=>{let f=parseInt((l.match(/-(\d+)-SPRINT\.md$/i)||[])[1]||"0",10),g=parseInt((d.match(/-(\d+)-SPRINT\.md$/i)||[])[1]||"0",10);return f-g}),c=[];for(let l of u){let d=Yt.readFileSync(ln.join(o,l),"utf8"),f=l.match(/^(\d+)-(\d+)-SPRINT\.md$/i),g;f?g=`${parseInt(f[1],10)}.${parseInt(f[2],10)}`:g=sy(d).sprint||l.replace(/-SPRINT\.md$/i,""),c.push(...SF(d,g,l,a))}r.push({id:n.name,numericId:i,brief:null,sprints:null,sprintMap:{},stories:c,epics:[],noMilestone:!1})}return r}function iy(t){let e=ln.join(t,".planning","epics");if(!Yt.existsSync(e))return null;let r=[],n=Yt.readdirSync(e).filter(o=>/^EPIC-\d+\.md$/i.test(o));for(let o of n){let a=Yt.readFileSync(ln.join(e,o),"utf8"),u=o.match(/(\d+)/),c=u?parseInt(u[1],10):null,l=o.replace(/\.md$/i,"");r.push({id:l,file:o,epicNumber:c,content:a,title:kc(a)||l,frontmatter:{},sourcePath:`.planning/epics/${o}`})}let s=[],i=ln.join(e,"stories");if(Yt.existsSync(i)){let o=Yt.readdirSync(i).filter(a=>/^[\d.]+\.md$/.test(a));for(let a of o){let u=Yt.readFileSync(ln.join(i,a),"utf8"),c=a.replace(/\.md$/i,""),l=u.match(/\*\*Epic:\*\*\s*EPIC-(\d+)/i),d=null;if(l){let f=parseInt(l[1],10),g=r.find(m=>m.epicNumber===f);g&&(d=g.id)}s.push({id:c,file:a,content:u,title:kc(u)||c,parentEpic:d,sprintId:null,frontmatter:{},sourcePath:`.planning/epics/stories/${a}`})}}return r.length===0&&s.length===0?null:{id:"epics",numericId:null,brief:null,sprints:null,sprintMap:{},stories:s,epics:r,noMilestone:!0}}function CF(t){let e=oy(t),r=iy(t);return r&&e.push(r),e}function wF(t,e){if(!e.sprint&&!e.epic&&!e.story)return t;let r=t.map(n=>({...n,epics:[...n.epics],stories:[...n.stories]}));if(e.sprint){let n=e.sprint.replace(/-/g,".");for(let s of r){s.stories=s.stories.filter(o=>o.sprintId===e.sprint||o.sprintId===n);let i=new Set(s.stories.map(o=>o.parentEpic).filter(Boolean));s.epics=s.epics.filter(o=>i.has(o.id))}}if(e.epic)for(let n of r)n.epics=n.epics.filter(s=>s.id===e.epic),n.stories=n.stories.filter(s=>s.parentEpic===e.epic);if(e.story)for(let n of r){n.stories=n.stories.filter(i=>i.id===e.story);let s=new Set(n.stories.map(i=>i.parentEpic).filter(Boolean));n.epics=n.epics.filter(i=>s.has(i.id))}return r.filter(n=>n.epics.length>0||n.stories.length>0)}ay.exports={extractFrontmatter:sy,extractTitle:kc,discoverSprintTrackPhases:oy,discoverEpicTrackPhase:iy,discoverPhases:CF,applyGranularFilters:wF}});var ly=v((lT,cy)=>{var Qo=require("fs"),Ac=require("path"),xF=require("crypto"),Rt=ny(),{askText:$F,PromptAbortError:kF}=as(),{writeJsonAtomic:AF}=Jt(),{loadConfig:FF}=gs(),{discoverPhases:jF,applyGranularFilters:IF}=uy();function Rn(t){return xF.createHash("sha256").update(t||"").digest("hex").slice(0,12)}function TF(t){let e={execute:!1,dryRun:!0,repo:null,only:null,phase:null,sprint:null,epic:null,story:null,withLabels:!1,createProject:!1,yes:!1,forceYolo:!1,updateBody:!0,updateLabels:!0,updateMilestone:!0,updateState:!0};for(let r of t)r==="--execute"||r==="-e"?(e.execute=!0,e.dryRun=!1):r==="--dry-run"?(e.dryRun=!0,e.execute=!1):r==="--yes"||r==="-y"?e.yes=!0:r==="--force-yolo"?e.forceYolo=!0:r==="--with-labels"?e.withLabels=!0:r==="--project"?e.createProject=!0:r==="--no-update"?(e.updateBody=!1,e.updateLabels=!1,e.updateMilestone=!1,e.updateState=!1):r==="--no-update-body"?e.updateBody=!1:r==="--no-update-labels"?e.updateLabels=!1:r==="--no-close"?e.updateState=!1:r.startsWith("--repo=")?e.repo=r.slice(7):r.startsWith("--only=")?e.only=r.slice(7):r.startsWith("--phase=")?e.phase=r.slice(8):r.startsWith("--sprint=")?e.sprint=r.slice(9):r.startsWith("--epic=")?e.epic=r.slice(7):r.startsWith("--story=")&&(e.story=r.slice(8));return e.updateEnabled=e.updateBody||e.updateLabels||e.updateMilestone||e.updateState,e}function RF(t){let e=Ac.join(t,".rcode/state.json");if(!Qo.existsSync(e))return null;try{return JSON.parse(Qo.readFileSync(e,"utf8"))}catch{return null}}function PF(t){let e=Ac.join(t,".rcode/integrations/github-map.json");if(!Qo.existsSync(e))return{phases:{},epics:{},stories:{},project:null,labels:[]};try{return JSON.parse(Qo.readFileSync(e,"utf8"))}catch{return{phases:{},epics:{},stories:{},project:null,labels:[]}}}function Ds(t,e){let r=Ac.join(t,".rcode/integrations/github-map.json");AF(r,e)}function Re(t,e){return`${t}:${e}`}async function OF(t){let e=TF(t),r=process.cwd(),s=FF(r).communication_mode||"guided";console.log(`
379
- \u{1F54C} rcode \u2014 GitHub Sync`),console.log(` Mode: ${e.dryRun?"DRY-RUN (preview only, nothing is sent)":"EXECUTE"}`),console.log(` Comms mode: ${s}`),console.log(` Scope: ${e.only||"full (create + update existing)"}`),console.log(` Labels: ${e.withLabels?"will create/ensure taxonomy":"skipped (pass --with-labels to enable)"}`),e.updateEnabled||console.log(" Note: --no-update passed \u2192 create-only mode"),e.phase&&console.log(` Phase filter: ${e.phase}`),e.sprint&&console.log(` Sprint filter: ${e.sprint}`),e.epic&&console.log(` Epic filter: ${e.epic}`),e.story&&console.log(` Story filter: ${e.story}`),console.log();let i=Rt.checkAuth();i.authenticated||(console.error("\u274C gh CLI not authenticated."),console.error(" Run: gh auth login"),console.error(` Error: ${i.error||"unknown"}`),process.exit(1)),console.log(` \u2713 Authenticated as ${i.account}`);let o=e.repo;if(!o){let h=Rt.detectRepo(r);h||(console.error("\u274C Could not detect GitHub repo. Run from a git repo or pass --repo=owner/name"),process.exit(1)),o=h.nameWithOwner}console.log(` \u2713 Target repo: ${o}`);let a=RF(r);a||(console.error("\u274C No .rcode/state.json found. Run 'rcode install' first."),process.exit(1)),console.log(` \u2713 Project: ${a.project_name||"(unnamed)"}`);let u=jF(r);if(e.phase&&(u=u.filter(h=>h.id===e.phase||h.numericId===e.phase),u.length===0&&(console.error(`\u274C Phase '${e.phase}' not found.`),process.exit(1))),u=IF(u,e),u.length===0){if(e.sprint||e.epic||e.story){let h=e.sprint?`sprint '${e.sprint}'`:e.epic?`epic '${e.epic}'`:`story '${e.story}'`;console.error(`\u274C No items matched ${h}.`),console.error(" Check the filter value or run without filters to see available ids."),process.exit(1)}console.log("\u2139 No phases found in .planning/phases/ or epics in .planning/epics/ \u2014 nothing to sync."),console.log(" Run /rcode-plan or /rcode-create-epics-and-stories to get started."),process.exit(0)}console.log(` \u2713 Phases found: ${u.length}`);for(let h of u)console.log(` - ${h.id} (${h.epics.length} epics, ${h.stories.length} stories)`);let c=PF(r),l={phases:Object.keys(c.phases).length,epics:Object.keys(c.epics).length,stories:Object.keys(c.stories).length};l.phases+l.epics+l.stories>0&&console.log(` \u2139 Existing sync map: ${l.phases} phases, ${l.epics} epics, ${l.stories} stories`);let d={labels:e.withLabels?[{name:"epic",color:"6f42c1",description:"Strategic initiative spanning multiple sprints"},{name:"type:feature",color:"0e8a16",description:"New functionality"},{name:"type:task",color:"c5def5",description:"Development work"},{name:"type:bug",color:"d73a4a",description:"Something is broken"},{name:"type:docs",color:"0075ca",description:"Documentation"},{name:"priority:critical",color:"b60205",description:"Drop everything"},{name:"priority:high",color:"d93f0b",description:"Important for sprint"},{name:"priority:medium",color:"fbca04",description:"Standard priority"},{name:"priority:low",color:"0e8a16",description:"Nice to have"},{name:"status:backlog",color:"c5def5",description:"Not started"},{name:"status:todo",color:"0075ca",description:"Ready to start"},{name:"status:in-progress",color:"fbca04",description:"Currently working"},{name:"status:blocked",color:"d73a4a",description:"Cannot progress"},{name:"status:review",color:"6f42c1",description:"Code review needed"},{name:"status:done",color:"0e8a16",description:"Completed"},{name:"FE",color:"1e3a8a",description:"Frontend"},{name:"BE",color:"0e8a16",description:"Backend"},{name:"ML",color:"6f42c1",description:"Machine Learning"},{name:"API",color:"0075ca",description:"API / Backend services"},{name:"Design",color:"f59e0b",description:"UI/UX design work"},{name:"DevOps",color:"fbca04",description:"Infrastructure and deployment"},{name:"QA",color:"d73a4a",description:"Quality assurance"},{name:"Docs",color:"c5def5",description:"Documentation"}]:[],milestones:u.filter(h=>!h.noMilestone&&!c.phases[h.id]),epics:u.flatMap(h=>h.epics.filter(w=>!c.epics[Re(h.id,w.id)]).map(w=>({...w,phase:h.id}))),stories:u.flatMap(h=>h.stories.filter(w=>!c.stories[Re(h.id,w.id)]).map(w=>({...w,phase:h.id}))),updateEpics:e.updateEnabled?u.flatMap(h=>h.epics.filter(w=>c.epics[Re(h.id,w.id)]).map(w=>({...w,phase:h.id,issueNumber:c.epics[Re(h.id,w.id)].issue_number,lastSyncedAt:c.epics[Re(h.id,w.id)].synced_at,lastSyncedContentHash:c.epics[Re(h.id,w.id)].content_hash}))):[],updateStories:e.updateEnabled?u.flatMap(h=>h.stories.filter(w=>c.stories[Re(h.id,w.id)]).map(w=>({...w,phase:h.id,issueNumber:c.stories[Re(h.id,w.id)].issue_number,lastSyncedAt:c.stories[Re(h.id,w.id)].synced_at,lastSyncedContentHash:c.stories[Re(h.id,w.id)].content_hash}))):[]};console.log(`
380
- \u{1F4CB} Plan:`),e.withLabels&&(!e.only||e.only==="labels")&&console.log(` Labels to ensure: ${d.labels.length}`),(!e.only||e.only==="milestones")&&console.log(` Milestones to create: ${d.milestones.length}`),(!e.only||e.only==="epics")&&console.log(` Epics to create: ${d.epics.length}`),(!e.only||e.only==="stories")&&console.log(` Stories to create: ${d.stories.length}`),e.updateEnabled&&((!e.only||e.only==="epics")&&console.log(` Epics to check: ${d.updateEpics.length} (existing, will update if changed)`),(!e.only||e.only==="stories")&&console.log(` Stories to check: ${d.updateStories.length} (existing, will update if changed)`)),e.createProject&&console.log(` Project v2: will create "${a.project_name||o}"`),console.log();let f=s==="yolo"&&e.yes&&!e.forceYolo;if(e.execute&&(!e.yes||f)){f&&(console.log("\u26A0\uFE0F communication_mode=yolo does not auto-confirm GitHub mutations."),console.log(" Pass --force-yolo to skip this prompt, or answer interactively below."),console.log()),console.log(`\u26A0\uFE0F This will modify ${o} on GitHub.`);let h=d.labels.length+d.milestones.length+d.epics.length+d.stories.length;console.log(` Items to create: ${h}`),(e.sprint||e.epic||e.story)&&console.log(` Granular filter: ${e.sprint||e.epic||e.story}`),console.log();let w=await $F(" Proceed? Type 'yes' to continue: ",{default:"no",validate:C=>{let A=C.toLowerCase();return["yes","y","no","n"].includes(A)?!0:"Please type 'yes' to confirm, or 'no' to abort."}});["yes","y"].includes(w.toLowerCase())||(console.log(`
381
- \u274C Aborted by user. No changes made.`),process.exit(0)),console.log()}let m={labels:[],milestones:[],epics:[],stories:[],errors:[]},D={execute:e.execute,dryRun:e.dryRun,repo:o};if(e.withLabels&&(!e.only||e.only==="labels")){console.log(`
382
- \u{1F3F7}\uFE0F Labels`);for(let h of d.labels){let w=Rt.ensureLabel(h.name,h.color,h.description,D);m.labels.push(w),w.error?m.errors.push(`label ${h.name}: ${w.error}`):w.dryRun||(c.labels.includes(h.name)||c.labels.push(h.name),e.execute&&Ds(r,c),console.log(` \u2713 ${w.existed?"exists":"created"}: ${h.name}`))}}if(!e.only||e.only==="milestones"){console.log(`
380
+ `);let o=cF(s);if(!r.profile&&Object.keys(n.overrides).length>0){console.log(" Overrides applied:");for(let[a,u]of Object.entries(n.overrides)){let c=QD(a,{profile:s,overrides:n.overrides});o[a]=c,console.log(` ${a} \u2192 ${u} (resolved: ${c??"inherit"})`)}console.log()}console.log(lF(o))}});var sy=v((dT,ny)=>{var{execSync:lT,spawnSync:ry}=require("child_process");function hF(t){return t?t.replace(/\b(ghp_|ghs_|github_pat_)[A-Za-z0-9_]{10,}\b/g,"[REDACTED]").slice(0,2e3):""}function Ke(t,{input:e=null,allowFailure:r=!1}={}){let n=ry("gh",t,{encoding:"utf8",input:e,stdio:e?["pipe","pipe","pipe"]:["ignore","pipe","pipe"]});if(n.status!==0&&!r){let s=hF(n.stderr||n.stdout||"(no output)");throw new Error(`gh ${t.join(" ")} failed:
381
+ ${s}`)}return{status:n.status,stdout:n.stdout||"",stderr:n.stderr||""}}function pF(){try{let t=Ke(["auth","status"],{allowFailure:!0});if(t.status!==0)return{authenticated:!1,error:t.stderr};let e=(t.stderr+t.stdout).match(/Logged in to github\.com account (\S+)/);return{authenticated:!0,account:e?e[1]:"unknown"}}catch(t){return{authenticated:!1,error:t.message}}}function mF(t=process.cwd()){try{let e=ry("gh",["repo","view","--json","owner,name,nameWithOwner,url"],{cwd:t,encoding:"utf8"});return e.status!==0?null:JSON.parse(e.stdout)}catch{return null}}function gF(t,e,r,{execute:n=!1,dryRun:s=!0}={}){if(s||!n)return console.log(` [dry-run] would ensure label: ${t} (${e})`),{dryRun:!0};let i=Ke(["label","list","--search",t,"--json","name"],{allowFailure:!0});if(i.status===0){let u;try{u=JSON.parse(i.stdout||"[]")}catch{u=[]}if(u.some(c=>c.name===t))return{existed:!0,name:t}}let o=["label","create",t,"--color",e];r&&o.push("--description",r);let a=Ke(o,{allowFailure:!0});return{created:a.status===0,name:t,error:a.status!==0?a.stderr:null}}function DF(t,e,r,{execute:n=!1,dryRun:s=!0,repo:i=null}={}){if(s||!n)return console.log(` [dry-run] would create milestone: "${t}"`),{dryRun:!0,title:t};let a=["api","--method","POST",`${i?`/repos/${i}`:"/repos/{owner}/{repo}"}/milestones`,"-f",`title=${t}`,"-f",`description=${e||""}`,"-f","state=open"];r&&a.push("-f",`due_on=${r}`);let u=Ke(a,{allowFailure:!0});if(u.status!==0)return{error:u.stderr};let c;try{c=JSON.parse(u.stdout)}catch{return{error:"failed to parse milestone response"}}return{created:!0,number:c.number,id:c.id,title:c.title,url:c.html_url}}function yF(t,{repo:e=null}={}){let r=["issue","view",String(t),"--json","number,title,body,labels,milestone,state,url"];e&&r.push("--repo",e);let n=Ke(r,{allowFailure:!0});if(n.status!==0)return{error:n.stderr};try{return JSON.parse(n.stdout)}catch{return{error:"failed to parse issue response"}}}function vF({title:t,body:e,labels:r=[],milestone:n=null,assignees:s=[]},{execute:i=!1,dryRun:o=!0,repo:a=null}={}){if(o||!i)return console.log(` [dry-run] would create issue: "${t}" (labels: ${r.join(",")})`),{dryRun:!0,title:t};let u=["issue","create","--title",t,"--body",e||""];for(let f of r)u.push("--label",f);n&&u.push("--milestone",String(n));for(let f of s)u.push("--assignee",f);a&&u.push("--repo",a);let c=Ke(u,{allowFailure:!0});if(c.status!==0)return{error:c.stderr};let l=c.stdout.trim(),d=l.match(/\/issues\/(\d+)/);return{created:!0,url:l,number:d?parseInt(d[1],10):null}}function _F(t,{title:e,body:r,addLabels:n,removeLabels:s,milestone:i,state:o},{execute:a=!1,dryRun:u=!0,repo:c=null}={}){if(u||!a){let f=[];return e!==void 0&&f.push("title"),r!==void 0&&f.push("body"),n&&n.length&&f.push(`+labels:${n.join(",")}`),s&&s.length&&f.push(`-labels:${s.join(",")}`),i!==void 0&&f.push("milestone"),o!==void 0&&f.push(`state:${o}`),console.log(` [dry-run] would update issue #${t} (${f.join(", ")})`),{dryRun:!0,number:t}}let l=[],d=["issue","edit",String(t)];if(c&&d.push("--repo",c),e!==void 0&&d.push("--title",e),r!==void 0&&d.push("--body",r),i!==void 0&&(i===null?d.push("--remove-milestone"):d.push("--milestone",String(i))),n&&n.length)for(let f of n)d.push("--add-label",f);if(s&&s.length)for(let f of s)d.push("--remove-label",f);if(d.length>3+(c?2:0)){let f=Ke(d,{allowFailure:!0});f.status!==0&&l.push(`edit: ${f.stderr}`)}if(o==="closed"){let f=["issue","close",String(t)];c&&f.push("--repo",c);let g=Ke(f,{allowFailure:!0});g.status!==0&&l.push(`close: ${g.stderr}`)}else if(o==="open"){let f=["issue","reopen",String(t)];c&&f.push("--repo",c);let g=Ke(f,{allowFailure:!0});g.status!==0&&l.push(`reopen: ${g.stderr}`)}return l.length>0?{error:l.join("; ")}:{updated:!0,number:t}}function bF(t,{title:e,description:r,state:n,dueDate:s},{execute:i=!1,dryRun:o=!0,repo:a=null}={}){if(o||!i)return console.log(` [dry-run] would update milestone #${t}`),{dryRun:!0,number:t};let c=["api","--method","PATCH",`${a?`/repos/${a}`:"/repos/{owner}/{repo}"}/milestones/${t}`];e!==void 0&&c.push("-f",`title=${e}`),r!==void 0&&c.push("-f",`description=${r}`),n!==void 0&&c.push("-f",`state=${n}`),s!==void 0&&(s===null?c.push("-f","due_on="):c.push("-f",`due_on=${s}`));let l=Ke(c,{allowFailure:!0});return l.status!==0?{error:l.stderr}:{updated:!0,number:t}}function SF(t,{execute:e=!0}={}){let r=Ke(["project","list","--owner",t,"--format","json"],{allowFailure:!0});if(r.status!==0)return null;try{return JSON.parse(r.stdout)}catch{return null}}function EF(t,e,{execute:r=!1,dryRun:n=!0}={}){if(n||!r)return console.log(` [dry-run] would create Project v2: "${e}" (owner: ${t})`),{dryRun:!0,title:e};let s=Ke(["project","create","--owner",t,"--title",e,"--format","json"],{allowFailure:!0});if(s.status!==0)return{error:s.stderr};try{return JSON.parse(s.stdout)}catch{return{error:"failed to parse project response"}}}function CF(t,e,r,{execute:n=!1,dryRun:s=!0}={}){if(s||!n)return console.log(` [dry-run] would add ${r} to project ${t}`),{dryRun:!0};let i=Ke(["project","item-add","--owner",e,String(t),"--url",r,"--format","json"],{allowFailure:!0});if(i.status!==0)return{error:i.stderr};try{return JSON.parse(i.stdout)}catch{return{error:"failed to parse project item response"}}}function wF(){try{let t=Ke(["api","rate_limit"],{allowFailure:!0});return t.status!==0?null:JSON.parse(t.stdout)}catch{return null}}ny.exports={runGh:Ke,checkAuth:pF,detectRepo:mF,ensureLabel:gF,createMilestone:DF,updateMilestone:bF,getIssue:yF,createIssue:vF,updateIssue:_F,listProjects:SF,createProject:EF,addIssueToProject:CF,getRateLimit:wF}});var cy=v((fT,uy)=>{var Jt=require("fs"),ln=require("path");function oy(t){let e=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return{};let r={};for(let n of e[1].split(/\r?\n/)){let s=n.match(/^([\w_-]+)\s*:\s*(.*)$/);s&&(r[s[1].trim()]=s[2].trim().replace(/^["']|["']$/g,""))}return r}function Ac(t){let e=t.match(/^#\s+(.+)$/m);return e?e[1].trim():null}function xF(t,e,r,n){let s=[],i=/<task\b([^>]*)>([\s\S]*?)<\/task>/g,o,a=0;for(;o=i.exec(t);){a+=1;let u=o[1].match(/id="([^"]+)"/),c=o[1].match(/title="([^"]*)"/),l=o[2].match(/<title>([\s\S]*?)<\/title>/);s.push({id:u?u[1]:`${e}-task-${a}`,file:r,content:o[0],title:c&&c[1].trim()||l&&l[1].trim()||`Task ${a}`,parentEpic:null,sprintId:e,frontmatter:{},sourcePath:`${n}/${r}`})}if(s.length===0){let u=/^#{2,4}\s+(?:Story|Task)\s+([^\s—–-]+)\s*[—–-]\s*(.+?)\s*$/gm,c;for(;c=u.exec(t);)s.push({id:c[1].trim(),file:r,content:c[0],title:c[2].trim(),parentEpic:null,sprintId:e,frontmatter:{},sourcePath:`${n}/${r}`})}return s}function iy(t){let e=ln.join(t,".planning","phases");if(!Jt.existsSync(e))return[];let r=[];for(let n of Jt.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let s=n.name.match(/^(\d+)-/),i=s?s[1]:null,o=ln.join(e,n.name),a=`.planning/phases/${n.name}`,u=Jt.readdirSync(o).filter(l=>/-SPRINT\.md$/i.test(l)).sort((l,d)=>{let f=parseInt((l.match(/-(\d+)-SPRINT\.md$/i)||[])[1]||"0",10),g=parseInt((d.match(/-(\d+)-SPRINT\.md$/i)||[])[1]||"0",10);return f-g}),c=[];for(let l of u){let d=Jt.readFileSync(ln.join(o,l),"utf8"),f=l.match(/^(\d+)-(\d+)-SPRINT\.md$/i),g;f?g=`${parseInt(f[1],10)}.${parseInt(f[2],10)}`:g=oy(d).sprint||l.replace(/-SPRINT\.md$/i,""),c.push(...xF(d,g,l,a))}r.push({id:n.name,numericId:i,brief:null,sprints:null,sprintMap:{},stories:c,epics:[],noMilestone:!1})}return r}function ay(t){let e=ln.join(t,".planning","epics");if(!Jt.existsSync(e))return null;let r=[],n=Jt.readdirSync(e).filter(o=>/^EPIC-\d+\.md$/i.test(o));for(let o of n){let a=Jt.readFileSync(ln.join(e,o),"utf8"),u=o.match(/(\d+)/),c=u?parseInt(u[1],10):null,l=o.replace(/\.md$/i,"");r.push({id:l,file:o,epicNumber:c,content:a,title:Ac(a)||l,frontmatter:{},sourcePath:`.planning/epics/${o}`})}let s=[],i=ln.join(e,"stories");if(Jt.existsSync(i)){let o=Jt.readdirSync(i).filter(a=>/^[\d.]+\.md$/.test(a));for(let a of o){let u=Jt.readFileSync(ln.join(i,a),"utf8"),c=a.replace(/\.md$/i,""),l=u.match(/\*\*Epic:\*\*\s*EPIC-(\d+)/i),d=null;if(l){let f=parseInt(l[1],10),g=r.find(m=>m.epicNumber===f);g&&(d=g.id)}s.push({id:c,file:a,content:u,title:Ac(u)||c,parentEpic:d,sprintId:null,frontmatter:{},sourcePath:`.planning/epics/stories/${a}`})}}return r.length===0&&s.length===0?null:{id:"epics",numericId:null,brief:null,sprints:null,sprintMap:{},stories:s,epics:r,noMilestone:!0}}function kF(t){let e=iy(t),r=ay(t);return r&&e.push(r),e}function $F(t,e){if(!e.sprint&&!e.epic&&!e.story)return t;let r=t.map(n=>({...n,epics:[...n.epics],stories:[...n.stories]}));if(e.sprint){let n=e.sprint.replace(/-/g,".");for(let s of r){s.stories=s.stories.filter(o=>o.sprintId===e.sprint||o.sprintId===n);let i=new Set(s.stories.map(o=>o.parentEpic).filter(Boolean));s.epics=s.epics.filter(o=>i.has(o.id))}}if(e.epic)for(let n of r)n.epics=n.epics.filter(s=>s.id===e.epic),n.stories=n.stories.filter(s=>s.parentEpic===e.epic);if(e.story)for(let n of r){n.stories=n.stories.filter(i=>i.id===e.story);let s=new Set(n.stories.map(i=>i.parentEpic).filter(Boolean));n.epics=n.epics.filter(i=>s.has(i.id))}return r.filter(n=>n.epics.length>0||n.stories.length>0)}uy.exports={extractFrontmatter:oy,extractTitle:Ac,discoverSprintTrackPhases:iy,discoverEpicTrackPhase:ay,discoverPhases:kF,applyGranularFilters:$F}});var dy=v((hT,ly)=>{var ei=require("fs"),Fc=require("path"),AF=require("crypto"),Pt=sy(),{askText:FF,PromptAbortError:jF}=as(),{writeJsonAtomic:IF}=Kt(),{loadConfig:TF}=gs(),{discoverPhases:RF,applyGranularFilters:PF}=cy();function Rn(t){return AF.createHash("sha256").update(t||"").digest("hex").slice(0,12)}function OF(t){let e={execute:!1,dryRun:!0,repo:null,only:null,phase:null,sprint:null,epic:null,story:null,withLabels:!1,createProject:!1,yes:!1,forceYolo:!1,updateBody:!0,updateLabels:!0,updateMilestone:!0,updateState:!0};for(let r of t)r==="--execute"||r==="-e"?(e.execute=!0,e.dryRun=!1):r==="--dry-run"?(e.dryRun=!0,e.execute=!1):r==="--yes"||r==="-y"?e.yes=!0:r==="--force-yolo"?e.forceYolo=!0:r==="--with-labels"?e.withLabels=!0:r==="--project"?e.createProject=!0:r==="--no-update"?(e.updateBody=!1,e.updateLabels=!1,e.updateMilestone=!1,e.updateState=!1):r==="--no-update-body"?e.updateBody=!1:r==="--no-update-labels"?e.updateLabels=!1:r==="--no-close"?e.updateState=!1:r.startsWith("--repo=")?e.repo=r.slice(7):r.startsWith("--only=")?e.only=r.slice(7):r.startsWith("--phase=")?e.phase=r.slice(8):r.startsWith("--sprint=")?e.sprint=r.slice(9):r.startsWith("--epic=")?e.epic=r.slice(7):r.startsWith("--story=")&&(e.story=r.slice(8));return e.updateEnabled=e.updateBody||e.updateLabels||e.updateMilestone||e.updateState,e}function NF(t){let e=Fc.join(t,".rcode/state.json");if(!ei.existsSync(e))return null;try{return JSON.parse(ei.readFileSync(e,"utf8"))}catch{return null}}function LF(t){let e=Fc.join(t,".rcode/integrations/github-map.json");if(!ei.existsSync(e))return{phases:{},epics:{},stories:{},project:null,labels:[]};try{return JSON.parse(ei.readFileSync(e,"utf8"))}catch{return{phases:{},epics:{},stories:{},project:null,labels:[]}}}function Ds(t,e){let r=Fc.join(t,".rcode/integrations/github-map.json");IF(r,e)}function Pe(t,e){return`${t}:${e}`}async function BF(t){let e=OF(t),r=process.cwd(),s=TF(r).communication_mode||"guided";console.log(`
382
+ \u{1F54C} rcode \u2014 GitHub Sync`),console.log(` Mode: ${e.dryRun?"DRY-RUN (preview only, nothing is sent)":"EXECUTE"}`),console.log(` Comms mode: ${s}`),console.log(` Scope: ${e.only||"full (create + update existing)"}`),console.log(` Labels: ${e.withLabels?"will create/ensure taxonomy":"skipped (pass --with-labels to enable)"}`),e.updateEnabled||console.log(" Note: --no-update passed \u2192 create-only mode"),e.phase&&console.log(` Phase filter: ${e.phase}`),e.sprint&&console.log(` Sprint filter: ${e.sprint}`),e.epic&&console.log(` Epic filter: ${e.epic}`),e.story&&console.log(` Story filter: ${e.story}`),console.log();let i=Pt.checkAuth();i.authenticated||(console.error("\u274C gh CLI not authenticated."),console.error(" Run: gh auth login"),console.error(` Error: ${i.error||"unknown"}`),process.exit(1)),console.log(` \u2713 Authenticated as ${i.account}`);let o=e.repo;if(!o){let h=Pt.detectRepo(r);h||(console.error("\u274C Could not detect GitHub repo. Run from a git repo or pass --repo=owner/name"),process.exit(1)),o=h.nameWithOwner}console.log(` \u2713 Target repo: ${o}`);let a=NF(r);a||(console.error("\u274C No .rcode/state.json found. Run 'rcode install' first."),process.exit(1)),console.log(` \u2713 Project: ${a.project_name||"(unnamed)"}`);let u=RF(r);if(e.phase&&(u=u.filter(h=>h.id===e.phase||h.numericId===e.phase),u.length===0&&(console.error(`\u274C Phase '${e.phase}' not found.`),process.exit(1))),u=PF(u,e),u.length===0){if(e.sprint||e.epic||e.story){let h=e.sprint?`sprint '${e.sprint}'`:e.epic?`epic '${e.epic}'`:`story '${e.story}'`;console.error(`\u274C No items matched ${h}.`),console.error(" Check the filter value or run without filters to see available ids."),process.exit(1)}console.log("\u2139 No phases found in .planning/phases/ or epics in .planning/epics/ \u2014 nothing to sync."),console.log(" Run /rcode-plan or /rcode-create-epics-and-stories to get started."),process.exit(0)}console.log(` \u2713 Phases found: ${u.length}`);for(let h of u)console.log(` - ${h.id} (${h.epics.length} epics, ${h.stories.length} stories)`);let c=LF(r),l={phases:Object.keys(c.phases).length,epics:Object.keys(c.epics).length,stories:Object.keys(c.stories).length};l.phases+l.epics+l.stories>0&&console.log(` \u2139 Existing sync map: ${l.phases} phases, ${l.epics} epics, ${l.stories} stories`);let d={labels:e.withLabels?[{name:"epic",color:"6f42c1",description:"Strategic initiative spanning multiple sprints"},{name:"type:feature",color:"0e8a16",description:"New functionality"},{name:"type:task",color:"c5def5",description:"Development work"},{name:"type:bug",color:"d73a4a",description:"Something is broken"},{name:"type:docs",color:"0075ca",description:"Documentation"},{name:"priority:critical",color:"b60205",description:"Drop everything"},{name:"priority:high",color:"d93f0b",description:"Important for sprint"},{name:"priority:medium",color:"fbca04",description:"Standard priority"},{name:"priority:low",color:"0e8a16",description:"Nice to have"},{name:"status:backlog",color:"c5def5",description:"Not started"},{name:"status:todo",color:"0075ca",description:"Ready to start"},{name:"status:in-progress",color:"fbca04",description:"Currently working"},{name:"status:blocked",color:"d73a4a",description:"Cannot progress"},{name:"status:review",color:"6f42c1",description:"Code review needed"},{name:"status:done",color:"0e8a16",description:"Completed"},{name:"FE",color:"1e3a8a",description:"Frontend"},{name:"BE",color:"0e8a16",description:"Backend"},{name:"ML",color:"6f42c1",description:"Machine Learning"},{name:"API",color:"0075ca",description:"API / Backend services"},{name:"Design",color:"f59e0b",description:"UI/UX design work"},{name:"DevOps",color:"fbca04",description:"Infrastructure and deployment"},{name:"QA",color:"d73a4a",description:"Quality assurance"},{name:"Docs",color:"c5def5",description:"Documentation"}]:[],milestones:u.filter(h=>!h.noMilestone&&!c.phases[h.id]),epics:u.flatMap(h=>h.epics.filter(w=>!c.epics[Pe(h.id,w.id)]).map(w=>({...w,phase:h.id}))),stories:u.flatMap(h=>h.stories.filter(w=>!c.stories[Pe(h.id,w.id)]).map(w=>({...w,phase:h.id}))),updateEpics:e.updateEnabled?u.flatMap(h=>h.epics.filter(w=>c.epics[Pe(h.id,w.id)]).map(w=>({...w,phase:h.id,issueNumber:c.epics[Pe(h.id,w.id)].issue_number,lastSyncedAt:c.epics[Pe(h.id,w.id)].synced_at,lastSyncedContentHash:c.epics[Pe(h.id,w.id)].content_hash}))):[],updateStories:e.updateEnabled?u.flatMap(h=>h.stories.filter(w=>c.stories[Pe(h.id,w.id)]).map(w=>({...w,phase:h.id,issueNumber:c.stories[Pe(h.id,w.id)].issue_number,lastSyncedAt:c.stories[Pe(h.id,w.id)].synced_at,lastSyncedContentHash:c.stories[Pe(h.id,w.id)].content_hash}))):[]};console.log(`
383
+ \u{1F4CB} Plan:`),e.withLabels&&(!e.only||e.only==="labels")&&console.log(` Labels to ensure: ${d.labels.length}`),(!e.only||e.only==="milestones")&&console.log(` Milestones to create: ${d.milestones.length}`),(!e.only||e.only==="epics")&&console.log(` Epics to create: ${d.epics.length}`),(!e.only||e.only==="stories")&&console.log(` Stories to create: ${d.stories.length}`),e.updateEnabled&&((!e.only||e.only==="epics")&&console.log(` Epics to check: ${d.updateEpics.length} (existing, will update if changed)`),(!e.only||e.only==="stories")&&console.log(` Stories to check: ${d.updateStories.length} (existing, will update if changed)`)),e.createProject&&console.log(` Project v2: will create "${a.project_name||o}"`),console.log();let f=s==="yolo"&&e.yes&&!e.forceYolo;if(e.execute&&(!e.yes||f)){f&&(console.log("\u26A0\uFE0F communication_mode=yolo does not auto-confirm GitHub mutations."),console.log(" Pass --force-yolo to skip this prompt, or answer interactively below."),console.log()),console.log(`\u26A0\uFE0F This will modify ${o} on GitHub.`);let h=d.labels.length+d.milestones.length+d.epics.length+d.stories.length;console.log(` Items to create: ${h}`),(e.sprint||e.epic||e.story)&&console.log(` Granular filter: ${e.sprint||e.epic||e.story}`),console.log();let w=await FF(" Proceed? Type 'yes' to continue: ",{default:"no",validate:C=>{let A=C.toLowerCase();return["yes","y","no","n"].includes(A)?!0:"Please type 'yes' to confirm, or 'no' to abort."}});["yes","y"].includes(w.toLowerCase())||(console.log(`
384
+ \u274C Aborted by user. No changes made.`),process.exit(0)),console.log()}let m={labels:[],milestones:[],epics:[],stories:[],errors:[]},y={execute:e.execute,dryRun:e.dryRun,repo:o};if(e.withLabels&&(!e.only||e.only==="labels")){console.log(`
385
+ \u{1F3F7}\uFE0F Labels`);for(let h of d.labels){let w=Pt.ensureLabel(h.name,h.color,h.description,y);m.labels.push(w),w.error?m.errors.push(`label ${h.name}: ${w.error}`):w.dryRun||(c.labels.includes(h.name)||c.labels.push(h.name),e.execute&&Ds(r,c),console.log(` \u2713 ${w.existed?"exists":"created"}: ${h.name}`))}}if(!e.only||e.only==="milestones"){console.log(`
383
386
  \u{1F3AF} Milestones (phases)`);for(let h of d.milestones){let w=h.brief?h.brief.split(`
384
387
  `).slice(0,5).join(`
385
- `):"rcode phase",C=Rt.createMilestone(h.id,w,null,D);m.milestones.push({phase:h.id,...C}),C.error?m.errors.push(`milestone ${h.id}: ${C.error}`):C.dryRun||(c.phases[h.id]={milestone_number:C.number,milestone_id:C.id,url:C.url,synced_at:new Date().toISOString()},e.execute&&Ds(r,c),console.log(` \u2713 created: ${h.id} \u2192 milestone #${C.number}`))}}if(!e.only||e.only==="epics"){console.log(`
388
+ `):"rcode phase",C=Pt.createMilestone(h.id,w,null,y);m.milestones.push({phase:h.id,...C}),C.error?m.errors.push(`milestone ${h.id}: ${C.error}`):C.dryRun||(c.phases[h.id]={milestone_number:C.number,milestone_id:C.id,url:C.url,synced_at:new Date().toISOString()},e.execute&&Ds(r,c),console.log(` \u2713 created: ${h.id} \u2192 milestone #${C.number}`))}}if(!e.only||e.only==="epics"){console.log(`
386
389
  \u{1F4E6} Epics`);for(let h of d.epics){let w=["## \u{1F3AF} Epic Vision","","_Strategic goal this Epic contributes to._","","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,"- **Synced by:** rcode github-sync","","## \u{1F4DD} Child Stories","","_Child story issues will be appended here after they are created._"].join(`
387
- `),C=c.phases[h.phase]&&c.phases[h.phase].milestone_number,A=Rt.createIssue({title:`[Epic] ${h.title}`,body:w,labels:e.withLabels?["epic","priority:medium","status:backlog"]:[],milestone:C},D);m.epics.push({epic:h.id,...A}),A.error?m.errors.push(`epic ${h.id}: ${A.error}`):A.dryRun||(c.epics[Re(h.phase,h.id)]={issue_number:A.number,url:A.url,phase:h.phase,synced_at:new Date().toISOString(),content_hash:Rn(h.content),child_story_issues:[]},e.execute&&Ds(r,c),console.log(` \u2713 created: ${h.id} \u2192 #${A.number}`))}}if(!e.only||e.only==="stories"){console.log(`
388
- \u{1F4C4} Stories`);for(let h of d.stories){let w=h.parentEpic?c.epics[Re(h.phase,h.parentEpic)]:null,C=w?`- **Parent Epic:** #${w.issue_number} (Part of this epic)`:h.parentEpic?`- **Parent Epic:** \`${h.parentEpic}\` (not yet synced to GitHub)`:"- **Parent Epic:** (standalone \u2014 no parent epic)",A=h.sprintId?`- **Sprint:** \`${h.sprintId}\``:"- **Sprint:** (not assigned to a sprint)",T=["## \u{1F3AF} Problem Statement","","_Clear explanation of what this story solves._","","## \u2705 Acceptance Criteria","","- [ ] Given/When/Then flows documented in source","- [ ] Tests written and passing","- [ ] Code review complete","","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",C,A,`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,"- **Synced by:** rcode github-sync","","> **Linking:** Reference this story in commits with `refs #{issue}`","> or close it via PR with `Closes #{issue}`."].join(`
389
- `),G=c.phases[h.phase]&&c.phases[h.phase].milestone_number,I=Rt.createIssue({title:h.title,body:T,labels:e.withLabels?["type:feature","priority:medium","status:backlog"]:[],milestone:G},D);m.stories.push({story:h.id,...I}),I.error?m.errors.push(`story ${h.id}: ${I.error}`):I.dryRun||(c.stories[Re(h.phase,h.id)]={issue_number:I.number,url:I.url,phase:h.phase,parent_epic:h.parentEpic||null,sprint_id:h.sprintId||null,synced_at:new Date().toISOString(),content_hash:Rn(h.content)},e.execute&&Ds(r,c),w&&(w.child_story_issues=w.child_story_issues||[],w.child_story_issues.includes(I.number)||w.child_story_issues.push(I.number)),console.log(` \u2713 created: ${h.id} \u2192 #${I.number}`))}}if(e.execute&&(!e.only||e.only==="epics"||e.only==="stories")){let h=Object.entries(c.epics).filter(([,w])=>w.child_story_issues&&w.child_story_issues.length>0);if(h.length>0){console.log(`
390
- \u{1F517} Linking stories \u2192 epics (task lists)`);for(let[w,C]of h){let A=C.child_story_issues.sort((P,E)=>P-E).map(P=>`- [ ] #${P}`).join(`
391
- `),T=Rt.getIssue(C.issue_number,{repo:o});if(T.error){m.errors.push(`link epic #${C.issue_number}: ${T.error}`);continue}let G=T.body||"",I,Z=/## 📝 Child Stories[\s\S]*?(?=\n## |$)/,F=`## \u{1F4DD} Child Stories
390
+ `),C=c.phases[h.phase]&&c.phases[h.phase].milestone_number,A=Pt.createIssue({title:`[Epic] ${h.title}`,body:w,labels:e.withLabels?["epic","priority:medium","status:backlog"]:[],milestone:C},y);m.epics.push({epic:h.id,...A}),A.error?m.errors.push(`epic ${h.id}: ${A.error}`):A.dryRun||(c.epics[Pe(h.phase,h.id)]={issue_number:A.number,url:A.url,phase:h.phase,synced_at:new Date().toISOString(),content_hash:Rn(h.content),child_story_issues:[]},e.execute&&Ds(r,c),console.log(` \u2713 created: ${h.id} \u2192 #${A.number}`))}}if(!e.only||e.only==="stories"){console.log(`
391
+ \u{1F4C4} Stories`);for(let h of d.stories){let w=h.parentEpic?c.epics[Pe(h.phase,h.parentEpic)]:null,C=w?`- **Parent Epic:** #${w.issue_number} (Part of this epic)`:h.parentEpic?`- **Parent Epic:** \`${h.parentEpic}\` (not yet synced to GitHub)`:"- **Parent Epic:** (standalone \u2014 no parent epic)",A=h.sprintId?`- **Sprint:** \`${h.sprintId}\``:"- **Sprint:** (not assigned to a sprint)",T=["## \u{1F3AF} Problem Statement","","_Clear explanation of what this story solves._","","## \u2705 Acceptance Criteria","","- [ ] Given/When/Then flows documented in source","- [ ] Tests written and passing","- [ ] Code review complete","","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",C,A,`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,"- **Synced by:** rcode github-sync","","> **Linking:** Reference this story in commits with `refs #{issue}`","> or close it via PR with `Closes #{issue}`."].join(`
392
+ `),V=c.phases[h.phase]&&c.phases[h.phase].milestone_number,I=Pt.createIssue({title:h.title,body:T,labels:e.withLabels?["type:feature","priority:medium","status:backlog"]:[],milestone:V},y);m.stories.push({story:h.id,...I}),I.error?m.errors.push(`story ${h.id}: ${I.error}`):I.dryRun||(c.stories[Pe(h.phase,h.id)]={issue_number:I.number,url:I.url,phase:h.phase,parent_epic:h.parentEpic||null,sprint_id:h.sprintId||null,synced_at:new Date().toISOString(),content_hash:Rn(h.content)},e.execute&&Ds(r,c),w&&(w.child_story_issues=w.child_story_issues||[],w.child_story_issues.includes(I.number)||w.child_story_issues.push(I.number)),console.log(` \u2713 created: ${h.id} \u2192 #${I.number}`))}}if(e.execute&&(!e.only||e.only==="epics"||e.only==="stories")){let h=Object.entries(c.epics).filter(([,w])=>w.child_story_issues&&w.child_story_issues.length>0);if(h.length>0){console.log(`
393
+ \u{1F517} Linking stories \u2192 epics (task lists)`);for(let[w,C]of h){let A=C.child_story_issues.sort((P,b)=>P-b).map(P=>`- [ ] #${P}`).join(`
394
+ `),T=Pt.getIssue(C.issue_number,{repo:o});if(T.error){m.errors.push(`link epic #${C.issue_number}: ${T.error}`);continue}let V=T.body||"",I,H=/## 📝 Child Stories[\s\S]*?(?=\n## |$)/,F=`## \u{1F4DD} Child Stories
392
395
 
393
396
  ${A}
394
- `;Z.test(G)?I=G.replace(Z,F):I=G.trimEnd()+`
397
+ `;H.test(V)?I=V.replace(H,F):I=V.trimEnd()+`
395
398
 
396
- `+F;let W=Rt.updateIssue(C.issue_number,{body:I},D);W.error?m.errors.push(`update epic #${C.issue_number}: ${W.error}`):console.log(` \u2713 linked ${C.child_story_issues.length} stories \u2192 epic #${C.issue_number}`)}}}if(e.updateEnabled&&(!e.only||e.only==="epics")&&d.updateEpics.length>0){console.log(`
399
+ `+F;let q=Pt.updateIssue(C.issue_number,{body:I},y);q.error?m.errors.push(`update epic #${C.issue_number}: ${q.error}`):console.log(` \u2713 linked ${C.child_story_issues.length} stories \u2192 epic #${C.issue_number}`)}}}if(e.updateEnabled&&(!e.only||e.only==="epics")&&d.updateEpics.length>0){console.log(`
397
400
  \u{1F504} Update existing epics`);for(let h of d.updateEpics){let w=Rn(h.content);if(w===h.lastSyncedContentHash)continue;let C=["## \u{1F3AF} Epic Vision","",`_Strategic goal this Epic contributes to. Fill in from \`${h.sourcePath}\`._`,"","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
398
- `),A=Rt.updateIssue(h.issueNumber,{title:e.updateBody?`[Epic] ${h.title}`:void 0,body:e.updateBody?C:void 0},D);A.error?m.errors.push(`update epic #${h.issueNumber}: ${A.error}`):A.dryRun||(c.epics[Re(h.phase,h.id)].content_hash=w,c.epics[Re(h.phase,h.id)].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${h.issueNumber} (${h.id})`))}}if(e.updateEnabled&&(!e.only||e.only==="stories")&&d.updateStories.length>0){console.log(`
401
+ `),A=Pt.updateIssue(h.issueNumber,{title:e.updateBody?`[Epic] ${h.title}`:void 0,body:e.updateBody?C:void 0},y);A.error?m.errors.push(`update epic #${h.issueNumber}: ${A.error}`):A.dryRun||(c.epics[Pe(h.phase,h.id)].content_hash=w,c.epics[Pe(h.phase,h.id)].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${h.issueNumber} (${h.id})`))}}if(e.updateEnabled&&(!e.only||e.only==="stories")&&d.updateStories.length>0){console.log(`
399
402
  \u{1F504} Update existing stories`);for(let h of d.updateStories){let w=Rn(h.content);if(w===h.lastSyncedContentHash)continue;let C=["## \u{1F3AF} Problem Statement","",`_From \`${h.sourcePath}\`._`,"","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
400
- `),A=Rt.updateIssue(h.issueNumber,{title:e.updateBody?h.title:void 0,body:e.updateBody?C:void 0},D);A.error?m.errors.push(`update story #${h.issueNumber}: ${A.error}`):A.dryRun||(c.stories[Re(h.phase,h.id)].content_hash=w,c.stories[Re(h.phase,h.id)].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${h.issueNumber} (${h.id})`))}}if(e.createProject&&(!e.only||e.only==="project")){console.log(`
401
- \u{1F4CA} Project v2`);let h=o.split("/")[0],w=a.project_name||o.split("/")[1],C=Rt.createProject(h,w,D);C.error?m.errors.push(`project: ${C.error}`):C.dryRun||(c.project={number:C.number,url:C.url,synced_at:new Date().toISOString()},console.log(` \u2713 created: Project v2 "${w}" \u2192 ${C.url}`))}if(e.execute&&(Ds(r,c),console.log(`
403
+ `),A=Pt.updateIssue(h.issueNumber,{title:e.updateBody?h.title:void 0,body:e.updateBody?C:void 0},y);A.error?m.errors.push(`update story #${h.issueNumber}: ${A.error}`):A.dryRun||(c.stories[Pe(h.phase,h.id)].content_hash=w,c.stories[Pe(h.phase,h.id)].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${h.issueNumber} (${h.id})`))}}if(e.createProject&&(!e.only||e.only==="project")){console.log(`
404
+ \u{1F4CA} Project v2`);let h=o.split("/")[0],w=a.project_name||o.split("/")[1],C=Pt.createProject(h,w,y);C.error?m.errors.push(`project: ${C.error}`):C.dryRun||(c.project={number:C.number,url:C.url,synced_at:new Date().toISOString()},console.log(` \u2713 created: Project v2 "${w}" \u2192 ${C.url}`))}if(e.execute&&(Ds(r,c),console.log(`
402
405
  \u{1F4BE} Sync map saved to .rcode/integrations/github-map.json`)),console.log(`
403
406
  \u{1F4CA} Summary`),console.log(` Labels: ${m.labels.length}`),console.log(` Milestones: ${m.milestones.length}`),console.log(` Epics: ${m.epics.length} created`),console.log(` Stories: ${m.stories.length} created`),e.updateEnabled){let h=d.updateEpics.filter(C=>Rn(C.content)!==C.lastSyncedContentHash).length,w=d.updateStories.filter(C=>Rn(C.content)!==C.lastSyncedContentHash).length;console.log(` Updated: ${h} epics, ${w} stories (content changed since last sync)`)}if(m.errors.length>0){console.log(` Errors: ${m.errors.length}`);for(let h of m.errors)console.log(` \u274C ${h}`)}e.dryRun?(console.log(`
404
407
  \u26A0\uFE0F This was a DRY-RUN. No changes were made to GitHub.`),console.log(" To actually apply these changes, run again with: --execute")):console.log(`
405
- \u2705 Sync complete. View on GitHub: https://github.com/${o}`)}cy.exports=function(e){OF(e).catch(r=>{r instanceof kF&&(console.log(`
408
+ \u2705 Sync complete. View on GitHub: https://github.com/${o}`)}ly.exports=function(e){BF(e).catch(r=>{r instanceof jF&&(console.log(`
406
409
  \u274C GitHub sync cancelled \u2014 ${r.message}.`),process.exit(0)),console.error(`
407
- \u274C GitHub sync failed:`,r.message),process.env.DEBUG&&console.error(r.stack),process.exit(1)})}});var fy=v((dT,dy)=>{dy.exports=function(e,{packageJson:r}){console.log(`
410
+ \u274C GitHub sync failed:`,r.message),process.env.DEBUG&&console.error(r.stack),process.exit(1)})}});var hy=v((pT,fy)=>{fy.exports=function(e,{packageJson:r}){console.log(`
408
411
  \u{1F54C} rcode v${r.version} \u2014 Tiers
409
412
 
410
413
  Everything is organized into 4 tiers + a preview track. Start with \u{1F331} Starter.
@@ -443,7 +446,7 @@ Everything is organized into 4 tiers + a preview track. Start with \u{1F331} Sta
443
446
  See: docs/V2-PREVIEW.md
444
447
 
445
448
  Full detail: docs/TIERS.md
446
- `.trim())}});var ys=require("path"),dn=require("fs"),hy=ys.resolve(__dirname,".."),vs=JSON.parse(dn.readFileSync(ys.join(hy,"package.json"),"utf8")),NF={install:is(),init:is(),update:Tg(),uninstall:ic(),remove:ic(),nuke:Zg(),"migrate-namespace":Vg(),dashboard:cc(),serve:cc(),digest:Kg(),team:tD(),agent:oD(),doctor:bD(),workflow:yc(),plan:(t,e)=>Fc("plan",t,e),execute:(t,e)=>Fc("execute-sprint",t,e),ship:(t,e)=>Fc("ship",t,e),"set-profile":OD(),"set-mode":MD(),config:VD(),context:XD(),"show-model":ey(),"github-sync":ly(),tiers:fy(),version:()=>console.log(vs.version),help:py};function py(){console.log(`
449
+ `.trim())}});var ys=require("path"),dn=require("fs"),py=ys.resolve(__dirname,".."),vs=JSON.parse(dn.readFileSync(ys.join(py,"package.json"),"utf8")),MF={install:is(),init:is(),update:Rg(),uninstall:ac(),remove:ac(),nuke:Ug(),"migrate-namespace":Gg(),dashboard:lc(),serve:lc(),digest:Qg(),team:rD(),agent:iD(),doctor:ED(),workflow:vc(),plan:(t,e)=>jc("plan",t,e),execute:(t,e)=>jc("execute-sprint",t,e),ship:(t,e)=>jc("ship",t,e),"set-profile":ND(),"set-mode":qD(),config:GD(),context:XD(),"show-model":ty(),"github-sync":dy(),tiers:hy(),version:()=>console.log(vs.version),help:my};function my(){console.log(`
447
450
  \u{1F54C} rcode v${vs.version}
448
451
  Context-aware AI team methodology. See tiers: \`rcode tiers\`
449
452
 
@@ -517,14 +520,14 @@ Getting started:
517
520
  rcode set-profile # choose model profile (quality | balanced | budget)
518
521
 
519
522
  Documentation: https://github.com/hanzlahabib/rcode
520
- `.trim())}function Fc(t,e,r){yc()(["show",t,...e],r);let n=e.includes("--auto")||e.includes("--run");console.log(`
523
+ `.trim())}function jc(t,e,r){vc()(["show",t,...e],r);let n=e.includes("--auto")||e.includes("--run");console.log(`
521
524
  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`),console.log(`\u25B6 To run: paste the above into Claude Code as /${t==="execute-sprint"?"rcode-execute-sprint":`rcode-${t}`}`),console.log(" or pipe it directly: rcode "+(t==="execute-sprint"?"execute":t)+" | cld --model sonnet"),n&&console.log(`
522
- AUTO mode detected \u2014 in Claude Code run: /rcode-`+(t==="execute-sprint"?"execute-sprint":t)+" --auto (applies yolo defaults, skips confirmation prompts)")}function LF(){let e=require("os").homedir(),r=ys.join(e,".rcode"),n=ys.join(r,".welcome-shown");if(dn.existsSync(n))return;let s=ys.join(e,".claude","commands"),i=!1;try{i=dn.existsSync(s)&&dn.readdirSync(s).some(o=>o.startsWith("rcode-")&&o.endsWith(".md"))}catch{}if(i){console.log(`
525
+ AUTO mode detected \u2014 in Claude Code run: /rcode-`+(t==="execute-sprint"?"execute-sprint":t)+" --auto (applies yolo defaults, skips confirmation prompts)")}function qF(){let e=require("os").homedir(),r=ys.join(e,".rcode"),n=ys.join(r,".welcome-shown");if(dn.existsSync(n))return;let s=ys.join(e,".claude","commands"),i=!1;try{i=dn.existsSync(s)&&dn.readdirSync(s).some(o=>o.startsWith("rcode-")&&o.endsWith(".md"))}catch{}if(i){console.log(`
523
526
  \u{1F54C} rcode v${vs.version} \u2014 first run detected.
524
- `),console.log(` \u2713 ${BF(s)} slash commands installed \u2192 ~/.claude/commands/`),console.log(" \u2713 All /rcode-* commands available in every Claude Code project."),console.log(`
527
+ `),console.log(` \u2713 ${WF(s)} slash commands installed \u2192 ~/.claude/commands/`),console.log(" \u2713 All /rcode-* commands available in every Claude Code project."),console.log(`
525
528
  To set up a project: cd my-project && rcode install`),console.log(" Show all commands: rcode help"),console.log(` Diagnose issues: rcode doctor
526
529
  `);try{dn.mkdirSync(r,{recursive:!0}),dn.writeFileSync(n,`installed ${vs.version} at ${new Date().toISOString()}
527
- `)}catch{}}}function BF(t){try{return dn.readdirSync(t).filter(e=>e.startsWith("rcode-")&&e.endsWith(".md")).length}catch{return 0}}async function MF(){let[,,t="help",...e]=process.argv;(t==="--help"||t==="-h")&&(t="help"),(t==="--version"||t==="-v")&&(t="version"),LF();let r=NF[t];r||(console.error(`Unknown command: ${t}`),py(),process.exit(1));try{await r(e,{packageRoot:hy,packageJson:vs})}catch(n){console.error(`Error running '${t}':`,n.message),process.env.DEBUG&&console.error(n.stack),process.exit(1)}finally{try{as().closeSession()}catch{}}}MF();
530
+ `)}catch{}}}function WF(t){try{return dn.readdirSync(t).filter(e=>e.startsWith("rcode-")&&e.endsWith(".md")).length}catch{return 0}}async function HF(){let[,,t="help",...e]=process.argv;(t==="--help"||t==="-h")&&(t="help"),(t==="--version"||t==="-v")&&(t="version"),qF();let r=MF[t];r||(console.error(`Unknown command: ${t}`),my(),process.exit(1));try{await r(e,{packageRoot:py,packageJson:vs})}catch(n){console.error(`Error running '${t}':`,n.message),process.env.DEBUG&&console.error(n.stack),process.exit(1)}finally{try{as().closeSession()}catch{}}}HF();
528
531
  /*! Bundled license information:
529
532
 
530
533
  is-extglob/index.js: