@photon-ai/cli 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +51 -24
  2. package/dist/photon.js +79 -79
  3. package/package.json +3 -2
package/dist/photon.js CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as JJ}from"node:module";var DJ=Object.create;var{getPrototypeOf:FJ,defineProperty:G6,getOwnPropertyNames:uJ}=Object;var EJ=Object.prototype.hasOwnProperty;function BJ(D){return this[D]}var CJ,ZJ,GD=(D,F,u)=>{var E=D!=null&&typeof D==="object";if(E){var B=F?CJ??=new WeakMap:ZJ??=new WeakMap,C=B.get(D);if(C)return C}u=D!=null?DJ(FJ(D)):{};let Z=F||!D||!D.__esModule?G6(u,"default",{value:D,enumerable:!0}):u;for(let J of uJ(D))if(!EJ.call(Z,J))G6(Z,J,{get:BJ.bind(D,J),enumerable:!0});if(E)B.set(D,Z);return Z};var M=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var p=JJ(import.meta.url);var U2=M((xW,K6)=>{var qu=[],Q6=0,UD=(D,F)=>{if(Q6>=F)qu.push(D)};UD.WARN=1;UD.INFO=2;UD.DEBUG=3;UD.reset=()=>{qu=[]};UD.setDebugLevel=(D)=>{Q6=D};UD.warn=(D)=>UD(D,UD.WARN);UD.info=(D)=>UD(D,UD.INFO);UD.debug=(D)=>UD(D,UD.DEBUG);UD.debugMessages=()=>qu;K6.exports=UD});var q6=M((kW,z6)=>{z6.exports=({onlyFirst:D=!1}={})=>{let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}});var U6=M((yW,A6)=>{var HJ=q6();A6.exports=(D)=>typeof D==="string"?D.replace(HJ(),""):D});var N6=M((bW,Au)=>{var W6=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};Au.exports=W6;Au.exports.default=W6});var V6=M((fW,$6)=>{$6.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var Wu=M((vW,Uu)=>{var YJ=U6(),XJ=N6(),GJ=V6(),I6=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=YJ(D),D.length===0)return 0;D=D.replace(GJ()," ");let F=0;for(let u=0;u<D.length;u++){let E=D.codePointAt(u);if(E<=31||E>=127&&E<=159)continue;if(E>=768&&E<=879)continue;if(E>65535)u++;F+=XJ(E)?2:1}return F};Uu.exports=I6;Uu.exports.default=I6});var Nu=M((hW,O6)=>{var M6=Wu();function W2(D){return D?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function oD(D){let F=W2();return(""+D).replace(F,"").split(`
3
- `).reduce(function(B,C){return M6(C)>B?M6(C):B},0)}function IF(D,F){return Array(F+1).join(D)}function QJ(D,F,u,E){let B=oD(D);if(F+1>=B){let C=F-B;switch(E){case"right":{D=IF(u,C)+D;break}case"center":{let Z=Math.ceil(C/2),J=C-Z;D=IF(u,J)+D+IF(u,Z);break}default:{D=D+IF(u,C);break}}}return D}var r0={};function MF(D,F,u){F="\x1B["+F+"m",u="\x1B["+u+"m",r0[F]={set:D,to:!0},r0[u]={set:D,to:!1},r0[D]={on:F,off:u}}MF("bold",1,22);MF("italics",3,23);MF("underline",4,24);MF("inverse",7,27);MF("strikethrough",9,29);function T6(D,F){let u=F[1]?parseInt(F[1].split(";")[0]):0;if(u>=30&&u<=39||u>=90&&u<=97){D.lastForegroundAdded=F[0];return}if(u>=40&&u<=49||u>=100&&u<=107){D.lastBackgroundAdded=F[0];return}if(u===0){for(let B in D)if(Object.prototype.hasOwnProperty.call(D,B))delete D[B];return}let E=r0[F[0]];if(E)D[E.set]=E.to}function KJ(D){let F=W2(!0),u=F.exec(D),E={};while(u!==null)T6(E,u),u=F.exec(D);return E}function _6(D,F){let{lastBackgroundAdded:u,lastForegroundAdded:E}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function(B){if(D[B])F+=r0[B].off}),u&&u!="\x1B[49m")F+="\x1B[49m";if(E&&E!="\x1B[39m")F+="\x1B[39m";return F}function zJ(D,F){let{lastBackgroundAdded:u,lastForegroundAdded:E}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function(B){if(D[B])F=r0[B].on+F}),u&&u!="\x1B[49m")F=u+F;if(E&&E!="\x1B[39m")F=E+F;return F}function qJ(D,F){if(D.length===oD(D))return D.substr(0,F);while(oD(D)>F)D=D.slice(0,-1);return D}function AJ(D,F){let u=W2(!0),E=D.split(W2()),B=0,C=0,Z="",J,X={};while(C<F){J=u.exec(D);let H=E[B];if(B++,C+oD(H)>F)H=qJ(H,F-C);if(Z+=H,C+=oD(H),C<F){if(!J)break;Z+=J[0],T6(X,J)}}return _6(X,Z)}function UJ(D,F,u){if(u=u||"…",oD(D)<=F)return D;F-=oD(u);let B=AJ(D,F);B+=u;let C="\x1B]8;;\x07";if(D.includes(C)&&!B.includes(C))B+=C;return B}function WJ(){return{chars:{top:"─","top-mid":"┬","top-left":"┌","top-right":"┐",bottom:"─","bottom-mid":"┴","bottom-left":"└","bottom-right":"┘",left:"│","left-mid":"├",mid:"─","mid-mid":"┼",right:"│","right-mid":"┤",middle:"│"},truncate:"…",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function NJ(D,F){D=D||{},F=F||WJ();let u=Object.assign({},F,D);return u.chars=Object.assign({},F.chars,D.chars),u.style=Object.assign({},F.style,D.style),u}function $J(D,F){let u=[],E=F.split(/(\s+)/g),B=[],C=0,Z;for(let J=0;J<E.length;J+=2){let X=E[J],H=C+oD(X);if(C>0&&Z)H+=Z.length;if(H>D){if(C!==0)u.push(B.join(""));B=[X],C=oD(X)}else B.push(Z||"",X),C=H;Z=E[J+1]}if(C)u.push(B.join(""));return u}function VJ(D,F){let u=[],E="";function B(Z,J){if(E.length&&J)E+=J;E+=Z;while(E.length>D)u.push(E.slice(0,D)),E=E.slice(D)}let C=F.split(/(\s+)/g);for(let Z=0;Z<C.length;Z+=2)B(C[Z],Z&&C[Z-1]);if(E.length)u.push(E);return u}function IJ(D,F,u=!0){let E=[];F=F.split(`
4
- `);let B=u?$J:VJ;for(let C=0;C<F.length;C++)E.push.apply(E,B(D,F[C]));return E}function MJ(D){let F={},u=[];for(let E=0;E<D.length;E++){let B=zJ(F,D[E]);F=KJ(B);let C=Object.assign({},F);u.push(_6(C,B))}return u}function TJ(D,F){return["\x1B]","8",";",";",D||F,"\x07",F,"\x1B]","8",";",";","\x07"].join("")}O6.exports={strlen:oD,repeat:IF,pad:QJ,truncate:UJ,mergeOptions:NJ,wordWrap:IJ,colorizeLines:MJ,hyperlink:TJ}});var S6=M((gW,j6)=>{var R6={};j6.exports=R6;var L6={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(L6).forEach(function(D){var F=L6[D],u=R6[D]=[];u.open="\x1B["+F[0]+"m",u.close="\x1B["+F[1]+"m"})});var w6=M((mW,P6)=>{P6.exports=function(D,F){F=F||process.argv;var u=F.indexOf("--"),E=/^-{1,2}/.test(D)?"":"--",B=F.indexOf(E+D);return B!==-1&&(u===-1?!0:B<u)}});var k6=M((dW,x6)=>{var _J=p("os"),dD=w6(),MD=process.env,s0=void 0;if(dD("no-color")||dD("no-colors")||dD("color=false"))s0=!1;else if(dD("color")||dD("colors")||dD("color=true")||dD("color=always"))s0=!0;if("FORCE_COLOR"in MD)s0=MD.FORCE_COLOR.length===0||parseInt(MD.FORCE_COLOR,10)!==0;function OJ(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function LJ(D){if(s0===!1)return 0;if(dD("color=16m")||dD("color=full")||dD("color=truecolor"))return 3;if(dD("color=256"))return 2;if(D&&!D.isTTY&&s0!==!0)return 0;var F=s0?1:0;if(process.platform==="win32"){var u=_J.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(u[0])>=10&&Number(u[2])>=10586)return Number(u[2])>=14931?3:2;return 1}if("CI"in MD){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(B){return B in MD})||MD.CI_NAME==="codeship")return 1;return F}if("TEAMCITY_VERSION"in MD)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(MD.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in MD){var E=parseInt((MD.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(MD.TERM_PROGRAM){case"iTerm.app":return E>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(MD.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(MD.TERM))return 1;if("COLORTERM"in MD)return 1;if(MD.TERM==="dumb")return F;return F}function $u(D){var F=LJ(D);return OJ(F)}x6.exports={supportsColor:$u,stdout:$u(process.stdout),stderr:$u(process.stderr)}});var b6=M((cW,y6)=>{y6.exports=function(F,u){var E="";F=F||"Run the trap, drop the bass",F=F.split("");var B={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return F.forEach(function(C){C=C.toLowerCase();var Z=B[C]||[" "],J=Math.floor(Math.random()*Z.length);if(typeof B[C]<"u")E+=B[C][J];else E+=C}),E}});var v6=M((lW,f6)=>{f6.exports=function(F,u){F=F||" he is here ";var E={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},B=[].concat(E.up,E.down,E.mid);function C(X){var H=Math.floor(Math.random()*X);return H}function Z(X){var H=!1;return B.filter(function(Y){H=Y===X}),H}function J(X,H){var Y="",G,K;H=H||{},H.up=typeof H.up<"u"?H.up:!0,H.mid=typeof H.mid<"u"?H.mid:!0,H.down=typeof H.down<"u"?H.down:!0,H.size=typeof H.size<"u"?H.size:"maxi",X=X.split("");for(K in X){if(Z(K))continue;switch(Y=Y+X[K],G={up:0,down:0,mid:0},H.size){case"mini":G.up=C(8),G.mid=C(2),G.down=C(8);break;case"maxi":G.up=C(16)+3,G.mid=C(4)+1,G.down=C(64)+3;break;default:G.up=C(8)+1,G.mid=C(6)/2,G.down=C(8)+1;break}var Q=["up","mid","down"];for(var z in Q){var q=Q[z];for(var U=0;U<=G[q];U++)if(H[q])Y=Y+E[q][C(E[q].length)]}}return Y}return J(F,u)}});var g6=M((pW,h6)=>{h6.exports=function(D){return function(F,u,E){if(F===" ")return F;switch(u%3){case 0:return D.red(F);case 1:return D.white(F);case 2:return D.blue(F)}}}});var d6=M((iW,m6)=>{m6.exports=function(D){return function(F,u,E){return u%2===0?F:D.inverse(F)}}});var l6=M((nW,c6)=>{c6.exports=function(D){var F=["red","yellow","green","blue","magenta"];return function(u,E,B){if(u===" ")return u;else return D[F[E++%F.length]](u)}}});var i6=M((aW,p6)=>{p6.exports=function(D){var F=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(u,E,B){return u===" "?u:D[F[Math.round(Math.random()*(F.length-2))]](u)}}});var o6=M((sW,s6)=>{var i={};s6.exports=i;i.themes={};var RJ=p("util"),L0=i.styles=S6(),n6=Object.defineProperties,jJ=new RegExp(/[\r\n]+/g);i.supportsColor=k6().supportsColor;if(typeof i.enabled>"u")i.enabled=i.supportsColor()!==!1;i.enable=function(){i.enabled=!0};i.disable=function(){i.enabled=!1};i.stripColors=i.strip=function(D){return(""+D).replace(/\x1B\[\d+m/g,"")};var rW=i.stylize=function(F,u){if(!i.enabled)return F+"";var E=L0[u];if(!E&&u in i)return i[u](F);return E.open+F+E.close},SJ=/[|\\{}()[\]^$+*?.]/g,PJ=function(D){if(typeof D!=="string")throw TypeError("Expected a string");return D.replace(SJ,"\\$&")};function a6(D){var F=function u(){return xJ.apply(u,arguments)};return F._styles=D,F.__proto__=wJ,F}var r6=function(){var D={};return L0.grey=L0.gray,Object.keys(L0).forEach(function(F){L0[F].closeRe=new RegExp(PJ(L0[F].close),"g"),D[F]={get:function(){return a6(this._styles.concat(F))}}}),D}(),wJ=n6(function(){},r6);function xJ(){var D=Array.prototype.slice.call(arguments),F=D.map(function(Z){if(Z!=null&&Z.constructor===String)return Z;else return RJ.inspect(Z)}).join(" ");if(!i.enabled||!F)return F;var u=F.indexOf(`
5
- `)!=-1,E=this._styles,B=E.length;while(B--){var C=L0[E[B]];if(F=C.open+F.replace(C.closeRe,C.open)+C.close,u)F=F.replace(jJ,function(Z){return C.close+Z+C.open})}return F}i.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var F in D)(function(u){i[u]=function(E){if(typeof D[u]==="object"){var B=E;for(var C in D[u])B=i[D[u][C]](B);return B}return i[D[u]](E)}})(F)};function kJ(){var D={};return Object.keys(r6).forEach(function(F){D[F]={get:function(){return a6([F])}}}),D}var yJ=function(F,u){var E=u.split("");return E=E.map(F),E.join("")};i.trap=b6();i.zalgo=v6();i.maps={};i.maps.america=g6()(i);i.maps.zebra=d6()(i);i.maps.rainbow=l6()(i);i.maps.random=i6()(i);for(Vu in i.maps)(function(D){i[D]=function(F){return yJ(i.maps[D],F)}})(Vu);var Vu;n6(i,kJ())});var e6=M((oW,t6)=>{var bJ=o6();t6.exports=bJ});var E9=M((tW,V2)=>{var{info:fJ,debug:u9}=U2(),wD=Nu();class TF{constructor(D){this.setOptions(D),this.x=null,this.y=null}setOptions(D){if(["boolean","number","bigint","string"].indexOf(typeof D)!==-1)D={content:""+D};D=D||{},this.options=D;let F=D.content;if(["boolean","number","bigint","string"].indexOf(typeof F)!==-1)this.content=String(F);else if(!F)this.content=this.options.href||"";else throw Error("Content needs to be a primitive, got: "+typeof F);if(this.colSpan=D.colSpan||1,this.rowSpan=D.rowSpan||1,this.options.href)Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(D,F){this.cells=F;let u=this.options.chars||{},E=D.chars,B=this.chars={};hJ.forEach(function(J){Iu(u,E,J,B)}),this.truncate=this.options.truncate||D.truncate;let C=this.options.style=this.options.style||{},Z=D.style;Iu(C,Z,"padding-left",this),Iu(C,Z,"padding-right",this),this.head=C.head||Z.head,this.border=C.border||Z.border,this.fixedWidth=D.colWidths[this.x],this.lines=this.computeLines(D),this.desiredWidth=wD.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(D){let F=D.wordWrap||D.textWrap,{wordWrap:u=F}=this.options;if(this.fixedWidth&&u){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let C=1;while(C<this.colSpan)this.fixedWidth+=D.colWidths[this.x+C],C++}let{wrapOnWordBoundary:E=!0}=D,{wrapOnWordBoundary:B=E}=this.options;return this.wrapLines(wD.wordWrap(this.fixedWidth,this.content,B))}return this.wrapLines(this.content.split(`
6
- `))}wrapLines(D){let F=wD.colorizeLines(D);if(this.href)return F.map((u)=>wD.hyperlink(this.href,u));return F}init(D){let F=this.x,u=this.y;this.widths=D.colWidths.slice(F,F+this.colSpan),this.heights=D.rowHeights.slice(u,u+this.rowSpan),this.width=this.widths.reduce(F9,-1),this.height=this.heights.reduce(F9,-1),this.hAlign=this.options.hAlign||D.colAligns[F],this.vAlign=this.options.vAlign||D.rowAligns[u],this.drawRight=F+this.colSpan==D.colWidths.length}draw(D,F){if(D=="top")return this.drawTop(this.drawRight);if(D=="bottom")return this.drawBottom(this.drawRight);let u=wD.truncate(this.content,10,this.truncate);if(!D)fJ(`${this.y}-${this.x}: ${this.rowSpan-D}x${this.colSpan} Cell ${u}`);let E=Math.max(this.height-this.lines.length,0),B;switch(this.vAlign){case"center":B=Math.ceil(E/2);break;case"bottom":B=E;break;default:B=0}if(D<B||D>=B+this.lines.length)return this.drawEmpty(this.drawRight,F);let C=this.lines.length>this.height&&D+1>=this.height;return this.drawLine(D-B,this.drawRight,C,F)}drawTop(D){let F=[];if(this.cells)this.widths.forEach(function(u,E){F.push(this._topLeftChar(E)),F.push(wD.repeat(this.chars[this.y==0?"top":"mid"],u))},this);else F.push(this._topLeftChar(0)),F.push(wD.repeat(this.chars[this.y==0?"top":"mid"],this.width));if(D)F.push(this.chars[this.y==0?"topRight":"rightMid"]);return this.wrapWithStyleColors("border",F.join(""))}_topLeftChar(D){let F=this.x+D,u;if(this.y==0)u=F==0?"topLeft":D==0?"topMid":"top";else if(F==0)u="leftMid";else if(u=D==0?"midMid":"bottomMid",this.cells){if(this.cells[this.y-1][F]instanceof TF.ColSpanCell)u=D==0?"topMid":"mid";if(D==0){let B=1;while(this.cells[this.y][F-B]instanceof TF.ColSpanCell)B++;if(this.cells[this.y][F-B]instanceof TF.RowSpanCell)u="leftMid"}}return this.chars[u]}wrapWithStyleColors(D,F){if(this[D]&&this[D].length)try{let u=e6();for(let E=this[D].length-1;E>=0;E--)u=u[this[D][E]];return u(F)}catch(u){return F}else return F}drawLine(D,F,u,E){let B=this.chars[this.x==0?"left":"middle"];if(this.x&&E&&this.cells){let G=this.cells[this.y+E][this.x-1];while(G instanceof N2)G=this.cells[G.y][G.x-1];if(!(G instanceof $2))B=this.chars.rightMid}let C=wD.repeat(" ",this.paddingLeft),Z=F?this.chars.right:"",J=wD.repeat(" ",this.paddingRight),X=this.lines[D],H=this.width-(this.paddingLeft+this.paddingRight);if(u)X+=this.truncate||"…";let Y=wD.truncate(X,H,this.truncate);return Y=wD.pad(Y,H," ",this.hAlign),Y=C+Y+J,this.stylizeLine(B,Y,Z)}stylizeLine(D,F,u){if(D=this.wrapWithStyleColors("border",D),u=this.wrapWithStyleColors("border",u),this.y===0)F=this.wrapWithStyleColors("head",F);return D+F+u}drawBottom(D){let F=this.chars[this.x==0?"bottomLeft":"bottomMid"],u=wD.repeat(this.chars.bottom,this.width),E=D?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",F+u+E)}drawEmpty(D,F){let u=this.chars[this.x==0?"left":"middle"];if(this.x&&F&&this.cells){let C=this.cells[this.y+F][this.x-1];while(C instanceof N2)C=this.cells[C.y][C.x-1];if(!(C instanceof $2))u=this.chars.rightMid}let E=D?this.chars.right:"",B=wD.repeat(" ",this.width);return this.stylizeLine(u,B,E)}}class N2{constructor(){}draw(D){if(typeof D==="number")u9(`${this.y}-${this.x}: 1x1 ColSpanCell`);return""}init(){}mergeTableOptions(){}}class $2{constructor(D){this.originalCell=D}init(D){let F=this.y,u=this.originalCell.y;this.cellOffset=F-u,this.offset=vJ(D.rowHeights,u,this.cellOffset)}draw(D){if(D=="top")return this.originalCell.draw(this.offset,this.cellOffset);if(D=="bottom")return this.originalCell.draw("bottom");return u9(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+D)}mergeTableOptions(){}}function D9(...D){return D.filter((F)=>F!==void 0&&F!==null).shift()}function Iu(D,F,u,E){let B=u.split("-");if(B.length>1)B[1]=B[1].charAt(0).toUpperCase()+B[1].substr(1),B=B.join(""),E[B]=D9(D[B],D[u],F[B],F[u]);else E[u]=D9(D[u],F[u])}function vJ(D,F,u){let E=D[F];for(let B=1;B<u;B++)E+=1+D[F+B];return E}function F9(D,F){return D+F+1}var hJ=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];V2.exports=TF;V2.exports.ColSpanCell=N2;V2.exports.RowSpanCell=$2});var Z9=M((eW,C9)=>{var{warn:gJ,debug:mJ}=U2(),Mu=E9(),{ColSpanCell:dJ,RowSpanCell:cJ}=Mu;(function(){function D(Q,z){if(Q[z]>0)return D(Q,z+1);return z}function F(Q){let z={};Q.forEach(function(q,U){let N=0;q.forEach(function(I){I.y=U,I.x=U?D(z,N):N;let $=I.rowSpan||1,W=I.colSpan||1;if($>1)for(let j=0;j<W;j++)z[I.x+j]=$;N=I.x+W}),Object.keys(z).forEach((I)=>{if(z[I]--,z[I]<1)delete z[I]})})}function u(Q){let z=0;return Q.forEach(function(q){q.forEach(function(U){z=Math.max(z,U.x+(U.colSpan||1))})}),z}function E(Q){return Q.length}function B(Q,z){let q=Q.y,U=Q.y-1+(Q.rowSpan||1),N=z.y,I=z.y-1+(z.rowSpan||1),$=!(q>I||N>U),W=Q.x,j=Q.x-1+(Q.colSpan||1),P=z.x,L=z.x-1+(z.colSpan||1),v=!(W>L||P>j);return $&&v}function C(Q,z,q){let U=Math.min(Q.length-1,q),N={x:z,y:q};for(let I=0;I<=U;I++){let $=Q[I];for(let W=0;W<$.length;W++)if(B(N,$[W]))return!0}return!1}function Z(Q,z,q,U){for(let N=q;N<U;N++)if(C(Q,N,z))return!1;return!0}function J(Q){Q.forEach(function(z,q){z.forEach(function(U){for(let N=1;N<U.rowSpan;N++){let I=new cJ(U);I.x=U.x,I.y=U.y+N,I.colSpan=U.colSpan,H(I,Q[q+N])}})})}function X(Q){for(let z=Q.length-1;z>=0;z--){let q=Q[z];for(let U=0;U<q.length;U++){let N=q[U];for(let I=1;I<N.colSpan;I++){let $=new dJ;$.x=N.x+I,$.y=N.y,q.splice(U+1,0,$)}}}}function H(Q,z){let q=0;while(q<z.length&&z[q].x<Q.x)q++;z.splice(q,0,Q)}function Y(Q){let z=E(Q),q=u(Q);mJ(`Max rows: ${z}; Max cols: ${q}`);for(let U=0;U<z;U++)for(let N=0;N<q;N++)if(!C(Q,N,U)){let I={x:N,y:U,colSpan:1,rowSpan:1};N++;while(N<q&&!C(Q,N,U))I.colSpan++,N++;let $=U+1;while($<z&&Z(Q,$,I.x,I.x+I.colSpan))I.rowSpan++,$++;let W=new Mu(I);W.x=I.x,W.y=I.y,gJ(`Missing cell at ${W.y}-${W.x}.`),H(W,Q[U])}}function G(Q){return Q.map(function(z){if(!Array.isArray(z)){let q=Object.keys(z)[0];if(z=z[q],Array.isArray(z))z=z.slice(),z.unshift(q);else z=[q,z]}return z.map(function(q){return new Mu(q)})})}function K(Q){let z=G(Q);return F(z),Y(z),J(z),X(z),z}C9.exports={makeTableLayout:K,layoutTable:F,addRowSpanCells:J,maxWidth:u,fillInTable:Y,computeWidths:B9("colSpan","desiredWidth","x",1),computeHeights:B9("rowSpan","desiredHeight","y",1)}})();function B9(D,F,u,E){return function(B,C){let Z=[],J=[],X={};C.forEach(function(H){H.forEach(function(Y){if((Y[D]||1)>1)J.push(Y);else Z[Y[u]]=Math.max(Z[Y[u]]||0,Y[F]||0,E)})}),B.forEach(function(H,Y){if(typeof H==="number")Z[Y]=H});for(let H=J.length-1;H>=0;H--){let Y=J[H],G=Y[D],K=Y[u],Q=Z[K],z=typeof B[K]==="number"?0:1;if(typeof Q==="number"){for(let q=1;q<G;q++)if(Q+=1+Z[K+q],typeof B[K+q]!=="number")z++}else if(Q=F==="desiredWidth"?Y.desiredWidth-1:1,!X[K]||X[K]<Q)X[K]=Q;if(Y[F]>Q){let q=0;while(z>0&&Y[F]>Q){if(typeof B[K+q]!=="number"){let U=Math.round((Y[F]-Q)/z);Q+=U,Z[K+q]+=U,z--}q++}}}Object.assign(B,Z,X);for(let H=0;H<B.length;H++)B[H]=Math.max(E,B[H]||0)}}});var H9=M((DN,J9)=>{var J0=U2(),lJ=Nu(),Tu=Z9();class Ou extends Array{constructor(D){super();let F=lJ.mergeOptions(D);if(Object.defineProperty(this,"options",{value:F,enumerable:F.debug}),F.debug){switch(typeof F.debug){case"boolean":J0.setDebugLevel(J0.WARN);break;case"number":J0.setDebugLevel(F.debug);break;case"string":J0.setDebugLevel(parseInt(F.debug,10));break;default:J0.setDebugLevel(J0.WARN),J0.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof F.debug}`)}Object.defineProperty(this,"messages",{get(){return J0.debugMessages()}})}}toString(){let D=this,F=this.options.head&&this.options.head.length;if(F){if(D=[this.options.head],this.length)D.push.apply(D,this)}else this.options.style.head=[];let u=Tu.makeTableLayout(D);u.forEach(function(B){B.forEach(function(C){C.mergeTableOptions(this.options,u)},this)},this),Tu.computeWidths(this.options.colWidths,u),Tu.computeHeights(this.options.rowHeights,u),u.forEach(function(B){B.forEach(function(C){C.init(this.options)},this)},this);let E=[];for(let B=0;B<u.length;B++){let C=u[B],Z=this.options.rowHeights[B];if(B===0||!this.options.style.compact||B==1&&F)_u(C,"top",E);for(let J=0;J<Z;J++)_u(C,J,E);if(B+1==u.length)_u(C,"bottom",E)}return E.join(`
2
+ import{createRequire as AJ}from"node:module";var YJ=Object.create;var{getPrototypeOf:XJ,defineProperty:V6,getOwnPropertyNames:GJ}=Object;var QJ=Object.prototype.hasOwnProperty;function KJ(D){return this[D]}var zJ,qJ,YD=(D,F,u)=>{var E=D!=null&&typeof D==="object";if(E){var B=F?zJ??=new WeakMap:qJ??=new WeakMap,C=B.get(D);if(C)return C}u=D!=null?YJ(XJ(D)):{};let Z=F||!D||!D.__esModule?V6(u,"default",{value:D,enumerable:!0}):u;for(let J of GJ(D))if(!QJ.call(Z,J))V6(Z,J,{get:KJ.bind(D,J),enumerable:!0});if(E)B.set(D,Z);return Z};var T=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var p=AJ(import.meta.url);var N2=T((mW,M6)=>{var M3=[],I6=0,WD=(D,F)=>{if(I6>=F)M3.push(D)};WD.WARN=1;WD.INFO=2;WD.DEBUG=3;WD.reset=()=>{M3=[]};WD.setDebugLevel=(D)=>{I6=D};WD.warn=(D)=>WD(D,WD.WARN);WD.info=(D)=>WD(D,WD.INFO);WD.debug=(D)=>WD(D,WD.DEBUG);WD.debugMessages=()=>M3;M6.exports=WD});var O6=T((dW,T6)=>{T6.exports=({onlyFirst:D=!1}={})=>{let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}});var L6=T((cW,_6)=>{var UJ=O6();_6.exports=(D)=>typeof D==="string"?D.replace(UJ(),""):D});var j6=T((lW,T3)=>{var R6=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};T3.exports=R6;T3.exports.default=R6});var P6=T((pW,S6)=>{S6.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var _3=T((iW,O3)=>{var WJ=L6(),NJ=j6(),$J=P6(),w6=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=WJ(D),D.length===0)return 0;D=D.replace($J()," ");let F=0;for(let u=0;u<D.length;u++){let E=D.codePointAt(u);if(E<=31||E>=127&&E<=159)continue;if(E>=768&&E<=879)continue;if(E>65535)u++;F+=NJ(E)?2:1}return F};O3.exports=w6;O3.exports.default=w6});var L3=T((nW,b6)=>{var x6=_3();function $2(D){return D?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function tD(D){let F=$2();return(""+D).replace(F,"").split(`
3
+ `).reduce(function(B,C){return x6(C)>B?x6(C):B},0)}function TF(D,F){return Array(F+1).join(D)}function VJ(D,F,u,E){let B=tD(D);if(F+1>=B){let C=F-B;switch(E){case"right":{D=TF(u,C)+D;break}case"center":{let Z=Math.ceil(C/2),J=C-Z;D=TF(u,J)+D+TF(u,Z);break}default:{D=D+TF(u,C);break}}}return D}var s0={};function OF(D,F,u){F="\x1B["+F+"m",u="\x1B["+u+"m",s0[F]={set:D,to:!0},s0[u]={set:D,to:!1},s0[D]={on:F,off:u}}OF("bold",1,22);OF("italics",3,23);OF("underline",4,24);OF("inverse",7,27);OF("strikethrough",9,29);function k6(D,F){let u=F[1]?parseInt(F[1].split(";")[0]):0;if(u>=30&&u<=39||u>=90&&u<=97){D.lastForegroundAdded=F[0];return}if(u>=40&&u<=49||u>=100&&u<=107){D.lastBackgroundAdded=F[0];return}if(u===0){for(let B in D)if(Object.prototype.hasOwnProperty.call(D,B))delete D[B];return}let E=s0[F[0]];if(E)D[E.set]=E.to}function IJ(D){let F=$2(!0),u=F.exec(D),E={};while(u!==null)k6(E,u),u=F.exec(D);return E}function y6(D,F){let{lastBackgroundAdded:u,lastForegroundAdded:E}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function(B){if(D[B])F+=s0[B].off}),u&&u!="\x1B[49m")F+="\x1B[49m";if(E&&E!="\x1B[39m")F+="\x1B[39m";return F}function MJ(D,F){let{lastBackgroundAdded:u,lastForegroundAdded:E}=D;if(delete D.lastBackgroundAdded,delete D.lastForegroundAdded,Object.keys(D).forEach(function(B){if(D[B])F=s0[B].on+F}),u&&u!="\x1B[49m")F=u+F;if(E&&E!="\x1B[39m")F=E+F;return F}function TJ(D,F){if(D.length===tD(D))return D.substr(0,F);while(tD(D)>F)D=D.slice(0,-1);return D}function OJ(D,F){let u=$2(!0),E=D.split($2()),B=0,C=0,Z="",J,X={};while(C<F){J=u.exec(D);let H=E[B];if(B++,C+tD(H)>F)H=TJ(H,F-C);if(Z+=H,C+=tD(H),C<F){if(!J)break;Z+=J[0],k6(X,J)}}return y6(X,Z)}function _J(D,F,u){if(u=u||"…",tD(D)<=F)return D;F-=tD(u);let B=OJ(D,F);B+=u;let C="\x1B]8;;\x07";if(D.includes(C)&&!B.includes(C))B+=C;return B}function LJ(){return{chars:{top:"─","top-mid":"┬","top-left":"┌","top-right":"┐",bottom:"─","bottom-mid":"┴","bottom-left":"└","bottom-right":"┘",left:"│","left-mid":"├",mid:"─","mid-mid":"┼",right:"│","right-mid":"┤",middle:"│"},truncate:"…",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function RJ(D,F){D=D||{},F=F||LJ();let u=Object.assign({},F,D);return u.chars=Object.assign({},F.chars,D.chars),u.style=Object.assign({},F.style,D.style),u}function jJ(D,F){let u=[],E=F.split(/(\s+)/g),B=[],C=0,Z;for(let J=0;J<E.length;J+=2){let X=E[J],H=C+tD(X);if(C>0&&Z)H+=Z.length;if(H>D){if(C!==0)u.push(B.join(""));B=[X],C=tD(X)}else B.push(Z||"",X),C=H;Z=E[J+1]}if(C)u.push(B.join(""));return u}function SJ(D,F){let u=[],E="";function B(Z,J){if(E.length&&J)E+=J;E+=Z;while(E.length>D)u.push(E.slice(0,D)),E=E.slice(D)}let C=F.split(/(\s+)/g);for(let Z=0;Z<C.length;Z+=2)B(C[Z],Z&&C[Z-1]);if(E.length)u.push(E);return u}function PJ(D,F,u=!0){let E=[];F=F.split(`
4
+ `);let B=u?jJ:SJ;for(let C=0;C<F.length;C++)E.push.apply(E,B(D,F[C]));return E}function wJ(D){let F={},u=[];for(let E=0;E<D.length;E++){let B=MJ(F,D[E]);F=IJ(B);let C=Object.assign({},F);u.push(y6(C,B))}return u}function xJ(D,F){return["\x1B]","8",";",";",D||F,"\x07",F,"\x1B]","8",";",";","\x07"].join("")}b6.exports={strlen:tD,repeat:TF,pad:VJ,truncate:_J,mergeOptions:RJ,wordWrap:PJ,colorizeLines:wJ,hyperlink:xJ}});var g6=T((aW,h6)=>{var v6={};h6.exports=v6;var f6={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(f6).forEach(function(D){var F=f6[D],u=v6[D]=[];u.open="\x1B["+F[0]+"m",u.close="\x1B["+F[1]+"m"})});var d6=T((rW,m6)=>{m6.exports=function(D,F){F=F||process.argv;var u=F.indexOf("--"),E=/^-{1,2}/.test(D)?"":"--",B=F.indexOf(E+D);return B!==-1&&(u===-1?!0:B<u)}});var l6=T((sW,c6)=>{var kJ=p("os"),cD=d6(),TD=process.env,o0=void 0;if(cD("no-color")||cD("no-colors")||cD("color=false"))o0=!1;else if(cD("color")||cD("colors")||cD("color=true")||cD("color=always"))o0=!0;if("FORCE_COLOR"in TD)o0=TD.FORCE_COLOR.length===0||parseInt(TD.FORCE_COLOR,10)!==0;function yJ(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function bJ(D){if(o0===!1)return 0;if(cD("color=16m")||cD("color=full")||cD("color=truecolor"))return 3;if(cD("color=256"))return 2;if(D&&!D.isTTY&&o0!==!0)return 0;var F=o0?1:0;if(process.platform==="win32"){var u=kJ.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(u[0])>=10&&Number(u[2])>=10586)return Number(u[2])>=14931?3:2;return 1}if("CI"in TD){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(B){return B in TD})||TD.CI_NAME==="codeship")return 1;return F}if("TEAMCITY_VERSION"in TD)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(TD.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in TD){var E=parseInt((TD.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(TD.TERM_PROGRAM){case"iTerm.app":return E>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(TD.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(TD.TERM))return 1;if("COLORTERM"in TD)return 1;if(TD.TERM==="dumb")return F;return F}function R3(D){var F=bJ(D);return yJ(F)}c6.exports={supportsColor:R3,stdout:R3(process.stdout),stderr:R3(process.stderr)}});var i6=T((oW,p6)=>{p6.exports=function(F,u){var E="";F=F||"Run the trap, drop the bass",F=F.split("");var B={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return F.forEach(function(C){C=C.toLowerCase();var Z=B[C]||[" "],J=Math.floor(Math.random()*Z.length);if(typeof B[C]<"u")E+=B[C][J];else E+=C}),E}});var a6=T((tW,n6)=>{n6.exports=function(F,u){F=F||" he is here ";var E={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},B=[].concat(E.up,E.down,E.mid);function C(X){var H=Math.floor(Math.random()*X);return H}function Z(X){var H=!1;return B.filter(function(Y){H=Y===X}),H}function J(X,H){var Y="",G,K;H=H||{},H.up=typeof H.up<"u"?H.up:!0,H.mid=typeof H.mid<"u"?H.mid:!0,H.down=typeof H.down<"u"?H.down:!0,H.size=typeof H.size<"u"?H.size:"maxi",X=X.split("");for(K in X){if(Z(K))continue;switch(Y=Y+X[K],G={up:0,down:0,mid:0},H.size){case"mini":G.up=C(8),G.mid=C(2),G.down=C(8);break;case"maxi":G.up=C(16)+3,G.mid=C(4)+1,G.down=C(64)+3;break;default:G.up=C(8)+1,G.mid=C(6)/2,G.down=C(8)+1;break}var Q=["up","mid","down"];for(var z in Q){var q=Q[z];for(var U=0;U<=G[q];U++)if(H[q])Y=Y+E[q][C(E[q].length)]}}return Y}return J(F,u)}});var s6=T((eW,r6)=>{r6.exports=function(D){return function(F,u,E){if(F===" ")return F;switch(u%3){case 0:return D.red(F);case 1:return D.white(F);case 2:return D.blue(F)}}}});var t6=T((DN,o6)=>{o6.exports=function(D){return function(F,u,E){return u%2===0?F:D.inverse(F)}}});var D9=T((FN,e6)=>{e6.exports=function(D){var F=["red","yellow","green","blue","magenta"];return function(u,E,B){if(u===" ")return u;else return D[F[E++%F.length]](u)}}});var u9=T((uN,F9)=>{F9.exports=function(D){var F=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(u,E,B){return u===" "?u:D[F[Math.round(Math.random()*(F.length-2))]](u)}}});var J9=T((BN,Z9)=>{var n={};Z9.exports=n;n.themes={};var fJ=p("util"),R0=n.styles=g6(),E9=Object.defineProperties,vJ=new RegExp(/[\r\n]+/g);n.supportsColor=l6().supportsColor;if(typeof n.enabled>"u")n.enabled=n.supportsColor()!==!1;n.enable=function(){n.enabled=!0};n.disable=function(){n.enabled=!1};n.stripColors=n.strip=function(D){return(""+D).replace(/\x1B\[\d+m/g,"")};var EN=n.stylize=function(F,u){if(!n.enabled)return F+"";var E=R0[u];if(!E&&u in n)return n[u](F);return E.open+F+E.close},hJ=/[|\\{}()[\]^$+*?.]/g,gJ=function(D){if(typeof D!=="string")throw TypeError("Expected a string");return D.replace(hJ,"\\$&")};function B9(D){var F=function u(){return dJ.apply(u,arguments)};return F._styles=D,F.__proto__=mJ,F}var C9=function(){var D={};return R0.grey=R0.gray,Object.keys(R0).forEach(function(F){R0[F].closeRe=new RegExp(gJ(R0[F].close),"g"),D[F]={get:function(){return B9(this._styles.concat(F))}}}),D}(),mJ=E9(function(){},C9);function dJ(){var D=Array.prototype.slice.call(arguments),F=D.map(function(Z){if(Z!=null&&Z.constructor===String)return Z;else return fJ.inspect(Z)}).join(" ");if(!n.enabled||!F)return F;var u=F.indexOf(`
5
+ `)!=-1,E=this._styles,B=E.length;while(B--){var C=R0[E[B]];if(F=C.open+F.replace(C.closeRe,C.open)+C.close,u)F=F.replace(vJ,function(Z){return C.close+Z+C.open})}return F}n.setTheme=function(D){if(typeof D==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var F in D)(function(u){n[u]=function(E){if(typeof D[u]==="object"){var B=E;for(var C in D[u])B=n[D[u][C]](B);return B}return n[D[u]](E)}})(F)};function cJ(){var D={};return Object.keys(C9).forEach(function(F){D[F]={get:function(){return B9([F])}}}),D}var lJ=function(F,u){var E=u.split("");return E=E.map(F),E.join("")};n.trap=i6();n.zalgo=a6();n.maps={};n.maps.america=s6()(n);n.maps.zebra=t6()(n);n.maps.rainbow=D9()(n);n.maps.random=u9()(n);for(j3 in n.maps)(function(D){n[D]=function(F){return lJ(n.maps[D],F)}})(j3);var j3;E9(n,cJ())});var Y9=T((CN,H9)=>{var pJ=J9();H9.exports=pJ});var K9=T((ZN,M2)=>{var{info:iJ,debug:Q9}=N2(),wD=L3();class _F{constructor(D){this.setOptions(D),this.x=null,this.y=null}setOptions(D){if(["boolean","number","bigint","string"].indexOf(typeof D)!==-1)D={content:""+D};D=D||{},this.options=D;let F=D.content;if(["boolean","number","bigint","string"].indexOf(typeof F)!==-1)this.content=String(F);else if(!F)this.content=this.options.href||"";else throw Error("Content needs to be a primitive, got: "+typeof F);if(this.colSpan=D.colSpan||1,this.rowSpan=D.rowSpan||1,this.options.href)Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(D,F){this.cells=F;let u=this.options.chars||{},E=D.chars,B=this.chars={};aJ.forEach(function(J){S3(u,E,J,B)}),this.truncate=this.options.truncate||D.truncate;let C=this.options.style=this.options.style||{},Z=D.style;S3(C,Z,"padding-left",this),S3(C,Z,"padding-right",this),this.head=C.head||Z.head,this.border=C.border||Z.border,this.fixedWidth=D.colWidths[this.x],this.lines=this.computeLines(D),this.desiredWidth=wD.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(D){let F=D.wordWrap||D.textWrap,{wordWrap:u=F}=this.options;if(this.fixedWidth&&u){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let C=1;while(C<this.colSpan)this.fixedWidth+=D.colWidths[this.x+C],C++}let{wrapOnWordBoundary:E=!0}=D,{wrapOnWordBoundary:B=E}=this.options;return this.wrapLines(wD.wordWrap(this.fixedWidth,this.content,B))}return this.wrapLines(this.content.split(`
6
+ `))}wrapLines(D){let F=wD.colorizeLines(D);if(this.href)return F.map((u)=>wD.hyperlink(this.href,u));return F}init(D){let F=this.x,u=this.y;this.widths=D.colWidths.slice(F,F+this.colSpan),this.heights=D.rowHeights.slice(u,u+this.rowSpan),this.width=this.widths.reduce(G9,-1),this.height=this.heights.reduce(G9,-1),this.hAlign=this.options.hAlign||D.colAligns[F],this.vAlign=this.options.vAlign||D.rowAligns[u],this.drawRight=F+this.colSpan==D.colWidths.length}draw(D,F){if(D=="top")return this.drawTop(this.drawRight);if(D=="bottom")return this.drawBottom(this.drawRight);let u=wD.truncate(this.content,10,this.truncate);if(!D)iJ(`${this.y}-${this.x}: ${this.rowSpan-D}x${this.colSpan} Cell ${u}`);let E=Math.max(this.height-this.lines.length,0),B;switch(this.vAlign){case"center":B=Math.ceil(E/2);break;case"bottom":B=E;break;default:B=0}if(D<B||D>=B+this.lines.length)return this.drawEmpty(this.drawRight,F);let C=this.lines.length>this.height&&D+1>=this.height;return this.drawLine(D-B,this.drawRight,C,F)}drawTop(D){let F=[];if(this.cells)this.widths.forEach(function(u,E){F.push(this._topLeftChar(E)),F.push(wD.repeat(this.chars[this.y==0?"top":"mid"],u))},this);else F.push(this._topLeftChar(0)),F.push(wD.repeat(this.chars[this.y==0?"top":"mid"],this.width));if(D)F.push(this.chars[this.y==0?"topRight":"rightMid"]);return this.wrapWithStyleColors("border",F.join(""))}_topLeftChar(D){let F=this.x+D,u;if(this.y==0)u=F==0?"topLeft":D==0?"topMid":"top";else if(F==0)u="leftMid";else if(u=D==0?"midMid":"bottomMid",this.cells){if(this.cells[this.y-1][F]instanceof _F.ColSpanCell)u=D==0?"topMid":"mid";if(D==0){let B=1;while(this.cells[this.y][F-B]instanceof _F.ColSpanCell)B++;if(this.cells[this.y][F-B]instanceof _F.RowSpanCell)u="leftMid"}}return this.chars[u]}wrapWithStyleColors(D,F){if(this[D]&&this[D].length)try{let u=Y9();for(let E=this[D].length-1;E>=0;E--)u=u[this[D][E]];return u(F)}catch(u){return F}else return F}drawLine(D,F,u,E){let B=this.chars[this.x==0?"left":"middle"];if(this.x&&E&&this.cells){let G=this.cells[this.y+E][this.x-1];while(G instanceof V2)G=this.cells[G.y][G.x-1];if(!(G instanceof I2))B=this.chars.rightMid}let C=wD.repeat(" ",this.paddingLeft),Z=F?this.chars.right:"",J=wD.repeat(" ",this.paddingRight),X=this.lines[D],H=this.width-(this.paddingLeft+this.paddingRight);if(u)X+=this.truncate||"…";let Y=wD.truncate(X,H,this.truncate);return Y=wD.pad(Y,H," ",this.hAlign),Y=C+Y+J,this.stylizeLine(B,Y,Z)}stylizeLine(D,F,u){if(D=this.wrapWithStyleColors("border",D),u=this.wrapWithStyleColors("border",u),this.y===0)F=this.wrapWithStyleColors("head",F);return D+F+u}drawBottom(D){let F=this.chars[this.x==0?"bottomLeft":"bottomMid"],u=wD.repeat(this.chars.bottom,this.width),E=D?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",F+u+E)}drawEmpty(D,F){let u=this.chars[this.x==0?"left":"middle"];if(this.x&&F&&this.cells){let C=this.cells[this.y+F][this.x-1];while(C instanceof V2)C=this.cells[C.y][C.x-1];if(!(C instanceof I2))u=this.chars.rightMid}let E=D?this.chars.right:"",B=wD.repeat(" ",this.width);return this.stylizeLine(u,B,E)}}class V2{constructor(){}draw(D){if(typeof D==="number")Q9(`${this.y}-${this.x}: 1x1 ColSpanCell`);return""}init(){}mergeTableOptions(){}}class I2{constructor(D){this.originalCell=D}init(D){let F=this.y,u=this.originalCell.y;this.cellOffset=F-u,this.offset=nJ(D.rowHeights,u,this.cellOffset)}draw(D){if(D=="top")return this.originalCell.draw(this.offset,this.cellOffset);if(D=="bottom")return this.originalCell.draw("bottom");return Q9(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+D)}mergeTableOptions(){}}function X9(...D){return D.filter((F)=>F!==void 0&&F!==null).shift()}function S3(D,F,u,E){let B=u.split("-");if(B.length>1)B[1]=B[1].charAt(0).toUpperCase()+B[1].substr(1),B=B.join(""),E[B]=X9(D[B],D[u],F[B],F[u]);else E[u]=X9(D[u],F[u])}function nJ(D,F,u){let E=D[F];for(let B=1;B<u;B++)E+=1+D[F+B];return E}function G9(D,F){return D+F+1}var aJ=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];M2.exports=_F;M2.exports.ColSpanCell=V2;M2.exports.RowSpanCell=I2});var A9=T((JN,q9)=>{var{warn:rJ,debug:sJ}=N2(),P3=K9(),{ColSpanCell:oJ,RowSpanCell:tJ}=P3;(function(){function D(Q,z){if(Q[z]>0)return D(Q,z+1);return z}function F(Q){let z={};Q.forEach(function(q,U){let N=0;q.forEach(function(M){M.y=U,M.x=U?D(z,N):N;let $=M.rowSpan||1,W=M.colSpan||1;if($>1)for(let j=0;j<W;j++)z[M.x+j]=$;N=M.x+W}),Object.keys(z).forEach((M)=>{if(z[M]--,z[M]<1)delete z[M]})})}function u(Q){let z=0;return Q.forEach(function(q){q.forEach(function(U){z=Math.max(z,U.x+(U.colSpan||1))})}),z}function E(Q){return Q.length}function B(Q,z){let q=Q.y,U=Q.y-1+(Q.rowSpan||1),N=z.y,M=z.y-1+(z.rowSpan||1),$=!(q>M||N>U),W=Q.x,j=Q.x-1+(Q.colSpan||1),P=z.x,L=z.x-1+(z.colSpan||1),v=!(W>L||P>j);return $&&v}function C(Q,z,q){let U=Math.min(Q.length-1,q),N={x:z,y:q};for(let M=0;M<=U;M++){let $=Q[M];for(let W=0;W<$.length;W++)if(B(N,$[W]))return!0}return!1}function Z(Q,z,q,U){for(let N=q;N<U;N++)if(C(Q,N,z))return!1;return!0}function J(Q){Q.forEach(function(z,q){z.forEach(function(U){for(let N=1;N<U.rowSpan;N++){let M=new tJ(U);M.x=U.x,M.y=U.y+N,M.colSpan=U.colSpan,H(M,Q[q+N])}})})}function X(Q){for(let z=Q.length-1;z>=0;z--){let q=Q[z];for(let U=0;U<q.length;U++){let N=q[U];for(let M=1;M<N.colSpan;M++){let $=new oJ;$.x=N.x+M,$.y=N.y,q.splice(U+1,0,$)}}}}function H(Q,z){let q=0;while(q<z.length&&z[q].x<Q.x)q++;z.splice(q,0,Q)}function Y(Q){let z=E(Q),q=u(Q);sJ(`Max rows: ${z}; Max cols: ${q}`);for(let U=0;U<z;U++)for(let N=0;N<q;N++)if(!C(Q,N,U)){let M={x:N,y:U,colSpan:1,rowSpan:1};N++;while(N<q&&!C(Q,N,U))M.colSpan++,N++;let $=U+1;while($<z&&Z(Q,$,M.x,M.x+M.colSpan))M.rowSpan++,$++;let W=new P3(M);W.x=M.x,W.y=M.y,rJ(`Missing cell at ${W.y}-${W.x}.`),H(W,Q[U])}}function G(Q){return Q.map(function(z){if(!Array.isArray(z)){let q=Object.keys(z)[0];if(z=z[q],Array.isArray(z))z=z.slice(),z.unshift(q);else z=[q,z]}return z.map(function(q){return new P3(q)})})}function K(Q){let z=G(Q);return F(z),Y(z),J(z),X(z),z}q9.exports={makeTableLayout:K,layoutTable:F,addRowSpanCells:J,maxWidth:u,fillInTable:Y,computeWidths:z9("colSpan","desiredWidth","x",1),computeHeights:z9("rowSpan","desiredHeight","y",1)}})();function z9(D,F,u,E){return function(B,C){let Z=[],J=[],X={};C.forEach(function(H){H.forEach(function(Y){if((Y[D]||1)>1)J.push(Y);else Z[Y[u]]=Math.max(Z[Y[u]]||0,Y[F]||0,E)})}),B.forEach(function(H,Y){if(typeof H==="number")Z[Y]=H});for(let H=J.length-1;H>=0;H--){let Y=J[H],G=Y[D],K=Y[u],Q=Z[K],z=typeof B[K]==="number"?0:1;if(typeof Q==="number"){for(let q=1;q<G;q++)if(Q+=1+Z[K+q],typeof B[K+q]!=="number")z++}else if(Q=F==="desiredWidth"?Y.desiredWidth-1:1,!X[K]||X[K]<Q)X[K]=Q;if(Y[F]>Q){let q=0;while(z>0&&Y[F]>Q){if(typeof B[K+q]!=="number"){let U=Math.round((Y[F]-Q)/z);Q+=U,Z[K+q]+=U,z--}q++}}}Object.assign(B,Z,X);for(let H=0;H<B.length;H++)B[H]=Math.max(E,B[H]||0)}}});var W9=T((HN,U9)=>{var J0=N2(),eJ=L3(),w3=A9();class k3 extends Array{constructor(D){super();let F=eJ.mergeOptions(D);if(Object.defineProperty(this,"options",{value:F,enumerable:F.debug}),F.debug){switch(typeof F.debug){case"boolean":J0.setDebugLevel(J0.WARN);break;case"number":J0.setDebugLevel(F.debug);break;case"string":J0.setDebugLevel(parseInt(F.debug,10));break;default:J0.setDebugLevel(J0.WARN),J0.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof F.debug}`)}Object.defineProperty(this,"messages",{get(){return J0.debugMessages()}})}}toString(){let D=this,F=this.options.head&&this.options.head.length;if(F){if(D=[this.options.head],this.length)D.push.apply(D,this)}else this.options.style.head=[];let u=w3.makeTableLayout(D);u.forEach(function(B){B.forEach(function(C){C.mergeTableOptions(this.options,u)},this)},this),w3.computeWidths(this.options.colWidths,u),w3.computeHeights(this.options.rowHeights,u),u.forEach(function(B){B.forEach(function(C){C.init(this.options)},this)},this);let E=[];for(let B=0;B<u.length;B++){let C=u[B],Z=this.options.rowHeights[B];if(B===0||!this.options.style.compact||B==1&&F)x3(C,"top",E);for(let J=0;J<Z;J++)x3(C,J,E);if(B+1==u.length)x3(C,"bottom",E)}return E.join(`
7
7
  `)}get width(){return this.toString().split(`
8
- `)[0].length}}Ou.reset=()=>J0.reset();function _u(D,F,u){let E=[];D.forEach(function(C){E.push(C.draw(F))});let B=E.join("");if(B.length)u.push(B)}J9.exports=Ou});var Ru=M((FN,Lu)=>{var M2=process||{},Y9=M2.argv||[],I2=M2.env||{},pJ=!(!!I2.NO_COLOR||Y9.includes("--no-color"))&&(!!I2.FORCE_COLOR||Y9.includes("--color")||M2.platform==="win32"||(M2.stdout||{}).isTTY&&I2.TERM!=="dumb"||!!I2.CI),iJ=(D,F,u=D)=>(E)=>{let B=""+E,C=B.indexOf(F,D.length);return~C?D+nJ(B,F,u,C)+F:D+B+F},nJ=(D,F,u,E)=>{let B="",C=0;do B+=D.substring(C,E)+u,C=E+F.length,E=D.indexOf(F,C);while(~E);return B+D.substring(C)},X9=(D=pJ)=>{let F=D?iJ:()=>String;return{isColorSupported:D,reset:F("\x1B[0m","\x1B[0m"),bold:F("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:F("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:F("\x1B[3m","\x1B[23m"),underline:F("\x1B[4m","\x1B[24m"),inverse:F("\x1B[7m","\x1B[27m"),hidden:F("\x1B[8m","\x1B[28m"),strikethrough:F("\x1B[9m","\x1B[29m"),black:F("\x1B[30m","\x1B[39m"),red:F("\x1B[31m","\x1B[39m"),green:F("\x1B[32m","\x1B[39m"),yellow:F("\x1B[33m","\x1B[39m"),blue:F("\x1B[34m","\x1B[39m"),magenta:F("\x1B[35m","\x1B[39m"),cyan:F("\x1B[36m","\x1B[39m"),white:F("\x1B[37m","\x1B[39m"),gray:F("\x1B[90m","\x1B[39m"),bgBlack:F("\x1B[40m","\x1B[49m"),bgRed:F("\x1B[41m","\x1B[49m"),bgGreen:F("\x1B[42m","\x1B[49m"),bgYellow:F("\x1B[43m","\x1B[49m"),bgBlue:F("\x1B[44m","\x1B[49m"),bgMagenta:F("\x1B[45m","\x1B[49m"),bgCyan:F("\x1B[46m","\x1B[49m"),bgWhite:F("\x1B[47m","\x1B[49m"),blackBright:F("\x1B[90m","\x1B[39m"),redBright:F("\x1B[91m","\x1B[39m"),greenBright:F("\x1B[92m","\x1B[39m"),yellowBright:F("\x1B[93m","\x1B[39m"),blueBright:F("\x1B[94m","\x1B[39m"),magentaBright:F("\x1B[95m","\x1B[39m"),cyanBright:F("\x1B[96m","\x1B[39m"),whiteBright:F("\x1B[97m","\x1B[39m"),bgBlackBright:F("\x1B[100m","\x1B[49m"),bgRedBright:F("\x1B[101m","\x1B[49m"),bgGreenBright:F("\x1B[102m","\x1B[49m"),bgYellowBright:F("\x1B[103m","\x1B[49m"),bgBlueBright:F("\x1B[104m","\x1B[49m"),bgMagentaBright:F("\x1B[105m","\x1B[49m"),bgCyanBright:F("\x1B[106m","\x1B[49m"),bgWhiteBright:F("\x1B[107m","\x1B[49m")}};Lu.exports=X9();Lu.exports.createColors=X9});var A9=M((ZN,q9)=>{var z0=p("constants"),tJ=process.cwd,T2=null,eJ=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!T2)T2=tJ.call(process);return T2};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(_2=process.chdir,process.chdir=function(D){T2=null,_2.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,_2)}var _2;q9.exports=DH;function DH(D){if(z0.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))F(D);if(!D.lutimes)u(D);if(D.chown=C(D.chown),D.fchown=C(D.fchown),D.lchown=C(D.lchown),D.chmod=E(D.chmod),D.fchmod=E(D.fchmod),D.lchmod=E(D.lchmod),D.chownSync=Z(D.chownSync),D.fchownSync=Z(D.fchownSync),D.lchownSync=Z(D.lchownSync),D.chmodSync=B(D.chmodSync),D.fchmodSync=B(D.fchmodSync),D.lchmodSync=B(D.lchmodSync),D.stat=J(D.stat),D.fstat=J(D.fstat),D.lstat=J(D.lstat),D.statSync=X(D.statSync),D.fstatSync=X(D.fstatSync),D.lstatSync=X(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(Y,G,K){if(K)process.nextTick(K)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(Y,G,K,Q){if(Q)process.nextTick(Q)},D.lchownSync=function(){};if(eJ==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(Y){function G(K,Q,z){var q=Date.now(),U=0;Y(K,Q,function N(I){if(I&&(I.code==="EACCES"||I.code==="EPERM"||I.code==="EBUSY")&&Date.now()-q<60000){if(setTimeout(function(){D.stat(Q,function($,W){if($&&$.code==="ENOENT")Y(K,Q,N);else z(I)})},U),U<100)U+=10;return}if(z)z(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Y);return G}(D.rename);D.read=typeof D.read!=="function"?D.read:function(Y){function G(K,Q,z,q,U,N){var I;if(N&&typeof N==="function"){var $=0;I=function(W,j,P){if(W&&W.code==="EAGAIN"&&$<10)return $++,Y.call(D,K,Q,z,q,U,I);N.apply(this,arguments)}}return Y.call(D,K,Q,z,q,U,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Y);return G}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(Y){return function(G,K,Q,z,q){var U=0;while(!0)try{return Y.call(D,G,K,Q,z,q)}catch(N){if(N.code==="EAGAIN"&&U<10){U++;continue}throw N}}}(D.readSync);function F(Y){Y.lchmod=function(G,K,Q){Y.open(G,z0.O_WRONLY|z0.O_SYMLINK,K,function(z,q){if(z){if(Q)Q(z);return}Y.fchmod(q,K,function(U){Y.close(q,function(N){if(Q)Q(U||N)})})})},Y.lchmodSync=function(G,K){var Q=Y.openSync(G,z0.O_WRONLY|z0.O_SYMLINK,K),z=!0,q;try{q=Y.fchmodSync(Q,K),z=!1}finally{if(z)try{Y.closeSync(Q)}catch(U){}else Y.closeSync(Q)}return q}}function u(Y){if(z0.hasOwnProperty("O_SYMLINK")&&Y.futimes)Y.lutimes=function(G,K,Q,z){Y.open(G,z0.O_SYMLINK,function(q,U){if(q){if(z)z(q);return}Y.futimes(U,K,Q,function(N){Y.close(U,function(I){if(z)z(N||I)})})})},Y.lutimesSync=function(G,K,Q){var z=Y.openSync(G,z0.O_SYMLINK),q,U=!0;try{q=Y.futimesSync(z,K,Q),U=!1}finally{if(U)try{Y.closeSync(z)}catch(N){}else Y.closeSync(z)}return q};else if(Y.futimes)Y.lutimes=function(G,K,Q,z){if(z)process.nextTick(z)},Y.lutimesSync=function(){}}function E(Y){if(!Y)return Y;return function(G,K,Q){return Y.call(D,G,K,function(z){if(H(z))z=null;if(Q)Q.apply(this,arguments)})}}function B(Y){if(!Y)return Y;return function(G,K){try{return Y.call(D,G,K)}catch(Q){if(!H(Q))throw Q}}}function C(Y){if(!Y)return Y;return function(G,K,Q,z){return Y.call(D,G,K,Q,function(q){if(H(q))q=null;if(z)z.apply(this,arguments)})}}function Z(Y){if(!Y)return Y;return function(G,K,Q){try{return Y.call(D,G,K,Q)}catch(z){if(!H(z))throw z}}}function J(Y){if(!Y)return Y;return function(G,K,Q){if(typeof K==="function")Q=K,K=null;function z(q,U){if(U){if(U.uid<0)U.uid+=4294967296;if(U.gid<0)U.gid+=4294967296}if(Q)Q.apply(this,arguments)}return K?Y.call(D,G,K,z):Y.call(D,G,z)}}function X(Y){if(!Y)return Y;return function(G,K){var Q=K?Y.call(D,G,K):Y.call(D,G);if(Q){if(Q.uid<0)Q.uid+=4294967296;if(Q.gid<0)Q.gid+=4294967296}return Q}}function H(Y){if(!Y)return!0;if(Y.code==="ENOSYS")return!0;var G=!process.getuid||process.getuid()!==0;if(G){if(Y.code==="EINVAL"||Y.code==="EPERM")return!0}return!1}}});var N9=M((JN,W9)=>{var U9=p("stream").Stream;W9.exports=FH;function FH(D){return{ReadStream:F,WriteStream:u};function F(E,B){if(!(this instanceof F))return new F(E,B);U9.call(this);var C=this;this.path=E,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,B=B||{};var Z=Object.keys(B);for(var J=0,X=Z.length;J<X;J++){var H=Z[J];this[H]=B[H]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){C._read()});return}D.open(this.path,this.flags,this.mode,function(Y,G){if(Y){C.emit("error",Y),C.readable=!1;return}C.fd=G,C.emit("open",G),C._read()})}function u(E,B){if(!(this instanceof u))return new u(E,B);U9.call(this),this.path=E,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,B=B||{};var C=Object.keys(B);for(var Z=0,J=C.length;Z<J;Z++){var X=C[Z];this[X]=B[X]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var V9=M((HN,$9)=>{$9.exports=EH;var uH=Object.getPrototypeOf||function(D){return D.__proto__};function EH(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var F={__proto__:uH(D)};else var F=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(u){Object.defineProperty(F,u,Object.getOwnPropertyDescriptor(D,u))}),F}});var T9=M((YN,wu)=>{var CD=p("fs"),BH=A9(),CH=N9(),ZH=V9(),O2=p("util"),KD,R2;if(typeof Symbol==="function"&&typeof Symbol.for==="function")KD=Symbol.for("graceful-fs.queue"),R2=Symbol.for("graceful-fs.previous");else KD="___graceful-fs.queue",R2="___graceful-fs.previous";function JH(){}function M9(D,F){Object.defineProperty(D,KD,{get:function(){return F}})}var R0=JH;if(O2.debuglog)R0=O2.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))R0=function(){var D=O2.format.apply(O2,arguments);D="GFS4: "+D.split(/\n/).join(`
9
- GFS4: `),console.error(D)};if(!CD[KD]){if(ju=global[KD]||[],M9(CD,ju),CD.close=function(D){function F(u,E){return D.call(CD,u,function(B){if(!B)I9();if(typeof E==="function")E.apply(this,arguments)})}return Object.defineProperty(F,R2,{value:D}),F}(CD.close),CD.closeSync=function(D){function F(u){D.apply(CD,arguments),I9()}return Object.defineProperty(F,R2,{value:D}),F}(CD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){R0(CD[KD]),p("assert").equal(CD[KD].length,0)})}var ju;if(!global[KD])M9(global,CD[KD]);wu.exports=Su(ZH(CD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!CD.__patched)wu.exports=Su(CD),CD.__patched=!0;function Su(D){BH(D),D.gracefulify=Su,D.createReadStream=j,D.createWriteStream=P;var F=D.readFile;D.readFile=u;function u(V,O,_){if(typeof O==="function")_=O,O=null;return h(V,O,_);function h(w,R,S,b){return F(w,R,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))o0([h,[w,R,S],f,b||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var E=D.writeFile;D.writeFile=B;function B(V,O,_,h){if(typeof _==="function")h=_,_=null;return w(V,O,_,h);function w(R,S,b,f,l){return E(R,S,b,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))o0([w,[R,S,b,f],g,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var C=D.appendFile;if(C)D.appendFile=Z;function Z(V,O,_,h){if(typeof _==="function")h=_,_=null;return w(V,O,_,h);function w(R,S,b,f,l){return C(R,S,b,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))o0([w,[R,S,b,f],g,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=X;function X(V,O,_,h){if(typeof _==="function")h=_,_=0;return w(V,O,_,h);function w(R,S,b,f,l){return J(R,S,b,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))o0([w,[R,S,b,f],g,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var H=D.readdir;D.readdir=G;var Y=/^v[0-5]\./;function G(V,O,_){if(typeof O==="function")_=O,O=null;var h=Y.test(process.version)?function(S,b,f,l){return H(S,w(S,b,f,l))}:function(S,b,f,l){return H(S,b,w(S,b,f,l))};return h(V,O,_);function w(R,S,b,f){return function(l,g){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))o0([h,[R,S,b],l,f||Date.now(),Date.now()]);else{if(g&&g.sort)g.sort();if(typeof b==="function")b.call(this,l,g)}}}}if(process.version.substr(0,4)==="v0.8"){var K=CH(D);N=K.ReadStream,$=K.WriteStream}var Q=D.ReadStream;if(Q)N.prototype=Object.create(Q.prototype),N.prototype.open=I;var z=D.WriteStream;if(z)$.prototype=Object.create(z.prototype),$.prototype.open=W;Object.defineProperty(D,"ReadStream",{get:function(){return N},set:function(V){N=V},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return $},set:function(V){$=V},enumerable:!0,configurable:!0});var q=N;Object.defineProperty(D,"FileReadStream",{get:function(){return q},set:function(V){q=V},enumerable:!0,configurable:!0});var U=$;Object.defineProperty(D,"FileWriteStream",{get:function(){return U},set:function(V){U=V},enumerable:!0,configurable:!0});function N(V,O){if(this instanceof N)return Q.apply(this,arguments),this;else return N.apply(Object.create(N.prototype),arguments)}function I(){var V=this;v(V.path,V.flags,V.mode,function(O,_){if(O){if(V.autoClose)V.destroy();V.emit("error",O)}else V.fd=_,V.emit("open",_),V.read()})}function $(V,O){if(this instanceof $)return z.apply(this,arguments),this;else return $.apply(Object.create($.prototype),arguments)}function W(){var V=this;v(V.path,V.flags,V.mode,function(O,_){if(O)V.destroy(),V.emit("error",O);else V.fd=_,V.emit("open",_)})}function j(V,O){return new D.ReadStream(V,O)}function P(V,O){return new D.WriteStream(V,O)}var L=D.open;D.open=v;function v(V,O,_,h){if(typeof _==="function")h=_,_=null;return w(V,O,_,h);function w(R,S,b,f,l){return L(R,S,b,function(g,zu){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))o0([w,[R,S,b,f],g,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}return D}function o0(D){R0("ENQUEUE",D[0].name,D[1]),CD[KD].push(D),Pu()}var L2;function I9(){var D=Date.now();for(var F=0;F<CD[KD].length;++F)if(CD[KD][F].length>2)CD[KD][F][3]=D,CD[KD][F][4]=D;Pu()}function Pu(){if(clearTimeout(L2),L2=void 0,CD[KD].length===0)return;var D=CD[KD].shift(),F=D[0],u=D[1],E=D[2],B=D[3],C=D[4];if(B===void 0)R0("RETRY",F.name,u),F.apply(null,u);else if(Date.now()-B>=60000){R0("TIMEOUT",F.name,u);var Z=u.pop();if(typeof Z==="function")Z.call(null,E)}else{var J=Date.now()-C,X=Math.max(C-B,1),H=Math.min(X*1.2,100);if(J>=H)R0("RETRY",F.name,u),F.apply(null,u.concat([B]));else CD[KD].push(D)}if(L2===void 0)L2=setTimeout(Pu,0)}});var xF=M((b$,Z7)=>{var hH=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...D)=>console.error("SEMVER",...D):()=>{};Z7.exports=hH});var kF=M((f$,J7)=>{var gH=Number.MAX_SAFE_INTEGER||9007199254740991,mH=["major","premajor","minor","preminor","patch","prepatch","prerelease"];J7.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:gH,RELEASE_TYPES:mH,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var uF=M((F0,H7)=>{var{MAX_SAFE_COMPONENT_LENGTH:pu,MAX_SAFE_BUILD_LENGTH:dH,MAX_LENGTH:cH}=kF(),lH=xF();F0=H7.exports={};var pH=F0.re=[],iH=F0.safeRe=[],k=F0.src=[],nH=F0.safeSrc=[],y=F0.t={},aH=0,iu="[a-zA-Z0-9-]",rH=[["\\s",1],["\\d",cH],[iu,dH]],sH=(D)=>{for(let[F,u]of rH)D=D.split(`${F}*`).join(`${F}{0,${u}}`).split(`${F}+`).join(`${F}{1,${u}}`);return D},c=(D,F,u)=>{let E=sH(F),B=aH++;lH(D,B,F),y[D]=B,k[B]=F,nH[B]=E,pH[B]=new RegExp(F,u?"g":void 0),iH[B]=new RegExp(E,u?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*");c("NUMERICIDENTIFIERLOOSE","\\d+");c("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${iu}*`);c("MAINVERSION",`(${k[y.NUMERICIDENTIFIER]})\\.(${k[y.NUMERICIDENTIFIER]})\\.(${k[y.NUMERICIDENTIFIER]})`);c("MAINVERSIONLOOSE",`(${k[y.NUMERICIDENTIFIERLOOSE]})\\.(${k[y.NUMERICIDENTIFIERLOOSE]})\\.(${k[y.NUMERICIDENTIFIERLOOSE]})`);c("PRERELEASEIDENTIFIER",`(?:${k[y.NONNUMERICIDENTIFIER]}|${k[y.NUMERICIDENTIFIER]})`);c("PRERELEASEIDENTIFIERLOOSE",`(?:${k[y.NONNUMERICIDENTIFIER]}|${k[y.NUMERICIDENTIFIERLOOSE]})`);c("PRERELEASE",`(?:-(${k[y.PRERELEASEIDENTIFIER]}(?:\\.${k[y.PRERELEASEIDENTIFIER]})*))`);c("PRERELEASELOOSE",`(?:-?(${k[y.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${k[y.PRERELEASEIDENTIFIERLOOSE]})*))`);c("BUILDIDENTIFIER",`${iu}+`);c("BUILD",`(?:\\+(${k[y.BUILDIDENTIFIER]}(?:\\.${k[y.BUILDIDENTIFIER]})*))`);c("FULLPLAIN",`v?${k[y.MAINVERSION]}${k[y.PRERELEASE]}?${k[y.BUILD]}?`);c("FULL",`^${k[y.FULLPLAIN]}$`);c("LOOSEPLAIN",`[v=\\s]*${k[y.MAINVERSIONLOOSE]}${k[y.PRERELEASELOOSE]}?${k[y.BUILD]}?`);c("LOOSE",`^${k[y.LOOSEPLAIN]}$`);c("GTLT","((?:<|>)?=?)");c("XRANGEIDENTIFIERLOOSE",`${k[y.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);c("XRANGEIDENTIFIER",`${k[y.NUMERICIDENTIFIER]}|x|X|\\*`);c("XRANGEPLAIN",`[v=\\s]*(${k[y.XRANGEIDENTIFIER]})(?:\\.(${k[y.XRANGEIDENTIFIER]})(?:\\.(${k[y.XRANGEIDENTIFIER]})(?:${k[y.PRERELEASE]})?${k[y.BUILD]}?)?)?`);c("XRANGEPLAINLOOSE",`[v=\\s]*(${k[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[y.XRANGEIDENTIFIERLOOSE]})(?:${k[y.PRERELEASELOOSE]})?${k[y.BUILD]}?)?)?`);c("XRANGE",`^${k[y.GTLT]}\\s*${k[y.XRANGEPLAIN]}$`);c("XRANGELOOSE",`^${k[y.GTLT]}\\s*${k[y.XRANGEPLAINLOOSE]}$`);c("COERCEPLAIN",`(^|[^\\d])(\\d{1,${pu}})(?:\\.(\\d{1,${pu}}))?(?:\\.(\\d{1,${pu}}))?`);c("COERCE",`${k[y.COERCEPLAIN]}(?:$|[^\\d])`);c("COERCEFULL",k[y.COERCEPLAIN]+`(?:${k[y.PRERELEASE]})?(?:${k[y.BUILD]})?(?:$|[^\\d])`);c("COERCERTL",k[y.COERCE],!0);c("COERCERTLFULL",k[y.COERCEFULL],!0);c("LONETILDE","(?:~>?)");c("TILDETRIM",`(\\s*)${k[y.LONETILDE]}\\s+`,!0);F0.tildeTrimReplace="$1~";c("TILDE",`^${k[y.LONETILDE]}${k[y.XRANGEPLAIN]}$`);c("TILDELOOSE",`^${k[y.LONETILDE]}${k[y.XRANGEPLAINLOOSE]}$`);c("LONECARET","(?:\\^)");c("CARETTRIM",`(\\s*)${k[y.LONECARET]}\\s+`,!0);F0.caretTrimReplace="$1^";c("CARET",`^${k[y.LONECARET]}${k[y.XRANGEPLAIN]}$`);c("CARETLOOSE",`^${k[y.LONECARET]}${k[y.XRANGEPLAINLOOSE]}$`);c("COMPARATORLOOSE",`^${k[y.GTLT]}\\s*(${k[y.LOOSEPLAIN]})$|^$`);c("COMPARATOR",`^${k[y.GTLT]}\\s*(${k[y.FULLPLAIN]})$|^$`);c("COMPARATORTRIM",`(\\s*)${k[y.GTLT]}\\s*(${k[y.LOOSEPLAIN]}|${k[y.XRANGEPLAIN]})`,!0);F0.comparatorTrimReplace="$1$2$3";c("HYPHENRANGE",`^\\s*(${k[y.XRANGEPLAIN]})\\s+-\\s+(${k[y.XRANGEPLAIN]})\\s*$`);c("HYPHENRANGELOOSE",`^\\s*(${k[y.XRANGEPLAINLOOSE]})\\s+-\\s+(${k[y.XRANGEPLAINLOOSE]})\\s*$`);c("STAR","(<|>)?=?\\s*\\*");c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var f2=M((v$,Y7)=>{var oH=Object.freeze({loose:!0}),tH=Object.freeze({}),eH=(D)=>{if(!D)return tH;if(typeof D!=="object")return oH;return D};Y7.exports=eH});var nu=M((h$,Q7)=>{var X7=/^[0-9]+$/,G7=(D,F)=>{if(typeof D==="number"&&typeof F==="number")return D===F?0:D<F?-1:1;let u=X7.test(D),E=X7.test(F);if(u&&E)D=+D,F=+F;return D===F?0:u&&!E?-1:E&&!u?1:D<F?-1:1},DY=(D,F)=>G7(F,D);Q7.exports={compareIdentifiers:G7,rcompareIdentifiers:DY}});var ND=M((g$,z7)=>{var v2=xF(),{MAX_LENGTH:K7,MAX_SAFE_INTEGER:h2}=kF(),{safeRe:g2,t:m2}=uF(),FY=f2(),{compareIdentifiers:au}=nu();class pD{constructor(D,F){if(F=FY(F),D instanceof pD)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else D=D.version;else if(typeof D!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof D}".`);if(D.length>K7)throw TypeError(`version is longer than ${K7} characters`);v2("SemVer",D,F),this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease;let u=D.trim().match(F.loose?g2[m2.LOOSE]:g2[m2.FULL]);if(!u)throw TypeError(`Invalid Version: ${D}`);if(this.raw=D,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>h2||this.major<0)throw TypeError("Invalid major version");if(this.minor>h2||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>h2||this.patch<0)throw TypeError("Invalid patch version");if(!u[4])this.prerelease=[];else this.prerelease=u[4].split(".").map((E)=>{if(/^[0-9]+$/.test(E)){let B=+E;if(B>=0&&B<h2)return B}return E});this.build=u[5]?u[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(D){if(v2("SemVer.compare",this.version,this.options,D),!(D instanceof pD)){if(typeof D==="string"&&D===this.version)return 0;D=new pD(D,this.options)}if(D.version===this.version)return 0;return this.compareMain(D)||this.comparePre(D)}compareMain(D){if(!(D instanceof pD))D=new pD(D,this.options);if(this.major<D.major)return-1;if(this.major>D.major)return 1;if(this.minor<D.minor)return-1;if(this.minor>D.minor)return 1;if(this.patch<D.patch)return-1;if(this.patch>D.patch)return 1;return 0}comparePre(D){if(!(D instanceof pD))D=new pD(D,this.options);if(this.prerelease.length&&!D.prerelease.length)return-1;else if(!this.prerelease.length&&D.prerelease.length)return 1;else if(!this.prerelease.length&&!D.prerelease.length)return 0;let F=0;do{let u=this.prerelease[F],E=D.prerelease[F];if(v2("prerelease compare",F,u,E),u===void 0&&E===void 0)return 0;else if(E===void 0)return 1;else if(u===void 0)return-1;else if(u===E)continue;else return au(u,E)}while(++F)}compareBuild(D){if(!(D instanceof pD))D=new pD(D,this.options);let F=0;do{let u=this.build[F],E=D.build[F];if(v2("build compare",F,u,E),u===void 0&&E===void 0)return 0;else if(E===void 0)return 1;else if(u===void 0)return-1;else if(u===E)continue;else return au(u,E)}while(++F)}inc(D,F,u){if(D.startsWith("pre")){if(!F&&u===!1)throw Error("invalid increment argument: identifier is empty");if(F){let E=`-${F}`.match(this.options.loose?g2[m2.PRERELEASELOOSE]:g2[m2.PRERELEASE]);if(!E||E[1]!==F)throw Error(`invalid identifier: ${F}`)}}switch(D){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",F,u);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",F,u);break;case"prepatch":this.prerelease.length=0,this.inc("patch",F,u),this.inc("pre",F,u);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",F,u);this.inc("pre",F,u);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let E=Number(u)?1:0;if(this.prerelease.length===0)this.prerelease=[E];else{let B=this.prerelease.length;while(--B>=0)if(typeof this.prerelease[B]==="number")this.prerelease[B]++,B=-2;if(B===-1){if(F===this.prerelease.join(".")&&u===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(E)}}if(F){let B=[F,E];if(u===!1)B=[F];if(au(this.prerelease[0],F)===0){if(isNaN(this.prerelease[1]))this.prerelease=B}else this.prerelease=B}break}default:throw Error(`invalid increment argument: ${D}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}z7.exports=pD});var w0=M((m$,A7)=>{var q7=ND(),uY=(D,F,u=!1)=>{if(D instanceof q7)return D;try{return new q7(D,F)}catch(E){if(!u)return null;throw E}};A7.exports=uY});var ru=M((d$,W7)=>{var U7=w0(),EY=(D,F)=>{let u=U7(D,null,!0),E=U7(F,null,!0),B=u.compare(E);if(B===0)return null;let C=B>0,Z=C?u:E,J=C?E:u,X=!!Z.prerelease.length;if(!!J.prerelease.length&&!X){if(!J.patch&&!J.minor)return"major";if(J.compareMain(Z)===0){if(J.minor&&!J.patch)return"minor";return"patch"}}let Y=X?"pre":"";if(u.major!==E.major)return Y+"major";if(u.minor!==E.minor)return Y+"minor";if(u.patch!==E.patch)return Y+"patch";return"prerelease"};W7.exports=EY});var gD=M((c$,$7)=>{var N7=ND(),BY=(D,F,u)=>new N7(D,u).compare(new N7(F,u));$7.exports=BY});var EF=M((l$,V7)=>{var CY=gD(),ZY=(D,F,u)=>CY(D,F,u)>0;V7.exports=ZY});var p7=M((qY)=>{qY.parse=qY.decode=zY;qY.stringify=qY.encode=d7;qY.safe=JF;qY.unsafe=a2;var E3=typeof process<"u"&&process.platform==="win32"?`\r
8
+ `)[0].length}}k3.reset=()=>J0.reset();function x3(D,F,u){let E=[];D.forEach(function(C){E.push(C.draw(F))});let B=E.join("");if(B.length)u.push(B)}U9.exports=k3});var b3=T((YN,y3)=>{var O2=process||{},N9=O2.argv||[],T2=O2.env||{},DH=!(!!T2.NO_COLOR||N9.includes("--no-color"))&&(!!T2.FORCE_COLOR||N9.includes("--color")||O2.platform==="win32"||(O2.stdout||{}).isTTY&&T2.TERM!=="dumb"||!!T2.CI),FH=(D,F,u=D)=>(E)=>{let B=""+E,C=B.indexOf(F,D.length);return~C?D+uH(B,F,u,C)+F:D+B+F},uH=(D,F,u,E)=>{let B="",C=0;do B+=D.substring(C,E)+u,C=E+F.length,E=D.indexOf(F,C);while(~E);return B+D.substring(C)},$9=(D=DH)=>{let F=D?FH:()=>String;return{isColorSupported:D,reset:F("\x1B[0m","\x1B[0m"),bold:F("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:F("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:F("\x1B[3m","\x1B[23m"),underline:F("\x1B[4m","\x1B[24m"),inverse:F("\x1B[7m","\x1B[27m"),hidden:F("\x1B[8m","\x1B[28m"),strikethrough:F("\x1B[9m","\x1B[29m"),black:F("\x1B[30m","\x1B[39m"),red:F("\x1B[31m","\x1B[39m"),green:F("\x1B[32m","\x1B[39m"),yellow:F("\x1B[33m","\x1B[39m"),blue:F("\x1B[34m","\x1B[39m"),magenta:F("\x1B[35m","\x1B[39m"),cyan:F("\x1B[36m","\x1B[39m"),white:F("\x1B[37m","\x1B[39m"),gray:F("\x1B[90m","\x1B[39m"),bgBlack:F("\x1B[40m","\x1B[49m"),bgRed:F("\x1B[41m","\x1B[49m"),bgGreen:F("\x1B[42m","\x1B[49m"),bgYellow:F("\x1B[43m","\x1B[49m"),bgBlue:F("\x1B[44m","\x1B[49m"),bgMagenta:F("\x1B[45m","\x1B[49m"),bgCyan:F("\x1B[46m","\x1B[49m"),bgWhite:F("\x1B[47m","\x1B[49m"),blackBright:F("\x1B[90m","\x1B[39m"),redBright:F("\x1B[91m","\x1B[39m"),greenBright:F("\x1B[92m","\x1B[39m"),yellowBright:F("\x1B[93m","\x1B[39m"),blueBright:F("\x1B[94m","\x1B[39m"),magentaBright:F("\x1B[95m","\x1B[39m"),cyanBright:F("\x1B[96m","\x1B[39m"),whiteBright:F("\x1B[97m","\x1B[39m"),bgBlackBright:F("\x1B[100m","\x1B[49m"),bgRedBright:F("\x1B[101m","\x1B[49m"),bgGreenBright:F("\x1B[102m","\x1B[49m"),bgYellowBright:F("\x1B[103m","\x1B[49m"),bgBlueBright:F("\x1B[104m","\x1B[49m"),bgMagentaBright:F("\x1B[105m","\x1B[49m"),bgCyanBright:F("\x1B[106m","\x1B[49m"),bgWhiteBright:F("\x1B[107m","\x1B[49m")}};y3.exports=$9();y3.exports.createColors=$9});var M9=T((GN,I9)=>{var z0=p("constants"),EH=process.cwd,_2=null,BH=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!_2)_2=EH.call(process);return _2};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(L2=process.chdir,process.chdir=function(D){_2=null,L2.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,L2)}var L2;I9.exports=CH;function CH(D){if(z0.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))F(D);if(!D.lutimes)u(D);if(D.chown=C(D.chown),D.fchown=C(D.fchown),D.lchown=C(D.lchown),D.chmod=E(D.chmod),D.fchmod=E(D.fchmod),D.lchmod=E(D.lchmod),D.chownSync=Z(D.chownSync),D.fchownSync=Z(D.fchownSync),D.lchownSync=Z(D.lchownSync),D.chmodSync=B(D.chmodSync),D.fchmodSync=B(D.fchmodSync),D.lchmodSync=B(D.lchmodSync),D.stat=J(D.stat),D.fstat=J(D.fstat),D.lstat=J(D.lstat),D.statSync=X(D.statSync),D.fstatSync=X(D.fstatSync),D.lstatSync=X(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(Y,G,K){if(K)process.nextTick(K)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(Y,G,K,Q){if(Q)process.nextTick(Q)},D.lchownSync=function(){};if(BH==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(Y){function G(K,Q,z){var q=Date.now(),U=0;Y(K,Q,function N(M){if(M&&(M.code==="EACCES"||M.code==="EPERM"||M.code==="EBUSY")&&Date.now()-q<60000){if(setTimeout(function(){D.stat(Q,function($,W){if($&&$.code==="ENOENT")Y(K,Q,N);else z(M)})},U),U<100)U+=10;return}if(z)z(M)})}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Y);return G}(D.rename);D.read=typeof D.read!=="function"?D.read:function(Y){function G(K,Q,z,q,U,N){var M;if(N&&typeof N==="function"){var $=0;M=function(W,j,P){if(W&&W.code==="EAGAIN"&&$<10)return $++,Y.call(D,K,Q,z,q,U,M);N.apply(this,arguments)}}return Y.call(D,K,Q,z,q,U,M)}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Y);return G}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(Y){return function(G,K,Q,z,q){var U=0;while(!0)try{return Y.call(D,G,K,Q,z,q)}catch(N){if(N.code==="EAGAIN"&&U<10){U++;continue}throw N}}}(D.readSync);function F(Y){Y.lchmod=function(G,K,Q){Y.open(G,z0.O_WRONLY|z0.O_SYMLINK,K,function(z,q){if(z){if(Q)Q(z);return}Y.fchmod(q,K,function(U){Y.close(q,function(N){if(Q)Q(U||N)})})})},Y.lchmodSync=function(G,K){var Q=Y.openSync(G,z0.O_WRONLY|z0.O_SYMLINK,K),z=!0,q;try{q=Y.fchmodSync(Q,K),z=!1}finally{if(z)try{Y.closeSync(Q)}catch(U){}else Y.closeSync(Q)}return q}}function u(Y){if(z0.hasOwnProperty("O_SYMLINK")&&Y.futimes)Y.lutimes=function(G,K,Q,z){Y.open(G,z0.O_SYMLINK,function(q,U){if(q){if(z)z(q);return}Y.futimes(U,K,Q,function(N){Y.close(U,function(M){if(z)z(N||M)})})})},Y.lutimesSync=function(G,K,Q){var z=Y.openSync(G,z0.O_SYMLINK),q,U=!0;try{q=Y.futimesSync(z,K,Q),U=!1}finally{if(U)try{Y.closeSync(z)}catch(N){}else Y.closeSync(z)}return q};else if(Y.futimes)Y.lutimes=function(G,K,Q,z){if(z)process.nextTick(z)},Y.lutimesSync=function(){}}function E(Y){if(!Y)return Y;return function(G,K,Q){return Y.call(D,G,K,function(z){if(H(z))z=null;if(Q)Q.apply(this,arguments)})}}function B(Y){if(!Y)return Y;return function(G,K){try{return Y.call(D,G,K)}catch(Q){if(!H(Q))throw Q}}}function C(Y){if(!Y)return Y;return function(G,K,Q,z){return Y.call(D,G,K,Q,function(q){if(H(q))q=null;if(z)z.apply(this,arguments)})}}function Z(Y){if(!Y)return Y;return function(G,K,Q){try{return Y.call(D,G,K,Q)}catch(z){if(!H(z))throw z}}}function J(Y){if(!Y)return Y;return function(G,K,Q){if(typeof K==="function")Q=K,K=null;function z(q,U){if(U){if(U.uid<0)U.uid+=4294967296;if(U.gid<0)U.gid+=4294967296}if(Q)Q.apply(this,arguments)}return K?Y.call(D,G,K,z):Y.call(D,G,z)}}function X(Y){if(!Y)return Y;return function(G,K){var Q=K?Y.call(D,G,K):Y.call(D,G);if(Q){if(Q.uid<0)Q.uid+=4294967296;if(Q.gid<0)Q.gid+=4294967296}return Q}}function H(Y){if(!Y)return!0;if(Y.code==="ENOSYS")return!0;var G=!process.getuid||process.getuid()!==0;if(G){if(Y.code==="EINVAL"||Y.code==="EPERM")return!0}return!1}}});var _9=T((QN,O9)=>{var T9=p("stream").Stream;O9.exports=ZH;function ZH(D){return{ReadStream:F,WriteStream:u};function F(E,B){if(!(this instanceof F))return new F(E,B);T9.call(this);var C=this;this.path=E,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,B=B||{};var Z=Object.keys(B);for(var J=0,X=Z.length;J<X;J++){var H=Z[J];this[H]=B[H]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){C._read()});return}D.open(this.path,this.flags,this.mode,function(Y,G){if(Y){C.emit("error",Y),C.readable=!1;return}C.fd=G,C.emit("open",G),C._read()})}function u(E,B){if(!(this instanceof u))return new u(E,B);T9.call(this),this.path=E,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,B=B||{};var C=Object.keys(B);for(var Z=0,J=C.length;Z<J;Z++){var X=C[Z];this[X]=B[X]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var R9=T((KN,L9)=>{L9.exports=HH;var JH=Object.getPrototypeOf||function(D){return D.__proto__};function HH(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var F={__proto__:JH(D)};else var F=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(u){Object.defineProperty(F,u,Object.getOwnPropertyDescriptor(D,u))}),F}});var P9=T((zN,g3)=>{var CD=p("fs"),YH=M9(),XH=_9(),GH=R9(),R2=p("util"),KD,S2;if(typeof Symbol==="function"&&typeof Symbol.for==="function")KD=Symbol.for("graceful-fs.queue"),S2=Symbol.for("graceful-fs.previous");else KD="___graceful-fs.queue",S2="___graceful-fs.previous";function QH(){}function S9(D,F){Object.defineProperty(D,KD,{get:function(){return F}})}var j0=QH;if(R2.debuglog)j0=R2.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))j0=function(){var D=R2.format.apply(R2,arguments);D="GFS4: "+D.split(/\n/).join(`
9
+ GFS4: `),console.error(D)};if(!CD[KD]){if(f3=global[KD]||[],S9(CD,f3),CD.close=function(D){function F(u,E){return D.call(CD,u,function(B){if(!B)j9();if(typeof E==="function")E.apply(this,arguments)})}return Object.defineProperty(F,S2,{value:D}),F}(CD.close),CD.closeSync=function(D){function F(u){D.apply(CD,arguments),j9()}return Object.defineProperty(F,S2,{value:D}),F}(CD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){j0(CD[KD]),p("assert").equal(CD[KD].length,0)})}var f3;if(!global[KD])S9(global,CD[KD]);g3.exports=v3(GH(CD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!CD.__patched)g3.exports=v3(CD),CD.__patched=!0;function v3(D){YH(D),D.gracefulify=v3,D.createReadStream=j,D.createWriteStream=P;var F=D.readFile;D.readFile=u;function u(V,_,O){if(typeof _==="function")O=_,_=null;return g(V,_,O);function g(w,R,S,b){return F(w,R,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))t0([g,[w,R,S],f,b||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var E=D.writeFile;D.writeFile=B;function B(V,_,O,g){if(typeof O==="function")g=O,O=null;return w(V,_,O,g);function w(R,S,b,f,l){return E(R,S,b,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))t0([w,[R,S,b,f],m,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var C=D.appendFile;if(C)D.appendFile=Z;function Z(V,_,O,g){if(typeof O==="function")g=O,O=null;return w(V,_,O,g);function w(R,S,b,f,l){return C(R,S,b,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))t0([w,[R,S,b,f],m,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=X;function X(V,_,O,g){if(typeof O==="function")g=O,O=0;return w(V,_,O,g);function w(R,S,b,f,l){return J(R,S,b,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))t0([w,[R,S,b,f],m,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var H=D.readdir;D.readdir=G;var Y=/^v[0-5]\./;function G(V,_,O){if(typeof _==="function")O=_,_=null;var g=Y.test(process.version)?function(S,b,f,l){return H(S,w(S,b,f,l))}:function(S,b,f,l){return H(S,b,w(S,b,f,l))};return g(V,_,O);function w(R,S,b,f){return function(l,m){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))t0([g,[R,S,b],l,f||Date.now(),Date.now()]);else{if(m&&m.sort)m.sort();if(typeof b==="function")b.call(this,l,m)}}}}if(process.version.substr(0,4)==="v0.8"){var K=XH(D);N=K.ReadStream,$=K.WriteStream}var Q=D.ReadStream;if(Q)N.prototype=Object.create(Q.prototype),N.prototype.open=M;var z=D.WriteStream;if(z)$.prototype=Object.create(z.prototype),$.prototype.open=W;Object.defineProperty(D,"ReadStream",{get:function(){return N},set:function(V){N=V},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return $},set:function(V){$=V},enumerable:!0,configurable:!0});var q=N;Object.defineProperty(D,"FileReadStream",{get:function(){return q},set:function(V){q=V},enumerable:!0,configurable:!0});var U=$;Object.defineProperty(D,"FileWriteStream",{get:function(){return U},set:function(V){U=V},enumerable:!0,configurable:!0});function N(V,_){if(this instanceof N)return Q.apply(this,arguments),this;else return N.apply(Object.create(N.prototype),arguments)}function M(){var V=this;v(V.path,V.flags,V.mode,function(_,O){if(_){if(V.autoClose)V.destroy();V.emit("error",_)}else V.fd=O,V.emit("open",O),V.read()})}function $(V,_){if(this instanceof $)return z.apply(this,arguments),this;else return $.apply(Object.create($.prototype),arguments)}function W(){var V=this;v(V.path,V.flags,V.mode,function(_,O){if(_)V.destroy(),V.emit("error",_);else V.fd=O,V.emit("open",O)})}function j(V,_){return new D.ReadStream(V,_)}function P(V,_){return new D.WriteStream(V,_)}var L=D.open;D.open=v;function v(V,_,O,g){if(typeof O==="function")g=O,O=null;return w(V,_,O,g);function w(R,S,b,f,l){return L(R,S,b,function(m,I3){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))t0([w,[R,S,b,f],m,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}return D}function t0(D){j0("ENQUEUE",D[0].name,D[1]),CD[KD].push(D),h3()}var j2;function j9(){var D=Date.now();for(var F=0;F<CD[KD].length;++F)if(CD[KD][F].length>2)CD[KD][F][3]=D,CD[KD][F][4]=D;h3()}function h3(){if(clearTimeout(j2),j2=void 0,CD[KD].length===0)return;var D=CD[KD].shift(),F=D[0],u=D[1],E=D[2],B=D[3],C=D[4];if(B===void 0)j0("RETRY",F.name,u),F.apply(null,u);else if(Date.now()-B>=60000){j0("TIMEOUT",F.name,u);var Z=u.pop();if(typeof Z==="function")Z.call(null,E)}else{var J=Date.now()-C,X=Math.max(C-B,1),H=Math.min(X*1.2,100);if(J>=H)j0("RETRY",F.name,u),F.apply(null,u.concat([B]));else CD[KD].push(D)}if(j2===void 0)j2=setTimeout(h3,0)}});var kF=T((m$,K7)=>{var lH=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...D)=>console.error("SEMVER",...D):()=>{};K7.exports=lH});var yF=T((d$,z7)=>{var pH=Number.MAX_SAFE_INTEGER||9007199254740991,iH=["major","premajor","minor","preminor","patch","prepatch","prerelease"];z7.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:pH,RELEASE_TYPES:iH,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var EF=T((u0,q7)=>{var{MAX_SAFE_COMPONENT_LENGTH:e3,MAX_SAFE_BUILD_LENGTH:nH,MAX_LENGTH:aH}=yF(),rH=kF();u0=q7.exports={};var sH=u0.re=[],oH=u0.safeRe=[],k=u0.src=[],tH=u0.safeSrc=[],y=u0.t={},eH=0,D1="[a-zA-Z0-9-]",DY=[["\\s",1],["\\d",aH],[D1,nH]],FY=(D)=>{for(let[F,u]of DY)D=D.split(`${F}*`).join(`${F}{0,${u}}`).split(`${F}+`).join(`${F}{1,${u}}`);return D},c=(D,F,u)=>{let E=FY(F),B=eH++;rH(D,B,F),y[D]=B,k[B]=F,tH[B]=E,sH[B]=new RegExp(F,u?"g":void 0),oH[B]=new RegExp(E,u?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*");c("NUMERICIDENTIFIERLOOSE","\\d+");c("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${D1}*`);c("MAINVERSION",`(${k[y.NUMERICIDENTIFIER]})\\.(${k[y.NUMERICIDENTIFIER]})\\.(${k[y.NUMERICIDENTIFIER]})`);c("MAINVERSIONLOOSE",`(${k[y.NUMERICIDENTIFIERLOOSE]})\\.(${k[y.NUMERICIDENTIFIERLOOSE]})\\.(${k[y.NUMERICIDENTIFIERLOOSE]})`);c("PRERELEASEIDENTIFIER",`(?:${k[y.NONNUMERICIDENTIFIER]}|${k[y.NUMERICIDENTIFIER]})`);c("PRERELEASEIDENTIFIERLOOSE",`(?:${k[y.NONNUMERICIDENTIFIER]}|${k[y.NUMERICIDENTIFIERLOOSE]})`);c("PRERELEASE",`(?:-(${k[y.PRERELEASEIDENTIFIER]}(?:\\.${k[y.PRERELEASEIDENTIFIER]})*))`);c("PRERELEASELOOSE",`(?:-?(${k[y.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${k[y.PRERELEASEIDENTIFIERLOOSE]})*))`);c("BUILDIDENTIFIER",`${D1}+`);c("BUILD",`(?:\\+(${k[y.BUILDIDENTIFIER]}(?:\\.${k[y.BUILDIDENTIFIER]})*))`);c("FULLPLAIN",`v?${k[y.MAINVERSION]}${k[y.PRERELEASE]}?${k[y.BUILD]}?`);c("FULL",`^${k[y.FULLPLAIN]}$`);c("LOOSEPLAIN",`[v=\\s]*${k[y.MAINVERSIONLOOSE]}${k[y.PRERELEASELOOSE]}?${k[y.BUILD]}?`);c("LOOSE",`^${k[y.LOOSEPLAIN]}$`);c("GTLT","((?:<|>)?=?)");c("XRANGEIDENTIFIERLOOSE",`${k[y.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);c("XRANGEIDENTIFIER",`${k[y.NUMERICIDENTIFIER]}|x|X|\\*`);c("XRANGEPLAIN",`[v=\\s]*(${k[y.XRANGEIDENTIFIER]})(?:\\.(${k[y.XRANGEIDENTIFIER]})(?:\\.(${k[y.XRANGEIDENTIFIER]})(?:${k[y.PRERELEASE]})?${k[y.BUILD]}?)?)?`);c("XRANGEPLAINLOOSE",`[v=\\s]*(${k[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[y.XRANGEIDENTIFIERLOOSE]})(?:${k[y.PRERELEASELOOSE]})?${k[y.BUILD]}?)?)?`);c("XRANGE",`^${k[y.GTLT]}\\s*${k[y.XRANGEPLAIN]}$`);c("XRANGELOOSE",`^${k[y.GTLT]}\\s*${k[y.XRANGEPLAINLOOSE]}$`);c("COERCEPLAIN",`(^|[^\\d])(\\d{1,${e3}})(?:\\.(\\d{1,${e3}}))?(?:\\.(\\d{1,${e3}}))?`);c("COERCE",`${k[y.COERCEPLAIN]}(?:$|[^\\d])`);c("COERCEFULL",k[y.COERCEPLAIN]+`(?:${k[y.PRERELEASE]})?(?:${k[y.BUILD]})?(?:$|[^\\d])`);c("COERCERTL",k[y.COERCE],!0);c("COERCERTLFULL",k[y.COERCEFULL],!0);c("LONETILDE","(?:~>?)");c("TILDETRIM",`(\\s*)${k[y.LONETILDE]}\\s+`,!0);u0.tildeTrimReplace="$1~";c("TILDE",`^${k[y.LONETILDE]}${k[y.XRANGEPLAIN]}$`);c("TILDELOOSE",`^${k[y.LONETILDE]}${k[y.XRANGEPLAINLOOSE]}$`);c("LONECARET","(?:\\^)");c("CARETTRIM",`(\\s*)${k[y.LONECARET]}\\s+`,!0);u0.caretTrimReplace="$1^";c("CARET",`^${k[y.LONECARET]}${k[y.XRANGEPLAIN]}$`);c("CARETLOOSE",`^${k[y.LONECARET]}${k[y.XRANGEPLAINLOOSE]}$`);c("COMPARATORLOOSE",`^${k[y.GTLT]}\\s*(${k[y.LOOSEPLAIN]})$|^$`);c("COMPARATOR",`^${k[y.GTLT]}\\s*(${k[y.FULLPLAIN]})$|^$`);c("COMPARATORTRIM",`(\\s*)${k[y.GTLT]}\\s*(${k[y.LOOSEPLAIN]}|${k[y.XRANGEPLAIN]})`,!0);u0.comparatorTrimReplace="$1$2$3";c("HYPHENRANGE",`^\\s*(${k[y.XRANGEPLAIN]})\\s+-\\s+(${k[y.XRANGEPLAIN]})\\s*$`);c("HYPHENRANGELOOSE",`^\\s*(${k[y.XRANGEPLAINLOOSE]})\\s+-\\s+(${k[y.XRANGEPLAINLOOSE]})\\s*$`);c("STAR","(<|>)?=?\\s*\\*");c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var h2=T((c$,A7)=>{var uY=Object.freeze({loose:!0}),EY=Object.freeze({}),BY=(D)=>{if(!D)return EY;if(typeof D!=="object")return uY;return D};A7.exports=BY});var F1=T((l$,N7)=>{var U7=/^[0-9]+$/,W7=(D,F)=>{if(typeof D==="number"&&typeof F==="number")return D===F?0:D<F?-1:1;let u=U7.test(D),E=U7.test(F);if(u&&E)D=+D,F=+F;return D===F?0:u&&!E?-1:E&&!u?1:D<F?-1:1},CY=(D,F)=>W7(F,D);N7.exports={compareIdentifiers:W7,rcompareIdentifiers:CY}});var $D=T((p$,V7)=>{var g2=kF(),{MAX_LENGTH:$7,MAX_SAFE_INTEGER:m2}=yF(),{safeRe:d2,t:c2}=EF(),ZY=h2(),{compareIdentifiers:u1}=F1();class iD{constructor(D,F){if(F=ZY(F),D instanceof iD)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else D=D.version;else if(typeof D!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof D}".`);if(D.length>$7)throw TypeError(`version is longer than ${$7} characters`);g2("SemVer",D,F),this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease;let u=D.trim().match(F.loose?d2[c2.LOOSE]:d2[c2.FULL]);if(!u)throw TypeError(`Invalid Version: ${D}`);if(this.raw=D,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>m2||this.major<0)throw TypeError("Invalid major version");if(this.minor>m2||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>m2||this.patch<0)throw TypeError("Invalid patch version");if(!u[4])this.prerelease=[];else this.prerelease=u[4].split(".").map((E)=>{if(/^[0-9]+$/.test(E)){let B=+E;if(B>=0&&B<m2)return B}return E});this.build=u[5]?u[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(D){if(g2("SemVer.compare",this.version,this.options,D),!(D instanceof iD)){if(typeof D==="string"&&D===this.version)return 0;D=new iD(D,this.options)}if(D.version===this.version)return 0;return this.compareMain(D)||this.comparePre(D)}compareMain(D){if(!(D instanceof iD))D=new iD(D,this.options);if(this.major<D.major)return-1;if(this.major>D.major)return 1;if(this.minor<D.minor)return-1;if(this.minor>D.minor)return 1;if(this.patch<D.patch)return-1;if(this.patch>D.patch)return 1;return 0}comparePre(D){if(!(D instanceof iD))D=new iD(D,this.options);if(this.prerelease.length&&!D.prerelease.length)return-1;else if(!this.prerelease.length&&D.prerelease.length)return 1;else if(!this.prerelease.length&&!D.prerelease.length)return 0;let F=0;do{let u=this.prerelease[F],E=D.prerelease[F];if(g2("prerelease compare",F,u,E),u===void 0&&E===void 0)return 0;else if(E===void 0)return 1;else if(u===void 0)return-1;else if(u===E)continue;else return u1(u,E)}while(++F)}compareBuild(D){if(!(D instanceof iD))D=new iD(D,this.options);let F=0;do{let u=this.build[F],E=D.build[F];if(g2("build compare",F,u,E),u===void 0&&E===void 0)return 0;else if(E===void 0)return 1;else if(u===void 0)return-1;else if(u===E)continue;else return u1(u,E)}while(++F)}inc(D,F,u){if(D.startsWith("pre")){if(!F&&u===!1)throw Error("invalid increment argument: identifier is empty");if(F){let E=`-${F}`.match(this.options.loose?d2[c2.PRERELEASELOOSE]:d2[c2.PRERELEASE]);if(!E||E[1]!==F)throw Error(`invalid identifier: ${F}`)}}switch(D){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",F,u);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",F,u);break;case"prepatch":this.prerelease.length=0,this.inc("patch",F,u),this.inc("pre",F,u);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",F,u);this.inc("pre",F,u);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let E=Number(u)?1:0;if(this.prerelease.length===0)this.prerelease=[E];else{let B=this.prerelease.length;while(--B>=0)if(typeof this.prerelease[B]==="number")this.prerelease[B]++,B=-2;if(B===-1){if(F===this.prerelease.join(".")&&u===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(E)}}if(F){let B=[F,E];if(u===!1)B=[F];if(u1(this.prerelease[0],F)===0){if(isNaN(this.prerelease[1]))this.prerelease=B}else this.prerelease=B}break}default:throw Error(`invalid increment argument: ${D}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}V7.exports=iD});var x0=T((i$,M7)=>{var I7=$D(),JY=(D,F,u=!1)=>{if(D instanceof I7)return D;try{return new I7(D,F)}catch(E){if(!u)return null;throw E}};M7.exports=JY});var E1=T((n$,O7)=>{var T7=x0(),HY=(D,F)=>{let u=T7(D,null,!0),E=T7(F,null,!0),B=u.compare(E);if(B===0)return null;let C=B>0,Z=C?u:E,J=C?E:u,X=!!Z.prerelease.length;if(!!J.prerelease.length&&!X){if(!J.patch&&!J.minor)return"major";if(J.compareMain(Z)===0){if(J.minor&&!J.patch)return"minor";return"patch"}}let Y=X?"pre":"";if(u.major!==E.major)return Y+"major";if(u.minor!==E.minor)return Y+"minor";if(u.patch!==E.patch)return Y+"patch";return"prerelease"};O7.exports=HY});var mD=T((a$,L7)=>{var _7=$D(),YY=(D,F,u)=>new _7(D,u).compare(new _7(F,u));L7.exports=YY});var BF=T((r$,R7)=>{var XY=mD(),GY=(D,F,u)=>XY(D,F,u)>0;R7.exports=GY});var t7=T(($Y)=>{$Y.parse=$Y.decode=NY;$Y.stringify=$Y.encode=r7;$Y.safe=HF;$Y.unsafe=s2;var G1=typeof process<"u"&&process.platform==="win32"?`\r
10
10
  `:`
11
- `;function d7(D,F){var u=[],E="";if(typeof F==="string")F={section:F,whitespace:!1};else F=F||{},F.whitespace=F.whitespace===!0;var B=F.whitespace?" = ":"=";if(Object.keys(D).forEach(function(C,Z,J){var X=D[C];if(X&&Array.isArray(X))X.forEach(function(H){E+=JF(C+"[]")+B+JF(H)+`
12
- `});else if(X&&typeof X==="object")u.push(C);else E+=JF(C)+B+JF(X)+E3}),F.section&&E.length)E="["+JF(F.section)+"]"+E3+E;return u.forEach(function(C,Z,J){var X=c7(C).join("\\."),H=(F.section?F.section+".":"")+X,Y=d7(D[C],{section:H,whitespace:F.whitespace});if(E.length&&Y.length)E+=E3;E+=Y}),E}function c7(D){return D.replace(/\1/g,"\x02LITERAL\\1LITERAL\x02").replace(/\\\./g,"\x01").split(/\./).map(function(F){return F.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"\x01")})}function zY(D){var F={},u=F,E=null,B=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,C=D.split(/[\r\n]+/g);return C.forEach(function(Z,J,X){if(!Z||Z.match(/^\s*[;#]/))return;var H=Z.match(B);if(!H)return;if(H[1]!==void 0){if(E=a2(H[1]),E==="__proto__"){u={};return}u=F[E]=F[E]||{};return}var Y=a2(H[2]);if(Y==="__proto__")return;var G=H[3]?a2(H[4]):!0;switch(G){case"true":case"false":case"null":G=JSON.parse(G)}if(Y.length>2&&Y.slice(-2)==="[]"){if(Y=Y.substring(0,Y.length-2),Y==="__proto__")return;if(!u[Y])u[Y]=[];else if(!Array.isArray(u[Y]))u[Y]=[u[Y]]}if(Array.isArray(u[Y]))u[Y].push(G);else u[Y]=G}),Object.keys(F).filter(function(Z,J,X){if(!F[Z]||typeof F[Z]!=="object"||Array.isArray(F[Z]))return!1;var H=c7(Z),Y=F,G=H.pop(),K=G.replace(/\\\./g,".");if(H.forEach(function(Q,z,q){if(Q==="__proto__")return;if(!Y[Q]||typeof Y[Q]!=="object")Y[Q]={};Y=Y[Q]}),Y===F&&K===G)return!1;return Y[K]=F[Z],!0}).forEach(function(Z,J,X){delete F[Z]}),F}function l7(D){return D.charAt(0)==='"'&&D.slice(-1)==='"'||D.charAt(0)==="'"&&D.slice(-1)==="'"}function JF(D){return typeof D!=="string"||D.match(/[=\r\n]/)||D.match(/^\[/)||D.length>1&&l7(D)||D!==D.trim()?JSON.stringify(D):D.replace(/;/g,"\\;").replace(/#/g,"\\#")}function a2(D,F){if(D=(D||"").trim(),l7(D)){if(D.charAt(0)==="'")D=D.substr(1,D.length-2);try{D=JSON.parse(D)}catch(J){}}else{var u=!1,E="";for(var B=0,C=D.length;B<C;B++){var Z=D.charAt(B);if(u){if("\\;#".indexOf(Z)!==-1)E+=Z;else E+="\\"+Z;u=!1}else if(";#".indexOf(Z)!==-1)break;else if(Z==="\\")u=!0;else E+=Z}if(u)E+="\\";return E.trim()}return D}});var a7=M((wV,n7)=>{var B3=1,i7=2;function $Y(){return""}function VY(D,F,u){return D.slice(F,u).replace(/\S/g," ")}n7.exports=function(D,F){F=F||{};var u,E,B=!1,C=!1,Z=0,J="",X=F.whitespace===!1?$Y:VY;for(var H=0;H<D.length;H++){if(u=D[H],E=D[H+1],!C&&u==='"'){var Y=D[H-1]==="\\"&&D[H-2]!=="\\";if(!Y)B=!B}if(B)continue;if(!C&&u+E==="//")J+=D.slice(Z,H),Z=H,C=B3,H++;else if(C===B3&&u+E===`\r
13
- `){H++,C=!1,J+=X(D,Z,H),Z=H;continue}else if(C===B3&&u===`
14
- `)C=!1,J+=X(D,Z,H),Z=H;else if(!C&&u+E==="/*"){J+=D.slice(Z,H),Z=H,C=i7,H++;continue}else if(C===i7&&u+E==="*/"){H++,C=!1,J+=X(D,Z,H+1),Z=H+1;continue}}return J+(C?X(D.substr(Z)):D.substr(Z))}});var s7=M((OY)=>{var r7=p("fs"),IY=p7(),vF=p("path"),MY=a7(),TY=OY.parse=function(D){if(/^\s*{/.test(D))return JSON.parse(MY(D));return IY.parse(D)},_Y=OY.file=function(){var D=[].slice.call(arguments).filter(function(B){return B!=null});for(var F in D)if(typeof D[F]!=="string")return;var u=vF.join.apply(null,D),E;try{return r7.readFileSync(u,"utf-8")}catch(B){return}},xV=OY.json=function(){var D=_Y.apply(null,arguments);return D?TY(D):null},kV=OY.env=function(D,F){F=F||process.env;var u={},E=D.length;for(var B in F)if(B.toLowerCase().indexOf(D.toLowerCase())===0){var C=B.substring(E).split("__"),Z;while((Z=C.indexOf(""))>-1)C.splice(Z,1);var J=u;C.forEach(function(H,Y){if(!H||typeof J!=="object")return;if(Y===C.length-1)J[H]=F[B];if(J[H]===void 0)J[H]={};J=J[H]})}return u},yV=OY.find=function(){var D=vF.join.apply(null,[].slice.call(arguments));function F(u,E){var B=vF.join(u,E);try{return r7.statSync(B),B}catch(C){if(vF.dirname(u)!==u)return F(vF.dirname(u),E)}}return F(process.cwd(),D)}});var u4=M((dV,F4)=>{/*!
11
+ `;function r7(D,F){var u=[],E="";if(typeof F==="string")F={section:F,whitespace:!1};else F=F||{},F.whitespace=F.whitespace===!0;var B=F.whitespace?" = ":"=";if(Object.keys(D).forEach(function(C,Z,J){var X=D[C];if(X&&Array.isArray(X))X.forEach(function(H){E+=HF(C+"[]")+B+HF(H)+`
12
+ `});else if(X&&typeof X==="object")u.push(C);else E+=HF(C)+B+HF(X)+G1}),F.section&&E.length)E="["+HF(F.section)+"]"+G1+E;return u.forEach(function(C,Z,J){var X=s7(C).join("\\."),H=(F.section?F.section+".":"")+X,Y=r7(D[C],{section:H,whitespace:F.whitespace});if(E.length&&Y.length)E+=G1;E+=Y}),E}function s7(D){return D.replace(/\1/g,"\x02LITERAL\\1LITERAL\x02").replace(/\\\./g,"\x01").split(/\./).map(function(F){return F.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"\x01")})}function NY(D){var F={},u=F,E=null,B=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,C=D.split(/[\r\n]+/g);return C.forEach(function(Z,J,X){if(!Z||Z.match(/^\s*[;#]/))return;var H=Z.match(B);if(!H)return;if(H[1]!==void 0){if(E=s2(H[1]),E==="__proto__"){u={};return}u=F[E]=F[E]||{};return}var Y=s2(H[2]);if(Y==="__proto__")return;var G=H[3]?s2(H[4]):!0;switch(G){case"true":case"false":case"null":G=JSON.parse(G)}if(Y.length>2&&Y.slice(-2)==="[]"){if(Y=Y.substring(0,Y.length-2),Y==="__proto__")return;if(!u[Y])u[Y]=[];else if(!Array.isArray(u[Y]))u[Y]=[u[Y]]}if(Array.isArray(u[Y]))u[Y].push(G);else u[Y]=G}),Object.keys(F).filter(function(Z,J,X){if(!F[Z]||typeof F[Z]!=="object"||Array.isArray(F[Z]))return!1;var H=s7(Z),Y=F,G=H.pop(),K=G.replace(/\\\./g,".");if(H.forEach(function(Q,z,q){if(Q==="__proto__")return;if(!Y[Q]||typeof Y[Q]!=="object")Y[Q]={};Y=Y[Q]}),Y===F&&K===G)return!1;return Y[K]=F[Z],!0}).forEach(function(Z,J,X){delete F[Z]}),F}function o7(D){return D.charAt(0)==='"'&&D.slice(-1)==='"'||D.charAt(0)==="'"&&D.slice(-1)==="'"}function HF(D){return typeof D!=="string"||D.match(/[=\r\n]/)||D.match(/^\[/)||D.length>1&&o7(D)||D!==D.trim()?JSON.stringify(D):D.replace(/;/g,"\\;").replace(/#/g,"\\#")}function s2(D,F){if(D=(D||"").trim(),o7(D)){if(D.charAt(0)==="'")D=D.substr(1,D.length-2);try{D=JSON.parse(D)}catch(J){}}else{var u=!1,E="";for(var B=0,C=D.length;B<C;B++){var Z=D.charAt(B);if(u){if("\\;#".indexOf(Z)!==-1)E+=Z;else E+="\\"+Z;u=!1}else if(";#".indexOf(Z)!==-1)break;else if(Z==="\\")u=!0;else E+=Z}if(u)E+="\\";return E.trim()}return D}});var F4=T((fV,D4)=>{var Q1=1,e7=2;function OY(){return""}function _Y(D,F,u){return D.slice(F,u).replace(/\S/g," ")}D4.exports=function(D,F){F=F||{};var u,E,B=!1,C=!1,Z=0,J="",X=F.whitespace===!1?OY:_Y;for(var H=0;H<D.length;H++){if(u=D[H],E=D[H+1],!C&&u==='"'){var Y=D[H-1]==="\\"&&D[H-2]!=="\\";if(!Y)B=!B}if(B)continue;if(!C&&u+E==="//")J+=D.slice(Z,H),Z=H,C=Q1,H++;else if(C===Q1&&u+E===`\r
13
+ `){H++,C=!1,J+=X(D,Z,H),Z=H;continue}else if(C===Q1&&u===`
14
+ `)C=!1,J+=X(D,Z,H),Z=H;else if(!C&&u+E==="/*"){J+=D.slice(Z,H),Z=H,C=e7,H++;continue}else if(C===e7&&u+E==="*/"){H++,C=!1,J+=X(D,Z,H+1),Z=H+1;continue}}return J+(C?X(D.substr(Z)):D.substr(Z))}});var E4=T((PY)=>{var u4=p("fs"),LY=t7(),hF=p("path"),RY=F4(),jY=PY.parse=function(D){if(/^\s*{/.test(D))return JSON.parse(RY(D));return LY.parse(D)},SY=PY.file=function(){var D=[].slice.call(arguments).filter(function(B){return B!=null});for(var F in D)if(typeof D[F]!=="string")return;var u=hF.join.apply(null,D),E;try{return u4.readFileSync(u,"utf-8")}catch(B){return}},vV=PY.json=function(){var D=SY.apply(null,arguments);return D?jY(D):null},hV=PY.env=function(D,F){F=F||process.env;var u={},E=D.length;for(var B in F)if(B.toLowerCase().indexOf(D.toLowerCase())===0){var C=B.substring(E).split("__"),Z;while((Z=C.indexOf(""))>-1)C.splice(Z,1);var J=u;C.forEach(function(H,Y){if(!H||typeof J!=="object")return;if(Y===C.length-1)J[H]=F[B];if(J[H]===void 0)J[H]={};J=J[H]})}return u},gV=PY.find=function(){var D=hF.join.apply(null,[].slice.call(arguments));function F(u,E){var B=hF.join(u,E);try{return u4.statSync(B),B}catch(C){if(hF.dirname(u)!==u)return F(hF.dirname(u),E)}}return F(process.cwd(),D)}});var Y4=T((nV,H4)=>{/*!
15
15
  * @description Recursive object extending
16
16
  * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
17
17
  * @license MIT
@@ -36,117 +36,117 @@ GFS4: `),console.error(D)};if(!CD[KD]){if(ju=global[KD]||[],M9(CD,ju),CD.close=f
36
36
  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
37
37
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38
38
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39
- */function t7(D){return D instanceof Buffer||D instanceof Date||D instanceof RegExp?!0:!1}function e7(D){if(D instanceof Buffer){var F=Buffer.alloc?Buffer.alloc(D.length):new Buffer(D.length);return D.copy(F),F}else if(D instanceof Date)return new Date(D.getTime());else if(D instanceof RegExp)return new RegExp(D);else throw Error("Unexpected situation")}function D4(D){var F=[];return D.forEach(function(u,E){if(typeof u==="object"&&u!==null)if(Array.isArray(u))F[E]=D4(u);else if(t7(u))F[E]=e7(u);else F[E]=C3({},u);else F[E]=u}),F}function o7(D,F){return F==="__proto__"?void 0:D[F]}var C3=F4.exports=function(){if(arguments.length<1||typeof arguments[0]!=="object")return!1;if(arguments.length<2)return arguments[0];var D=arguments[0],F=Array.prototype.slice.call(arguments,1),u,E,B;return F.forEach(function(C){if(typeof C!=="object"||C===null||Array.isArray(C))return;Object.keys(C).forEach(function(Z){if(E=o7(D,Z),u=o7(C,Z),u===D)return;else if(typeof u!=="object"||u===null){D[Z]=u;return}else if(Array.isArray(u)){D[Z]=D4(u);return}else if(t7(u)){D[Z]=e7(u);return}else if(typeof E!=="object"||E===null||Array.isArray(E)){D[Z]=C3({},u);return}else{D[Z]=C3(E,u);return}})}),D}});var Z4=M((cV,C4)=>{function LY(D,F){var u=D;F.slice(0,-1).forEach(function(B){u=u[B]||{}});var E=F[F.length-1];return E in u}function E4(D){if(typeof D==="number")return!0;if(/^0x[0-9a-f]+$/i.test(D))return!0;return/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(D)}function B4(D,F){return F==="constructor"&&typeof D[F]==="function"||F==="__proto__"}C4.exports=function(D,F){if(!F)F={};var u={bools:{},strings:{},unknownFn:null};if(typeof F.unknown==="function")u.unknownFn=F.unknown;if(typeof F.boolean==="boolean"&&F.boolean)u.allBools=!0;else[].concat(F.boolean).filter(Boolean).forEach(function(W){u.bools[W]=!0});var E={};function B(W){return E[W].some(function(j){return u.bools[j]})}Object.keys(F.alias||{}).forEach(function(W){E[W]=[].concat(F.alias[W]),E[W].forEach(function(j){E[j]=[W].concat(E[W].filter(function(P){return j!==P}))})}),[].concat(F.string).filter(Boolean).forEach(function(W){if(u.strings[W]=!0,E[W])[].concat(E[W]).forEach(function(j){u.strings[j]=!0})});var C=F.default||{},Z={_:[]};function J(W,j){return u.allBools&&/^--[^=]+$/.test(j)||u.strings[W]||u.bools[W]||E[W]}function X(W,j,P){var L=W;for(var v=0;v<j.length-1;v++){var V=j[v];if(B4(L,V))return;if(L[V]===void 0)L[V]={};if(L[V]===Object.prototype||L[V]===Number.prototype||L[V]===String.prototype)L[V]={};if(L[V]===Array.prototype)L[V]=[];L=L[V]}var O=j[j.length-1];if(B4(L,O))return;if(L===Object.prototype||L===Number.prototype||L===String.prototype)L={};if(L===Array.prototype)L=[];if(L[O]===void 0||u.bools[O]||typeof L[O]==="boolean")L[O]=P;else if(Array.isArray(L[O]))L[O].push(P);else L[O]=[L[O],P]}function H(W,j,P){if(P&&u.unknownFn&&!J(W,P)){if(u.unknownFn(P)===!1)return}var L=!u.strings[W]&&E4(j)?Number(j):j;X(Z,W.split("."),L),(E[W]||[]).forEach(function(v){X(Z,v.split("."),L)})}Object.keys(u.bools).forEach(function(W){H(W,C[W]===void 0?!1:C[W])});var Y=[];if(D.indexOf("--")!==-1)Y=D.slice(D.indexOf("--")+1),D=D.slice(0,D.indexOf("--"));for(var G=0;G<D.length;G++){var K=D[G],Q,z;if(/^--.+=/.test(K)){var q=K.match(/^--([^=]+)=([\s\S]*)$/);Q=q[1];var U=q[2];if(u.bools[Q])U=U!=="false";H(Q,U,K)}else if(/^--no-.+/.test(K))Q=K.match(/^--no-(.+)/)[1],H(Q,!1,K);else if(/^--.+/.test(K))if(Q=K.match(/^--(.+)/)[1],z=D[G+1],z!==void 0&&!/^(-|--)[^-]/.test(z)&&!u.bools[Q]&&!u.allBools&&(E[Q]?!B(Q):!0))H(Q,z,K),G+=1;else if(/^(true|false)$/.test(z))H(Q,z==="true",K),G+=1;else H(Q,u.strings[Q]?"":!0,K);else if(/^-[^-]+/.test(K)){var N=K.slice(1,-1).split(""),I=!1;for(var $=0;$<N.length;$++){if(z=K.slice($+2),z==="-"){H(N[$],z,K);continue}if(/[A-Za-z]/.test(N[$])&&z[0]==="="){H(N[$],z.slice(1),K),I=!0;break}if(/[A-Za-z]/.test(N[$])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(z)){H(N[$],z,K),I=!0;break}if(N[$+1]&&N[$+1].match(/\W/)){H(N[$],K.slice($+2),K),I=!0;break}else H(N[$],u.strings[N[$]]?"":!0,K)}if(Q=K.slice(-1)[0],!I&&Q!=="-")if(D[G+1]&&!/^(-|--)[^-]/.test(D[G+1])&&!u.bools[Q]&&(E[Q]?!B(Q):!0))H(Q,D[G+1],K),G+=1;else if(D[G+1]&&/^(true|false)$/.test(D[G+1]))H(Q,D[G+1]==="true",K),G+=1;else H(Q,u.strings[Q]?"":!0,K)}else{if(!u.unknownFn||u.unknownFn(K)!==!1)Z._.push(u.strings._||!E4(K)?K:Number(K));if(F.stopEarly){Z._.push.apply(Z._,D.slice(G+1));break}}}if(Object.keys(C).forEach(function(W){if(!LY(Z,W.split(".")))X(Z,W.split("."),C[W]),(E[W]||[]).forEach(function(j){X(Z,j.split("."),C[W])})}),F["--"])Z["--"]=Y.slice();else Y.forEach(function(W){Z._.push(W)});return Z}});var X4=M((lV,Y4)=>{var hF=s7(),HF=p("path").join,RY=u4(),J4="/etc",H4=process.platform==="win32",gF=H4?process.env.USERPROFILE:process.env.HOME;Y4.exports=function(D,F,u,E){if(typeof D!=="string")throw Error("rc(name): name *must* be string");if(!u)u=Z4()(process.argv.slice(2));F=(typeof F==="string"?hF.json(F):F)||{},E=E||hF.parse;var B=hF.env(D+"_"),C=[F],Z=[];function J(X){if(Z.indexOf(X)>=0)return;var H=hF.file(X);if(H)C.push(E(H)),Z.push(X)}if(!H4)[HF(J4,D,"config"),HF(J4,D+"rc")].forEach(J);if(gF)[HF(gF,".config",D,"config"),HF(gF,".config",D),HF(gF,"."+D,"config"),HF(gF,"."+D+"rc")].forEach(J);if(J(hF.find("."+D+"rc")),B.config)J(B.config);if(u.config)J(u.config);return RY.apply(null,C.concat([B,u,Z.length?{configs:Z,config:Z[Z.length-1]}:void 0]))}});var K4=M((iV,Q4)=>{var U0=p("constants"),jY=process.cwd,r2=null,SY=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!r2)r2=jY.call(process);return r2};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(s2=process.chdir,process.chdir=function(D){r2=null,s2.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,s2)}var s2;Q4.exports=PY;function PY(D){if(U0.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))F(D);if(!D.lutimes)u(D);if(D.chown=C(D.chown),D.fchown=C(D.fchown),D.lchown=C(D.lchown),D.chmod=E(D.chmod),D.fchmod=E(D.fchmod),D.lchmod=E(D.lchmod),D.chownSync=Z(D.chownSync),D.fchownSync=Z(D.fchownSync),D.lchownSync=Z(D.lchownSync),D.chmodSync=B(D.chmodSync),D.fchmodSync=B(D.fchmodSync),D.lchmodSync=B(D.lchmodSync),D.stat=J(D.stat),D.fstat=J(D.fstat),D.lstat=J(D.lstat),D.statSync=X(D.statSync),D.fstatSync=X(D.fstatSync),D.lstatSync=X(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(Y,G,K){if(K)process.nextTick(K)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(Y,G,K,Q){if(Q)process.nextTick(Q)},D.lchownSync=function(){};if(SY==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(Y){function G(K,Q,z){var q=Date.now(),U=0;Y(K,Q,function N(I){if(I&&(I.code==="EACCES"||I.code==="EPERM")&&Date.now()-q<60000){if(setTimeout(function(){D.stat(Q,function($,W){if($&&$.code==="ENOENT")Y(K,Q,N);else z(I)})},U),U<100)U+=10;return}if(z)z(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Y);return G}(D.rename);D.read=typeof D.read!=="function"?D.read:function(Y){function G(K,Q,z,q,U,N){var I;if(N&&typeof N==="function"){var $=0;I=function(W,j,P){if(W&&W.code==="EAGAIN"&&$<10)return $++,Y.call(D,K,Q,z,q,U,I);N.apply(this,arguments)}}return Y.call(D,K,Q,z,q,U,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Y);return G}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(Y){return function(G,K,Q,z,q){var U=0;while(!0)try{return Y.call(D,G,K,Q,z,q)}catch(N){if(N.code==="EAGAIN"&&U<10){U++;continue}throw N}}}(D.readSync);function F(Y){Y.lchmod=function(G,K,Q){Y.open(G,U0.O_WRONLY|U0.O_SYMLINK,K,function(z,q){if(z){if(Q)Q(z);return}Y.fchmod(q,K,function(U){Y.close(q,function(N){if(Q)Q(U||N)})})})},Y.lchmodSync=function(G,K){var Q=Y.openSync(G,U0.O_WRONLY|U0.O_SYMLINK,K),z=!0,q;try{q=Y.fchmodSync(Q,K),z=!1}finally{if(z)try{Y.closeSync(Q)}catch(U){}else Y.closeSync(Q)}return q}}function u(Y){if(U0.hasOwnProperty("O_SYMLINK")&&Y.futimes)Y.lutimes=function(G,K,Q,z){Y.open(G,U0.O_SYMLINK,function(q,U){if(q){if(z)z(q);return}Y.futimes(U,K,Q,function(N){Y.close(U,function(I){if(z)z(N||I)})})})},Y.lutimesSync=function(G,K,Q){var z=Y.openSync(G,U0.O_SYMLINK),q,U=!0;try{q=Y.futimesSync(z,K,Q),U=!1}finally{if(U)try{Y.closeSync(z)}catch(N){}else Y.closeSync(z)}return q};else if(Y.futimes)Y.lutimes=function(G,K,Q,z){if(z)process.nextTick(z)},Y.lutimesSync=function(){}}function E(Y){if(!Y)return Y;return function(G,K,Q){return Y.call(D,G,K,function(z){if(H(z))z=null;if(Q)Q.apply(this,arguments)})}}function B(Y){if(!Y)return Y;return function(G,K){try{return Y.call(D,G,K)}catch(Q){if(!H(Q))throw Q}}}function C(Y){if(!Y)return Y;return function(G,K,Q,z){return Y.call(D,G,K,Q,function(q){if(H(q))q=null;if(z)z.apply(this,arguments)})}}function Z(Y){if(!Y)return Y;return function(G,K,Q){try{return Y.call(D,G,K,Q)}catch(z){if(!H(z))throw z}}}function J(Y){if(!Y)return Y;return function(G,K,Q){if(typeof K==="function")Q=K,K=null;function z(q,U){if(U){if(U.uid<0)U.uid+=4294967296;if(U.gid<0)U.gid+=4294967296}if(Q)Q.apply(this,arguments)}return K?Y.call(D,G,K,z):Y.call(D,G,z)}}function X(Y){if(!Y)return Y;return function(G,K){var Q=K?Y.call(D,G,K):Y.call(D,G);if(Q){if(Q.uid<0)Q.uid+=4294967296;if(Q.gid<0)Q.gid+=4294967296}return Q}}function H(Y){if(!Y)return!0;if(Y.code==="ENOSYS")return!0;var G=!process.getuid||process.getuid()!==0;if(G){if(Y.code==="EINVAL"||Y.code==="EPERM")return!0}return!1}}});var A4=M((nV,q4)=>{var z4=p("stream").Stream;q4.exports=wY;function wY(D){return{ReadStream:F,WriteStream:u};function F(E,B){if(!(this instanceof F))return new F(E,B);z4.call(this);var C=this;this.path=E,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,B=B||{};var Z=Object.keys(B);for(var J=0,X=Z.length;J<X;J++){var H=Z[J];this[H]=B[H]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){C._read()});return}D.open(this.path,this.flags,this.mode,function(Y,G){if(Y){C.emit("error",Y),C.readable=!1;return}C.fd=G,C.emit("open",G),C._read()})}function u(E,B){if(!(this instanceof u))return new u(E,B);z4.call(this),this.path=E,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,B=B||{};var C=Object.keys(B);for(var Z=0,J=C.length;Z<J;Z++){var X=C[Z];this[X]=B[X]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var W4=M((aV,U4)=>{U4.exports=kY;var xY=Object.getPrototypeOf||function(D){return D.__proto__};function kY(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var F={__proto__:xY(D)};else var F=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(u){Object.defineProperty(F,u,Object.getOwnPropertyDescriptor(D,u))}),F}});var V4=M((rV,X3)=>{var ZD=p("fs"),yY=K4(),bY=A4(),fY=W4(),o2=p("util"),qD,e2;if(typeof Symbol==="function"&&typeof Symbol.for==="function")qD=Symbol.for("graceful-fs.queue"),e2=Symbol.for("graceful-fs.previous");else qD="___graceful-fs.queue",e2="___graceful-fs.previous";function vY(){}function $4(D,F){Object.defineProperty(D,qD,{get:function(){return F}})}var x0=vY;if(o2.debuglog)x0=o2.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))x0=function(){var D=o2.format.apply(o2,arguments);D="GFS4: "+D.split(/\n/).join(`
40
- GFS4: `),console.error(D)};if(!ZD[qD]){if(J3=global[qD]||[],$4(ZD,J3),ZD.close=function(D){function F(u,E){return D.call(ZD,u,function(B){if(!B)N4();if(typeof E==="function")E.apply(this,arguments)})}return Object.defineProperty(F,e2,{value:D}),F}(ZD.close),ZD.closeSync=function(D){function F(u){D.apply(ZD,arguments),N4()}return Object.defineProperty(F,e2,{value:D}),F}(ZD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){x0(ZD[qD]),p("assert").equal(ZD[qD].length,0)})}var J3;if(!global[qD])$4(global,ZD[qD]);X3.exports=H3(fY(ZD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ZD.__patched)X3.exports=H3(ZD),ZD.__patched=!0;function H3(D){yY(D),D.gracefulify=H3,D.createReadStream=j,D.createWriteStream=P;var F=D.readFile;D.readFile=u;function u(V,O,_){if(typeof O==="function")_=O,O=null;return h(V,O,_);function h(w,R,S,b){return F(w,R,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))YF([h,[w,R,S],f,b||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var E=D.writeFile;D.writeFile=B;function B(V,O,_,h){if(typeof _==="function")h=_,_=null;return w(V,O,_,h);function w(R,S,b,f,l){return E(R,S,b,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))YF([w,[R,S,b,f],g,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var C=D.appendFile;if(C)D.appendFile=Z;function Z(V,O,_,h){if(typeof _==="function")h=_,_=null;return w(V,O,_,h);function w(R,S,b,f,l){return C(R,S,b,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))YF([w,[R,S,b,f],g,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=X;function X(V,O,_,h){if(typeof _==="function")h=_,_=0;return w(V,O,_,h);function w(R,S,b,f,l){return J(R,S,b,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))YF([w,[R,S,b,f],g,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var H=D.readdir;D.readdir=G;var Y=/^v[0-5]\./;function G(V,O,_){if(typeof O==="function")_=O,O=null;var h=Y.test(process.version)?function(S,b,f,l){return H(S,w(S,b,f,l))}:function(S,b,f,l){return H(S,b,w(S,b,f,l))};return h(V,O,_);function w(R,S,b,f){return function(l,g){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))YF([h,[R,S,b],l,f||Date.now(),Date.now()]);else{if(g&&g.sort)g.sort();if(typeof b==="function")b.call(this,l,g)}}}}if(process.version.substr(0,4)==="v0.8"){var K=bY(D);N=K.ReadStream,$=K.WriteStream}var Q=D.ReadStream;if(Q)N.prototype=Object.create(Q.prototype),N.prototype.open=I;var z=D.WriteStream;if(z)$.prototype=Object.create(z.prototype),$.prototype.open=W;Object.defineProperty(D,"ReadStream",{get:function(){return N},set:function(V){N=V},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return $},set:function(V){$=V},enumerable:!0,configurable:!0});var q=N;Object.defineProperty(D,"FileReadStream",{get:function(){return q},set:function(V){q=V},enumerable:!0,configurable:!0});var U=$;Object.defineProperty(D,"FileWriteStream",{get:function(){return U},set:function(V){U=V},enumerable:!0,configurable:!0});function N(V,O){if(this instanceof N)return Q.apply(this,arguments),this;else return N.apply(Object.create(N.prototype),arguments)}function I(){var V=this;v(V.path,V.flags,V.mode,function(O,_){if(O){if(V.autoClose)V.destroy();V.emit("error",O)}else V.fd=_,V.emit("open",_),V.read()})}function $(V,O){if(this instanceof $)return z.apply(this,arguments),this;else return $.apply(Object.create($.prototype),arguments)}function W(){var V=this;v(V.path,V.flags,V.mode,function(O,_){if(O)V.destroy(),V.emit("error",O);else V.fd=_,V.emit("open",_)})}function j(V,O){return new D.ReadStream(V,O)}function P(V,O){return new D.WriteStream(V,O)}var L=D.open;D.open=v;function v(V,O,_,h){if(typeof _==="function")h=_,_=null;return w(V,O,_,h);function w(R,S,b,f,l){return L(R,S,b,function(g,zu){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))YF([w,[R,S,b,f],g,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}return D}function YF(D){x0("ENQUEUE",D[0].name,D[1]),ZD[qD].push(D),Y3()}var t2;function N4(){var D=Date.now();for(var F=0;F<ZD[qD].length;++F)if(ZD[qD][F].length>2)ZD[qD][F][3]=D,ZD[qD][F][4]=D;Y3()}function Y3(){if(clearTimeout(t2),t2=void 0,ZD[qD].length===0)return;var D=ZD[qD].shift(),F=D[0],u=D[1],E=D[2],B=D[3],C=D[4];if(B===void 0)x0("RETRY",F.name,u),F.apply(null,u);else if(Date.now()-B>=60000){x0("TIMEOUT",F.name,u);var Z=u.pop();if(typeof Z==="function")Z.call(null,E)}else{var J=Date.now()-C,X=Math.max(C-B,1),H=Math.min(X*1.2,100);if(J>=H)x0("RETRY",F.name,u),F.apply(null,u.concat([B]));else ZD[qD].push(D)}if(t2===void 0)t2=setTimeout(Y3,0)}});var I4=M((XF)=>{var hY=XF&&XF.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(XF,"__esModule",{value:!0});XF.readCAFileSync=void 0;var gY=hY(V4());function mY(D){try{let F=gY.default.readFileSync(D,"utf8"),u="-----END CERTIFICATE-----";return F.split("-----END CERTIFICATE-----").filter((B)=>Boolean(B.trim())).map((B)=>`${B.trimLeft()}-----END CERTIFICATE-----`)}catch(F){if(F.code==="ENOENT")return;throw F}}XF.readCAFileSync=mY});var M4=M((k0)=>{var dY=k0&&k0.__createBinding||(Object.create?function(D,F,u,E){if(E===void 0)E=u;var B=Object.getOwnPropertyDescriptor(F,u);if(!B||("get"in B?!F.__esModule:B.writable||B.configurable))B={enumerable:!0,get:function(){return F[u]}};Object.defineProperty(D,E,B)}:function(D,F,u,E){if(E===void 0)E=u;D[E]=F[u]}),cY=k0&&k0.__exportStar||function(D,F){for(var u in D)if(u!=="default"&&!Object.prototype.hasOwnProperty.call(F,u))dY(F,D,u)};Object.defineProperty(k0,"__esModule",{value:!0});cY(I4(),k0)});var O4=M((tV,_4)=>{_4.exports=T4;function y0(D,F){if(typeof Object.setPrototypeOf==="function")return Object.setPrototypeOf(D,F);else D.__proto__=F}function T4(){this.list=[];var D=null;Object.defineProperty(this,"root",{get:function(){return D},set:function(F){if(D=F,this.list.length)y0(this.list[this.list.length-1],F)},enumerable:!0,configurable:!0})}T4.prototype={get length(){return this.list.length},get keys(){var D=[];for(var F in this.list[0])D.push(F);return D},get snapshot(){var D={};return this.keys.forEach(function(F){D[F]=this.get(F)},this),D},get store(){return this.list[0]},push:function(D){if(typeof D!=="object")D={valueOf:D};if(this.list.length>=1)y0(this.list[this.list.length-1],D);return y0(D,this.root),this.list.push(D)},pop:function(){if(this.list.length>=2)y0(this.list[this.list.length-2],this.root);return this.list.pop()},unshift:function(D){return y0(D,this.list[0]||this.root),this.list.unshift(D)},shift:function(){if(this.list.length===1)y0(this.list[0],this.root);return this.list.shift()},get:function(D){return this.list[0][D]},set:function(D,F,u){if(!this.length)this.push({});if(u&&this.list[0].hasOwnProperty(D))this.push({});return this.list[0][D]=F},forEach:function(D,F){for(var u in this.list[0])D.call(F,u,this.list[0][u])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){var D=this.list.splice.apply(this.list,arguments);for(var F=0,u=this.list.length;F<u;F++)y0(this.list[F],this.list[F+1]||this.root);return D}}});var S4=M((pY)=>{pY.parse=pY.decode=lY;pY.stringify=pY.encode=L4;pY.safe=GF;pY.unsafe=D8;var G3=typeof process<"u"&&process.platform==="win32"?`\r
39
+ */function C4(D){return D instanceof Buffer||D instanceof Date||D instanceof RegExp?!0:!1}function Z4(D){if(D instanceof Buffer){var F=Buffer.alloc?Buffer.alloc(D.length):new Buffer(D.length);return D.copy(F),F}else if(D instanceof Date)return new Date(D.getTime());else if(D instanceof RegExp)return new RegExp(D);else throw Error("Unexpected situation")}function J4(D){var F=[];return D.forEach(function(u,E){if(typeof u==="object"&&u!==null)if(Array.isArray(u))F[E]=J4(u);else if(C4(u))F[E]=Z4(u);else F[E]=K1({},u);else F[E]=u}),F}function B4(D,F){return F==="__proto__"?void 0:D[F]}var K1=H4.exports=function(){if(arguments.length<1||typeof arguments[0]!=="object")return!1;if(arguments.length<2)return arguments[0];var D=arguments[0],F=Array.prototype.slice.call(arguments,1),u,E,B;return F.forEach(function(C){if(typeof C!=="object"||C===null||Array.isArray(C))return;Object.keys(C).forEach(function(Z){if(E=B4(D,Z),u=B4(C,Z),u===D)return;else if(typeof u!=="object"||u===null){D[Z]=u;return}else if(Array.isArray(u)){D[Z]=J4(u);return}else if(C4(u)){D[Z]=Z4(u);return}else if(typeof E!=="object"||E===null||Array.isArray(E)){D[Z]=K1({},u);return}else{D[Z]=K1(E,u);return}})}),D}});var K4=T((aV,Q4)=>{function wY(D,F){var u=D;F.slice(0,-1).forEach(function(B){u=u[B]||{}});var E=F[F.length-1];return E in u}function X4(D){if(typeof D==="number")return!0;if(/^0x[0-9a-f]+$/i.test(D))return!0;return/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(D)}function G4(D,F){return F==="constructor"&&typeof D[F]==="function"||F==="__proto__"}Q4.exports=function(D,F){if(!F)F={};var u={bools:{},strings:{},unknownFn:null};if(typeof F.unknown==="function")u.unknownFn=F.unknown;if(typeof F.boolean==="boolean"&&F.boolean)u.allBools=!0;else[].concat(F.boolean).filter(Boolean).forEach(function(W){u.bools[W]=!0});var E={};function B(W){return E[W].some(function(j){return u.bools[j]})}Object.keys(F.alias||{}).forEach(function(W){E[W]=[].concat(F.alias[W]),E[W].forEach(function(j){E[j]=[W].concat(E[W].filter(function(P){return j!==P}))})}),[].concat(F.string).filter(Boolean).forEach(function(W){if(u.strings[W]=!0,E[W])[].concat(E[W]).forEach(function(j){u.strings[j]=!0})});var C=F.default||{},Z={_:[]};function J(W,j){return u.allBools&&/^--[^=]+$/.test(j)||u.strings[W]||u.bools[W]||E[W]}function X(W,j,P){var L=W;for(var v=0;v<j.length-1;v++){var V=j[v];if(G4(L,V))return;if(L[V]===void 0)L[V]={};if(L[V]===Object.prototype||L[V]===Number.prototype||L[V]===String.prototype)L[V]={};if(L[V]===Array.prototype)L[V]=[];L=L[V]}var _=j[j.length-1];if(G4(L,_))return;if(L===Object.prototype||L===Number.prototype||L===String.prototype)L={};if(L===Array.prototype)L=[];if(L[_]===void 0||u.bools[_]||typeof L[_]==="boolean")L[_]=P;else if(Array.isArray(L[_]))L[_].push(P);else L[_]=[L[_],P]}function H(W,j,P){if(P&&u.unknownFn&&!J(W,P)){if(u.unknownFn(P)===!1)return}var L=!u.strings[W]&&X4(j)?Number(j):j;X(Z,W.split("."),L),(E[W]||[]).forEach(function(v){X(Z,v.split("."),L)})}Object.keys(u.bools).forEach(function(W){H(W,C[W]===void 0?!1:C[W])});var Y=[];if(D.indexOf("--")!==-1)Y=D.slice(D.indexOf("--")+1),D=D.slice(0,D.indexOf("--"));for(var G=0;G<D.length;G++){var K=D[G],Q,z;if(/^--.+=/.test(K)){var q=K.match(/^--([^=]+)=([\s\S]*)$/);Q=q[1];var U=q[2];if(u.bools[Q])U=U!=="false";H(Q,U,K)}else if(/^--no-.+/.test(K))Q=K.match(/^--no-(.+)/)[1],H(Q,!1,K);else if(/^--.+/.test(K))if(Q=K.match(/^--(.+)/)[1],z=D[G+1],z!==void 0&&!/^(-|--)[^-]/.test(z)&&!u.bools[Q]&&!u.allBools&&(E[Q]?!B(Q):!0))H(Q,z,K),G+=1;else if(/^(true|false)$/.test(z))H(Q,z==="true",K),G+=1;else H(Q,u.strings[Q]?"":!0,K);else if(/^-[^-]+/.test(K)){var N=K.slice(1,-1).split(""),M=!1;for(var $=0;$<N.length;$++){if(z=K.slice($+2),z==="-"){H(N[$],z,K);continue}if(/[A-Za-z]/.test(N[$])&&z[0]==="="){H(N[$],z.slice(1),K),M=!0;break}if(/[A-Za-z]/.test(N[$])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(z)){H(N[$],z,K),M=!0;break}if(N[$+1]&&N[$+1].match(/\W/)){H(N[$],K.slice($+2),K),M=!0;break}else H(N[$],u.strings[N[$]]?"":!0,K)}if(Q=K.slice(-1)[0],!M&&Q!=="-")if(D[G+1]&&!/^(-|--)[^-]/.test(D[G+1])&&!u.bools[Q]&&(E[Q]?!B(Q):!0))H(Q,D[G+1],K),G+=1;else if(D[G+1]&&/^(true|false)$/.test(D[G+1]))H(Q,D[G+1]==="true",K),G+=1;else H(Q,u.strings[Q]?"":!0,K)}else{if(!u.unknownFn||u.unknownFn(K)!==!1)Z._.push(u.strings._||!X4(K)?K:Number(K));if(F.stopEarly){Z._.push.apply(Z._,D.slice(G+1));break}}}if(Object.keys(C).forEach(function(W){if(!wY(Z,W.split(".")))X(Z,W.split("."),C[W]),(E[W]||[]).forEach(function(j){X(Z,j.split("."),C[W])})}),F["--"])Z["--"]=Y.slice();else Y.forEach(function(W){Z._.push(W)});return Z}});var U4=T((rV,A4)=>{var gF=E4(),YF=p("path").join,xY=Y4(),z4="/etc",q4=process.platform==="win32",mF=q4?process.env.USERPROFILE:process.env.HOME;A4.exports=function(D,F,u,E){if(typeof D!=="string")throw Error("rc(name): name *must* be string");if(!u)u=K4()(process.argv.slice(2));F=(typeof F==="string"?gF.json(F):F)||{},E=E||gF.parse;var B=gF.env(D+"_"),C=[F],Z=[];function J(X){if(Z.indexOf(X)>=0)return;var H=gF.file(X);if(H)C.push(E(H)),Z.push(X)}if(!q4)[YF(z4,D,"config"),YF(z4,D+"rc")].forEach(J);if(mF)[YF(mF,".config",D,"config"),YF(mF,".config",D),YF(mF,"."+D,"config"),YF(mF,"."+D+"rc")].forEach(J);if(J(gF.find("."+D+"rc")),B.config)J(B.config);if(u.config)J(u.config);return xY.apply(null,C.concat([B,u,Z.length?{configs:Z,config:Z[Z.length-1]}:void 0]))}});var $4=T((oV,N4)=>{var U0=p("constants"),kY=process.cwd,o2=null,yY=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!o2)o2=kY.call(process);return o2};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(t2=process.chdir,process.chdir=function(D){o2=null,t2.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,t2)}var t2;N4.exports=bY;function bY(D){if(U0.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))F(D);if(!D.lutimes)u(D);if(D.chown=C(D.chown),D.fchown=C(D.fchown),D.lchown=C(D.lchown),D.chmod=E(D.chmod),D.fchmod=E(D.fchmod),D.lchmod=E(D.lchmod),D.chownSync=Z(D.chownSync),D.fchownSync=Z(D.fchownSync),D.lchownSync=Z(D.lchownSync),D.chmodSync=B(D.chmodSync),D.fchmodSync=B(D.fchmodSync),D.lchmodSync=B(D.lchmodSync),D.stat=J(D.stat),D.fstat=J(D.fstat),D.lstat=J(D.lstat),D.statSync=X(D.statSync),D.fstatSync=X(D.fstatSync),D.lstatSync=X(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(Y,G,K){if(K)process.nextTick(K)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(Y,G,K,Q){if(Q)process.nextTick(Q)},D.lchownSync=function(){};if(yY==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(Y){function G(K,Q,z){var q=Date.now(),U=0;Y(K,Q,function N(M){if(M&&(M.code==="EACCES"||M.code==="EPERM")&&Date.now()-q<60000){if(setTimeout(function(){D.stat(Q,function($,W){if($&&$.code==="ENOENT")Y(K,Q,N);else z(M)})},U),U<100)U+=10;return}if(z)z(M)})}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Y);return G}(D.rename);D.read=typeof D.read!=="function"?D.read:function(Y){function G(K,Q,z,q,U,N){var M;if(N&&typeof N==="function"){var $=0;M=function(W,j,P){if(W&&W.code==="EAGAIN"&&$<10)return $++,Y.call(D,K,Q,z,q,U,M);N.apply(this,arguments)}}return Y.call(D,K,Q,z,q,U,M)}if(Object.setPrototypeOf)Object.setPrototypeOf(G,Y);return G}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(Y){return function(G,K,Q,z,q){var U=0;while(!0)try{return Y.call(D,G,K,Q,z,q)}catch(N){if(N.code==="EAGAIN"&&U<10){U++;continue}throw N}}}(D.readSync);function F(Y){Y.lchmod=function(G,K,Q){Y.open(G,U0.O_WRONLY|U0.O_SYMLINK,K,function(z,q){if(z){if(Q)Q(z);return}Y.fchmod(q,K,function(U){Y.close(q,function(N){if(Q)Q(U||N)})})})},Y.lchmodSync=function(G,K){var Q=Y.openSync(G,U0.O_WRONLY|U0.O_SYMLINK,K),z=!0,q;try{q=Y.fchmodSync(Q,K),z=!1}finally{if(z)try{Y.closeSync(Q)}catch(U){}else Y.closeSync(Q)}return q}}function u(Y){if(U0.hasOwnProperty("O_SYMLINK")&&Y.futimes)Y.lutimes=function(G,K,Q,z){Y.open(G,U0.O_SYMLINK,function(q,U){if(q){if(z)z(q);return}Y.futimes(U,K,Q,function(N){Y.close(U,function(M){if(z)z(N||M)})})})},Y.lutimesSync=function(G,K,Q){var z=Y.openSync(G,U0.O_SYMLINK),q,U=!0;try{q=Y.futimesSync(z,K,Q),U=!1}finally{if(U)try{Y.closeSync(z)}catch(N){}else Y.closeSync(z)}return q};else if(Y.futimes)Y.lutimes=function(G,K,Q,z){if(z)process.nextTick(z)},Y.lutimesSync=function(){}}function E(Y){if(!Y)return Y;return function(G,K,Q){return Y.call(D,G,K,function(z){if(H(z))z=null;if(Q)Q.apply(this,arguments)})}}function B(Y){if(!Y)return Y;return function(G,K){try{return Y.call(D,G,K)}catch(Q){if(!H(Q))throw Q}}}function C(Y){if(!Y)return Y;return function(G,K,Q,z){return Y.call(D,G,K,Q,function(q){if(H(q))q=null;if(z)z.apply(this,arguments)})}}function Z(Y){if(!Y)return Y;return function(G,K,Q){try{return Y.call(D,G,K,Q)}catch(z){if(!H(z))throw z}}}function J(Y){if(!Y)return Y;return function(G,K,Q){if(typeof K==="function")Q=K,K=null;function z(q,U){if(U){if(U.uid<0)U.uid+=4294967296;if(U.gid<0)U.gid+=4294967296}if(Q)Q.apply(this,arguments)}return K?Y.call(D,G,K,z):Y.call(D,G,z)}}function X(Y){if(!Y)return Y;return function(G,K){var Q=K?Y.call(D,G,K):Y.call(D,G);if(Q){if(Q.uid<0)Q.uid+=4294967296;if(Q.gid<0)Q.gid+=4294967296}return Q}}function H(Y){if(!Y)return!0;if(Y.code==="ENOSYS")return!0;var G=!process.getuid||process.getuid()!==0;if(G){if(Y.code==="EINVAL"||Y.code==="EPERM")return!0}return!1}}});var M4=T((tV,I4)=>{var V4=p("stream").Stream;I4.exports=fY;function fY(D){return{ReadStream:F,WriteStream:u};function F(E,B){if(!(this instanceof F))return new F(E,B);V4.call(this);var C=this;this.path=E,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,B=B||{};var Z=Object.keys(B);for(var J=0,X=Z.length;J<X;J++){var H=Z[J];this[H]=B[H]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){C._read()});return}D.open(this.path,this.flags,this.mode,function(Y,G){if(Y){C.emit("error",Y),C.readable=!1;return}C.fd=G,C.emit("open",G),C._read()})}function u(E,B){if(!(this instanceof u))return new u(E,B);V4.call(this),this.path=E,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,B=B||{};var C=Object.keys(B);for(var Z=0,J=C.length;Z<J;Z++){var X=C[Z];this[X]=B[X]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var O4=T((eV,T4)=>{T4.exports=hY;var vY=Object.getPrototypeOf||function(D){return D.__proto__};function hY(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var F={__proto__:vY(D)};else var F=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(u){Object.defineProperty(F,u,Object.getOwnPropertyDescriptor(D,u))}),F}});var R4=T((DI,W1)=>{var ZD=p("fs"),gY=$4(),mY=M4(),dY=O4(),e2=p("util"),qD,F8;if(typeof Symbol==="function"&&typeof Symbol.for==="function")qD=Symbol.for("graceful-fs.queue"),F8=Symbol.for("graceful-fs.previous");else qD="___graceful-fs.queue",F8="___graceful-fs.previous";function cY(){}function L4(D,F){Object.defineProperty(D,qD,{get:function(){return F}})}var k0=cY;if(e2.debuglog)k0=e2.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))k0=function(){var D=e2.format.apply(e2,arguments);D="GFS4: "+D.split(/\n/).join(`
40
+ GFS4: `),console.error(D)};if(!ZD[qD]){if(q1=global[qD]||[],L4(ZD,q1),ZD.close=function(D){function F(u,E){return D.call(ZD,u,function(B){if(!B)_4();if(typeof E==="function")E.apply(this,arguments)})}return Object.defineProperty(F,F8,{value:D}),F}(ZD.close),ZD.closeSync=function(D){function F(u){D.apply(ZD,arguments),_4()}return Object.defineProperty(F,F8,{value:D}),F}(ZD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){k0(ZD[qD]),p("assert").equal(ZD[qD].length,0)})}var q1;if(!global[qD])L4(global,ZD[qD]);W1.exports=A1(dY(ZD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ZD.__patched)W1.exports=A1(ZD),ZD.__patched=!0;function A1(D){gY(D),D.gracefulify=A1,D.createReadStream=j,D.createWriteStream=P;var F=D.readFile;D.readFile=u;function u(V,_,O){if(typeof _==="function")O=_,_=null;return g(V,_,O);function g(w,R,S,b){return F(w,R,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))XF([g,[w,R,S],f,b||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var E=D.writeFile;D.writeFile=B;function B(V,_,O,g){if(typeof O==="function")g=O,O=null;return w(V,_,O,g);function w(R,S,b,f,l){return E(R,S,b,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))XF([w,[R,S,b,f],m,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var C=D.appendFile;if(C)D.appendFile=Z;function Z(V,_,O,g){if(typeof O==="function")g=O,O=null;return w(V,_,O,g);function w(R,S,b,f,l){return C(R,S,b,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))XF([w,[R,S,b,f],m,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=X;function X(V,_,O,g){if(typeof O==="function")g=O,O=0;return w(V,_,O,g);function w(R,S,b,f,l){return J(R,S,b,function(m){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))XF([w,[R,S,b,f],m,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var H=D.readdir;D.readdir=G;var Y=/^v[0-5]\./;function G(V,_,O){if(typeof _==="function")O=_,_=null;var g=Y.test(process.version)?function(S,b,f,l){return H(S,w(S,b,f,l))}:function(S,b,f,l){return H(S,b,w(S,b,f,l))};return g(V,_,O);function w(R,S,b,f){return function(l,m){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))XF([g,[R,S,b],l,f||Date.now(),Date.now()]);else{if(m&&m.sort)m.sort();if(typeof b==="function")b.call(this,l,m)}}}}if(process.version.substr(0,4)==="v0.8"){var K=mY(D);N=K.ReadStream,$=K.WriteStream}var Q=D.ReadStream;if(Q)N.prototype=Object.create(Q.prototype),N.prototype.open=M;var z=D.WriteStream;if(z)$.prototype=Object.create(z.prototype),$.prototype.open=W;Object.defineProperty(D,"ReadStream",{get:function(){return N},set:function(V){N=V},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return $},set:function(V){$=V},enumerable:!0,configurable:!0});var q=N;Object.defineProperty(D,"FileReadStream",{get:function(){return q},set:function(V){q=V},enumerable:!0,configurable:!0});var U=$;Object.defineProperty(D,"FileWriteStream",{get:function(){return U},set:function(V){U=V},enumerable:!0,configurable:!0});function N(V,_){if(this instanceof N)return Q.apply(this,arguments),this;else return N.apply(Object.create(N.prototype),arguments)}function M(){var V=this;v(V.path,V.flags,V.mode,function(_,O){if(_){if(V.autoClose)V.destroy();V.emit("error",_)}else V.fd=O,V.emit("open",O),V.read()})}function $(V,_){if(this instanceof $)return z.apply(this,arguments),this;else return $.apply(Object.create($.prototype),arguments)}function W(){var V=this;v(V.path,V.flags,V.mode,function(_,O){if(_)V.destroy(),V.emit("error",_);else V.fd=O,V.emit("open",O)})}function j(V,_){return new D.ReadStream(V,_)}function P(V,_){return new D.WriteStream(V,_)}var L=D.open;D.open=v;function v(V,_,O,g){if(typeof O==="function")g=O,O=null;return w(V,_,O,g);function w(R,S,b,f,l){return L(R,S,b,function(m,I3){if(m&&(m.code==="EMFILE"||m.code==="ENFILE"))XF([w,[R,S,b,f],m,l||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}return D}function XF(D){k0("ENQUEUE",D[0].name,D[1]),ZD[qD].push(D),U1()}var D8;function _4(){var D=Date.now();for(var F=0;F<ZD[qD].length;++F)if(ZD[qD][F].length>2)ZD[qD][F][3]=D,ZD[qD][F][4]=D;U1()}function U1(){if(clearTimeout(D8),D8=void 0,ZD[qD].length===0)return;var D=ZD[qD].shift(),F=D[0],u=D[1],E=D[2],B=D[3],C=D[4];if(B===void 0)k0("RETRY",F.name,u),F.apply(null,u);else if(Date.now()-B>=60000){k0("TIMEOUT",F.name,u);var Z=u.pop();if(typeof Z==="function")Z.call(null,E)}else{var J=Date.now()-C,X=Math.max(C-B,1),H=Math.min(X*1.2,100);if(J>=H)k0("RETRY",F.name,u),F.apply(null,u.concat([B]));else ZD[qD].push(D)}if(D8===void 0)D8=setTimeout(U1,0)}});var j4=T((GF)=>{var lY=GF&&GF.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(GF,"__esModule",{value:!0});GF.readCAFileSync=void 0;var pY=lY(R4());function iY(D){try{let F=pY.default.readFileSync(D,"utf8"),u="-----END CERTIFICATE-----";return F.split("-----END CERTIFICATE-----").filter((B)=>Boolean(B.trim())).map((B)=>`${B.trimLeft()}-----END CERTIFICATE-----`)}catch(F){if(F.code==="ENOENT")return;throw F}}GF.readCAFileSync=iY});var S4=T((y0)=>{var nY=y0&&y0.__createBinding||(Object.create?function(D,F,u,E){if(E===void 0)E=u;var B=Object.getOwnPropertyDescriptor(F,u);if(!B||("get"in B?!F.__esModule:B.writable||B.configurable))B={enumerable:!0,get:function(){return F[u]}};Object.defineProperty(D,E,B)}:function(D,F,u,E){if(E===void 0)E=u;D[E]=F[u]}),aY=y0&&y0.__exportStar||function(D,F){for(var u in D)if(u!=="default"&&!Object.prototype.hasOwnProperty.call(F,u))nY(F,D,u)};Object.defineProperty(y0,"__esModule",{value:!0});aY(j4(),y0)});var x4=T((EI,w4)=>{w4.exports=P4;function b0(D,F){if(typeof Object.setPrototypeOf==="function")return Object.setPrototypeOf(D,F);else D.__proto__=F}function P4(){this.list=[];var D=null;Object.defineProperty(this,"root",{get:function(){return D},set:function(F){if(D=F,this.list.length)b0(this.list[this.list.length-1],F)},enumerable:!0,configurable:!0})}P4.prototype={get length(){return this.list.length},get keys(){var D=[];for(var F in this.list[0])D.push(F);return D},get snapshot(){var D={};return this.keys.forEach(function(F){D[F]=this.get(F)},this),D},get store(){return this.list[0]},push:function(D){if(typeof D!=="object")D={valueOf:D};if(this.list.length>=1)b0(this.list[this.list.length-1],D);return b0(D,this.root),this.list.push(D)},pop:function(){if(this.list.length>=2)b0(this.list[this.list.length-2],this.root);return this.list.pop()},unshift:function(D){return b0(D,this.list[0]||this.root),this.list.unshift(D)},shift:function(){if(this.list.length===1)b0(this.list[0],this.root);return this.list.shift()},get:function(D){return this.list[0][D]},set:function(D,F,u){if(!this.length)this.push({});if(u&&this.list[0].hasOwnProperty(D))this.push({});return this.list[0][D]=F},forEach:function(D,F){for(var u in this.list[0])D.call(F,u,this.list[0][u])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){var D=this.list.splice.apply(this.list,arguments);for(var F=0,u=this.list.length;F<u;F++)b0(this.list[F],this.list[F+1]||this.root);return D}}});var f4=T((sY)=>{sY.parse=sY.decode=rY;sY.stringify=sY.encode=k4;sY.safe=QF;sY.unsafe=u8;var N1=typeof process<"u"&&process.platform==="win32"?`\r
41
41
  `:`
42
- `;function L4(D,F){var u=[],E="";if(typeof F==="string")F={section:F,whitespace:!1};else F=F||{},F.whitespace=F.whitespace===!0;var B=F.whitespace?" = ":"=";if(Object.keys(D).forEach(function(C,Z,J){var X=D[C];if(X&&Array.isArray(X))X.forEach(function(H){E+=GF(C+"[]")+B+GF(H)+`
43
- `});else if(X&&typeof X==="object")u.push(C);else E+=GF(C)+B+GF(X)+G3}),F.section&&E.length)E="["+GF(F.section)+"]"+G3+E;return u.forEach(function(C,Z,J){var X=R4(C).join("\\."),H=(F.section?F.section+".":"")+X,Y=L4(D[C],{section:H,whitespace:F.whitespace});if(E.length&&Y.length)E+=G3;E+=Y}),E}function R4(D){return D.replace(/\1/g,"\x02LITERAL\\1LITERAL\x02").replace(/\\\./g,"\x01").split(/\./).map(function(F){return F.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"\x01")})}function lY(D){var F={},u=F,E=null,B=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,C=D.split(/[\r\n]+/g);return C.forEach(function(Z,J,X){if(!Z||Z.match(/^\s*[;#]/))return;var H=Z.match(B);if(!H)return;if(H[1]!==void 0){if(E=D8(H[1]),E==="__proto__"){u={};return}u=F[E]=F[E]||{};return}var Y=D8(H[2]);if(Y==="__proto__")return;var G=H[3]?D8(H[4]):!0;switch(G){case"true":case"false":case"null":G=JSON.parse(G)}if(Y.length>2&&Y.slice(-2)==="[]"){if(Y=Y.substring(0,Y.length-2),Y==="__proto__")return;if(!u[Y])u[Y]=[];else if(!Array.isArray(u[Y]))u[Y]=[u[Y]]}if(Array.isArray(u[Y]))u[Y].push(G);else u[Y]=G}),Object.keys(F).filter(function(Z,J,X){if(!F[Z]||typeof F[Z]!=="object"||Array.isArray(F[Z]))return!1;var H=R4(Z),Y=F,G=H.pop(),K=G.replace(/\\\./g,".");if(H.forEach(function(Q,z,q){if(Q==="__proto__")return;if(!Y[Q]||typeof Y[Q]!=="object")Y[Q]={};Y=Y[Q]}),Y===F&&K===G)return!1;return Y[K]=F[Z],!0}).forEach(function(Z,J,X){delete F[Z]}),F}function j4(D){return D.charAt(0)==='"'&&D.slice(-1)==='"'||D.charAt(0)==="'"&&D.slice(-1)==="'"}function GF(D){return typeof D!=="string"||D.match(/[=\r\n]/)||D.match(/^\[/)||D.length>1&&j4(D)||D!==D.trim()?JSON.stringify(D):D.replace(/;/g,"\\;").replace(/#/g,"\\#")}function D8(D,F){if(D=(D||"").trim(),j4(D)){if(D.charAt(0)==="'")D=D.substr(1,D.length-2);try{D=JSON.parse(D)}catch(J){}}else{var u=!1,E="";for(var B=0,C=D.length;B<C;B++){var Z=D.charAt(B);if(u){if("\\;#".indexOf(Z)!==-1)E+=Z;else E+="\\"+Z;u=!1}else if(";#".indexOf(Z)!==-1)break;else if(Z==="\\")u=!0;else E+=Z}if(u)E+="\\";return E.trim()}return D}});var k4=M((H0,x4)=>{var __dirname="/home/runner/work/cli/cli/node_modules/config-chain",P4=O4(),mF=p("path"),F8=p("fs"),Q3=S4(),K3=p("events").EventEmitter,sY=p("url"),oY=p("http"),H0=x4.exports=function(){var D=[].slice.call(arguments),F=new $D;while(D.length){var u=D.shift();if(u)F.push(typeof u==="string"?eY(u):u)}return F},uI=H0.find=function(){var D=mF.join.apply(null,[].slice.call(arguments));function F(u,E){var B=mF.join(u,E);try{return F8.statSync(B),B}catch(C){if(mF.dirname(u)!==u)return F(mF.dirname(u),E)}}return F(__dirname,D)},tY=H0.parse=function(D,F,u){if(D=""+D,!u)try{return JSON.parse(D)}catch(E){return Q3.parse(D)}else if(u==="json")if(this.emit)try{return JSON.parse(D)}catch(E){this.emit("error",E)}else return JSON.parse(D);else return Q3.parse(D)},eY=H0.json=function(){var D=[].slice.call(arguments).filter(function(E){return E!=null}),F=mF.join.apply(null,D),u;try{u=F8.readFileSync(F,"utf-8")}catch(E){return}return tY(u,F,"json")},EI=H0.env=function(D,F){F=F||process.env;var u={},E=D.length;for(var B in F)if(B.indexOf(D)===0)u[B.substring(E)]=F[B];return u};H0.ConfigChain=$D;function $D(){K3.apply(this),P4.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var w4={constructor:{value:$D}};Object.keys(K3.prototype).forEach(function(D){w4[D]=Object.getOwnPropertyDescriptor(K3.prototype,D)});$D.prototype=Object.create(P4.prototype,w4);$D.prototype.del=function(D,F){if(F){var u=this.sources[F];if(u=u&&u.data,!u)return this.emit("error",Error("not found "+F));delete u[D]}else for(var E=0,B=this.list.length;E<B;E++)delete this.list[E][D];return this};$D.prototype.set=function(D,F,u){var E;if(u){if(E=this.sources[u],E=E&&E.data,!E)return this.emit("error",Error("not found "+u))}else if(E=this.list[0],!E)return this.emit("error",Error("cannot set, no confs!"));return E[D]=F,this};$D.prototype.get=function(D,F){if(F){if(F=this.sources[F],F)F=F.data;if(F&&Object.hasOwnProperty.call(F,D))return F[D];return}return this.list[0][D]};$D.prototype.save=function(D,C,u){if(typeof C==="function")u=C,C=null;var E=this.sources[D];if(!E||!(E.path||E.source)||!E.data)return this.emit("error",Error("bad save target: "+D));if(E.source){var B=E.prefix||"";return Object.keys(E.data).forEach(function(J){E.source[B+J]=E.data[J]}),this}var C=C||E.type,Z=E.data;if(E.type==="json")Z=JSON.stringify(Z);else Z=Q3.stringify(Z);return this._saving++,F8.writeFile(E.path,Z,"utf8",function(J){if(this._saving--,J)if(u)return u(J);else return this.emit("error",J);if(this._saving===0){if(u)u();this.emit("save")}}.bind(this)),this};$D.prototype.addFile=function(D,F,u){u=u||D;var E={__source__:u};return this.sources[u]={path:D,type:F},this.push(E),this._await(),F8.readFile(D,"utf8",function(B,C){if(B)this.emit("error",B);this.addString(C,D,F,E)}.bind(this)),this};$D.prototype.addEnv=function(D,F,u){u=u||"env";var E=H0.env(D,F);return this.sources[u]={data:E,source:F,prefix:D},this.add(E,u)};$D.prototype.addUrl=function(D,F,u){this._await();var E=sY.format(D);u=u||E;var B={__source__:u};return this.sources[u]={href:E,type:F},this.push(B),oY.request(D,function(C){var Z=[],J=C.headers["content-type"];if(!F)F=J.indexOf("json")!==-1?"json":J.indexOf("ini")!==-1?"ini":E.match(/\.json$/)?"json":E.match(/\.ini$/)?"ini":null,B.type=F;C.on("data",Z.push.bind(Z)).on("end",function(){this.addString(Buffer.concat(Z),E,F,B)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};$D.prototype.addString=function(D,F,u,E){return D=this.parse(D,F,u),this.add(D,E),this};$D.prototype.add=function(D,F){if(F&&typeof F==="object"){var u=this.list.indexOf(F);if(u===-1)return this.emit("error",Error("bad marker"));this.splice(u,1,D),F=F.__source__,this.sources[F]=this.sources[F]||{},this.sources[F].data=D,this._resolve()}else{if(typeof F==="string")this.sources[F]=this.sources[F]||{},this.sources[F].data=D;this._await(),this.push(D),process.nextTick(this._resolve.bind(this))}return this};$D.prototype.parse=H0.parse;$D.prototype._await=function(){this._awaiting++};$D.prototype._resolve=function(){if(this._awaiting--,this._awaiting===0)this.emit("load",this)}});var f4=M((BI,b4)=>{b4.exports=function(D){let F=D.indexOf(":");if(F===-1)return y4(D);let u=D.substr(0,F),E=D.substr(F+1);return`${u}:${y4(E)}`};function y4(D){if(D=D.toLowerCase(),D==="_authtoken")return"_authToken";let F=D[0];for(let u=1;u<D.length;u++)F+=D[u]==="_"?"-":D[u];return F}});var g4=M((v4)=>{Object.defineProperty(v4,"__esModule",{value:!0});v4.envReplace=void 0;var DX=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function FX(D,F){return D.replace(DX,uX.bind(null,F))}v4.envReplace=FX;function uX(D,F,u,E){if(u.length%2)return F.slice((u.length+1)/2);let B=BX(D,E);if(B===void 0)throw Error(`Failed to replace env in config: ${F}`);return`${u.slice(u.length/2)}${B}`}var EX=/([^:-]+)(:?)-(.+)/;function BX(D,F){let u=F.match(EX);if(!u)return D[F];let[,E,B,C]=u;if(Object.prototype.hasOwnProperty.call(D,E))return!D[E]&&B?C:D[E];return C}});var m4=M((z3)=>{Object.defineProperty(z3,"__esModule",{value:!0});z3.envReplace=void 0;var CX=g4();Object.defineProperty(z3,"envReplace",{enumerable:!0,get:function(){return CX.envReplace}})});var d4=M((GX)=>{var JX=p("fs"),b0=p("path"),{envReplace:q3}=m4(),HX=(D)=>{if(typeof D!=="string")return D;return q3(D,process.env)},YX=(D,F,u)=>{if(typeof F!=="string")return F;let E=[].concat(D[u]),B=E.indexOf(b0)!==-1,C=E.indexOf(Boolean)!==-1,Z=E.indexOf(String)!==-1,J=E.indexOf(Number)!==-1;if(F=`${F}`.trim(),/^".*"$/.test(F))try{F=JSON.parse(F)}catch(H){throw Error(`Failed parsing JSON config key ${u}: ${F}`)}if(C&&!Z&&F==="")return!0;switch(F){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}let X=q3(F,process.env);if((u.endsWith(":tokenHelper")||u==="tokenHelper")&&X!==F)throw Error(`It is not allowed to use environment variables in the value of the ${u} setting.`);else F=X;if(B){if((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(F)&&process.env.HOME)F=b0.resolve(process.env.HOME,F.substr(2));F=b0.resolve(F)}if(J&&!isNaN(F))F=Number(F);return F},XX=(D)=>{D=b0.resolve(D);let F=!1;while(b0.basename(D)==="node_modules")D=b0.dirname(D),F=!0;if(F)return D;let u=(E,B)=>{let C=/^[a-zA-Z]:(\\|\/)?$/;if(E==="/"||process.platform==="win32"&&C.test(E))return B;try{let Z=JX.readdirSync(E);if(Z.includes("node_modules")||Z.includes("package.json")||Z.includes("package.json5")||Z.includes("package.yaml")||Z.includes("pnpm-workspace.yaml"))return E;let J=b0.dirname(E);if(J===E)return B;return u(J,B)}catch(Z){if(E===B){if(Z.code==="ENOENT")return B;throw Z}return B}};return u(D,D)};GX.envReplace=q3;GX.findPrefix=XX;GX.parseField=YX;GX.parseKey=HX});var l4=M((NX)=>{var f0=p("path"),AX=p("stream").Stream,u8=p("url"),UX=()=>{},WX=()=>[],c4=()=>{};NX.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:f0,cache:f0,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:f0,"global-style":Boolean,group:[Number,String],"https-proxy":[null,u8],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":f0,"init-author-name":String,"init-author-email":String,"init-author-url":["",u8],"init-license":String,"init-version":c4,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":WX(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:AX,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,c4],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:f0,production:Boolean,progress:Boolean,proxy:[null,!1,u8],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,u8],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:f0,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:f0,umask:UX,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var a4=M((YI,n4)=>{var{readCAFileSync:VX}=M4(),p4=p("fs"),A3=p("path"),{ConfigChain:IX}=k4(),MX=f4(),U3=d4();class i4 extends IX{constructor(D,F){super(D);this.root=D,this._parseField=U3.parseField.bind(null,F||l4())}add(D,F){try{for(let[u,E]of Object.entries(D)){let B=U3.parseKey(u);if(B!==u)delete D[u];D[B]=this._parseField(E,B)}}catch(u){throw u}return super.add(D,F)}addFile(D,F){F=F||D;let u={__source__:F};this.sources[F]={path:D,type:"ini"},this.push(u),this._await();try{let E=p4.readFileSync(D,"utf8");this.addString(E,D,"ini",u)}catch(E){if(E.code==="ENOENT")this.add({},u);else if(E.code!=="EISDIR")return`Issue while reading "${D}". ${E.message}`}}addEnv(D){D=D||process.env;let F={};return Object.keys(D).filter((u)=>/^npm_config_/i.test(u)).forEach((u)=>{if(!D[u])return;let E=MX(u.substr(11)),B=D[u];F[E]=TX(E,B)}),super.addEnv("",F,"env")}loadPrefix(){let D=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:(u)=>{let E=this.get("global");this[E?"globalPrefix":"localPrefix"]=u},get:()=>{return this.get("global")?this.globalPrefix:this.localPrefix}}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:(u)=>{this.set("prefix",u)},get:()=>{return A3.resolve(this.get("prefix"))}});let F;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:(u)=>{F=u},get:()=>{return F}}),Object.prototype.hasOwnProperty.call(D,"prefix"))F=A3.resolve(D.prefix);else try{F=U3.findPrefix(process.cwd())}catch(u){throw u}return F}loadCAFile(D){if(!D)return;let F=VX(D);if(F)this.set("ca",F)}loadUser(){let D=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){D.user=Number(process.env.SUDO_UID);return}let F=A3.resolve(this.get("prefix"));try{let u=p4.statSync(F);D.user=u.uid}catch(u){if(u.code==="ENOENT")return;throw u}}}function TX(D,F){function u(E){if(E.indexOf(`
42
+ `;function k4(D,F){var u=[],E="";if(typeof F==="string")F={section:F,whitespace:!1};else F=F||{},F.whitespace=F.whitespace===!0;var B=F.whitespace?" = ":"=";if(Object.keys(D).forEach(function(C,Z,J){var X=D[C];if(X&&Array.isArray(X))X.forEach(function(H){E+=QF(C+"[]")+B+QF(H)+`
43
+ `});else if(X&&typeof X==="object")u.push(C);else E+=QF(C)+B+QF(X)+N1}),F.section&&E.length)E="["+QF(F.section)+"]"+N1+E;return u.forEach(function(C,Z,J){var X=y4(C).join("\\."),H=(F.section?F.section+".":"")+X,Y=k4(D[C],{section:H,whitespace:F.whitespace});if(E.length&&Y.length)E+=N1;E+=Y}),E}function y4(D){return D.replace(/\1/g,"\x02LITERAL\\1LITERAL\x02").replace(/\\\./g,"\x01").split(/\./).map(function(F){return F.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"\x01")})}function rY(D){var F={},u=F,E=null,B=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,C=D.split(/[\r\n]+/g);return C.forEach(function(Z,J,X){if(!Z||Z.match(/^\s*[;#]/))return;var H=Z.match(B);if(!H)return;if(H[1]!==void 0){if(E=u8(H[1]),E==="__proto__"){u={};return}u=F[E]=F[E]||{};return}var Y=u8(H[2]);if(Y==="__proto__")return;var G=H[3]?u8(H[4]):!0;switch(G){case"true":case"false":case"null":G=JSON.parse(G)}if(Y.length>2&&Y.slice(-2)==="[]"){if(Y=Y.substring(0,Y.length-2),Y==="__proto__")return;if(!u[Y])u[Y]=[];else if(!Array.isArray(u[Y]))u[Y]=[u[Y]]}if(Array.isArray(u[Y]))u[Y].push(G);else u[Y]=G}),Object.keys(F).filter(function(Z,J,X){if(!F[Z]||typeof F[Z]!=="object"||Array.isArray(F[Z]))return!1;var H=y4(Z),Y=F,G=H.pop(),K=G.replace(/\\\./g,".");if(H.forEach(function(Q,z,q){if(Q==="__proto__")return;if(!Y[Q]||typeof Y[Q]!=="object")Y[Q]={};Y=Y[Q]}),Y===F&&K===G)return!1;return Y[K]=F[Z],!0}).forEach(function(Z,J,X){delete F[Z]}),F}function b4(D){return D.charAt(0)==='"'&&D.slice(-1)==='"'||D.charAt(0)==="'"&&D.slice(-1)==="'"}function QF(D){return typeof D!=="string"||D.match(/[=\r\n]/)||D.match(/^\[/)||D.length>1&&b4(D)||D!==D.trim()?JSON.stringify(D):D.replace(/;/g,"\\;").replace(/#/g,"\\#")}function u8(D,F){if(D=(D||"").trim(),b4(D)){if(D.charAt(0)==="'")D=D.substr(1,D.length-2);try{D=JSON.parse(D)}catch(J){}}else{var u=!1,E="";for(var B=0,C=D.length;B<C;B++){var Z=D.charAt(B);if(u){if("\\;#".indexOf(Z)!==-1)E+=Z;else E+="\\"+Z;u=!1}else if(";#".indexOf(Z)!==-1)break;else if(Z==="\\")u=!0;else E+=Z}if(u)E+="\\";return E.trim()}return D}});var m4=T((H0,g4)=>{var __dirname="/home/runner/work/cli/cli/node_modules/config-chain",v4=x4(),dF=p("path"),E8=p("fs"),$1=f4(),V1=p("events").EventEmitter,FX=p("url"),uX=p("http"),H0=g4.exports=function(){var D=[].slice.call(arguments),F=new VD;while(D.length){var u=D.shift();if(u)F.push(typeof u==="string"?BX(u):u)}return F},JI=H0.find=function(){var D=dF.join.apply(null,[].slice.call(arguments));function F(u,E){var B=dF.join(u,E);try{return E8.statSync(B),B}catch(C){if(dF.dirname(u)!==u)return F(dF.dirname(u),E)}}return F(__dirname,D)},EX=H0.parse=function(D,F,u){if(D=""+D,!u)try{return JSON.parse(D)}catch(E){return $1.parse(D)}else if(u==="json")if(this.emit)try{return JSON.parse(D)}catch(E){this.emit("error",E)}else return JSON.parse(D);else return $1.parse(D)},BX=H0.json=function(){var D=[].slice.call(arguments).filter(function(E){return E!=null}),F=dF.join.apply(null,D),u;try{u=E8.readFileSync(F,"utf-8")}catch(E){return}return EX(u,F,"json")},HI=H0.env=function(D,F){F=F||process.env;var u={},E=D.length;for(var B in F)if(B.indexOf(D)===0)u[B.substring(E)]=F[B];return u};H0.ConfigChain=VD;function VD(){V1.apply(this),v4.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var h4={constructor:{value:VD}};Object.keys(V1.prototype).forEach(function(D){h4[D]=Object.getOwnPropertyDescriptor(V1.prototype,D)});VD.prototype=Object.create(v4.prototype,h4);VD.prototype.del=function(D,F){if(F){var u=this.sources[F];if(u=u&&u.data,!u)return this.emit("error",Error("not found "+F));delete u[D]}else for(var E=0,B=this.list.length;E<B;E++)delete this.list[E][D];return this};VD.prototype.set=function(D,F,u){var E;if(u){if(E=this.sources[u],E=E&&E.data,!E)return this.emit("error",Error("not found "+u))}else if(E=this.list[0],!E)return this.emit("error",Error("cannot set, no confs!"));return E[D]=F,this};VD.prototype.get=function(D,F){if(F){if(F=this.sources[F],F)F=F.data;if(F&&Object.hasOwnProperty.call(F,D))return F[D];return}return this.list[0][D]};VD.prototype.save=function(D,C,u){if(typeof C==="function")u=C,C=null;var E=this.sources[D];if(!E||!(E.path||E.source)||!E.data)return this.emit("error",Error("bad save target: "+D));if(E.source){var B=E.prefix||"";return Object.keys(E.data).forEach(function(J){E.source[B+J]=E.data[J]}),this}var C=C||E.type,Z=E.data;if(E.type==="json")Z=JSON.stringify(Z);else Z=$1.stringify(Z);return this._saving++,E8.writeFile(E.path,Z,"utf8",function(J){if(this._saving--,J)if(u)return u(J);else return this.emit("error",J);if(this._saving===0){if(u)u();this.emit("save")}}.bind(this)),this};VD.prototype.addFile=function(D,F,u){u=u||D;var E={__source__:u};return this.sources[u]={path:D,type:F},this.push(E),this._await(),E8.readFile(D,"utf8",function(B,C){if(B)this.emit("error",B);this.addString(C,D,F,E)}.bind(this)),this};VD.prototype.addEnv=function(D,F,u){u=u||"env";var E=H0.env(D,F);return this.sources[u]={data:E,source:F,prefix:D},this.add(E,u)};VD.prototype.addUrl=function(D,F,u){this._await();var E=FX.format(D);u=u||E;var B={__source__:u};return this.sources[u]={href:E,type:F},this.push(B),uX.request(D,function(C){var Z=[],J=C.headers["content-type"];if(!F)F=J.indexOf("json")!==-1?"json":J.indexOf("ini")!==-1?"ini":E.match(/\.json$/)?"json":E.match(/\.ini$/)?"ini":null,B.type=F;C.on("data",Z.push.bind(Z)).on("end",function(){this.addString(Buffer.concat(Z),E,F,B)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};VD.prototype.addString=function(D,F,u,E){return D=this.parse(D,F,u),this.add(D,E),this};VD.prototype.add=function(D,F){if(F&&typeof F==="object"){var u=this.list.indexOf(F);if(u===-1)return this.emit("error",Error("bad marker"));this.splice(u,1,D),F=F.__source__,this.sources[F]=this.sources[F]||{},this.sources[F].data=D,this._resolve()}else{if(typeof F==="string")this.sources[F]=this.sources[F]||{},this.sources[F].data=D;this._await(),this.push(D),process.nextTick(this._resolve.bind(this))}return this};VD.prototype.parse=H0.parse;VD.prototype._await=function(){this._awaiting++};VD.prototype._resolve=function(){if(this._awaiting--,this._awaiting===0)this.emit("load",this)}});var l4=T((YI,c4)=>{c4.exports=function(D){let F=D.indexOf(":");if(F===-1)return d4(D);let u=D.substr(0,F),E=D.substr(F+1);return`${u}:${d4(E)}`};function d4(D){if(D=D.toLowerCase(),D==="_authtoken")return"_authToken";let F=D[0];for(let u=1;u<D.length;u++)F+=D[u]==="_"?"-":D[u];return F}});var n4=T((p4)=>{Object.defineProperty(p4,"__esModule",{value:!0});p4.envReplace=void 0;var CX=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function ZX(D,F){return D.replace(CX,JX.bind(null,F))}p4.envReplace=ZX;function JX(D,F,u,E){if(u.length%2)return F.slice((u.length+1)/2);let B=YX(D,E);if(B===void 0)throw Error(`Failed to replace env in config: ${F}`);return`${u.slice(u.length/2)}${B}`}var HX=/([^:-]+)(:?)-(.+)/;function YX(D,F){let u=F.match(HX);if(!u)return D[F];let[,E,B,C]=u;if(Object.prototype.hasOwnProperty.call(D,E))return!D[E]&&B?C:D[E];return C}});var a4=T((I1)=>{Object.defineProperty(I1,"__esModule",{value:!0});I1.envReplace=void 0;var XX=n4();Object.defineProperty(I1,"envReplace",{enumerable:!0,get:function(){return XX.envReplace}})});var r4=T((AX)=>{var QX=p("fs"),f0=p("path"),{envReplace:M1}=a4(),KX=(D)=>{if(typeof D!=="string")return D;return M1(D,process.env)},zX=(D,F,u)=>{if(typeof F!=="string")return F;let E=[].concat(D[u]),B=E.indexOf(f0)!==-1,C=E.indexOf(Boolean)!==-1,Z=E.indexOf(String)!==-1,J=E.indexOf(Number)!==-1;if(F=`${F}`.trim(),/^".*"$/.test(F))try{F=JSON.parse(F)}catch(H){throw Error(`Failed parsing JSON config key ${u}: ${F}`)}if(C&&!Z&&F==="")return!0;switch(F){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}let X=M1(F,process.env);if((u.endsWith(":tokenHelper")||u==="tokenHelper")&&X!==F)throw Error(`It is not allowed to use environment variables in the value of the ${u} setting.`);else F=X;if(B){if((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(F)&&process.env.HOME)F=f0.resolve(process.env.HOME,F.substr(2));F=f0.resolve(F)}if(J&&!isNaN(F))F=Number(F);return F},qX=(D)=>{D=f0.resolve(D);let F=!1;while(f0.basename(D)==="node_modules")D=f0.dirname(D),F=!0;if(F)return D;let u=(E,B)=>{let C=/^[a-zA-Z]:(\\|\/)?$/;if(E==="/"||process.platform==="win32"&&C.test(E))return B;try{let Z=QX.readdirSync(E);if(Z.includes("node_modules")||Z.includes("package.json")||Z.includes("package.json5")||Z.includes("package.yaml")||Z.includes("pnpm-workspace.yaml"))return E;let J=f0.dirname(E);if(J===E)return B;return u(J,B)}catch(Z){if(E===B){if(Z.code==="ENOENT")return B;throw Z}return B}};return u(D,D)};AX.envReplace=M1;AX.findPrefix=qX;AX.parseField=zX;AX.parseKey=KX});var o4=T((TX)=>{var v0=p("path"),VX=p("stream").Stream,B8=p("url"),IX=()=>{},MX=()=>[],s4=()=>{};TX.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:v0,cache:v0,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:v0,"global-style":Boolean,group:[Number,String],"https-proxy":[null,B8],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":v0,"init-author-name":String,"init-author-email":String,"init-author-url":["",B8],"init-license":String,"init-version":s4,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":MX(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:VX,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,s4],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:v0,production:Boolean,progress:Boolean,proxy:[null,!1,B8],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,B8],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:v0,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:v0,umask:IX,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var F5=T((zI,D5)=>{var{readCAFileSync:_X}=S4(),t4=p("fs"),T1=p("path"),{ConfigChain:LX}=m4(),RX=l4(),O1=r4();class e4 extends LX{constructor(D,F){super(D);this.root=D,this._parseField=O1.parseField.bind(null,F||o4())}add(D,F){try{for(let[u,E]of Object.entries(D)){let B=O1.parseKey(u);if(B!==u)delete D[u];D[B]=this._parseField(E,B)}}catch(u){throw u}return super.add(D,F)}addFile(D,F){F=F||D;let u={__source__:F};this.sources[F]={path:D,type:"ini"},this.push(u),this._await();try{let E=t4.readFileSync(D,"utf8");this.addString(E,D,"ini",u)}catch(E){if(E.code==="ENOENT")this.add({},u);else if(E.code!=="EISDIR")return`Issue while reading "${D}". ${E.message}`}}addEnv(D){D=D||process.env;let F={};return Object.keys(D).filter((u)=>/^npm_config_/i.test(u)).forEach((u)=>{if(!D[u])return;let E=RX(u.substr(11)),B=D[u];F[E]=jX(E,B)}),super.addEnv("",F,"env")}loadPrefix(){let D=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:(u)=>{let E=this.get("global");this[E?"globalPrefix":"localPrefix"]=u},get:()=>{return this.get("global")?this.globalPrefix:this.localPrefix}}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:(u)=>{this.set("prefix",u)},get:()=>{return T1.resolve(this.get("prefix"))}});let F;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:(u)=>{F=u},get:()=>{return F}}),Object.prototype.hasOwnProperty.call(D,"prefix"))F=T1.resolve(D.prefix);else try{F=O1.findPrefix(process.cwd())}catch(u){throw u}return F}loadCAFile(D){if(!D)return;let F=_X(D);if(F)this.set("ca",F)}loadUser(){let D=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){D.user=Number(process.env.SUDO_UID);return}let F=T1.resolve(this.get("prefix"));try{let u=t4.statSync(F);D.user=u.uid}catch(u){if(u.code==="ENOENT")return;throw u}}}function jX(D,F){function u(E){if(E.indexOf(`
44
44
 
45
45
  `))return E.split(`
46
46
 
47
- `);return E.split(",")}switch(D){case"hoist-pattern":case"public-hoist-pattern":return u(F)}return F}n4.exports=i4});var D5=M((e4)=>{var o4=p("os"),Y0=p("path"),t4=o4.tmpdir(),_X=process.getuid?process.getuid():process.pid,OX=()=>!0,r4=process.platform==="win32",s4={editor:()=>process.env.EDITOR||process.env.VISUAL||(r4?"notepad.exe":"vi"),shell:()=>r4?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},LX={fromString:()=>process.umask()},QF=o4.homedir();if(QF)process.env.HOME=QF;else QF=Y0.resolve(t4,"npm-"+_X);var RX=process.platform==="win32"?"npm-cache":".npm",jX=process.platform==="win32"&&process.env.APPDATA||QF,SX=Y0.resolve(jX,RX),E8,v0;Object.defineProperty(e4,"defaults",{get:function(){if(E8)return E8;if(process.env.PREFIX)v0=process.env.PREFIX;else if(process.platform==="win32")v0=Y0.dirname(process.execPath);else if(v0=Y0.dirname(Y0.dirname(process.execPath)),process.env.DESTDIR)v0=Y0.join(process.env.DESTDIR,v0);return E8={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:SX,"cache-lock-stale":60000,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:s4.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":60000,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Y0.resolve(v0,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Y0.resolve(QF,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:v0,production:!1,progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:s4.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:t4,unicode:OX(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Y0.resolve(QF,".npmrc"),umask:process.umask?process.umask():LX.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},E8}})});var u5=M((GI,W3)=>{var h0=p("path"),PX=a4(),F5=D5();W3.exports=(D,F,u)=>{let E=new PX(Object.assign({},F5.defaults,u),F);E.add(Object.assign({},D),"cli");let B=[],C=!1;if(p.resolve.paths){let H=p.resolve.paths("npm"),Y;try{Y=p.resolve("npm",{paths:H.slice(-1)})}catch(G){C=!0}if(Y)B.push(E.addFile(h0.resolve(h0.dirname(Y),"..","npmrc"),"builtin"))}E.addEnv(),E.loadPrefix();let Z=h0.resolve(E.localPrefix,".npmrc"),J=E.get("userconfig");if(!E.get("global")&&Z!==J)B.push(E.addFile(Z,"project"));else E.add({},"project");if(E.get("workspace-prefix")&&E.get("workspace-prefix")!==Z){let H=h0.resolve(E.get("workspace-prefix"),".npmrc");B.push(E.addFile(H,"workspace"))}if(B.push(E.addFile(E.get("userconfig"),"user")),E.get("prefix")){let H=h0.resolve(E.get("prefix"),"etc");E.root.globalconfig=h0.resolve(H,"npmrc"),E.root.globalignorefile=h0.resolve(H,"npmignore")}B.push(E.addFile(E.get("globalconfig"),"global")),E.loadUser();let X=E.get("cafile");if(X)E.loadCAFile(X);return{config:E,warnings:B.filter(Boolean),failedToLoadBuiltInConfig:C}};Object.defineProperty(W3.exports,"defaults",{get(){return F5.defaults},enumerable:!0})});var Z5=M((KI,C5)=>{var E5=u5();C5.exports=function(){let F,u;if(arguments.length>=2)F=arguments[0],u=Object.assign({},arguments[1]);else if(typeof arguments[0]==="string")F=arguments[0];else u=Object.assign({},arguments[0]);u=u||{};let E=u.npmrc;return u.npmrc=(u.npmrc?{config:{get:(B)=>E[B]}}:E5()).config,F=F||u.npmrc.get("registry")||E5.defaults.registry,B5(F,u)||xX(u.npmrc)};function wX(D,F){let u=new URL(F,new URL(D.startsWith("//")?`./${D}`:D,"resolve://"));if(u.protocol==="resolve:"){let{pathname:E,search:B,hash:C}=u;return E+B+C}return u.toString()}function B5(D,F){let u=D instanceof URL?D:new URL(D.startsWith("//")?`http:${D}`:D),E;while(E!=="/"&&u.pathname!==E){E=u.pathname||"/";let B="//"+u.host+E.replace(/\/$/,""),C=yX(B,F.npmrc);if(C)return C;if(!F.recursive)return/\/$/.test(D)?void 0:B5(new URL("./",u),F);u.pathname=wX(kX(E),"..")||"/"}return}function xX(D){if(!D.get("_auth"))return;return{token:B8(D.get("_auth")),type:"Basic"}}function kX(D){return D[D.length-1]==="/"?D:D+"/"}function yX(D,F){let u=bX(F.get(D+":_authToken")||F.get(D+"/:_authToken"));if(u)return u;let E=F.get(D+":username")||F.get(D+"/:username"),B=F.get(D+":_password")||F.get(D+"/:_password"),C=fX(E,B);if(C)return C;let Z=vX(F.get(D+":_auth")||F.get(D+"/:_auth"));if(Z)return Z;return}function B8(D){return D.replace(/^\$\{?([^}]*)\}?$/,function(F,u){return process.env[u]})}function bX(D){if(!D)return;return{token:B8(D),type:"Bearer"}}function fX(D,F){if(!D||!F)return;let u=Buffer.from(B8(F),"base64").toString("utf8");return{token:Buffer.from(D+":"+u,"utf8").toString("base64"),type:"Basic",password:u,username:D}}function vX(D){if(!D)return;return{token:B8(D),type:"Basic"}}});var H5=M((zI,J5)=>{var hX=w0(),gX=(D,F)=>{let u=hX(D,F);return u?u.version:null};J5.exports=gX});var X5=M((qI,Y5)=>{var mX=w0(),dX=(D,F)=>{let u=mX(D.trim().replace(/^[=v]+/,""),F);return u?u.version:null};Y5.exports=dX});var K5=M((AI,Q5)=>{var G5=ND(),cX=(D,F,u,E,B)=>{if(typeof u==="string")B=E,E=u,u=void 0;try{return new G5(D instanceof G5?D.version:D,u).inc(F,E,B).version}catch(C){return null}};Q5.exports=cX});var q5=M((UI,z5)=>{var lX=ND(),pX=(D,F)=>new lX(D,F).major;z5.exports=pX});var U5=M((WI,A5)=>{var iX=ND(),nX=(D,F)=>new iX(D,F).minor;A5.exports=nX});var N5=M((NI,W5)=>{var aX=ND(),rX=(D,F)=>new aX(D,F).patch;W5.exports=rX});var V5=M(($I,$5)=>{var sX=w0(),oX=(D,F)=>{let u=sX(D,F);return u&&u.prerelease.length?u.prerelease:null};$5.exports=oX});var M5=M((VI,I5)=>{var tX=gD(),eX=(D,F,u)=>tX(F,D,u);I5.exports=eX});var _5=M((II,T5)=>{var DG=gD(),FG=(D,F)=>DG(D,F,!0);T5.exports=FG});var C8=M((MI,L5)=>{var O5=ND(),uG=(D,F,u)=>{let E=new O5(D,u),B=new O5(F,u);return E.compare(B)||E.compareBuild(B)};L5.exports=uG});var j5=M((TI,R5)=>{var EG=C8(),BG=(D,F)=>D.sort((u,E)=>EG(u,E,F));R5.exports=BG});var P5=M((_I,S5)=>{var CG=C8(),ZG=(D,F)=>D.sort((u,E)=>CG(E,u,F));S5.exports=ZG});var Z8=M((OI,w5)=>{var JG=gD(),HG=(D,F,u)=>JG(D,F,u)<0;w5.exports=HG});var N3=M((LI,x5)=>{var YG=gD(),XG=(D,F,u)=>YG(D,F,u)===0;x5.exports=XG});var $3=M((RI,k5)=>{var GG=gD(),QG=(D,F,u)=>GG(D,F,u)!==0;k5.exports=QG});var J8=M((jI,y5)=>{var KG=gD(),zG=(D,F,u)=>KG(D,F,u)>=0;y5.exports=zG});var H8=M((SI,b5)=>{var qG=gD(),AG=(D,F,u)=>qG(D,F,u)<=0;b5.exports=AG});var V3=M((PI,f5)=>{var UG=N3(),WG=$3(),NG=EF(),$G=J8(),VG=Z8(),IG=H8(),MG=(D,F,u,E)=>{switch(F){case"===":if(typeof D==="object")D=D.version;if(typeof u==="object")u=u.version;return D===u;case"!==":if(typeof D==="object")D=D.version;if(typeof u==="object")u=u.version;return D!==u;case"":case"=":case"==":return UG(D,u,E);case"!=":return WG(D,u,E);case">":return NG(D,u,E);case">=":return $G(D,u,E);case"<":return VG(D,u,E);case"<=":return IG(D,u,E);default:throw TypeError(`Invalid operator: ${F}`)}};f5.exports=MG});var h5=M((wI,v5)=>{var TG=ND(),_G=w0(),{safeRe:Y8,t:X8}=uF(),OG=(D,F)=>{if(D instanceof TG)return D;if(typeof D==="number")D=String(D);if(typeof D!=="string")return null;F=F||{};let u=null;if(!F.rtl)u=D.match(F.includePrerelease?Y8[X8.COERCEFULL]:Y8[X8.COERCE]);else{let X=F.includePrerelease?Y8[X8.COERCERTLFULL]:Y8[X8.COERCERTL],H;while((H=X.exec(D))&&(!u||u.index+u[0].length!==D.length)){if(!u||H.index+H[0].length!==u.index+u[0].length)u=H;X.lastIndex=H.index+H[1].length+H[2].length}X.lastIndex=-1}if(u===null)return null;let E=u[2],B=u[3]||"0",C=u[4]||"0",Z=F.includePrerelease&&u[5]?`-${u[5]}`:"",J=F.includePrerelease&&u[6]?`+${u[6]}`:"";return _G(`${E}.${B}.${C}${Z}${J}`,F)};v5.exports=OG});var d5=M((xI,m5)=>{class g5{constructor(){this.max=1000,this.map=new Map}get(D){let F=this.map.get(D);if(F===void 0)return;else return this.map.delete(D),this.map.set(D,F),F}delete(D){return this.map.delete(D)}set(D,F){if(!this.delete(D)&&F!==void 0){if(this.map.size>=this.max){let E=this.map.keys().next().value;this.delete(E)}this.map.set(D,F)}return this}}m5.exports=g5});var mD=M((kI,i5)=>{var LG=/\s+/g;class dF{constructor(D,F){if(F=jG(F),D instanceof dF)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else return new dF(D.raw,F);if(D instanceof I3)return this.raw=D.value,this.set=[[D]],this.formatted=void 0,this;if(this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease,this.raw=D.trim().replace(LG," "),this.set=this.raw.split("||").map((u)=>this.parseRange(u.trim())).filter((u)=>u.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let u=this.set[0];if(this.set=this.set.filter((E)=>!l5(E[0])),this.set.length===0)this.set=[u];else if(this.set.length>1){for(let E of this.set)if(E.length===1&&bG(E[0])){this.set=[E];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let D=0;D<this.set.length;D++){if(D>0)this.formatted+="||";let F=this.set[D];for(let u=0;u<F.length;u++){if(u>0)this.formatted+=" ";this.formatted+=F[u].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(D){let u=((this.options.includePrerelease&&kG)|(this.options.loose&&yG))+":"+D,E=c5.get(u);if(E)return E;let B=this.options.loose,C=B?_D[VD.HYPHENRANGELOOSE]:_D[VD.HYPHENRANGE];D=D.replace(C,iG(this.options.includePrerelease)),FD("hyphen replace",D),D=D.replace(_D[VD.COMPARATORTRIM],PG),FD("comparator trim",D),D=D.replace(_D[VD.TILDETRIM],wG),FD("tilde trim",D),D=D.replace(_D[VD.CARETTRIM],xG),FD("caret trim",D);let Z=D.split(" ").map((Y)=>fG(Y,this.options)).join(" ").split(/\s+/).map((Y)=>pG(Y,this.options));if(B)Z=Z.filter((Y)=>{return FD("loose invalid filter",Y,this.options),!!Y.match(_D[VD.COMPARATORLOOSE])});FD("range list",Z);let J=new Map,X=Z.map((Y)=>new I3(Y,this.options));for(let Y of X){if(l5(Y))return[Y];J.set(Y.value,Y)}if(J.size>1&&J.has(""))J.delete("");let H=[...J.values()];return c5.set(u,H),H}intersects(D,F){if(!(D instanceof dF))throw TypeError("a Range is required");return this.set.some((u)=>{return p5(u,F)&&D.set.some((E)=>{return p5(E,F)&&u.every((B)=>{return E.every((C)=>{return B.intersects(C,F)})})})})}test(D){if(!D)return!1;if(typeof D==="string")try{D=new SG(D,this.options)}catch(F){return!1}for(let F=0;F<this.set.length;F++)if(nG(this.set[F],D,this.options))return!0;return!1}}i5.exports=dF;var RG=d5(),c5=new RG,jG=f2(),I3=cF(),FD=xF(),SG=ND(),{safeRe:_D,t:VD,comparatorTrimReplace:PG,tildeTrimReplace:wG,caretTrimReplace:xG}=uF(),{FLAG_INCLUDE_PRERELEASE:kG,FLAG_LOOSE:yG}=kF(),l5=(D)=>D.value==="<0.0.0-0",bG=(D)=>D.value==="",p5=(D,F)=>{let u=!0,E=D.slice(),B=E.pop();while(u&&E.length)u=E.every((C)=>{return B.intersects(C,F)}),B=E.pop();return u},fG=(D,F)=>{return D=D.replace(_D[VD.BUILD],""),FD("comp",D,F),D=gG(D,F),FD("caret",D),D=vG(D,F),FD("tildes",D),D=dG(D,F),FD("xrange",D),D=lG(D,F),FD("stars",D),D},OD=(D)=>!D||D.toLowerCase()==="x"||D==="*",vG=(D,F)=>{return D.trim().split(/\s+/).map((u)=>hG(u,F)).join(" ")},hG=(D,F)=>{let u=F.loose?_D[VD.TILDELOOSE]:_D[VD.TILDE];return D.replace(u,(E,B,C,Z,J)=>{FD("tilde",D,E,B,C,Z,J);let X;if(OD(B))X="";else if(OD(C))X=`>=${B}.0.0 <${+B+1}.0.0-0`;else if(OD(Z))X=`>=${B}.${C}.0 <${B}.${+C+1}.0-0`;else if(J)FD("replaceTilde pr",J),X=`>=${B}.${C}.${Z}-${J} <${B}.${+C+1}.0-0`;else X=`>=${B}.${C}.${Z} <${B}.${+C+1}.0-0`;return FD("tilde return",X),X})},gG=(D,F)=>{return D.trim().split(/\s+/).map((u)=>mG(u,F)).join(" ")},mG=(D,F)=>{FD("caret",D,F);let u=F.loose?_D[VD.CARETLOOSE]:_D[VD.CARET],E=F.includePrerelease?"-0":"";return D.replace(u,(B,C,Z,J,X)=>{FD("caret",D,B,C,Z,J,X);let H;if(OD(C))H="";else if(OD(Z))H=`>=${C}.0.0${E} <${+C+1}.0.0-0`;else if(OD(J))if(C==="0")H=`>=${C}.${Z}.0${E} <${C}.${+Z+1}.0-0`;else H=`>=${C}.${Z}.0${E} <${+C+1}.0.0-0`;else if(X)if(FD("replaceCaret pr",X),C==="0")if(Z==="0")H=`>=${C}.${Z}.${J}-${X} <${C}.${Z}.${+J+1}-0`;else H=`>=${C}.${Z}.${J}-${X} <${C}.${+Z+1}.0-0`;else H=`>=${C}.${Z}.${J}-${X} <${+C+1}.0.0-0`;else if(FD("no pr"),C==="0")if(Z==="0")H=`>=${C}.${Z}.${J}${E} <${C}.${Z}.${+J+1}-0`;else H=`>=${C}.${Z}.${J}${E} <${C}.${+Z+1}.0-0`;else H=`>=${C}.${Z}.${J} <${+C+1}.0.0-0`;return FD("caret return",H),H})},dG=(D,F)=>{return FD("replaceXRanges",D,F),D.split(/\s+/).map((u)=>cG(u,F)).join(" ")},cG=(D,F)=>{D=D.trim();let u=F.loose?_D[VD.XRANGELOOSE]:_D[VD.XRANGE];return D.replace(u,(E,B,C,Z,J,X)=>{FD("xRange",D,E,B,C,Z,J,X);let H=OD(C),Y=H||OD(Z),G=Y||OD(J),K=G;if(B==="="&&K)B="";if(X=F.includePrerelease?"-0":"",H)if(B===">"||B==="<")E="<0.0.0-0";else E="*";else if(B&&K){if(Y)Z=0;if(J=0,B===">")if(B=">=",Y)C=+C+1,Z=0,J=0;else Z=+Z+1,J=0;else if(B==="<=")if(B="<",Y)C=+C+1;else Z=+Z+1;if(B==="<")X="-0";E=`${B+C}.${Z}.${J}${X}`}else if(Y)E=`>=${C}.0.0${X} <${+C+1}.0.0-0`;else if(G)E=`>=${C}.${Z}.0${X} <${C}.${+Z+1}.0-0`;return FD("xRange return",E),E})},lG=(D,F)=>{return FD("replaceStars",D,F),D.trim().replace(_D[VD.STAR],"")},pG=(D,F)=>{return FD("replaceGTE0",D,F),D.trim().replace(_D[F.includePrerelease?VD.GTE0PRE:VD.GTE0],"")},iG=(D)=>(F,u,E,B,C,Z,J,X,H,Y,G,K)=>{if(OD(E))u="";else if(OD(B))u=`>=${E}.0.0${D?"-0":""}`;else if(OD(C))u=`>=${E}.${B}.0${D?"-0":""}`;else if(Z)u=`>=${u}`;else u=`>=${u}${D?"-0":""}`;if(OD(H))X="";else if(OD(Y))X=`<${+H+1}.0.0-0`;else if(OD(G))X=`<${H}.${+Y+1}.0-0`;else if(K)X=`<=${H}.${Y}.${G}-${K}`;else if(D)X=`<${H}.${Y}.${+G+1}-0`;else X=`<=${X}`;return`${u} ${X}`.trim()},nG=(D,F,u)=>{for(let E=0;E<D.length;E++)if(!D[E].test(F))return!1;if(F.prerelease.length&&!u.includePrerelease){for(let E=0;E<D.length;E++){if(FD(D[E].semver),D[E].semver===I3.ANY)continue;if(D[E].semver.prerelease.length>0){let B=D[E].semver;if(B.major===F.major&&B.minor===F.minor&&B.patch===F.patch)return!0}}return!1}return!0}});var cF=M((yI,t5)=>{var lF=Symbol("SemVer ANY");class G8{static get ANY(){return lF}constructor(D,F){if(F=n5(F),D instanceof G8)if(D.loose===!!F.loose)return D;else D=D.value;if(D=D.trim().split(/\s+/).join(" "),T3("comparator",D,F),this.options=F,this.loose=!!F.loose,this.parse(D),this.semver===lF)this.value="";else this.value=this.operator+this.semver.version;T3("comp",this)}parse(D){let F=this.options.loose?a5[r5.COMPARATORLOOSE]:a5[r5.COMPARATOR],u=D.match(F);if(!u)throw TypeError(`Invalid comparator: ${D}`);if(this.operator=u[1]!==void 0?u[1]:"",this.operator==="=")this.operator="";if(!u[2])this.semver=lF;else this.semver=new s5(u[2],this.options.loose)}toString(){return this.value}test(D){if(T3("Comparator.test",D,this.options.loose),this.semver===lF||D===lF)return!0;if(typeof D==="string")try{D=new s5(D,this.options)}catch(F){return!1}return M3(D,this.operator,this.semver,this.options)}intersects(D,F){if(!(D instanceof G8))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new o5(D.value,F).test(this.value)}else if(D.operator===""){if(D.value==="")return!0;return new o5(this.value,F).test(D.semver)}if(F=n5(F),F.includePrerelease&&(this.value==="<0.0.0-0"||D.value==="<0.0.0-0"))return!1;if(!F.includePrerelease&&(this.value.startsWith("<0.0.0")||D.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&D.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&D.operator.startsWith("<"))return!0;if(this.semver.version===D.semver.version&&this.operator.includes("=")&&D.operator.includes("="))return!0;if(M3(this.semver,"<",D.semver,F)&&this.operator.startsWith(">")&&D.operator.startsWith("<"))return!0;if(M3(this.semver,">",D.semver,F)&&this.operator.startsWith("<")&&D.operator.startsWith(">"))return!0;return!1}}t5.exports=G8;var n5=f2(),{safeRe:a5,t:r5}=uF(),M3=V3(),T3=xF(),s5=ND(),o5=mD()});var pF=M((bI,e5)=>{var aG=mD(),rG=(D,F,u)=>{try{F=new aG(F,u)}catch(E){return!1}return F.test(D)};e5.exports=rG});var FE=M((fI,DE)=>{var sG=mD(),oG=(D,F)=>new sG(D,F).set.map((u)=>u.map((E)=>E.value).join(" ").trim().split(" "));DE.exports=oG});var EE=M((vI,uE)=>{var tG=ND(),eG=mD(),DQ=(D,F,u)=>{let E=null,B=null,C=null;try{C=new eG(F,u)}catch(Z){return null}return D.forEach((Z)=>{if(C.test(Z)){if(!E||B.compare(Z)===-1)E=Z,B=new tG(E,u)}}),E};uE.exports=DQ});var CE=M((hI,BE)=>{var FQ=ND(),uQ=mD(),EQ=(D,F,u)=>{let E=null,B=null,C=null;try{C=new uQ(F,u)}catch(Z){return null}return D.forEach((Z)=>{if(C.test(Z)){if(!E||B.compare(Z)===1)E=Z,B=new FQ(E,u)}}),E};BE.exports=EQ});var HE=M((gI,JE)=>{var _3=ND(),BQ=mD(),ZE=EF(),CQ=(D,F)=>{D=new BQ(D,F);let u=new _3("0.0.0");if(D.test(u))return u;if(u=new _3("0.0.0-0"),D.test(u))return u;u=null;for(let E=0;E<D.set.length;++E){let B=D.set[E],C=null;if(B.forEach((Z)=>{let J=new _3(Z.semver.version);switch(Z.operator){case">":if(J.prerelease.length===0)J.patch++;else J.prerelease.push(0);J.raw=J.format();case"":case">=":if(!C||ZE(J,C))C=J;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${Z.operator}`)}}),C&&(!u||ZE(u,C)))u=C}if(u&&D.test(u))return u;return null};JE.exports=CQ});var XE=M((mI,YE)=>{var ZQ=mD(),JQ=(D,F)=>{try{return new ZQ(D,F).range||"*"}catch(u){return null}};YE.exports=JQ});var Q8=M((dI,zE)=>{var HQ=ND(),KE=cF(),{ANY:YQ}=KE,XQ=mD(),GQ=pF(),GE=EF(),QE=Z8(),QQ=H8(),KQ=J8(),zQ=(D,F,u,E)=>{D=new HQ(D,E),F=new XQ(F,E);let B,C,Z,J,X;switch(u){case">":B=GE,C=QQ,Z=QE,J=">",X=">=";break;case"<":B=QE,C=KQ,Z=GE,J="<",X="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(GQ(D,F,E))return!1;for(let H=0;H<F.set.length;++H){let Y=F.set[H],G=null,K=null;if(Y.forEach((Q)=>{if(Q.semver===YQ)Q=new KE(">=0.0.0");if(G=G||Q,K=K||Q,B(Q.semver,G.semver,E))G=Q;else if(Z(Q.semver,K.semver,E))K=Q}),G.operator===J||G.operator===X)return!1;if((!K.operator||K.operator===J)&&C(D,K.semver))return!1;else if(K.operator===X&&Z(D,K.semver))return!1}return!0};zE.exports=zQ});var AE=M((cI,qE)=>{var qQ=Q8(),AQ=(D,F,u)=>qQ(D,F,">",u);qE.exports=AQ});var WE=M((lI,UE)=>{var UQ=Q8(),WQ=(D,F,u)=>UQ(D,F,"<",u);UE.exports=WQ});var VE=M((pI,$E)=>{var NE=mD(),NQ=(D,F,u)=>{return D=new NE(D,u),F=new NE(F,u),D.intersects(F,u)};$E.exports=NQ});var ME=M((iI,IE)=>{var $Q=pF(),VQ=gD();IE.exports=(D,F,u)=>{let E=[],B=null,C=null,Z=D.sort((Y,G)=>VQ(Y,G,u));for(let Y of Z)if($Q(Y,F,u)){if(C=Y,!B)B=Y}else{if(C)E.push([B,C]);C=null,B=null}if(B)E.push([B,null]);let J=[];for(let[Y,G]of E)if(Y===G)J.push(Y);else if(!G&&Y===Z[0])J.push("*");else if(!G)J.push(`>=${Y}`);else if(Y===Z[0])J.push(`<=${G}`);else J.push(`${Y} - ${G}`);let X=J.join(" || "),H=typeof F.raw==="string"?F.raw:String(F);return X.length<H.length?X:F}});var jE=M((nI,RE)=>{var TE=mD(),L3=cF(),{ANY:O3}=L3,iF=pF(),R3=gD(),IQ=(D,F,u={})=>{if(D===F)return!0;D=new TE(D,u),F=new TE(F,u);let E=!1;D:for(let B of D.set){for(let C of F.set){let Z=TQ(B,C,u);if(E=E||Z!==null,Z)continue D}if(E)return!1}return!0},MQ=[new L3(">=0.0.0-0")],_E=[new L3(">=0.0.0")],TQ=(D,F,u)=>{if(D===F)return!0;if(D.length===1&&D[0].semver===O3)if(F.length===1&&F[0].semver===O3)return!0;else if(u.includePrerelease)D=MQ;else D=_E;if(F.length===1&&F[0].semver===O3)if(u.includePrerelease)return!0;else F=_E;let E=new Set,B,C;for(let Q of D)if(Q.operator===">"||Q.operator===">=")B=OE(B,Q,u);else if(Q.operator==="<"||Q.operator==="<=")C=LE(C,Q,u);else E.add(Q.semver);if(E.size>1)return null;let Z;if(B&&C){if(Z=R3(B.semver,C.semver,u),Z>0)return null;else if(Z===0&&(B.operator!==">="||C.operator!=="<="))return null}for(let Q of E){if(B&&!iF(Q,String(B),u))return null;if(C&&!iF(Q,String(C),u))return null;for(let z of F)if(!iF(Q,String(z),u))return!1;return!0}let J,X,H,Y,G=C&&!u.includePrerelease&&C.semver.prerelease.length?C.semver:!1,K=B&&!u.includePrerelease&&B.semver.prerelease.length?B.semver:!1;if(G&&G.prerelease.length===1&&C.operator==="<"&&G.prerelease[0]===0)G=!1;for(let Q of F){if(Y=Y||Q.operator===">"||Q.operator===">=",H=H||Q.operator==="<"||Q.operator==="<=",B){if(K){if(Q.semver.prerelease&&Q.semver.prerelease.length&&Q.semver.major===K.major&&Q.semver.minor===K.minor&&Q.semver.patch===K.patch)K=!1}if(Q.operator===">"||Q.operator===">="){if(J=OE(B,Q,u),J===Q&&J!==B)return!1}else if(B.operator===">="&&!iF(B.semver,String(Q),u))return!1}if(C){if(G){if(Q.semver.prerelease&&Q.semver.prerelease.length&&Q.semver.major===G.major&&Q.semver.minor===G.minor&&Q.semver.patch===G.patch)G=!1}if(Q.operator==="<"||Q.operator==="<="){if(X=LE(C,Q,u),X===Q&&X!==C)return!1}else if(C.operator==="<="&&!iF(C.semver,String(Q),u))return!1}if(!Q.operator&&(C||B)&&Z!==0)return!1}if(B&&H&&!C&&Z!==0)return!1;if(C&&Y&&!B&&Z!==0)return!1;if(K||G)return!1;return!0},OE=(D,F,u)=>{if(!D)return F;let E=R3(D.semver,F.semver,u);return E>0?D:E<0?F:F.operator===">"&&D.operator===">="?F:D},LE=(D,F,u)=>{if(!D)return F;let E=R3(D.semver,F.semver,u);return E<0?D:E>0?F:F.operator==="<"&&D.operator==="<="?F:D};RE.exports=IQ});var xE=M((aI,wE)=>{var j3=uF(),SE=kF(),_Q=ND(),PE=nu(),OQ=w0(),LQ=H5(),RQ=X5(),jQ=K5(),SQ=ru(),PQ=q5(),wQ=U5(),xQ=N5(),kQ=V5(),yQ=gD(),bQ=M5(),fQ=_5(),vQ=C8(),hQ=j5(),gQ=P5(),mQ=EF(),dQ=Z8(),cQ=N3(),lQ=$3(),pQ=J8(),iQ=H8(),nQ=V3(),aQ=h5(),rQ=cF(),sQ=mD(),oQ=pF(),tQ=FE(),eQ=EE(),DK=CE(),FK=HE(),uK=XE(),EK=Q8(),BK=AE(),CK=WE(),ZK=VE(),JK=ME(),HK=jE();wE.exports={parse:OQ,valid:LQ,clean:RQ,inc:jQ,diff:SQ,major:PQ,minor:wQ,patch:xQ,prerelease:kQ,compare:yQ,rcompare:bQ,compareLoose:fQ,compareBuild:vQ,sort:hQ,rsort:gQ,gt:mQ,lt:dQ,eq:cQ,neq:lQ,gte:pQ,lte:iQ,cmp:nQ,coerce:aQ,Comparator:rQ,Range:sQ,satisfies:oQ,toComparators:tQ,maxSatisfying:eQ,minSatisfying:DK,minVersion:FK,validRange:uK,outside:EK,gtr:BK,ltr:CK,intersects:ZK,simplifyRange:JK,subset:HK,SemVer:_Q,re:j3.re,src:j3.src,tokens:j3.t,SEMVER_SPEC_VERSION:SE.SEMVER_SPEC_VERSION,RELEASE_TYPES:SE.RELEASE_TYPES,compareIdentifiers:PE.compareIdentifiers,rcompareIdentifiers:PE.rcompareIdentifiers}});var lE=M((BM,cE)=>{var{hasOwnProperty:w3}=Object.prototype,x3=(D,F={})=>{if(typeof F==="string")F={section:F};F.align=F.align===!0,F.newline=F.newline===!0,F.sort=F.sort===!0,F.whitespace=F.whitespace===!0||F.align===!0,F.platform=F.platform||typeof process<"u"&&process.platform,F.bracketedArray=F.bracketedArray!==!1;let u=F.platform==="win32"?`\r
47
+ `);return E.split(",")}switch(D){case"hoist-pattern":case"public-hoist-pattern":return u(F)}return F}D5.exports=e4});var J5=T((Z5)=>{var B5=p("os"),Y0=p("path"),C5=B5.tmpdir(),SX=process.getuid?process.getuid():process.pid,PX=()=>!0,u5=process.platform==="win32",E5={editor:()=>process.env.EDITOR||process.env.VISUAL||(u5?"notepad.exe":"vi"),shell:()=>u5?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},wX={fromString:()=>process.umask()},KF=B5.homedir();if(KF)process.env.HOME=KF;else KF=Y0.resolve(C5,"npm-"+SX);var xX=process.platform==="win32"?"npm-cache":".npm",kX=process.platform==="win32"&&process.env.APPDATA||KF,yX=Y0.resolve(kX,xX),C8,h0;Object.defineProperty(Z5,"defaults",{get:function(){if(C8)return C8;if(process.env.PREFIX)h0=process.env.PREFIX;else if(process.platform==="win32")h0=Y0.dirname(process.execPath);else if(h0=Y0.dirname(Y0.dirname(process.execPath)),process.env.DESTDIR)h0=Y0.join(process.env.DESTDIR,h0);return C8={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:yX,"cache-lock-stale":60000,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:E5.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":60000,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Y0.resolve(h0,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Y0.resolve(KF,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:h0,production:!1,progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:E5.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:C5,unicode:PX(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Y0.resolve(KF,".npmrc"),umask:process.umask?process.umask():wX.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},C8}})});var Y5=T((AI,_1)=>{var g0=p("path"),bX=F5(),H5=J5();_1.exports=(D,F,u)=>{let E=new bX(Object.assign({},H5.defaults,u),F);E.add(Object.assign({},D),"cli");let B=[],C=!1;if(p.resolve.paths){let H=p.resolve.paths("npm"),Y;try{Y=p.resolve("npm",{paths:H.slice(-1)})}catch(G){C=!0}if(Y)B.push(E.addFile(g0.resolve(g0.dirname(Y),"..","npmrc"),"builtin"))}E.addEnv(),E.loadPrefix();let Z=g0.resolve(E.localPrefix,".npmrc"),J=E.get("userconfig");if(!E.get("global")&&Z!==J)B.push(E.addFile(Z,"project"));else E.add({},"project");if(E.get("workspace-prefix")&&E.get("workspace-prefix")!==Z){let H=g0.resolve(E.get("workspace-prefix"),".npmrc");B.push(E.addFile(H,"workspace"))}if(B.push(E.addFile(E.get("userconfig"),"user")),E.get("prefix")){let H=g0.resolve(E.get("prefix"),"etc");E.root.globalconfig=g0.resolve(H,"npmrc"),E.root.globalignorefile=g0.resolve(H,"npmignore")}B.push(E.addFile(E.get("globalconfig"),"global")),E.loadUser();let X=E.get("cafile");if(X)E.loadCAFile(X);return{config:E,warnings:B.filter(Boolean),failedToLoadBuiltInConfig:C}};Object.defineProperty(_1.exports,"defaults",{get(){return H5.defaults},enumerable:!0})});var K5=T((WI,Q5)=>{var X5=Y5();Q5.exports=function(){let F,u;if(arguments.length>=2)F=arguments[0],u=Object.assign({},arguments[1]);else if(typeof arguments[0]==="string")F=arguments[0];else u=Object.assign({},arguments[0]);u=u||{};let E=u.npmrc;return u.npmrc=(u.npmrc?{config:{get:(B)=>E[B]}}:X5()).config,F=F||u.npmrc.get("registry")||X5.defaults.registry,G5(F,u)||vX(u.npmrc)};function fX(D,F){let u=new URL(F,new URL(D.startsWith("//")?`./${D}`:D,"resolve://"));if(u.protocol==="resolve:"){let{pathname:E,search:B,hash:C}=u;return E+B+C}return u.toString()}function G5(D,F){let u=D instanceof URL?D:new URL(D.startsWith("//")?`http:${D}`:D),E;while(E!=="/"&&u.pathname!==E){E=u.pathname||"/";let B="//"+u.host+E.replace(/\/$/,""),C=gX(B,F.npmrc);if(C)return C;if(!F.recursive)return/\/$/.test(D)?void 0:G5(new URL("./",u),F);u.pathname=fX(hX(E),"..")||"/"}return}function vX(D){if(!D.get("_auth"))return;return{token:Z8(D.get("_auth")),type:"Basic"}}function hX(D){return D[D.length-1]==="/"?D:D+"/"}function gX(D,F){let u=mX(F.get(D+":_authToken")||F.get(D+"/:_authToken"));if(u)return u;let E=F.get(D+":username")||F.get(D+"/:username"),B=F.get(D+":_password")||F.get(D+"/:_password"),C=dX(E,B);if(C)return C;let Z=cX(F.get(D+":_auth")||F.get(D+"/:_auth"));if(Z)return Z;return}function Z8(D){return D.replace(/^\$\{?([^}]*)\}?$/,function(F,u){return process.env[u]})}function mX(D){if(!D)return;return{token:Z8(D),type:"Bearer"}}function dX(D,F){if(!D||!F)return;let u=Buffer.from(Z8(F),"base64").toString("utf8");return{token:Buffer.from(D+":"+u,"utf8").toString("base64"),type:"Basic",password:u,username:D}}function cX(D){if(!D)return;return{token:Z8(D),type:"Basic"}}});var q5=T((NI,z5)=>{var lX=x0(),pX=(D,F)=>{let u=lX(D,F);return u?u.version:null};z5.exports=pX});var U5=T(($I,A5)=>{var iX=x0(),nX=(D,F)=>{let u=iX(D.trim().replace(/^[=v]+/,""),F);return u?u.version:null};A5.exports=nX});var $5=T((VI,N5)=>{var W5=$D(),aX=(D,F,u,E,B)=>{if(typeof u==="string")B=E,E=u,u=void 0;try{return new W5(D instanceof W5?D.version:D,u).inc(F,E,B).version}catch(C){return null}};N5.exports=aX});var I5=T((II,V5)=>{var rX=$D(),sX=(D,F)=>new rX(D,F).major;V5.exports=sX});var T5=T((MI,M5)=>{var oX=$D(),tX=(D,F)=>new oX(D,F).minor;M5.exports=tX});var _5=T((TI,O5)=>{var eX=$D(),DG=(D,F)=>new eX(D,F).patch;O5.exports=DG});var R5=T((OI,L5)=>{var FG=x0(),uG=(D,F)=>{let u=FG(D,F);return u&&u.prerelease.length?u.prerelease:null};L5.exports=uG});var S5=T((_I,j5)=>{var EG=mD(),BG=(D,F,u)=>EG(F,D,u);j5.exports=BG});var w5=T((LI,P5)=>{var CG=mD(),ZG=(D,F)=>CG(D,F,!0);P5.exports=ZG});var J8=T((RI,k5)=>{var x5=$D(),JG=(D,F,u)=>{let E=new x5(D,u),B=new x5(F,u);return E.compare(B)||E.compareBuild(B)};k5.exports=JG});var b5=T((jI,y5)=>{var HG=J8(),YG=(D,F)=>D.sort((u,E)=>HG(u,E,F));y5.exports=YG});var v5=T((SI,f5)=>{var XG=J8(),GG=(D,F)=>D.sort((u,E)=>XG(E,u,F));f5.exports=GG});var H8=T((PI,h5)=>{var QG=mD(),KG=(D,F,u)=>QG(D,F,u)<0;h5.exports=KG});var L1=T((wI,g5)=>{var zG=mD(),qG=(D,F,u)=>zG(D,F,u)===0;g5.exports=qG});var R1=T((xI,m5)=>{var AG=mD(),UG=(D,F,u)=>AG(D,F,u)!==0;m5.exports=UG});var Y8=T((kI,d5)=>{var WG=mD(),NG=(D,F,u)=>WG(D,F,u)>=0;d5.exports=NG});var X8=T((yI,c5)=>{var $G=mD(),VG=(D,F,u)=>$G(D,F,u)<=0;c5.exports=VG});var j1=T((bI,l5)=>{var IG=L1(),MG=R1(),TG=BF(),OG=Y8(),_G=H8(),LG=X8(),RG=(D,F,u,E)=>{switch(F){case"===":if(typeof D==="object")D=D.version;if(typeof u==="object")u=u.version;return D===u;case"!==":if(typeof D==="object")D=D.version;if(typeof u==="object")u=u.version;return D!==u;case"":case"=":case"==":return IG(D,u,E);case"!=":return MG(D,u,E);case">":return TG(D,u,E);case">=":return OG(D,u,E);case"<":return _G(D,u,E);case"<=":return LG(D,u,E);default:throw TypeError(`Invalid operator: ${F}`)}};l5.exports=RG});var i5=T((fI,p5)=>{var jG=$D(),SG=x0(),{safeRe:G8,t:Q8}=EF(),PG=(D,F)=>{if(D instanceof jG)return D;if(typeof D==="number")D=String(D);if(typeof D!=="string")return null;F=F||{};let u=null;if(!F.rtl)u=D.match(F.includePrerelease?G8[Q8.COERCEFULL]:G8[Q8.COERCE]);else{let X=F.includePrerelease?G8[Q8.COERCERTLFULL]:G8[Q8.COERCERTL],H;while((H=X.exec(D))&&(!u||u.index+u[0].length!==D.length)){if(!u||H.index+H[0].length!==u.index+u[0].length)u=H;X.lastIndex=H.index+H[1].length+H[2].length}X.lastIndex=-1}if(u===null)return null;let E=u[2],B=u[3]||"0",C=u[4]||"0",Z=F.includePrerelease&&u[5]?`-${u[5]}`:"",J=F.includePrerelease&&u[6]?`+${u[6]}`:"";return SG(`${E}.${B}.${C}${Z}${J}`,F)};p5.exports=PG});var r5=T((vI,a5)=>{class n5{constructor(){this.max=1000,this.map=new Map}get(D){let F=this.map.get(D);if(F===void 0)return;else return this.map.delete(D),this.map.set(D,F),F}delete(D){return this.map.delete(D)}set(D,F){if(!this.delete(D)&&F!==void 0){if(this.map.size>=this.max){let E=this.map.keys().next().value;this.delete(E)}this.map.set(D,F)}return this}}a5.exports=n5});var dD=T((hI,e5)=>{var wG=/\s+/g;class cF{constructor(D,F){if(F=kG(F),D instanceof cF)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else return new cF(D.raw,F);if(D instanceof S1)return this.raw=D.value,this.set=[[D]],this.formatted=void 0,this;if(this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease,this.raw=D.trim().replace(wG," "),this.set=this.raw.split("||").map((u)=>this.parseRange(u.trim())).filter((u)=>u.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let u=this.set[0];if(this.set=this.set.filter((E)=>!o5(E[0])),this.set.length===0)this.set=[u];else if(this.set.length>1){for(let E of this.set)if(E.length===1&&mG(E[0])){this.set=[E];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let D=0;D<this.set.length;D++){if(D>0)this.formatted+="||";let F=this.set[D];for(let u=0;u<F.length;u++){if(u>0)this.formatted+=" ";this.formatted+=F[u].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(D){let u=((this.options.includePrerelease&&hG)|(this.options.loose&&gG))+":"+D,E=s5.get(u);if(E)return E;let B=this.options.loose,C=B?_D[ID.HYPHENRANGELOOSE]:_D[ID.HYPHENRANGE];D=D.replace(C,oG(this.options.includePrerelease)),FD("hyphen replace",D),D=D.replace(_D[ID.COMPARATORTRIM],bG),FD("comparator trim",D),D=D.replace(_D[ID.TILDETRIM],fG),FD("tilde trim",D),D=D.replace(_D[ID.CARETTRIM],vG),FD("caret trim",D);let Z=D.split(" ").map((Y)=>dG(Y,this.options)).join(" ").split(/\s+/).map((Y)=>sG(Y,this.options));if(B)Z=Z.filter((Y)=>{return FD("loose invalid filter",Y,this.options),!!Y.match(_D[ID.COMPARATORLOOSE])});FD("range list",Z);let J=new Map,X=Z.map((Y)=>new S1(Y,this.options));for(let Y of X){if(o5(Y))return[Y];J.set(Y.value,Y)}if(J.size>1&&J.has(""))J.delete("");let H=[...J.values()];return s5.set(u,H),H}intersects(D,F){if(!(D instanceof cF))throw TypeError("a Range is required");return this.set.some((u)=>{return t5(u,F)&&D.set.some((E)=>{return t5(E,F)&&u.every((B)=>{return E.every((C)=>{return B.intersects(C,F)})})})})}test(D){if(!D)return!1;if(typeof D==="string")try{D=new yG(D,this.options)}catch(F){return!1}for(let F=0;F<this.set.length;F++)if(tG(this.set[F],D,this.options))return!0;return!1}}e5.exports=cF;var xG=r5(),s5=new xG,kG=h2(),S1=lF(),FD=kF(),yG=$D(),{safeRe:_D,t:ID,comparatorTrimReplace:bG,tildeTrimReplace:fG,caretTrimReplace:vG}=EF(),{FLAG_INCLUDE_PRERELEASE:hG,FLAG_LOOSE:gG}=yF(),o5=(D)=>D.value==="<0.0.0-0",mG=(D)=>D.value==="",t5=(D,F)=>{let u=!0,E=D.slice(),B=E.pop();while(u&&E.length)u=E.every((C)=>{return B.intersects(C,F)}),B=E.pop();return u},dG=(D,F)=>{return D=D.replace(_D[ID.BUILD],""),FD("comp",D,F),D=pG(D,F),FD("caret",D),D=cG(D,F),FD("tildes",D),D=nG(D,F),FD("xrange",D),D=rG(D,F),FD("stars",D),D},LD=(D)=>!D||D.toLowerCase()==="x"||D==="*",cG=(D,F)=>{return D.trim().split(/\s+/).map((u)=>lG(u,F)).join(" ")},lG=(D,F)=>{let u=F.loose?_D[ID.TILDELOOSE]:_D[ID.TILDE];return D.replace(u,(E,B,C,Z,J)=>{FD("tilde",D,E,B,C,Z,J);let X;if(LD(B))X="";else if(LD(C))X=`>=${B}.0.0 <${+B+1}.0.0-0`;else if(LD(Z))X=`>=${B}.${C}.0 <${B}.${+C+1}.0-0`;else if(J)FD("replaceTilde pr",J),X=`>=${B}.${C}.${Z}-${J} <${B}.${+C+1}.0-0`;else X=`>=${B}.${C}.${Z} <${B}.${+C+1}.0-0`;return FD("tilde return",X),X})},pG=(D,F)=>{return D.trim().split(/\s+/).map((u)=>iG(u,F)).join(" ")},iG=(D,F)=>{FD("caret",D,F);let u=F.loose?_D[ID.CARETLOOSE]:_D[ID.CARET],E=F.includePrerelease?"-0":"";return D.replace(u,(B,C,Z,J,X)=>{FD("caret",D,B,C,Z,J,X);let H;if(LD(C))H="";else if(LD(Z))H=`>=${C}.0.0${E} <${+C+1}.0.0-0`;else if(LD(J))if(C==="0")H=`>=${C}.${Z}.0${E} <${C}.${+Z+1}.0-0`;else H=`>=${C}.${Z}.0${E} <${+C+1}.0.0-0`;else if(X)if(FD("replaceCaret pr",X),C==="0")if(Z==="0")H=`>=${C}.${Z}.${J}-${X} <${C}.${Z}.${+J+1}-0`;else H=`>=${C}.${Z}.${J}-${X} <${C}.${+Z+1}.0-0`;else H=`>=${C}.${Z}.${J}-${X} <${+C+1}.0.0-0`;else if(FD("no pr"),C==="0")if(Z==="0")H=`>=${C}.${Z}.${J}${E} <${C}.${Z}.${+J+1}-0`;else H=`>=${C}.${Z}.${J}${E} <${C}.${+Z+1}.0-0`;else H=`>=${C}.${Z}.${J} <${+C+1}.0.0-0`;return FD("caret return",H),H})},nG=(D,F)=>{return FD("replaceXRanges",D,F),D.split(/\s+/).map((u)=>aG(u,F)).join(" ")},aG=(D,F)=>{D=D.trim();let u=F.loose?_D[ID.XRANGELOOSE]:_D[ID.XRANGE];return D.replace(u,(E,B,C,Z,J,X)=>{FD("xRange",D,E,B,C,Z,J,X);let H=LD(C),Y=H||LD(Z),G=Y||LD(J),K=G;if(B==="="&&K)B="";if(X=F.includePrerelease?"-0":"",H)if(B===">"||B==="<")E="<0.0.0-0";else E="*";else if(B&&K){if(Y)Z=0;if(J=0,B===">")if(B=">=",Y)C=+C+1,Z=0,J=0;else Z=+Z+1,J=0;else if(B==="<=")if(B="<",Y)C=+C+1;else Z=+Z+1;if(B==="<")X="-0";E=`${B+C}.${Z}.${J}${X}`}else if(Y)E=`>=${C}.0.0${X} <${+C+1}.0.0-0`;else if(G)E=`>=${C}.${Z}.0${X} <${C}.${+Z+1}.0-0`;return FD("xRange return",E),E})},rG=(D,F)=>{return FD("replaceStars",D,F),D.trim().replace(_D[ID.STAR],"")},sG=(D,F)=>{return FD("replaceGTE0",D,F),D.trim().replace(_D[F.includePrerelease?ID.GTE0PRE:ID.GTE0],"")},oG=(D)=>(F,u,E,B,C,Z,J,X,H,Y,G,K)=>{if(LD(E))u="";else if(LD(B))u=`>=${E}.0.0${D?"-0":""}`;else if(LD(C))u=`>=${E}.${B}.0${D?"-0":""}`;else if(Z)u=`>=${u}`;else u=`>=${u}${D?"-0":""}`;if(LD(H))X="";else if(LD(Y))X=`<${+H+1}.0.0-0`;else if(LD(G))X=`<${H}.${+Y+1}.0-0`;else if(K)X=`<=${H}.${Y}.${G}-${K}`;else if(D)X=`<${H}.${Y}.${+G+1}-0`;else X=`<=${X}`;return`${u} ${X}`.trim()},tG=(D,F,u)=>{for(let E=0;E<D.length;E++)if(!D[E].test(F))return!1;if(F.prerelease.length&&!u.includePrerelease){for(let E=0;E<D.length;E++){if(FD(D[E].semver),D[E].semver===S1.ANY)continue;if(D[E].semver.prerelease.length>0){let B=D[E].semver;if(B.major===F.major&&B.minor===F.minor&&B.patch===F.patch)return!0}}return!1}return!0}});var lF=T((gI,CE)=>{var pF=Symbol("SemVer ANY");class K8{static get ANY(){return pF}constructor(D,F){if(F=DE(F),D instanceof K8)if(D.loose===!!F.loose)return D;else D=D.value;if(D=D.trim().split(/\s+/).join(" "),w1("comparator",D,F),this.options=F,this.loose=!!F.loose,this.parse(D),this.semver===pF)this.value="";else this.value=this.operator+this.semver.version;w1("comp",this)}parse(D){let F=this.options.loose?FE[uE.COMPARATORLOOSE]:FE[uE.COMPARATOR],u=D.match(F);if(!u)throw TypeError(`Invalid comparator: ${D}`);if(this.operator=u[1]!==void 0?u[1]:"",this.operator==="=")this.operator="";if(!u[2])this.semver=pF;else this.semver=new EE(u[2],this.options.loose)}toString(){return this.value}test(D){if(w1("Comparator.test",D,this.options.loose),this.semver===pF||D===pF)return!0;if(typeof D==="string")try{D=new EE(D,this.options)}catch(F){return!1}return P1(D,this.operator,this.semver,this.options)}intersects(D,F){if(!(D instanceof K8))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new BE(D.value,F).test(this.value)}else if(D.operator===""){if(D.value==="")return!0;return new BE(this.value,F).test(D.semver)}if(F=DE(F),F.includePrerelease&&(this.value==="<0.0.0-0"||D.value==="<0.0.0-0"))return!1;if(!F.includePrerelease&&(this.value.startsWith("<0.0.0")||D.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&D.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&D.operator.startsWith("<"))return!0;if(this.semver.version===D.semver.version&&this.operator.includes("=")&&D.operator.includes("="))return!0;if(P1(this.semver,"<",D.semver,F)&&this.operator.startsWith(">")&&D.operator.startsWith("<"))return!0;if(P1(this.semver,">",D.semver,F)&&this.operator.startsWith("<")&&D.operator.startsWith(">"))return!0;return!1}}CE.exports=K8;var DE=h2(),{safeRe:FE,t:uE}=EF(),P1=j1(),w1=kF(),EE=$D(),BE=dD()});var iF=T((mI,ZE)=>{var eG=dD(),DQ=(D,F,u)=>{try{F=new eG(F,u)}catch(E){return!1}return F.test(D)};ZE.exports=DQ});var HE=T((dI,JE)=>{var FQ=dD(),uQ=(D,F)=>new FQ(D,F).set.map((u)=>u.map((E)=>E.value).join(" ").trim().split(" "));JE.exports=uQ});var XE=T((cI,YE)=>{var EQ=$D(),BQ=dD(),CQ=(D,F,u)=>{let E=null,B=null,C=null;try{C=new BQ(F,u)}catch(Z){return null}return D.forEach((Z)=>{if(C.test(Z)){if(!E||B.compare(Z)===-1)E=Z,B=new EQ(E,u)}}),E};YE.exports=CQ});var QE=T((lI,GE)=>{var ZQ=$D(),JQ=dD(),HQ=(D,F,u)=>{let E=null,B=null,C=null;try{C=new JQ(F,u)}catch(Z){return null}return D.forEach((Z)=>{if(C.test(Z)){if(!E||B.compare(Z)===1)E=Z,B=new ZQ(E,u)}}),E};GE.exports=HQ});var qE=T((pI,zE)=>{var x1=$D(),YQ=dD(),KE=BF(),XQ=(D,F)=>{D=new YQ(D,F);let u=new x1("0.0.0");if(D.test(u))return u;if(u=new x1("0.0.0-0"),D.test(u))return u;u=null;for(let E=0;E<D.set.length;++E){let B=D.set[E],C=null;if(B.forEach((Z)=>{let J=new x1(Z.semver.version);switch(Z.operator){case">":if(J.prerelease.length===0)J.patch++;else J.prerelease.push(0);J.raw=J.format();case"":case">=":if(!C||KE(J,C))C=J;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${Z.operator}`)}}),C&&(!u||KE(u,C)))u=C}if(u&&D.test(u))return u;return null};zE.exports=XQ});var UE=T((iI,AE)=>{var GQ=dD(),QQ=(D,F)=>{try{return new GQ(D,F).range||"*"}catch(u){return null}};AE.exports=QQ});var z8=T((nI,VE)=>{var KQ=$D(),$E=lF(),{ANY:zQ}=$E,qQ=dD(),AQ=iF(),WE=BF(),NE=H8(),UQ=X8(),WQ=Y8(),NQ=(D,F,u,E)=>{D=new KQ(D,E),F=new qQ(F,E);let B,C,Z,J,X;switch(u){case">":B=WE,C=UQ,Z=NE,J=">",X=">=";break;case"<":B=NE,C=WQ,Z=WE,J="<",X="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(AQ(D,F,E))return!1;for(let H=0;H<F.set.length;++H){let Y=F.set[H],G=null,K=null;if(Y.forEach((Q)=>{if(Q.semver===zQ)Q=new $E(">=0.0.0");if(G=G||Q,K=K||Q,B(Q.semver,G.semver,E))G=Q;else if(Z(Q.semver,K.semver,E))K=Q}),G.operator===J||G.operator===X)return!1;if((!K.operator||K.operator===J)&&C(D,K.semver))return!1;else if(K.operator===X&&Z(D,K.semver))return!1}return!0};VE.exports=NQ});var ME=T((aI,IE)=>{var $Q=z8(),VQ=(D,F,u)=>$Q(D,F,">",u);IE.exports=VQ});var OE=T((rI,TE)=>{var IQ=z8(),MQ=(D,F,u)=>IQ(D,F,"<",u);TE.exports=MQ});var RE=T((sI,LE)=>{var _E=dD(),TQ=(D,F,u)=>{return D=new _E(D,u),F=new _E(F,u),D.intersects(F,u)};LE.exports=TQ});var SE=T((oI,jE)=>{var OQ=iF(),_Q=mD();jE.exports=(D,F,u)=>{let E=[],B=null,C=null,Z=D.sort((Y,G)=>_Q(Y,G,u));for(let Y of Z)if(OQ(Y,F,u)){if(C=Y,!B)B=Y}else{if(C)E.push([B,C]);C=null,B=null}if(B)E.push([B,null]);let J=[];for(let[Y,G]of E)if(Y===G)J.push(Y);else if(!G&&Y===Z[0])J.push("*");else if(!G)J.push(`>=${Y}`);else if(Y===Z[0])J.push(`<=${G}`);else J.push(`${Y} - ${G}`);let X=J.join(" || "),H=typeof F.raw==="string"?F.raw:String(F);return X.length<H.length?X:F}});var bE=T((tI,yE)=>{var PE=dD(),y1=lF(),{ANY:k1}=y1,nF=iF(),b1=mD(),LQ=(D,F,u={})=>{if(D===F)return!0;D=new PE(D,u),F=new PE(F,u);let E=!1;D:for(let B of D.set){for(let C of F.set){let Z=jQ(B,C,u);if(E=E||Z!==null,Z)continue D}if(E)return!1}return!0},RQ=[new y1(">=0.0.0-0")],wE=[new y1(">=0.0.0")],jQ=(D,F,u)=>{if(D===F)return!0;if(D.length===1&&D[0].semver===k1)if(F.length===1&&F[0].semver===k1)return!0;else if(u.includePrerelease)D=RQ;else D=wE;if(F.length===1&&F[0].semver===k1)if(u.includePrerelease)return!0;else F=wE;let E=new Set,B,C;for(let Q of D)if(Q.operator===">"||Q.operator===">=")B=xE(B,Q,u);else if(Q.operator==="<"||Q.operator==="<=")C=kE(C,Q,u);else E.add(Q.semver);if(E.size>1)return null;let Z;if(B&&C){if(Z=b1(B.semver,C.semver,u),Z>0)return null;else if(Z===0&&(B.operator!==">="||C.operator!=="<="))return null}for(let Q of E){if(B&&!nF(Q,String(B),u))return null;if(C&&!nF(Q,String(C),u))return null;for(let z of F)if(!nF(Q,String(z),u))return!1;return!0}let J,X,H,Y,G=C&&!u.includePrerelease&&C.semver.prerelease.length?C.semver:!1,K=B&&!u.includePrerelease&&B.semver.prerelease.length?B.semver:!1;if(G&&G.prerelease.length===1&&C.operator==="<"&&G.prerelease[0]===0)G=!1;for(let Q of F){if(Y=Y||Q.operator===">"||Q.operator===">=",H=H||Q.operator==="<"||Q.operator==="<=",B){if(K){if(Q.semver.prerelease&&Q.semver.prerelease.length&&Q.semver.major===K.major&&Q.semver.minor===K.minor&&Q.semver.patch===K.patch)K=!1}if(Q.operator===">"||Q.operator===">="){if(J=xE(B,Q,u),J===Q&&J!==B)return!1}else if(B.operator===">="&&!nF(B.semver,String(Q),u))return!1}if(C){if(G){if(Q.semver.prerelease&&Q.semver.prerelease.length&&Q.semver.major===G.major&&Q.semver.minor===G.minor&&Q.semver.patch===G.patch)G=!1}if(Q.operator==="<"||Q.operator==="<="){if(X=kE(C,Q,u),X===Q&&X!==C)return!1}else if(C.operator==="<="&&!nF(C.semver,String(Q),u))return!1}if(!Q.operator&&(C||B)&&Z!==0)return!1}if(B&&H&&!C&&Z!==0)return!1;if(C&&Y&&!B&&Z!==0)return!1;if(K||G)return!1;return!0},xE=(D,F,u)=>{if(!D)return F;let E=b1(D.semver,F.semver,u);return E>0?D:E<0?F:F.operator===">"&&D.operator===">="?F:D},kE=(D,F,u)=>{if(!D)return F;let E=b1(D.semver,F.semver,u);return E<0?D:E>0?F:F.operator==="<"&&D.operator==="<="?F:D};yE.exports=LQ});var gE=T((eI,hE)=>{var f1=EF(),fE=yF(),SQ=$D(),vE=F1(),PQ=x0(),wQ=q5(),xQ=U5(),kQ=$5(),yQ=E1(),bQ=I5(),fQ=T5(),vQ=_5(),hQ=R5(),gQ=mD(),mQ=S5(),dQ=w5(),cQ=J8(),lQ=b5(),pQ=v5(),iQ=BF(),nQ=H8(),aQ=L1(),rQ=R1(),sQ=Y8(),oQ=X8(),tQ=j1(),eQ=i5(),DK=lF(),FK=dD(),uK=iF(),EK=HE(),BK=XE(),CK=QE(),ZK=qE(),JK=UE(),HK=z8(),YK=ME(),XK=OE(),GK=RE(),QK=SE(),KK=bE();hE.exports={parse:PQ,valid:wQ,clean:xQ,inc:kQ,diff:yQ,major:bQ,minor:fQ,patch:vQ,prerelease:hQ,compare:gQ,rcompare:mQ,compareLoose:dQ,compareBuild:cQ,sort:lQ,rsort:pQ,gt:iQ,lt:nQ,eq:aQ,neq:rQ,gte:sQ,lte:oQ,cmp:tQ,coerce:eQ,Comparator:DK,Range:FK,satisfies:uK,toComparators:EK,maxSatisfying:BK,minSatisfying:CK,minVersion:ZK,validRange:JK,outside:HK,gtr:YK,ltr:XK,intersects:GK,simplifyRange:QK,subset:KK,SemVer:SQ,re:f1.re,src:f1.src,tokens:f1.t,SEMVER_SPEC_VERSION:fE.SEMVER_SPEC_VERSION,RELEASE_TYPES:fE.RELEASE_TYPES,compareIdentifiers:vE.compareIdentifiers,rcompareIdentifiers:vE.rcompareIdentifiers}});var oE=T((YM,sE)=>{var{hasOwnProperty:g1}=Object.prototype,m1=(D,F={})=>{if(typeof F==="string")F={section:F};F.align=F.align===!0,F.newline=F.newline===!0,F.sort=F.sort===!0,F.whitespace=F.whitespace===!0||F.align===!0,F.platform=F.platform||typeof process<"u"&&process.platform,F.bracketedArray=F.bracketedArray!==!1;let u=F.platform==="win32"?`\r
48
48
  `:`
49
- `,E=F.whitespace?" = ":"=",B=[],C=F.sort?Object.keys(D).sort():Object.keys(D),Z=0;if(F.align)Z=X0(C.filter((H)=>D[H]===null||Array.isArray(D[H])||typeof D[H]!=="object").map((H)=>Array.isArray(D[H])?`${H}[]`:H).concat([""]).reduce((H,Y)=>X0(H).length>=X0(Y).length?H:Y)).length;let J="",X=F.bracketedArray?"[]":"";for(let H of C){let Y=D[H];if(Y&&Array.isArray(Y))for(let G of Y)J+=X0(`${H}${X}`).padEnd(Z," ")+E+X0(G)+u;else if(Y&&typeof Y==="object")B.push(H);else J+=X0(H).padEnd(Z," ")+E+X0(Y)+u}if(F.section&&J.length)J="["+X0(F.section)+"]"+(F.newline?u+u:u)+J;for(let H of B){let Y=mE(H,".").join("\\."),G=(F.section?F.section+".":"")+Y,K=x3(D[H],{...F,section:G});if(J.length&&K.length)J+=u;J+=K}return J};function mE(D,F){var u=0,E=0,B=0,C=[];do if(B=D.indexOf(F,u),B!==-1){if(u=B+F.length,B>0&&D[B-1]==="\\")continue;C.push(D.slice(E,B)),E=B+F.length}while(B!==-1);return C.push(D.slice(E)),C}var gE=(D,F={})=>{F.bracketedArray=F.bracketedArray!==!1;let u=Object.create(null),E=u,B=null,C=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,Z=D.split(/[\r\n]+/g),J={};for(let H of Z){if(!H||H.match(/^\s*[;#]/)||H.match(/^\s*$/))continue;let Y=H.match(C);if(!Y)continue;if(Y[1]!==void 0){if(B=z8(Y[1]),B==="__proto__"){E=Object.create(null);continue}E=u[B]=u[B]||Object.create(null);continue}let G=z8(Y[2]),K;if(F.bracketedArray)K=G.length>2&&G.slice(-2)==="[]";else J[G]=(J?.[G]||0)+1,K=J[G]>1;let Q=K?G.slice(0,-2):G;if(Q==="__proto__")continue;let z=Y[3]?z8(Y[4]):!0,q=z==="true"||z==="false"||z==="null"?JSON.parse(z):z;if(K){if(!w3.call(E,Q))E[Q]=[];else if(!Array.isArray(E[Q]))E[Q]=[E[Q]]}if(Array.isArray(E[Q]))E[Q].push(q);else E[Q]=q}let X=[];for(let H of Object.keys(u)){if(!w3.call(u,H)||typeof u[H]!=="object"||Array.isArray(u[H]))continue;let Y=mE(H,".");E=u;let G=Y.pop(),K=G.replace(/\\\./g,".");for(let Q of Y){if(Q==="__proto__")continue;if(!w3.call(E,Q)||typeof E[Q]!=="object")E[Q]=Object.create(null);E=E[Q]}if(E===u&&K===G)continue;E[K]=u[H],X.push(H)}for(let H of X)delete u[H];return u},dE=(D)=>{return D.startsWith('"')&&D.endsWith('"')||D.startsWith("'")&&D.endsWith("'")},X0=(D)=>{if(typeof D!=="string"||D.match(/[=\r\n]/)||D.match(/^\[/)||D.length>1&&dE(D)||D!==D.trim())return JSON.stringify(D);return D.split(";").join("\\;").split("#").join("\\#")},z8=(D,F)=>{if(D=(D||"").trim(),dE(D)){if(D.charAt(0)==="'")D=D.slice(1,-1);try{D=JSON.parse(D)}catch{}}else{let u=!1,E="";for(let B=0,C=D.length;B<C;B++){let Z=D.charAt(B);if(u){if("\\;#".indexOf(Z)!==-1)E+=Z;else E+="\\"+Z;u=!1}else if(";#".indexOf(Z)!==-1)break;else if(Z==="\\")u=!0;else E+=Z}if(u)E+="\\";return E.trim()}return D};cE.exports={parse:gE,decode:gE,stringify:x3,encode:x3,safe:X0,unsafe:z8}});var EB=M((xM,uB)=>{uB.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var CB=M((hM,kK)=>{kK.exports={single:{topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},double:{topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},round:{topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},bold:{topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},singleDouble:{topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},doubleSingle:{topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"}}});var d3=M((gM,m3)=>{var ZB=CB();m3.exports=ZB;m3.exports.default=ZB});var QB=M((dM,GB)=>{var mK=Wu();function g0(D,F){if(!D)return D;F=F||{};let u=F.align||"center";if(u==="left")return D;let E=F.split||`
50
- `,B=F.pad||" ",C=u!=="right"?dK:cK,Z=!1;if(!Array.isArray(D))Z=!0,D=String(D).split(E);let J,X=0;return D=D.map(function(H){return H=String(H),J=mK(H),X=Math.max(J,X),{str:H,width:J}}).map(function(H){return Array(C(X,H.width)+1).join(B)+H.str}),Z?D.join(E):D}g0.left=function(F){return g0(F,{align:"left"})};g0.center=function(F){return g0(F,{align:"center"})};g0.right=function(F){return g0(F,{align:"right"})};GB.exports=g0;function dK(D,F){return Math.floor((D-F)/2)}function cK(D,F){return D-F}});var D2=M((Wz)=>{class D1 extends Error{constructor(D,F,u){super(u);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class yB extends D1{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Wz.CommanderError=D1;Wz.InvalidArgumentError=yB});var L8=M((Mz)=>{var{InvalidArgumentError:Vz}=D2();class bB{constructor(D,F){switch(this.description=F||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,u)=>{if(!this.argChoices.includes(F))throw new Vz(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,u);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Iz(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}Mz.Argument=bB;Mz.humanReadableArgName=Iz});var F1=M((Lz)=>{var{humanReadableArgName:Oz}=L8();class fB{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let F=D.commands.filter((E)=>!E._hidden),u=D._getHelpCommand();if(u&&!u._hidden)F.push(u);if(this.sortSubcommands)F.sort((E,B)=>{return E.name().localeCompare(B.name())});return F}compareOptions(D,F){let u=(E)=>{return E.short?E.short.replace(/^-/,""):E.long.replace(/^--/,"")};return u(D).localeCompare(u(F))}visibleOptions(D){let F=D.options.filter((E)=>!E.hidden),u=D._getHelpOption();if(u&&!u.hidden){let E=u.short&&D._findOption(u.short),B=u.long&&D._findOption(u.long);if(!E&&!B)F.push(u);else if(u.long&&!B)F.push(D.createOption(u.long,u.description));else if(u.short&&!E)F.push(D.createOption(u.short,u.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let u=D.parent;u;u=u.parent){let E=u.options.filter((B)=>!B.hidden);F.push(...E)}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((F)=>{F.description=F.description||D._argsDescription[F.name()]||""});if(D.registeredArguments.find((F)=>F.description))return D.registeredArguments;return[]}subcommandTerm(D){let F=D.registeredArguments.map((u)=>Oz(u)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(F?" "+F:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,F){return F.visibleCommands(D).reduce((u,E)=>{return Math.max(u,this.displayWidth(F.styleSubcommandTerm(F.subcommandTerm(E))))},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce((u,E)=>{return Math.max(u,this.displayWidth(F.styleOptionTerm(F.optionTerm(E))))},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce((u,E)=>{return Math.max(u,this.displayWidth(F.styleOptionTerm(F.optionTerm(E))))},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce((u,E)=>{return Math.max(u,this.displayWidth(F.styleArgumentTerm(F.argumentTerm(E))))},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let u="";for(let E=D.parent;E;E=E.parent)u=E.name()+" "+u;return u+F+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((u)=>JSON.stringify(u)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)F.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)F.push(`env: ${D.envVar}`);if(F.length>0){let u=`(${F.join(", ")})`;if(D.description)return`${D.description} ${u}`;return u}return D.description}argumentDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((u)=>JSON.stringify(u)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let u=`(${F.join(", ")})`;if(D.description)return`${D.description} ${u}`;return u}return D.description}formatItemList(D,F,u){if(F.length===0)return[];return[u.styleTitle(D),...F,""]}groupItems(D,F,u){let E=new Map;return D.forEach((B)=>{let C=u(B);if(!E.has(C))E.set(C,[])}),F.forEach((B)=>{let C=u(B);if(!E.has(C))E.set(C,[]);E.get(C).push(B)}),E}formatHelp(D,F){let u=F.padWidth(D,F),E=F.helpWidth??80;function B(Y,G){return F.formatItem(Y,u,G,F)}let C=[`${F.styleTitle("Usage:")} ${F.styleUsage(F.commandUsage(D))}`,""],Z=F.commandDescription(D);if(Z.length>0)C=C.concat([F.boxWrap(F.styleCommandDescription(Z),E),""]);let J=F.visibleArguments(D).map((Y)=>{return B(F.styleArgumentTerm(F.argumentTerm(Y)),F.styleArgumentDescription(F.argumentDescription(Y)))});if(C=C.concat(this.formatItemList("Arguments:",J,F)),this.groupItems(D.options,F.visibleOptions(D),(Y)=>Y.helpGroupHeading??"Options:").forEach((Y,G)=>{let K=Y.map((Q)=>{return B(F.styleOptionTerm(F.optionTerm(Q)),F.styleOptionDescription(F.optionDescription(Q)))});C=C.concat(this.formatItemList(G,K,F))}),F.showGlobalOptions){let Y=F.visibleGlobalOptions(D).map((G)=>{return B(F.styleOptionTerm(F.optionTerm(G)),F.styleOptionDescription(F.optionDescription(G)))});C=C.concat(this.formatItemList("Global Options:",Y,F))}return this.groupItems(D.commands,F.visibleCommands(D),(Y)=>Y.helpGroup()||"Commands:").forEach((Y,G)=>{let K=Y.map((Q)=>{return B(F.styleSubcommandTerm(F.subcommandTerm(Q)),F.styleSubcommandDescription(F.subcommandDescription(Q)))});C=C.concat(this.formatItemList(G,K,F))}),C.join(`
51
- `)}displayWidth(D){return vB(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F==="[command]")return this.styleSubcommandText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleCommandText(F)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleSubcommandText(F)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,F){return Math.max(F.longestOptionTermLength(D,F),F.longestGlobalOptionTermLength(D,F),F.longestSubcommandTermLength(D,F),F.longestArgumentTermLength(D,F))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,F,u,E){let C=" ".repeat(2);if(!u)return C+D;let Z=D.padEnd(F+D.length-E.displayWidth(D)),J=2,H=(this.helpWidth??80)-F-J-2,Y;if(H<this.minWidthToWrap||E.preformatted(u))Y=u;else Y=E.boxWrap(u,H).replace(/\n/g,`
49
+ `,E=F.whitespace?" = ":"=",B=[],C=F.sort?Object.keys(D).sort():Object.keys(D),Z=0;if(F.align)Z=X0(C.filter((H)=>D[H]===null||Array.isArray(D[H])||typeof D[H]!=="object").map((H)=>Array.isArray(D[H])?`${H}[]`:H).concat([""]).reduce((H,Y)=>X0(H).length>=X0(Y).length?H:Y)).length;let J="",X=F.bracketedArray?"[]":"";for(let H of C){let Y=D[H];if(Y&&Array.isArray(Y))for(let G of Y)J+=X0(`${H}${X}`).padEnd(Z," ")+E+X0(G)+u;else if(Y&&typeof Y==="object")B.push(H);else J+=X0(H).padEnd(Z," ")+E+X0(Y)+u}if(F.section&&J.length)J="["+X0(F.section)+"]"+(F.newline?u+u:u)+J;for(let H of B){let Y=aE(H,".").join("\\."),G=(F.section?F.section+".":"")+Y,K=m1(D[H],{...F,section:G});if(J.length&&K.length)J+=u;J+=K}return J};function aE(D,F){var u=0,E=0,B=0,C=[];do if(B=D.indexOf(F,u),B!==-1){if(u=B+F.length,B>0&&D[B-1]==="\\")continue;C.push(D.slice(E,B)),E=B+F.length}while(B!==-1);return C.push(D.slice(E)),C}var nE=(D,F={})=>{F.bracketedArray=F.bracketedArray!==!1;let u=Object.create(null),E=u,B=null,C=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,Z=D.split(/[\r\n]+/g),J={};for(let H of Z){if(!H||H.match(/^\s*[;#]/)||H.match(/^\s*$/))continue;let Y=H.match(C);if(!Y)continue;if(Y[1]!==void 0){if(B=A8(Y[1]),B==="__proto__"){E=Object.create(null);continue}E=u[B]=u[B]||Object.create(null);continue}let G=A8(Y[2]),K;if(F.bracketedArray)K=G.length>2&&G.slice(-2)==="[]";else J[G]=(J?.[G]||0)+1,K=J[G]>1;let Q=K?G.slice(0,-2):G;if(Q==="__proto__")continue;let z=Y[3]?A8(Y[4]):!0,q=z==="true"||z==="false"||z==="null"?JSON.parse(z):z;if(K){if(!g1.call(E,Q))E[Q]=[];else if(!Array.isArray(E[Q]))E[Q]=[E[Q]]}if(Array.isArray(E[Q]))E[Q].push(q);else E[Q]=q}let X=[];for(let H of Object.keys(u)){if(!g1.call(u,H)||typeof u[H]!=="object"||Array.isArray(u[H]))continue;let Y=aE(H,".");E=u;let G=Y.pop(),K=G.replace(/\\\./g,".");for(let Q of Y){if(Q==="__proto__")continue;if(!g1.call(E,Q)||typeof E[Q]!=="object")E[Q]=Object.create(null);E=E[Q]}if(E===u&&K===G)continue;E[K]=u[H],X.push(H)}for(let H of X)delete u[H];return u},rE=(D)=>{return D.startsWith('"')&&D.endsWith('"')||D.startsWith("'")&&D.endsWith("'")},X0=(D)=>{if(typeof D!=="string"||D.match(/[=\r\n]/)||D.match(/^\[/)||D.length>1&&rE(D)||D!==D.trim())return JSON.stringify(D);return D.split(";").join("\\;").split("#").join("\\#")},A8=(D,F)=>{if(D=(D||"").trim(),rE(D)){if(D.charAt(0)==="'")D=D.slice(1,-1);try{D=JSON.parse(D)}catch{}}else{let u=!1,E="";for(let B=0,C=D.length;B<C;B++){let Z=D.charAt(B);if(u){if("\\;#".indexOf(Z)!==-1)E+=Z;else E+="\\"+Z;u=!1}else if(";#".indexOf(Z)!==-1)break;else if(Z==="\\")u=!0;else E+=Z}if(u)E+="\\";return E.trim()}return D};sE.exports={parse:nE,decode:nE,stringify:m1,encode:m1,safe:X0,unsafe:A8}});var XB=T((vM,YB)=>{YB.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var QB=T((lM,hK)=>{hK.exports={single:{topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},double:{topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},round:{topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},bold:{topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},singleDouble:{topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},doubleSingle:{topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"}}});var s1=T((pM,r1)=>{var KB=QB();r1.exports=KB;r1.exports.default=KB});var NB=T((nM,WB)=>{var iK=_3();function m0(D,F){if(!D)return D;F=F||{};let u=F.align||"center";if(u==="left")return D;let E=F.split||`
50
+ `,B=F.pad||" ",C=u!=="right"?nK:aK,Z=!1;if(!Array.isArray(D))Z=!0,D=String(D).split(E);let J,X=0;return D=D.map(function(H){return H=String(H),J=iK(H),X=Math.max(J,X),{str:H,width:J}}).map(function(H){return Array(C(X,H.width)+1).join(B)+H.str}),Z?D.join(E):D}m0.left=function(F){return m0(F,{align:"left"})};m0.center=function(F){return m0(F,{align:"center"})};m0.right=function(F){return m0(F,{align:"right"})};WB.exports=m0;function nK(D,F){return Math.floor((D-F)/2)}function aK(D,F){return D-F}});var F2=T((Mz)=>{class Hu extends Error{constructor(D,F,u){super(u);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class dB extends Hu{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Mz.CommanderError=Hu;Mz.InvalidArgumentError=dB});var j8=T((Rz)=>{var{InvalidArgumentError:_z}=F2();class cB{constructor(D,F){switch(this.description=F||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,u)=>{if(!this.argChoices.includes(F))throw new _z(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,u);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Lz(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}Rz.Argument=cB;Rz.humanReadableArgName=Lz});var Yu=T((wz)=>{var{humanReadableArgName:Pz}=j8();class lB{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let F=D.commands.filter((E)=>!E._hidden),u=D._getHelpCommand();if(u&&!u._hidden)F.push(u);if(this.sortSubcommands)F.sort((E,B)=>{return E.name().localeCompare(B.name())});return F}compareOptions(D,F){let u=(E)=>{return E.short?E.short.replace(/^-/,""):E.long.replace(/^--/,"")};return u(D).localeCompare(u(F))}visibleOptions(D){let F=D.options.filter((E)=>!E.hidden),u=D._getHelpOption();if(u&&!u.hidden){let E=u.short&&D._findOption(u.short),B=u.long&&D._findOption(u.long);if(!E&&!B)F.push(u);else if(u.long&&!B)F.push(D.createOption(u.long,u.description));else if(u.short&&!E)F.push(D.createOption(u.short,u.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let u=D.parent;u;u=u.parent){let E=u.options.filter((B)=>!B.hidden);F.push(...E)}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((F)=>{F.description=F.description||D._argsDescription[F.name()]||""});if(D.registeredArguments.find((F)=>F.description))return D.registeredArguments;return[]}subcommandTerm(D){let F=D.registeredArguments.map((u)=>Pz(u)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(F?" "+F:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,F){return F.visibleCommands(D).reduce((u,E)=>{return Math.max(u,this.displayWidth(F.styleSubcommandTerm(F.subcommandTerm(E))))},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce((u,E)=>{return Math.max(u,this.displayWidth(F.styleOptionTerm(F.optionTerm(E))))},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce((u,E)=>{return Math.max(u,this.displayWidth(F.styleOptionTerm(F.optionTerm(E))))},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce((u,E)=>{return Math.max(u,this.displayWidth(F.styleArgumentTerm(F.argumentTerm(E))))},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let u="";for(let E=D.parent;E;E=E.parent)u=E.name()+" "+u;return u+F+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((u)=>JSON.stringify(u)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)F.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)F.push(`env: ${D.envVar}`);if(F.length>0){let u=`(${F.join(", ")})`;if(D.description)return`${D.description} ${u}`;return u}return D.description}argumentDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map((u)=>JSON.stringify(u)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let u=`(${F.join(", ")})`;if(D.description)return`${D.description} ${u}`;return u}return D.description}formatItemList(D,F,u){if(F.length===0)return[];return[u.styleTitle(D),...F,""]}groupItems(D,F,u){let E=new Map;return D.forEach((B)=>{let C=u(B);if(!E.has(C))E.set(C,[])}),F.forEach((B)=>{let C=u(B);if(!E.has(C))E.set(C,[]);E.get(C).push(B)}),E}formatHelp(D,F){let u=F.padWidth(D,F),E=F.helpWidth??80;function B(Y,G){return F.formatItem(Y,u,G,F)}let C=[`${F.styleTitle("Usage:")} ${F.styleUsage(F.commandUsage(D))}`,""],Z=F.commandDescription(D);if(Z.length>0)C=C.concat([F.boxWrap(F.styleCommandDescription(Z),E),""]);let J=F.visibleArguments(D).map((Y)=>{return B(F.styleArgumentTerm(F.argumentTerm(Y)),F.styleArgumentDescription(F.argumentDescription(Y)))});if(C=C.concat(this.formatItemList("Arguments:",J,F)),this.groupItems(D.options,F.visibleOptions(D),(Y)=>Y.helpGroupHeading??"Options:").forEach((Y,G)=>{let K=Y.map((Q)=>{return B(F.styleOptionTerm(F.optionTerm(Q)),F.styleOptionDescription(F.optionDescription(Q)))});C=C.concat(this.formatItemList(G,K,F))}),F.showGlobalOptions){let Y=F.visibleGlobalOptions(D).map((G)=>{return B(F.styleOptionTerm(F.optionTerm(G)),F.styleOptionDescription(F.optionDescription(G)))});C=C.concat(this.formatItemList("Global Options:",Y,F))}return this.groupItems(D.commands,F.visibleCommands(D),(Y)=>Y.helpGroup()||"Commands:").forEach((Y,G)=>{let K=Y.map((Q)=>{return B(F.styleSubcommandTerm(F.subcommandTerm(Q)),F.styleSubcommandDescription(F.subcommandDescription(Q)))});C=C.concat(this.formatItemList(G,K,F))}),C.join(`
51
+ `)}displayWidth(D){return pB(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F==="[command]")return this.styleSubcommandText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleCommandText(F)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((F)=>{if(F==="[options]")return this.styleOptionText(F);if(F[0]==="["||F[0]==="<")return this.styleArgumentText(F);return this.styleSubcommandText(F)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,F){return Math.max(F.longestOptionTermLength(D,F),F.longestGlobalOptionTermLength(D,F),F.longestSubcommandTermLength(D,F),F.longestArgumentTermLength(D,F))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,F,u,E){let C=" ".repeat(2);if(!u)return C+D;let Z=D.padEnd(F+D.length-E.displayWidth(D)),J=2,H=(this.helpWidth??80)-F-J-2,Y;if(H<this.minWidthToWrap||E.preformatted(u))Y=u;else Y=E.boxWrap(u,H).replace(/\n/g,`
52
52
  `+" ".repeat(F+J));return C+Z+" ".repeat(J)+Y.replace(/\n/g,`
53
53
  ${C}`)}boxWrap(D,F){if(F<this.minWidthToWrap)return D;let u=D.split(/\r\n|\n/),E=/[\s]*[^\s]+/g,B=[];return u.forEach((C)=>{let Z=C.match(E);if(Z===null){B.push("");return}let J=[Z.shift()],X=this.displayWidth(J[0]);Z.forEach((H)=>{let Y=this.displayWidth(H);if(X+Y<=F){J.push(H),X+=Y;return}B.push(J.join(""));let G=H.trimStart();J=[G],X=this.displayWidth(G)}),B.push(J.join(""))}),B.join(`
54
- `)}}function vB(D){let F=/\x1b\[\d*(;\d*)*m/g;return D.replace(F,"")}Lz.Help=fB;Lz.stripColor=vB});var u1=M((wz)=>{var{InvalidArgumentError:Sz}=D2();class gB{constructor(D,F){this.flags=D,this.description=F||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let u=Pz(D);if(this.short=u.shortFlag,this.long=u.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let F=D;if(typeof D==="string")F={[D]:!0};return this.implied=Object.assign(this.implied||{},F),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,u)=>{if(!this.argChoices.includes(F))throw new Sz(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,u);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return hB(this.name().replace(/^no-/,""));return hB(this.name())}helpGroup(D){return this.helpGroupHeading=D,this}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class mB{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((F)=>{if(F.negate)this.negativeOptions.set(F.attributeName(),F);else this.positiveOptions.set(F.attributeName(),F)}),this.negativeOptions.forEach((F,u)=>{if(this.positiveOptions.has(u))this.dualOptions.add(u)})}valueFromOption(D,F){let u=F.attributeName();if(!this.dualOptions.has(u))return!0;let E=this.negativeOptions.get(u).presetArg,B=E!==void 0?E:!1;return F.negate===(B===D)}}function hB(D){return D.split("-").reduce((F,u)=>{return F+u[0].toUpperCase()+u.slice(1)})}function Pz(D){let F,u,E=/^-[^-]$/,B=/^--[^-]/,C=D.split(/[ |,]+/).concat("guard");if(E.test(C[0]))F=C.shift();if(B.test(C[0]))u=C.shift();if(!F&&E.test(C[0]))F=C.shift();if(!F&&B.test(C[0]))F=u,u=C.shift();if(C[0].startsWith("-")){let Z=C[0],J=`option creation failed due to '${Z}' in option flags '${D}'`;if(/^-[^-][^-]/.test(Z))throw Error(`${J}
54
+ `)}}function pB(D){let F=/\x1b\[\d*(;\d*)*m/g;return D.replace(F,"")}wz.Help=lB;wz.stripColor=pB});var Xu=T((fz)=>{var{InvalidArgumentError:yz}=F2();class nB{constructor(D,F){this.flags=D,this.description=F||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let u=bz(D);if(this.short=u.shortFlag,this.long=u.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let F=D;if(typeof D==="string")F={[D]:!0};return this.implied=Object.assign(this.implied||{},F),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_collectValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.push(D),F}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,u)=>{if(!this.argChoices.includes(F))throw new yz(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(F,u);return F},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return iB(this.name().replace(/^no-/,""));return iB(this.name())}helpGroup(D){return this.helpGroupHeading=D,this}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class aB{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((F)=>{if(F.negate)this.negativeOptions.set(F.attributeName(),F);else this.positiveOptions.set(F.attributeName(),F)}),this.negativeOptions.forEach((F,u)=>{if(this.positiveOptions.has(u))this.dualOptions.add(u)})}valueFromOption(D,F){let u=F.attributeName();if(!this.dualOptions.has(u))return!0;let E=this.negativeOptions.get(u).presetArg,B=E!==void 0?E:!1;return F.negate===(B===D)}}function iB(D){return D.split("-").reduce((F,u)=>{return F+u[0].toUpperCase()+u.slice(1)})}function bz(D){let F,u,E=/^-[^-]$/,B=/^--[^-]/,C=D.split(/[ |,]+/).concat("guard");if(E.test(C[0]))F=C.shift();if(B.test(C[0]))u=C.shift();if(!F&&E.test(C[0]))F=C.shift();if(!F&&B.test(C[0]))F=u,u=C.shift();if(C[0].startsWith("-")){let Z=C[0],J=`option creation failed due to '${Z}' in option flags '${D}'`;if(/^-[^-][^-]/.test(Z))throw Error(`${J}
55
55
  - a short flag is a single dash and a single character
56
56
  - either use a single dash and a single character (for a short flag)
57
57
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(E.test(Z))throw Error(`${J}
58
58
  - too many short flags`);if(B.test(Z))throw Error(`${J}
59
59
  - too many long flags`);throw Error(`${J}
60
- - unrecognised flag format`)}if(F===void 0&&u===void 0)throw Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:F,longFlag:u}}wz.Option=gB;wz.DualOptions=mB});var dB=M((fz)=>{function yz(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let u=[];for(let E=0;E<=D.length;E++)u[E]=[E];for(let E=0;E<=F.length;E++)u[0][E]=E;for(let E=1;E<=F.length;E++)for(let B=1;B<=D.length;B++){let C=1;if(D[B-1]===F[E-1])C=0;else C=1;if(u[B][E]=Math.min(u[B-1][E]+1,u[B][E-1]+1,u[B-1][E-1]+C),B>1&&E>1&&D[B-1]===F[E-2]&&D[B-2]===F[E-1])u[B][E]=Math.min(u[B][E],u[B-2][E-2]+1)}return u[D.length][F.length]}function bz(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let u=D.startsWith("--");if(u)D=D.slice(2),F=F.map((Z)=>Z.slice(2));let E=[],B=3,C=0.4;if(F.forEach((Z)=>{if(Z.length<=1)return;let J=yz(D,Z),X=Math.max(D.length,Z.length);if((X-J)/X>C){if(J<B)B=J,E=[Z];else if(J===B)E.push(Z)}}),E.sort((Z,J)=>Z.localeCompare(J)),u)E=E.map((Z)=>`--${Z}`);if(E.length>1)return`
60
+ - unrecognised flag format`)}if(F===void 0&&u===void 0)throw Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:F,longFlag:u}}fz.Option=nB;fz.DualOptions=aB});var rB=T((dz)=>{function gz(D,F){if(Math.abs(D.length-F.length)>3)return Math.max(D.length,F.length);let u=[];for(let E=0;E<=D.length;E++)u[E]=[E];for(let E=0;E<=F.length;E++)u[0][E]=E;for(let E=1;E<=F.length;E++)for(let B=1;B<=D.length;B++){let C=1;if(D[B-1]===F[E-1])C=0;else C=1;if(u[B][E]=Math.min(u[B-1][E]+1,u[B][E-1]+1,u[B-1][E-1]+C),B>1&&E>1&&D[B-1]===F[E-2]&&D[B-2]===F[E-1])u[B][E]=Math.min(u[B][E],u[B-2][E-2]+1)}return u[D.length][F.length]}function mz(D,F){if(!F||F.length===0)return"";F=Array.from(new Set(F));let u=D.startsWith("--");if(u)D=D.slice(2),F=F.map((Z)=>Z.slice(2));let E=[],B=3,C=0.4;if(F.forEach((Z)=>{if(Z.length<=1)return;let J=gz(D,Z),X=Math.max(D.length,Z.length);if((X-J)/X>C){if(J<B)B=J,E=[Z];else if(J===B)E.push(Z)}}),E.sort((Z,J)=>Z.localeCompare(J)),u)E=E.map((Z)=>`--${Z}`);if(E.length>1)return`
61
61
  (Did you mean one of ${E.join(", ")}?)`;if(E.length===1)return`
62
- (Did you mean ${E[0]}?)`;return""}fz.suggestSimilar=bz});var iB=M((pz)=>{var hz=p("node:events").EventEmitter,E1=p("node:child_process"),G0=p("node:path"),R8=p("node:fs"),s=p("node:process"),{Argument:gz,humanReadableArgName:mz}=L8(),{CommanderError:B1}=D2(),{Help:dz,stripColor:cz}=F1(),{Option:cB,DualOptions:lz}=u1(),{suggestSimilar:lB}=dB();class Z1 extends hz{constructor(D){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=D||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(F)=>s.stdout.write(F),writeErr:(F)=>s.stderr.write(F),outputError:(F,u)=>u(F),getOutHelpWidth:()=>s.stdout.isTTY?s.stdout.columns:void 0,getErrHelpWidth:()=>s.stderr.isTTY?s.stderr.columns:void 0,getOutHasColors:()=>C1()??(s.stdout.isTTY&&s.stdout.hasColors?.()),getErrHasColors:()=>C1()??(s.stderr.isTTY&&s.stderr.hasColors?.()),stripColor:(F)=>cz(F)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let F=this;F;F=F.parent)D.push(F);return D}command(D,F,u){let E=F,B=u;if(typeof E==="object"&&E!==null)B=E,E=null;B=B||{};let[,C,Z]=D.match(/([^ ]+) *(.*)/),J=this.createCommand(C);if(E)J.description(E),J._executableHandler=!0;if(B.isDefault)this._defaultCommandName=J._name;if(J._hidden=!!(B.noHelp||B.hidden),J._executableFile=B.executableFile||null,Z)J.arguments(Z);if(this._registerCommand(J),J.parent=this,J.copyInheritedSettings(this),E)return this;return J}createCommand(D){return new Z1(D)}createHelp(){return Object.assign(new dz,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...D},this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,F){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
63
- - specify the name in Command constructor or using .name()`);if(F=F||{},F.isDefault)this._defaultCommandName=D._name;if(F.noHelp||F.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,F){return new gz(D,F)}argument(D,F,u,E){let B=this.createArgument(D,F);if(typeof u==="function")B.default(E).argParser(u);else B.default(u);return this.addArgument(B),this}arguments(D){return D.trim().split(/ +/).forEach((F)=>{this.argument(F)}),this}addArgument(D){let F=this.registeredArguments.slice(-1)[0];if(F?.variadic)throw Error(`only the last argument can be variadic '${F.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,F){if(typeof D==="boolean"){if(this._addImplicitHelpCommand=D,D&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let u=D??"help [command]",[,E,B]=u.match(/([^ ]+) *(.*)/),C=F??"display help for command",Z=this.createCommand(E);if(Z.helpOption(!1),B)Z.arguments(B);if(C)Z.description(C);if(this._addImplicitHelpCommand=!0,this._helpCommand=Z,D||F)this._initCommandGroup(Z);return this}addHelpCommand(D,F){if(typeof D!=="object")return this.helpCommand(D,F),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this._initCommandGroup(D),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,F){let u=["preSubcommand","preAction","postAction"];if(!u.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
64
- Expecting one of '${u.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(F);else this._lifeCycleHooks[D]=[F];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(F)=>{if(F.code!=="commander.executeSubCommandAsync")throw F};return this}_exit(D,F,u){if(this._exitCallback)this._exitCallback(new B1(D,F,u));s.exit(D)}action(D){let F=(u)=>{let E=this.registeredArguments.length,B=u.slice(0,E);if(this._storeOptionsAsProperties)B[E]=this;else B[E]=this.opts();return B.push(this),D.apply(this,B)};return this._actionHandler=F,this}createOption(D,F){return new cB(D,F)}_callParseArg(D,F,u,E){try{return D.parseArg(F,u)}catch(B){if(B.code==="commander.invalidArgument"){let C=`${E} ${B.message}`;this.error(C,{exitCode:B.exitCode,code:B.code})}throw B}}_registerOption(D){let F=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(F){let u=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${u}'
65
- - already used by option '${F.flags}'`)}this._initOptionGroup(D),this.options.push(D)}_registerCommand(D){let F=(E)=>{return[E.name()].concat(E.aliases())},u=F(D).find((E)=>this._findCommand(E));if(u){let E=F(this._findCommand(u)).join("|"),B=F(D).join("|");throw Error(`cannot add command '${B}' as already have command '${E}'`)}this._initCommandGroup(D),this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),u=D.attributeName();if(D.negate){let B=D.long.replace(/^--no-/,"--");if(!this._findOption(B))this.setOptionValueWithSource(u,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(u,D.defaultValue,"default");let E=(B,C,Z)=>{if(B==null&&D.presetArg!==void 0)B=D.presetArg;let J=this.getOptionValue(u);if(B!==null&&D.parseArg)B=this._callParseArg(D,B,J,C);else if(B!==null&&D.variadic)B=D._collectValue(B,J);if(B==null)if(D.negate)B=!1;else if(D.isBoolean()||D.optional)B=!0;else B="";this.setOptionValueWithSource(u,B,Z)};if(this.on("option:"+F,(B)=>{let C=`error: option '${D.flags}' argument '${B}' is invalid.`;E(B,C,"cli")}),D.envVar)this.on("optionEnv:"+F,(B)=>{let C=`error: option '${D.flags}' value '${B}' from env '${D.envVar}' is invalid.`;E(B,C,"env")});return this}_optionEx(D,F,u,E,B){if(typeof F==="object"&&F instanceof cB)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let C=this.createOption(F,u);if(C.makeOptionMandatory(!!D.mandatory),typeof E==="function")C.default(B).argParser(E);else if(E instanceof RegExp){let Z=E;E=(J,X)=>{let H=Z.exec(J);return H?H[0]:X},C.default(B).argParser(E)}else C.default(E);return this.addOption(C)}option(D,F,u,E){return this._optionEx({},D,F,u,E)}requiredOption(D,F,u,E){return this._optionEx({mandatory:!0},D,F,u,E)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,F){return this.setOptionValueWithSource(D,F,void 0)}setOptionValueWithSource(D,F,u){if(this._storeOptionsAsProperties)this[D]=F;else this._optionValues[D]=F;return this._optionValueSources[D]=u,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let F;return this._getCommandAndAncestors().forEach((u)=>{if(u.getOptionValueSource(D)!==void 0)F=u.getOptionValueSource(D)}),F}_prepareUserArgs(D,F){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(F=F||{},D===void 0&&F.from===void 0){if(s.versions?.electron)F.from="electron";let E=s.execArgv??[];if(E.includes("-e")||E.includes("--eval")||E.includes("-p")||E.includes("--print"))F.from="eval"}if(D===void 0)D=s.argv;this.rawArgs=D.slice();let u;switch(F.from){case void 0:case"node":this._scriptPath=D[1],u=D.slice(2);break;case"electron":if(s.defaultApp)this._scriptPath=D[1],u=D.slice(2);else u=D.slice(1);break;case"user":u=D.slice(0);break;case"eval":u=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${F.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",u}parse(D,F){this._prepareForParse();let u=this._prepareUserArgs(D,F);return this._parseCommand([],u),this}async parseAsync(D,F){this._prepareForParse();let u=this._prepareUserArgs(D,F);return await this._parseCommand([],u),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
66
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(D,F,u){if(R8.existsSync(D))return;let E=F?`searched for local subcommand relative to directory '${F}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",B=`'${D}' does not exist
62
+ (Did you mean ${E[0]}?)`;return""}dz.suggestSimilar=mz});var eB=T((sz)=>{var lz=p("node:events").EventEmitter,Gu=p("node:child_process"),G0=p("node:path"),S8=p("node:fs"),s=p("node:process"),{Argument:pz,humanReadableArgName:iz}=j8(),{CommanderError:Qu}=F2(),{Help:nz,stripColor:az}=Yu(),{Option:sB,DualOptions:rz}=Xu(),{suggestSimilar:oB}=rB();class zu extends lz{constructor(D){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=D||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(F)=>s.stdout.write(F),writeErr:(F)=>s.stderr.write(F),outputError:(F,u)=>u(F),getOutHelpWidth:()=>s.stdout.isTTY?s.stdout.columns:void 0,getErrHelpWidth:()=>s.stderr.isTTY?s.stderr.columns:void 0,getOutHasColors:()=>Ku()??(s.stdout.isTTY&&s.stdout.hasColors?.()),getErrHasColors:()=>Ku()??(s.stderr.isTTY&&s.stderr.hasColors?.()),stripColor:(F)=>az(F)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let F=this;F;F=F.parent)D.push(F);return D}command(D,F,u){let E=F,B=u;if(typeof E==="object"&&E!==null)B=E,E=null;B=B||{};let[,C,Z]=D.match(/([^ ]+) *(.*)/),J=this.createCommand(C);if(E)J.description(E),J._executableHandler=!0;if(B.isDefault)this._defaultCommandName=J._name;if(J._hidden=!!(B.noHelp||B.hidden),J._executableFile=B.executableFile||null,Z)J.arguments(Z);if(this._registerCommand(J),J.parent=this,J.copyInheritedSettings(this),E)return this;return J}createCommand(D){return new zu(D)}createHelp(){return Object.assign(new nz,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...D},this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,F){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
63
+ - specify the name in Command constructor or using .name()`);if(F=F||{},F.isDefault)this._defaultCommandName=D._name;if(F.noHelp||F.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,F){return new pz(D,F)}argument(D,F,u,E){let B=this.createArgument(D,F);if(typeof u==="function")B.default(E).argParser(u);else B.default(u);return this.addArgument(B),this}arguments(D){return D.trim().split(/ +/).forEach((F)=>{this.argument(F)}),this}addArgument(D){let F=this.registeredArguments.slice(-1)[0];if(F?.variadic)throw Error(`only the last argument can be variadic '${F.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,F){if(typeof D==="boolean"){if(this._addImplicitHelpCommand=D,D&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let u=D??"help [command]",[,E,B]=u.match(/([^ ]+) *(.*)/),C=F??"display help for command",Z=this.createCommand(E);if(Z.helpOption(!1),B)Z.arguments(B);if(C)Z.description(C);if(this._addImplicitHelpCommand=!0,this._helpCommand=Z,D||F)this._initCommandGroup(Z);return this}addHelpCommand(D,F){if(typeof D!=="object")return this.helpCommand(D,F),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this._initCommandGroup(D),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,F){let u=["preSubcommand","preAction","postAction"];if(!u.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
64
+ Expecting one of '${u.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(F);else this._lifeCycleHooks[D]=[F];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(F)=>{if(F.code!=="commander.executeSubCommandAsync")throw F};return this}_exit(D,F,u){if(this._exitCallback)this._exitCallback(new Qu(D,F,u));s.exit(D)}action(D){let F=(u)=>{let E=this.registeredArguments.length,B=u.slice(0,E);if(this._storeOptionsAsProperties)B[E]=this;else B[E]=this.opts();return B.push(this),D.apply(this,B)};return this._actionHandler=F,this}createOption(D,F){return new sB(D,F)}_callParseArg(D,F,u,E){try{return D.parseArg(F,u)}catch(B){if(B.code==="commander.invalidArgument"){let C=`${E} ${B.message}`;this.error(C,{exitCode:B.exitCode,code:B.code})}throw B}}_registerOption(D){let F=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(F){let u=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${u}'
65
+ - already used by option '${F.flags}'`)}this._initOptionGroup(D),this.options.push(D)}_registerCommand(D){let F=(E)=>{return[E.name()].concat(E.aliases())},u=F(D).find((E)=>this._findCommand(E));if(u){let E=F(this._findCommand(u)).join("|"),B=F(D).join("|");throw Error(`cannot add command '${B}' as already have command '${E}'`)}this._initCommandGroup(D),this.commands.push(D)}addOption(D){this._registerOption(D);let F=D.name(),u=D.attributeName();if(D.negate){let B=D.long.replace(/^--no-/,"--");if(!this._findOption(B))this.setOptionValueWithSource(u,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(u,D.defaultValue,"default");let E=(B,C,Z)=>{if(B==null&&D.presetArg!==void 0)B=D.presetArg;let J=this.getOptionValue(u);if(B!==null&&D.parseArg)B=this._callParseArg(D,B,J,C);else if(B!==null&&D.variadic)B=D._collectValue(B,J);if(B==null)if(D.negate)B=!1;else if(D.isBoolean()||D.optional)B=!0;else B="";this.setOptionValueWithSource(u,B,Z)};if(this.on("option:"+F,(B)=>{let C=`error: option '${D.flags}' argument '${B}' is invalid.`;E(B,C,"cli")}),D.envVar)this.on("optionEnv:"+F,(B)=>{let C=`error: option '${D.flags}' value '${B}' from env '${D.envVar}' is invalid.`;E(B,C,"env")});return this}_optionEx(D,F,u,E,B){if(typeof F==="object"&&F instanceof sB)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let C=this.createOption(F,u);if(C.makeOptionMandatory(!!D.mandatory),typeof E==="function")C.default(B).argParser(E);else if(E instanceof RegExp){let Z=E;E=(J,X)=>{let H=Z.exec(J);return H?H[0]:X},C.default(B).argParser(E)}else C.default(E);return this.addOption(C)}option(D,F,u,E){return this._optionEx({},D,F,u,E)}requiredOption(D,F,u,E){return this._optionEx({mandatory:!0},D,F,u,E)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,F){return this.setOptionValueWithSource(D,F,void 0)}setOptionValueWithSource(D,F,u){if(this._storeOptionsAsProperties)this[D]=F;else this._optionValues[D]=F;return this._optionValueSources[D]=u,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let F;return this._getCommandAndAncestors().forEach((u)=>{if(u.getOptionValueSource(D)!==void 0)F=u.getOptionValueSource(D)}),F}_prepareUserArgs(D,F){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(F=F||{},D===void 0&&F.from===void 0){if(s.versions?.electron)F.from="electron";let E=s.execArgv??[];if(E.includes("-e")||E.includes("--eval")||E.includes("-p")||E.includes("--print"))F.from="eval"}if(D===void 0)D=s.argv;this.rawArgs=D.slice();let u;switch(F.from){case void 0:case"node":this._scriptPath=D[1],u=D.slice(2);break;case"electron":if(s.defaultApp)this._scriptPath=D[1],u=D.slice(2);else u=D.slice(1);break;case"user":u=D.slice(0);break;case"eval":u=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${F.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",u}parse(D,F){this._prepareForParse();let u=this._prepareUserArgs(D,F);return this._parseCommand([],u),this}async parseAsync(D,F){this._prepareForParse();let u=this._prepareUserArgs(D,F);return await this._parseCommand([],u),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
66
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(D,F,u){if(S8.existsSync(D))return;let E=F?`searched for local subcommand relative to directory '${F}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",B=`'${D}' does not exist
67
67
  - if '${u}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
68
68
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
69
- - ${E}`;throw Error(B)}_executeSubCommand(D,F){F=F.slice();let u=!1,E=[".js",".ts",".tsx",".mjs",".cjs"];function B(H,Y){let G=G0.resolve(H,Y);if(R8.existsSync(G))return G;if(E.includes(G0.extname(Y)))return;let K=E.find((Q)=>R8.existsSync(`${G}${Q}`));if(K)return`${G}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let C=D._executableFile||`${this._name}-${D._name}`,Z=this._executableDir||"";if(this._scriptPath){let H;try{H=R8.realpathSync(this._scriptPath)}catch{H=this._scriptPath}Z=G0.resolve(G0.dirname(H),Z)}if(Z){let H=B(Z,C);if(!H&&!D._executableFile&&this._scriptPath){let Y=G0.basename(this._scriptPath,G0.extname(this._scriptPath));if(Y!==this._name)H=B(Z,`${Y}-${D._name}`)}C=H||C}u=E.includes(G0.extname(C));let J;if(s.platform!=="win32")if(u)F.unshift(C),F=pB(s.execArgv).concat(F),J=E1.spawn(s.argv[0],F,{stdio:"inherit"});else J=E1.spawn(C,F,{stdio:"inherit"});else this._checkForMissingExecutable(C,Z,D._name),F.unshift(C),F=pB(s.execArgv).concat(F),J=E1.spawn(s.execPath,F,{stdio:"inherit"});if(!J.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((Y)=>{s.on(Y,()=>{if(J.killed===!1&&J.exitCode===null)J.kill(Y)})});let X=this._exitCallback;J.on("close",(H)=>{if(H=H??1,!X)s.exit(H);else X(new B1(H,"commander.executeSubCommandAsync","(close)"))}),J.on("error",(H)=>{if(H.code==="ENOENT")this._checkForMissingExecutable(C,Z,D._name);else if(H.code==="EACCES")throw Error(`'${C}' not executable`);if(!X)s.exit(1);else{let Y=new B1(1,"commander.executeSubCommandAsync","(error)");Y.nestedError=H,X(Y)}}),this.runningCommand=J}_dispatchSubcommand(D,F,u){let E=this._findCommand(D);if(!E)this.help({error:!0});E._prepareForParse();let B;return B=this._chainOrCallSubCommandHook(B,E,"preSubcommand"),B=this._chainOrCall(B,()=>{if(E._executableHandler)this._executeSubCommand(E,F.concat(u));else return E._parseCommand(F,u)}),B}_dispatchHelpCommand(D){if(!D)this.help();let F=this._findCommand(D);if(F&&!F._executableHandler)F.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,F)=>{if(D.required&&this.args[F]==null)this.missingArgument(D.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let D=(u,E,B)=>{let C=E;if(E!==null&&u.parseArg){let Z=`error: command-argument value '${E}' is invalid for argument '${u.name()}'.`;C=this._callParseArg(u,E,B,Z)}return C};this._checkNumberOfArguments();let F=[];this.registeredArguments.forEach((u,E)=>{let B=u.defaultValue;if(u.variadic){if(E<this.args.length){if(B=this.args.slice(E),u.parseArg)B=B.reduce((C,Z)=>{return D(u,Z,C)},u.defaultValue)}else if(B===void 0)B=[]}else if(E<this.args.length){if(B=this.args[E],u.parseArg)B=D(u,B,u.defaultValue)}F[E]=B}),this.processedArgs=F}_chainOrCall(D,F){if(D?.then&&typeof D.then==="function")return D.then(()=>F());return F()}_chainOrCallHooks(D,F){let u=D,E=[];if(this._getCommandAndAncestors().reverse().filter((B)=>B._lifeCycleHooks[F]!==void 0).forEach((B)=>{B._lifeCycleHooks[F].forEach((C)=>{E.push({hookedCommand:B,callback:C})})}),F==="postAction")E.reverse();return E.forEach((B)=>{u=this._chainOrCall(u,()=>{return B.callback(B.hookedCommand,this)})}),u}_chainOrCallSubCommandHook(D,F,u){let E=D;if(this._lifeCycleHooks[u]!==void 0)this._lifeCycleHooks[u].forEach((B)=>{E=this._chainOrCall(E,()=>{return B(this,F)})});return E}_parseCommand(D,F){let u=this.parseOptions(F);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(u.operands),F=u.unknown,this.args=D.concat(F),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),F);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(F),this._dispatchSubcommand(this._defaultCommandName,D,F);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(u.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let E=()=>{if(u.unknown.length>0)this.unknownOption(u.unknown[0])},B=`command:${this.name()}`;if(this._actionHandler){E(),this._processArguments();let C;if(C=this._chainOrCallHooks(C,"preAction"),C=this._chainOrCall(C,()=>this._actionHandler(this.processedArgs)),this.parent)C=this._chainOrCall(C,()=>{this.parent.emit(B,D,F)});return C=this._chainOrCallHooks(C,"postAction"),C}if(this.parent?.listenerCount(B))E(),this._processArguments(),this.parent.emit(B,D,F);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,F);if(this.listenerCount("command:*"))this.emit("command:*",D,F);else if(this.commands.length)this.unknownCommand();else E(),this._processArguments()}else if(this.commands.length)E(),this.help({error:!0});else E(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((F)=>F._name===D||F._aliases.includes(D))}_findOption(D){return this.options.find((F)=>F.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((F)=>{if(F.mandatory&&D.getOptionValue(F.attributeName())===void 0)D.missingMandatoryOptionValue(F)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((u)=>{let E=u.attributeName();if(this.getOptionValue(E)===void 0)return!1;return this.getOptionValueSource(E)!=="default"});D.filter((u)=>u.conflictsWith.length>0).forEach((u)=>{let E=D.find((B)=>u.conflictsWith.includes(B.attributeName()));if(E)this._conflictingOption(u,E)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let F=[],u=[],E=F;function B(H){return H.length>1&&H[0]==="-"}let C=(H)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(H))return!1;return!this._getCommandAndAncestors().some((Y)=>Y.options.map((G)=>G.short).some((G)=>/^-\d$/.test(G)))},Z=null,J=null,X=0;while(X<D.length||J){let H=J??D[X++];if(J=null,H==="--"){if(E===u)E.push(H);E.push(...D.slice(X));break}if(Z&&(!B(H)||C(H))){this.emit(`option:${Z.name()}`,H);continue}if(Z=null,B(H)){let Y=this._findOption(H);if(Y){if(Y.required){let G=D[X++];if(G===void 0)this.optionMissingArgument(Y);this.emit(`option:${Y.name()}`,G)}else if(Y.optional){let G=null;if(X<D.length&&(!B(D[X])||C(D[X])))G=D[X++];this.emit(`option:${Y.name()}`,G)}else this.emit(`option:${Y.name()}`);Z=Y.variadic?Y:null;continue}}if(H.length>2&&H[0]==="-"&&H[1]!=="-"){let Y=this._findOption(`-${H[1]}`);if(Y){if(Y.required||Y.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${Y.name()}`,H.slice(2));else this.emit(`option:${Y.name()}`),J=`-${H.slice(2)}`;continue}}if(/^--[^=]+=/.test(H)){let Y=H.indexOf("="),G=this._findOption(H.slice(0,Y));if(G&&(G.required||G.optional)){this.emit(`option:${G.name()}`,H.slice(Y+1));continue}}if(E===F&&B(H)&&!(this.commands.length===0&&C(H)))E=u;if((this._enablePositionalOptions||this._passThroughOptions)&&F.length===0&&u.length===0){if(this._findCommand(H)){F.push(H),u.push(...D.slice(X));break}else if(this._getHelpCommand()&&H===this._getHelpCommand().name()){F.push(H,...D.slice(X));break}else if(this._defaultCommandName){u.push(H,...D.slice(X));break}}if(this._passThroughOptions){E.push(H,...D.slice(X));break}E.push(H)}return{operands:F,unknown:u}}opts(){if(this._storeOptionsAsProperties){let D={},F=this.options.length;for(let u=0;u<F;u++){let E=this.options[u].attributeName();D[E]=E===this._versionOptionName?this._version:this[E]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,F)=>Object.assign(D,F.opts()),{})}error(D,F){if(this._outputConfiguration.outputError(`${D}
69
+ - ${E}`;throw Error(B)}_executeSubCommand(D,F){F=F.slice();let u=!1,E=[".js",".ts",".tsx",".mjs",".cjs"];function B(H,Y){let G=G0.resolve(H,Y);if(S8.existsSync(G))return G;if(E.includes(G0.extname(Y)))return;let K=E.find((Q)=>S8.existsSync(`${G}${Q}`));if(K)return`${G}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let C=D._executableFile||`${this._name}-${D._name}`,Z=this._executableDir||"";if(this._scriptPath){let H;try{H=S8.realpathSync(this._scriptPath)}catch{H=this._scriptPath}Z=G0.resolve(G0.dirname(H),Z)}if(Z){let H=B(Z,C);if(!H&&!D._executableFile&&this._scriptPath){let Y=G0.basename(this._scriptPath,G0.extname(this._scriptPath));if(Y!==this._name)H=B(Z,`${Y}-${D._name}`)}C=H||C}u=E.includes(G0.extname(C));let J;if(s.platform!=="win32")if(u)F.unshift(C),F=tB(s.execArgv).concat(F),J=Gu.spawn(s.argv[0],F,{stdio:"inherit"});else J=Gu.spawn(C,F,{stdio:"inherit"});else this._checkForMissingExecutable(C,Z,D._name),F.unshift(C),F=tB(s.execArgv).concat(F),J=Gu.spawn(s.execPath,F,{stdio:"inherit"});if(!J.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((Y)=>{s.on(Y,()=>{if(J.killed===!1&&J.exitCode===null)J.kill(Y)})});let X=this._exitCallback;J.on("close",(H)=>{if(H=H??1,!X)s.exit(H);else X(new Qu(H,"commander.executeSubCommandAsync","(close)"))}),J.on("error",(H)=>{if(H.code==="ENOENT")this._checkForMissingExecutable(C,Z,D._name);else if(H.code==="EACCES")throw Error(`'${C}' not executable`);if(!X)s.exit(1);else{let Y=new Qu(1,"commander.executeSubCommandAsync","(error)");Y.nestedError=H,X(Y)}}),this.runningCommand=J}_dispatchSubcommand(D,F,u){let E=this._findCommand(D);if(!E)this.help({error:!0});E._prepareForParse();let B;return B=this._chainOrCallSubCommandHook(B,E,"preSubcommand"),B=this._chainOrCall(B,()=>{if(E._executableHandler)this._executeSubCommand(E,F.concat(u));else return E._parseCommand(F,u)}),B}_dispatchHelpCommand(D){if(!D)this.help();let F=this._findCommand(D);if(F&&!F._executableHandler)F.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,F)=>{if(D.required&&this.args[F]==null)this.missingArgument(D.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let D=(u,E,B)=>{let C=E;if(E!==null&&u.parseArg){let Z=`error: command-argument value '${E}' is invalid for argument '${u.name()}'.`;C=this._callParseArg(u,E,B,Z)}return C};this._checkNumberOfArguments();let F=[];this.registeredArguments.forEach((u,E)=>{let B=u.defaultValue;if(u.variadic){if(E<this.args.length){if(B=this.args.slice(E),u.parseArg)B=B.reduce((C,Z)=>{return D(u,Z,C)},u.defaultValue)}else if(B===void 0)B=[]}else if(E<this.args.length){if(B=this.args[E],u.parseArg)B=D(u,B,u.defaultValue)}F[E]=B}),this.processedArgs=F}_chainOrCall(D,F){if(D?.then&&typeof D.then==="function")return D.then(()=>F());return F()}_chainOrCallHooks(D,F){let u=D,E=[];if(this._getCommandAndAncestors().reverse().filter((B)=>B._lifeCycleHooks[F]!==void 0).forEach((B)=>{B._lifeCycleHooks[F].forEach((C)=>{E.push({hookedCommand:B,callback:C})})}),F==="postAction")E.reverse();return E.forEach((B)=>{u=this._chainOrCall(u,()=>{return B.callback(B.hookedCommand,this)})}),u}_chainOrCallSubCommandHook(D,F,u){let E=D;if(this._lifeCycleHooks[u]!==void 0)this._lifeCycleHooks[u].forEach((B)=>{E=this._chainOrCall(E,()=>{return B(this,F)})});return E}_parseCommand(D,F){let u=this.parseOptions(F);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(u.operands),F=u.unknown,this.args=D.concat(F),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),F);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(F),this._dispatchSubcommand(this._defaultCommandName,D,F);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(u.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let E=()=>{if(u.unknown.length>0)this.unknownOption(u.unknown[0])},B=`command:${this.name()}`;if(this._actionHandler){E(),this._processArguments();let C;if(C=this._chainOrCallHooks(C,"preAction"),C=this._chainOrCall(C,()=>this._actionHandler(this.processedArgs)),this.parent)C=this._chainOrCall(C,()=>{this.parent.emit(B,D,F)});return C=this._chainOrCallHooks(C,"postAction"),C}if(this.parent?.listenerCount(B))E(),this._processArguments(),this.parent.emit(B,D,F);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,F);if(this.listenerCount("command:*"))this.emit("command:*",D,F);else if(this.commands.length)this.unknownCommand();else E(),this._processArguments()}else if(this.commands.length)E(),this.help({error:!0});else E(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((F)=>F._name===D||F._aliases.includes(D))}_findOption(D){return this.options.find((F)=>F.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((F)=>{if(F.mandatory&&D.getOptionValue(F.attributeName())===void 0)D.missingMandatoryOptionValue(F)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((u)=>{let E=u.attributeName();if(this.getOptionValue(E)===void 0)return!1;return this.getOptionValueSource(E)!=="default"});D.filter((u)=>u.conflictsWith.length>0).forEach((u)=>{let E=D.find((B)=>u.conflictsWith.includes(B.attributeName()));if(E)this._conflictingOption(u,E)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let F=[],u=[],E=F;function B(H){return H.length>1&&H[0]==="-"}let C=(H)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(H))return!1;return!this._getCommandAndAncestors().some((Y)=>Y.options.map((G)=>G.short).some((G)=>/^-\d$/.test(G)))},Z=null,J=null,X=0;while(X<D.length||J){let H=J??D[X++];if(J=null,H==="--"){if(E===u)E.push(H);E.push(...D.slice(X));break}if(Z&&(!B(H)||C(H))){this.emit(`option:${Z.name()}`,H);continue}if(Z=null,B(H)){let Y=this._findOption(H);if(Y){if(Y.required){let G=D[X++];if(G===void 0)this.optionMissingArgument(Y);this.emit(`option:${Y.name()}`,G)}else if(Y.optional){let G=null;if(X<D.length&&(!B(D[X])||C(D[X])))G=D[X++];this.emit(`option:${Y.name()}`,G)}else this.emit(`option:${Y.name()}`);Z=Y.variadic?Y:null;continue}}if(H.length>2&&H[0]==="-"&&H[1]!=="-"){let Y=this._findOption(`-${H[1]}`);if(Y){if(Y.required||Y.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${Y.name()}`,H.slice(2));else this.emit(`option:${Y.name()}`),J=`-${H.slice(2)}`;continue}}if(/^--[^=]+=/.test(H)){let Y=H.indexOf("="),G=this._findOption(H.slice(0,Y));if(G&&(G.required||G.optional)){this.emit(`option:${G.name()}`,H.slice(Y+1));continue}}if(E===F&&B(H)&&!(this.commands.length===0&&C(H)))E=u;if((this._enablePositionalOptions||this._passThroughOptions)&&F.length===0&&u.length===0){if(this._findCommand(H)){F.push(H),u.push(...D.slice(X));break}else if(this._getHelpCommand()&&H===this._getHelpCommand().name()){F.push(H,...D.slice(X));break}else if(this._defaultCommandName){u.push(H,...D.slice(X));break}}if(this._passThroughOptions){E.push(H,...D.slice(X));break}E.push(H)}return{operands:F,unknown:u}}opts(){if(this._storeOptionsAsProperties){let D={},F=this.options.length;for(let u=0;u<F;u++){let E=this.options[u].attributeName();D[E]=E===this._versionOptionName?this._version:this[E]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,F)=>Object.assign(D,F.opts()),{})}error(D,F){if(this._outputConfiguration.outputError(`${D}
70
70
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
71
71
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
72
- `),this.outputHelp({error:!0});let u=F||{},E=u.exitCode||1,B=u.code||"commander.error";this._exit(E,B,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in s.env){let F=D.attributeName();if(this.getOptionValue(F)===void 0||["default","config","env"].includes(this.getOptionValueSource(F)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,s.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new lz(this.options),F=(u)=>{return this.getOptionValue(u)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(u))};this.options.filter((u)=>u.implied!==void 0&&F(u.attributeName())&&D.valueFromOption(this.getOptionValue(u.attributeName()),u)).forEach((u)=>{Object.keys(u.implied).filter((E)=>!F(E)).forEach((E)=>{this.setOptionValueWithSource(E,u.implied[E],"implied")})})}missingArgument(D){let F=`error: missing required argument '${D}'`;this.error(F,{code:"commander.missingArgument"})}optionMissingArgument(D){let F=`error: option '${D.flags}' argument missing`;this.error(F,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let F=`error: required option '${D.flags}' not specified`;this.error(F,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,F){let u=(C)=>{let Z=C.attributeName(),J=this.getOptionValue(Z),X=this.options.find((Y)=>Y.negate&&Z===Y.attributeName()),H=this.options.find((Y)=>!Y.negate&&Z===Y.attributeName());if(X&&(X.presetArg===void 0&&J===!1||X.presetArg!==void 0&&J===X.presetArg))return X;return H||C},E=(C)=>{let Z=u(C),J=Z.attributeName();if(this.getOptionValueSource(J)==="env")return`environment variable '${Z.envVar}'`;return`option '${Z.flags}'`},B=`error: ${E(D)} cannot be used with ${E(F)}`;this.error(B,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let F="";if(D.startsWith("--")&&this._showSuggestionAfterError){let E=[],B=this;do{let C=B.createHelp().visibleOptions(B).filter((Z)=>Z.long).map((Z)=>Z.long);E=E.concat(C),B=B.parent}while(B&&!B._enablePositionalOptions);F=lB(D,E)}let u=`error: unknown option '${D}'${F}`;this.error(u,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let F=this.registeredArguments.length,u=F===1?"":"s",B=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${u} but got ${D.length}.`;this.error(B,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],F="";if(this._showSuggestionAfterError){let E=[];this.createHelp().visibleCommands(this).forEach((B)=>{if(E.push(B.name()),B.alias())E.push(B.alias())}),F=lB(D,E)}let u=`error: unknown command '${D}'${F}`;this.error(u,{code:"commander.unknownCommand"})}version(D,F,u){if(D===void 0)return this._version;this._version=D,F=F||"-V, --version",u=u||"output the version number";let E=this.createOption(F,u);return this._versionOptionName=E.attributeName(),this._registerOption(E),this.on("option:"+E.name(),()=>{this._outputConfiguration.writeOut(`${D}
73
- `),this._exit(0,"commander.version",D)}),this}description(D,F){if(D===void 0&&F===void 0)return this._description;if(this._description=D,F)this._argsDescription=F;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)F=this.commands[this.commands.length-1];if(D===F._name)throw Error("Command alias can't be the same as its name");let u=this.parent?._findCommand(D);if(u){let E=[u.name()].concat(u.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${E}'`)}return F._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((F)=>this.alias(F)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let F=this.registeredArguments.map((u)=>{return mz(u)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?F:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}helpGroup(D){if(D===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=D,this}commandsGroup(D){if(D===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=D,this}optionsGroup(D){if(D===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=D,this}_initOptionGroup(D){if(this._defaultOptionGroup&&!D.helpGroupHeading)D.helpGroup(this._defaultOptionGroup)}_initCommandGroup(D){if(this._defaultCommandGroup&&!D.helpGroup())D.helpGroup(this._defaultCommandGroup)}nameFromFilename(D){return this._name=G0.basename(D,G0.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let F=this.createHelp(),u=this._getOutputContext(D);F.prepareContext({error:u.error,helpWidth:u.helpWidth,outputHasColors:u.hasColors});let E=F.formatHelp(this,F);if(u.hasColors)return E;return this._outputConfiguration.stripColor(E)}_getOutputContext(D){D=D||{};let F=!!D.error,u,E,B;if(F)u=(Z)=>this._outputConfiguration.writeErr(Z),E=this._outputConfiguration.getErrHasColors(),B=this._outputConfiguration.getErrHelpWidth();else u=(Z)=>this._outputConfiguration.writeOut(Z),E=this._outputConfiguration.getOutHasColors(),B=this._outputConfiguration.getOutHelpWidth();return{error:F,write:(Z)=>{if(!E)Z=this._outputConfiguration.stripColor(Z);return u(Z)},hasColors:E,helpWidth:B}}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let u=this._getOutputContext(D),E={error:u.error,write:u.write,command:this};this._getCommandAndAncestors().reverse().forEach((C)=>C.emit("beforeAllHelp",E)),this.emit("beforeHelp",E);let B=this.helpInformation({error:u.error});if(F){if(B=F(B),typeof B!=="string"&&!Buffer.isBuffer(B))throw Error("outputHelp callback must return a string or a Buffer")}if(u.write(B),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",E),this._getCommandAndAncestors().forEach((C)=>C.emit("afterAllHelp",E))}helpOption(D,F){if(typeof D==="boolean"){if(D){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(D??"-h, --help",F??"display help for command"),D||F)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this._initOptionGroup(D),this}help(D){this.outputHelp(D);let F=Number(s.exitCode??0);if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let u=["beforeAll","before","after","afterAll"];if(!u.includes(D))throw Error(`Unexpected value for position to addHelpText.
72
+ `),this.outputHelp({error:!0});let u=F||{},E=u.exitCode||1,B=u.code||"commander.error";this._exit(E,B,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in s.env){let F=D.attributeName();if(this.getOptionValue(F)===void 0||["default","config","env"].includes(this.getOptionValueSource(F)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,s.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new rz(this.options),F=(u)=>{return this.getOptionValue(u)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(u))};this.options.filter((u)=>u.implied!==void 0&&F(u.attributeName())&&D.valueFromOption(this.getOptionValue(u.attributeName()),u)).forEach((u)=>{Object.keys(u.implied).filter((E)=>!F(E)).forEach((E)=>{this.setOptionValueWithSource(E,u.implied[E],"implied")})})}missingArgument(D){let F=`error: missing required argument '${D}'`;this.error(F,{code:"commander.missingArgument"})}optionMissingArgument(D){let F=`error: option '${D.flags}' argument missing`;this.error(F,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let F=`error: required option '${D.flags}' not specified`;this.error(F,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,F){let u=(C)=>{let Z=C.attributeName(),J=this.getOptionValue(Z),X=this.options.find((Y)=>Y.negate&&Z===Y.attributeName()),H=this.options.find((Y)=>!Y.negate&&Z===Y.attributeName());if(X&&(X.presetArg===void 0&&J===!1||X.presetArg!==void 0&&J===X.presetArg))return X;return H||C},E=(C)=>{let Z=u(C),J=Z.attributeName();if(this.getOptionValueSource(J)==="env")return`environment variable '${Z.envVar}'`;return`option '${Z.flags}'`},B=`error: ${E(D)} cannot be used with ${E(F)}`;this.error(B,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let F="";if(D.startsWith("--")&&this._showSuggestionAfterError){let E=[],B=this;do{let C=B.createHelp().visibleOptions(B).filter((Z)=>Z.long).map((Z)=>Z.long);E=E.concat(C),B=B.parent}while(B&&!B._enablePositionalOptions);F=oB(D,E)}let u=`error: unknown option '${D}'${F}`;this.error(u,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let F=this.registeredArguments.length,u=F===1?"":"s",B=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${F} argument${u} but got ${D.length}.`;this.error(B,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],F="";if(this._showSuggestionAfterError){let E=[];this.createHelp().visibleCommands(this).forEach((B)=>{if(E.push(B.name()),B.alias())E.push(B.alias())}),F=oB(D,E)}let u=`error: unknown command '${D}'${F}`;this.error(u,{code:"commander.unknownCommand"})}version(D,F,u){if(D===void 0)return this._version;this._version=D,F=F||"-V, --version",u=u||"output the version number";let E=this.createOption(F,u);return this._versionOptionName=E.attributeName(),this._registerOption(E),this.on("option:"+E.name(),()=>{this._outputConfiguration.writeOut(`${D}
73
+ `),this._exit(0,"commander.version",D)}),this}description(D,F){if(D===void 0&&F===void 0)return this._description;if(this._description=D,F)this._argsDescription=F;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)F=this.commands[this.commands.length-1];if(D===F._name)throw Error("Command alias can't be the same as its name");let u=this.parent?._findCommand(D);if(u){let E=[u.name()].concat(u.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${E}'`)}return F._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((F)=>this.alias(F)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let F=this.registeredArguments.map((u)=>{return iz(u)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?F:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}helpGroup(D){if(D===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=D,this}commandsGroup(D){if(D===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=D,this}optionsGroup(D){if(D===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=D,this}_initOptionGroup(D){if(this._defaultOptionGroup&&!D.helpGroupHeading)D.helpGroup(this._defaultOptionGroup)}_initCommandGroup(D){if(this._defaultCommandGroup&&!D.helpGroup())D.helpGroup(this._defaultCommandGroup)}nameFromFilename(D){return this._name=G0.basename(D,G0.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let F=this.createHelp(),u=this._getOutputContext(D);F.prepareContext({error:u.error,helpWidth:u.helpWidth,outputHasColors:u.hasColors});let E=F.formatHelp(this,F);if(u.hasColors)return E;return this._outputConfiguration.stripColor(E)}_getOutputContext(D){D=D||{};let F=!!D.error,u,E,B;if(F)u=(Z)=>this._outputConfiguration.writeErr(Z),E=this._outputConfiguration.getErrHasColors(),B=this._outputConfiguration.getErrHelpWidth();else u=(Z)=>this._outputConfiguration.writeOut(Z),E=this._outputConfiguration.getOutHasColors(),B=this._outputConfiguration.getOutHelpWidth();return{error:F,write:(Z)=>{if(!E)Z=this._outputConfiguration.stripColor(Z);return u(Z)},hasColors:E,helpWidth:B}}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let u=this._getOutputContext(D),E={error:u.error,write:u.write,command:this};this._getCommandAndAncestors().reverse().forEach((C)=>C.emit("beforeAllHelp",E)),this.emit("beforeHelp",E);let B=this.helpInformation({error:u.error});if(F){if(B=F(B),typeof B!=="string"&&!Buffer.isBuffer(B))throw Error("outputHelp callback must return a string or a Buffer")}if(u.write(B),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",E),this._getCommandAndAncestors().forEach((C)=>C.emit("afterAllHelp",E))}helpOption(D,F){if(typeof D==="boolean"){if(D){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(D??"-h, --help",F??"display help for command"),D||F)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this._initOptionGroup(D),this}help(D){this.outputHelp(D);let F=Number(s.exitCode??0);if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let u=["beforeAll","before","after","afterAll"];if(!u.includes(D))throw Error(`Unexpected value for position to addHelpText.
74
74
  Expecting one of '${u.join("', '")}'`);let E=`${D}Help`;return this.on(E,(B)=>{let C;if(typeof F==="function")C=F({error:B.error,command:B.command});else C=F;if(C)B.write(`${C}
75
- `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((E)=>F.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function pB(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let u,E="127.0.0.1",B="9229",C;if((C=F.match(/^(--inspect(-brk)?)$/))!==null)u=C[1];else if((C=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(u=C[1],/^\d+$/.test(C[3]))B=C[3];else E=C[3];else if((C=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)u=C[1],E=C[3],B=C[4];if(u&&B!=="0")return`${u}=${E}:${parseInt(B)+1}`;return F})}function C1(){if(s.env.NO_COLOR||s.env.FORCE_COLOR==="0"||s.env.FORCE_COLOR==="false")return!1;if(s.env.FORCE_COLOR||s.env.CLICOLOR_FORCE!==void 0)return!0;return}pz.Command=Z1;pz.useColor=C1});var j8=M((sz)=>{var{Argument:nB}=L8(),{Command:J1}=iB(),{CommanderError:az,InvalidArgumentError:aB}=D2(),{Help:rz}=F1(),{Option:rB}=u1();sz.program=new J1;sz.createCommand=(D)=>new J1(D);sz.createOption=(D,F)=>new rB(D,F);sz.createArgument=(D,F)=>new nB(D,F);sz.Command=J1;sz.Option=rB;sz.Argument=nB;sz.Help=rz;sz.CommanderError=az;sz.InvalidArgumentError=aB;sz.InvalidOptionArgumentError=aB});var oB=M((yD,sB)=>{var iD=j8();yD=sB.exports={};yD.program=new iD.Command;yD.Argument=iD.Argument;yD.Command=iD.Command;yD.CommanderError=iD.CommanderError;yD.Help=iD.Help;yD.InvalidArgumentError=iD.InvalidArgumentError;yD.InvalidOptionArgumentError=iD.InvalidArgumentError;yD.Option=iD.Option;yD.createCommand=(D)=>new iD.Command(D);yD.createOption=(D,F)=>new iD.Option(D,F);yD.createArgument=(D,F)=>new iD.Argument(D,F)});var y1=M((UL,iC)=>{var k1={to(D,F){if(!F)return`\x1B[${D+1}G`;return`\x1B[${F+1};${D+1}H`},move(D,F){let u="";if(D<0)u+=`\x1B[${-D}D`;else if(D>0)u+=`\x1B[${D}C`;if(F<0)u+=`\x1B[${-F}A`;else if(F>0)u+=`\x1B[${F}B`;return u},up:(D=1)=>`\x1B[${D}A`,down:(D=1)=>`\x1B[${D}B`,forward:(D=1)=>`\x1B[${D}C`,backward:(D=1)=>`\x1B[${D}D`,nextLine:(D=1)=>"\x1B[E".repeat(D),prevLine:(D=1)=>"\x1B[F".repeat(D),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},jA={up:(D=1)=>"\x1B[S".repeat(D),down:(D=1)=>"\x1B[T".repeat(D)},SA={screen:"\x1B[2J",up:(D=1)=>"\x1B[1J".repeat(D),down:(D=1)=>"\x1B[J".repeat(D),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(D){let F="";for(let u=0;u<D;u++)F+=this.line+(u<D-1?k1.up():"");if(D)F+=k1.left;return F}};iC.exports={cursor:k1,scroll:jA,erase:SA,beep:"\x07"}});class VF extends Error{envName;constructor(D){super(`Not authenticated for backend "${D}".`);this.envName=D;this.name="NotAuthenticatedError"}}class a0 extends Error{constructor(){super("Authorization was denied.");this.name="DeviceFlowDenied"}}class O0 extends Error{constructor(){super("Device code expired.");this.name="DeviceFlowExpired"}}class d extends Error{envName;constructor(D){super(`Session expired for "${D}".`);this.envName=D;this.name="SessionExpiredError"}}var G9=GD(H9(),1),QD=GD(Ru(),1),A={bold:QD.default.bold,dim:QD.default.dim,italic:QD.default.italic,underline:QD.default.underline,cyan:QD.default.cyan,green:QD.default.green,yellow:QD.default.yellow,red:QD.default.red,gray:QD.default.gray,blue:QD.default.blue,magenta:QD.default.magenta,success:(D)=>QD.default.green(`✓ ${D}`),error:(D)=>QD.default.red(`✗ ${D}`),info:(D)=>QD.default.cyan(`◆ ${D}`),warn:(D)=>QD.default.yellow(`! ${D}`),hint:(D)=>QD.default.dim(D)};function vD(D,F){let u=new G9.default({head:D.map((E)=>A.bold(E)),style:{head:[],border:["gray"]}});for(let E of F)u.push(E);console.log(u.toString())}function a(D){console.log(JSON.stringify(D,null,2))}function m(D){if(D instanceof Error)return D.message;if(typeof D==="string")return D;if(typeof D==="object"&&D!==null){let F=D,u=F.status?` [${F.status}]`:"";if(typeof F.value==="string")return F.value+u;if(typeof F.value==="object"&&F.value!==null){let E=F.value;if(E.error)return String(E.error)+u;if(E.message)return String(E.message)+u}return JSON.stringify(F.value??D)+u}return String(D)}function T(D,F={}){if(console.error(A.error(D)),F.hint)console.error(A.hint(` Hint: ${F.hint}`));if(F.context)console.error(A.dim(` ${F.context}`));process.exit(F.code??1)}import{lstatSync as aJ,realpathSync as Q9,symlinkSync as rJ}from"node:fs";import{delimiter as sJ,join as _F,resolve as oJ,sep as K9}from"node:path";function z9(){try{let D=process.argv[1];if(!D)return;if(!D.endsWith(`${K9}dist${K9}photon.js`))return;let F=Q9(oJ(D)),u=process.env.HOME||process.env.USERPROFILE||"",E=(process.env.PATH||"").split(sJ);if(u)E.push(_F(u,".bun","bin"),_F(u,".local","share","pnpm"),_F(u,".yarn","bin"));E.push("/usr/local/bin");let B=new Set;for(let C of E){if(!C||B.has(C))continue;B.add(C);let Z=_F(C,"photon");try{if(Q9(Z)!==F)continue}catch{continue}let J=_F(C,"pho");try{aJ(J);return}catch{}rJ("./photon",J);return}}catch{}}import m0 from"node:process";import{spawn as Xz}from"node:child_process";import{fileURLToPath as Gz}from"node:url";import PB from"node:path";import{format as t3}from"node:util";var SF=GD(T9(),1);import jF from"node:path";import $H from"node:os";import HH from"os";import j2 from"path";var q0=HH.homedir(),{env:j0}=process,_9=j0.XDG_DATA_HOME||(q0?j2.join(q0,".local","share"):void 0),t0=j0.XDG_CONFIG_HOME||(q0?j2.join(q0,".config"):void 0),QN=j0.XDG_STATE_HOME||(q0?j2.join(q0,".local","state"):void 0),KN=j0.XDG_CACHE_HOME||(q0?j2.join(q0,".cache"):void 0),zN=j0.XDG_RUNTIME_DIR||void 0,YH=(j0.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(_9)YH.unshift(_9);var XH=(j0.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(t0)XH.unshift(t0);import WH from"node:path";import r from"node:fs";import{promisify as WD}from"node:util";var GH=(D,F)=>{let{onError:u}=F;return function(...B){return D.apply(void 0,B).catch(u)}},tD=GH;var QH=(D,F)=>{let{onError:u}=F;return function(...B){try{return D.apply(void 0,B)}catch(C){return u(C)}}},cD=QH;var O9=250;var KH=(D,F)=>{let{isRetriable:u}=F;return function(B){let{timeout:C}=B,Z=B.interval??O9,J=Date.now()+C;return function X(...H){return D.apply(void 0,H).catch((Y)=>{if(!u(Y))throw Y;if(Date.now()>=J)throw Y;let G=Math.round(Z*Math.random());if(G>0)return new Promise((Q)=>setTimeout(Q,G)).then(()=>X.apply(void 0,H));else return X.apply(void 0,H)})}}},eD=KH;var zH=(D,F)=>{let{isRetriable:u}=F;return function(B){let{timeout:C}=B,Z=Date.now()+C;return function(...X){while(!0)try{return D.apply(void 0,X)}catch(H){if(!u(H))throw H;if(Date.now()>=Z)throw H;continue}}}},D0=zH;import R9 from"node:process";var OF={isChangeErrorOk:(D)=>{if(!OF.isNodeError(D))return!1;let{code:F}=D;if(F==="ENOSYS")return!0;if(!L9&&(F==="EINVAL"||F==="EPERM"))return!0;return!1},isNodeError:(D)=>{return D instanceof Error},isRetriableError:(D)=>{if(!OF.isNodeError(D))return!1;let{code:F}=D;if(F==="EMFILE"||F==="ENFILE"||F==="EAGAIN"||F==="EBUSY"||F==="EACCESS"||F==="EACCES"||F==="EACCS"||F==="EPERM")return!0;return!1},onChangeError:(D)=>{if(!OF.isNodeError(D))throw D;if(OF.isChangeErrorOk(D))return;throw D}},xu=OF;var LF={onError:xu.onChangeError},SD={onError:()=>{return}},L9=R9.getuid?!R9.getuid():!1,zD={isRetriable:xu.isRetriableError};var qH={attempt:{chmod:tD(WD(r.chmod),LF),chown:tD(WD(r.chown),LF),close:tD(WD(r.close),SD),fsync:tD(WD(r.fsync),SD),mkdir:tD(WD(r.mkdir),SD),realpath:tD(WD(r.realpath),SD),stat:tD(WD(r.stat),SD),unlink:tD(WD(r.unlink),SD),chmodSync:cD(r.chmodSync,LF),chownSync:cD(r.chownSync,LF),closeSync:cD(r.closeSync,SD),existsSync:cD(r.existsSync,SD),fsyncSync:cD(r.fsync,SD),mkdirSync:cD(r.mkdirSync,SD),realpathSync:cD(r.realpathSync,SD),statSync:cD(r.statSync,SD),unlinkSync:cD(r.unlinkSync,SD)},retry:{close:eD(WD(r.close),zD),fsync:eD(WD(r.fsync),zD),open:eD(WD(r.open),zD),readFile:eD(WD(r.readFile),zD),rename:eD(WD(r.rename),zD),stat:eD(WD(r.stat),zD),write:eD(WD(r.write),zD),writeFile:eD(WD(r.writeFile),zD),closeSync:D0(r.closeSync,zD),fsyncSync:D0(r.fsyncSync,zD),openSync:D0(r.openSync,zD),readFileSync:D0(r.readFileSync,zD),renameSync:D0(r.renameSync,zD),statSync:D0(r.statSync,zD),writeSync:D0(r.writeSync,zD),writeFileSync:D0(r.writeFileSync,zD)}},YD=qH;import S0 from"node:process";var j9="utf8",ku=438,S9=511;var P9={},w9=S0.geteuid?S0.geteuid():-1,x9=S0.getegid?S0.getegid():-1;var k9=1000,y9=!!S0.getuid,hN=S0.getuid?!S0.getuid():!1,yu=128;var b9=(D)=>{return D instanceof Error&&"code"in D};var bu=(D)=>{return typeof D==="string"},S2=(D)=>{return D===void 0};import UH from"node:path";import e0 from"node:process";import f9 from"node:process";var v9=f9.platform==="linux",P2=f9.platform==="win32";var fu=["SIGHUP","SIGINT","SIGTERM"];if(!P2)fu.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(v9)fu.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var h9=fu;class g9{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(D)=>{if(this.exited)return;this.exited=!0;for(let F of this.callbacks)F();if(D)if(P2&&(D!=="SIGINT"&&D!=="SIGTERM"&&D!=="SIGKILL"))e0.kill(e0.pid,"SIGTERM");else e0.kill(e0.pid,D)},this.hook=()=>{e0.once("exit",()=>this.exit());for(let D of h9)try{e0.once(D,()=>this.exit(D))}catch{}},this.register=(D)=>{return this.callbacks.add(D),()=>{this.callbacks.delete(D)}},this.hook()}}var m9=new g9;var AH=m9.register,d9=AH;var xD={store:{},create:(D)=>{let F=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),u=Date.now().toString().slice(-10),E="tmp-",B=`.tmp-${u}${F}`;return`${D}${B}`},get:(D,F,u=!0)=>{let E=xD.truncate(F(D));if(E in xD.store)return xD.get(D,F,u);return xD.store[E]=u,[E,()=>delete xD.store[E]]},purge:(D)=>{if(!xD.store[D])return;delete xD.store[D],YD.attempt.unlink(D)},purgeSync:(D)=>{if(!xD.store[D])return;delete xD.store[D],YD.attempt.unlinkSync(D)},purgeSyncAll:()=>{for(let D in xD.store)xD.purgeSync(D)},truncate:(D)=>{let F=UH.basename(D);if(F.length<=yu)return D;let u=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(F);if(!u)return D;let E=F.length-yu;return`${D.slice(0,-F.length)}${u[1]}${u[2].slice(0,-E)}${u[3]}`}};d9(xD.purgeSyncAll);var RF=xD;function w2(D,F,u=P9){if(bu(u))return w2(D,F,{encoding:u});let B={timeout:u.timeout??k9},C=null,Z=null,J=null;try{let X=YD.attempt.realpathSync(D),H=!!X;D=X||D,[Z,C]=RF.get(D,u.tmpCreate||RF.create,u.tmpPurge!==!1);let Y=y9&&S2(u.chown),G=S2(u.mode);if(H&&(Y||G)){let K=YD.attempt.statSync(D);if(K){if(u={...u},Y)u.chown={uid:K.uid,gid:K.gid};if(G)u.mode=K.mode}}if(!H){let K=WH.dirname(D);YD.attempt.mkdirSync(K,{mode:S9,recursive:!0})}if(J=YD.retry.openSync(B)(Z,"w",u.mode||ku),u.tmpCreated)u.tmpCreated(Z);if(bu(F))YD.retry.writeSync(B)(J,F,0,u.encoding||j9);else if(!S2(F))YD.retry.writeSync(B)(J,F,0,F.length,0);if(u.fsync!==!1)if(u.fsyncWait!==!1)YD.retry.fsyncSync(B)(J);else YD.attempt.fsync(J);if(YD.retry.closeSync(B)(J),J=null,u.chown&&(u.chown.uid!==w9||u.chown.gid!==x9))YD.attempt.chownSync(Z,u.chown.uid,u.chown.gid);if(u.mode&&u.mode!==ku)YD.attempt.chmodSync(Z,u.mode);try{YD.retry.renameSync(B)(Z,D)}catch(K){if(!b9(K))throw K;if(K.code!=="ENAMETOOLONG")throw K;YD.retry.renameSync(B)(Z,RF.truncate(D))}C(),Z=null}finally{if(J)YD.attempt.closeSync(J);if(Z)RF.purge(Z)}}var P0=(D)=>{let F=typeof D;return D!==null&&(F==="object"||F==="function")};var vu=new Set(["__proto__","prototype","constructor"]),NH=new Set("0123456789");function x2(D){let F=[],u="",E="start",B=!1;for(let C of D)switch(C){case"\\":{if(E==="index")throw Error("Invalid character in an index");if(E==="indexEnd")throw Error("Invalid character after an index");if(B)u+=C;E="property",B=!B;break}case".":{if(E==="index")throw Error("Invalid character in an index");if(E==="indexEnd"){E="property";break}if(B){B=!1,u+=C;break}if(vu.has(u))return[];F.push(u),u="",E="property";break}case"[":{if(E==="index")throw Error("Invalid character in an index");if(E==="indexEnd"){E="index";break}if(B){B=!1,u+=C;break}if(E==="property"){if(vu.has(u))return[];F.push(u),u=""}E="index";break}case"]":{if(E==="index"){F.push(Number.parseInt(u,10)),u="",E="indexEnd";break}if(E==="indexEnd")throw Error("Invalid character after an index")}default:{if(E==="index"&&!NH.has(C))throw Error("Invalid character in an index");if(E==="indexEnd")throw Error("Invalid character after an index");if(E==="start")E="property";if(B)B=!1,u+="\\";u+=C}}if(B)u+="\\";switch(E){case"property":{if(vu.has(u))return[];F.push(u);break}case"index":throw Error("Index was not closed");case"start":{F.push("");break}}return F}function hu(D,F){if(typeof F!=="number"&&Array.isArray(D)){let u=Number.parseInt(F,10);return Number.isInteger(u)&&D[u]===D[F]}return!1}function c9(D,F){if(hu(D,F))throw Error("Cannot use string index")}function l9(D,F,u){if(!P0(D)||typeof F!=="string")return u===void 0?D:u;let E=x2(F);if(E.length===0)return u;for(let B=0;B<E.length;B++){let C=E[B];if(hu(D,C))D=B===E.length-1?void 0:null;else D=D[C];if(D===void 0||D===null){if(B!==E.length-1)return u;break}}return D===void 0?u:D}function gu(D,F,u){if(!P0(D)||typeof F!=="string")return D;let E=D,B=x2(F);for(let C=0;C<B.length;C++){let Z=B[C];if(c9(D,Z),C===B.length-1)D[Z]=u;else if(!P0(D[Z]))D[Z]=typeof B[C+1]==="number"?[]:{};D=D[Z]}return E}function p9(D,F){if(!P0(D)||typeof F!=="string")return!1;let u=x2(F);for(let E=0;E<u.length;E++){let B=u[E];if(c9(D,B),E===u.length-1)return delete D[B],!0;if(D=D[B],!P0(D))return!1}}function i9(D,F){if(!P0(D)||typeof F!=="string")return!1;let u=x2(F);if(u.length===0)return!1;for(let E of u){if(!P0(D)||!(E in D)||hu(D,E))return!1;D=D[E]}return!0}function VH(D,F){let u=F?jF.join(D,"config.json"):jF.join("configstore",`${D}.json`),E=t0??SF.default.mkdtempSync(SF.default.realpathSync($H.tmpdir())+jF.sep);return jF.join(E,u)}var IH="You don't have access to this file.",MH={mode:448,recursive:!0},n9={mode:384};function a9(D){if(D.code==="EACCES")D.message=`${D.message}
76
- ${IH}
77
- `;throw D}class k2{constructor(D,F,u={}){if(this._path=u.configPath??VH(D,u.globalConfigPath),this._clearInvalidConfig=u.clearInvalidConfig??!0,F)this.all={...F,...this.all}}get all(){try{return JSON.parse(SF.default.readFileSync(this._path,"utf8"))}catch(D){if(D.code==="ENOENT")return{};if(D.name==="SyntaxError"){if(this._clearInvalidConfig)return w2(this._path,"",n9),{};throw D}return a9(D),{}}}set all(D){try{SF.default.mkdirSync(jF.dirname(this._path),MH),w2(this._path,JSON.stringify(D,void 0,"\t"),n9)}catch(F){a9(F)}}get size(){return Object.keys(this.all||{}).length}get(D){return l9(this.all,D)}set(D,F){let u=this.all;if(typeof D==="object"&&arguments.length===1)for(let E of Object.keys(D))gu(u,E,D[E]);else gu(u,D,F);this.all=u}has(D){return i9(this.all,D)}delete(D){let F=this.all;p9(F,D),this.all=F}clear(){this.all={}}get path(){return this._path}}var r9=(D=0)=>(F)=>`\x1B[${F+D}m`,s9=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,o9=(D=0)=>(F,u,E)=>`\x1B[${38+D};2;${F};${u};${E}m`,uD={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]}},M$=Object.keys(uD.modifier),TH=Object.keys(uD.color),_H=Object.keys(uD.bgColor),T$=[...TH,..._H];function OH(){let D=new Map;for(let[F,u]of Object.entries(uD)){for(let[E,B]of Object.entries(u))uD[E]={open:`\x1B[${B[0]}m`,close:`\x1B[${B[1]}m`},u[E]=uD[E],D.set(B[0],B[1]);Object.defineProperty(uD,F,{value:u,enumerable:!1})}return Object.defineProperty(uD,"codes",{value:D,enumerable:!1}),uD.color.close="\x1B[39m",uD.bgColor.close="\x1B[49m",uD.color.ansi=r9(),uD.color.ansi256=s9(),uD.color.ansi16m=o9(),uD.bgColor.ansi=r9(10),uD.bgColor.ansi256=s9(10),uD.bgColor.ansi16m=o9(10),Object.defineProperties(uD,{rgbToAnsi256:{value(F,u,E){if(F===u&&u===E){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round(u/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(F){let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!u)return[0,0,0];let[E]=u;if(E.length===3)E=[...E].map((C)=>C+C).join("");let B=Number.parseInt(E,16);return[B>>16&255,B>>8&255,B&255]},enumerable:!1},hexToAnsi256:{value:(F)=>uD.rgbToAnsi256(...uD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let u,E,B;if(F>=232)u=((F-232)*10+8)/255,E=u,B=u;else{F-=16;let J=F%36;u=Math.floor(F/36)/5,E=Math.floor(J/6)/5,B=J%6/5}let C=Math.max(u,E,B)*2;if(C===0)return 30;let Z=30+(Math.round(B)<<2|Math.round(E)<<1|Math.round(u));if(C===2)Z+=60;return Z},enumerable:!1},rgbToAnsi:{value:(F,u,E)=>uD.ansi256ToAnsi(uD.rgbToAnsi256(F,u,E)),enumerable:!1},hexToAnsi:{value:(F)=>uD.ansi256ToAnsi(uD.hexToAnsi256(F)),enumerable:!1}}),uD}var LH=OH(),lD=LH;import mu from"node:process";import RH from"node:os";import t9 from"node:tty";function hD(D,F=globalThis.Deno?globalThis.Deno.args:mu.argv){let u=D.startsWith("-")?"":D.length===1?"-":"--",E=F.indexOf(u+D),B=F.indexOf("--");return E!==-1&&(B===-1||E<B)}var{env:ED}=mu,y2;if(hD("no-color")||hD("no-colors")||hD("color=false")||hD("color=never"))y2=0;else if(hD("color")||hD("colors")||hD("color=true")||hD("color=always"))y2=1;function jH(){if("FORCE_COLOR"in ED){if(ED.FORCE_COLOR==="true")return 1;if(ED.FORCE_COLOR==="false")return 0;return ED.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ED.FORCE_COLOR,10),3)}}function SH(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function PH(D,{streamIsTTY:F,sniffFlags:u=!0}={}){let E=jH();if(E!==void 0)y2=E;let B=u?y2:E;if(B===0)return 0;if(u){if(hD("color=16m")||hD("color=full")||hD("color=truecolor"))return 3;if(hD("color=256"))return 2}if("TF_BUILD"in ED&&"AGENT_NAME"in ED)return 1;if(D&&!F&&B===void 0)return 0;let C=B||0;if(ED.TERM==="dumb")return C;if(mu.platform==="win32"){let Z=RH.release().split(".");if(Number(Z[0])>=10&&Number(Z[2])>=10586)return Number(Z[2])>=14931?3:2;return 1}if("CI"in ED){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((Z)=>(Z in ED)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((Z)=>(Z in ED))||ED.CI_NAME==="codeship")return 1;return C}if("TEAMCITY_VERSION"in ED)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ED.TEAMCITY_VERSION)?1:0;if(ED.COLORTERM==="truecolor")return 3;if(ED.TERM==="xterm-kitty")return 3;if(ED.TERM==="xterm-ghostty")return 3;if(ED.TERM==="wezterm")return 3;if("TERM_PROGRAM"in ED){let Z=Number.parseInt((ED.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ED.TERM_PROGRAM){case"iTerm.app":return Z>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(ED.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ED.TERM))return 1;if("COLORTERM"in ED)return 1;return C}function e9(D,F={}){let u=PH(D,{streamIsTTY:D&&D.isTTY,...F});return SH(u)}var wH={stdout:e9({isTTY:t9.isatty(1)}),stderr:e9({isTTY:t9.isatty(2)})},D7=wH;function F7(D,F,u){let E=D.indexOf(F);if(E===-1)return D;let B=F.length,C=0,Z="";do Z+=D.slice(C,E)+F+u,C=E+B,E=D.indexOf(F,C);while(E!==-1);return Z+=D.slice(C),Z}function u7(D,F,u,E){let B=0,C="";do{let Z=D[E-1]==="\r";C+=D.slice(B,Z?E-1:E)+F+(Z?`\r
75
+ `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((E)=>F.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function tB(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let u,E="127.0.0.1",B="9229",C;if((C=F.match(/^(--inspect(-brk)?)$/))!==null)u=C[1];else if((C=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(u=C[1],/^\d+$/.test(C[3]))B=C[3];else E=C[3];else if((C=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)u=C[1],E=C[3],B=C[4];if(u&&B!=="0")return`${u}=${E}:${parseInt(B)+1}`;return F})}function Ku(){if(s.env.NO_COLOR||s.env.FORCE_COLOR==="0"||s.env.FORCE_COLOR==="false")return!1;if(s.env.FORCE_COLOR||s.env.CLICOLOR_FORCE!==void 0)return!0;return}sz.Command=zu;sz.useColor=Ku});var Au=T((Fq)=>{var{Argument:DC}=j8(),{Command:qu}=eB(),{CommanderError:ez,InvalidArgumentError:FC}=F2(),{Help:Dq}=Yu(),{Option:uC}=Xu();Fq.program=new qu;Fq.createCommand=(D)=>new qu(D);Fq.createOption=(D,F)=>new uC(D,F);Fq.createArgument=(D,F)=>new DC(D,F);Fq.Command=qu;Fq.Option=uC;Fq.Argument=DC;Fq.Help=Dq;Fq.CommanderError=ez;Fq.InvalidArgumentError=FC;Fq.InvalidOptionArgumentError=FC});var BC=T((bD,EC)=>{var nD=Au();bD=EC.exports={};bD.program=new nD.Command;bD.Argument=nD.Argument;bD.Command=nD.Command;bD.CommanderError=nD.CommanderError;bD.Help=nD.Help;bD.InvalidArgumentError=nD.InvalidArgumentError;bD.InvalidOptionArgumentError=nD.InvalidArgumentError;bD.Option=nD.Option;bD.createCommand=(D)=>new nD.Command(D);bD.createOption=(D,F)=>new nD.Option(D,F);bD.createArgument=(D,F)=>new nD.Argument(D,F)});var Su=T((tO,wC)=>{var ju={to(D,F){if(!F)return`\x1B[${D+1}G`;return`\x1B[${F+1};${D+1}H`},move(D,F){let u="";if(D<0)u+=`\x1B[${-D}D`;else if(D>0)u+=`\x1B[${D}C`;if(F<0)u+=`\x1B[${-F}A`;else if(F>0)u+=`\x1B[${F}B`;return u},up:(D=1)=>`\x1B[${D}A`,down:(D=1)=>`\x1B[${D}B`,forward:(D=1)=>`\x1B[${D}C`,backward:(D=1)=>`\x1B[${D}D`,nextLine:(D=1)=>"\x1B[E".repeat(D),prevLine:(D=1)=>"\x1B[F".repeat(D),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},pq={up:(D=1)=>"\x1B[S".repeat(D),down:(D=1)=>"\x1B[T".repeat(D)},iq={screen:"\x1B[2J",up:(D=1)=>"\x1B[1J".repeat(D),down:(D=1)=>"\x1B[J".repeat(D),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(D){let F="";for(let u=0;u<D;u++)F+=this.line+(u<D-1?ju.up():"");if(D)F+=ju.left;return F}};wC.exports={cursor:ju,scroll:pq,erase:iq,beep:"\x07"}});class MF extends Error{envName;constructor(D){super(`Not authenticated for backend "${D}".`);this.envName=D;this.name="NotAuthenticatedError"}}class r0 extends Error{constructor(){super("Authorization was denied.");this.name="DeviceFlowDenied"}}class L0 extends Error{constructor(){super("Device code expired.");this.name="DeviceFlowExpired"}}class d extends Error{envName;constructor(D){super(`Session expired for "${D}".`);this.envName=D;this.name="SessionExpiredError"}}var V9=YD(W9(),1),QD=YD(b3(),1),A={bold:QD.default.bold,dim:QD.default.dim,italic:QD.default.italic,underline:QD.default.underline,cyan:QD.default.cyan,green:QD.default.green,yellow:QD.default.yellow,red:QD.default.red,gray:QD.default.gray,blue:QD.default.blue,magenta:QD.default.magenta,success:(D)=>QD.default.green(`✓ ${D}`),error:(D)=>QD.default.red(`✗ ${D}`),info:(D)=>QD.default.cyan(`◆ ${D}`),warn:(D)=>QD.default.yellow(`! ${D}`),hint:(D)=>QD.default.dim(D)};function hD(D,F){let u=new V9.default({head:D.map((E)=>A.bold(E)),style:{head:[],border:["gray"]}});for(let E of F)u.push(E);console.log(u.toString())}function a(D){console.log(JSON.stringify(D,null,2))}function h(D){if(D instanceof Error)return D.message;if(typeof D==="string")return D;if(typeof D==="object"&&D!==null){let F=D,u=F.status?` [${F.status}]`:"";if(typeof F.value==="string")return F.value+u;if(typeof F.value==="object"&&F.value!==null){let E=F.value;if(E.error)return String(E.error)+u;if(E.message)return String(E.message)+u}return JSON.stringify(F.value??D)+u}return String(D)}function I(D,F={}){if(console.error(A.error(D)),F.hint)console.error(A.hint(` Hint: ${F.hint}`));if(F.context)console.error(A.dim(` ${F.context}`));process.exit(F.code??1)}import d0 from"node:process";import{spawn as qz}from"node:child_process";import{fileURLToPath as Az}from"node:url";import vB from"node:path";import{format as Zu}from"node:util";var PF=YD(P9(),1);import SF from"node:path";import OH from"node:os";import KH from"os";import P2 from"path";var q0=KH.homedir(),{env:S0}=process,w9=S0.XDG_DATA_HOME||(q0?P2.join(q0,".local","share"):void 0),e0=S0.XDG_CONFIG_HOME||(q0?P2.join(q0,".config"):void 0),UN=S0.XDG_STATE_HOME||(q0?P2.join(q0,".local","state"):void 0),WN=S0.XDG_CACHE_HOME||(q0?P2.join(q0,".cache"):void 0),NN=S0.XDG_RUNTIME_DIR||void 0,zH=(S0.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(w9)zH.unshift(w9);var qH=(S0.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(e0)qH.unshift(e0);import MH from"node:path";import r from"node:fs";import{promisify as ND}from"node:util";var AH=(D,F)=>{let{onError:u}=F;return function(...B){return D.apply(void 0,B).catch(u)}},eD=AH;var UH=(D,F)=>{let{onError:u}=F;return function(...B){try{return D.apply(void 0,B)}catch(C){return u(C)}}},lD=UH;var x9=250;var WH=(D,F)=>{let{isRetriable:u}=F;return function(B){let{timeout:C}=B,Z=B.interval??x9,J=Date.now()+C;return function X(...H){return D.apply(void 0,H).catch((Y)=>{if(!u(Y))throw Y;if(Date.now()>=J)throw Y;let G=Math.round(Z*Math.random());if(G>0)return new Promise((Q)=>setTimeout(Q,G)).then(()=>X.apply(void 0,H));else return X.apply(void 0,H)})}}},D0=WH;var NH=(D,F)=>{let{isRetriable:u}=F;return function(B){let{timeout:C}=B,Z=Date.now()+C;return function(...X){while(!0)try{return D.apply(void 0,X)}catch(H){if(!u(H))throw H;if(Date.now()>=Z)throw H;continue}}}},F0=NH;import y9 from"node:process";var LF={isChangeErrorOk:(D)=>{if(!LF.isNodeError(D))return!1;let{code:F}=D;if(F==="ENOSYS")return!0;if(!k9&&(F==="EINVAL"||F==="EPERM"))return!0;return!1},isNodeError:(D)=>{return D instanceof Error},isRetriableError:(D)=>{if(!LF.isNodeError(D))return!1;let{code:F}=D;if(F==="EMFILE"||F==="ENFILE"||F==="EAGAIN"||F==="EBUSY"||F==="EACCESS"||F==="EACCES"||F==="EACCS"||F==="EPERM")return!0;return!1},onChangeError:(D)=>{if(!LF.isNodeError(D))throw D;if(LF.isChangeErrorOk(D))return;throw D}},m3=LF;var RF={onError:m3.onChangeError},SD={onError:()=>{return}},k9=y9.getuid?!y9.getuid():!1,zD={isRetriable:m3.isRetriableError};var $H={attempt:{chmod:eD(ND(r.chmod),RF),chown:eD(ND(r.chown),RF),close:eD(ND(r.close),SD),fsync:eD(ND(r.fsync),SD),mkdir:eD(ND(r.mkdir),SD),realpath:eD(ND(r.realpath),SD),stat:eD(ND(r.stat),SD),unlink:eD(ND(r.unlink),SD),chmodSync:lD(r.chmodSync,RF),chownSync:lD(r.chownSync,RF),closeSync:lD(r.closeSync,SD),existsSync:lD(r.existsSync,SD),fsyncSync:lD(r.fsync,SD),mkdirSync:lD(r.mkdirSync,SD),realpathSync:lD(r.realpathSync,SD),statSync:lD(r.statSync,SD),unlinkSync:lD(r.unlinkSync,SD)},retry:{close:D0(ND(r.close),zD),fsync:D0(ND(r.fsync),zD),open:D0(ND(r.open),zD),readFile:D0(ND(r.readFile),zD),rename:D0(ND(r.rename),zD),stat:D0(ND(r.stat),zD),write:D0(ND(r.write),zD),writeFile:D0(ND(r.writeFile),zD),closeSync:F0(r.closeSync,zD),fsyncSync:F0(r.fsyncSync,zD),openSync:F0(r.openSync,zD),readFileSync:F0(r.readFileSync,zD),renameSync:F0(r.renameSync,zD),statSync:F0(r.statSync,zD),writeSync:F0(r.writeSync,zD),writeFileSync:F0(r.writeFileSync,zD)}},XD=$H;import P0 from"node:process";var b9="utf8",d3=438,f9=511;var v9={},h9=P0.geteuid?P0.geteuid():-1,g9=P0.getegid?P0.getegid():-1;var m9=1000,d9=!!P0.getuid,lN=P0.getuid?!P0.getuid():!1,c3=128;var c9=(D)=>{return D instanceof Error&&"code"in D};var l3=(D)=>{return typeof D==="string"},w2=(D)=>{return D===void 0};import IH from"node:path";import DF from"node:process";import l9 from"node:process";var p9=l9.platform==="linux",x2=l9.platform==="win32";var p3=["SIGHUP","SIGINT","SIGTERM"];if(!x2)p3.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(p9)p3.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var i9=p3;class n9{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(D)=>{if(this.exited)return;this.exited=!0;for(let F of this.callbacks)F();if(D)if(x2&&(D!=="SIGINT"&&D!=="SIGTERM"&&D!=="SIGKILL"))DF.kill(DF.pid,"SIGTERM");else DF.kill(DF.pid,D)},this.hook=()=>{DF.once("exit",()=>this.exit());for(let D of i9)try{DF.once(D,()=>this.exit(D))}catch{}},this.register=(D)=>{return this.callbacks.add(D),()=>{this.callbacks.delete(D)}},this.hook()}}var a9=new n9;var VH=a9.register,r9=VH;var xD={store:{},create:(D)=>{let F=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),u=Date.now().toString().slice(-10),E="tmp-",B=`.tmp-${u}${F}`;return`${D}${B}`},get:(D,F,u=!0)=>{let E=xD.truncate(F(D));if(E in xD.store)return xD.get(D,F,u);return xD.store[E]=u,[E,()=>delete xD.store[E]]},purge:(D)=>{if(!xD.store[D])return;delete xD.store[D],XD.attempt.unlink(D)},purgeSync:(D)=>{if(!xD.store[D])return;delete xD.store[D],XD.attempt.unlinkSync(D)},purgeSyncAll:()=>{for(let D in xD.store)xD.purgeSync(D)},truncate:(D)=>{let F=IH.basename(D);if(F.length<=c3)return D;let u=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(F);if(!u)return D;let E=F.length-c3;return`${D.slice(0,-F.length)}${u[1]}${u[2].slice(0,-E)}${u[3]}`}};r9(xD.purgeSyncAll);var jF=xD;function k2(D,F,u=v9){if(l3(u))return k2(D,F,{encoding:u});let B={timeout:u.timeout??m9},C=null,Z=null,J=null;try{let X=XD.attempt.realpathSync(D),H=!!X;D=X||D,[Z,C]=jF.get(D,u.tmpCreate||jF.create,u.tmpPurge!==!1);let Y=d9&&w2(u.chown),G=w2(u.mode);if(H&&(Y||G)){let K=XD.attempt.statSync(D);if(K){if(u={...u},Y)u.chown={uid:K.uid,gid:K.gid};if(G)u.mode=K.mode}}if(!H){let K=MH.dirname(D);XD.attempt.mkdirSync(K,{mode:f9,recursive:!0})}if(J=XD.retry.openSync(B)(Z,"w",u.mode||d3),u.tmpCreated)u.tmpCreated(Z);if(l3(F))XD.retry.writeSync(B)(J,F,0,u.encoding||b9);else if(!w2(F))XD.retry.writeSync(B)(J,F,0,F.length,0);if(u.fsync!==!1)if(u.fsyncWait!==!1)XD.retry.fsyncSync(B)(J);else XD.attempt.fsync(J);if(XD.retry.closeSync(B)(J),J=null,u.chown&&(u.chown.uid!==h9||u.chown.gid!==g9))XD.attempt.chownSync(Z,u.chown.uid,u.chown.gid);if(u.mode&&u.mode!==d3)XD.attempt.chmodSync(Z,u.mode);try{XD.retry.renameSync(B)(Z,D)}catch(K){if(!c9(K))throw K;if(K.code!=="ENAMETOOLONG")throw K;XD.retry.renameSync(B)(Z,jF.truncate(D))}C(),Z=null}finally{if(J)XD.attempt.closeSync(J);if(Z)jF.purge(Z)}}var w0=(D)=>{let F=typeof D;return D!==null&&(F==="object"||F==="function")};var i3=new Set(["__proto__","prototype","constructor"]),TH=new Set("0123456789");function y2(D){let F=[],u="",E="start",B=!1;for(let C of D)switch(C){case"\\":{if(E==="index")throw Error("Invalid character in an index");if(E==="indexEnd")throw Error("Invalid character after an index");if(B)u+=C;E="property",B=!B;break}case".":{if(E==="index")throw Error("Invalid character in an index");if(E==="indexEnd"){E="property";break}if(B){B=!1,u+=C;break}if(i3.has(u))return[];F.push(u),u="",E="property";break}case"[":{if(E==="index")throw Error("Invalid character in an index");if(E==="indexEnd"){E="index";break}if(B){B=!1,u+=C;break}if(E==="property"){if(i3.has(u))return[];F.push(u),u=""}E="index";break}case"]":{if(E==="index"){F.push(Number.parseInt(u,10)),u="",E="indexEnd";break}if(E==="indexEnd")throw Error("Invalid character after an index")}default:{if(E==="index"&&!TH.has(C))throw Error("Invalid character in an index");if(E==="indexEnd")throw Error("Invalid character after an index");if(E==="start")E="property";if(B)B=!1,u+="\\";u+=C}}if(B)u+="\\";switch(E){case"property":{if(i3.has(u))return[];F.push(u);break}case"index":throw Error("Index was not closed");case"start":{F.push("");break}}return F}function n3(D,F){if(typeof F!=="number"&&Array.isArray(D)){let u=Number.parseInt(F,10);return Number.isInteger(u)&&D[u]===D[F]}return!1}function s9(D,F){if(n3(D,F))throw Error("Cannot use string index")}function o9(D,F,u){if(!w0(D)||typeof F!=="string")return u===void 0?D:u;let E=y2(F);if(E.length===0)return u;for(let B=0;B<E.length;B++){let C=E[B];if(n3(D,C))D=B===E.length-1?void 0:null;else D=D[C];if(D===void 0||D===null){if(B!==E.length-1)return u;break}}return D===void 0?u:D}function a3(D,F,u){if(!w0(D)||typeof F!=="string")return D;let E=D,B=y2(F);for(let C=0;C<B.length;C++){let Z=B[C];if(s9(D,Z),C===B.length-1)D[Z]=u;else if(!w0(D[Z]))D[Z]=typeof B[C+1]==="number"?[]:{};D=D[Z]}return E}function t9(D,F){if(!w0(D)||typeof F!=="string")return!1;let u=y2(F);for(let E=0;E<u.length;E++){let B=u[E];if(s9(D,B),E===u.length-1)return delete D[B],!0;if(D=D[B],!w0(D))return!1}}function e9(D,F){if(!w0(D)||typeof F!=="string")return!1;let u=y2(F);if(u.length===0)return!1;for(let E of u){if(!w0(D)||!(E in D)||n3(D,E))return!1;D=D[E]}return!0}function _H(D,F){let u=F?SF.join(D,"config.json"):SF.join("configstore",`${D}.json`),E=e0??PF.default.mkdtempSync(PF.default.realpathSync(OH.tmpdir())+SF.sep);return SF.join(E,u)}var LH="You don't have access to this file.",RH={mode:448,recursive:!0},D7={mode:384};function F7(D){if(D.code==="EACCES")D.message=`${D.message}
76
+ ${LH}
77
+ `;throw D}class b2{constructor(D,F,u={}){if(this._path=u.configPath??_H(D,u.globalConfigPath),this._clearInvalidConfig=u.clearInvalidConfig??!0,F)this.all={...F,...this.all}}get all(){try{return JSON.parse(PF.default.readFileSync(this._path,"utf8"))}catch(D){if(D.code==="ENOENT")return{};if(D.name==="SyntaxError"){if(this._clearInvalidConfig)return k2(this._path,"",D7),{};throw D}return F7(D),{}}}set all(D){try{PF.default.mkdirSync(SF.dirname(this._path),RH),k2(this._path,JSON.stringify(D,void 0,"\t"),D7)}catch(F){F7(F)}}get size(){return Object.keys(this.all||{}).length}get(D){return o9(this.all,D)}set(D,F){let u=this.all;if(typeof D==="object"&&arguments.length===1)for(let E of Object.keys(D))a3(u,E,D[E]);else a3(u,D,F);this.all=u}has(D){return e9(this.all,D)}delete(D){let F=this.all;t9(F,D),this.all=F}clear(){this.all={}}get path(){return this._path}}var u7=(D=0)=>(F)=>`\x1B[${F+D}m`,E7=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,B7=(D=0)=>(F,u,E)=>`\x1B[${38+D};2;${F};${u};${E}m`,uD={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]}},R$=Object.keys(uD.modifier),jH=Object.keys(uD.color),SH=Object.keys(uD.bgColor),j$=[...jH,...SH];function PH(){let D=new Map;for(let[F,u]of Object.entries(uD)){for(let[E,B]of Object.entries(u))uD[E]={open:`\x1B[${B[0]}m`,close:`\x1B[${B[1]}m`},u[E]=uD[E],D.set(B[0],B[1]);Object.defineProperty(uD,F,{value:u,enumerable:!1})}return Object.defineProperty(uD,"codes",{value:D,enumerable:!1}),uD.color.close="\x1B[39m",uD.bgColor.close="\x1B[49m",uD.color.ansi=u7(),uD.color.ansi256=E7(),uD.color.ansi16m=B7(),uD.bgColor.ansi=u7(10),uD.bgColor.ansi256=E7(10),uD.bgColor.ansi16m=B7(10),Object.defineProperties(uD,{rgbToAnsi256:{value(F,u,E){if(F===u&&u===E){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round(u/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(F){let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!u)return[0,0,0];let[E]=u;if(E.length===3)E=[...E].map((C)=>C+C).join("");let B=Number.parseInt(E,16);return[B>>16&255,B>>8&255,B&255]},enumerable:!1},hexToAnsi256:{value:(F)=>uD.rgbToAnsi256(...uD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let u,E,B;if(F>=232)u=((F-232)*10+8)/255,E=u,B=u;else{F-=16;let J=F%36;u=Math.floor(F/36)/5,E=Math.floor(J/6)/5,B=J%6/5}let C=Math.max(u,E,B)*2;if(C===0)return 30;let Z=30+(Math.round(B)<<2|Math.round(E)<<1|Math.round(u));if(C===2)Z+=60;return Z},enumerable:!1},rgbToAnsi:{value:(F,u,E)=>uD.ansi256ToAnsi(uD.rgbToAnsi256(F,u,E)),enumerable:!1},hexToAnsi:{value:(F)=>uD.ansi256ToAnsi(uD.hexToAnsi256(F)),enumerable:!1}}),uD}var wH=PH(),pD=wH;import r3 from"node:process";import xH from"node:os";import C7 from"node:tty";function gD(D,F=globalThis.Deno?globalThis.Deno.args:r3.argv){let u=D.startsWith("-")?"":D.length===1?"-":"--",E=F.indexOf(u+D),B=F.indexOf("--");return E!==-1&&(B===-1||E<B)}var{env:ED}=r3,f2;if(gD("no-color")||gD("no-colors")||gD("color=false")||gD("color=never"))f2=0;else if(gD("color")||gD("colors")||gD("color=true")||gD("color=always"))f2=1;function kH(){if("FORCE_COLOR"in ED){if(ED.FORCE_COLOR==="true")return 1;if(ED.FORCE_COLOR==="false")return 0;return ED.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ED.FORCE_COLOR,10),3)}}function yH(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function bH(D,{streamIsTTY:F,sniffFlags:u=!0}={}){let E=kH();if(E!==void 0)f2=E;let B=u?f2:E;if(B===0)return 0;if(u){if(gD("color=16m")||gD("color=full")||gD("color=truecolor"))return 3;if(gD("color=256"))return 2}if("TF_BUILD"in ED&&"AGENT_NAME"in ED)return 1;if(D&&!F&&B===void 0)return 0;let C=B||0;if(ED.TERM==="dumb")return C;if(r3.platform==="win32"){let Z=xH.release().split(".");if(Number(Z[0])>=10&&Number(Z[2])>=10586)return Number(Z[2])>=14931?3:2;return 1}if("CI"in ED){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((Z)=>(Z in ED)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((Z)=>(Z in ED))||ED.CI_NAME==="codeship")return 1;return C}if("TEAMCITY_VERSION"in ED)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ED.TEAMCITY_VERSION)?1:0;if(ED.COLORTERM==="truecolor")return 3;if(ED.TERM==="xterm-kitty")return 3;if(ED.TERM==="xterm-ghostty")return 3;if(ED.TERM==="wezterm")return 3;if("TERM_PROGRAM"in ED){let Z=Number.parseInt((ED.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ED.TERM_PROGRAM){case"iTerm.app":return Z>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(ED.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ED.TERM))return 1;if("COLORTERM"in ED)return 1;return C}function Z7(D,F={}){let u=bH(D,{streamIsTTY:D&&D.isTTY,...F});return yH(u)}var fH={stdout:Z7({isTTY:C7.isatty(1)}),stderr:Z7({isTTY:C7.isatty(2)})},J7=fH;function H7(D,F,u){let E=D.indexOf(F);if(E===-1)return D;let B=F.length,C=0,Z="";do Z+=D.slice(C,E)+F+u,C=E+B,E=D.indexOf(F,C);while(E!==-1);return Z+=D.slice(C),Z}function Y7(D,F,u,E){let B=0,C="";do{let Z=D[E-1]==="\r";C+=D.slice(B,Z?E-1:E)+F+(Z?`\r
78
78
  `:`
79
79
  `)+u,B=E+1,E=D.indexOf(`
80
- `,B)}while(E!==-1);return C+=D.slice(B),C}var{stdout:E7,stderr:B7}=D7,du=Symbol("GENERATOR"),DF=Symbol("STYLER"),PF=Symbol("IS_EMPTY"),C7=["ansi","ansi","ansi256","ansi16m"],FF=Object.create(null),xH=(D,F={})=>{if(F.level&&!(Number.isInteger(F.level)&&F.level>=0&&F.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let u=E7?E7.level:0;D.level=F.level===void 0?u:F.level};var kH=(D)=>{let F=(...u)=>u.join(" ");return xH(F,D),Object.setPrototypeOf(F,wF.prototype),F};function wF(D){return kH(D)}Object.setPrototypeOf(wF.prototype,Function.prototype);for(let[D,F]of Object.entries(lD))FF[D]={get(){let u=b2(this,lu(F.open,F.close,this[DF]),this[PF]);return Object.defineProperty(this,D,{value:u}),u}};FF.visible={get(){let D=b2(this,this[DF],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var cu=(D,F,u,...E)=>{if(D==="rgb"){if(F==="ansi16m")return lD[u].ansi16m(...E);if(F==="ansi256")return lD[u].ansi256(lD.rgbToAnsi256(...E));return lD[u].ansi(lD.rgbToAnsi(...E))}if(D==="hex")return cu("rgb",F,u,...lD.hexToRgb(...E));return lD[u][D](...E)},yH=["rgb","hex","ansi256"];for(let D of yH){FF[D]={get(){let{level:u}=this;return function(...E){let B=lu(cu(D,C7[u],"color",...E),lD.color.close,this[DF]);return b2(this,B,this[PF])}}};let F="bg"+D[0].toUpperCase()+D.slice(1);FF[F]={get(){let{level:u}=this;return function(...E){let B=lu(cu(D,C7[u],"bgColor",...E),lD.bgColor.close,this[DF]);return b2(this,B,this[PF])}}}}var bH=Object.defineProperties(()=>{},{...FF,level:{enumerable:!0,get(){return this[du].level},set(D){this[du].level=D}}}),lu=(D,F,u)=>{let E,B;if(u===void 0)E=D,B=F;else E=u.openAll+D,B=F+u.closeAll;return{open:D,close:F,openAll:E,closeAll:B,parent:u}},b2=(D,F,u)=>{let E=(...B)=>fH(E,B.length===1?""+B[0]:B.join(" "));return Object.setPrototypeOf(E,bH),E[du]=D,E[DF]=F,E[PF]=u,E},fH=(D,F)=>{if(D.level<=0||!F)return D[PF]?"":F;let u=D[DF];if(u===void 0)return F;let{openAll:E,closeAll:B}=u;if(F.includes("\x1B"))while(u!==void 0)F=F7(F,u.close,u.open),u=u.parent;let C=F.indexOf(`
81
- `);if(C!==-1)F=u7(F,B,E,C);return E+F+B};Object.defineProperties(wF.prototype,FF);var vH=wF(),k$=wF({level:B7?B7.level:0});var TD=vH;var wB=GD(ru(),1),xB=GD(EF(),1);class BF extends Error{response;request;options;constructor(D,F,u){let E=D.status||D.status===0?D.status:"",B=D.statusText??"",C=`${E} ${B}`.trim(),Z=C?`status code ${C}`:"an unknown error";super(`Request failed with ${Z}: ${F.method} ${F.url}`);this.name="HTTPError",this.response=D,this.request=F,this.options=u}}class yF extends Error{name="NonError";value;constructor(D){let F="Non-error value was thrown";try{if(typeof D==="string")F=D;else if(D&&typeof D==="object"&&"message"in D&&typeof D.message==="string")F=D.message}catch{}super(F);this.value=D}}class bF extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(D){let F=D?.cause?D.cause instanceof Error?D.cause:new yF(D.cause):void 0;super(D?.code?`Forced retry: ${D.code}`:"Forced retry",F?{cause:F}:void 0);this.customDelay=D?.delay,this.code=D?.code,this.customRequest=D?.request}}var su=(()=>{let D=!1,F=!1,u=typeof globalThis.ReadableStream==="function",E=typeof globalThis.Request==="function";if(u&&E)try{F=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return D=!0,"half"}}).headers.has("Content-Type")}catch(B){if(B instanceof Error&&B.message==="unsupported BodyInit type")return!1;throw B}return D&&!F})(),I7=typeof globalThis.AbortController==="function",d2=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",M7=typeof globalThis.ReadableStream==="function",T7=typeof globalThis.FormData==="function",c2=["get","post","put","patch","head","delete"],JY=()=>{return};JY();var _7={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},l2=2147483647,O7=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,p2=Symbol("stop");class i2{options;constructor(D){this.options=D}}var L7=(D)=>new i2(D),R7={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},j7={next:!0},S7={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var HY=(D)=>{if(!D)return 0;if(D instanceof FormData){let F=0;for(let[u,E]of D)F+=O7,F+=new TextEncoder().encode(`Content-Disposition: form-data; name="${u}"`).length,F+=typeof E==="string"?new TextEncoder().encode(E).length:E.size;return F}if(D instanceof Blob)return D.size;if(D instanceof ArrayBuffer)return D.byteLength;if(typeof D==="string")return new TextEncoder().encode(D).length;if(D instanceof URLSearchParams)return new TextEncoder().encode(D.toString()).length;if("byteLength"in D)return D.byteLength;if(typeof D==="object"&&D!==null)try{let F=JSON.stringify(D);return new TextEncoder().encode(F).length}catch{return 0}return 0},P7=(D,F,u)=>{let E,B=0;return D.pipeThrough(new TransformStream({transform(C,Z){if(Z.enqueue(C),E){B+=E.byteLength;let J=F===0?0:B/F;if(J>=1)J=1-Number.EPSILON;u?.({percent:J,totalBytes:Math.max(F,B),transferredBytes:B},E)}E=C},flush(){if(E)B+=E.byteLength,u?.({percent:1,totalBytes:Math.max(F,B),transferredBytes:B},E)}}))},w7=(D,F)=>{if(!D.body)return D;if(D.status===204)return new Response(null,{status:D.status,statusText:D.statusText,headers:D.headers});let u=Math.max(0,Number(D.headers.get("content-length"))||0);return new Response(P7(D.body,u,F),{status:D.status,statusText:D.statusText,headers:D.headers})},x7=(D,F,u)=>{if(!D.body)return D;let E=HY(u??D.body);return new Request(D,{duplex:"half",body:P7(D.body,E,F)})};var A0=(D)=>D!==null&&typeof D==="object";var fF=(...D)=>{for(let F of D)if((!A0(F)||Array.isArray(F))&&F!==void 0)throw TypeError("The `options` argument must be an object");return eu({},...D)},ou=(D={},F={})=>{let u=new globalThis.Headers(D),E=F instanceof globalThis.Headers,B=new globalThis.Headers(F);for(let[C,Z]of B.entries())if(E&&Z==="undefined"||Z===void 0)u.delete(C);else u.set(C,Z);return u};function n2(D,F,u){return Object.hasOwn(F,u)&&F[u]===void 0?[]:eu(D[u]??[],F[u]??[])}var tu=(D={},F={})=>({beforeRequest:n2(D,F,"beforeRequest"),beforeRetry:n2(D,F,"beforeRetry"),afterResponse:n2(D,F,"afterResponse"),beforeError:n2(D,F,"beforeError")}),YY=(D,F)=>{let u=new URLSearchParams;for(let E of[D,F]){if(E===void 0)continue;if(E instanceof URLSearchParams)for(let[B,C]of E.entries())u.append(B,C);else if(Array.isArray(E))for(let B of E){if(!Array.isArray(B)||B.length!==2)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");u.append(String(B[0]),String(B[1]))}else if(A0(E)){for(let[B,C]of Object.entries(E))if(C!==void 0)u.append(B,String(C))}else{let B=new URLSearchParams(E);for(let[C,Z]of B.entries())u.append(C,Z)}}return u},eu=(...D)=>{let F={},u={},E={},B,C=[];for(let Z of D)if(Array.isArray(Z)){if(!Array.isArray(F))F=[];F=[...F,...Z]}else if(A0(Z)){for(let[J,X]of Object.entries(Z)){if(J==="signal"&&X instanceof globalThis.AbortSignal){C.push(X);continue}if(J==="context"){if(X!==void 0&&X!==null&&(!A0(X)||Array.isArray(X)))throw TypeError("The `context` option must be an object");F={...F,context:X===void 0||X===null?{}:{...F.context,...X}};continue}if(J==="searchParams"){if(X===void 0||X===null)B=void 0;else B=B===void 0?X:YY(B,X);continue}if(A0(X)&&J in F)X=eu(F[J],X);F={...F,[J]:X}}if(A0(Z.hooks))E=tu(E,Z.hooks),F.hooks=E;if(A0(Z.headers))u=ou(u,Z.headers),F.headers=u}if(B!==void 0)F.searchParams=B;if(C.length>0)if(C.length===1)F.signal=C[0];else if(d2)F.signal=AbortSignal.any(C);else F.signal=C.at(-1);return F};var y7=(D)=>c2.includes(D)?D.toUpperCase():D,XY=["get","put","head","delete","options","trace"],GY=[408,413,429,500,502,503,504],QY=[413,429,503],k7={limit:2,methods:XY,statusCodes:GY,afterStatusCodes:QY,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:(D)=>0.3*2**(D-1)*1000,jitter:void 0,retryOnTimeout:!1},b7=(D={})=>{if(typeof D==="number")return{...k7,limit:D};if(D.methods&&!Array.isArray(D.methods))throw Error("retry.methods must be an array");if(D.methods&&=D.methods.map((u)=>u.toLowerCase()),D.statusCodes&&!Array.isArray(D.statusCodes))throw Error("retry.statusCodes must be an array");let F=Object.fromEntries(Object.entries(D).filter(([,u])=>u!==void 0));return{...k7,...F}};class CF extends Error{request;constructor(D){super(`Request timed out: ${D.method} ${D.url}`);this.name="TimeoutError",this.request=D}}async function D3(D,F,u,E){return new Promise((B,C)=>{let Z=setTimeout(()=>{if(u)u.abort();C(new CF(D))},E.timeout);E.fetch(D,F).then(B).catch(C).then(()=>{clearTimeout(Z)})})}async function F3(D,{signal:F}){return new Promise((u,E)=>{if(F)F.throwIfAborted(),F.addEventListener("abort",B,{once:!0});function B(){clearTimeout(C),E(F.reason)}let C=setTimeout(()=>{F?.removeEventListener("abort",B),u()},D)})}var f7=(D,F)=>{let u={};for(let E in F){if(!Object.hasOwn(F,E))continue;if(!(E in S7)&&!(E in R7)&&(!(E in D)||(E in j7)))u[E]=F[E]}return u},v7=(D)=>{if(D===void 0)return!1;if(Array.isArray(D))return D.length>0;if(D instanceof URLSearchParams)return D.size>0;if(typeof D==="object")return Object.keys(D).length>0;if(typeof D==="string")return D.trim().length>0;return Boolean(D)};function h7(D){return D instanceof BF||D?.name===BF.name}function g7(D){return D instanceof CF||D?.name===CF.name}class ZF{static create(D,F){let u=new ZF(D,F),E=async()=>{if(typeof u.#D.timeout==="number"&&u.#D.timeout>l2)throw RangeError(`The \`timeout\` option cannot be greater than ${l2}`);await Promise.resolve();let C=await u.#A();for(let Z of u.#D.hooks.afterResponse){let J=u.#Y(C.clone()),X;try{X=await Z(u.request,u.#Q(),J,{retryCount:u.#F})}catch(Y){throw u.#H(J),u.#H(C),Y}if(X instanceof i2)throw u.#H(J),u.#H(C),new bF(X.options);let H=X instanceof globalThis.Response?X:C;if(J!==H)u.#H(J);if(C!==H)u.#H(C);C=H}if(u.#Y(C),!C.ok&&(typeof u.#D.throwHttpErrors==="function"?u.#D.throwHttpErrors(C.status):u.#D.throwHttpErrors)){let Z=new BF(C,u.request,u.#Q());for(let J of u.#D.hooks.beforeError)Z=await J(Z,{retryCount:u.#F});throw Z}if(u.#D.onDownloadProgress){if(typeof u.#D.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!M7)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let Z=C.clone();return u.#H(C),w7(Z,u.#D.onDownloadProgress)}return C},B=u.#q(E).finally(()=>{let C=u.#B;u.#G(C?.body??void 0),u.#G(u.request.body??void 0)});for(let[C,Z]of Object.entries(_7)){if(C==="bytes"&&typeof globalThis.Response?.prototype?.bytes!=="function")continue;B[C]=async()=>{u.request.headers.set("accept",u.request.headers.get("accept")||Z);let J=await B;if(C==="json"){if(J.status===204)return"";let X=await J.text();if(X==="")return"";if(F.parseJson)return F.parseJson(X);return JSON.parse(X)}return J[C]()}}return B}static#u(D){if(D&&typeof D==="object"&&!Array.isArray(D)&&!(D instanceof URLSearchParams))return Object.fromEntries(Object.entries(D).filter(([,F])=>F!==void 0));return D}request;#Z;#F=0;#E;#D;#B;#C;#J;constructor(D,F={}){if(this.#E=D,this.#D={...F,headers:ou(this.#E.headers,F.headers),hooks:tu({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},F.hooks),method:y7(F.method??this.#E.method??"GET"),prefixUrl:String(F.prefixUrl||""),retry:b7(F.retry),throwHttpErrors:F.throwHttpErrors??!0,timeout:F.timeout??1e4,fetch:F.fetch??globalThis.fetch.bind(globalThis),context:F.context??{}},typeof this.#E!=="string"&&!(this.#E instanceof URL||this.#E instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(this.#D.prefixUrl&&typeof this.#E==="string"){if(this.#E.startsWith("/"))throw Error("`input` must not begin with a slash when using `prefixUrl`");if(!this.#D.prefixUrl.endsWith("/"))this.#D.prefixUrl+="/";this.#E=this.#D.prefixUrl+this.#E}if(I7&&d2)this.#C=this.#D.signal??this.#E.signal,this.#Z=new globalThis.AbortController,this.#D.signal=this.#C?AbortSignal.any([this.#C,this.#Z.signal]):this.#Z.signal;if(su)this.#D.duplex="half";if(this.#D.json!==void 0)this.#D.body=this.#D.stringifyJson?.(this.#D.json)??JSON.stringify(this.#D.json),this.#D.headers.set("content-type",this.#D.headers.get("content-type")??"application/json");let u=F.headers&&new globalThis.Headers(F.headers).has("content-type");if(this.#E instanceof globalThis.Request&&(T7&&this.#D.body instanceof globalThis.FormData||this.#D.body instanceof URLSearchParams)&&!u)this.#D.headers.delete("content-type");if(this.request=new globalThis.Request(this.#E,this.#D),v7(this.#D.searchParams)){let B="?"+(typeof this.#D.searchParams==="string"?this.#D.searchParams.replace(/^\?/,""):new URLSearchParams(ZF.#u(this.#D.searchParams)).toString()),C=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,B);this.request=new globalThis.Request(C,this.#D)}if(this.#D.onUploadProgress){if(typeof this.#D.onUploadProgress!=="function")throw TypeError("The `onUploadProgress` option must be a function");if(!su)throw Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#U(this.request,this.#D.body??void 0)}}#K(){let D=this.#D.retry.delay(this.#F),F=D;if(this.#D.retry.jitter===!0)F=Math.random()*D;else if(typeof this.#D.retry.jitter==="function"){if(F=this.#D.retry.jitter(D),!Number.isFinite(F)||F<0)F=D}let u=this.#D.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(u,F)}async#X(D){if(this.#F++,this.#F>this.#D.retry.limit)throw D;let F=D instanceof Error?D:new yF(D);if(F instanceof bF)return F.customDelay??this.#K();if(!this.#D.retry.methods.includes(this.request.method.toLowerCase()))throw D;if(this.#D.retry.shouldRetry!==void 0){let u=await this.#D.retry.shouldRetry({error:F,retryCount:this.#F});if(u===!1)throw D;if(u===!0)return this.#K()}if(g7(D)&&!this.#D.retry.retryOnTimeout)throw D;if(h7(D)){if(!this.#D.retry.statusCodes.includes(D.response.status))throw D;let u=D.response.headers.get("Retry-After")??D.response.headers.get("RateLimit-Reset")??D.response.headers.get("X-RateLimit-Retry-After")??D.response.headers.get("X-RateLimit-Reset")??D.response.headers.get("X-Rate-Limit-Reset");if(u&&this.#D.retry.afterStatusCodes.includes(D.response.status)){let E=Number(u)*1000;if(Number.isNaN(E))E=Date.parse(u)-Date.now();else if(E>=Date.parse("2024-01-01"))E-=Date.now();let B=this.#D.retry.maxRetryAfter??E;return E<B?E:B}if(D.response.status===413)throw D}return this.#K()}#Y(D){if(this.#D.parseJson)D.json=async()=>this.#D.parseJson(await D.text());return D}#G(D){if(!D)return;D.cancel().catch(()=>{return})}#H(D){this.#G(D.body??void 0)}async#q(D){try{return await D()}catch(F){let u=Math.min(await this.#X(F),l2);if(this.#F<1)throw F;if(await F3(u,this.#C?{signal:this.#C}:{}),F instanceof bF&&F.customRequest){let E=this.#D.signal?new globalThis.Request(F.customRequest,{signal:this.#D.signal}):new globalThis.Request(F.customRequest);this.#z(E)}for(let E of this.#D.hooks.beforeRetry){let B=await E({request:this.request,options:this.#Q(),error:F,retryCount:this.#F});if(B instanceof globalThis.Request){this.#z(B);break}if(B instanceof globalThis.Response)return B;if(B===p2)return}return this.#q(D)}}async#A(){if(this.#Z?.signal.aborted)this.#Z=new globalThis.AbortController,this.#D.signal=this.#C?AbortSignal.any([this.#C,this.#Z.signal]):this.#Z.signal,this.request=new globalThis.Request(this.request,{signal:this.#D.signal});for(let F of this.#D.hooks.beforeRequest){let u=await F(this.request,this.#Q(),{retryCount:this.#F});if(u instanceof Response)return u;if(u instanceof globalThis.Request){this.#z(u);break}}let D=f7(this.request,this.#D);if(this.#B=this.request,this.request=this.#B.clone(),this.#D.timeout===!1)return this.#D.fetch(this.#B,D);return D3(this.#B,D,this.#Z,this.#D)}#Q(){if(!this.#J){let{hooks:D,...F}=this.#D;this.#J=Object.freeze(F)}return this.#J}#z(D){this.#J=void 0,this.request=this.#U(D)}#U(D,F){if(!this.#D.onUploadProgress||!D.body)return D;return x7(D,this.#D.onUploadProgress,F??this.#D.body??void 0)}}/*! MIT License © Sindre Sorhus */var u3=(D)=>{let F=(u,E)=>ZF.create(u,fF(D,E));for(let u of c2)F[u]=(E,B)=>ZF.create(E,fF(D,B,{method:u}));return F.create=(u)=>u3(fF(u)),F.extend=(u)=>{if(typeof u==="function")u=u(D??{});return u3(fF(D,u))},F.stop=p2,F.retry=L7,F},KY=u3(),m7=KY;var G4=GD(X4(),1);function Z3(D){let F=G4.default("npm",{registry:"https://registry.npmjs.org/"}),u=F[`${D}:registry`]||F.config_registry||F.registry;return u.slice(-1)==="/"?u:`${u}/`}var kE=GD(Z5(),1),yE=GD(xE(),1);class bE extends Error{constructor(D){super(`Package \`${D}\` could not be found`);this.name="PackageNotFoundError"}}class fE extends Error{constructor(D,F){super(`Version \`${F}\` for package \`${D}\` could not be found`);this.name="VersionNotFoundError"}}async function S3(D,F={}){let{version:u="latest"}=F,{omitDeprecated:E=!0}=F,B=D.split("/")[0],C=F.registryUrl??Z3(B),Z=new URL(encodeURIComponent(D).replace(/^%40/,"@"),C),J=kE.default(C.toString(),{recursive:!0}),X={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};if(F.fullMetadata)delete X.accept;if(J)X.authorization=`${J.type} ${J.token}`;let H;try{H=await m7(Z,{headers:X,keepalive:!0}).json()}catch(G){if(G?.response?.status===404)throw new bE(D);throw G}if(F.allVersions)return H;let Y=new fE(D,u);if(H["dist-tags"][u]){let{time:G}=H;H=H.versions[H["dist-tags"][u]],H.time=G}else if(u){let G=Boolean(H.versions[u]);if(E&&!G){for(let[Q,z]of Object.entries(H.versions))if(z.deprecated)delete H.versions[Q]}if(!G){let Q=Object.keys(H.versions);if(u=yE.default.maxSatisfying(Q,u),!u)throw Y}let{time:K}=H;if(H=H.versions[u],H.time=K,!H)throw Y}return H}async function P3(D,F){let{version:u}=await S3(D.toLowerCase(),F);return u}import vE from"node:process";var YK=vE.env.npm_package_json,K8=vE.env.npm_config_user_agent,XK=Boolean(K8?.startsWith("npm"))||Boolean(YK?.endsWith("package.json")),GK=Boolean(K8?.startsWith("yarn")),FM=Boolean(K8?.startsWith("pnpm")),uM=Boolean(K8?.startsWith("bun")),hE=XK||GK;import UK from"node:fs";import WK from"node:path";import{fileURLToPath as NK}from"node:url";var iE=GD(lE(),1);import JD from"node:process";import HD from"node:path";import k3 from"node:os";import q8 from"node:fs";var aF=JD.platform==="win32",pE=(D)=>{try{return iE.default.parse(q8.readFileSync(D,"utf8")).prefix}catch{}},QK=()=>Object.keys(JD.env).reduce((D,F)=>/^npm_config_prefix$/i.test(F)?JD.env[F]:D,void 0),KK=()=>{if(aF&&JD.env.APPDATA)return HD.join(JD.env.APPDATA,"/npm/etc/npmrc");if(JD.execPath.includes("/Cellar/node")){let D=JD.execPath.slice(0,JD.execPath.indexOf("/Cellar/node"));return HD.join(D,"/lib/node_modules/npm/npmrc")}if(JD.execPath.endsWith("/bin/node")){let D=HD.dirname(HD.dirname(JD.execPath));return HD.join(D,"/etc/npmrc")}},zK=()=>{if(aF){let{APPDATA:D}=JD.env;return D?HD.join(D,"npm"):HD.dirname(JD.execPath)}return HD.dirname(HD.dirname(JD.execPath))},qK=()=>{let D=QK();if(D)return D;let F=pE(HD.join(k3.homedir(),".npmrc"));if(F)return F;if(JD.env.PREFIX)return JD.env.PREFIX;let u=pE(KK());if(u)return u;return zK()},nF=HD.resolve(qK()),nE=()=>{if(aF&&JD.env.LOCALAPPDATA){let D=HD.join(JD.env.LOCALAPPDATA,"Yarn");if(q8.existsSync(D))return D}return!1},AK=()=>{if(JD.env.PREFIX)return JD.env.PREFIX;let D=nE();if(D)return D;let F=HD.join(k3.homedir(),".config/yarn");if(q8.existsSync(F))return F;let u=HD.join(k3.homedir(),".yarn-config");if(q8.existsSync(u))return u;return nF},u0={};u0.npm={};u0.npm.prefix=nF;u0.npm.packages=HD.join(nF,aF?"node_modules":"lib/node_modules");u0.npm.binaries=aF?nF:HD.join(nF,"bin");var aE=HD.resolve(AK());u0.yarn={};u0.yarn.prefix=aE;u0.yarn.packages=HD.join(aE,nE()?"Data/global/node_modules":"global/node_modules");u0.yarn.binaries=HD.join(u0.yarn.packages,".bin");var y3=u0;import b3 from"node:path";function A8(D,F){let u=b3.relative(F,D);return Boolean(u&&u!==".."&&!u.startsWith(`..${b3.sep}`)&&u!==b3.resolve(D))}var rE=WK.dirname(NK(import.meta.url)),$K=(()=>{try{return A8(rE,y3.yarn.packages)||A8(rE,UK.realpathSync(y3.npm.packages))}catch{return!1}})(),sE=$K;import T8 from"node:process";function f3({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var VK=f3();function v3(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);if(!D.includes("\x1B")&&!D.includes("›"))return D;return D.replace(VK,"")}var U8=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],W8=[12288,12288,65281,65376,65504,65510],h3=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],g3=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],rF=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var N8=(D,F)=>{let u=0,E=Math.floor(D.length/2)-1;while(u<=E){let B=Math.floor((u+E)/2),C=B*2;if(F<D[C])E=B-1;else if(F>D[C+1])u=B+1;else return!0}return!1};var IK=U8[0],MK=U8.at(-1),TK=W8[0],_K=W8.at(-1),_M=h3[0],OM=h3.at(-1),LM=g3[0],RM=g3.at(-1),OK=rF[0],LK=rF.at(-1),oE=19968,[RK,jK]=SK(rF);function SK(D){let F=D[0],u=D[1];for(let E=0;E<D.length;E+=2){let B=D[E],C=D[E+1];if(oE>=B&&oE<=C)return[B,C];if(C-B>u-F)F=B,u=C}return[F,u]}var tE=(D)=>{if(D<IK||D>MK)return!1;return N8(U8,D)},eE=(D)=>{if(D<TK||D>_K)return!1;return N8(W8,D)};var DB=(D)=>{if(D>=RK&&D<=jK)return!0;if(D<OK||D>LK)return!1;return N8(rF,D)};function PK(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function FB(D,{ambiguousAsWide:F=!1}={}){if(PK(D),eE(D)||DB(D)||F&&tE(D))return 2;return 1}var BB=GD(EB(),1),wK=new Intl.Segmenter,xK=/^\p{Default_Ignorable_Code_Point}$/u;function LD(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:u=!0,countAnsiEscapeCodes:E=!1}=F;if(!E)D=v3(D);if(D.length===0)return 0;let B=0,C={ambiguousAsWide:!u};for(let{segment:Z}of wK.segment(D)){let J=Z.codePointAt(0);if(J<=31||J>=127&&J<=159)continue;if(J>=8203&&J<=8207||J===65279)continue;if(J>=768&&J<=879||J>=6832&&J<=6911||J>=7616&&J<=7679||J>=8400&&J<=8447||J>=65056&&J<=65071)continue;if(J>=55296&&J<=57343)continue;if(J>=65024&&J<=65039)continue;if(xK.test(Z))continue;if(BB.default().test(Z)){B+=2;continue}B+=FB(J,C)}return B}function $8(D){let F=0;for(let u of D.split(`
82
- `))F=Math.max(F,LD(u));return F}var TB=GD(d3(),1);var yK=/[\p{Lu}]/u,bK=/[\p{Ll}]/u,JB=/^[\p{Lu}](?![\p{Lu}])/gu,XB=/([\p{Alpha}\p{N}_]|$)/u,c3=/[_.\- ]+/,fK=new RegExp("^"+c3.source),HB=new RegExp(c3.source+XB.source,"gu"),YB=new RegExp("\\d+"+XB.source,"gu"),vK=(D,F,u,E)=>{let B=!1,C=!1,Z=!1,J=!1;for(let X=0;X<D.length;X++){let H=D[X];if(J=X>2?D[X-3]==="-":!0,B&&yK.test(H))D=D.slice(0,X)+"-"+D.slice(X),B=!1,Z=C,C=!0,X++;else if(C&&Z&&bK.test(H)&&(!J||E))D=D.slice(0,X-1)+"-"+D.slice(X-1),Z=C,C=!1,B=!0;else B=F(H)===H&&u(H)!==H,Z=C,C=u(H)===H&&F(H)!==H}return D},hK=(D,F)=>{return JB.lastIndex=0,D.replaceAll(JB,(u)=>F(u))},gK=(D,F)=>{return HB.lastIndex=0,YB.lastIndex=0,D.replaceAll(YB,(u,E,B)=>["_","-"].includes(D.charAt(B+u.length))?u:F(u)).replaceAll(HB,(u,E)=>F(E))};function l3(D,F){if(!(typeof D==="string"||Array.isArray(D)))throw TypeError("Expected the input to be `string | string[]`");if(F={pascalCase:!1,preserveConsecutiveUppercase:!1,...F},Array.isArray(D))D=D.map((C)=>C.trim()).filter((C)=>C.length).join("-");else D=D.trim();if(D.length===0)return"";let u=F.locale===!1?(C)=>C.toLowerCase():(C)=>C.toLocaleLowerCase(F.locale),E=F.locale===!1?(C)=>C.toUpperCase():(C)=>C.toLocaleUpperCase(F.locale);if(D.length===1){if(c3.test(D))return"";return F.pascalCase?E(D):u(D)}if(D!==u(D))D=vK(D,u,E,F.preserveConsecutiveUppercase);if(D=D.replace(fK,""),D=F.preserveConsecutiveUppercase?hK(D,u):u(D),F.pascalCase)D=E(D.charAt(0))+D.slice(1);return gK(D,E)}var r3=GD(QB(),1);function p3({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var lK=p3();function i3(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);if(!D.includes("\x1B")&&!D.includes("›"))return D;return D.replace(lK,"")}var KB=(D=0)=>(F)=>`\x1B[${F+D}m`,zB=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,qB=(D=0)=>(F,u,E)=>`\x1B[${38+D};2;${F};${u};${E}m`,BD={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]}},iM=Object.keys(BD.modifier),pK=Object.keys(BD.color),iK=Object.keys(BD.bgColor),nM=[...pK,...iK];function nK(){let D=new Map;for(let[F,u]of Object.entries(BD)){for(let[E,B]of Object.entries(u))BD[E]={open:`\x1B[${B[0]}m`,close:`\x1B[${B[1]}m`},u[E]=BD[E],D.set(B[0],B[1]);Object.defineProperty(BD,F,{value:u,enumerable:!1})}return Object.defineProperty(BD,"codes",{value:D,enumerable:!1}),BD.color.close="\x1B[39m",BD.bgColor.close="\x1B[49m",BD.color.ansi=KB(),BD.color.ansi256=zB(),BD.color.ansi16m=qB(),BD.bgColor.ansi=KB(10),BD.bgColor.ansi256=zB(10),BD.bgColor.ansi16m=qB(10),Object.defineProperties(BD,{rgbToAnsi256:{value(F,u,E){if(F===u&&u===E){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round(u/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(F){let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!u)return[0,0,0];let[E]=u;if(E.length===3)E=[...E].map((C)=>C+C).join("");let B=Number.parseInt(E,16);return[B>>16&255,B>>8&255,B&255]},enumerable:!1},hexToAnsi256:{value:(F)=>BD.rgbToAnsi256(...BD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let u,E,B;if(F>=232)u=((F-232)*10+8)/255,E=u,B=u;else{F-=16;let J=F%36;u=Math.floor(F/36)/5,E=Math.floor(J/6)/5,B=J%6/5}let C=Math.max(u,E,B)*2;if(C===0)return 30;let Z=30+(Math.round(B)<<2|Math.round(E)<<1|Math.round(u));if(C===2)Z+=60;return Z},enumerable:!1},rgbToAnsi:{value:(F,u,E)=>BD.ansi256ToAnsi(BD.rgbToAnsi256(F,u,E)),enumerable:!1},hexToAnsi:{value:(F)=>BD.ansi256ToAnsi(BD.hexToAnsi256(F)),enumerable:!1}}),BD}var aK=nK(),AB=aK;var I8=new Set(["\x1B","›"]),rK=39,a3="\x07",NB="[",sK="]",$B="m",V8=`${sK}8;;`,UB=(D)=>`${I8.values().next().value}${NB}${D}${$B}`,WB=(D)=>`${I8.values().next().value}${V8}${D}${a3}`,oK=(D)=>D.split(" ").map((F)=>LD(F)),n3=(D,F,u)=>{let E=[...F],B=!1,C=!1,Z=LD(i3(D.at(-1)));for(let[J,X]of E.entries()){let H=LD(X);if(Z+H<=u)D[D.length-1]+=X;else D.push(X),Z=0;if(I8.has(X))B=!0,C=E.slice(J+1,J+1+V8.length).join("")===V8;if(B){if(C){if(X===a3)B=!1,C=!1}else if(X===$B)B=!1;continue}if(Z+=H,Z===u&&J<E.length-1)D.push(""),Z=0}if(!Z&&D.at(-1).length>0&&D.length>1)D[D.length-2]+=D.pop()},tK=(D)=>{let F=D.split(" "),u=F.length;while(u>0){if(LD(F[u-1])>0)break;u--}if(u===F.length)return D;return F.slice(0,u).join(" ")+F.slice(u).join("")},eK=(D,F,u={})=>{if(u.trim!==!1&&D.trim()==="")return"";let E="",B,C,Z=oK(D),J=[""];for(let[G,K]of D.split(" ").entries()){if(u.trim!==!1)J[J.length-1]=J.at(-1).trimStart();let Q=LD(J.at(-1));if(G!==0){if(Q>=F&&(u.wordWrap===!1||u.trim===!1))J.push(""),Q=0;if(Q>0||u.trim===!1)J[J.length-1]+=" ",Q++}if(u.hard&&Z[G]>F){let z=F-Q,q=1+Math.floor((Z[G]-z-1)/F);if(Math.floor((Z[G]-1)/F)<q)J.push("");n3(J,K,F);continue}if(Q+Z[G]>F&&Q>0&&Z[G]>0){if(u.wordWrap===!1&&Q<F){n3(J,K,F);continue}J.push("")}if(Q+Z[G]>F&&u.wordWrap===!1){n3(J,K,F);continue}J[J.length-1]+=K}if(u.trim!==!1)J=J.map((G)=>tK(G));let X=J.join(`
83
- `),H=[...X],Y=0;for(let[G,K]of H.entries()){if(E+=K,I8.has(K)){let{groups:z}=new RegExp(`(?:\\${NB}(?<code>\\d+)m|\\${V8}(?<uri>.*)${a3})`).exec(X.slice(Y))||{groups:{}};if(z.code!==void 0){let q=Number.parseFloat(z.code);B=q===rK?void 0:q}else if(z.uri!==void 0)C=z.uri.length===0?void 0:z.uri}let Q=AB.codes.get(Number(B));if(H[G+1]===`
84
- `){if(C)E+=WB("");if(B&&Q)E+=UB(Q)}else if(K===`
85
- `){if(B&&Q)E+=UB(B);if(C)E+=WB(C)}Y+=K.length}return E};function M8(D,F,u){return String(D).normalize().replaceAll(`\r
80
+ `,B)}while(E!==-1);return C+=D.slice(B),C}var{stdout:X7,stderr:G7}=J7,s3=Symbol("GENERATOR"),FF=Symbol("STYLER"),wF=Symbol("IS_EMPTY"),Q7=["ansi","ansi","ansi256","ansi16m"],uF=Object.create(null),vH=(D,F={})=>{if(F.level&&!(Number.isInteger(F.level)&&F.level>=0&&F.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let u=X7?X7.level:0;D.level=F.level===void 0?u:F.level};var hH=(D)=>{let F=(...u)=>u.join(" ");return vH(F,D),Object.setPrototypeOf(F,xF.prototype),F};function xF(D){return hH(D)}Object.setPrototypeOf(xF.prototype,Function.prototype);for(let[D,F]of Object.entries(pD))uF[D]={get(){let u=v2(this,t3(F.open,F.close,this[FF]),this[wF]);return Object.defineProperty(this,D,{value:u}),u}};uF.visible={get(){let D=v2(this,this[FF],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var o3=(D,F,u,...E)=>{if(D==="rgb"){if(F==="ansi16m")return pD[u].ansi16m(...E);if(F==="ansi256")return pD[u].ansi256(pD.rgbToAnsi256(...E));return pD[u].ansi(pD.rgbToAnsi(...E))}if(D==="hex")return o3("rgb",F,u,...pD.hexToRgb(...E));return pD[u][D](...E)},gH=["rgb","hex","ansi256"];for(let D of gH){uF[D]={get(){let{level:u}=this;return function(...E){let B=t3(o3(D,Q7[u],"color",...E),pD.color.close,this[FF]);return v2(this,B,this[wF])}}};let F="bg"+D[0].toUpperCase()+D.slice(1);uF[F]={get(){let{level:u}=this;return function(...E){let B=t3(o3(D,Q7[u],"bgColor",...E),pD.bgColor.close,this[FF]);return v2(this,B,this[wF])}}}}var mH=Object.defineProperties(()=>{},{...uF,level:{enumerable:!0,get(){return this[s3].level},set(D){this[s3].level=D}}}),t3=(D,F,u)=>{let E,B;if(u===void 0)E=D,B=F;else E=u.openAll+D,B=F+u.closeAll;return{open:D,close:F,openAll:E,closeAll:B,parent:u}},v2=(D,F,u)=>{let E=(...B)=>dH(E,B.length===1?""+B[0]:B.join(" "));return Object.setPrototypeOf(E,mH),E[s3]=D,E[FF]=F,E[wF]=u,E},dH=(D,F)=>{if(D.level<=0||!F)return D[wF]?"":F;let u=D[FF];if(u===void 0)return F;let{openAll:E,closeAll:B}=u;if(F.includes("\x1B"))while(u!==void 0)F=H7(F,u.close,u.open),u=u.parent;let C=F.indexOf(`
81
+ `);if(C!==-1)F=Y7(F,B,E,C);return E+F+B};Object.defineProperties(xF.prototype,uF);var cH=xF(),h$=xF({level:G7?G7.level:0});var OD=cH;var hB=YD(E1(),1),gB=YD(BF(),1);class CF extends Error{response;request;options;constructor(D,F,u){let E=D.status||D.status===0?D.status:"",B=D.statusText??"",C=`${E} ${B}`.trim(),Z=C?`status code ${C}`:"an unknown error";super(`Request failed with ${Z}: ${F.method} ${F.url}`);this.name="HTTPError",this.response=D,this.request=F,this.options=u}}class bF extends Error{name="NonError";value;constructor(D){let F="Non-error value was thrown";try{if(typeof D==="string")F=D;else if(D&&typeof D==="object"&&"message"in D&&typeof D.message==="string")F=D.message}catch{}super(F);this.value=D}}class fF extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(D){let F=D?.cause?D.cause instanceof Error?D.cause:new bF(D.cause):void 0;super(D?.code?`Forced retry: ${D.code}`:"Forced retry",F?{cause:F}:void 0);this.customDelay=D?.delay,this.code=D?.code,this.customRequest=D?.request}}var B1=(()=>{let D=!1,F=!1,u=typeof globalThis.ReadableStream==="function",E=typeof globalThis.Request==="function";if(u&&E)try{F=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return D=!0,"half"}}).headers.has("Content-Type")}catch(B){if(B instanceof Error&&B.message==="unsupported BodyInit type")return!1;throw B}return D&&!F})(),j7=typeof globalThis.AbortController==="function",l2=typeof globalThis.AbortSignal==="function"&&typeof globalThis.AbortSignal.any==="function",S7=typeof globalThis.ReadableStream==="function",P7=typeof globalThis.FormData==="function",p2=["get","post","put","patch","head","delete"],QY=()=>{return};QY();var w7={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},i2=2147483647,x7=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,n2=Symbol("stop");class a2{options;constructor(D){this.options=D}}var k7=(D)=>new a2(D),y7={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},b7={next:!0},f7={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var KY=(D)=>{if(!D)return 0;if(D instanceof FormData){let F=0;for(let[u,E]of D)F+=x7,F+=new TextEncoder().encode(`Content-Disposition: form-data; name="${u}"`).length,F+=typeof E==="string"?new TextEncoder().encode(E).length:E.size;return F}if(D instanceof Blob)return D.size;if(D instanceof ArrayBuffer)return D.byteLength;if(typeof D==="string")return new TextEncoder().encode(D).length;if(D instanceof URLSearchParams)return new TextEncoder().encode(D.toString()).length;if("byteLength"in D)return D.byteLength;if(typeof D==="object"&&D!==null)try{let F=JSON.stringify(D);return new TextEncoder().encode(F).length}catch{return 0}return 0},v7=(D,F,u)=>{let E,B=0;return D.pipeThrough(new TransformStream({transform(C,Z){if(Z.enqueue(C),E){B+=E.byteLength;let J=F===0?0:B/F;if(J>=1)J=1-Number.EPSILON;u?.({percent:J,totalBytes:Math.max(F,B),transferredBytes:B},E)}E=C},flush(){if(E)B+=E.byteLength,u?.({percent:1,totalBytes:Math.max(F,B),transferredBytes:B},E)}}))},h7=(D,F)=>{if(!D.body)return D;if(D.status===204)return new Response(null,{status:D.status,statusText:D.statusText,headers:D.headers});let u=Math.max(0,Number(D.headers.get("content-length"))||0);return new Response(v7(D.body,u,F),{status:D.status,statusText:D.statusText,headers:D.headers})},g7=(D,F,u)=>{if(!D.body)return D;let E=KY(u??D.body);return new Request(D,{duplex:"half",body:v7(D.body,E,F)})};var A0=(D)=>D!==null&&typeof D==="object";var vF=(...D)=>{for(let F of D)if((!A0(F)||Array.isArray(F))&&F!==void 0)throw TypeError("The `options` argument must be an object");return J1({},...D)},C1=(D={},F={})=>{let u=new globalThis.Headers(D),E=F instanceof globalThis.Headers,B=new globalThis.Headers(F);for(let[C,Z]of B.entries())if(E&&Z==="undefined"||Z===void 0)u.delete(C);else u.set(C,Z);return u};function r2(D,F,u){return Object.hasOwn(F,u)&&F[u]===void 0?[]:J1(D[u]??[],F[u]??[])}var Z1=(D={},F={})=>({beforeRequest:r2(D,F,"beforeRequest"),beforeRetry:r2(D,F,"beforeRetry"),afterResponse:r2(D,F,"afterResponse"),beforeError:r2(D,F,"beforeError")}),zY=(D,F)=>{let u=new URLSearchParams;for(let E of[D,F]){if(E===void 0)continue;if(E instanceof URLSearchParams)for(let[B,C]of E.entries())u.append(B,C);else if(Array.isArray(E))for(let B of E){if(!Array.isArray(B)||B.length!==2)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");u.append(String(B[0]),String(B[1]))}else if(A0(E)){for(let[B,C]of Object.entries(E))if(C!==void 0)u.append(B,String(C))}else{let B=new URLSearchParams(E);for(let[C,Z]of B.entries())u.append(C,Z)}}return u},J1=(...D)=>{let F={},u={},E={},B,C=[];for(let Z of D)if(Array.isArray(Z)){if(!Array.isArray(F))F=[];F=[...F,...Z]}else if(A0(Z)){for(let[J,X]of Object.entries(Z)){if(J==="signal"&&X instanceof globalThis.AbortSignal){C.push(X);continue}if(J==="context"){if(X!==void 0&&X!==null&&(!A0(X)||Array.isArray(X)))throw TypeError("The `context` option must be an object");F={...F,context:X===void 0||X===null?{}:{...F.context,...X}};continue}if(J==="searchParams"){if(X===void 0||X===null)B=void 0;else B=B===void 0?X:zY(B,X);continue}if(A0(X)&&J in F)X=J1(F[J],X);F={...F,[J]:X}}if(A0(Z.hooks))E=Z1(E,Z.hooks),F.hooks=E;if(A0(Z.headers))u=C1(u,Z.headers),F.headers=u}if(B!==void 0)F.searchParams=B;if(C.length>0)if(C.length===1)F.signal=C[0];else if(l2)F.signal=AbortSignal.any(C);else F.signal=C.at(-1);return F};var d7=(D)=>p2.includes(D)?D.toUpperCase():D,qY=["get","put","head","delete","options","trace"],AY=[408,413,429,500,502,503,504],UY=[413,429,503],m7={limit:2,methods:qY,statusCodes:AY,afterStatusCodes:UY,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:(D)=>0.3*2**(D-1)*1000,jitter:void 0,retryOnTimeout:!1},c7=(D={})=>{if(typeof D==="number")return{...m7,limit:D};if(D.methods&&!Array.isArray(D.methods))throw Error("retry.methods must be an array");if(D.methods&&=D.methods.map((u)=>u.toLowerCase()),D.statusCodes&&!Array.isArray(D.statusCodes))throw Error("retry.statusCodes must be an array");let F=Object.fromEntries(Object.entries(D).filter(([,u])=>u!==void 0));return{...m7,...F}};class ZF extends Error{request;constructor(D){super(`Request timed out: ${D.method} ${D.url}`);this.name="TimeoutError",this.request=D}}async function H1(D,F,u,E){return new Promise((B,C)=>{let Z=setTimeout(()=>{if(u)u.abort();C(new ZF(D))},E.timeout);E.fetch(D,F).then(B).catch(C).then(()=>{clearTimeout(Z)})})}async function Y1(D,{signal:F}){return new Promise((u,E)=>{if(F)F.throwIfAborted(),F.addEventListener("abort",B,{once:!0});function B(){clearTimeout(C),E(F.reason)}let C=setTimeout(()=>{F?.removeEventListener("abort",B),u()},D)})}var l7=(D,F)=>{let u={};for(let E in F){if(!Object.hasOwn(F,E))continue;if(!(E in f7)&&!(E in y7)&&(!(E in D)||(E in b7)))u[E]=F[E]}return u},p7=(D)=>{if(D===void 0)return!1;if(Array.isArray(D))return D.length>0;if(D instanceof URLSearchParams)return D.size>0;if(typeof D==="object")return Object.keys(D).length>0;if(typeof D==="string")return D.trim().length>0;return Boolean(D)};function i7(D){return D instanceof CF||D?.name===CF.name}function n7(D){return D instanceof ZF||D?.name===ZF.name}class JF{static create(D,F){let u=new JF(D,F),E=async()=>{if(typeof u.#D.timeout==="number"&&u.#D.timeout>i2)throw RangeError(`The \`timeout\` option cannot be greater than ${i2}`);await Promise.resolve();let C=await u.#A();for(let Z of u.#D.hooks.afterResponse){let J=u.#Y(C.clone()),X;try{X=await Z(u.request,u.#Q(),J,{retryCount:u.#F})}catch(Y){throw u.#H(J),u.#H(C),Y}if(X instanceof a2)throw u.#H(J),u.#H(C),new fF(X.options);let H=X instanceof globalThis.Response?X:C;if(J!==H)u.#H(J);if(C!==H)u.#H(C);C=H}if(u.#Y(C),!C.ok&&(typeof u.#D.throwHttpErrors==="function"?u.#D.throwHttpErrors(C.status):u.#D.throwHttpErrors)){let Z=new CF(C,u.request,u.#Q());for(let J of u.#D.hooks.beforeError)Z=await J(Z,{retryCount:u.#F});throw Z}if(u.#D.onDownloadProgress){if(typeof u.#D.onDownloadProgress!=="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!S7)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let Z=C.clone();return u.#H(C),h7(Z,u.#D.onDownloadProgress)}return C},B=u.#q(E).finally(()=>{let C=u.#B;u.#G(C?.body??void 0),u.#G(u.request.body??void 0)});for(let[C,Z]of Object.entries(w7)){if(C==="bytes"&&typeof globalThis.Response?.prototype?.bytes!=="function")continue;B[C]=async()=>{u.request.headers.set("accept",u.request.headers.get("accept")||Z);let J=await B;if(C==="json"){if(J.status===204)return"";let X=await J.text();if(X==="")return"";if(F.parseJson)return F.parseJson(X);return JSON.parse(X)}return J[C]()}}return B}static#u(D){if(D&&typeof D==="object"&&!Array.isArray(D)&&!(D instanceof URLSearchParams))return Object.fromEntries(Object.entries(D).filter(([,F])=>F!==void 0));return D}request;#Z;#F=0;#E;#D;#B;#C;#J;constructor(D,F={}){if(this.#E=D,this.#D={...F,headers:C1(this.#E.headers,F.headers),hooks:Z1({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},F.hooks),method:d7(F.method??this.#E.method??"GET"),prefixUrl:String(F.prefixUrl||""),retry:c7(F.retry),throwHttpErrors:F.throwHttpErrors??!0,timeout:F.timeout??1e4,fetch:F.fetch??globalThis.fetch.bind(globalThis),context:F.context??{}},typeof this.#E!=="string"&&!(this.#E instanceof URL||this.#E instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(this.#D.prefixUrl&&typeof this.#E==="string"){if(this.#E.startsWith("/"))throw Error("`input` must not begin with a slash when using `prefixUrl`");if(!this.#D.prefixUrl.endsWith("/"))this.#D.prefixUrl+="/";this.#E=this.#D.prefixUrl+this.#E}if(j7&&l2)this.#C=this.#D.signal??this.#E.signal,this.#Z=new globalThis.AbortController,this.#D.signal=this.#C?AbortSignal.any([this.#C,this.#Z.signal]):this.#Z.signal;if(B1)this.#D.duplex="half";if(this.#D.json!==void 0)this.#D.body=this.#D.stringifyJson?.(this.#D.json)??JSON.stringify(this.#D.json),this.#D.headers.set("content-type",this.#D.headers.get("content-type")??"application/json");let u=F.headers&&new globalThis.Headers(F.headers).has("content-type");if(this.#E instanceof globalThis.Request&&(P7&&this.#D.body instanceof globalThis.FormData||this.#D.body instanceof URLSearchParams)&&!u)this.#D.headers.delete("content-type");if(this.request=new globalThis.Request(this.#E,this.#D),p7(this.#D.searchParams)){let B="?"+(typeof this.#D.searchParams==="string"?this.#D.searchParams.replace(/^\?/,""):new URLSearchParams(JF.#u(this.#D.searchParams)).toString()),C=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,B);this.request=new globalThis.Request(C,this.#D)}if(this.#D.onUploadProgress){if(typeof this.#D.onUploadProgress!=="function")throw TypeError("The `onUploadProgress` option must be a function");if(!B1)throw Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#U(this.request,this.#D.body??void 0)}}#K(){let D=this.#D.retry.delay(this.#F),F=D;if(this.#D.retry.jitter===!0)F=Math.random()*D;else if(typeof this.#D.retry.jitter==="function"){if(F=this.#D.retry.jitter(D),!Number.isFinite(F)||F<0)F=D}let u=this.#D.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(u,F)}async#X(D){if(this.#F++,this.#F>this.#D.retry.limit)throw D;let F=D instanceof Error?D:new bF(D);if(F instanceof fF)return F.customDelay??this.#K();if(!this.#D.retry.methods.includes(this.request.method.toLowerCase()))throw D;if(this.#D.retry.shouldRetry!==void 0){let u=await this.#D.retry.shouldRetry({error:F,retryCount:this.#F});if(u===!1)throw D;if(u===!0)return this.#K()}if(n7(D)&&!this.#D.retry.retryOnTimeout)throw D;if(i7(D)){if(!this.#D.retry.statusCodes.includes(D.response.status))throw D;let u=D.response.headers.get("Retry-After")??D.response.headers.get("RateLimit-Reset")??D.response.headers.get("X-RateLimit-Retry-After")??D.response.headers.get("X-RateLimit-Reset")??D.response.headers.get("X-Rate-Limit-Reset");if(u&&this.#D.retry.afterStatusCodes.includes(D.response.status)){let E=Number(u)*1000;if(Number.isNaN(E))E=Date.parse(u)-Date.now();else if(E>=Date.parse("2024-01-01"))E-=Date.now();let B=this.#D.retry.maxRetryAfter??E;return E<B?E:B}if(D.response.status===413)throw D}return this.#K()}#Y(D){if(this.#D.parseJson)D.json=async()=>this.#D.parseJson(await D.text());return D}#G(D){if(!D)return;D.cancel().catch(()=>{return})}#H(D){this.#G(D.body??void 0)}async#q(D){try{return await D()}catch(F){let u=Math.min(await this.#X(F),i2);if(this.#F<1)throw F;if(await Y1(u,this.#C?{signal:this.#C}:{}),F instanceof fF&&F.customRequest){let E=this.#D.signal?new globalThis.Request(F.customRequest,{signal:this.#D.signal}):new globalThis.Request(F.customRequest);this.#z(E)}for(let E of this.#D.hooks.beforeRetry){let B=await E({request:this.request,options:this.#Q(),error:F,retryCount:this.#F});if(B instanceof globalThis.Request){this.#z(B);break}if(B instanceof globalThis.Response)return B;if(B===n2)return}return this.#q(D)}}async#A(){if(this.#Z?.signal.aborted)this.#Z=new globalThis.AbortController,this.#D.signal=this.#C?AbortSignal.any([this.#C,this.#Z.signal]):this.#Z.signal,this.request=new globalThis.Request(this.request,{signal:this.#D.signal});for(let F of this.#D.hooks.beforeRequest){let u=await F(this.request,this.#Q(),{retryCount:this.#F});if(u instanceof Response)return u;if(u instanceof globalThis.Request){this.#z(u);break}}let D=l7(this.request,this.#D);if(this.#B=this.request,this.request=this.#B.clone(),this.#D.timeout===!1)return this.#D.fetch(this.#B,D);return H1(this.#B,D,this.#Z,this.#D)}#Q(){if(!this.#J){let{hooks:D,...F}=this.#D;this.#J=Object.freeze(F)}return this.#J}#z(D){this.#J=void 0,this.request=this.#U(D)}#U(D,F){if(!this.#D.onUploadProgress||!D.body)return D;return g7(D,this.#D.onUploadProgress,F??this.#D.body??void 0)}}/*! MIT License © Sindre Sorhus */var X1=(D)=>{let F=(u,E)=>JF.create(u,vF(D,E));for(let u of p2)F[u]=(E,B)=>JF.create(E,vF(D,B,{method:u}));return F.create=(u)=>X1(vF(u)),F.extend=(u)=>{if(typeof u==="function")u=u(D??{});return X1(vF(D,u))},F.stop=n2,F.retry=k7,F},WY=X1(),a7=WY;var W4=YD(U4(),1);function z1(D){let F=W4.default("npm",{registry:"https://registry.npmjs.org/"}),u=F[`${D}:registry`]||F.config_registry||F.registry;return u.slice(-1)==="/"?u:`${u}/`}var mE=YD(K5(),1),dE=YD(gE(),1);class cE extends Error{constructor(D){super(`Package \`${D}\` could not be found`);this.name="PackageNotFoundError"}}class lE extends Error{constructor(D,F){super(`Version \`${F}\` for package \`${D}\` could not be found`);this.name="VersionNotFoundError"}}async function v1(D,F={}){let{version:u="latest"}=F,{omitDeprecated:E=!0}=F,B=D.split("/")[0],C=F.registryUrl??z1(B),Z=new URL(encodeURIComponent(D).replace(/^%40/,"@"),C),J=mE.default(C.toString(),{recursive:!0}),X={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};if(F.fullMetadata)delete X.accept;if(J)X.authorization=`${J.type} ${J.token}`;let H;try{H=await a7(Z,{headers:X,keepalive:!0}).json()}catch(G){if(G?.response?.status===404)throw new cE(D);throw G}if(F.allVersions)return H;let Y=new lE(D,u);if(H["dist-tags"][u]){let{time:G}=H;H=H.versions[H["dist-tags"][u]],H.time=G}else if(u){let G=Boolean(H.versions[u]);if(E&&!G){for(let[Q,z]of Object.entries(H.versions))if(z.deprecated)delete H.versions[Q]}if(!G){let Q=Object.keys(H.versions);if(u=dE.default.maxSatisfying(Q,u),!u)throw Y}let{time:K}=H;if(H=H.versions[u],H.time=K,!H)throw Y}return H}async function h1(D,F){let{version:u}=await v1(D.toLowerCase(),F);return u}import pE from"node:process";var zK=pE.env.npm_package_json,q8=pE.env.npm_config_user_agent,qK=Boolean(q8?.startsWith("npm"))||Boolean(zK?.endsWith("package.json")),AK=Boolean(q8?.startsWith("yarn")),ZM=Boolean(q8?.startsWith("pnpm")),JM=Boolean(q8?.startsWith("bun")),iE=qK||AK;import IK from"node:fs";import MK from"node:path";import{fileURLToPath as TK}from"node:url";var eE=YD(oE(),1);import JD from"node:process";import HD from"node:path";import d1 from"node:os";import U8 from"node:fs";var rF=JD.platform==="win32",tE=(D)=>{try{return eE.default.parse(U8.readFileSync(D,"utf8")).prefix}catch{}},UK=()=>Object.keys(JD.env).reduce((D,F)=>/^npm_config_prefix$/i.test(F)?JD.env[F]:D,void 0),WK=()=>{if(rF&&JD.env.APPDATA)return HD.join(JD.env.APPDATA,"/npm/etc/npmrc");if(JD.execPath.includes("/Cellar/node")){let D=JD.execPath.slice(0,JD.execPath.indexOf("/Cellar/node"));return HD.join(D,"/lib/node_modules/npm/npmrc")}if(JD.execPath.endsWith("/bin/node")){let D=HD.dirname(HD.dirname(JD.execPath));return HD.join(D,"/etc/npmrc")}},NK=()=>{if(rF){let{APPDATA:D}=JD.env;return D?HD.join(D,"npm"):HD.dirname(JD.execPath)}return HD.dirname(HD.dirname(JD.execPath))},$K=()=>{let D=UK();if(D)return D;let F=tE(HD.join(d1.homedir(),".npmrc"));if(F)return F;if(JD.env.PREFIX)return JD.env.PREFIX;let u=tE(WK());if(u)return u;return NK()},aF=HD.resolve($K()),DB=()=>{if(rF&&JD.env.LOCALAPPDATA){let D=HD.join(JD.env.LOCALAPPDATA,"Yarn");if(U8.existsSync(D))return D}return!1},VK=()=>{if(JD.env.PREFIX)return JD.env.PREFIX;let D=DB();if(D)return D;let F=HD.join(d1.homedir(),".config/yarn");if(U8.existsSync(F))return F;let u=HD.join(d1.homedir(),".yarn-config");if(U8.existsSync(u))return u;return aF},E0={};E0.npm={};E0.npm.prefix=aF;E0.npm.packages=HD.join(aF,rF?"node_modules":"lib/node_modules");E0.npm.binaries=rF?aF:HD.join(aF,"bin");var FB=HD.resolve(VK());E0.yarn={};E0.yarn.prefix=FB;E0.yarn.packages=HD.join(FB,DB()?"Data/global/node_modules":"global/node_modules");E0.yarn.binaries=HD.join(E0.yarn.packages,".bin");var c1=E0;import l1 from"node:path";function W8(D,F){let u=l1.relative(F,D);return Boolean(u&&u!==".."&&!u.startsWith(`..${l1.sep}`)&&u!==l1.resolve(D))}var uB=MK.dirname(TK(import.meta.url)),OK=(()=>{try{return W8(uB,c1.yarn.packages)||W8(uB,IK.realpathSync(c1.npm.packages))}catch{return!1}})(),EB=OK;import _8 from"node:process";function p1({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var _K=p1();function i1(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);if(!D.includes("\x1B")&&!D.includes("›"))return D;return D.replace(_K,"")}var N8=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],$8=[12288,12288,65281,65376,65504,65510],n1=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],a1=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],sF=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var V8=(D,F)=>{let u=0,E=Math.floor(D.length/2)-1;while(u<=E){let B=Math.floor((u+E)/2),C=B*2;if(F<D[C])E=B-1;else if(F>D[C+1])u=B+1;else return!0}return!1};var LK=N8[0],RK=N8.at(-1),jK=$8[0],SK=$8.at(-1),SM=n1[0],PM=n1.at(-1),wM=a1[0],xM=a1.at(-1),PK=sF[0],wK=sF.at(-1),BB=19968,[xK,kK]=yK(sF);function yK(D){let F=D[0],u=D[1];for(let E=0;E<D.length;E+=2){let B=D[E],C=D[E+1];if(BB>=B&&BB<=C)return[B,C];if(C-B>u-F)F=B,u=C}return[F,u]}var CB=(D)=>{if(D<LK||D>RK)return!1;return V8(N8,D)},ZB=(D)=>{if(D<jK||D>SK)return!1;return V8($8,D)};var JB=(D)=>{if(D>=xK&&D<=kK)return!0;if(D<PK||D>wK)return!1;return V8(sF,D)};function bK(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function HB(D,{ambiguousAsWide:F=!1}={}){if(bK(D),ZB(D)||JB(D)||F&&CB(D))return 2;return 1}var GB=YD(XB(),1),fK=new Intl.Segmenter,vK=/^\p{Default_Ignorable_Code_Point}$/u;function RD(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:u=!0,countAnsiEscapeCodes:E=!1}=F;if(!E)D=i1(D);if(D.length===0)return 0;let B=0,C={ambiguousAsWide:!u};for(let{segment:Z}of fK.segment(D)){let J=Z.codePointAt(0);if(J<=31||J>=127&&J<=159)continue;if(J>=8203&&J<=8207||J===65279)continue;if(J>=768&&J<=879||J>=6832&&J<=6911||J>=7616&&J<=7679||J>=8400&&J<=8447||J>=65056&&J<=65071)continue;if(J>=55296&&J<=57343)continue;if(J>=65024&&J<=65039)continue;if(vK.test(Z))continue;if(GB.default().test(Z)){B+=2;continue}B+=HB(J,C)}return B}function I8(D){let F=0;for(let u of D.split(`
82
+ `))F=Math.max(F,RD(u));return F}var PB=YD(s1(),1);var gK=/[\p{Lu}]/u,mK=/[\p{Ll}]/u,zB=/^[\p{Lu}](?![\p{Lu}])/gu,UB=/([\p{Alpha}\p{N}_]|$)/u,o1=/[_.\- ]+/,dK=new RegExp("^"+o1.source),qB=new RegExp(o1.source+UB.source,"gu"),AB=new RegExp("\\d+"+UB.source,"gu"),cK=(D,F,u,E)=>{let B=!1,C=!1,Z=!1,J=!1;for(let X=0;X<D.length;X++){let H=D[X];if(J=X>2?D[X-3]==="-":!0,B&&gK.test(H))D=D.slice(0,X)+"-"+D.slice(X),B=!1,Z=C,C=!0,X++;else if(C&&Z&&mK.test(H)&&(!J||E))D=D.slice(0,X-1)+"-"+D.slice(X-1),Z=C,C=!1,B=!0;else B=F(H)===H&&u(H)!==H,Z=C,C=u(H)===H&&F(H)!==H}return D},lK=(D,F)=>{return zB.lastIndex=0,D.replaceAll(zB,(u)=>F(u))},pK=(D,F)=>{return qB.lastIndex=0,AB.lastIndex=0,D.replaceAll(AB,(u,E,B)=>["_","-"].includes(D.charAt(B+u.length))?u:F(u)).replaceAll(qB,(u,E)=>F(E))};function t1(D,F){if(!(typeof D==="string"||Array.isArray(D)))throw TypeError("Expected the input to be `string | string[]`");if(F={pascalCase:!1,preserveConsecutiveUppercase:!1,...F},Array.isArray(D))D=D.map((C)=>C.trim()).filter((C)=>C.length).join("-");else D=D.trim();if(D.length===0)return"";let u=F.locale===!1?(C)=>C.toLowerCase():(C)=>C.toLocaleLowerCase(F.locale),E=F.locale===!1?(C)=>C.toUpperCase():(C)=>C.toLocaleUpperCase(F.locale);if(D.length===1){if(o1.test(D))return"";return F.pascalCase?E(D):u(D)}if(D!==u(D))D=cK(D,u,E,F.preserveConsecutiveUppercase);if(D=D.replace(dK,""),D=F.preserveConsecutiveUppercase?lK(D,u):u(D),F.pascalCase)D=E(D.charAt(0))+D.slice(1);return pK(D,E)}var Eu=YD(NB(),1);function e1({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var rK=e1();function Du(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);if(!D.includes("\x1B")&&!D.includes("›"))return D;return D.replace(rK,"")}var $B=(D=0)=>(F)=>`\x1B[${F+D}m`,VB=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,IB=(D=0)=>(F,u,E)=>`\x1B[${38+D};2;${F};${u};${E}m`,BD={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]}},oM=Object.keys(BD.modifier),sK=Object.keys(BD.color),oK=Object.keys(BD.bgColor),tM=[...sK,...oK];function tK(){let D=new Map;for(let[F,u]of Object.entries(BD)){for(let[E,B]of Object.entries(u))BD[E]={open:`\x1B[${B[0]}m`,close:`\x1B[${B[1]}m`},u[E]=BD[E],D.set(B[0],B[1]);Object.defineProperty(BD,F,{value:u,enumerable:!1})}return Object.defineProperty(BD,"codes",{value:D,enumerable:!1}),BD.color.close="\x1B[39m",BD.bgColor.close="\x1B[49m",BD.color.ansi=$B(),BD.color.ansi256=VB(),BD.color.ansi16m=IB(),BD.bgColor.ansi=$B(10),BD.bgColor.ansi256=VB(10),BD.bgColor.ansi16m=IB(10),Object.defineProperties(BD,{rgbToAnsi256:{value(F,u,E){if(F===u&&u===E){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round(u/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(F){let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!u)return[0,0,0];let[E]=u;if(E.length===3)E=[...E].map((C)=>C+C).join("");let B=Number.parseInt(E,16);return[B>>16&255,B>>8&255,B&255]},enumerable:!1},hexToAnsi256:{value:(F)=>BD.rgbToAnsi256(...BD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value(F){if(F<8)return 30+F;if(F<16)return 90+(F-8);let u,E,B;if(F>=232)u=((F-232)*10+8)/255,E=u,B=u;else{F-=16;let J=F%36;u=Math.floor(F/36)/5,E=Math.floor(J/6)/5,B=J%6/5}let C=Math.max(u,E,B)*2;if(C===0)return 30;let Z=30+(Math.round(B)<<2|Math.round(E)<<1|Math.round(u));if(C===2)Z+=60;return Z},enumerable:!1},rgbToAnsi:{value:(F,u,E)=>BD.ansi256ToAnsi(BD.rgbToAnsi256(F,u,E)),enumerable:!1},hexToAnsi:{value:(F)=>BD.ansi256ToAnsi(BD.hexToAnsi256(F)),enumerable:!1}}),BD}var eK=tK(),MB=eK;var T8=new Set(["\x1B","›"]),Dz=39,uu="\x07",_B="[",Fz="]",LB="m",M8=`${Fz}8;;`,TB=(D)=>`${T8.values().next().value}${_B}${D}${LB}`,OB=(D)=>`${T8.values().next().value}${M8}${D}${uu}`,uz=(D)=>D.split(" ").map((F)=>RD(F)),Fu=(D,F,u)=>{let E=[...F],B=!1,C=!1,Z=RD(Du(D.at(-1)));for(let[J,X]of E.entries()){let H=RD(X);if(Z+H<=u)D[D.length-1]+=X;else D.push(X),Z=0;if(T8.has(X))B=!0,C=E.slice(J+1,J+1+M8.length).join("")===M8;if(B){if(C){if(X===uu)B=!1,C=!1}else if(X===LB)B=!1;continue}if(Z+=H,Z===u&&J<E.length-1)D.push(""),Z=0}if(!Z&&D.at(-1).length>0&&D.length>1)D[D.length-2]+=D.pop()},Ez=(D)=>{let F=D.split(" "),u=F.length;while(u>0){if(RD(F[u-1])>0)break;u--}if(u===F.length)return D;return F.slice(0,u).join(" ")+F.slice(u).join("")},Bz=(D,F,u={})=>{if(u.trim!==!1&&D.trim()==="")return"";let E="",B,C,Z=uz(D),J=[""];for(let[G,K]of D.split(" ").entries()){if(u.trim!==!1)J[J.length-1]=J.at(-1).trimStart();let Q=RD(J.at(-1));if(G!==0){if(Q>=F&&(u.wordWrap===!1||u.trim===!1))J.push(""),Q=0;if(Q>0||u.trim===!1)J[J.length-1]+=" ",Q++}if(u.hard&&Z[G]>F){let z=F-Q,q=1+Math.floor((Z[G]-z-1)/F);if(Math.floor((Z[G]-1)/F)<q)J.push("");Fu(J,K,F);continue}if(Q+Z[G]>F&&Q>0&&Z[G]>0){if(u.wordWrap===!1&&Q<F){Fu(J,K,F);continue}J.push("")}if(Q+Z[G]>F&&u.wordWrap===!1){Fu(J,K,F);continue}J[J.length-1]+=K}if(u.trim!==!1)J=J.map((G)=>Ez(G));let X=J.join(`
83
+ `),H=[...X],Y=0;for(let[G,K]of H.entries()){if(E+=K,T8.has(K)){let{groups:z}=new RegExp(`(?:\\${_B}(?<code>\\d+)m|\\${M8}(?<uri>.*)${uu})`).exec(X.slice(Y))||{groups:{}};if(z.code!==void 0){let q=Number.parseFloat(z.code);B=q===Dz?void 0:q}else if(z.uri!==void 0)C=z.uri.length===0?void 0:z.uri}let Q=MB.codes.get(Number(B));if(H[G+1]===`
84
+ `){if(C)E+=OB("");if(B&&Q)E+=TB(Q)}else if(K===`
85
+ `){if(B&&Q)E+=TB(B);if(C)E+=OB(C)}Y+=K.length}return E};function O8(D,F,u){return String(D).normalize().replaceAll(`\r
86
86
  `,`
87
87
  `).split(`
88
- `).map((E)=>eK(E,F,u)).join(`
89
- `)}var Hz=GD(d3(),1),W0=`
90
- `,kD=" ",sF="none",_B=()=>{let{env:D,stdout:F,stderr:u}=T8;if(F?.columns)return F.columns;if(u?.columns)return u.columns;if(D.COLUMNS)return Number.parseInt(D.COLUMNS,10);return 80},VB=(D)=>typeof D==="number"?{top:D,right:D*3,bottom:D,left:D*3}:{top:0,right:0,bottom:0,left:0,...D},oF=(D)=>D===sF?0:2,Dz=(D)=>{let F=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],u;if(D===sF){D={};for(let E of F)D[E]=""}if(typeof D==="string"){if(u=TB.default[D],!u)throw TypeError(`Invalid border style: ${D}`)}else{if(typeof D?.vertical==="string")D.left=D.vertical,D.right=D.vertical;if(typeof D?.horizontal==="string")D.top=D.horizontal,D.bottom=D.horizontal;for(let E of F)if(D[E]===null||typeof D[E]!=="string")throw TypeError(`Invalid border style: ${E}`);u=D}return u},Fz=(D,F,u)=>{let E="",B=LD(D);switch(u){case"left":{E=D+F.slice(B);break}case"right":{E=F.slice(B)+D;break}default:{if(F=F.slice(B),F.length%2===1)F=F.slice(Math.floor(F.length/2)),E=F.slice(1)+D+F;else F=F.slice(F.length/2),E=F+D+F;break}}return E},uz=(D,{padding:F,width:u,textAlignment:E,height:B})=>{D=r3.default(D,{align:E});let C=D.split(W0),Z=$8(D),J=u-F.left-F.right;if(Z>J){let Y=[];for(let G of C){let K=M8(G,J,{hard:!0}),z=r3.default(K,{align:E}).split(`
91
- `),q=Math.max(...z.map((U)=>LD(U)));for(let U of z){let N;switch(E){case"center":{N=kD.repeat((J-q)/2)+U;break}case"right":{N=kD.repeat(J-q)+U;break}default:{N=U;break}}Y.push(N)}}C=Y}if(E==="center"&&Z<J)C=C.map((Y)=>kD.repeat((J-Z)/2)+Y);else if(E==="right"&&Z<J)C=C.map((Y)=>kD.repeat(J-Z)+Y);let X=kD.repeat(F.left),H=kD.repeat(F.right);if(C=C.map((Y)=>{let G=X+Y+H;return G+kD.repeat(u-LD(G))}),F.top>0)C=[...Array.from({length:F.top}).fill(kD.repeat(u)),...C];if(F.bottom>0)C=[...C,...Array.from({length:F.bottom}).fill(kD.repeat(u))];if(B&&C.length>B)C=C.slice(0,B);else if(B&&C.length<B)C=[...C,...Array.from({length:B-C.length}).fill(kD.repeat(u))];return C.join(W0)},Ez=(D,F,u)=>{let E=(Y)=>{let G=u.borderColor?Zz(u.borderColor)(Y):Y;return u.dimBorder?TD.dim(G):G},B=(Y)=>u.backgroundColor?Jz(u.backgroundColor)(Y):Y,C=Dz(u.borderStyle),Z=_B(),J=kD.repeat(u.margin.left);if(u.float==="center"){let Y=Math.max((Z-F-oF(u.borderStyle))/2,0);J=kD.repeat(Y)}else if(u.float==="right"){let Y=Math.max(Z-F-u.margin.right-oF(u.borderStyle),0);J=kD.repeat(Y)}let X="";if(u.margin.top)X+=W0.repeat(u.margin.top);if(u.borderStyle!==sF||u.title)X+=E(J+C.topLeft+(u.title?Fz(u.title,C.top.repeat(F),u.titleAlignment):C.top.repeat(F))+C.topRight)+W0;let H=D.split(W0);if(X+=H.map((Y)=>J+E(C.left)+B(Y)+E(C.right)).join(W0),u.borderStyle!==sF)X+=W0+E(J+C.bottomLeft+C.bottom.repeat(F)+C.bottomRight);if(u.margin.bottom)X+=W0.repeat(u.margin.bottom);return X},Bz=(D)=>{if(D.fullscreen&&T8?.stdout){let F=[T8.stdout.columns,T8.stdout.rows];if(typeof D.fullscreen==="function")F=D.fullscreen(...F);D.width||=F[0],D.height||=F[1]}return D.width&&=Math.max(1,D.width-oF(D.borderStyle)),D.height&&=Math.max(1,D.height-oF(D.borderStyle)),D},IB=(D,F)=>F===sF?D:` ${D} `,Cz=(D,F)=>{F=Bz(F);let u=F.width!==void 0,E=_B(),B=oF(F.borderStyle),C=E-F.margin.left-F.margin.right-B,Z=$8(M8(D,E-B,{hard:!0,trim:!1}))+F.padding.left+F.padding.right;if(F.title&&u)F.title=F.title.slice(0,Math.max(0,F.width-2)),F.title&&=IB(F.title,F.borderStyle);else if(F.title){if(F.title=F.title.slice(0,Math.max(0,C-2)),F.title){if(F.title=IB(F.title,F.borderStyle),LD(F.title)>Z)F.width=LD(F.title)}}if(F.width||=Z,!u){if(F.margin.left&&F.margin.right&&F.width>C){let X=(E-F.width-B)/(F.margin.left+F.margin.right);F.margin.left=Math.max(0,Math.floor(F.margin.left*X)),F.margin.right=Math.max(0,Math.floor(F.margin.right*X))}F.width=Math.min(F.width,E-B-F.margin.left-F.margin.right)}if(F.width-(F.padding.left+F.padding.right)<=0)F.padding.left=0,F.padding.right=0;if(F.height&&F.height-(F.padding.top+F.padding.bottom)<=0)F.padding.top=0,F.padding.bottom=0;return F},s3=(D)=>D.match(/^#(?:[0-f]{3}){1,2}$/i),MB=(D)=>typeof D==="string"&&(TD[D]??s3(D)),Zz=(D)=>s3(D)?TD.hex(D):TD[D],Jz=(D)=>s3(D)?TD.bgHex(D):TD[l3(["bg",D])];function _8(D,F){if(F={padding:0,borderStyle:"single",dimBorder:!1,textAlignment:"left",float:"left",titleAlignment:"left",...F},F.align)F.textAlignment=F.align;if(F.borderColor&&!MB(F.borderColor))throw Error(`${F.borderColor} is not a valid borderColor`);if(F.backgroundColor&&!MB(F.backgroundColor))throw Error(`${F.backgroundColor} is not a valid backgroundColor`);return F.padding=VB(F.padding),F.margin=VB(F.margin),F=Cz(D,F),D=uz(D,F),Ez(D,F.width,F)}import{env as tF}from"node:process";var Yz=tF.CI!=="0"&&tF.CI!=="false"&&(("CI"in tF)||("CONTINUOUS_INTEGRATION"in tF)||Object.keys(tF).some((D)=>D.startsWith("CI_"))),OB=Yz;var LB=(D)=>D.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function RB(D,...F){if(typeof D==="string")return LB(D);let u=D[0];for(let[E,B]of F.entries())u=u+LB(String(B))+D[E+1];return u}class jB extends Error{constructor(D){super(`Missing a value for ${D?`the placeholder: ${D}`:"a placeholder"}`,D);this.name="MissingValueError",this.key=D}}class SB extends Error{constructor(D){super(`Missing filter: ${D}`);this.name="MissingFilterError",this.filterName=D}}function o3(D,F,{ignoreMissing:u=!1,transform:E=({value:C})=>C,filters:B={}}={}){if(typeof D!=="string")throw TypeError(`Expected a \`string\` in the first argument, got \`${typeof D}\``);if(typeof F!=="object")throw TypeError(`Expected an \`object\` or \`Array\` in the second argument, got \`${typeof F}\``);let C="",Z="";D=D.replace(/\\{/g,C),D=D.replace(/\\}/g,Z);let J=(z)=>{let q=[],U="";for(let N=0;N<z.length;N++)if(z[N]==="\\"&&z[N+1]===".")U+=".",N++;else if(z[N]===".")q.push(U),U="";else U+=z[N];return q.push(U),q},X=(z,q)=>{let U=q.split("|").map((P)=>P.trim()),N=U[0],I=U.slice(1),$=J(N),W=F;for(let P of $)if(W)W=W[P];for(let P of I){let L=B[P];if(!L){if(u)return z;throw new SB(P)}if(W!==void 0)W=L(W)}let j=E({value:W,key:N});if(j===void 0){if(u)return z;throw new jB(N)}return String(j)},G=`(${"(\\d+|[a-z$_][\\w\\-.$\\\\]*)"}\\s*${"(?:\\|\\s*[a-z$_][\\w$]*\\s*)*"})`,K=new RegExp(`{{${G}}}`,"gi"),Q=new RegExp(`{${G}}`,"gi");return D=D.replace(K,(...z)=>RB(X(...z))),D=D.replace(Q,X),D=D.replace(new RegExp(C,"g"),"{"),D=D.replace(new RegExp(Z,"g"),"}"),D}var Qz=PB.dirname(Gz(import.meta.url)),Kz=86400000;class O8{config;update;_packageName;_shouldNotifyInNpmScript;#u;#Z;#F;#E;constructor(D={}){if(this.#u=D,D.pkg??={},D.distTag??="latest",D.pkg={name:D.pkg.name??D.packageName,version:D.pkg.version??D.packageVersion},!D.pkg.name||!D.pkg.version)throw Error("pkg.name and pkg.version required");if(this._packageName=D.pkg.name,this.#Z=D.pkg.version,this.#F=typeof D.updateCheckInterval==="number"?D.updateCheckInterval:Kz,this.#E="NO_UPDATE_NOTIFIER"in m0.env||m0.env.NODE_ENV==="test"||m0.argv.includes("--no-update-notifier")||OB,this._shouldNotifyInNpmScript=D.shouldNotifyInNpmScript,!this.#E)try{this.config=new k2(`update-notifier-${this._packageName}`,{optOut:!1,lastUpdateCheck:Date.now()})}catch{let F=TD.yellow(t3(" %s update check failed ",D.pkg.name))+t3(`
92
- Try running with %s or get access `,TD.cyan("sudo"))+`
88
+ `).map((E)=>Bz(E,F,u)).join(`
89
+ `)}var Kz=YD(s1(),1),W0=`
90
+ `,kD=" ",oF="none",wB=()=>{let{env:D,stdout:F,stderr:u}=_8;if(F?.columns)return F.columns;if(u?.columns)return u.columns;if(D.COLUMNS)return Number.parseInt(D.COLUMNS,10);return 80},RB=(D)=>typeof D==="number"?{top:D,right:D*3,bottom:D,left:D*3}:{top:0,right:0,bottom:0,left:0,...D},tF=(D)=>D===oF?0:2,Cz=(D)=>{let F=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],u;if(D===oF){D={};for(let E of F)D[E]=""}if(typeof D==="string"){if(u=PB.default[D],!u)throw TypeError(`Invalid border style: ${D}`)}else{if(typeof D?.vertical==="string")D.left=D.vertical,D.right=D.vertical;if(typeof D?.horizontal==="string")D.top=D.horizontal,D.bottom=D.horizontal;for(let E of F)if(D[E]===null||typeof D[E]!=="string")throw TypeError(`Invalid border style: ${E}`);u=D}return u},Zz=(D,F,u)=>{let E="",B=RD(D);switch(u){case"left":{E=D+F.slice(B);break}case"right":{E=F.slice(B)+D;break}default:{if(F=F.slice(B),F.length%2===1)F=F.slice(Math.floor(F.length/2)),E=F.slice(1)+D+F;else F=F.slice(F.length/2),E=F+D+F;break}}return E},Jz=(D,{padding:F,width:u,textAlignment:E,height:B})=>{D=Eu.default(D,{align:E});let C=D.split(W0),Z=I8(D),J=u-F.left-F.right;if(Z>J){let Y=[];for(let G of C){let K=O8(G,J,{hard:!0}),z=Eu.default(K,{align:E}).split(`
91
+ `),q=Math.max(...z.map((U)=>RD(U)));for(let U of z){let N;switch(E){case"center":{N=kD.repeat((J-q)/2)+U;break}case"right":{N=kD.repeat(J-q)+U;break}default:{N=U;break}}Y.push(N)}}C=Y}if(E==="center"&&Z<J)C=C.map((Y)=>kD.repeat((J-Z)/2)+Y);else if(E==="right"&&Z<J)C=C.map((Y)=>kD.repeat(J-Z)+Y);let X=kD.repeat(F.left),H=kD.repeat(F.right);if(C=C.map((Y)=>{let G=X+Y+H;return G+kD.repeat(u-RD(G))}),F.top>0)C=[...Array.from({length:F.top}).fill(kD.repeat(u)),...C];if(F.bottom>0)C=[...C,...Array.from({length:F.bottom}).fill(kD.repeat(u))];if(B&&C.length>B)C=C.slice(0,B);else if(B&&C.length<B)C=[...C,...Array.from({length:B-C.length}).fill(kD.repeat(u))];return C.join(W0)},Hz=(D,F,u)=>{let E=(Y)=>{let G=u.borderColor?Gz(u.borderColor)(Y):Y;return u.dimBorder?OD.dim(G):G},B=(Y)=>u.backgroundColor?Qz(u.backgroundColor)(Y):Y,C=Cz(u.borderStyle),Z=wB(),J=kD.repeat(u.margin.left);if(u.float==="center"){let Y=Math.max((Z-F-tF(u.borderStyle))/2,0);J=kD.repeat(Y)}else if(u.float==="right"){let Y=Math.max(Z-F-u.margin.right-tF(u.borderStyle),0);J=kD.repeat(Y)}let X="";if(u.margin.top)X+=W0.repeat(u.margin.top);if(u.borderStyle!==oF||u.title)X+=E(J+C.topLeft+(u.title?Zz(u.title,C.top.repeat(F),u.titleAlignment):C.top.repeat(F))+C.topRight)+W0;let H=D.split(W0);if(X+=H.map((Y)=>J+E(C.left)+B(Y)+E(C.right)).join(W0),u.borderStyle!==oF)X+=W0+E(J+C.bottomLeft+C.bottom.repeat(F)+C.bottomRight);if(u.margin.bottom)X+=W0.repeat(u.margin.bottom);return X},Yz=(D)=>{if(D.fullscreen&&_8?.stdout){let F=[_8.stdout.columns,_8.stdout.rows];if(typeof D.fullscreen==="function")F=D.fullscreen(...F);D.width||=F[0],D.height||=F[1]}return D.width&&=Math.max(1,D.width-tF(D.borderStyle)),D.height&&=Math.max(1,D.height-tF(D.borderStyle)),D},jB=(D,F)=>F===oF?D:` ${D} `,Xz=(D,F)=>{F=Yz(F);let u=F.width!==void 0,E=wB(),B=tF(F.borderStyle),C=E-F.margin.left-F.margin.right-B,Z=I8(O8(D,E-B,{hard:!0,trim:!1}))+F.padding.left+F.padding.right;if(F.title&&u)F.title=F.title.slice(0,Math.max(0,F.width-2)),F.title&&=jB(F.title,F.borderStyle);else if(F.title){if(F.title=F.title.slice(0,Math.max(0,C-2)),F.title){if(F.title=jB(F.title,F.borderStyle),RD(F.title)>Z)F.width=RD(F.title)}}if(F.width||=Z,!u){if(F.margin.left&&F.margin.right&&F.width>C){let X=(E-F.width-B)/(F.margin.left+F.margin.right);F.margin.left=Math.max(0,Math.floor(F.margin.left*X)),F.margin.right=Math.max(0,Math.floor(F.margin.right*X))}F.width=Math.min(F.width,E-B-F.margin.left-F.margin.right)}if(F.width-(F.padding.left+F.padding.right)<=0)F.padding.left=0,F.padding.right=0;if(F.height&&F.height-(F.padding.top+F.padding.bottom)<=0)F.padding.top=0,F.padding.bottom=0;return F},Bu=(D)=>D.match(/^#(?:[0-f]{3}){1,2}$/i),SB=(D)=>typeof D==="string"&&(OD[D]??Bu(D)),Gz=(D)=>Bu(D)?OD.hex(D):OD[D],Qz=(D)=>Bu(D)?OD.bgHex(D):OD[t1(["bg",D])];function L8(D,F){if(F={padding:0,borderStyle:"single",dimBorder:!1,textAlignment:"left",float:"left",titleAlignment:"left",...F},F.align)F.textAlignment=F.align;if(F.borderColor&&!SB(F.borderColor))throw Error(`${F.borderColor} is not a valid borderColor`);if(F.backgroundColor&&!SB(F.backgroundColor))throw Error(`${F.backgroundColor} is not a valid backgroundColor`);return F.padding=RB(F.padding),F.margin=RB(F.margin),F=Xz(D,F),D=Jz(D,F),Hz(D,F.width,F)}import{env as eF}from"node:process";var zz=eF.CI!=="0"&&eF.CI!=="false"&&(("CI"in eF)||("CONTINUOUS_INTEGRATION"in eF)||Object.keys(eF).some((D)=>D.startsWith("CI_"))),xB=zz;var kB=(D)=>D.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function yB(D,...F){if(typeof D==="string")return kB(D);let u=D[0];for(let[E,B]of F.entries())u=u+kB(String(B))+D[E+1];return u}class bB extends Error{constructor(D){super(`Missing a value for ${D?`the placeholder: ${D}`:"a placeholder"}`,D);this.name="MissingValueError",this.key=D}}class fB extends Error{constructor(D){super(`Missing filter: ${D}`);this.name="MissingFilterError",this.filterName=D}}function Cu(D,F,{ignoreMissing:u=!1,transform:E=({value:C})=>C,filters:B={}}={}){if(typeof D!=="string")throw TypeError(`Expected a \`string\` in the first argument, got \`${typeof D}\``);if(typeof F!=="object")throw TypeError(`Expected an \`object\` or \`Array\` in the second argument, got \`${typeof F}\``);let C="",Z="";D=D.replace(/\\{/g,C),D=D.replace(/\\}/g,Z);let J=(z)=>{let q=[],U="";for(let N=0;N<z.length;N++)if(z[N]==="\\"&&z[N+1]===".")U+=".",N++;else if(z[N]===".")q.push(U),U="";else U+=z[N];return q.push(U),q},X=(z,q)=>{let U=q.split("|").map((P)=>P.trim()),N=U[0],M=U.slice(1),$=J(N),W=F;for(let P of $)if(W)W=W[P];for(let P of M){let L=B[P];if(!L){if(u)return z;throw new fB(P)}if(W!==void 0)W=L(W)}let j=E({value:W,key:N});if(j===void 0){if(u)return z;throw new bB(N)}return String(j)},G=`(${"(\\d+|[a-z$_][\\w\\-.$\\\\]*)"}\\s*${"(?:\\|\\s*[a-z$_][\\w$]*\\s*)*"})`,K=new RegExp(`{{${G}}}`,"gi"),Q=new RegExp(`{${G}}`,"gi");return D=D.replace(K,(...z)=>yB(X(...z))),D=D.replace(Q,X),D=D.replace(new RegExp(C,"g"),"{"),D=D.replace(new RegExp(Z,"g"),"}"),D}var Uz=vB.dirname(Az(import.meta.url)),Wz=86400000;class R8{config;update;_packageName;_shouldNotifyInNpmScript;#u;#Z;#F;#E;constructor(D={}){if(this.#u=D,D.pkg??={},D.distTag??="latest",D.pkg={name:D.pkg.name??D.packageName,version:D.pkg.version??D.packageVersion},!D.pkg.name||!D.pkg.version)throw Error("pkg.name and pkg.version required");if(this._packageName=D.pkg.name,this.#Z=D.pkg.version,this.#F=typeof D.updateCheckInterval==="number"?D.updateCheckInterval:Wz,this.#E="NO_UPDATE_NOTIFIER"in d0.env||d0.env.NODE_ENV==="test"||d0.argv.includes("--no-update-notifier")||xB,this._shouldNotifyInNpmScript=D.shouldNotifyInNpmScript,!this.#E)try{this.config=new b2(`update-notifier-${this._packageName}`,{optOut:!1,lastUpdateCheck:Date.now()})}catch{let F=OD.yellow(Zu(" %s update check failed ",D.pkg.name))+Zu(`
92
+ Try running with %s or get access `,OD.cyan("sudo"))+`
93
93
  to the local update config store via
94
- `+TD.cyan(t3(" sudo chown -R $USER:$(id -gn $USER) %s ",t0));m0.on("exit",()=>{console.error(_8(F,{textAlignment:"center"}))})}}check(){if(!this.config||this.config.get("optOut")||this.#E)return;if(this.update=this.config.get("update"),this.update)this.update.current=this.#Z,this.config.delete("update");if(Date.now()-this.config.get("lastUpdateCheck")<this.#F)return;Xz(m0.execPath,[PB.join(Qz,"check.js"),JSON.stringify(this.#u)],{detached:!0,stdio:"ignore"}).unref()}async fetchInfo(){let{distTag:D}=this.#u,F=await P3(this._packageName,{version:D});return{latest:F,current:this.#Z,type:wB.default(this.#Z,F)??D,name:this._packageName}}notify(D){let F=!this._shouldNotifyInNpmScript&&hE;if(!m0.stdout.isTTY||F||!this.update||!xB.default(this.update.latest,this.update.current))return this;D={isGlobal:sE,...D};let u=D.isGlobal?`npm i -g ${this._packageName}`:`npm i ${this._packageName}`,E="Update available "+TD.dim("{currentVersion}")+TD.reset(" → ")+TD.green("{latestVersion}")+`
95
- Run `+TD.cyan("{updateCommand}")+" to update",B=D.message||E;D.boxenOptions??={padding:1,margin:1,textAlignment:"center",borderColor:"yellow",borderStyle:"round"};let C=_8(o3(B,{packageName:this._packageName,currentVersion:this.update.current,latestVersion:this.update.latest,updateCommand:u}),D.boxenOptions);if(D.defer===!1)console.error(C);else m0.on("exit",()=>{console.error(C)});return this}}function e3(D){let F=new O8(D);return F.check(),F}var zz=()=>Boolean(process.stdout.isTTY),qz=()=>Boolean(process.stdin.isTTY),Az=()=>Boolean(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.BUILDKITE||process.env.TF_BUILD);var E0=()=>zz()&&qz()&&!Az();var eF={name:"@photon-ai/cli",version:"0.3.3",description:"Photon CLI — typed terminal UI for the Photon Dashboard. Binary: `photon` (alias `pho`).",keywords:["photon","cli","dashboard","spectrum","messaging","imessage","developer-tools"],author:"Photon",license:"MIT",homepage:"https://github.com/photon-hq/cli#readme",repository:{type:"git",url:"git+https://github.com/photon-hq/cli.git"},bugs:{url:"https://github.com/photon-hq/cli/issues"},type:"module",bin:{photon:"./dist/photon.js"},files:["dist","README.md"],publishConfig:{access:"public"},engines:{bun:">=1.3.0",node:">=18.0.0"},scripts:{start:"bun run src/index.ts",dev:"bun run --watch src/index.ts",build:"bun build ./src/index.ts --outfile dist/photon.js --target node --minify && chmod +x dist/photon.js",compile:"bun build ./src/index.ts --compile --outfile dist/photon",typecheck:"tsc --noEmit",test:"bun test",check:"bun run typecheck && bun test && bun run build","sync:api":"bun run scripts/sync-api-types.ts",manifest:"bun run scripts/generate-route-manifest.ts",prepublishOnly:"bun run typecheck && bun run build"},devDependencies:{"@types/bun":"latest","@types/node":"^25.6.2","@types/update-notifier":"^6.0.8",elysia:"1.4.28",typescript:"^5"},dependencies:{"@clack/prompts":"^1.2.0","@commander-js/extra-typings":"^14.0.0","@elysiajs/eden":"1.4.9","better-auth":"1.4.18","cli-table3":"^0.6.5",commander:"^14.0.3",open:"^11.0.0",picocolors:"^1.1.1","update-notifier":"^7.3.1"}};function kB(){if(!E0())return;if(process.env.PHOTON_NO_UPDATE_NOTIFIER==="1")return;e3({pkg:{name:eF.name,version:eF.version},updateCheckInterval:86400000}).notify({defer:!0,isGlobal:!0})}var tB=GD(oB(),1),{program:mT,createCommand:dT,createArgument:cT,createOption:lT,CommanderError:pT,InvalidArgumentError:iT,InvalidOptionArgumentError:nT,Command:eB,Argument:aT,Option:rT,Help:sT}=tB.default;import{existsSync as DC,renameSync as Hq}from"node:fs";import FC from"node:os";import KF from"node:path";var S8="https://app.photon.codes";function Yq(D){return D??process.env.PHOTON_API_HOST??S8}function H1(D){try{return new URL(D).origin}catch{throw Error(`Invalid API host URL: "${D}". Must include scheme — e.g. https://your.host.tld.`)}}function uC(D){let F=H1(Yq(D));return{name:Xq(F),url:F}}function Xq(D){let F;try{F=new URL(D)}catch{throw Error(`Invalid API host URL: "${D}". Must include scheme — e.g. https://your.host.tld.`)}if(F.origin===S8)return"production";let u=F.hostname.toLowerCase().replace(/[[\]]/g,"").replace(/[.:%]/g,"_"),E=F.port?`_${F.port}`:"",B=`${u}${E}`;if(B.length>64)throw Error(`API host "${D}" produces a key longer than 64 characters (got ${B.length}). Use a shorter hostname or alias the host in your local hosts file / DNS.`);return B}var Gq=/^[a-z0-9_][a-z0-9_-]{0,63}$/;function Qq(D){if(!Gq.test(D))throw Error(`Invalid environment key "${D}" — must be 1-64 chars, `+"start with a-z, 0-9, or '_', and only contain a-z, 0-9, '-', '_'.")}function P8(){let D=process.env.PHOTON_CONFIG_DIR??process.env.DASHBOARD_CONFIG_DIR;if(D)return D;let F=process.env.XDG_CONFIG_HOME,u=F?KF.join(F,"photon"):KF.join(FC.homedir(),".config","photon"),E=F?KF.join(F,"photon-dashboard"):KF.join(FC.homedir(),".config","photon-dashboard"),B=u;if(!DC(u)&&DC(E))try{Hq(E,u)}catch{B=E}return B}var Y1=()=>KF.join(P8(),"credentials"),w8=(D)=>{return Qq(D),KF.join(Y1(),`${D}.json`)};async function PD(D){return uC(D)}import{chmod as Kq,mkdir as zq,readdir as qq,readFile as Aq,unlink as Uq,writeFile as Wq}from"node:fs/promises";import{dirname as Nq}from"node:path";async function zF(D){try{let F=await Aq(w8(D),"utf-8");return JSON.parse(F)}catch{return null}}async function EC(D){let F=w8(D.envName);await zq(Nq(F),{recursive:!0}),await Wq(F,JSON.stringify(D,null,2)+`
96
- `,"utf-8"),await Kq(F,384)}async function BC(D){let F=w8(D);try{await Uq(F)}catch(u){if(u.code!=="ENOENT")throw u}}async function x8(){try{return(await qq(Y1())).filter((F)=>F.endsWith(".json")).map((F)=>F.slice(0,-5)).sort()}catch(D){if(D.code==="ENOENT")return[];throw D}}function CC(D){D.command("auth").description("inspect authentication state across backends").command("status").description("show login status for every backend you've authenticated against").option("--json","output JSON").action(async(u)=>{let E=await PD(),B=await x8(),C=Array.from(new Set([E.name,...B])).sort(),Z=await Promise.all(C.map(async(H)=>{let Y=await zF(H);if(!Y)return{name:H,url:H===E.name?E.url:null,loggedIn:!1,user:null,issuedAt:null,corrupt:B.includes(H)};return{name:H,url:Y.apiUrl,loggedIn:!0,user:Y.user,issuedAt:Y.issuedAt,corrupt:!1}}));if(u.json)return a(Z);let J=Z.map((H)=>[H.name===E.name?A.green("●"):" ",H.name,H.url??A.dim("—"),H.loggedIn?A.green(H.user?.email??"yes"):H.corrupt?A.yellow("corrupt"):A.dim("no"),H.issuedAt?new Date(H.issuedAt).toLocaleDateString():A.dim("—")]);vD(["","key","url","logged in","since"],J);let X=Z.filter((H)=>H.corrupt).map((H)=>H.name);if(X.length>0)console.log(),console.log(A.warn(`Credentials file for ${X.join(", ")} is unreadable. Re-login with \`photon login --api-host <url>\`.`))})}var N0=class extends Error{constructor(D,F){super(F+"");this.status=D,this.value=F}},$q=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,Vq=/(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{2}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT(?:\+|-)\d{4}\s\([^)]+\)/,Iq=/^(?:(?:(?:(?:0?[1-9]|[12][0-9]|3[01])[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:19|20)\d{2})|(?:(?:19|20)\d{2}[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:0?[1-9]|[12][0-9]|3[01]))))(?:\s(?:1[012]|0?[1-9]):[0-5][0-9](?::[0-5][0-9])?(?:\s[AP]M)?)?$/,Mq=(D)=>D.trim().length!==0&&!Number.isNaN(Number(D)),k8=(D,F)=>{if(typeof D!="string"||F?.parseDate===!1)return null;let u=D.replace(/"/g,"");if($q.test(u)||Vq.test(u)||Iq.test(u)){let E=new Date(u);if(!Number.isNaN(E.getTime()))return E}return null},Tq=(D)=>{let F=D.charCodeAt(0),u=D.charCodeAt(D.length-1);return F===123&&u===125||F===91&&u===93},_q=(D,F)=>JSON.parse(D,(u,E)=>{return k8(E,F)||E}),d0=(D,F)=>{if(!D)return D;if(Mq(D))return+D;if(D==="true")return!0;if(D==="false")return!1;if(F?.parseDate!==!1){let u=k8(D,F);if(u)return u}if(Tq(D))try{return _q(D,F)}catch{}return D},X1=(D,F)=>{let u=D.data.toString();return u==="null"?null:d0(u,F)};var Oq=class{constructor(D){this.url=D,this.ws=new WebSocket(D)}ws;send(D){return Array.isArray(D)?(D.forEach((F)=>this.send(F)),this):(this.ws.send(typeof D=="object"?JSON.stringify(D):D.toString()),this)}on(D,F,u){return this.addEventListener(D,F,u)}off(D,F,u){return this.ws.removeEventListener(D,F,u),this}subscribe(D,F){return this.addEventListener("message",D,F)}addEventListener(D,F,u){return this.ws.addEventListener(D,(E)=>{if(D==="message"){let B=X1(E);F({...E,data:B})}else F(E)},u),this}removeEventListener(D,F,u){return this.off(D,F,u),this}close(){return this.ws.close(),this}},Lq=["get","post","put","delete","patch","options","head","connect","subscribe"],ZC=(D,F)=>typeof F=="function"?F(D):F===!0,YC=["localhost","127.0.0.1","0.0.0.0"],Q1=typeof FileList>"u",y8=(D)=>Q1?D instanceof Blob:D instanceof FileList||D instanceof File,Rq=(D)=>{if(!D)return!1;for(let F in D)if(y8(D[F])||Array.isArray(D[F])&&D[F].find(y8))return!0;return!1},G1=(D)=>Q1?D:new Promise((F)=>{let u=new FileReader;u.onload=()=>{let E=new File([u.result],D.name,{lastModified:D.lastModified,type:D.type});F(E)},u.readAsArrayBuffer(D)}),c0=async(D,F,u={},E={})=>{if(Array.isArray(D)){for(let B of D)if(!Array.isArray(B))E=await c0(B,F,u,E);else{let C=B[0];if(typeof C=="string")E[C.toLowerCase()]=B[1];else for(let[Z,J]of C)E[Z.toLowerCase()]=J}return E}if(!D)return E;switch(typeof D){case"function":if(D instanceof Headers)return c0(D,F,u,E);let B=await D(F,u);return B?c0(B,F,u,E):E;case"object":if(D instanceof Headers)return D.forEach((C,Z)=>{E[Z.toLowerCase()]=C}),E;for(let[C,Z]of Object.entries(D))E[C.toLowerCase()]=Z;return E;default:return E}};function XC(D,F){let u=D.split(`
97
- `),E={};for(let B of u){if(!B||B.startsWith(":"))continue;let C=B.indexOf(":");if(C>0){let Z=B.slice(0,C).trim(),J=B.slice(C+1).replace(/^ /,"");E[Z]=J&&d0(J,F)}}return Object.keys(E).length>0?E:null}function*JC(D,F){let u;for(;(u=D.value.indexOf(`
94
+ `+OD.cyan(Zu(" sudo chown -R $USER:$(id -gn $USER) %s ",e0));d0.on("exit",()=>{console.error(L8(F,{textAlignment:"center"}))})}}check(){if(!this.config||this.config.get("optOut")||this.#E)return;if(this.update=this.config.get("update"),this.update)this.update.current=this.#Z,this.config.delete("update");if(Date.now()-this.config.get("lastUpdateCheck")<this.#F)return;qz(d0.execPath,[vB.join(Uz,"check.js"),JSON.stringify(this.#u)],{detached:!0,stdio:"ignore"}).unref()}async fetchInfo(){let{distTag:D}=this.#u,F=await h1(this._packageName,{version:D});return{latest:F,current:this.#Z,type:hB.default(this.#Z,F)??D,name:this._packageName}}notify(D){let F=!this._shouldNotifyInNpmScript&&iE;if(!d0.stdout.isTTY||F||!this.update||!gB.default(this.update.latest,this.update.current))return this;D={isGlobal:EB,...D};let u=D.isGlobal?`npm i -g ${this._packageName}`:`npm i ${this._packageName}`,E="Update available "+OD.dim("{currentVersion}")+OD.reset(" → ")+OD.green("{latestVersion}")+`
95
+ Run `+OD.cyan("{updateCommand}")+" to update",B=D.message||E;D.boxenOptions??={padding:1,margin:1,textAlignment:"center",borderColor:"yellow",borderStyle:"round"};let C=L8(Cu(B,{packageName:this._packageName,currentVersion:this.update.current,latestVersion:this.update.latest,updateCommand:u}),D.boxenOptions);if(D.defer===!1)console.error(C);else d0.on("exit",()=>{console.error(C)});return this}}function Ju(D){let F=new R8(D);return F.check(),F}var Nz=()=>Boolean(process.stdout.isTTY),$z=()=>Boolean(process.stdin.isTTY),Vz=()=>Boolean(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.BUILDKITE||process.env.TF_BUILD);var yD=()=>Nz()&&$z()&&!Vz();var D2={name:"@photon-ai/cli",version:"0.4.0",description:"Photon CLI — typed terminal UI for the Photon Dashboard. Binary: `photon` (alias `pho`).",keywords:["photon","cli","dashboard","spectrum","messaging","imessage","developer-tools"],author:"Photon",license:"MIT",homepage:"https://github.com/photon-hq/cli#readme",repository:{type:"git",url:"git+https://github.com/photon-hq/cli.git"},bugs:{url:"https://github.com/photon-hq/cli/issues"},type:"module",bin:{photon:"./dist/photon.js",pho:"./dist/photon.js"},files:["dist","README.md"],publishConfig:{access:"public"},engines:{bun:">=1.3.0",node:">=18.0.0"},scripts:{start:"bun run src/index.ts",dev:"bun run --watch src/index.ts",build:"bun build ./src/index.ts --outfile dist/photon.js --target node --minify && chmod +x dist/photon.js",compile:"bun build ./src/index.ts --compile --outfile dist/photon",typecheck:"tsc --noEmit",test:"bun test",check:"bun run typecheck && bun test && bun run build","sync:api":"bun run scripts/sync-api-types.ts",manifest:"bun run scripts/generate-route-manifest.ts",prepublishOnly:"bun run typecheck && bun run build"},devDependencies:{"@types/bun":"latest","@types/node":"^25.6.2","@types/update-notifier":"^6.0.8",elysia:"1.4.28",typescript:"^5"},dependencies:{"@clack/prompts":"^1.2.0","@commander-js/extra-typings":"^14.0.0","@elysiajs/eden":"1.4.9","better-auth":"1.4.18","cli-table3":"^0.6.5",commander:"^14.0.3",open:"^11.0.0",picocolors:"^1.1.1","update-notifier":"^7.3.1"}};function mB(){if(!yD())return;if(process.env.PHOTON_NO_UPDATE_NOTIFIER==="1")return;Ju({pkg:{name:D2.name,version:D2.version},updateCheckInterval:86400000}).notify({defer:!0,isGlobal:!0})}var CC=YD(BC(),1),{program:iT,createCommand:nT,createArgument:aT,createOption:rT,CommanderError:sT,InvalidArgumentError:oT,InvalidOptionArgumentError:tT,Command:ZC,Argument:eT,Option:DO,Help:FO}=CC.default;import{existsSync as JC,renameSync as Kq}from"node:fs";import HC from"node:os";import zF from"node:path";var P8="https://app.photon.codes";function zq(D){return D??process.env.PHOTON_API_HOST??P8}function Uu(D){try{return new URL(D).origin}catch{throw Error(`Invalid API host URL: "${D}". Must include scheme — e.g. https://your.host.tld.`)}}function YC(D){let F=Uu(zq(D));return{name:qq(F),url:F}}function qq(D){let F;try{F=new URL(D)}catch{throw Error(`Invalid API host URL: "${D}". Must include scheme — e.g. https://your.host.tld.`)}if(F.origin===P8)return"production";let u=F.hostname.toLowerCase().replace(/[[\]]/g,"").replace(/[.:%]/g,"_"),E=F.port?`_${F.port}`:"",B=`${u}${E}`;if(B.length>64)throw Error(`API host "${D}" produces a key longer than 64 characters (got ${B.length}). Use a shorter hostname or alias the host in your local hosts file / DNS.`);return B}var Aq=/^[a-z0-9_][a-z0-9_-]{0,63}$/;function Uq(D){if(!Aq.test(D))throw Error(`Invalid environment key "${D}" — must be 1-64 chars, `+"start with a-z, 0-9, or '_', and only contain a-z, 0-9, '-', '_'.")}function w8(){let D=process.env.PHOTON_CONFIG_DIR??process.env.DASHBOARD_CONFIG_DIR;if(D)return D;let F=process.env.XDG_CONFIG_HOME,u=F?zF.join(F,"photon"):zF.join(HC.homedir(),".config","photon"),E=F?zF.join(F,"photon-dashboard"):zF.join(HC.homedir(),".config","photon-dashboard"),B=u;if(!JC(u)&&JC(E))try{Kq(E,u)}catch{B=E}return B}var Wu=()=>zF.join(w8(),"credentials"),x8=(D)=>{return Uq(D),zF.join(Wu(),`${D}.json`)};async function PD(D){return YC(D)}import{chmod as Wq,mkdir as Nq,readdir as $q,readFile as Vq,unlink as Iq,writeFile as Mq}from"node:fs/promises";import{dirname as Tq}from"node:path";async function qF(D){try{let F=await Vq(x8(D),"utf-8");return JSON.parse(F)}catch{return null}}async function XC(D){let F=x8(D.envName);await Nq(Tq(F),{recursive:!0}),await Mq(F,JSON.stringify(D,null,2)+`
96
+ `,"utf-8"),await Wq(F,384)}async function GC(D){let F=x8(D);try{await Iq(F)}catch(u){if(u.code!=="ENOENT")throw u}}async function k8(){try{return(await $q(Wu())).filter((F)=>F.endsWith(".json")).map((F)=>F.slice(0,-5)).sort()}catch(D){if(D.code==="ENOENT")return[];throw D}}function QC(D){D.command("auth").description("inspect authentication state across backends").command("status").description("show login status for every backend you've authenticated against").option("--json","output JSON").action(async(u)=>{let E=await PD(),B=await k8(),C=Array.from(new Set([E.name,...B])).sort(),Z=await Promise.all(C.map(async(H)=>{let Y=await qF(H);if(!Y)return{name:H,url:H===E.name?E.url:null,loggedIn:!1,user:null,issuedAt:null,corrupt:B.includes(H)};return{name:H,url:Y.apiUrl,loggedIn:!0,user:Y.user,issuedAt:Y.issuedAt,corrupt:!1}}));if(u.json)return a(Z);let J=Z.map((H)=>[H.name===E.name?A.green("●"):" ",H.name,H.url??A.dim("—"),H.loggedIn?A.green(H.user?.email??"yes"):H.corrupt?A.yellow("corrupt"):A.dim("no"),H.issuedAt?new Date(H.issuedAt).toLocaleDateString():A.dim("—")]);hD(["","key","url","logged in","since"],J);let X=Z.filter((H)=>H.corrupt).map((H)=>H.name);if(X.length>0)console.log(),console.log(A.warn(`Credentials file for ${X.join(", ")} is unreadable. Re-login with \`photon login --api-host <url>\`.`))})}var N0=class extends Error{constructor(D,F){super(F+"");this.status=D,this.value=F}},Oq=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,_q=/(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{2}\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT(?:\+|-)\d{4}\s\([^)]+\)/,Lq=/^(?:(?:(?:(?:0?[1-9]|[12][0-9]|3[01])[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:19|20)\d{2})|(?:(?:19|20)\d{2}[/\s-](?:0?[1-9]|1[0-2])[/\s-](?:0?[1-9]|[12][0-9]|3[01]))))(?:\s(?:1[012]|0?[1-9]):[0-5][0-9](?::[0-5][0-9])?(?:\s[AP]M)?)?$/,Rq=(D)=>D.trim().length!==0&&!Number.isNaN(Number(D)),y8=(D,F)=>{if(typeof D!="string"||F?.parseDate===!1)return null;let u=D.replace(/"/g,"");if(Oq.test(u)||_q.test(u)||Lq.test(u)){let E=new Date(u);if(!Number.isNaN(E.getTime()))return E}return null},jq=(D)=>{let F=D.charCodeAt(0),u=D.charCodeAt(D.length-1);return F===123&&u===125||F===91&&u===93},Sq=(D,F)=>JSON.parse(D,(u,E)=>{return y8(E,F)||E}),c0=(D,F)=>{if(!D)return D;if(Rq(D))return+D;if(D==="true")return!0;if(D==="false")return!1;if(F?.parseDate!==!1){let u=y8(D,F);if(u)return u}if(jq(D))try{return Sq(D,F)}catch{}return D},Nu=(D,F)=>{let u=D.data.toString();return u==="null"?null:c0(u,F)};var Pq=class{constructor(D){this.url=D,this.ws=new WebSocket(D)}ws;send(D){return Array.isArray(D)?(D.forEach((F)=>this.send(F)),this):(this.ws.send(typeof D=="object"?JSON.stringify(D):D.toString()),this)}on(D,F,u){return this.addEventListener(D,F,u)}off(D,F,u){return this.ws.removeEventListener(D,F,u),this}subscribe(D,F){return this.addEventListener("message",D,F)}addEventListener(D,F,u){return this.ws.addEventListener(D,(E)=>{if(D==="message"){let B=Nu(E);F({...E,data:B})}else F(E)},u),this}removeEventListener(D,F,u){return this.off(D,F,u),this}close(){return this.ws.close(),this}},wq=["get","post","put","delete","patch","options","head","connect","subscribe"],KC=(D,F)=>typeof F=="function"?F(D):F===!0,AC=["localhost","127.0.0.1","0.0.0.0"],Vu=typeof FileList>"u",b8=(D)=>Vu?D instanceof Blob:D instanceof FileList||D instanceof File,xq=(D)=>{if(!D)return!1;for(let F in D)if(b8(D[F])||Array.isArray(D[F])&&D[F].find(b8))return!0;return!1},$u=(D)=>Vu?D:new Promise((F)=>{let u=new FileReader;u.onload=()=>{let E=new File([u.result],D.name,{lastModified:D.lastModified,type:D.type});F(E)},u.readAsArrayBuffer(D)}),l0=async(D,F,u={},E={})=>{if(Array.isArray(D)){for(let B of D)if(!Array.isArray(B))E=await l0(B,F,u,E);else{let C=B[0];if(typeof C=="string")E[C.toLowerCase()]=B[1];else for(let[Z,J]of C)E[Z.toLowerCase()]=J}return E}if(!D)return E;switch(typeof D){case"function":if(D instanceof Headers)return l0(D,F,u,E);let B=await D(F,u);return B?l0(B,F,u,E):E;case"object":if(D instanceof Headers)return D.forEach((C,Z)=>{E[Z.toLowerCase()]=C}),E;for(let[C,Z]of Object.entries(D))E[C.toLowerCase()]=Z;return E;default:return E}};function UC(D,F){let u=D.split(`
97
+ `),E={};for(let B of u){if(!B||B.startsWith(":"))continue;let C=B.indexOf(":");if(C>0){let Z=B.slice(0,C).trim(),J=B.slice(C+1).replace(/^ /,"");E[Z]=J&&c0(J,F)}}return Object.keys(E).length>0?E:null}function*zC(D,F){let u;for(;(u=D.value.indexOf(`
98
98
 
99
- `))!==-1;){let E=D.value.slice(0,u);if(D.value=D.value.slice(u+2),E.trim()){let B=XC(E,F);B&&(yield B)}}}async function*HC(D,F){let u=D.body;if(!u)return;let E=u.getReader(),B=new TextDecoder("utf-8");if(D.headers.get("Content-Type")?.startsWith("text/event-stream")){let C={value:""};try{for(;;){let{done:J,value:X}=await E.read();if(J)break;let H=typeof X=="string"?X:B.decode(X,{stream:!0});C.value+=H,yield*JC(C,F)}let Z=B.decode();if(Z&&(C.value+=Z),yield*JC(C,F),C.value.trim()){let J=XC(C.value,F);J&&(yield J)}}finally{E.releaseLock()}}else try{for(;;){let{done:C,value:Z}=await E.read();if(C)break;yield d0(typeof Z=="string"?Z:B.decode(Z,{stream:!0}),{parseDate:F?.parseDate})}}finally{E.releaseLock()}}var F2=(D,F,u=[],E)=>new Proxy(()=>{},{get(B,C){if(C==="~path")return"/"+u.join("/");if(!(u.length===0&&(C==="then"||C==="catch"||C==="finally")))return F2(D,F,[...u,C],E)},apply(B,C,[Z,J]){if(!Z||J||typeof Z=="object"&&Object.keys(Z).length!==1||Lq.includes(u.at(-1))){let X=[...u],H=X.pop(),Y="/"+X.join("/"),{fetcher:G=fetch,headers:K,onRequest:Q,onResponse:z,fetch:q}=F,U=H==="get"||H==="head"||H==="subscribe",N=U?Z?.query:J?.query,I="";if(N){let $=(W,j)=>{j!=null&&(j instanceof Date&&(j=j.toISOString()),I+=(I?"&":"?")+`${encodeURIComponent(W)}=${encodeURIComponent(typeof j=="object"?JSON.stringify(j):j+"")}`)};for(let[W,j]of Object.entries(N)){if(Array.isArray(j)){for(let P of j)$(W,P);continue}$(W,j)}}if(H==="subscribe"){let $=D.replace(/^([^]+):\/\//,D.startsWith("https://")?"wss://":D.startsWith("http://")||YC.find((W)=>D.includes(W))?"ws://":"wss://")+Y+I;return new Oq($)}return(async()=>{K=await c0(K,Y,J);let $={method:H?.toUpperCase(),body:Z,...q,headers:K};$.headers={...K,...await c0(U?Z?.headers:J?.headers,Y,$)};let W=U&&typeof Z=="object"?Z.fetch:J?.fetch,j=(U&&typeof Z=="object"?Z.throwHttpError:J?.throwHttpError)??F.throwHttpError;if($={...$,...W},U&&delete $.body,Q){Array.isArray(Q)||(Q=[Q]);for(let O of Q){let _=await O(Y,$);typeof _=="object"&&($={...$,..._,headers:{...$.headers,...await c0(_.headers,Y,$)}})}}if(U&&delete $.body,Rq(Z)){let O=new FormData,_=(w)=>{if(typeof w=="string"||y8(w))return!1;if(typeof w=="object"){if(w!==null)return!0;if(w instanceof Date)return!1}return!1},h=async(w)=>w instanceof File?await G1(w):_(w)?JSON.stringify(w):w;for(let[w,R]of Object.entries($.body)){if(Array.isArray(R)){if(R.some((S)=>typeof S=="object"&&S!==null&&!y8(S)))O.append(w,JSON.stringify(R));else for(let S=0;S<R.length;S++){let b=R[S],f=await h(b);O.append(w,f)}continue}if(Q1){if(Array.isArray(R))for(let S of R)O.append(w,await h(S));else O.append(w,await h(R));continue}if(R instanceof File){O.append(w,await G1(R));continue}if(R instanceof FileList){for(let S=0;S<R.length;S++)O.append(w,await G1(R[S]));continue}O.append(w,await h(R))}$.body=O}else typeof Z=="object"?($.headers["content-type"]="application/json",$.body=JSON.stringify(Z)):Z!=null&&($.headers["content-type"]="text/plain");if(U&&delete $.body,Q){Array.isArray(Q)||(Q=[Q]);for(let O of Q){let _=await O(Y,$);typeof _=="object"&&($={...$,..._,headers:{...$.headers,...await c0(_.headers,Y,$)}})}}J?.headers?.["content-type"]&&($.headers["content-type"]=J?.headers["content-type"]);let P=D+Y+I,L;try{L=await(E?.handle(new Request(P,$))??G(P,$))}catch(O){let _=new N0(503,O);if(ZC(_,j))throw _;return{data:null,error:_,response:void 0,status:503,headers:void 0}}let v=null,V=null;if(z){Array.isArray(z)||(z=[z]);for(let O of z)try{let _=await O(L.clone());if(_!=null){v=_;break}}catch(_){_ instanceof N0?V=_:V=new N0(422,_);break}}if(v!==null)return{data:v,error:V,response:L,status:L.status,headers:L.headers};switch(L.headers.get("Content-Type")?.split(";")[0]){case"text/event-stream":v=HC(L,{parseDate:F.parseDate});break;case"application/json":v=JSON.parse(await L.text(),(_,h)=>{if(typeof h!="string")return h;return k8(h,{parseDate:F.parseDate})||h});break;case"application/octet-stream":v=await L.arrayBuffer();break;case"multipart/form-data":let O=await L.formData();v={},O.forEach((_,h)=>{v[h]=_});break;default:L.headers.get("content-type")?.startsWith("text/")&&L.headers.get("transfer-encoding")==="chunked"&&!L.headers.has("content-length")?v=HC(L,{parseDate:F.parseDate}):v=await L.text().then((_)=>d0(_,{parseDate:F.parseDate}))}if(L.status>=300||L.status<200){if(V=new N0(L.status,v),ZC(V,j))throw V;v=null}return{data:v,error:V,response:L,status:L.status,headers:L.headers}})()}return typeof Z=="object"?F2(D,F,[...u,Object.values(Z)[0]],E):F2(D,F,u)}}),K1=(D,F={})=>typeof D=="string"?(F.keepDomain||(D.includes("://")||(D=(YC.find((u)=>D.includes(u))?"http://":"https://")+D),D.endsWith("/")&&(D=D.slice(0,-1))),F2(D,F)):(typeof window<"u"&&console.warn("Elysia instance server found on client side, this is not recommended for security reason. Use generic type instead."),F2("http://e.ly",F,[],D));var $0=GD(Ru(),1),b8=process.env.PHOTON_DEBUG==="1"||process.env.PHOTON_DEBUG==="true";function GC(D){b8=D}function QC(){return b8}function jq(...D){if(!b8)return;let F=$0.default.dim(`[debug ${new Date().toISOString()}]`);console.error(F,...D)}function z1(D){if(!b8)return;let F=D.status>=500?$0.default.red:D.status>=400?$0.default.yellow:D.status>=200?$0.default.green:$0.default.dim;jq($0.default.bold(D.method.padEnd(6)),F(String(D.status)),D.url,$0.default.dim(`${D.durationMs}ms`))}async function n(D={}){let F=D.url?{name:"custom",url:H1(D.url)}:await PD(D.apiHost),u=D.token??process.env.PHOTON_TOKEN??process.env.DASHBOARD_TOKEN,E=D.url||u?null:await zF(F.name);if(D.requireAuth&&!E&&!u)throw new VF(F.name);let B=u??E?.accessToken,C={};if(B)C.Authorization=`Bearer ${B}`;let Z=QC()?Sq():fetch;return{api:K1(F.url,{headers:C,fetcher:Z}),env:F,creds:E}}function Sq(){return Object.assign(async(D,F)=>{let u=performance.now(),E=typeof D==="string"?D:D instanceof URL?D.toString():D.url,B=(F?.method??(D instanceof Request?D.method:void 0)??"GET").toUpperCase();try{let C=await fetch(D,F);return z1({method:B,url:E,status:C.status,durationMs:Math.round(performance.now()-u)}),C}catch(C){throw z1({method:B,url:E,status:0,durationMs:Math.round(performance.now()-u)}),C}},typeof fetch.preconnect==="function"?{preconnect:fetch.preconnect.bind(fetch)}:{})}async function e(D){let F=await PD(D.apiHost),u=D.flagProjectId?.trim();if(u)return{projectId:u,env:F};let E=process.env.PHOTON_PROJECT_ID?.trim();if(E)return{projectId:E,env:F};T(`No project specified for backend "${F.name}".`,{hint:"Pass `--project <id>`, or set `PHOTON_PROJECT_ID` in your shell."})}import L1 from"node:process";import SC from"node:path";import{fileURLToPath as JA}from"node:url";import HA from"node:child_process";import YA,{constants as XA}from"node:fs/promises";import{promisify as gq}from"node:util";import mq from"node:child_process";import $1,{constants as NC}from"node:fs/promises";import qC from"node:process";import yq from"node:os";import W1 from"node:fs";import xq from"node:fs";import KC from"node:fs";var q1;function Pq(){try{return KC.statSync("/.dockerenv"),!0}catch{return!1}}function wq(){try{return KC.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function A1(){if(q1===void 0)q1=Pq()||wq();return q1}var U1,kq=()=>{try{return xq.statSync("/run/.containerenv"),!0}catch{return!1}};function l0(){if(U1===void 0)U1=kq()||A1();return U1}var zC=()=>{if(qC.platform!=="linux")return!1;if(yq.release().toLowerCase().includes("microsoft")){if(l0())return!1;return!0}try{if(W1.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!l0()}catch{}if(W1.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||W1.existsSync("/run/WSL"))return!l0();return!1},Q0=qC.env.__IS_WSL_TEST__?zC:zC();import AC from"node:process";import{Buffer as bq}from"node:buffer";import{promisify as fq}from"node:util";import vq from"node:child_process";var hq=fq(vq.execFile),N1=()=>`${AC.env.SYSTEMROOT||AC.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;var bD=async(D,F={})=>{let{powerShellPath:u,...E}=F,B=bD.encodeCommand(D);return hq(u??N1(),[...bD.argumentsPrefix,B],{encoding:"utf8",...E})};bD.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];bD.encodeCommand=(D)=>bq.from(D,"utf16le").toString("base64");bD.escapeArgument=(D)=>`'${String(D).replaceAll("'","''")}'`;function UC(D){for(let F of D.split(`
100
- `)){if(/^\s*#/.test(F))continue;let u=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(F);if(!u)continue;return u.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}var dq=gq(mq.execFile),cq=(()=>{let F;return async function(){if(F)return F;let u="/etc/wsl.conf",E=!1;try{await $1.access(u,NC.F_OK),E=!0}catch{}if(!E)return"/mnt/";let B=await $1.readFile(u,{encoding:"utf8"}),C=UC(B);if(C===void 0)return"/mnt/";return F=C,F=F.endsWith("/")?F:`${F}/`,F}})(),lq=async()=>{return`${await cq()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},f8=Q0?lq:N1,WC,$C=async()=>{return WC??=(async()=>{try{let D=await f8();return await $1.access(D,NC.X_OK),!0}catch{return!1}})(),WC},VC=async()=>{let D=await f8(),F=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:u}=await bD(F,{powerShellPath:D});return u.trim()},IC=async(D)=>{if(/^[a-z]+:\/\//i.test(D))return D;try{let{stdout:F}=await dq("wslpath",["-aw",D],{encoding:"utf8"});return F.trim()}catch{return D}};function p0(D,F,u){let E=(B)=>Object.defineProperty(D,F,{value:B,enumerable:!0,writable:!0});return Object.defineProperty(D,F,{configurable:!0,enumerable:!0,get(){let B=u();return E(B),B},set(B){E(B)}}),D}import{promisify as uA}from"node:util";import T1 from"node:process";import{execFile as EA}from"node:child_process";import{promisify as pq}from"node:util";import iq from"node:process";import{execFile as nq}from"node:child_process";var aq=pq(nq);async function V1(){if(iq.platform!=="darwin")throw Error("macOS only");let{stdout:D}=await aq("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),u=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(D)?.groups.id??"com.apple.Safari";if(u==="com.apple.safari")return"com.apple.Safari";return u}import rq from"node:process";import{promisify as sq}from"node:util";import{execFile as oq,execFileSync as WO}from"node:child_process";var tq=sq(oq);async function MC(D,{humanReadableOutput:F=!0,signal:u}={}){if(rq.platform!=="darwin")throw Error("macOS only");let E=F?[]:["-ss"],B={};if(u)B.signal=u;let{stdout:C}=await tq("osascript",["-e",D,E],B);return C.trim()}async function I1(D){return MC(`tell application "Finder" to set app_path to application file id "${D}" as string
101
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as eq}from"node:util";import{execFile as DA}from"node:child_process";var FA=eq(DA),v8={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},h8=new Map(Object.entries(v8));class TC extends Error{}async function M1(D=FA){let{stdout:F}=await D("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),u=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(F);if(!u)throw new TC(`Cannot find Windows browser in stdout: ${JSON.stringify(F)}`);let{id:E}=u.groups,B=E.lastIndexOf("."),C=E.lastIndexOf("-"),Z=B===-1?void 0:E.slice(0,B),J=C===-1?void 0:E.slice(0,C);return v8[E]??v8[Z]??v8[J]??{name:E,id:E}}var BA=uA(EA),CA=(D)=>D.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(F)=>F.toUpperCase());async function _1(){if(T1.platform==="darwin"){let D=await V1();return{name:await I1(D),id:D}}if(T1.platform==="linux"){let{stdout:D}=await BA("xdg-mime",["query","default","x-scheme-handler/http"]),F=D.trim();return{name:CA(F.replace(/.desktop$/,"").replace("-"," ")),id:F}}if(T1.platform==="win32")return M1();throw Error("Only macOS, Linux, and Windows are supported")}import O1 from"node:process";var ZA=Boolean(O1.env.SSH_CONNECTION||O1.env.SSH_CLIENT||O1.env.SSH_TTY),_C=ZA;var g8=Symbol("fallbackAttempt"),R1=import.meta.url?SC.dirname(JA(import.meta.url)):"",OC=SC.join(R1,"xdg-open"),{platform:qF,arch:LC}=L1,RC=async(D,F)=>{if(D.length===0)return;let u=[];for(let E of D)try{return await F(E)}catch(B){u.push(B)}throw AggregateError(u,"Failed to open in all supported apps")},m8=async(D)=>{D={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...D};let F=D[g8]===!0;if(delete D[g8],Array.isArray(D.app))return RC(D.app,(H)=>m8({...D,app:H,[g8]:!0}));let{name:u,arguments:E=[]}=D.app??{};if(E=[...E],Array.isArray(u))return RC(u,(H)=>m8({...D,app:{name:H,arguments:E},[g8]:!0}));if(u==="browser"||u==="browserPrivate"){let H={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},Y={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},G;if(Q0){let K=await VC();G=h8.get(K)??{}}else G=await _1();if(G.id in H){let K=H[G.id.toLowerCase()];if(u==="browserPrivate"){if(K==="safari")throw Error("Safari doesn't support opening in private mode via command line");E.push(Y[K])}return m8({...D,app:{name:AF[K],arguments:E}})}throw Error(`${G.name} is not supported as a default browser`)}let B,C=[],Z={},J=!1;if(Q0&&!l0()&&!_C&&!u)J=await $C();if(qF==="darwin"){if(B="open",D.wait)C.push("--wait-apps");if(D.background)C.push("--background");if(D.newInstance)C.push("--new");if(u)C.push("-a",u)}else if(qF==="win32"||J){if(B=await f8(),C.push(...bD.argumentsPrefix),!Q0)Z.windowsVerbatimArguments=!0;if(Q0&&D.target)D.target=await IC(D.target);let H=["$ProgressPreference = 'SilentlyContinue';","Start"];if(D.wait)H.push("-Wait");if(u){if(H.push(bD.escapeArgument(u)),D.target)E.push(D.target)}else if(D.target)H.push(bD.escapeArgument(D.target));if(E.length>0)E=E.map((Y)=>bD.escapeArgument(Y)),H.push("-ArgumentList",E.join(","));if(D.target=bD.encodeCommand(H.join(" ")),!D.wait)Z.stdio="ignore"}else{if(u)B=u;else{let H=!R1||R1==="/",Y=!1;try{await YA.access(OC,XA.X_OK),Y=!0}catch{}B=L1.versions.electron??(qF==="android"||H||!Y)?"xdg-open":OC}if(E.length>0)C.push(...E);if(!D.wait)Z.stdio="ignore",Z.detached=!0}if(qF==="darwin"&&E.length>0)C.push("--args",...E);if(D.target)C.push(D.target);let X=HA.spawn(B,C,Z);if(D.wait)return new Promise((H,Y)=>{X.once("error",Y),X.once("close",(G)=>{if(!D.allowNonzeroExitCode&&G!==0){Y(Error(`Exited with code ${G}`));return}H(X)})});if(F)return new Promise((H,Y)=>{X.once("error",Y),X.once("spawn",()=>{X.once("close",(G)=>{if(X.off("error",Y),G!==0){Y(Error(`Exited with code ${G}`));return}X.unref(),H(X)})})});return X.unref(),new Promise((H,Y)=>{X.once("error",Y),X.once("spawn",()=>{X.off("error",Y),H(X)})})},GA=(D,F)=>{if(typeof D!=="string")throw TypeError("Expected a `target`");return m8({...F,target:D})};function jC(D){if(typeof D==="string"||Array.isArray(D))return D;let{[LC]:F}=D;if(!F)throw Error(`${LC} is not supported`);return F}function u2({[qF]:D},{wsl:F}={}){if(F&&Q0)return jC(F);if(!D)throw Error(`${qF} is not supported`);return jC(D)}var AF={browser:"browser",browserPrivate:"browserPrivate"};p0(AF,"chrome",()=>u2({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));p0(AF,"brave",()=>u2({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));p0(AF,"firefox",()=>u2({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));p0(AF,"edge",()=>u2({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));p0(AF,"safari",()=>u2({darwin:"Safari"}));var d8=GA;async function E2(D,F={}){let u=F.label??"Open";if(console.log(`${A.dim(u+":")} ${A.underline(A.cyan(D))}`),F.noBrowser)return"skipped";try{return await d8(D),"opened"}catch{return"failed"}}function PC(D){let F=D.command("billing").description("view + manage your project's subscription");QA(F),KA(F),zA(F),AA(F)}function QA(D){D.command("plans").description("list available subscription plans").option("-p, --project <id>","project id (accepted for parity with other billing commands; not used)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{api:u,env:E}=await n({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:B,error:C,status:Z}=await u.api.billing.plans.get();if(Z===401)throw new d(E.name);if(C)T(`Failed to list plans: ${m(C)}`);let J=B??[];if(F.json)return a(J);if(J.length===0){console.log(A.dim("No plans available."));return}let X=J.flatMap((H)=>(H.prices??[{id:"—",unit_amount:null,currency:"—",recurring:null}]).map((Y)=>[H.name,Y.id,UA(Y),Y.recurring?.interval??A.dim("—")]));vD(["plan","price id","price","interval"],X)})}function KA(D){D.command("show").description("show the project's current subscription (defaults to $PHOTON_PROJECT_ID)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{projectId:u,env:E}=await e({flagProjectId:F.project,apiHost:F.apiHost}),{api:B}=await n({apiHost:E.url,token:F.token,requireAuth:!0}),{data:C,error:Z,status:J}=await B.api.projects({id:u}).subscription.get();if(J===401)throw new d(E.name);if(Z)T(`Failed to fetch subscription: ${m(Z)}`);if(F.json)return a(C??{});let X=C??{};if(console.log(A.bold("Subscription")),console.log(` ${A.dim("tier".padEnd(8))} ${WA(X.tier)}`),console.log(` ${A.dim("status".padEnd(8))} ${NA(X.status??null)}`),X.subscriptionId)console.log(` ${A.dim("id".padEnd(8))} ${X.subscriptionId}`);if(X.tier==="unknown")console.log(),console.log(A.warn('Server returned tier "unknown". This is a known issue (architecture-review S3) — the subscription may still be active.'))})}function zA(D){D.command("checkout").description("start a subscription checkout (opens Stripe in browser)").option("--plan <price-id>","Stripe price id from `photon billing plans`").option("--qty <n>","quantity",qA).option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--no-browser","print the URL instead of launching a browser").option("--json","output JSON ({url}) and skip browser open").action(async(F)=>{if(!F.plan)T("--plan <price-id> is required.",{hint:"List options: `photon billing plans`. Pass the `price id` column."});let{projectId:u,env:E}=await e({flagProjectId:F.project,apiHost:F.apiHost}),{api:B}=await n({apiHost:E.url,token:F.token,requireAuth:!0}),{data:C,error:Z,status:J}=await B.api.billing.checkout.post({projectId:u,priceId:F.plan,quantity:F.qty});if(J===401)throw new d(E.name);if(Z)T(`Failed to start checkout: ${m(Z)}`);let X=C;if(X.error)T(X.error);if(!X.url)T("Server did not return a checkout URL.");if(F.json)return a({url:X.url});if(await E2(X.url,{noBrowser:!F.browser,label:"Stripe checkout"})==="failed")console.log(A.warn("Could not open browser automatically — copy the URL above."))})}function qA(D){if(!/^\d+$/.test(D))throw new(j8()).InvalidArgumentError(`must be a non-negative integer (got "${D}")`);let F=Number.parseInt(D,10);if(!Number.isFinite(F)||F<1)throw new(j8()).InvalidArgumentError(`must be at least 1 (got "${D}")`);return F}function AA(D){D.command("manage").alias("portal").description("open the Stripe customer portal for this project").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--no-browser","print the URL instead of launching a browser").option("--json","output JSON ({url}) and skip browser open").action(async(F)=>{let{projectId:u,env:E}=await e({flagProjectId:F.project,apiHost:F.apiHost}),{api:B}=await n({apiHost:E.url,token:F.token,requireAuth:!0}),{data:C,error:Z,status:J}=await B.api.projects({id:u}).subscription.manage.post();if(J===401)throw new d(E.name);if(Z)T(`Failed to open portal: ${m(Z)}`);let X=C;if(X.error)T(X.error);if(!X.url)T("Server did not return a portal URL.");if(F.json)return a({url:X.url});if(await E2(X.url,{noBrowser:!F.browser,label:"Stripe portal"})==="failed")console.log(A.warn("Could not open browser automatically — copy the URL above."))})}function UA(D){if(D.unit_amount==null)return A.dim("—");let F=D.currency.toUpperCase(),u=2;try{u=new Intl.NumberFormat("en-US",{style:"currency",currency:F}).resolvedOptions().maximumFractionDigits??2}catch{}let E=10**u;return`${(D.unit_amount/E).toFixed(u)} ${F}`}function WA(D){if(!D)return A.dim("—");if(D==="free")return A.dim(D);if(D==="unknown")return A.yellow(D);return A.green(D)}function NA(D){if(!D)return A.dim("—");switch(D){case"active":return A.green(D);case"past_due":case"unpaid":return A.red(D);case"trialing":return A.cyan(D);case"canceled":return A.dim(D);default:return D}}function wC(D){D.command("config").description("inspect Photon CLI configuration").command("show",{isDefault:!0}).description("dump the active configuration (no secrets printed)").option("--json","output JSON").action(async(u)=>{let E=await PD(),B=await x8(),C=process.env.PHOTON_PROJECT_ID?.trim()||null,Z={configDir:P8(),currentEnv:{name:E.name,url:E.url},activeProject:C,authedEnvs:B};if(u.json)return a(Z);console.log(A.bold("Photon CLI configuration")),console.log();let J=18;X("config dir",Z.configDir),X("active backend",`${A.bold(Z.currentEnv.name)} ${A.dim(`(${Z.currentEnv.url})`)}`),X("active project",C?`${A.bold(C)} ${A.dim("(via $PHOTON_PROJECT_ID)")}`:A.dim("(none — pass --project <id> or set $PHOTON_PROJECT_ID)")),X("logged-in keys",B.length>0?B.join(", "):A.dim("none"));function X(H,Y){console.log(` ${A.dim(H.padEnd(J))} ${Y}`)}})}function xC(D){D.command("env").description("show the active backend (set via PHOTON_API_HOST or --api-host)").command("current",{isDefault:!0}).description("print the resolved API host").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").action(async(u)=>{let E=await PD(u.apiHost);console.log(`${A.bold(E.name)} ${A.dim(`(${E.url})`)}`)})}import{styleText as f1}from"node:util";import{stdout as g1,stdin as sC}from"node:process";import*as I0 from"node:readline";import PA from"node:readline";var kC=(D)=>{return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109},yC=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},bC=(D)=>{return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9800&&D<=9811||D===9855||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=19968&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D===94192||D===94193||D>=94208&&D<=100343||D>=100352&&D<=101589||D>=101632&&D<=101640||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128727||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129672||D>=129680&&D<=129725||D>=129727&&D<=129733||D>=129742&&D<=129755||D>=129760&&D<=129768||D>=129776&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141};var j1=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,c8=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,l8=/\t{1,1000}/y,S1=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,p8=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,$A=/\p{M}+/gu,VA={limit:1/0,ellipsis:""},fC=(D,F={},u={})=>{let E=F.limit??1/0,B=F.ellipsis??"",C=F?.ellipsisWidth??(B?fC(B,VA,u).width:0),Z=u.ansiWidth??0,J=u.controlWidth??0,X=u.tabWidth??8,H=u.ambiguousWidth??1,Y=u.emojiWidth??2,G=u.fullWidthWidth??2,K=u.regularWidth??1,Q=u.wideWidth??2,z=0,q=0,U=D.length,N=0,I=!1,$=U,W=Math.max(0,E-C),j=0,P=0,L=0,v=0;D:while(!0){if(P>j||q>=U&&q>z){let V=D.slice(j,P)||D.slice(z,q);N=0;for(let O of V.replaceAll($A,"")){let _=O.codePointAt(0)||0;if(yC(_))v=G;else if(bC(_))v=Q;else if(H!==K&&kC(_))v=H;else v=K;if(L+v>W)$=Math.min($,Math.max(j,z)+N);if(L+v>E){I=!0;break D}N+=O.length,L+=v}j=P=0}if(q>=U)break;if(p8.lastIndex=q,p8.test(D)){if(N=p8.lastIndex-q,v=N*K,L+v>W)$=Math.min($,q+Math.floor((W-L)/K));if(L+v>E){I=!0;break}L+=v,j=z,P=q,q=z=p8.lastIndex;continue}if(j1.lastIndex=q,j1.test(D)){if(L+Z>W)$=Math.min($,q);if(L+Z>E){I=!0;break}L+=Z,j=z,P=q,q=z=j1.lastIndex;continue}if(c8.lastIndex=q,c8.test(D)){if(N=c8.lastIndex-q,v=N*J,L+v>W)$=Math.min($,q+Math.floor((W-L)/J));if(L+v>E){I=!0;break}L+=v,j=z,P=q,q=z=c8.lastIndex;continue}if(l8.lastIndex=q,l8.test(D)){if(N=l8.lastIndex-q,v=N*X,L+v>W)$=Math.min($,q+Math.floor((W-L)/X));if(L+v>E){I=!0;break}L+=v,j=z,P=q,q=z=l8.lastIndex;continue}if(S1.lastIndex=q,S1.test(D)){if(L+Y>W)$=Math.min($,q);if(L+Y>E){I=!0;break}L+=Y,j=z,P=q,q=z=S1.lastIndex;continue}q+=1}return{width:I?W:L,index:I?$:U,truncated:I,ellipsed:I&&E>=C}},vC=fC;var IA={limit:1/0,ellipsis:"",ellipsisWidth:0},MA=(D,F={})=>{return vC(D,IA,F).width},B0=MA;var i8="\x1B",cC="›",TA=39,w1="\x07",lC="[",_A="]",pC="m",x1=`${_A}8;;`,hC=new RegExp(`(?:\\${lC}(?<code>\\d+)m|\\${x1}(?<uri>.*)${w1})`,"y"),gC=(D)=>{if(D>=30&&D<=37)return 39;if(D>=90&&D<=97)return 39;if(D>=40&&D<=47)return 49;if(D>=100&&D<=107)return 49;if(D===1||D===2)return 22;if(D===3)return 23;if(D===4)return 24;if(D===7)return 27;if(D===8)return 28;if(D===9)return 29;if(D===0)return 0;return},mC=(D)=>`${i8}${lC}${D}${pC}`,dC=(D)=>`${i8}${x1}${D}${w1}`,P1=(D,F,u)=>{let E=F[Symbol.iterator](),B=!1,C=!1,Z=D.at(-1),J=Z===void 0?0:B0(Z),X=E.next(),H=E.next(),Y=0;while(!X.done){let G=X.value,K=B0(G);if(J+K<=u)D[D.length-1]+=G;else D.push(G),J=0;if(G===i8||G===cC)B=!0,C=F.startsWith(x1,Y+1);if(B){if(C){if(G===w1)B=!1,C=!1}else if(G===pC)B=!1}else if(J+=K,J===u&&!H.done)D.push(""),J=0;X=H,H=E.next(),Y+=G.length}if(Z=D.at(-1),!J&&Z!==void 0&&Z.length&&D.length>1)D[D.length-2]+=D.pop()},OA=(D)=>{let F=D.split(" "),u=F.length;while(u){if(B0(F[u-1]))break;u--}if(u===F.length)return D;return F.slice(0,u).join(" ")+F.slice(u).join("")},LA=(D,F,u={})=>{if(u.trim!==!1&&D.trim()==="")return"";let E="",B,C,Z=D.split(" "),J=[""],X=0;for(let G=0;G<Z.length;G++){let K=Z[G];if(u.trim!==!1){let z=J.at(-1)??"",q=z.trimStart();if(z.length!==q.length)J[J.length-1]=q,X=B0(q)}if(G!==0){if(X>=F&&(u.wordWrap===!1||u.trim===!1))J.push(""),X=0;if(X||u.trim===!1)J[J.length-1]+=" ",X++}let Q=B0(K);if(u.hard&&Q>F){let z=F-X,q=1+Math.floor((Q-z-1)/F);if(Math.floor((Q-1)/F)<q)J.push("");P1(J,K,F),X=B0(J.at(-1)??"");continue}if(X+Q>F&&X&&Q){if(u.wordWrap===!1&&X<F){P1(J,K,F),X=B0(J.at(-1)??"");continue}J.push(""),X=0}if(X+Q>F&&u.wordWrap===!1){P1(J,K,F),X=B0(J.at(-1)??"");continue}J[J.length-1]+=K,X+=Q}if(u.trim!==!1)J=J.map((G)=>OA(G));let H=J.join(`
102
- `),Y=!1;for(let G=0;G<H.length;G++){let K=H[G];if(E+=K,!Y)Y=K>="\uD800"&&K<="\uDBFF";else continue;if(K===i8||K===cC){hC.lastIndex=G+1;let z=hC.exec(H)?.groups;if(z?.code!==void 0){let q=Number.parseFloat(z.code);B=q===TA?void 0:q}else if(z?.uri!==void 0)C=z.uri.length===0?void 0:z.uri}if(H[G+1]===`
103
- `){if(C)E+=dC("");let Q=B?gC(B):void 0;if(B&&Q)E+=mC(Q)}else if(K===`
104
- `){if(B&&gC(B))E+=mC(B);if(C)E+=dC(C)}}return E},RA=/\r?\n/;function V0(D,F,u){return String(D).normalize().split(RA).map((E)=>LA(E,F,u)).join(`
105
- `)}var ID=GD(y1(),1);import{ReadStream as nC}from"node:tty";function UF(D,F,u){if(!u.some((Z)=>!Z.disabled))return D;let E=D+F,B=Math.max(u.length-1,0),C=E<0?B:E>B?0:E;return u[C].disabled?UF(C,F<0?-1:1,u):C}var wA=["up","down","left","right","space","enter","cancel"],xA=["January","February","March","April","May","June","July","August","September","October","November","December"],AD={actions:new Set(wA),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...xA],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(D,F)=>`There are only ${D} days in ${F}`,afterMin:(D)=>`Date must be on or after ${D.toISOString().slice(0,10)}`,beforeMax:(D)=>`Date must be on or before ${D.toISOString().slice(0,10)}`}}};function m1(D,F){if(typeof D=="string")return AD.aliases.get(D)===F;for(let u of D)if(u!==void 0&&m1(u,F))return!0;return!1}function kA(D,F){if(D===F)return;let u=D.split(`
99
+ `))!==-1;){let E=D.value.slice(0,u);if(D.value=D.value.slice(u+2),E.trim()){let B=UC(E,F);B&&(yield B)}}}async function*qC(D,F){let u=D.body;if(!u)return;let E=u.getReader(),B=new TextDecoder("utf-8");if(D.headers.get("Content-Type")?.startsWith("text/event-stream")){let C={value:""};try{for(;;){let{done:J,value:X}=await E.read();if(J)break;let H=typeof X=="string"?X:B.decode(X,{stream:!0});C.value+=H,yield*zC(C,F)}let Z=B.decode();if(Z&&(C.value+=Z),yield*zC(C,F),C.value.trim()){let J=UC(C.value,F);J&&(yield J)}}finally{E.releaseLock()}}else try{for(;;){let{done:C,value:Z}=await E.read();if(C)break;yield c0(typeof Z=="string"?Z:B.decode(Z,{stream:!0}),{parseDate:F?.parseDate})}}finally{E.releaseLock()}}var u2=(D,F,u=[],E)=>new Proxy(()=>{},{get(B,C){if(C==="~path")return"/"+u.join("/");if(!(u.length===0&&(C==="then"||C==="catch"||C==="finally")))return u2(D,F,[...u,C],E)},apply(B,C,[Z,J]){if(!Z||J||typeof Z=="object"&&Object.keys(Z).length!==1||wq.includes(u.at(-1))){let X=[...u],H=X.pop(),Y="/"+X.join("/"),{fetcher:G=fetch,headers:K,onRequest:Q,onResponse:z,fetch:q}=F,U=H==="get"||H==="head"||H==="subscribe",N=U?Z?.query:J?.query,M="";if(N){let $=(W,j)=>{j!=null&&(j instanceof Date&&(j=j.toISOString()),M+=(M?"&":"?")+`${encodeURIComponent(W)}=${encodeURIComponent(typeof j=="object"?JSON.stringify(j):j+"")}`)};for(let[W,j]of Object.entries(N)){if(Array.isArray(j)){for(let P of j)$(W,P);continue}$(W,j)}}if(H==="subscribe"){let $=D.replace(/^([^]+):\/\//,D.startsWith("https://")?"wss://":D.startsWith("http://")||AC.find((W)=>D.includes(W))?"ws://":"wss://")+Y+M;return new Pq($)}return(async()=>{K=await l0(K,Y,J);let $={method:H?.toUpperCase(),body:Z,...q,headers:K};$.headers={...K,...await l0(U?Z?.headers:J?.headers,Y,$)};let W=U&&typeof Z=="object"?Z.fetch:J?.fetch,j=(U&&typeof Z=="object"?Z.throwHttpError:J?.throwHttpError)??F.throwHttpError;if($={...$,...W},U&&delete $.body,Q){Array.isArray(Q)||(Q=[Q]);for(let _ of Q){let O=await _(Y,$);typeof O=="object"&&($={...$,...O,headers:{...$.headers,...await l0(O.headers,Y,$)}})}}if(U&&delete $.body,xq(Z)){let _=new FormData,O=(w)=>{if(typeof w=="string"||b8(w))return!1;if(typeof w=="object"){if(w!==null)return!0;if(w instanceof Date)return!1}return!1},g=async(w)=>w instanceof File?await $u(w):O(w)?JSON.stringify(w):w;for(let[w,R]of Object.entries($.body)){if(Array.isArray(R)){if(R.some((S)=>typeof S=="object"&&S!==null&&!b8(S)))_.append(w,JSON.stringify(R));else for(let S=0;S<R.length;S++){let b=R[S],f=await g(b);_.append(w,f)}continue}if(Vu){if(Array.isArray(R))for(let S of R)_.append(w,await g(S));else _.append(w,await g(R));continue}if(R instanceof File){_.append(w,await $u(R));continue}if(R instanceof FileList){for(let S=0;S<R.length;S++)_.append(w,await $u(R[S]));continue}_.append(w,await g(R))}$.body=_}else typeof Z=="object"?($.headers["content-type"]="application/json",$.body=JSON.stringify(Z)):Z!=null&&($.headers["content-type"]="text/plain");if(U&&delete $.body,Q){Array.isArray(Q)||(Q=[Q]);for(let _ of Q){let O=await _(Y,$);typeof O=="object"&&($={...$,...O,headers:{...$.headers,...await l0(O.headers,Y,$)}})}}J?.headers?.["content-type"]&&($.headers["content-type"]=J?.headers["content-type"]);let P=D+Y+M,L;try{L=await(E?.handle(new Request(P,$))??G(P,$))}catch(_){let O=new N0(503,_);if(KC(O,j))throw O;return{data:null,error:O,response:void 0,status:503,headers:void 0}}let v=null,V=null;if(z){Array.isArray(z)||(z=[z]);for(let _ of z)try{let O=await _(L.clone());if(O!=null){v=O;break}}catch(O){O instanceof N0?V=O:V=new N0(422,O);break}}if(v!==null)return{data:v,error:V,response:L,status:L.status,headers:L.headers};switch(L.headers.get("Content-Type")?.split(";")[0]){case"text/event-stream":v=qC(L,{parseDate:F.parseDate});break;case"application/json":v=JSON.parse(await L.text(),(O,g)=>{if(typeof g!="string")return g;return y8(g,{parseDate:F.parseDate})||g});break;case"application/octet-stream":v=await L.arrayBuffer();break;case"multipart/form-data":let _=await L.formData();v={},_.forEach((O,g)=>{v[g]=O});break;default:L.headers.get("content-type")?.startsWith("text/")&&L.headers.get("transfer-encoding")==="chunked"&&!L.headers.has("content-length")?v=qC(L,{parseDate:F.parseDate}):v=await L.text().then((O)=>c0(O,{parseDate:F.parseDate}))}if(L.status>=300||L.status<200){if(V=new N0(L.status,v),KC(V,j))throw V;v=null}return{data:v,error:V,response:L,status:L.status,headers:L.headers}})()}return typeof Z=="object"?u2(D,F,[...u,Object.values(Z)[0]],E):u2(D,F,u)}}),Iu=(D,F={})=>typeof D=="string"?(F.keepDomain||(D.includes("://")||(D=(AC.find((u)=>D.includes(u))?"http://":"https://")+D),D.endsWith("/")&&(D=D.slice(0,-1))),u2(D,F)):(typeof window<"u"&&console.warn("Elysia instance server found on client side, this is not recommended for security reason. Use generic type instead."),u2("http://e.ly",F,[],D));var $0=YD(b3(),1),f8=process.env.PHOTON_DEBUG==="1"||process.env.PHOTON_DEBUG==="true";function WC(D){f8=D}function NC(){return f8}function kq(...D){if(!f8)return;let F=$0.default.dim(`[debug ${new Date().toISOString()}]`);console.error(F,...D)}function Mu(D){if(!f8)return;let F=D.status>=500?$0.default.red:D.status>=400?$0.default.yellow:D.status>=200?$0.default.green:$0.default.dim;kq($0.default.bold(D.method.padEnd(6)),F(String(D.status)),D.url,$0.default.dim(`${D.durationMs}ms`))}async function i(D={}){let F=D.url?{name:"custom",url:Uu(D.url)}:await PD(D.apiHost),u=D.token??process.env.PHOTON_TOKEN??process.env.DASHBOARD_TOKEN,E=D.url||u?null:await qF(F.name);if(D.requireAuth&&!E&&!u)throw new MF(F.name);let B=u??E?.accessToken,C={};if(B)C.Authorization=`Bearer ${B}`;let Z=NC()?yq():fetch;return{api:Iu(F.url,{headers:C,fetcher:Z}),env:F,creds:E}}function yq(){return Object.assign(async(D,F)=>{let u=performance.now(),E=typeof D==="string"?D:D instanceof URL?D.toString():D.url,B=(F?.method??(D instanceof Request?D.method:void 0)??"GET").toUpperCase();try{let C=await fetch(D,F);return Mu({method:B,url:E,status:C.status,durationMs:Math.round(performance.now()-u)}),C}catch(C){throw Mu({method:B,url:E,status:0,durationMs:Math.round(performance.now()-u)}),C}},typeof fetch.preconnect==="function"?{preconnect:fetch.preconnect.bind(fetch)}:{})}async function e(D){let F=await PD(D.apiHost),u=D.flagProjectId?.trim();if(u)return{projectId:u,env:F};let E=process.env.PHOTON_PROJECT_ID?.trim();if(E)return{projectId:E,env:F};I(`No project specified for backend "${F.name}".`,{hint:"Pass `--project <id>`, or set `PHOTON_PROJECT_ID` in your shell."})}import{styleText as wu}from"node:util";import{stdout as yu,stdin as bC}from"node:process";import*as I0 from"node:readline";import nq from"node:readline";var $C=(D)=>{return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109},VC=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},IC=(D)=>{return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9800&&D<=9811||D===9855||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=19968&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D===94192||D===94193||D>=94208&&D<=100343||D>=100352&&D<=101589||D>=101632&&D<=101640||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128727||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129672||D>=129680&&D<=129725||D>=129727&&D<=129733||D>=129742&&D<=129755||D>=129760&&D<=129768||D>=129776&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141};var Tu=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,v8=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,h8=/\t{1,1000}/y,Ou=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,g8=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,bq=/\p{M}+/gu,fq={limit:1/0,ellipsis:""},MC=(D,F={},u={})=>{let E=F.limit??1/0,B=F.ellipsis??"",C=F?.ellipsisWidth??(B?MC(B,fq,u).width:0),Z=u.ansiWidth??0,J=u.controlWidth??0,X=u.tabWidth??8,H=u.ambiguousWidth??1,Y=u.emojiWidth??2,G=u.fullWidthWidth??2,K=u.regularWidth??1,Q=u.wideWidth??2,z=0,q=0,U=D.length,N=0,M=!1,$=U,W=Math.max(0,E-C),j=0,P=0,L=0,v=0;D:while(!0){if(P>j||q>=U&&q>z){let V=D.slice(j,P)||D.slice(z,q);N=0;for(let _ of V.replaceAll(bq,"")){let O=_.codePointAt(0)||0;if(VC(O))v=G;else if(IC(O))v=Q;else if(H!==K&&$C(O))v=H;else v=K;if(L+v>W)$=Math.min($,Math.max(j,z)+N);if(L+v>E){M=!0;break D}N+=_.length,L+=v}j=P=0}if(q>=U)break;if(g8.lastIndex=q,g8.test(D)){if(N=g8.lastIndex-q,v=N*K,L+v>W)$=Math.min($,q+Math.floor((W-L)/K));if(L+v>E){M=!0;break}L+=v,j=z,P=q,q=z=g8.lastIndex;continue}if(Tu.lastIndex=q,Tu.test(D)){if(L+Z>W)$=Math.min($,q);if(L+Z>E){M=!0;break}L+=Z,j=z,P=q,q=z=Tu.lastIndex;continue}if(v8.lastIndex=q,v8.test(D)){if(N=v8.lastIndex-q,v=N*J,L+v>W)$=Math.min($,q+Math.floor((W-L)/J));if(L+v>E){M=!0;break}L+=v,j=z,P=q,q=z=v8.lastIndex;continue}if(h8.lastIndex=q,h8.test(D)){if(N=h8.lastIndex-q,v=N*X,L+v>W)$=Math.min($,q+Math.floor((W-L)/X));if(L+v>E){M=!0;break}L+=v,j=z,P=q,q=z=h8.lastIndex;continue}if(Ou.lastIndex=q,Ou.test(D)){if(L+Y>W)$=Math.min($,q);if(L+Y>E){M=!0;break}L+=Y,j=z,P=q,q=z=Ou.lastIndex;continue}q+=1}return{width:M?W:L,index:M?$:U,truncated:M,ellipsed:M&&E>=C}},TC=MC;var vq={limit:1/0,ellipsis:"",ellipsisWidth:0},hq=(D,F={})=>{return TC(D,vq,F).width},B0=hq;var m8="\x1B",jC="›",gq=39,Lu="\x07",SC="[",mq="]",PC="m",Ru=`${mq}8;;`,OC=new RegExp(`(?:\\${SC}(?<code>\\d+)m|\\${Ru}(?<uri>.*)${Lu})`,"y"),_C=(D)=>{if(D>=30&&D<=37)return 39;if(D>=90&&D<=97)return 39;if(D>=40&&D<=47)return 49;if(D>=100&&D<=107)return 49;if(D===1||D===2)return 22;if(D===3)return 23;if(D===4)return 24;if(D===7)return 27;if(D===8)return 28;if(D===9)return 29;if(D===0)return 0;return},LC=(D)=>`${m8}${SC}${D}${PC}`,RC=(D)=>`${m8}${Ru}${D}${Lu}`,_u=(D,F,u)=>{let E=F[Symbol.iterator](),B=!1,C=!1,Z=D.at(-1),J=Z===void 0?0:B0(Z),X=E.next(),H=E.next(),Y=0;while(!X.done){let G=X.value,K=B0(G);if(J+K<=u)D[D.length-1]+=G;else D.push(G),J=0;if(G===m8||G===jC)B=!0,C=F.startsWith(Ru,Y+1);if(B){if(C){if(G===Lu)B=!1,C=!1}else if(G===PC)B=!1}else if(J+=K,J===u&&!H.done)D.push(""),J=0;X=H,H=E.next(),Y+=G.length}if(Z=D.at(-1),!J&&Z!==void 0&&Z.length&&D.length>1)D[D.length-2]+=D.pop()},dq=(D)=>{let F=D.split(" "),u=F.length;while(u){if(B0(F[u-1]))break;u--}if(u===F.length)return D;return F.slice(0,u).join(" ")+F.slice(u).join("")},cq=(D,F,u={})=>{if(u.trim!==!1&&D.trim()==="")return"";let E="",B,C,Z=D.split(" "),J=[""],X=0;for(let G=0;G<Z.length;G++){let K=Z[G];if(u.trim!==!1){let z=J.at(-1)??"",q=z.trimStart();if(z.length!==q.length)J[J.length-1]=q,X=B0(q)}if(G!==0){if(X>=F&&(u.wordWrap===!1||u.trim===!1))J.push(""),X=0;if(X||u.trim===!1)J[J.length-1]+=" ",X++}let Q=B0(K);if(u.hard&&Q>F){let z=F-X,q=1+Math.floor((Q-z-1)/F);if(Math.floor((Q-1)/F)<q)J.push("");_u(J,K,F),X=B0(J.at(-1)??"");continue}if(X+Q>F&&X&&Q){if(u.wordWrap===!1&&X<F){_u(J,K,F),X=B0(J.at(-1)??"");continue}J.push(""),X=0}if(X+Q>F&&u.wordWrap===!1){_u(J,K,F),X=B0(J.at(-1)??"");continue}J[J.length-1]+=K,X+=Q}if(u.trim!==!1)J=J.map((G)=>dq(G));let H=J.join(`
100
+ `),Y=!1;for(let G=0;G<H.length;G++){let K=H[G];if(E+=K,!Y)Y=K>="\uD800"&&K<="\uDBFF";else continue;if(K===m8||K===jC){OC.lastIndex=G+1;let z=OC.exec(H)?.groups;if(z?.code!==void 0){let q=Number.parseFloat(z.code);B=q===gq?void 0:q}else if(z?.uri!==void 0)C=z.uri.length===0?void 0:z.uri}if(H[G+1]===`
101
+ `){if(C)E+=RC("");let Q=B?_C(B):void 0;if(B&&Q)E+=LC(Q)}else if(K===`
102
+ `){if(B&&_C(B))E+=LC(B);if(C)E+=RC(C)}}return E},lq=/\r?\n/;function V0(D,F,u){return String(D).normalize().split(lq).map((E)=>cq(E,F,u)).join(`
103
+ `)}var MD=YD(Su(),1);import{ReadStream as xC}from"node:tty";function AF(D,F,u){if(!u.some((Z)=>!Z.disabled))return D;let E=D+F,B=Math.max(u.length-1,0),C=E<0?B:E>B?0:E;return u[C].disabled?AF(C,F<0?-1:1,u):C}var aq=["up","down","left","right","space","enter","cancel"],rq=["January","February","March","April","May","June","July","August","September","October","November","December"],AD={actions:new Set(aq),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...rq],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(D,F)=>`There are only ${D} days in ${F}`,afterMin:(D)=>`Date must be on or after ${D.toISOString().slice(0,10)}`,beforeMax:(D)=>`Date must be on or before ${D.toISOString().slice(0,10)}`}}};function bu(D,F){if(typeof D=="string")return AD.aliases.get(D)===F;for(let u of D)if(u!==void 0&&bu(u,F))return!0;return!1}function sq(D,F){if(D===F)return;let u=D.split(`
106
104
  `),E=F.split(`
107
- `),B=Math.max(u.length,E.length),C=[];for(let Z=0;Z<B;Z++)u[Z]!==E[Z]&&C.push(Z);return{lines:C,numLinesBefore:u.length,numLinesAfter:E.length,numLines:B}}var yA=globalThis.process.platform.startsWith("win"),v1=Symbol("clack:cancel");function RD(D){return D===v1}function n8(D,F){let u=D;u.isTTY&&u.setRawMode(F)}function oC({input:D=sC,output:F=g1,overwrite:u=!0,hideCursor:E=!0}={}){let B=I0.createInterface({input:D,output:F,prompt:"",tabSize:1});I0.emitKeypressEvents(D,B),D instanceof nC&&D.isTTY&&D.setRawMode(!0);let C=(Z,{name:J,sequence:X})=>{let H=String(Z);if(m1([H,J,X],"cancel")){E&&F.write(ID.cursor.show),process.exit(0);return}if(!u)return;I0.moveCursor(F,J==="return"?0:-1,J==="return"?-1:0,()=>{I0.clearLine(F,1,()=>{D.once("keypress",C)})})};return E&&F.write(ID.cursor.hide),D.once("keypress",C),()=>{D.off("keypress",C),E&&F.write(ID.cursor.show),D instanceof nC&&D.isTTY&&!yA&&D.setRawMode(!1),B.terminal=!1,B.close()}}var r8=(D)=>("columns"in D)&&typeof D.columns=="number"?D.columns:80,d1=(D)=>("rows"in D)&&typeof D.rows=="number"?D.rows:20;function B2(D,F,u,E=u){let B=r8(D??g1);return V0(F,B-u.length,{hard:!0,trim:!1}).split(`
105
+ `),B=Math.max(u.length,E.length),C=[];for(let Z=0;Z<B;Z++)u[Z]!==E[Z]&&C.push(Z);return{lines:C,numLinesBefore:u.length,numLinesAfter:E.length,numLines:B}}var oq=globalThis.process.platform.startsWith("win"),xu=Symbol("clack:cancel");function UD(D){return D===xu}function d8(D,F){let u=D;u.isTTY&&u.setRawMode(F)}function fC({input:D=bC,output:F=yu,overwrite:u=!0,hideCursor:E=!0}={}){let B=I0.createInterface({input:D,output:F,prompt:"",tabSize:1});I0.emitKeypressEvents(D,B),D instanceof xC&&D.isTTY&&D.setRawMode(!0);let C=(Z,{name:J,sequence:X})=>{let H=String(Z);if(bu([H,J,X],"cancel")){E&&F.write(MD.cursor.show),process.exit(0);return}if(!u)return;I0.moveCursor(F,J==="return"?0:-1,J==="return"?-1:0,()=>{I0.clearLine(F,1,()=>{D.once("keypress",C)})})};return E&&F.write(MD.cursor.hide),D.once("keypress",C),()=>{D.off("keypress",C),E&&F.write(MD.cursor.show),D instanceof xC&&D.isTTY&&!oq&&D.setRawMode(!1),B.terminal=!1,B.close()}}var l8=(D)=>("columns"in D)&&typeof D.columns=="number"?D.columns:80,fu=(D)=>("rows"in D)&&typeof D.rows=="number"?D.rows:20;function E2(D,F,u,E=u){let B=l8(D??yu);return V0(F,B-u.length,{hard:!0,trim:!1}).split(`
108
106
  `).map((C,Z)=>`${Z===0?E:u}${C}`).join(`
109
- `)}var WF=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(D,F=!0){let{input:u=sC,output:E=g1,render:B,signal:C,...Z}=D;this.opts=Z,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=B.bind(this),this._track=F,this._abortSignal=C,this.input=u,this.output=E}unsubscribe(){this._subscribers.clear()}setSubscriber(D,F){let u=this._subscribers.get(D)??[];u.push(F),this._subscribers.set(D,u)}on(D,F){this.setSubscriber(D,{cb:F})}once(D,F){this.setSubscriber(D,{cb:F,once:!0})}emit(D,...F){let u=this._subscribers.get(D)??[],E=[];for(let B of u)B.cb(...F),B.once&&E.push(()=>u.splice(u.indexOf(B),1));for(let B of E)B()}prompt(){return new Promise((D)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(v1);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=PA.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),n8(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(ID.cursor.show),this.output.off("resize",this.render),n8(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(ID.cursor.show),this.output.off("resize",this.render),n8(this.input,!1),D(v1)})})}_isActionKey(D,F){return D==="\t"}_setValue(D){this.value=D,this.emit("value",this.value)}_setUserInput(D,F){this.userInput=D??"",this.emit("userInput",this.userInput),F&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(D,F){if(this._track&&F.name!=="return"&&(F.name&&this._isActionKey(D,F)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),F?.name&&(!this._track&&AD.aliases.has(F.name)&&this.emit("cursor",AD.aliases.get(F.name)),AD.actions.has(F.name)&&this.emit("cursor",F.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),this.emit("key",D?.toLowerCase(),F),F?.name==="return"){if(this.opts.validate){let u=this.opts.validate(this.value);u&&(this.error=u instanceof Error?u.message:u,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}m1([D,F?.name,F?.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(`
110
- `),n8(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let D=V0(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
111
- `).length-1;this.output.write(ID.cursor.move(-999,D*-1))}render(){let D=V0(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(ID.cursor.hide);else{let F=kA(this._prevFrame,D),u=d1(this.output);if(this.restoreCursor(),F){let E=Math.max(0,F.numLinesAfter-u),B=Math.max(0,F.numLinesBefore-u),C=F.lines.find((Z)=>Z>=E);if(C===void 0){this._prevFrame=D;return}if(F.lines.length===1){this.output.write(ID.cursor.move(0,C-B)),this.output.write(ID.erase.lines(1));let Z=D.split(`
112
- `);this.output.write(Z[C]),this._prevFrame=D,this.output.write(ID.cursor.move(0,Z.length-C-1));return}else if(F.lines.length>1){if(E<B)C=E;else{let J=C-B;J>0&&this.output.write(ID.cursor.move(0,J))}this.output.write(ID.erase.down());let Z=D.split(`
107
+ `)}var UF=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(D,F=!0){let{input:u=bC,output:E=yu,render:B,signal:C,...Z}=D;this.opts=Z,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=B.bind(this),this._track=F,this._abortSignal=C,this.input=u,this.output=E}unsubscribe(){this._subscribers.clear()}setSubscriber(D,F){let u=this._subscribers.get(D)??[];u.push(F),this._subscribers.set(D,u)}on(D,F){this.setSubscriber(D,{cb:F})}once(D,F){this.setSubscriber(D,{cb:F,once:!0})}emit(D,...F){let u=this._subscribers.get(D)??[],E=[];for(let B of u)B.cb(...F),B.once&&E.push(()=>u.splice(u.indexOf(B),1));for(let B of E)B()}prompt(){return new Promise((D)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(xu);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=nq.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),d8(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(MD.cursor.show),this.output.off("resize",this.render),d8(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(MD.cursor.show),this.output.off("resize",this.render),d8(this.input,!1),D(xu)})})}_isActionKey(D,F){return D==="\t"}_setValue(D){this.value=D,this.emit("value",this.value)}_setUserInput(D,F){this.userInput=D??"",this.emit("userInput",this.userInput),F&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(D,F){if(this._track&&F.name!=="return"&&(F.name&&this._isActionKey(D,F)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),F?.name&&(!this._track&&AD.aliases.has(F.name)&&this.emit("cursor",AD.aliases.get(F.name)),AD.actions.has(F.name)&&this.emit("cursor",F.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),this.emit("key",D?.toLowerCase(),F),F?.name==="return"){if(this.opts.validate){let u=this.opts.validate(this.value);u&&(this.error=u instanceof Error?u.message:u,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}bu([D,F?.name,F?.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(`
108
+ `),d8(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let D=V0(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
109
+ `).length-1;this.output.write(MD.cursor.move(-999,D*-1))}render(){let D=V0(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(MD.cursor.hide);else{let F=sq(this._prevFrame,D),u=fu(this.output);if(this.restoreCursor(),F){let E=Math.max(0,F.numLinesAfter-u),B=Math.max(0,F.numLinesBefore-u),C=F.lines.find((Z)=>Z>=E);if(C===void 0){this._prevFrame=D;return}if(F.lines.length===1){this.output.write(MD.cursor.move(0,C-B)),this.output.write(MD.erase.lines(1));let Z=D.split(`
110
+ `);this.output.write(Z[C]),this._prevFrame=D,this.output.write(MD.cursor.move(0,Z.length-C-1));return}else if(F.lines.length>1){if(E<B)C=E;else{let J=C-B;J>0&&this.output.write(MD.cursor.move(0,J))}this.output.write(MD.erase.down());let Z=D.split(`
113
111
  `).slice(C);this.output.write(Z.join(`
114
- `)),this._prevFrame=D;return}}this.output.write(ID.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}};function bA(D,F){if(D===void 0||F.length===0)return 0;let u=F.findIndex((E)=>E.value===D);return u!==-1?u:0}function fA(D,F){return(F.label??String(F.value)).toLowerCase().includes(D.toLowerCase())}function vA(D,F){if(F)return D?F:F[0]}var hA=class extends WF{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#u=0;#Z="";#F;#E;#D;get cursor(){return this.#u}get userInputWithCursor(){if(!this.userInput)return f1(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let D=this.userInput.slice(0,this._cursor),[F,...u]=this.userInput.slice(this._cursor);return`${D}${f1("inverse",F)}${u.join("")}`}get options(){return typeof this.#E=="function"?this.#E():this.#E}constructor(D){super(D),this.#E=D.options,this.#D=D.placeholder;let F=this.options;this.filteredOptions=[...F],this.multiple=D.multiple===!0,this.#F=typeof D.options=="function"?D.filter:D.filter??fA;let u;if(D.initialValue&&Array.isArray(D.initialValue)?this.multiple?u=D.initialValue:u=D.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(u=[this.options[0].value]),u)for(let E of u){let B=F.findIndex((C)=>C.value===E);B!==-1&&(this.toggleSelected(E),this.#u=B)}this.focusedValue=this.options[this.#u]?.value,this.on("key",(E,B)=>this.#B(E,B)),this.on("userInput",(E)=>this.#C(E))}_isActionKey(D,F){return D==="\t"||this.multiple&&this.isNavigating&&F.name==="space"&&D!==void 0&&D!==""}#B(D,F){let u=F.name==="up",E=F.name==="down",B=F.name==="return",C=this.userInput===""||this.userInput==="\t",Z=this.#D,J=this.options,X=Z!==void 0&&Z!==""&&J.some((H)=>!H.disabled&&(this.#F?this.#F(Z,H):!0));if(F.name==="tab"&&C&&X){this.userInput==="\t"&&this._clearUserInput(),this._setUserInput(Z,!0),this.isNavigating=!1;return}u||E?(this.#u=UF(this.#u,u?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#u]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):B?this.value=vA(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(F.name==="tab"||this.isNavigating&&F.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(D){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(D)?this.selectedValues=this.selectedValues.filter((F)=>F!==D):this.selectedValues=[...this.selectedValues,D]:this.selectedValues=[D])}#C(D){if(D!==this.#Z){this.#Z=D;let F=this.options;D&&this.#F?this.filteredOptions=F.filter((B)=>this.#F?.(D,B)):this.filteredOptions=[...F];let u=bA(this.focusedValue,this.filteredOptions);this.#u=UF(u,0,this.filteredOptions);let E=this.filteredOptions[this.#u];E&&!E.disabled?this.focusedValue=E.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}};class c1 extends WF{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",(F)=>{this.output.write(ID.cursor.move(0,-1)),this.value=F,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var gA={Y:{type:"year",len:4},M:{type:"month",len:2},D:{type:"day",len:2}};function aC(D){return[...D].map((F)=>gA[F])}function mA(D){let F=new Intl.DateTimeFormat(D,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2000,0,15)),u=[],E="/";for(let B of F)B.type==="literal"?E=B.value.trim()||B.value:(B.type==="year"||B.type==="month"||B.type==="day")&&u.push({type:B.type,len:B.type==="year"?4:2});return{segments:u,separator:E}}function b1(D){return Number.parseInt((D||"0").replace(/_/g,"0"),10)||0}function a8(D){return{year:b1(D.year),month:b1(D.month),day:b1(D.day)}}function h1(D,F){return new Date(D||2001,F||1,0).getDate()}function tC(D){let{year:F,month:u,day:E}=a8(D);if(!F||F<0||F>9999||!u||u<1||u>12||!E||E<1)return;let B=new Date(Date.UTC(F,u-1,E));if(!(B.getUTCFullYear()!==F||B.getUTCMonth()!==u-1||B.getUTCDate()!==E))return{year:F,month:u,day:E}}function rC(D){let F=tC(D);return F?new Date(Date.UTC(F.year,F.month-1,F.day)):void 0}function dA(D,F,u,E){let B=u?{year:u.getUTCFullYear(),month:u.getUTCMonth()+1,day:u.getUTCDate()}:null,C=E?{year:E.getUTCFullYear(),month:E.getUTCMonth()+1,day:E.getUTCDate()}:null;return D==="year"?{min:B?.year??1,max:C?.year??9999}:D==="month"?{min:B&&F.year===B.year?B.month:1,max:C&&F.year===C.year?C.month:12}:{min:B&&F.year===B.year&&F.month===B.month?B.day:1,max:C&&F.year===C.year&&F.month===C.month?C.day:h1(F.year,F.month)}}class eC extends WF{#u;#Z;#F;#E;#D;#B={segmentIndex:0,positionInSegment:0};#C=!0;#J=null;inlineError="";get segmentCursor(){return{...this.#B}}get segmentValues(){return{...this.#F}}get segments(){return this.#u}get separator(){return this.#Z}get formattedValue(){return this.#K(this.#F)}#K(D){return this.#u.map((F)=>D[F.type]).join(this.#Z)}#X(){this._setUserInput(this.#K(this.#F)),this._setValue(rC(this.#F)??void 0)}constructor(D){let F=D.format?{segments:aC(D.format),separator:D.separator??"/"}:mA(D.locale),u=D.separator??F.separator,E=D.format?aC(D.format):F.segments,B=D.initialValue??D.defaultValue,C=B?{year:String(B.getUTCFullYear()).padStart(4,"0"),month:String(B.getUTCMonth()+1).padStart(2,"0"),day:String(B.getUTCDate()).padStart(2,"0")}:{year:"____",month:"__",day:"__"},Z=E.map((J)=>C[J.type]).join(u);super({...D,initialUserInput:Z},!1),this.#u=E,this.#Z=u,this.#F=C,this.#E=D.minDate,this.#D=D.maxDate,this.#X(),this.on("cursor",(J)=>this.#q(J)),this.on("key",(J,X)=>this.#A(J,X)),this.on("finalize",()=>this.#z(D))}#Y(){let D=Math.max(0,Math.min(this.#B.segmentIndex,this.#u.length-1)),F=this.#u[D];if(F)return this.#B.positionInSegment=Math.max(0,Math.min(this.#B.positionInSegment,F.len-1)),{segment:F,index:D}}#G(D){this.inlineError="",this.#J=null;let F=this.#Y();F&&(this.#B.segmentIndex=Math.max(0,Math.min(this.#u.length-1,F.index+D)),this.#B.positionInSegment=0,this.#C=!0)}#H(D){let F=this.#Y();if(!F)return;let{segment:u}=F,E=this.#F[u.type],B=!E||E.replace(/_/g,"")==="",C=Number.parseInt((E||"0").replace(/_/g,"0"),10)||0,Z=dA(u.type,a8(this.#F),this.#E,this.#D),J;B?J=D===1?Z.min:Z.max:J=Math.max(Math.min(Z.max,C+D),Z.min),this.#F={...this.#F,[u.type]:J.toString().padStart(u.len,"0")},this.#C=!0,this.#J=null,this.#X()}#q(D){if(D)switch(D){case"right":return this.#G(1);case"left":return this.#G(-1);case"up":return this.#H(1);case"down":return this.#H(-1)}}#A(D,F){if(F?.name==="backspace"||F?.sequence===""||F?.sequence==="\b"||D===""||D==="\b"){this.inlineError="";let u=this.#Y();if(!u)return;if(!this.#F[u.segment.type].replace(/_/g,"")){this.#G(-1);return}this.#F[u.segment.type]="_".repeat(u.segment.len),this.#C=!0,this.#B.positionInSegment=0,this.#X();return}if(F?.name==="tab"){this.inlineError="";let u=this.#Y();if(!u)return;let E=F.shift?-1:1,B=u.index+E;B>=0&&B<this.#u.length&&(this.#B.segmentIndex=B,this.#B.positionInSegment=0,this.#C=!0);return}if(D&&/^[0-9]$/.test(D)){let u=this.#Y();if(!u)return;let{segment:E}=u,B=!this.#F[E.type].replace(/_/g,"");if(this.#C&&this.#J!==null&&!B){let K=this.#J+D,Q={...this.#F,[E.type]:K},z=this.#Q(Q,E);if(z){this.inlineError=z,this.#J=null,this.#C=!1;return}this.inlineError="",this.#F[E.type]=K,this.#J=null,this.#C=!1,this.#X(),u.index<this.#u.length-1&&(this.#B.segmentIndex=u.index+1,this.#B.positionInSegment=0,this.#C=!0);return}this.#C&&!B&&(this.#F[E.type]="_".repeat(E.len),this.#B.positionInSegment=0),this.#C=!1,this.#J=null;let C=this.#F[E.type],Z=C.indexOf("_"),J=Z>=0?Z:Math.min(this.#B.positionInSegment,E.len-1);if(J<0||J>=E.len)return;let X=C.slice(0,J)+D+C.slice(J+1),H=!1;if(J===0&&C==="__"&&(E.type==="month"||E.type==="day")){let K=Number.parseInt(D,10);X=`0${D}`,H=K<=(E.type==="month"?1:2)}if(E.type==="year"&&(X=(C.replace(/_/g,"")+D).padStart(E.len,"_")),!X.includes("_")){let K={...this.#F,[E.type]:X},Q=this.#Q(K,E);if(Q){this.inlineError=Q;return}}this.inlineError="",this.#F[E.type]=X;let Y=X.includes("_")?void 0:tC(this.#F);if(Y){let{year:K,month:Q}=Y,z=h1(K,Q);this.#F={year:String(Math.max(0,Math.min(9999,K))).padStart(4,"0"),month:String(Math.max(1,Math.min(12,Q))).padStart(2,"0"),day:String(Math.max(1,Math.min(z,Y.day))).padStart(2,"0")}}this.#X();let G=X.indexOf("_");H?(this.#C=!0,this.#J=D):G>=0?this.#B.positionInSegment=G:Z>=0&&u.index<this.#u.length-1?(this.#B.segmentIndex=u.index+1,this.#B.positionInSegment=0,this.#C=!0):this.#B.positionInSegment=Math.min(J+1,E.len-1)}}#Q(D,F){let{month:u,day:E}=a8(D);if(F.type==="month"&&(u<0||u>12))return AD.date.messages.invalidMonth;if(F.type==="day"&&(E<0||E>31))return AD.date.messages.invalidDay(31,"any month")}#z(D){let{year:F,month:u,day:E}=a8(this.#F);if(F&&u&&E){let B=h1(F,u);this.#F={...this.#F,day:String(Math.min(E,B)).padStart(2,"0")}}this.value=rC(this.#F)??D.defaultValue??void 0}}class DZ extends WF{options;cursor=0;#u;getGroupItems(D){return this.options.filter((F)=>F.group===D)}isGroupSelected(D){let F=this.getGroupItems(D),u=this.value;return u===void 0?!1:F.every((E)=>u.includes(E.value))}toggleValue(){let D=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),D.group===!0){let F=D.value,u=this.getGroupItems(F);this.isGroupSelected(F)?this.value=this.value.filter((E)=>u.findIndex((B)=>B.value===E)===-1):this.value=[...this.value,...u.map((E)=>E.value)],this.value=Array.from(new Set(this.value))}else{let F=this.value.includes(D.value);this.value=F?this.value.filter((u)=>u!==D.value):[...this.value,D.value]}}constructor(D){super(D,!1);let{options:F}=D;this.#u=D.selectableGroups!==!1,this.options=Object.entries(F).flatMap(([u,E])=>[{value:u,group:!0,label:u},...E.map((B)=>({...B,group:u}))]),this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:u})=>u===D.cursorAt),this.#u?0:1),this.on("cursor",(u)=>{switch(u){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let E=this.options[this.cursor]?.group===!0;!this.#u&&E&&(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;let E=this.options[this.cursor]?.group===!0;!this.#u&&E&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}class l1 extends WF{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(D){super(D,!1),this.options=D.options;let F=this.options.findIndex(({value:E})=>E===D.initialValue),u=F===-1?0:F;this.cursor=this.options[u].disabled?UF(u,1,this.options):u,this.changeValue(),this.on("cursor",(E)=>{switch(E){case"left":case"up":this.cursor=UF(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=UF(this.cursor,1,this.options);break}this.changeValue()})}}class p1 extends WF{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let D=this.userInput;if(this.cursor>=D.length)return`${this.userInput}█`;let F=D.slice(0,this.cursor),[u,...E]=D.slice(this.cursor);return`${F}${f1("inverse",u)}${E.join("")}`}get cursor(){return this._cursor}constructor(D){super({...D,initialUserInput:D.initialUserInput??D.initialValue}),this.on("userInput",(F)=>{this._setValue(F)}),this.on("finalize",()=>{this.value||(this.value=D.defaultValue),this.value===void 0&&(this.value="")})}}import{styleText as x,stripVTControlCharacters as wL}from"node:util";import nD from"node:process";var C2=GD(y1(),1);function cA(){return nD.platform!=="win32"?nD.env.TERM!=="linux":!!nD.env.CI||!!nD.env.WT_SESSION||!!nD.env.TERMINUS_SUBLIME||nD.env.ConEmuTask==="{cmd::Cmder}"||nD.env.TERM_PROGRAM==="Terminus-Sublime"||nD.env.TERM_PROGRAM==="vscode"||nD.env.TERM==="xterm-256color"||nD.env.TERM==="alacritty"||nD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var i1=cA(),lA=()=>process.env.CI==="true";var t=(D,F)=>i1?D:F,pA=t("◆","*"),FZ=t("■","x"),uZ=t("▲","x"),a1=t("◇","o"),iA=t("┌","T"),DD=t("│","|"),Z2=t("└","—"),bL=t("┐","T"),fL=t("┘","—"),n1=t("●",">"),o8=t("○"," "),vL=t("◻","[•]"),hL=t("◼","[+]"),gL=t("◻","[ ]"),mL=t("▪","•"),dL=t("─","-"),cL=t("╮","+"),lL=t("├","+"),pL=t("╯","+"),iL=t("╰","+"),nL=t("╭","+"),nA=t("●","•"),aA=t("◆","*"),rA=t("▲","!"),sA=t("■","x"),r1=(D)=>{switch(D){case"initial":case"active":return x("cyan",pA);case"cancel":return x("red",FZ);case"error":return x("yellow",uZ);case"submit":return x("green",a1)}},oA=(D)=>{switch(D){case"initial":case"active":return x("cyan",DD);case"cancel":return x("red",DD);case"error":return x("yellow",DD);case"submit":return x("green",DD)}},tA=(D,F,u,E,B)=>{let C=F,Z=0;for(let J=u;J<E;J++){let X=D[J];if(C=C-X.length,Z++,C<=B)break}return{lineCount:C,removals:Z}},eA=({cursor:D,options:F,style:u,output:E=process.stdout,maxItems:B=Number.POSITIVE_INFINITY,columnPadding:C=0,rowPadding:Z=4})=>{let J=r8(E)-C,X=d1(E),H=x("dim","..."),Y=Math.max(X-Z,0),G=Math.max(Math.min(B,Y),5),K=0;D>=G-3&&(K=Math.max(Math.min(D-G+3,F.length-G),0));let Q=G<F.length&&K>0,z=G<F.length&&K+G<F.length,q=Math.min(K+G,F.length),U=[],N=0;Q&&N++,z&&N++;let I=K+(Q?1:0),$=q-(z?1:0);for(let j=I;j<$;j++){let P=V0(u(F[j],j===D),J,{hard:!0,trim:!1}).split(`
115
- `);U.push(P),N+=P.length}if(N>Y){let j=0,P=0,L=N,v=D-I,V=(O,_)=>tA(U,L,O,_,Y);Q?({lineCount:L,removals:j}=V(0,v),L>Y&&({lineCount:L,removals:P}=V(v+1,U.length))):({lineCount:L,removals:P}=V(v+1,U.length),L>Y&&({lineCount:L,removals:j}=V(0,v))),j>0&&(Q=!0,U.splice(0,j)),P>0&&(z=!0,U.splice(U.length-P,P))}let W=[];Q&&W.push(H);for(let j of U)for(let P of j)W.push(P);return z&&W.push(H),W};var t8=(D)=>{let F=D.active??"Yes",u=D.inactive??"No";return new c1({active:F,inactive:u,signal:D.signal,input:D.input,output:D.output,initialValue:D.initialValue??!0,render(){let E=D.withGuide??AD.withGuide,B=`${r1(this.state)} `,C=E?`${x("gray",DD)} `:"",Z=B2(D.output,D.message,C,B),J=`${E?`${x("gray",DD)}
112
+ `)),this._prevFrame=D;return}}this.output.write(MD.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}};function tq(D,F){if(D===void 0||F.length===0)return 0;let u=F.findIndex((E)=>E.value===D);return u!==-1?u:0}function eq(D,F){return(F.label??String(F.value)).toLowerCase().includes(D.toLowerCase())}function DA(D,F){if(F)return D?F:F[0]}var FA=class extends UF{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#u=0;#Z="";#F;#E;#D;get cursor(){return this.#u}get userInputWithCursor(){if(!this.userInput)return wu(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let D=this.userInput.slice(0,this._cursor),[F,...u]=this.userInput.slice(this._cursor);return`${D}${wu("inverse",F)}${u.join("")}`}get options(){return typeof this.#E=="function"?this.#E():this.#E}constructor(D){super(D),this.#E=D.options,this.#D=D.placeholder;let F=this.options;this.filteredOptions=[...F],this.multiple=D.multiple===!0,this.#F=typeof D.options=="function"?D.filter:D.filter??eq;let u;if(D.initialValue&&Array.isArray(D.initialValue)?this.multiple?u=D.initialValue:u=D.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(u=[this.options[0].value]),u)for(let E of u){let B=F.findIndex((C)=>C.value===E);B!==-1&&(this.toggleSelected(E),this.#u=B)}this.focusedValue=this.options[this.#u]?.value,this.on("key",(E,B)=>this.#B(E,B)),this.on("userInput",(E)=>this.#C(E))}_isActionKey(D,F){return D==="\t"||this.multiple&&this.isNavigating&&F.name==="space"&&D!==void 0&&D!==""}#B(D,F){let u=F.name==="up",E=F.name==="down",B=F.name==="return",C=this.userInput===""||this.userInput==="\t",Z=this.#D,J=this.options,X=Z!==void 0&&Z!==""&&J.some((H)=>!H.disabled&&(this.#F?this.#F(Z,H):!0));if(F.name==="tab"&&C&&X){this.userInput==="\t"&&this._clearUserInput(),this._setUserInput(Z,!0),this.isNavigating=!1;return}u||E?(this.#u=AF(this.#u,u?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#u]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):B?this.value=DA(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(F.name==="tab"||this.isNavigating&&F.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(D){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(D)?this.selectedValues=this.selectedValues.filter((F)=>F!==D):this.selectedValues=[...this.selectedValues,D]:this.selectedValues=[D])}#C(D){if(D!==this.#Z){this.#Z=D;let F=this.options;D&&this.#F?this.filteredOptions=F.filter((B)=>this.#F?.(D,B)):this.filteredOptions=[...F];let u=tq(this.focusedValue,this.filteredOptions);this.#u=AF(u,0,this.filteredOptions);let E=this.filteredOptions[this.#u];E&&!E.disabled?this.focusedValue=E.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}};class vu extends UF{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",(F)=>{this.output.write(MD.cursor.move(0,-1)),this.value=F,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var uA={Y:{type:"year",len:4},M:{type:"month",len:2},D:{type:"day",len:2}};function kC(D){return[...D].map((F)=>uA[F])}function EA(D){let F=new Intl.DateTimeFormat(D,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2000,0,15)),u=[],E="/";for(let B of F)B.type==="literal"?E=B.value.trim()||B.value:(B.type==="year"||B.type==="month"||B.type==="day")&&u.push({type:B.type,len:B.type==="year"?4:2});return{segments:u,separator:E}}function Pu(D){return Number.parseInt((D||"0").replace(/_/g,"0"),10)||0}function c8(D){return{year:Pu(D.year),month:Pu(D.month),day:Pu(D.day)}}function ku(D,F){return new Date(D||2001,F||1,0).getDate()}function vC(D){let{year:F,month:u,day:E}=c8(D);if(!F||F<0||F>9999||!u||u<1||u>12||!E||E<1)return;let B=new Date(Date.UTC(F,u-1,E));if(!(B.getUTCFullYear()!==F||B.getUTCMonth()!==u-1||B.getUTCDate()!==E))return{year:F,month:u,day:E}}function yC(D){let F=vC(D);return F?new Date(Date.UTC(F.year,F.month-1,F.day)):void 0}function BA(D,F,u,E){let B=u?{year:u.getUTCFullYear(),month:u.getUTCMonth()+1,day:u.getUTCDate()}:null,C=E?{year:E.getUTCFullYear(),month:E.getUTCMonth()+1,day:E.getUTCDate()}:null;return D==="year"?{min:B?.year??1,max:C?.year??9999}:D==="month"?{min:B&&F.year===B.year?B.month:1,max:C&&F.year===C.year?C.month:12}:{min:B&&F.year===B.year&&F.month===B.month?B.day:1,max:C&&F.year===C.year&&F.month===C.month?C.day:ku(F.year,F.month)}}class hC extends UF{#u;#Z;#F;#E;#D;#B={segmentIndex:0,positionInSegment:0};#C=!0;#J=null;inlineError="";get segmentCursor(){return{...this.#B}}get segmentValues(){return{...this.#F}}get segments(){return this.#u}get separator(){return this.#Z}get formattedValue(){return this.#K(this.#F)}#K(D){return this.#u.map((F)=>D[F.type]).join(this.#Z)}#X(){this._setUserInput(this.#K(this.#F)),this._setValue(yC(this.#F)??void 0)}constructor(D){let F=D.format?{segments:kC(D.format),separator:D.separator??"/"}:EA(D.locale),u=D.separator??F.separator,E=D.format?kC(D.format):F.segments,B=D.initialValue??D.defaultValue,C=B?{year:String(B.getUTCFullYear()).padStart(4,"0"),month:String(B.getUTCMonth()+1).padStart(2,"0"),day:String(B.getUTCDate()).padStart(2,"0")}:{year:"____",month:"__",day:"__"},Z=E.map((J)=>C[J.type]).join(u);super({...D,initialUserInput:Z},!1),this.#u=E,this.#Z=u,this.#F=C,this.#E=D.minDate,this.#D=D.maxDate,this.#X(),this.on("cursor",(J)=>this.#q(J)),this.on("key",(J,X)=>this.#A(J,X)),this.on("finalize",()=>this.#z(D))}#Y(){let D=Math.max(0,Math.min(this.#B.segmentIndex,this.#u.length-1)),F=this.#u[D];if(F)return this.#B.positionInSegment=Math.max(0,Math.min(this.#B.positionInSegment,F.len-1)),{segment:F,index:D}}#G(D){this.inlineError="",this.#J=null;let F=this.#Y();F&&(this.#B.segmentIndex=Math.max(0,Math.min(this.#u.length-1,F.index+D)),this.#B.positionInSegment=0,this.#C=!0)}#H(D){let F=this.#Y();if(!F)return;let{segment:u}=F,E=this.#F[u.type],B=!E||E.replace(/_/g,"")==="",C=Number.parseInt((E||"0").replace(/_/g,"0"),10)||0,Z=BA(u.type,c8(this.#F),this.#E,this.#D),J;B?J=D===1?Z.min:Z.max:J=Math.max(Math.min(Z.max,C+D),Z.min),this.#F={...this.#F,[u.type]:J.toString().padStart(u.len,"0")},this.#C=!0,this.#J=null,this.#X()}#q(D){if(D)switch(D){case"right":return this.#G(1);case"left":return this.#G(-1);case"up":return this.#H(1);case"down":return this.#H(-1)}}#A(D,F){if(F?.name==="backspace"||F?.sequence===""||F?.sequence==="\b"||D===""||D==="\b"){this.inlineError="";let u=this.#Y();if(!u)return;if(!this.#F[u.segment.type].replace(/_/g,"")){this.#G(-1);return}this.#F[u.segment.type]="_".repeat(u.segment.len),this.#C=!0,this.#B.positionInSegment=0,this.#X();return}if(F?.name==="tab"){this.inlineError="";let u=this.#Y();if(!u)return;let E=F.shift?-1:1,B=u.index+E;B>=0&&B<this.#u.length&&(this.#B.segmentIndex=B,this.#B.positionInSegment=0,this.#C=!0);return}if(D&&/^[0-9]$/.test(D)){let u=this.#Y();if(!u)return;let{segment:E}=u,B=!this.#F[E.type].replace(/_/g,"");if(this.#C&&this.#J!==null&&!B){let K=this.#J+D,Q={...this.#F,[E.type]:K},z=this.#Q(Q,E);if(z){this.inlineError=z,this.#J=null,this.#C=!1;return}this.inlineError="",this.#F[E.type]=K,this.#J=null,this.#C=!1,this.#X(),u.index<this.#u.length-1&&(this.#B.segmentIndex=u.index+1,this.#B.positionInSegment=0,this.#C=!0);return}this.#C&&!B&&(this.#F[E.type]="_".repeat(E.len),this.#B.positionInSegment=0),this.#C=!1,this.#J=null;let C=this.#F[E.type],Z=C.indexOf("_"),J=Z>=0?Z:Math.min(this.#B.positionInSegment,E.len-1);if(J<0||J>=E.len)return;let X=C.slice(0,J)+D+C.slice(J+1),H=!1;if(J===0&&C==="__"&&(E.type==="month"||E.type==="day")){let K=Number.parseInt(D,10);X=`0${D}`,H=K<=(E.type==="month"?1:2)}if(E.type==="year"&&(X=(C.replace(/_/g,"")+D).padStart(E.len,"_")),!X.includes("_")){let K={...this.#F,[E.type]:X},Q=this.#Q(K,E);if(Q){this.inlineError=Q;return}}this.inlineError="",this.#F[E.type]=X;let Y=X.includes("_")?void 0:vC(this.#F);if(Y){let{year:K,month:Q}=Y,z=ku(K,Q);this.#F={year:String(Math.max(0,Math.min(9999,K))).padStart(4,"0"),month:String(Math.max(1,Math.min(12,Q))).padStart(2,"0"),day:String(Math.max(1,Math.min(z,Y.day))).padStart(2,"0")}}this.#X();let G=X.indexOf("_");H?(this.#C=!0,this.#J=D):G>=0?this.#B.positionInSegment=G:Z>=0&&u.index<this.#u.length-1?(this.#B.segmentIndex=u.index+1,this.#B.positionInSegment=0,this.#C=!0):this.#B.positionInSegment=Math.min(J+1,E.len-1)}}#Q(D,F){let{month:u,day:E}=c8(D);if(F.type==="month"&&(u<0||u>12))return AD.date.messages.invalidMonth;if(F.type==="day"&&(E<0||E>31))return AD.date.messages.invalidDay(31,"any month")}#z(D){let{year:F,month:u,day:E}=c8(this.#F);if(F&&u&&E){let B=ku(F,u);this.#F={...this.#F,day:String(Math.min(E,B)).padStart(2,"0")}}this.value=yC(this.#F)??D.defaultValue??void 0}}class gC extends UF{options;cursor=0;#u;getGroupItems(D){return this.options.filter((F)=>F.group===D)}isGroupSelected(D){let F=this.getGroupItems(D),u=this.value;return u===void 0?!1:F.every((E)=>u.includes(E.value))}toggleValue(){let D=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),D.group===!0){let F=D.value,u=this.getGroupItems(F);this.isGroupSelected(F)?this.value=this.value.filter((E)=>u.findIndex((B)=>B.value===E)===-1):this.value=[...this.value,...u.map((E)=>E.value)],this.value=Array.from(new Set(this.value))}else{let F=this.value.includes(D.value);this.value=F?this.value.filter((u)=>u!==D.value):[...this.value,D.value]}}constructor(D){super(D,!1);let{options:F}=D;this.#u=D.selectableGroups!==!1,this.options=Object.entries(F).flatMap(([u,E])=>[{value:u,group:!0,label:u},...E.map((B)=>({...B,group:u}))]),this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:u})=>u===D.cursorAt),this.#u?0:1),this.on("cursor",(u)=>{switch(u){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let E=this.options[this.cursor]?.group===!0;!this.#u&&E&&(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;let E=this.options[this.cursor]?.group===!0;!this.#u&&E&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}}class hu extends UF{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(D){super(D,!1),this.options=D.options;let F=this.options.findIndex(({value:E})=>E===D.initialValue),u=F===-1?0:F;this.cursor=this.options[u].disabled?AF(u,1,this.options):u,this.changeValue(),this.on("cursor",(E)=>{switch(E){case"left":case"up":this.cursor=AF(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=AF(this.cursor,1,this.options);break}this.changeValue()})}}class gu extends UF{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let D=this.userInput;if(this.cursor>=D.length)return`${this.userInput}█`;let F=D.slice(0,this.cursor),[u,...E]=D.slice(this.cursor);return`${F}${wu("inverse",u)}${E.join("")}`}get cursor(){return this._cursor}constructor(D){super({...D,initialUserInput:D.initialUserInput??D.initialValue}),this.on("userInput",(F)=>{this._setValue(F)}),this.on("finalize",()=>{this.value||(this.value=D.defaultValue),this.value===void 0&&(this.value="")})}}import{styleText as x,stripVTControlCharacters as K_}from"node:util";import aD from"node:process";var B2=YD(Su(),1);function CA(){return aD.platform!=="win32"?aD.env.TERM!=="linux":!!aD.env.CI||!!aD.env.WT_SESSION||!!aD.env.TERMINUS_SUBLIME||aD.env.ConEmuTask==="{cmd::Cmder}"||aD.env.TERM_PROGRAM==="Terminus-Sublime"||aD.env.TERM_PROGRAM==="vscode"||aD.env.TERM==="xterm-256color"||aD.env.TERM==="alacritty"||aD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var mu=CA(),ZA=()=>process.env.CI==="true";var t=(D,F)=>mu?D:F,JA=t("◆","*"),mC=t("■","x"),dC=t("▲","x"),cu=t("◇","o"),HA=t("┌","T"),DD=t("│","|"),C2=t("└","—"),U_=t("┐","T"),W_=t("┘","—"),du=t("●",">"),i8=t("○"," "),N_=t("◻","[•]"),$_=t("◼","[+]"),V_=t("◻","[ ]"),I_=t("▪","•"),M_=t("─","-"),T_=t("╮","+"),O_=t("├","+"),__=t("╯","+"),L_=t("╰","+"),R_=t("╭","+"),YA=t("●","•"),XA=t("◆","*"),GA=t("▲","!"),QA=t("■","x"),lu=(D)=>{switch(D){case"initial":case"active":return x("cyan",JA);case"cancel":return x("red",mC);case"error":return x("yellow",dC);case"submit":return x("green",cu)}},KA=(D)=>{switch(D){case"initial":case"active":return x("cyan",DD);case"cancel":return x("red",DD);case"error":return x("yellow",DD);case"submit":return x("green",DD)}},zA=(D,F,u,E,B)=>{let C=F,Z=0;for(let J=u;J<E;J++){let X=D[J];if(C=C-X.length,Z++,C<=B)break}return{lineCount:C,removals:Z}},qA=({cursor:D,options:F,style:u,output:E=process.stdout,maxItems:B=Number.POSITIVE_INFINITY,columnPadding:C=0,rowPadding:Z=4})=>{let J=l8(E)-C,X=fu(E),H=x("dim","..."),Y=Math.max(X-Z,0),G=Math.max(Math.min(B,Y),5),K=0;D>=G-3&&(K=Math.max(Math.min(D-G+3,F.length-G),0));let Q=G<F.length&&K>0,z=G<F.length&&K+G<F.length,q=Math.min(K+G,F.length),U=[],N=0;Q&&N++,z&&N++;let M=K+(Q?1:0),$=q-(z?1:0);for(let j=M;j<$;j++){let P=V0(u(F[j],j===D),J,{hard:!0,trim:!1}).split(`
113
+ `);U.push(P),N+=P.length}if(N>Y){let j=0,P=0,L=N,v=D-M,V=(_,O)=>zA(U,L,_,O,Y);Q?({lineCount:L,removals:j}=V(0,v),L>Y&&({lineCount:L,removals:P}=V(v+1,U.length))):({lineCount:L,removals:P}=V(v+1,U.length),L>Y&&({lineCount:L,removals:j}=V(0,v))),j>0&&(Q=!0,U.splice(0,j)),P>0&&(z=!0,U.splice(U.length-P,P))}let W=[];Q&&W.push(H);for(let j of U)for(let P of j)W.push(P);return z&&W.push(H),W};var n8=(D)=>{let F=D.active??"Yes",u=D.inactive??"No";return new vu({active:F,inactive:u,signal:D.signal,input:D.input,output:D.output,initialValue:D.initialValue??!0,render(){let E=D.withGuide??AD.withGuide,B=`${lu(this.state)} `,C=E?`${x("gray",DD)} `:"",Z=E2(D.output,D.message,C,B),J=`${E?`${x("gray",DD)}
116
114
  `:""}${Z}
117
115
  `,X=this.value?F:u;switch(this.state){case"submit":{let H=E?`${x("gray",DD)} `:"";return`${J}${H}${x("dim",X)}`}case"cancel":{let H=E?`${x("gray",DD)} `:"";return`${J}${H}${x(["strikethrough","dim"],X)}${E?`
118
- ${x("gray",DD)}`:""}`}default:{let H=E?`${x("cyan",DD)} `:"",Y=E?x("cyan",Z2):"";return`${J}${H}${this.value?`${x("green",n1)} ${F}`:`${x("dim",o8)} ${x("dim",F)}`}${D.vertical?E?`
116
+ ${x("gray",DD)}`:""}`}default:{let H=E?`${x("cyan",DD)} `:"",Y=E?x("cyan",C2):"";return`${J}${H}${this.value?`${x("green",du)} ${F}`:`${x("dim",i8)} ${x("dim",F)}`}${D.vertical?E?`
119
117
  ${x("cyan",DD)} `:`
120
- `:` ${x("dim","/")} `}${this.value?`${x("dim",o8)} ${x("dim",u)}`:`${x("green",n1)} ${u}`}
118
+ `:` ${x("dim","/")} `}${this.value?`${x("dim",i8)} ${x("dim",u)}`:`${x("green",du)} ${u}`}
121
119
  ${Y}
122
120
  `}}}}).prompt()};var M0={message:(D=[],{symbol:F=x("gray",DD),secondarySymbol:u=x("gray",DD),output:E=process.stdout,spacing:B=1,withGuide:C}={})=>{let Z=[],J=C??AD.withGuide,X=J?u:"",H=J?`${F} `:"",Y=J?`${u} `:"";for(let K=0;K<B;K++)Z.push(X);let G=Array.isArray(D)?D:D.split(`
123
121
  `);if(G.length>0){let[K,...Q]=G;K.length>0?Z.push(`${H}${K}`):Z.push(J?F:"");for(let z of Q)z.length>0?Z.push(`${Y}${z}`):Z.push(J?u:"")}E.write(`${Z.join(`
124
122
  `)}
125
- `)},info:(D,F)=>{M0.message(D,{...F,symbol:x("blue",nA)})},success:(D,F)=>{M0.message(D,{...F,symbol:x("green",aA)})},step:(D,F)=>{M0.message(D,{...F,symbol:x("green",a1)})},warn:(D,F)=>{M0.message(D,{...F,symbol:x("yellow",rA)})},warning:(D,F)=>{M0.warn(D,F)},error:(D,F)=>{M0.message(D,{...F,symbol:x("red",sA)})}};var e8=(D="",F)=>{let u=F?.output??process.stdout,E=F?.withGuide??AD.withGuide?`${x("gray",iA)} `:"";u.write(`${E}${D}
126
- `)},J2=(D="",F)=>{let u=F?.output??process.stdout,E=F?.withGuide??AD.withGuide?`${x("gray",DD)}
127
- ${x("gray",Z2)} `:"";u.write(`${E}${D}
123
+ `)},info:(D,F)=>{M0.message(D,{...F,symbol:x("blue",YA)})},success:(D,F)=>{M0.message(D,{...F,symbol:x("green",XA)})},step:(D,F)=>{M0.message(D,{...F,symbol:x("green",cu)})},warn:(D,F)=>{M0.message(D,{...F,symbol:x("yellow",GA)})},warning:(D,F)=>{M0.warn(D,F)},error:(D,F)=>{M0.message(D,{...F,symbol:x("red",QA)})}};var a8=(D="",F)=>{let u=F?.output??process.stdout,E=F?.withGuide??AD.withGuide?`${x("gray",HA)} `:"";u.write(`${E}${D}
124
+ `)},Z2=(D="",F)=>{let u=F?.output??process.stdout,E=F?.withGuide??AD.withGuide?`${x("gray",DD)}
125
+ ${x("gray",C2)} `:"";u.write(`${E}${D}
128
126
 
129
- `)};var DU=(D)=>x("magenta",D),EZ=({indicator:D="dots",onCancel:F,output:u=process.stdout,cancelMessage:E,errorMessage:B,frames:C=i1?["◒","◐","◓","◑"]:["•","o","O","0"],delay:Z=i1?80:120,signal:J,...X}={})=>{let H=lA(),Y,G,K=!1,Q=!1,z="",q,U=performance.now(),N=r8(u),I=X?.styleFrame??DU,$=(R)=>{let S=R>1?B??AD.messages.error:E??AD.messages.cancel;Q=R===1,K&&(w(S,R),Q&&typeof F=="function"&&F())},W=()=>$(2),j=()=>$(1),P=()=>{process.on("uncaughtExceptionMonitor",W),process.on("unhandledRejection",W),process.on("SIGINT",j),process.on("SIGTERM",j),process.on("exit",$),J&&J.addEventListener("abort",j)},L=()=>{process.removeListener("uncaughtExceptionMonitor",W),process.removeListener("unhandledRejection",W),process.removeListener("SIGINT",j),process.removeListener("SIGTERM",j),process.removeListener("exit",$),J&&J.removeEventListener("abort",j)},v=()=>{if(q===void 0)return;H&&u.write(`
127
+ `)};var AA=(D)=>x("magenta",D),cC=({indicator:D="dots",onCancel:F,output:u=process.stdout,cancelMessage:E,errorMessage:B,frames:C=mu?["◒","◐","◓","◑"]:["•","o","O","0"],delay:Z=mu?80:120,signal:J,...X}={})=>{let H=ZA(),Y,G,K=!1,Q=!1,z="",q,U=performance.now(),N=l8(u),M=X?.styleFrame??AA,$=(R)=>{let S=R>1?B??AD.messages.error:E??AD.messages.cancel;Q=R===1,K&&(w(S,R),Q&&typeof F=="function"&&F())},W=()=>$(2),j=()=>$(1),P=()=>{process.on("uncaughtExceptionMonitor",W),process.on("unhandledRejection",W),process.on("SIGINT",j),process.on("SIGTERM",j),process.on("exit",$),J&&J.addEventListener("abort",j)},L=()=>{process.removeListener("uncaughtExceptionMonitor",W),process.removeListener("unhandledRejection",W),process.removeListener("SIGINT",j),process.removeListener("SIGTERM",j),process.removeListener("exit",$),J&&J.removeEventListener("abort",j)},v=()=>{if(q===void 0)return;H&&u.write(`
130
128
  `);let R=V0(q,N,{hard:!0,trim:!1}).split(`
131
- `);R.length>1&&u.write(C2.cursor.up(R.length-1)),u.write(C2.cursor.to(0)),u.write(C2.erase.down())},V=(R)=>R.replace(/\.+$/,""),O=(R)=>{let S=(performance.now()-R)/1000,b=Math.floor(S/60),f=Math.floor(S%60);return b>0?`[${b}m ${f}s]`:`[${f}s]`},_=X.withGuide??AD.withGuide,h=(R="")=>{K=!0,Y=oC({output:u}),z=V(R),U=performance.now(),_&&u.write(`${x("gray",DD)}
132
- `);let S=0,b=0;P(),G=setInterval(()=>{if(H&&z===q)return;v(),q=z;let f=I(C[S]),l;if(H)l=`${f} ${z}...`;else if(D==="timer")l=`${f} ${z} ${O(U)}`;else{let zu=".".repeat(Math.floor(b)).slice(0,3);l=`${f} ${z}${zu}`}let g=V0(l,N,{hard:!0,trim:!1});u.write(g),S=S+1<C.length?S+1:0,b=b<4?b+0.125:0},Z)},w=(R="",S=0,b=!1)=>{if(!K)return;K=!1,clearInterval(G),v();let f=S===0?x("green",a1):S===1?x("red",FZ):x("red",uZ);z=R??z,b||(D==="timer"?u.write(`${f} ${z} ${O(U)}
129
+ `);R.length>1&&u.write(B2.cursor.up(R.length-1)),u.write(B2.cursor.to(0)),u.write(B2.erase.down())},V=(R)=>R.replace(/\.+$/,""),_=(R)=>{let S=(performance.now()-R)/1000,b=Math.floor(S/60),f=Math.floor(S%60);return b>0?`[${b}m ${f}s]`:`[${f}s]`},O=X.withGuide??AD.withGuide,g=(R="")=>{K=!0,Y=fC({output:u}),z=V(R),U=performance.now(),O&&u.write(`${x("gray",DD)}
130
+ `);let S=0,b=0;P(),G=setInterval(()=>{if(H&&z===q)return;v(),q=z;let f=M(C[S]),l;if(H)l=`${f} ${z}...`;else if(D==="timer")l=`${f} ${z} ${_(U)}`;else{let I3=".".repeat(Math.floor(b)).slice(0,3);l=`${f} ${z}${I3}`}let m=V0(l,N,{hard:!0,trim:!1});u.write(m),S=S+1<C.length?S+1:0,b=b<4?b+0.125:0},Z)},w=(R="",S=0,b=!1)=>{if(!K)return;K=!1,clearInterval(G),v();let f=S===0?x("green",cu):S===1?x("red",mC):x("red",dC);z=R??z,b||(D==="timer"?u.write(`${f} ${z} ${_(U)}
133
131
  `):u.write(`${f} ${z}
134
- `)),L(),Y()};return{start:h,stop:(R="")=>w(R,0),message:(R="")=>{z=V(R??z)},cancel:(R="")=>w(R,1),error:(R="")=>w(R,2),clear:()=>w("",0,!0),get isCancelled(){return Q}}},aL={light:t("─","-"),heavy:t("━","="),block:t("█","#")};var s8=(D,F)=>D.includes(`
132
+ `)),L(),Y()};return{start:g,stop:(R="")=>w(R,0),message:(R="")=>{z=V(R??z)},cancel:(R="")=>w(R,1),error:(R="")=>w(R,2),clear:()=>w("",0,!0),get isCancelled(){return Q}}},j_={light:t("─","-"),heavy:t("━","="),block:t("█","#")};var p8=(D,F)=>D.includes(`
135
133
  `)?D.split(`
136
134
  `).map((u)=>F(u)).join(`
137
- `):F(D),BZ=(D)=>{let F=(u,E)=>{let B=u.label??String(u.value);switch(E){case"disabled":return`${x("gray",o8)} ${s8(B,(C)=>x("gray",C))}${u.hint?` ${x("dim",`(${u.hint??"disabled"})`)}`:""}`;case"selected":return`${s8(B,(C)=>x("dim",C))}`;case"active":return`${x("green",n1)} ${B}${u.hint?` ${x("dim",`(${u.hint})`)}`:""}`;case"cancelled":return`${s8(B,(C)=>x(["strikethrough","dim"],C))}`;default:return`${x("dim",o8)} ${s8(B,(C)=>x("dim",C))}`}};return new l1({options:D.options,signal:D.signal,input:D.input,output:D.output,initialValue:D.initialValue,render(){let u=D.withGuide??AD.withGuide,E=`${r1(this.state)} `,B=`${oA(this.state)} `,C=B2(D.output,D.message,B,E),Z=`${u?`${x("gray",DD)}
135
+ `):F(D),r8=(D)=>{let F=(u,E)=>{let B=u.label??String(u.value);switch(E){case"disabled":return`${x("gray",i8)} ${p8(B,(C)=>x("gray",C))}${u.hint?` ${x("dim",`(${u.hint??"disabled"})`)}`:""}`;case"selected":return`${p8(B,(C)=>x("dim",C))}`;case"active":return`${x("green",du)} ${B}${u.hint?` ${x("dim",`(${u.hint})`)}`:""}`;case"cancelled":return`${p8(B,(C)=>x(["strikethrough","dim"],C))}`;default:return`${x("dim",i8)} ${p8(B,(C)=>x("dim",C))}`}};return new hu({options:D.options,signal:D.signal,input:D.input,output:D.output,initialValue:D.initialValue,render(){let u=D.withGuide??AD.withGuide,E=`${lu(this.state)} `,B=`${KA(this.state)} `,C=E2(D.output,D.message,B,E),Z=`${u?`${x("gray",DD)}
138
136
  `:""}${C}
139
- `;switch(this.state){case"submit":{let J=u?`${x("gray",DD)} `:"",X=B2(D.output,F(this.options[this.cursor],"selected"),J);return`${Z}${X}`}case"cancel":{let J=u?`${x("gray",DD)} `:"",X=B2(D.output,F(this.options[this.cursor],"cancelled"),J);return`${Z}${X}${u?`
140
- ${x("gray",DD)}`:""}`}default:{let J=u?`${x("cyan",DD)} `:"",X=u?x("cyan",Z2):"",H=Z.split(`
141
- `).length,Y=u?2:1;return`${Z}${J}${eA({output:D.output,cursor:this.cursor,options:this.options,maxItems:D.maxItems,columnPadding:J.length,rowPadding:H+Y,style:(G,K)=>F(G,G.disabled?"disabled":K?"active":"inactive")}).join(`
137
+ `;switch(this.state){case"submit":{let J=u?`${x("gray",DD)} `:"",X=E2(D.output,F(this.options[this.cursor],"selected"),J);return`${Z}${X}`}case"cancel":{let J=u?`${x("gray",DD)} `:"",X=E2(D.output,F(this.options[this.cursor],"cancelled"),J);return`${Z}${X}${u?`
138
+ ${x("gray",DD)}`:""}`}default:{let J=u?`${x("cyan",DD)} `:"",X=u?x("cyan",C2):"",H=Z.split(`
139
+ `).length,Y=u?2:1;return`${Z}${J}${qA({output:D.output,cursor:this.cursor,options:this.options,maxItems:D.maxItems,columnPadding:J.length,rowPadding:H+Y,style:(G,K)=>F(G,G.disabled?"disabled":K?"active":"inactive")}).join(`
142
140
  ${J}`)}
143
141
  ${X}
144
- `}}}}).prompt()};var rL=`${x("gray",DD)} `;var K0=(D)=>new p1({validate:D.validate,placeholder:D.placeholder,defaultValue:D.defaultValue,initialValue:D.initialValue,output:D.output,signal:D.signal,input:D.input,render(){let F=D?.withGuide??AD.withGuide,u=`${`${F?`${x("gray",DD)}
145
- `:""}${r1(this.state)} `}${D.message}
146
- `,E=D.placeholder?x("inverse",D.placeholder[0])+x("dim",D.placeholder.slice(1)):x(["inverse","hidden"],"_"),B=this.userInput?this.userInputWithCursor:E,C=this.value??"";switch(this.state){case"error":{let Z=this.error?` ${x("yellow",this.error)}`:"",J=F?`${x("yellow",DD)} `:"",X=F?x("yellow",Z2):"";return`${u.trim()}
142
+ `}}}}).prompt()};var S_=`${x("gray",DD)} `;var Q0=(D)=>new gu({validate:D.validate,placeholder:D.placeholder,defaultValue:D.defaultValue,initialValue:D.initialValue,output:D.output,signal:D.signal,input:D.input,render(){let F=D?.withGuide??AD.withGuide,u=`${`${F?`${x("gray",DD)}
143
+ `:""}${lu(this.state)} `}${D.message}
144
+ `,E=D.placeholder?x("inverse",D.placeholder[0])+x("dim",D.placeholder.slice(1)):x(["inverse","hidden"],"_"),B=this.userInput?this.userInputWithCursor:E,C=this.value??"";switch(this.state){case"error":{let Z=this.error?` ${x("yellow",this.error)}`:"",J=F?`${x("yellow",DD)} `:"",X=F?x("yellow",C2):"";return`${u.trim()}
147
145
  ${J}${B}
148
146
  ${X}${Z}
149
147
  `}case"submit":{let Z=C?` ${x("dim",C)}`:"",J=F?x("gray",DD):"";return`${u}${J}${Z}`}case"cancel":{let Z=C?` ${x(["strikethrough","dim"],C)}`:"",J=F?x("gray",DD):"";return`${u}${J}${Z}${C.trim()?`
150
- ${J}`:""}`}default:{let Z=F?`${x("cyan",DD)} `:"",J=F?x("cyan",Z2):"";return`${u}${Z}${B}
148
+ ${J}`:""}`}default:{let Z=F?`${x("cyan",DD)} `:"",J=F?x("cyan",C2):"";return`${u}${Z}${B}
151
149
  ${J}
152
- `}}}}).prompt();var Du=Symbol.for("better-auth:broadcast-channel"),FU=()=>Math.floor(Date.now()/1000),uU=class{listeners=new Set;name;constructor(D="better-auth.message"){this.name=D}subscribe(D){return this.listeners.add(D),()=>{this.listeners.delete(D)}}post(D){if(typeof window>"u")return;try{localStorage.setItem(this.name,JSON.stringify({...D,timestamp:FU()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};let D=(F)=>{if(F.key!==this.name)return;let u=JSON.parse(F.newValue??"{}");if(u?.event!=="session"||!u?.data)return;this.listeners.forEach((E)=>E(u))};return window.addEventListener("storage",D),()=>{window.removeEventListener("storage",D)}}};function H2(D="better-auth.message"){if(!globalThis[Du])globalThis[Du]=new uU(D);return globalThis[Du]}var Fu=Symbol.for("better-auth:focus-manager"),EU=class{listeners=new Set;subscribe(D){return this.listeners.add(D),()=>{this.listeners.delete(D)}}setFocused(D){this.listeners.forEach((F)=>F(D))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};let D=()=>{if(document.visibilityState==="visible")this.setFocused(!0)};return document.addEventListener("visibilitychange",D,!1),()=>{document.removeEventListener("visibilitychange",D,!1)}}};function s1(){if(!globalThis[Fu])globalThis[Fu]=new EU;return globalThis[Fu]}var uu=Symbol.for("better-auth:online-manager"),BU=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(D){return this.listeners.add(D),()=>{this.listeners.delete(D)}}setOnline(D){this.isOnline=D,this.listeners.forEach((F)=>F(D))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};let D=()=>this.setOnline(!0),F=()=>this.setOnline(!1);return window.addEventListener("online",D,!1),window.addEventListener("offline",F,!1),()=>{window.removeEventListener("online",D,!1),window.removeEventListener("offline",F,!1)}}};function Eu(){if(!globalThis[uu])globalThis[uu]=new BU;return globalThis[uu]}var Y2=Symbol("clean");var aD=[],T0=0,Bu=4,CU=globalThis.nanostoresGlobal||={epoch:0},X2=(D)=>{let F=[],u={get(){if(!u.lc)u.listen(()=>{})();return u.value},init:D,lc:0,listen(E){return u.lc=F.push(E),()=>{for(let C=T0+Bu;C<aD.length;)if(aD[C]===E)aD.splice(C,Bu);else C+=Bu;let B=F.indexOf(E);if(~B){if(F.splice(B,1),!--u.lc)u.off()}}},notify(E,B){CU.epoch++;let C=!aD.length;for(let Z of F)aD.push(Z,u.value,E,B);if(C){for(T0=0;T0<aD.length;T0+=Bu)aD[T0](aD[T0+1],aD[T0+2],aD[T0+3]);aD.length=0}},off(){},set(E){let B=u.value;if(B!==E)u.value=E,u.notify(B)},subscribe(E){let B=u.listen(E);return E(u.value),B},value:D};return u[Y2]=()=>{F=[],u.lc=0,u.off()},u};var ZU=5,NF=6,Cu=10,JU=(D,F,u,E)=>{if(D.events=D.events||{},!D.events[u+Cu])D.events[u+Cu]=E((B)=>{D.events[u].reduceRight((C,Z)=>(Z(C),C),{shared:{},...B})});return D.events[u]=D.events[u]||[],D.events[u].push(F),()=>{let B=D.events[u],C=B.indexOf(F);if(B.splice(C,1),!B.length)delete D.events[u],D.events[u+Cu](),delete D.events[u+Cu]}};var CZ=1000,G2=(D,F)=>{return JU(D,(E)=>{let B=F(E);if(B)D.events[NF].push(B)},ZU,(E)=>{let B=D.listen;D.listen=(...Z)=>{if(!D.lc&&!D.active)D.active=!0,E();return B(...Z)};let C=D.off;D.events[NF]=[],D.off=()=>{C(),setTimeout(()=>{if(D.active&&!D.lc){D.active=!1;for(let Z of D.events[NF])Z();D.events[NF]=[]}},CZ)};{let Z=D[Y2];D[Y2]=()=>{for(let J of D.events[NF])J();D.events[NF]=[],D.active=!1,Z()}}return()=>{D.listen=B,D.off=C}})};var HU=()=>typeof window>"u",Zu=(D,F,u,E)=>{let B=X2({data:null,error:null,isPending:!0,isRefetching:!1,refetch:(J)=>C(J)}),C=async(J)=>{return new Promise((X)=>{let H=typeof E==="function"?E({data:B.get().data,error:B.get().error,isPending:B.get().isPending}):E;u(F,{...H,query:{...H?.query,...J?.query},async onSuccess(Y){B.set({data:Y.data,error:null,isPending:!1,isRefetching:!1,refetch:B.value.refetch}),await H?.onSuccess?.(Y)},async onError(Y){let{request:G}=Y,K=typeof G.retry==="number"?G.retry:G.retry?.attempts,Q=G.retryAttempt||0;if(K&&Q<K)return;B.set({error:Y.error,data:null,isPending:!1,isRefetching:!1,refetch:B.value.refetch}),await H?.onError?.(Y)},async onRequest(Y){let G=B.get();B.set({isPending:G.data===null,data:G.data,error:null,isRefetching:!0,refetch:B.value.refetch}),await H?.onRequest?.(Y)}}).catch((Y)=>{B.set({error:Y,data:null,isPending:!1,isRefetching:!1,refetch:B.value.refetch})}).finally(()=>{X(void 0)})})};D=Array.isArray(D)?D:[D];let Z=!1;for(let J of D)J.subscribe(async()=>{if(HU())return;if(Z)await C();else G2(B,()=>{let X=setTimeout(async()=>{if(!Z)await C(),Z=!0},0);return()=>{B.off(),J.off(),clearTimeout(X)}})});return B};var $F=()=>Math.floor(Date.now()/1000),YU=5;function o1(D){let{sessionAtom:F,sessionSignal:u,$fetch:E,options:B={}}=D,C=B.sessionOptions?.refetchInterval??0,Z=B.sessionOptions?.refetchOnWindowFocus??!0,J=B.sessionOptions?.refetchWhenOffline??!1,X={lastSync:0,lastSessionRequest:0,cachedSession:void 0},H=()=>{return J||Eu().isOnline},Y=(I)=>{if(!H())return;if(I?.event==="storage"){X.lastSync=$F(),u.set(!u.get());return}let $=F.get();if(I?.event==="poll"){X.lastSessionRequest=$F(),E("/get-session").then((W)=>{if(W.error)F.set({...$,data:null,error:W.error});else F.set({...$,data:W.data,error:null});X.lastSync=$F(),u.set(!u.get())}).catch(()=>{});return}if(I?.event==="visibilitychange"){if($F()-X.lastSessionRequest<YU)return;X.lastSessionRequest=$F()}if($?.data===null||$?.data===void 0||I?.event==="visibilitychange")X.lastSync=$F(),u.set(!u.get())},G=(I)=>{H2().post({event:"session",data:{trigger:I},clientId:Math.random().toString(36).substring(7)})},K=()=>{if(C&&C>0)X.pollInterval=setInterval(()=>{if(F.get()?.data)Y({event:"poll"})},C*1000)},Q=()=>{X.unsubscribeBroadcast=H2().subscribe(()=>{Y({event:"storage"})})},z=()=>{if(!Z)return;X.unsubscribeFocus=s1().subscribe(()=>{Y({event:"visibilitychange"})})},q=()=>{X.unsubscribeOnline=Eu().subscribe((I)=>{if(I)Y({event:"visibilitychange"})})};return{init:()=>{K(),Q(),z(),q(),H2().setup(),s1().setup(),Eu().setup()},cleanup:()=>{if(X.pollInterval)clearInterval(X.pollInterval),X.pollInterval=void 0;if(X.unsubscribeBroadcast)X.unsubscribeBroadcast(),X.unsubscribeBroadcast=void 0;if(X.unsubscribeFocus)X.unsubscribeFocus(),X.unsubscribeFocus=void 0;if(X.unsubscribeOnline)X.unsubscribeOnline(),X.unsubscribeOnline=void 0;X.lastSync=0,X.lastSessionRequest=0,X.cachedSession=void 0},triggerRefetch:Y,broadcastSessionUpdate:G}}var Ju=Object.create(null),Q2=(D)=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(D?Ju:globalThis),jD=new Proxy(Ju,{get(D,F){return Q2()[F]??Ju[F]},has(D,F){return F in Q2()||F in Ju},set(D,F,u){let E=Q2(!0);return E[F]=u,!0},deleteProperty(D,F){if(!F)return!1;let u=Q2(!0);return delete u[F],!0},ownKeys(){let D=Q2(!0);return Object.keys(D)}});var XU=typeof process<"u"&&process.env&&"development"||"";function o(D,F){if(typeof process<"u"&&process.env)return process.env[D]??F;if(typeof Deno<"u")return Deno.env.get(D)??F;if(typeof Bun<"u")return Bun.env[D]??F;return F}var GU=Object.freeze({get BETTER_AUTH_SECRET(){return o("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return o("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return o("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return o("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return o("NODE_ENV","development")},get PACKAGE_VERSION(){return o("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return o("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});var K2=1,XD=4,C0=8,fD=24,ZZ={eterm:XD,cons25:XD,console:XD,cygwin:XD,dtterm:XD,gnome:XD,hurd:XD,jfbterm:XD,konsole:XD,kterm:XD,mlterm:XD,mosh:fD,putty:XD,st:XD,"rxvt-unicode-24bit":fD,terminator:fD,"xterm-kitty":fD},QU=new Map(Object.entries({APPVEYOR:C0,BUILDKITE:C0,CIRCLECI:fD,DRONE:C0,GITEA_ACTIONS:fD,GITHUB_ACTIONS:fD,GITLAB_CI:C0,TRAVIS:C0})),KU=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function t1(){if(o("FORCE_COLOR")!==void 0)switch(o("FORCE_COLOR")){case"":case"1":case"true":return XD;case"2":return C0;case"3":return fD;default:return K2}if(o("NODE_DISABLE_COLORS")!==void 0&&o("NODE_DISABLE_COLORS")!==""||o("NO_COLOR")!==void 0&&o("NO_COLOR")!==""||o("TERM")==="dumb")return K2;if(o("TMUX"))return fD;if("TF_BUILD"in jD&&"AGENT_NAME"in jD)return XD;if("CI"in jD){for(let{0:D,1:F}of QU)if(D in jD)return F;if(o("CI_NAME")==="codeship")return C0;return K2}if("TEAMCITY_VERSION"in jD)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(o("TEAMCITY_VERSION"))!==null?XD:K2;switch(o("TERM_PROGRAM")){case"iTerm.app":if(!o("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(o("TERM_PROGRAM_VERSION"))!==null)return C0;return fD;case"HyperTerm":case"MacTerm":return fD;case"Apple_Terminal":return C0}if(o("COLORTERM")==="truecolor"||o("COLORTERM")==="24bit")return fD;if(o("TERM")){if(/truecolor/.exec(o("TERM"))!==null)return fD;if(/^xterm-256/.exec(o("TERM"))!==null)return C0;let D=o("TERM").toLowerCase();if(ZZ[D])return ZZ[D];if(KU.some((F)=>F.exec(D)!==null))return XD}if(o("COLORTERM"))return XD;return K2}var rD={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",undim:"\x1B[22m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",fg:{black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},bg:{black:"\x1B[40m",red:"\x1B[41m",green:"\x1B[42m",yellow:"\x1B[43m",blue:"\x1B[44m",magenta:"\x1B[45m",cyan:"\x1B[46m",white:"\x1B[47m"}},Hu=["debug","info","success","warn","error"];function JZ(D,F){return Hu.indexOf(F)>=Hu.indexOf(D)}var zU={info:rD.fg.blue,success:rD.fg.green,warn:rD.fg.yellow,error:rD.fg.red,debug:rD.fg.magenta},qU=(D,F,u)=>{let E=new Date().toISOString();if(u)return`${rD.dim}${E}${rD.reset} ${zU[D]}${D.toUpperCase()}${rD.reset} ${rD.bright}[Better Auth]:${rD.reset} ${F}`;return`${E} ${D.toUpperCase()} [Better Auth]: ${F}`},HZ=(D)=>{let F=D?.disabled!==!0,u=D?.level??"warn",E=D?.disableColors!==void 0?!D.disableColors:t1()!==1,B=(C,Z,J=[])=>{if(!F||!JZ(u,C))return;let X=qU(C,Z,E);if(!D||typeof D.log!=="function"){if(C==="error")console.error(X,...J);else if(C==="warn")console.warn(X,...J);else console.log(X,...J);return}D.log(C==="success"?"info":C,Z,...J)};return{...Object.fromEntries(Hu.map((C)=>[C,(...[Z,...J])=>B(C,Z,J)])),get level(){return u}}},YZ=HZ();function e1(D){return D}function D6(D){return D.charAt(0).toUpperCase()+D.slice(1)}var AU=e1({USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account.",CROSS_SITE_NAVIGATION_LOGIN_BLOCKED:"Cross-site navigation login blocked. This request appears to be a CSRF attack.",VERIFICATION_EMAIL_NOT_ENABLED:"Verification email isn't enabled",EMAIL_ALREADY_VERIFIED:"Email is already verified",EMAIL_MISMATCH:"Email mismatch",SESSION_NOT_FRESH:"Session is not fresh",LINKED_ACCOUNT_ALREADY_EXISTS:"Linked account already exists",INVALID_ORIGIN:"Invalid origin",INVALID_CALLBACK_URL:"Invalid callbackURL",INVALID_REDIRECT_URL:"Invalid redirectURL",INVALID_ERROR_CALLBACK_URL:"Invalid errorCallbackURL",INVALID_NEW_USER_CALLBACK_URL:"Invalid newUserCallbackURL",MISSING_OR_NULL_ORIGIN:"Missing or null Origin",CALLBACK_URL_REQUIRED:"callbackURL is required",FAILED_TO_CREATE_VERIFICATION:"Unable to create verification",FIELD_NOT_ALLOWED:"Field not allowed to be set",ASYNC_VALIDATION_NOT_SUPPORTED:"Async validation is not supported",VALIDATION_ERROR:"Validation Error",MISSING_FIELD:"Field is required"});var _0=class extends Error{constructor(D,F){super(D,F);this.name="BetterAuthError",this.message=D,this.stack=""}};function UU(D){try{return(new URL(D).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new _0(`Invalid base URL: ${D}. Please provide a valid base URL.`)}}function WU(D){try{let F=new URL(D);if(F.protocol!=="http:"&&F.protocol!=="https:")throw new _0(`Invalid base URL: ${D}. URL must include 'http://' or 'https://'`)}catch(F){if(F instanceof _0)throw F;throw new _0(`Invalid base URL: ${D}. Please provide a valid base URL.`,{cause:F})}}function z2(D,F="/api/auth"){if(WU(D),UU(D))return D;let u=D.replace(/\/+$/,"");if(!F||F==="/")return u;return F=F.startsWith("/")?F:`/${F}`,`${u}${F}`}function XZ(D,F){if(!D||D.trim()==="")return!1;if(F==="proto")return D==="http"||D==="https";if(F==="host"){if([/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some((u)=>u.test(D)))return!1;return/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(D)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(D)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(D)||/^localhost(:[0-9]{1,5})?$/i.test(D)}return!1}function GZ(D,F,u,E,B){if(D)return z2(D,F);if(E!==!1){let J=jD.BETTER_AUTH_URL||jD.NEXT_PUBLIC_BETTER_AUTH_URL||jD.PUBLIC_BETTER_AUTH_URL||jD.NUXT_PUBLIC_BETTER_AUTH_URL||jD.NUXT_PUBLIC_AUTH_URL||(jD.BASE_URL!=="/"?jD.BASE_URL:void 0);if(J)return z2(J,F)}let C=u?.headers.get("x-forwarded-host"),Z=u?.headers.get("x-forwarded-proto");if(C&&Z&&B){if(XZ(Z,"proto")&&XZ(C,"host"))try{return z2(`${Z}://${C}`,F)}catch(J){}}if(u){let J=NU(u.url);if(!J)throw new _0("Could not get origin from request. Please provide a valid base URL.");return z2(J,F)}if(typeof window<"u"&&window.location)return z2(window.location.origin,F)}function NU(D){try{let F=new URL(D);return F.origin==="null"?null:F.origin}catch{return null}}var QZ={id:"redirect",name:"Redirect",hooks:{onSuccess(D){if(D.data?.url&&D.data?.redirect){if(typeof window<"u"&&window.location){if(window.location)try{window.location.href=D.data.url}catch{}}}}}};var $U={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},VU=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,KZ={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},IU=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function MU(D){return D instanceof Date&&!isNaN(D.getTime())}function TU(D){let F=IU.exec(D);if(!F)return null;let[,u,E,B,C,Z,J,X,H,Y,G]=F,K=new Date(Date.UTC(parseInt(u,10),parseInt(E,10)-1,parseInt(B,10),parseInt(C,10),parseInt(Z,10),parseInt(J,10),X?parseInt(X.padEnd(3,"0"),10):0));if(H){let Q=(parseInt(Y,10)*60+parseInt(G,10))*(H==="+"?-1:1);K.setUTCMinutes(K.getUTCMinutes()+Q)}return MU(K)?K:null}function _U(D,F={}){let{strict:u=!1,warnings:E=!1,reviver:B,parseDates:C=!0}=F;if(typeof D!=="string")return D;let Z=D.trim();if(Z.length>0&&Z[0]==='"'&&Z.endsWith('"')&&!Z.slice(1,-1).includes('"'))return Z.slice(1,-1);let J=Z.toLowerCase();if(J.length<=9&&J in KZ)return KZ[J];if(!VU.test(Z)){if(u)throw SyntaxError("[better-json] Invalid JSON");return D}if(Object.entries($U).some(([X,H])=>{let Y=H.test(Z);if(Y&&E)console.warn(`[better-json] Detected potential prototype pollution attempt using ${X} pattern`);return Y})&&u)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(Z,(H,Y)=>{if(H==="__proto__"||H==="constructor"&&Y&&typeof Y==="object"&&"prototype"in Y){if(E)console.warn(`[better-json] Dropping "${H}" key to prevent prototype pollution`);return}if(C&&typeof Y==="string"){let G=TU(Y);if(G)return G}return B?B(H,Y):Y})}catch(X){if(u)throw X;return D}}function zZ(D,F={strict:!0}){return _U(D,F)}function qZ(D,F){let u=X2(!1),E=Zu(u,"/get-session",D,{method:"GET"});return G2(E,()=>{let B=o1({sessionAtom:E,sessionSignal:u,$fetch:D,options:F});return B.init(),()=>{B.cleanup()}}),{session:E,$sessionSignal:u}}function F6(D){if(D===null||typeof D!=="object")return!1;let F=Object.getPrototypeOf(D);if(F!==null&&F!==Object.prototype&&Object.getPrototypeOf(F)!==null)return!1;if(Symbol.iterator in D)return!1;if(Symbol.toStringTag in D)return Object.prototype.toString.call(D)==="[object Module]";return!0}function u6(D,F,u=".",E){if(!F6(F))return u6(D,{},u,E);let B={...F};for(let C of Object.keys(D)){if(C==="__proto__"||C==="constructor")continue;let Z=D[C];if(Z===null||Z===void 0)continue;if(E&&E(B,C,Z,u))continue;if(Array.isArray(Z)&&Array.isArray(B[C]))B[C]=[...Z,...B[C]];else if(F6(Z)&&F6(B[C]))B[C]=u6(Z,B[C],(u?`${u}.`:"")+C.toString(),E);else B[C]=Z}return B}function E6(D){return(...F)=>F.reduce((u,E)=>u6(u,E,"",D),{})}var AZ=E6(),FS=E6((D,F,u)=>{if(D[F]!==void 0&&typeof u==="function")return D[F]=u(D[F]),!0}),uS=E6((D,F,u)=>{if(Array.isArray(D[F])&&typeof u==="function")return D[F]=u(D[F]),!0});var{defineProperty:OU,defineProperties:LU,getOwnPropertyDescriptors:RU,getOwnPropertySymbols:UZ}=Object,jU=Object.prototype.hasOwnProperty,SU=Object.prototype.propertyIsEnumerable,WZ=(D,F,u)=>(F in D)?OU(D,F,{enumerable:!0,configurable:!0,writable:!0,value:u}):D[F]=u,sD=(D,F)=>{for(var u in F||(F={}))if(jU.call(F,u))WZ(D,u,F[u]);if(UZ){for(var u of UZ(F))if(SU.call(F,u))WZ(D,u,F[u])}return D},Z0=(D,F)=>LU(D,RU(F)),PU=class extends Error{constructor(D,F,u){super(F||D.toString(),{cause:u});this.status=D,this.statusText=F,this.error=u,Error.captureStackTrace(this,this.constructor)}},wU=async(D,F)=>{var u,E,B,C,Z,J;let X=F||{},H={onRequest:[F==null?void 0:F.onRequest],onResponse:[F==null?void 0:F.onResponse],onSuccess:[F==null?void 0:F.onSuccess],onError:[F==null?void 0:F.onError],onRetry:[F==null?void 0:F.onRetry]};if(!F||!(F==null?void 0:F.plugins))return{url:D,options:X,hooks:H};for(let Y of(F==null?void 0:F.plugins)||[]){if(Y.init){let G=await((u=Y.init)==null?void 0:u.call(Y,D.toString(),F));X=G.options||X,D=G.url}H.onRequest.push((E=Y.hooks)==null?void 0:E.onRequest),H.onResponse.push((B=Y.hooks)==null?void 0:B.onResponse),H.onSuccess.push((C=Y.hooks)==null?void 0:C.onSuccess),H.onError.push((Z=Y.hooks)==null?void 0:Z.onError),H.onRetry.push((J=Y.hooks)==null?void 0:J.onRetry)}return{url:D,options:X,hooks:H}},NZ=class{constructor(D){this.options=D}shouldAttemptRetry(D,F){if(this.options.shouldRetry)return Promise.resolve(D<this.options.attempts&&this.options.shouldRetry(F));return Promise.resolve(D<this.options.attempts)}getDelay(){return this.options.delay}},xU=class{constructor(D){this.options=D}shouldAttemptRetry(D,F){if(this.options.shouldRetry)return Promise.resolve(D<this.options.attempts&&this.options.shouldRetry(F));return Promise.resolve(D<this.options.attempts)}getDelay(D){return Math.min(this.options.maxDelay,this.options.baseDelay*2**D)}};function kU(D){if(typeof D==="number")return new NZ({type:"linear",attempts:D,delay:1000});switch(D.type){case"linear":return new NZ(D);case"exponential":return new xU(D);default:throw Error("Invalid retry strategy")}}var yU=async(D)=>{let F={},u=async(E)=>typeof E==="function"?await E():E;if(D==null?void 0:D.auth){if(D.auth.type==="Bearer"){let E=await u(D.auth.token);if(!E)return F;F.authorization=`Bearer ${E}`}else if(D.auth.type==="Basic"){let[E,B]=await Promise.all([u(D.auth.username),u(D.auth.password)]);if(!E||!B)return F;F.authorization=`Basic ${btoa(`${E}:${B}`)}`}else if(D.auth.type==="Custom"){let[E,B]=await Promise.all([u(D.auth.prefix),u(D.auth.value)]);if(!B)return F;F.authorization=`${E!=null?E:""} ${B}`}}return F},bU=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function fU(D){let F=D.headers.get("content-type"),u=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!F)return"json";let E=F.split(";").shift()||"";if(bU.test(E))return"json";if(u.has(E)||E.startsWith("text/"))return"text";return"blob"}function vU(D){try{return JSON.parse(D),!0}catch(F){return!1}}function B6(D){if(D===void 0)return!1;let F=typeof D;if(F==="string"||F==="number"||F==="boolean"||F===null)return!0;if(F!=="object")return!1;if(Array.isArray(D))return!0;if(D.buffer)return!1;return D.constructor&&D.constructor.name==="Object"||typeof D.toJSON==="function"}function $Z(D){try{return JSON.parse(D)}catch(F){return D}}function VZ(D){return typeof D==="function"}function hU(D){if(D==null?void 0:D.customFetchImpl)return D.customFetchImpl;if(typeof globalThis<"u"&&VZ(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&VZ(window.fetch))return window.fetch;throw Error("No fetch implementation found")}async function gU(D){let F=new Headers(D==null?void 0:D.headers),u=await yU(D);for(let[E,B]of Object.entries(u||{}))F.set(E,B);if(!F.has("content-type")){let E=mU(D==null?void 0:D.body);if(E)F.set("content-type",E)}return F}function mU(D){if(B6(D))return"application/json";return null}function dU(D){if(!(D==null?void 0:D.body))return null;let F=new Headers(D==null?void 0:D.headers);if(B6(D.body)&&!F.has("content-type")){for(let[u,E]of Object.entries(D==null?void 0:D.body))if(E instanceof Date)D.body[u]=E.toISOString();return JSON.stringify(D.body)}if(F.has("content-type")&&F.get("content-type")==="application/x-www-form-urlencoded"){if(B6(D.body))return new URLSearchParams(D.body).toString();return D.body}return D.body}function cU(D,F){var u;if(F==null?void 0:F.method)return F.method.toUpperCase();if(D.startsWith("@")){let E=(u=D.split("@")[1])==null?void 0:u.split("/")[0];if(!IZ.includes(E))return(F==null?void 0:F.body)?"POST":"GET";return E.toUpperCase()}return(F==null?void 0:F.body)?"POST":"GET"}function lU(D,F){let u;if(!(D==null?void 0:D.signal)&&(D==null?void 0:D.timeout))u=setTimeout(()=>F==null?void 0:F.abort(),D==null?void 0:D.timeout);return{abortTimeout:u,clearTimeout:()=>{if(u)clearTimeout(u)}}}var pU=class D extends Error{constructor(F,u){super(u||JSON.stringify(F,null,2));this.issues=F,Object.setPrototypeOf(this,D.prototype)}};async function Yu(D,F){let u=await D["~standard"].validate(F);if(u.issues)throw new pU(u.issues);return u.value}var IZ=["get","post","put","patch","delete"];var iU=(D)=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(F,u){var E,B,C,Z;let J=((B=(E=D.plugins)==null?void 0:E.find((X)=>{var H;return((H=X.schema)==null?void 0:H.config)?F.startsWith(X.schema.config.baseURL||"")||F.startsWith(X.schema.config.prefix||""):!1}))==null?void 0:B.schema)||D.schema;if(J){let X=F;if((C=J.config)==null?void 0:C.prefix){if(X.startsWith(J.config.prefix)){if(X=X.replace(J.config.prefix,""),J.config.baseURL)F=F.replace(J.config.prefix,J.config.baseURL)}}if((Z=J.config)==null?void 0:Z.baseURL){if(X.startsWith(J.config.baseURL))X=X.replace(J.config.baseURL,"")}let H=J.schema[X];if(H){let Y=Z0(sD({},u),{method:H.method,output:H.output});if(!(u==null?void 0:u.disableValidation))Y=Z0(sD({},Y),{body:H.input?await Yu(H.input,u==null?void 0:u.body):u==null?void 0:u.body,params:H.params?await Yu(H.params,u==null?void 0:u.params):u==null?void 0:u.params,query:H.query?await Yu(H.query,u==null?void 0:u.query):u==null?void 0:u.query});return{url:F,options:Y}}}return{url:F,options:u}}}),MZ=(D)=>{async function F(u,E){let B=Z0(sD(sD({},D),E),{plugins:[...(D==null?void 0:D.plugins)||[],iU(D||{}),...(E==null?void 0:E.plugins)||[]]});if(D==null?void 0:D.catchAllError)try{return await C6(u,B)}catch(C){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:C}}}return await C6(u,B)}return F};function nU(D,F){let{baseURL:u,params:E,query:B}=F||{query:{},params:{},baseURL:""},C=D.startsWith("http")?D.split("/").slice(0,3).join("/"):u||"";if(D.startsWith("@")){let G=D.toString().split("@")[1].split("/")[0];if(IZ.includes(G))D=D.replace(`@${G}/`,"/")}if(!C.endsWith("/"))C+="/";let[Z,J]=D.replace(C,"").split("?"),X=new URLSearchParams(J);for(let[G,K]of Object.entries(B||{})){if(K==null)continue;let Q;if(typeof K==="string")Q=K;else if(Array.isArray(K)){for(let z of K)X.append(G,z);continue}else Q=JSON.stringify(K);X.set(G,Q)}if(E)if(Array.isArray(E)){let G=Z.split("/").filter((K)=>K.startsWith(":"));for(let[K,Q]of G.entries()){let z=E[K];Z=Z.replace(Q,z)}}else for(let[G,K]of Object.entries(E))Z=Z.replace(`:${G}`,String(K));if(Z=Z.split("/").map(encodeURIComponent).join("/"),Z.startsWith("/"))Z=Z.slice(1);let H=X.toString();if(H=H.length>0?`?${H}`.replace(/\+/g,"%20"):"",!C.startsWith("http"))return`${C}${Z}${H}`;return new URL(`${Z}${H}`,C)}var C6=async(D,F)=>{var u,E,B,C,Z,J,X,H;let{hooks:Y,url:G,options:K}=await wU(D,F),Q=hU(K),z=new AbortController,q=(u=K.signal)!=null?u:z.signal,U=nU(G,K),N=dU(K),I=await gU(K),$=cU(G,K),W=Z0(sD({},K),{url:U,headers:I,body:N,method:$,signal:q});for(let w of Y.onRequest)if(w){let R=await w(W);if(typeof R==="object"&&R!==null)W=R}if("pipeTo"in W&&typeof W.pipeTo==="function"||typeof((E=F==null?void 0:F.body)==null?void 0:E.pipe)==="function"){if(!("duplex"in W))W.duplex="half"}let{clearTimeout:j}=lU(K,z),P=await Q(W.url,W);j();let L={response:P,request:W};for(let w of Y.onResponse)if(w){let R=await w(Z0(sD({},L),{response:((B=F==null?void 0:F.hookOptions)==null?void 0:B.cloneResponse)?P.clone():P}));if(R instanceof Response)P=R;else if(typeof R==="object"&&R!==null)P=R.response}if(P.ok){if(W.method==="HEAD")return{data:"",error:null};let R=fU(P),S={data:null,response:P,request:W};if(R==="json"||R==="text"){let b=await P.text(),f=(C=W.jsonParser)!=null?C:$Z;S.data=await f(b)}else S.data=await P[R]();if(W==null?void 0:W.output){if(W.output&&!W.disableValidation)S.data=await Yu(W.output,S.data)}for(let b of Y.onSuccess)if(b)await b(Z0(sD({},S),{response:((Z=F==null?void 0:F.hookOptions)==null?void 0:Z.cloneResponse)?P.clone():P}));if(F==null?void 0:F.throw)return S.data;return{data:S.data,error:null}}let v=(J=F==null?void 0:F.jsonParser)!=null?J:$Z,V=await P.text(),O=vU(V),_=O?await v(V):null,h={response:P,responseText:V,request:W,error:Z0(sD({},_),{status:P.status,statusText:P.statusText})};for(let w of Y.onError)if(w)await w(Z0(sD({},h),{response:((X=F==null?void 0:F.hookOptions)==null?void 0:X.cloneResponse)?P.clone():P}));if(F==null?void 0:F.retry){let w=kU(F.retry),R=(H=F.retryAttempt)!=null?H:0;if(await w.shouldAttemptRetry(R,P)){for(let b of Y.onRetry)if(b)await b(L);let S=w.getDelay(R);return await new Promise((b)=>setTimeout(b,S)),await C6(D,Z0(sD({},F),{retryAttempt:R+1}))}}if(F==null?void 0:F.throw)throw new PU(P.status,P.statusText,O?_:V);return{data:null,error:Z0(sD({},_),{status:P.status,statusText:P.statusText})}};var TZ=(D,F)=>{let u="credentials"in Request.prototype,E=GZ(D?.baseURL,D?.basePath,void 0,F)??"/api/auth",B=D?.plugins?.flatMap((W)=>W.fetchPlugins).filter((W)=>W!==void 0)||[],C={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:D?.fetchOptions?.onSuccess,onError:D?.fetchOptions?.onError,onRequest:D?.fetchOptions?.onRequest,onResponse:D?.fetchOptions?.onResponse}},{onSuccess:Z,onError:J,onRequest:X,onResponse:H,...Y}=D?.fetchOptions||{},G=MZ({baseURL:E,...u?{credentials:"include"}:{},method:"GET",jsonParser(W){if(!W)return null;return zZ(W,{strict:!1})},customFetchImpl:fetch,...Y,plugins:[C,...Y.plugins||[],...D?.disableDefaultFetchPlugins?[]:[QZ],...B]}),{$sessionSignal:K,session:Q}=qZ(G,D),z=D?.plugins||[],q={},U={$sessionSignal:K,session:Q},N={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},I=[{signal:"$sessionSignal",matcher(W){return W==="/sign-out"||W==="/update-user"||W==="/sign-up/email"||W==="/sign-in/email"||W==="/delete-user"||W==="/verify-email"||W==="/revoke-sessions"||W==="/revoke-session"||W==="/change-email"}}];for(let W of z){if(W.getAtoms)Object.assign(U,W.getAtoms?.(G));if(W.pathMethods)Object.assign(N,W.pathMethods);if(W.atomListeners)I.push(...W.atomListeners)}let $={notify:(W)=>{U[W].set(!U[W].get())},listen:(W,j)=>{U[W].subscribe(j)},atoms:U};for(let W of z)if(W.getActions)q=AZ(W.getActions?.(G,$,D)??{},q);return{get baseURL(){return E},pluginsActions:q,pluginsAtoms:U,pluginPathMethods:N,atomListeners:I,$fetch:G,$store:$}};function _Z(D){return typeof D==="object"&&D!==null&&"get"in D&&typeof D.get==="function"&&"lc"in D&&typeof D.lc==="number"}function aU(D,F,u){let E=F[D],{fetchOptions:B,query:C,...Z}=u||{};if(E)return E;if(B?.method)return B.method;if(Z&&Object.keys(Z).length>0)return"POST";return"GET"}function OZ(D,F,u,E,B){function C(Z=[]){return new Proxy(function(){},{get(J,X){if(typeof X!=="string")return;if(X==="then"||X==="catch"||X==="finally")return;let H=[...Z,X],Y=D;for(let G of H)if(Y&&typeof Y==="object"&&G in Y)Y=Y[G];else{Y=void 0;break}if(typeof Y==="function")return Y;if(_Z(Y))return Y;return C(H)},apply:async(J,X,H)=>{let Y="/"+Z.map((I)=>I.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)).join("/"),G=H[0]||{},K=H[1]||{},{query:Q,fetchOptions:z,...q}=G,U={...K,...z},N=aU(Y,u,G);return await F(Y,{...U,body:N==="GET"?void 0:{...q,...U?.body||{}},query:Q||U?.query,method:N,async onSuccess(I){if(await U?.onSuccess?.(I),!B||U.disableSignal)return;let $=B.filter((j)=>j.matcher(Y));if(!$.length)return;let W=new Set;for(let j of $){let P=E[j.signal];if(!P)return;if(W.has(j.signal))continue;W.add(j.signal);let L=P.get();setTimeout(()=>{P.set(!L)},10)}}})}})}return C()}function Z6(D){let{pluginPathMethods:F,pluginsActions:u,pluginsAtoms:E,$fetch:B,atomListeners:C,$store:Z}=TZ(D),J={};for(let[X,H]of Object.entries(E))J[`use${D6(X)}`]=H;return OZ({...u,...J,$fetch:B,$store:Z},B,F,E,C)}function LZ(D){return{authorize(F,u="AND"){let E=!1;for(let[B,C]of Object.entries(F)){let Z=D[B];if(!Z)return{success:!1,error:`You are not allowed to access resource: ${B}`};if(Array.isArray(C))E=C.every((J)=>Z.includes(J));else if(typeof C==="object"){let J=C;if(J.connector==="OR")E=J.actions.some((X)=>Z.includes(X));else E=J.actions.every((X)=>Z.includes(X))}else throw new _0("Invalid access control request");if(E&&u==="OR")return{success:E};if(!E&&u==="AND")return{success:!1,error:`unauthorized to access resource "${B}"`}}if(E)return{success:E};return{success:!1,error:"Not authorized"}},statements:D}}function q2(D){return{newRole(F){return LZ(F)},statements:D}}var RZ={user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]},J6=q2(RZ),jZ=J6.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),SZ=J6.newRole({user:[],session:[]});var H6=()=>{return{id:"device-authorization",$InferServerPlugin:{},pathMethods:{"/device/code":"POST","/device/token":"POST","/device":"GET","/device/approve":"POST","/device/deny":"POST"}}};var PZ={organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]},Xu=q2(PZ),wZ=Xu.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),xZ=Xu.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),kZ=Xu.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]});var Y6="photon-cli",yZ="openid profile email";function Gu(D){return Z6({baseURL:D,plugins:[H6()]})}function bZ(D){D.command("login").description("authenticate via the device authorization flow").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("--no-browser","don't auto-open the verification URL").action(async(F)=>{try{await tU(F)}catch(u){if(u instanceof a0||u instanceof O0)T(u.message);throw u}})}async function tU({apiHost:D,browser:F=!0}){let u=await PD(D);console.log(A.info(`Authenticating to ${A.bold(u.name)} ${A.dim(`(${u.url})`)}`));let E=Gu(u.url),B;try{B=await E.device.code({client_id:Y6,scope:yZ})}catch(q){T(`Could not reach ${u.url} — ${q instanceof Error?q.message:String(q)}`)}if(B.error||!B.data)T(`Failed to start device flow: ${m(B.error)}`);let{device_code:C,user_code:Z,verification_uri:J,verification_uri_complete:X,interval:H=5,expires_in:Y=1800}=B.data;if(console.log(),console.log(` ${A.dim("Visit:")} ${A.underline(A.cyan(J))}`),console.log(` ${A.dim("Code: ")} ${A.bold(Z)}`),console.log(),F){let q=X??J;try{await d8(q),console.log(A.dim(` Opened ${q}`))}catch{}}else console.log(A.dim(" --no-browser set; open the URL above manually"));console.log();let G=EZ();G.start(`Waiting for approval (polling every ${H}s)`);let K=await eU({auth:E,deviceCode:C,initialInterval:H,expiresInSec:Y,onSlowDown:(q)=>{G.message(`Server asked us to slow down — polling every ${q}s`)}}).catch((q)=>{throw G.error(q instanceof Error?q.message:"Failed"),q});G.stop("Authorized");let z=(await E.getSession({fetchOptions:{headers:{Authorization:`Bearer ${K}`}}})).data?.user;if(!z)T("Token issued but session lookup failed — server might be misconfigured.");await EC({accessToken:K,user:{id:z.id,email:z.email,name:z.name},envName:u.name,apiUrl:u.url,issuedAt:new Date().toISOString()}),console.log(),console.log(A.success(`Logged in to ${A.bold(u.name)} as ${A.bold(z.email)}`))}async function eU(D){let F=D.initialInterval,u=Date.now()+D.expiresInSec*1000;while(Date.now()<u){await new Promise((Z)=>setTimeout(Z,F*1000));let E=await D.auth.device.token({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:D.deviceCode,client_id:Y6});if(E.data?.access_token)return E.data.access_token;let B=DW(E.error);if(FW(E.error)===429){F+=10,D.onSlowDown(F);continue}switch(B){case"authorization_pending":continue;case"slow_down":F+=5,D.onSlowDown(F);continue;case"access_denied":throw new a0;case"expired_token":throw new O0;default:throw Error(`Device flow error: ${m(E.error)}`)}}throw new O0}function DW(D){if(D&&typeof D==="object"&&"error"in D){let F=D.error;return typeof F==="string"?F:void 0}return}function FW(D){if(D&&typeof D==="object"&&"status"in D){let F=D.status;return typeof F==="number"?F:void 0}return}function fZ(D){D.command("logout").description("clear stored credentials for the active backend").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").action(async(F)=>{let u=await PD(F.apiHost),E=await zF(u.name);if(!E){console.log(A.dim(`Not logged in to ${A.bold(u.name)} — nothing to do.`));return}try{await Gu(E.apiUrl).signOut({fetchOptions:{headers:{Authorization:`Bearer ${E.accessToken}`}}})}catch{}await BC(u.name),console.log(A.success(`Logged out of ${A.bold(u.name)}`))})}function vZ(D){D.command("ping").description("hit the Photon Dashboard /api/health endpoint").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-u, --url <url>","raw API URL (bypasses env resolution)").action(async(F)=>{let{api:u,env:E}=await n({apiHost:F.apiHost,url:F.url});console.log(A.dim(`→ ${E.url}`));let B=performance.now(),{data:C,error:Z,status:J}=await u.api.health.get(),X=Math.round(performance.now()-B);if(Z)console.error(A.error(`${J} (${X}ms): ${m(Z)}`)),process.exit(1);console.log(A.success(`${J} (${X}ms): ${JSON.stringify(C)}`))})}function gZ(D){let F=D.command("profile").description("view or manage your developer / organization profile");uW(F),EW(F),ZW(F)}function uW(D){D.command("show",{isDefault:!0}).description("show your profile").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{api:u,creds:E,env:B}=await n({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:C,error:Z}=await u.api.profile.get();if(Z){if(Z.status===401)throw new d(B.name);T(`Failed to fetch profile: ${m(Z)}`)}let J=C;if(F.json){a({user:E?.user??null,profile:J});return}if(E)console.log(A.bold(E.user.name)+A.dim(` <${E.user.email}>`));else console.log(A.dim(`token-authenticated on env ${B.name}`));if(console.log(),!J){console.log(A.dim("No developer or organization profile yet.")),console.log(A.hint("Set one up: `photon profile init`."));return}console.log(A.bold(`${J.type} profile`));let X=J.profile,H=Object.entries(X).filter(([G])=>!["id","userId","createdAt","updatedAt"].includes(G)),Y=Math.max(...H.map(([G])=>G.length));for(let[G,K]of H)console.log(` ${A.dim(G.padEnd(Y))} ${JW(K)}`)})}function EW(D){D.command("init").description("set up your developer or organization profile").option("--type <type>","developer | organization").option("--languages <list>","developer: comma-separated languages").option("--referral <text>","how did you hear about us?").option("--company-name <name>","organization: company name").option("--role <role>","organization: your role").option("--company-size <size>","organization: company size (e.g. 1-10, 11-50)").option("--website <url>","organization: company website").option("--platforms <list>","organization: comma-separated platforms").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{api:u,env:E}=await n({apiHost:F.apiHost,token:F.token,requireAuth:!0}),B=await u.api.profile.get();if(B.status===401)throw new d(E.name);if(B.error)T(`Failed to check existing profile: ${m(B.error)}`);if(B.data)T("A profile already exists for this account.",{hint:"Use `photon profile update` to change it."});let{type:C,payload:Z}=await BW(F);if(C==="developer"){let J=await u.api.profile.developer.post(Z);if(J.status===401)throw new d(E.name);if(J.error)T(`Failed to save profile: ${m(J.error)}`)}else{let J=await u.api.profile.organization.post(Z);if(J.status===401)throw new d(E.name);if(J.error)T(`Failed to save profile: ${m(J.error)}`)}if(F.json){a({type:C,profile:Z});return}console.log(A.success(`Created ${C} profile.`))})}async function BW(D){if(!E0()){if(!D.type)T("--type is required in non-interactive mode (developer | organization).");if(D.type!=="developer"&&D.type!=="organization")T(`Unknown profile type "${D.type}". Use "developer" or "organization".`);if(D.type==="developer"){if(!(D.languages!==void 0||D.referral!==void 0))T("At least one of --languages / --referral is required for a developer profile.",{hint:"Pass `--languages typescript,python` and/or `--referral 'word of mouth'`."});return{type:"developer",payload:{languages:i0(D.languages??""),referralSource:D.referral??""}}}if(!(D.companyName!==void 0||D.role!==void 0||D.companySize!==void 0||D.website!==void 0||D.platforms!==void 0||D.referral!==void 0))T("At least one organization field is required (--company-name, --role, --company-size, --website, --platforms, --referral).");return{type:"organization",payload:{companyName:D.companyName,role:D.role,companySize:D.companySize,website:D.website,platforms:D.platforms!==void 0?i0(D.platforms):void 0,referralSource:D.referral}}}e8(A.cyan("Set up your profile"));let F=D.type;if(!F){let X=await BZ({message:"What kind of profile?",options:[{value:"developer",label:"Developer",hint:"individual contributor"},{value:"organization",label:"Organization",hint:"company / team"}]});if(RD(X))T("Aborted.");F=String(X)}if(F!=="developer"&&F!=="organization")T(`Unknown profile type "${F}". Use "developer" or "organization".`);if(F==="developer"){let X=await hZ("Languages (comma-separated, e.g. typescript,python)",D.languages),H=await CW("How did you hear about us?",D.referral);return J2(A.dim("Submitting…")),{type:"developer",payload:{languages:X,referralSource:H}}}let u=await A2("Company name",D.companyName),E=await A2("Your role",D.role),B=await A2("Company size (e.g. 1-10, 11-50, 51-200)",D.companySize),C=await A2("Website URL",D.website),Z=D.platforms!==void 0?i0(D.platforms):await hZ("Platforms (comma-separated, e.g. ios,android,web)",void 0,!0),J=await A2("How did you hear about us?",D.referral);return J2(A.dim("Submitting…")),{type:"organization",payload:{companyName:u,role:E,companySize:B,website:C,platforms:Z.length>0?Z:void 0,referralSource:J}}}async function CW(D,F){if(F!==void 0)return F;let u=await K0({message:D});if(RD(u))T("Aborted.");return u??""}async function A2(D,F){if(F!==void 0)return F;let u=await K0({message:D,placeholder:"(skip)"});if(RD(u))T("Aborted.");let E=u?.trim();return E?E:void 0}async function hZ(D,F,u=!1){if(F!==void 0)return i0(F);let E=await K0({message:D,placeholder:u?"(skip)":void 0});if(RD(E))T("Aborted.");return i0(E??"")}function i0(D){return D.split(",").map((F)=>F.trim()).filter(Boolean)}function ZW(D){D.command("update").alias("edit").description("update your existing profile (preserves unchanged fields)").option("--languages <list>","developer: comma-separated languages").option("--referral <text>","how did you hear about us?").option("--company-name <name>","organization: company name").option("--role <role>","organization: your role").option("--company-size <size>","organization: company size").option("--website <url>","organization: company website").option("--platforms <list>","organization: comma-separated platforms").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{if(!(F.languages!==void 0||F.referral!==void 0||F.companyName!==void 0||F.role!==void 0||F.companySize!==void 0||F.website!==void 0||F.platforms!==void 0))T("Nothing to update.",{hint:"Pass at least one field flag — see `photon profile update --help`."});let{api:E,env:B}=await n({apiHost:F.apiHost,token:F.token,requireAuth:!0}),C=await E.api.profile.get();if(C.status===401)throw new d(B.name);if(C.error)T(`Failed to fetch profile: ${m(C.error)}`);let Z=C.data;if(!Z)T("No profile to update.",{hint:"Create one first: `photon profile init`."});let J=["--languages"],X=["--company-name","--role","--company-size","--website","--platforms"],H=[];if(F.languages!==void 0)H.push("--languages");let Y=[];if(F.companyName!==void 0)Y.push("--company-name");if(F.role!==void 0)Y.push("--role");if(F.companySize!==void 0)Y.push("--company-size");if(F.website!==void 0)Y.push("--website");if(F.platforms!==void 0)Y.push("--platforms");if(Z.type==="developer"&&Y.length>0)T(`Flags ${Y.join(", ")} apply to organization profiles, but yours is a developer profile.`,{hint:`Valid flags for developer: ${J.join(", ")}, --referral.`});if(Z.type==="organization"&&H.length>0)T(`Flags ${H.join(", ")} apply to developer profiles, but yours is an organization profile.`,{hint:`Valid flags for organization: ${X.join(", ")}, --referral.`});if(Z.type==="developer"){let G=Z.profile,K={languages:F.languages!==void 0?i0(F.languages):G.languages??[],referralSource:F.referral??G.referralSource??""},Q=await E.api.profile.developer.post(K);if(Q.status===401)throw new d(B.name);if(Q.error)T(`Failed to update profile: ${m(Q.error)}`);if(F.json)return a({type:"developer",profile:K});console.log(A.success("Developer profile updated."))}else{let G=Z.profile,K={companyName:F.companyName??G.companyName,role:F.role??G.role,companySize:F.companySize??G.companySize,website:F.website??G.website,platforms:F.platforms!==void 0?i0(F.platforms):G.platforms,referralSource:F.referral??G.referralSource},Q=await E.api.profile.organization.post(K);if(Q.status===401)throw new d(B.name);if(Q.error)T(`Failed to update profile: ${m(Q.error)}`);if(F.json)return a({type:"organization",profile:K});console.log(A.success("Organization profile updated."))}})}function JW(D){if(D===null||D===void 0||D==="")return A.dim("—");if(typeof D==="boolean")return D?A.green("yes"):A.dim("no");if(D instanceof Date)return D.toLocaleString();if(typeof D==="object")return JSON.stringify(D);return String(D)}async function n0(D){if(D.yes)return;if(!E0())T("Confirmation required for this destructive action.",{hint:D.fallbackHint??"Pass --yes to confirm."});let F=await t8({message:D.message,initialValue:!1});if(RD(F)||!F)T("Aborted.")}function mZ(D){let F=D.command("projects").alias("project").description("manage your Photon Dashboard projects");HW(F),YW(F),XW(F),QW(F),KW(F),zW(F),qW(F),AW(F)}function HW(D){D.command("list",{isDefault:!0}).alias("ls").description("list your projects").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{api:u,env:E}=await n({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:B,error:C}=await u.api.projects.get();if(C){if(C.status===401)throw new d(E.name);T(`Failed to list projects: ${m(C)}`)}let Z=B??[];if(F.json){a(Z);return}if(Z.length===0){console.log(A.dim("No projects yet.")),console.log(A.hint("Create one with `photon projects create`."));return}let J=Z.map((X)=>[UW(X.id,8),X.name,X.location,dZ(X.status),X.spectrum?A.green("on"):A.dim("off"),new Date(X.updatedAt).toLocaleDateString()]);vD(["id","name","location","status","spectrum","updated"],J)})}function YW(D){D.command("show [id]").alias("get").description("show details for one project (defaults to $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F,u)=>{let{projectId:E,env:B}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).get();if(X===401)throw new d(B.name);if(X===404||!J&&!Z)T(`Project not found: ${E}`,{hint:"List your projects with `photon projects ls`."});if(J)T(`Failed to fetch project: ${m(J)}`);if(u.json){a(Z);return}let H=Z;console.log(A.bold(H.name)+A.dim(` (${H.id})`)),console.log(),WW([["status",dZ(H.status)],["location",H.location],["spectrum",H.spectrum?A.green("enabled"):A.dim("disabled")],["spectrumProjectId",H.spectrumProjectId??A.dim("—")],["template",H.template?"yes":"no"],["observability",H.observability?"yes":"no"],["subscription",H.subscriptionStatus??A.dim("—")],["createdAt",new Date(H.createdAt).toLocaleString()],["updatedAt",new Date(H.updatedAt).toLocaleString()]])})}function XW(D){D.command("create").alias("new").description("create a new project").option("-n, --name <name>","project name").option("-l, --location <location>",'location (default: "United States")').option("--spectrum","enable Spectrum").option("--no-spectrum","disable Spectrum").option("--template","use as template").option("--observability","enable observability").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let u=await GW(F),{api:E,env:B}=await n({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:C,error:Z,status:J}=await E.api.projects.post({name:u.name,location:u.location,spectrum:u.spectrum,template:u.template,observability:u.observability});if(J===401)throw new d(B.name);if(Z)T(`Failed to create project: ${m(Z)}`);let X=C;if(X.error)T(X.error);if(!X.id)T("Server did not return a project id.");if(F.json){a({id:X.id,name:u.name,env:B.name});return}console.log(A.success(`Created ${A.bold(u.name)} ${A.dim(`(${X.id})`)} on ${A.bold(B.name)}`)),console.log(A.dim(` To make this the active project: export PHOTON_PROJECT_ID='${X.id}'`))})}async function GW(D){if(!E0()){if(!D.name?.trim())T("--name is required in non-interactive mode.",{hint:"Run from a terminal for the interactive prompt, or pass --name <name>."});return{name:D.name.trim(),location:D.location??"United States",spectrum:D.spectrum??!1,template:D.template??!1,observability:D.observability??!1}}e8(A.cyan("Create a new project"));let F=D.name?.trim();if(!F){let Z=await K0({message:"Project name",validate:(J)=>J&&J.trim()?void 0:"Project name is required"});if(RD(Z))T("Aborted.");F=Z.trim()}let u=D.location;if(u===void 0){let Z=await K0({message:"Location",placeholder:"United States",defaultValue:"United States"});if(RD(Z))T("Aborted.");u=Z||"United States"}let E=D.spectrum??await X6("Enable Spectrum?",!1),B=D.template??await X6("Use as template?",!1),C=D.observability??await X6("Enable observability?",!1);return J2(A.dim("Submitting…")),{name:F,location:u,spectrum:E,template:B,observability:C}}async function X6(D,F){let u=await t8({message:D,initialValue:F});if(RD(u))T("Aborted.");return Boolean(u)}function QW(D){D.command("update [id]").alias("edit").alias("set").description("update an existing project (defaults to $PHOTON_PROJECT_ID)").option("-n, --name <name>","new name").option("--spectrum","enable Spectrum").option("--no-spectrum","disable Spectrum").option("--template","use as template").option("--no-template","stop using as template").option("--observability","enable observability").option("--no-observability","disable observability").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F,u)=>{let E=u.name?.trim();if(u.name!==void 0&&!E)T("--name must not be empty.",{hint:"Either pass a non-empty name or omit --name to keep the current one."});if(!(E!==void 0||u.spectrum!==void 0||u.template!==void 0||u.observability!==void 0))T("Nothing to update.",{hint:"Pass at least one of --name / --spectrum / --template / --observability."});let{projectId:C,env:Z}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),{api:J}=await n({apiHost:Z.url,token:u.token,requireAuth:!0}),X=await J.api.projects({id:C}).get();if(X.status===401)throw new d(Z.name);if(X.status===404||!X.error&&!X.data)T(`Project not found: ${C}`,{hint:"List your projects with `photon projects ls`."});if(X.error||!X.data)T(`Failed to load current project: ${m(X.error)}`);let H=X.data,Y={name:E??H.name,spectrum:u.spectrum??H.spectrum,template:u.template??H.template,observability:u.observability??H.observability},{error:G,status:K,data:Q}=await J.api.projects({id:C}).patch(Y);if(K===401)throw new d(Z.name);if(G)T(`Failed to update project: ${m(G)}`);let z=Q;if(z.error)T(z.error);if(u.json){a({id:C,...Y});return}console.log(A.success(`Updated ${A.bold(Y.name)} ${A.dim(`(${C})`)}`))})}function KW(D){D.command("delete [id]").alias("rm").alias("remove").description("permanently delete a project (defaults to $PHOTON_PROJECT_ID)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("-y, --yes","skip confirmation").action(async(F,u)=>{let{projectId:E,env:B}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0}),Z=await C.api.projects({id:E}).get();if(Z.status===401)throw new d(B.name);if(Z.status===404||!Z.error&&!Z.data)T(`Project not found: ${E}`,{hint:"Already deleted? `photon projects ls` to confirm."});if(Z.error)T(`Failed to look up project: ${m(Z.error)}`);let J=Z.data;await n0({message:`Delete project ${A.bold(J.name)} (${E})? This cannot be undone.`,yes:u.yes??!1,fallbackHint:`Pass --yes to delete ${J.name}.`});let{error:X,status:H}=await C.api.projects({id:E}).delete();if(H===401)throw new d(B.name);if(X)T(`Failed to delete project: ${m(X)}`);if(console.log(A.success(`Deleted ${A.bold(J.name)} ${A.dim(`(${E})`)}`)),process.env.PHOTON_PROJECT_ID===E)console.error(A.warn("Active project just deleted. Run `unset PHOTON_PROJECT_ID` to clear."))})}function zW(D){D.command("regenerate-secret [id]").alias("rotate-secret").description("rotate the project's Spectrum API secret (defaults to $PHOTON_PROJECT_ID)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("-y, --yes","skip confirmation").option("--json","output JSON").action(async(F,u)=>{let{projectId:E,env:B}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0});await n0({message:`Rotate the API secret for project ${E}? Existing integrations using the old secret will stop working immediately.`,yes:u.yes??!1,fallbackHint:"Pass --yes to rotate the secret."});let{data:Z,error:J,status:X}=await C.api.projects({id:E})["regenerate-secret"].post();if(X===401)throw new d(B.name);if(J)T(`Failed to rotate secret: ${m(J)}`);let H=Z;if(H.error)T(H.error);if(!H.projectSecret)T("Server did not return a new secret.");if(u.json){a({id:E,projectSecret:H.projectSecret});return}console.log(A.success(`New secret for ${E}:`)),console.log(` ${A.bold(H.projectSecret)}`),M0.warn("This is shown once. Store it somewhere safe — re-rotating is the only way to recover.")})}function qW(D){D.command("open [id]").description("open the project in the dashboard web UI (defaults to $PHOTON_PROJECT_ID)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("--no-browser","print the URL instead of launching a browser").action(async(F,u)=>{let{projectId:E,env:B}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),C=new URL(`/dashboard/${E}`,B.url).toString();await E2(C,{noBrowser:!u.browser,label:"URL"})})}function AW(D){D.command("check-phone <number>").description("check whether a phone number is available on Spectrum").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F,u)=>{let{api:E,env:B}=await n({apiHost:u.apiHost,token:u.token,requireAuth:!0}),{data:C,error:Z,status:J}=await E.api.projects["check-availability"].get({query:{phoneNumber:F}});if(J===401)throw new d(B.name);if(Z)T(`Failed to check phone availability: ${m(Z)}`);if(u.json){a(C);return}if(C.available)console.log(A.success(`${F} is available.`));else console.log(A.warn(`${F} is taken.`))})}function dZ(D){switch(D){case"running":return A.green(D);case"paused":return A.yellow(D);case"error":return A.red(D);default:return D}}function UW(D,F){return D.length>F?`${D.slice(0,F)}…`:D}function WW(D){let F=Math.max(...D.map(([u])=>u.length));for(let[u,E]of D)console.log(` ${A.dim(u.padEnd(F))} ${E}`)}import{readFile as NW,stat as $W}from"node:fs/promises";import{extname as VW}from"node:path";var IW={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif"};function cZ(D){D.command("avatar").description("manage the Spectrum avatar image").command("upload <file>").description("upload an image as the Spectrum avatar").option("--no-update-profile","only upload, don't update the profile to use the new avatar").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").action(async(u,E)=>{let B=await $W(u).catch(()=>null);if(!B)T(`File not found: ${u}`);let C=await NW(u),Z=B.size,J=IW[VW(u).toLowerCase()]||"application/octet-stream",{projectId:X,env:H}=await e({flagProjectId:E.project,apiHost:E.apiHost}),{api:Y}=await n({apiHost:H.url,token:E.token,requireAuth:!0}),G=await Y.api.projects({id:X}).spectrum.avatar.upload.post({contentType:J});if(G.status===401)throw new d(H.name);if(G.error)T(`Failed to get upload URL: ${m(G.error)}`);let K=G.data;if(K.error)T(K.error);if(!K.uploadUrl||!K.key)T("Server did not return uploadUrl + key.");console.log(A.dim(`Uploading ${u} (${(Z/1024).toFixed(1)} KB)…`));let Q=await fetch(K.uploadUrl,{method:"PUT",body:C,headers:{"Content-Type":J}});if(!Q.ok)T(`Upload failed: ${Q.status} ${Q.statusText}`);let z=await Y.api.projects({id:X}).spectrum.avatar.commit.post({key:K.key});if(z.status===401)throw new d(H.name);if(z.error)T(`Uploaded, but commit failed: ${m(z.error)}`);let q=z.data;if(q.error)T(q.error);if(!q.avatarUrl)T("Server did not return an avatar URL after commit.");let U=q.avatarUrl;if(E.updateProfile!==!1){let N=await Y.api.projects({id:X}).spectrum.profile.patch({avatarUrl:U});if(N.status===401)throw new d(H.name);if(N.error){let I=MW({projectId:X,apiHost:H.url,token:E.token,avatarUrl:U});T(`Uploaded, but failed to update profile: ${m(N.error)}`,{hint:`Update manually: ${I}`,context:`Avatar URL: ${U}`})}}console.log(A.success(`Uploaded avatar from ${u}`)),console.log(A.dim(` URL: ${U}`))})}function MW(D){let F=["photon spectrum profile update"];if(F.push(`--project ${Qu(D.projectId)}`),D.apiHost!==S8)F.push(`--api-host ${Qu(D.apiHost)}`);if(D.token!==void 0)F.push(`--token ${Qu(D.token)}`);return F.push(`--avatar-url ${Qu(D.avatarUrl)}`),F.join(" ")}function Qu(D){return`'${D.replace(/'/g,"'\\''")}'`}function lZ(D){let F=D.command("lines").description("manage Spectrum phone lines on a project");F.command("list",{isDefault:!0}).alias("ls").description("list lines for the active project").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).lines.get();if(X===401)throw new d(B.name);if(J)T(`Failed to list lines: ${m(J)}`);let H=Z??[];if(u.json)return a(H);if(H.length===0){console.log(A.dim("No lines yet.")),console.log(A.hint("Add one with `photon spectrum lines add`."));return}let Y=H.map((G)=>[TW(G.id,10),G.platform??"—",G.phoneNumber??A.dim("—"),G.status??A.dim("—")]);vD(["id","platform","number","status"],Y)}),F.command("add").alias("create").description("add a new line (currently iMessage only)").option("--platform <name>","platform (only 'imessage' supported today)","imessage").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{if(u.platform!=="imessage")T(`Unsupported platform "${u.platform}".`,{hint:"The server currently only accepts 'imessage'."});let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).lines.post({platform:"imessage"});if(X===401)throw new d(B.name);if(J)T(`Failed to add line: ${m(J)}`);let H=Z;if(H.error)T(H.error);if(u.json)return a(H.line??{});console.log(A.success(`Added ${H.line?.platform??"imessage"} line${H.line?.id?A.dim(` (${H.line.id})`):""}`))}),F.command("remove <line-id>").alias("rm").alias("delete").description("remove a line").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("-y, --yes","skip confirmation").action(async(u,E)=>{let{projectId:B,env:C}=await e({flagProjectId:E.project,apiHost:E.apiHost}),{api:Z}=await n({apiHost:C.url,token:E.token,requireAuth:!0});await n0({message:`Remove line ${u} from project ${B}?`,yes:E.yes??!1,fallbackHint:`Pass --yes to remove line ${u}.`});let{error:J,status:X}=await Z.api.projects({id:B}).lines({lineId:u}).delete();if(X===401)throw new d(C.name);if(J)T(`Failed to remove line: ${m(J)}`);console.log(A.success(`Removed line ${u}`))})}function TW(D,F){return D.length>F?`${D.slice(0,F)}…`:D}function iZ(D){let F=D.command("platforms").description("manage Spectrum platform integrations on a project");F.command("list",{isDefault:!0}).alias("ls").description("list platforms and their enabled state").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).platforms.get();if(X===401)throw new d(B.name);if(J)T(`Failed to list platforms: ${m(J)}`);let H=Z??{};if(u.json)return a(H);let Y=Object.entries(H);if(Y.length===0){console.log(A.dim("No platforms configured for this project."));return}let G=Y.sort(([K],[Q])=>K.localeCompare(Q)).map(([K,Q])=>[K,Q?A.green("on"):A.dim("off")]);vD(["platform","state"],G)}),F.command("enable <name>").description("enable a platform").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u,E)=>{await pZ(u,!0,E)}),F.command("disable <name>").description("disable a platform").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u,E)=>{await pZ(u,!1,E)})}async function pZ(D,F,u){let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).platforms.toggle.post({platformId:D,enabled:F});if(X===401)throw new d(B.name);if(J)T(`Failed to ${F?"enable":"disable"} ${D}: ${m(J)}`);let H=Z;if(H.error)T(H.error,{hint:H.error==="Unsupported platform"?"Run `photon spectrum platforms ls` to see available platforms.":void 0});if(u.json)return a(H.platforms??{});console.log(A.success(`${F?"Enabled":"Disabled"} ${A.bold(D)}`))}function nZ(D){let F=D.command("profile").description("view or update the Spectrum profile (display name, avatar)");F.command("show",{isDefault:!0}).description("show the Spectrum profile").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).spectrum.profile.get();if(X===401)throw new d(B.name);if(J)T(`Failed to fetch Spectrum profile: ${m(J)}`);if(u.json)return a(Z??{});if(!Z||typeof Z!=="object"){console.log(A.dim("No Spectrum profile."));return}let H=Object.entries(Z).filter(([G])=>!["id"].includes(G));if(H.length===0){console.log(A.dim("Empty Spectrum profile."));return}let Y=Math.max(...H.map(([G])=>G.length));for(let[G,K]of H)console.log(` ${A.dim(G.padEnd(Y))} ${_W(K)}`)}),F.command("update").alias("edit").description("update the Spectrum profile (preserves unset fields)").option("--first-name <name>").option("--last-name <name>").option("--avatar-url <url>","avatar image URL (use `spectrum avatar upload` instead)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{if(!(u.firstName!==void 0||u.lastName!==void 0||u.avatarUrl!==void 0))T("Nothing to update.",{hint:"Pass at least one of --first-name / --last-name / --avatar-url."});let{projectId:B,env:C}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:Z}=await n({apiHost:C.url,token:u.token,requireAuth:!0}),J={};if(u.firstName!==void 0)J.firstName=u.firstName;if(u.lastName!==void 0)J.lastName=u.lastName;if(u.avatarUrl!==void 0)J.avatarUrl=u.avatarUrl;let{data:X,error:H,status:Y}=await Z.api.projects({id:B}).spectrum.profile.patch(J);if(Y===401)throw new d(C.name);if(H)T(`Failed to update Spectrum profile: ${m(H)}`);let G=X;if(G.error)T(G.error);if(u.json)return a(G.profile??{});console.log(A.success("Spectrum profile updated."))})}function _W(D){if(D===null||D===void 0||D==="")return A.dim("—");if(typeof D==="boolean")return D?A.green("yes"):A.dim("no");if(typeof D==="object")return JSON.stringify(D);return String(D)}function rZ(D){let F=D.command("users").description("manage Spectrum users on a project");F.command("list",{isDefault:!0}).alias("ls").description("list Spectrum users for the active project").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).spectrum.users.get();if(X===401)throw new d(B.name);if(J)T(`Failed to list users: ${m(J)}`);let H=Z??[];if(u.json)return a(H);if(H.length===0){console.log(A.dim("No Spectrum users yet.")),console.log(A.hint("Add one with `photon spectrum users add`."));return}let Y=H.map((G)=>[LW(G.id,10),aZ(G),G.email??A.dim("—"),G.phoneNumber??A.dim("—")]);vD(["id","name","email","phone"],Y)}),F.command("add").alias("create").description("add a Spectrum user to the active project").option("--first-name <name>","first name").option("--last-name <name>","last name").option("--email <email>","email address").option("--phone <number>","phone number (E.164)").option("--invite","send an onboarding invite to this user").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await n({apiHost:B.url,token:u.token,requireAuth:!0}),Z=await OW(u),{data:J,error:X,status:H}=await C.api.projects({id:E}).spectrum.users.post({firstName:Z.firstName,lastName:Z.lastName,email:Z.email,phoneNumber:Z.phone,sendInvite:u.invite??!1});if(H===401)throw new d(B.name);if(X)T(`Failed to add user: ${m(X)}`);let Y=J;if(Y.error)T(Y.error);if(u.json)return a(Y.user??{});let G=Y.user;if(console.log(A.success(`Added ${aZ(G??Z)} ${G?.id?A.dim(`(${G.id})`):""}`)),u.invite)console.log(A.dim(" Invite sent."))}),F.command("remove <user-id>").alias("rm").alias("delete").description("remove a Spectrum user").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("-y, --yes","skip confirmation").action(async(u,E)=>{let{projectId:B,env:C}=await e({flagProjectId:E.project,apiHost:E.apiHost}),{api:Z}=await n({apiHost:C.url,token:E.token,requireAuth:!0});await n0({message:`Remove user ${u} from project ${B}?`,yes:E.yes??!1,fallbackHint:`Pass --yes to remove user ${u}.`});let{error:J,status:X}=await Z.api.projects({id:B}).spectrum.users({userId:u}).delete();if(X===401)throw new d(C.name);if(J)T(`Failed to remove user: ${m(J)}`);console.log(A.success(`Removed user ${u}`))})}async function OW(D){if(!E0()){let F=[];if(!D.firstName)F.push("--first-name");if(!D.lastName)F.push("--last-name");if(!D.email)F.push("--email");if(!D.phone)F.push("--phone");if(F.length>0)T(`Missing required flags in non-interactive mode: ${F.join(", ")}`);return{firstName:D.firstName,lastName:D.lastName,email:D.email,phone:D.phone}}return{firstName:D.firstName??await Ku("First name"),lastName:D.lastName??await Ku("Last name"),email:D.email??await Ku("Email"),phone:D.phone??await Ku("Phone (E.164, e.g. +14155551234)")}}async function Ku(D){let F=await K0({message:D,validate:(u)=>u&&u.trim()?void 0:"Required"});if(RD(F))T("Aborted.");return F.trim()}function aZ(D){let F=[D.firstName,D.lastName].filter(Boolean);return F.length>0?F.join(" "):A.dim("(no name)")}function LW(D,F){return D.length>F?`${D.slice(0,F)}…`:D}function sZ(D){let F=D.command("spectrum").description("manage Spectrum users, lines, platforms, and profile");nZ(F),rZ(F),lZ(F),iZ(F),cZ(F)}function tZ(D){D.command("whoami").description("show the user authenticated for the active backend").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").action(async(F)=>{let{api:u,env:E,creds:B}=await n({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:C,error:Z,status:J}=await u.api.profile.get();if(J===401)throw new d(E.name);if(Z)T(`Failed to fetch profile: ${m(Z)}`);if(!B){if(console.log(A.dim(`authenticated via token on backend ${E.name} (${E.url})`)),C&&typeof C==="object"){let H=oZ(C);if(H)console.log(A.dim(`profile: ${H}`))}return}let X=B.user;if(console.log(A.bold(X.name)+A.dim(` <${X.email}>`)),console.log(A.dim(`backend: ${E.name} (${E.url})`)),console.log(A.dim(`signed in: ${new Date(B.issuedAt).toLocaleString()}`)),C&&typeof C==="object"){let H=oZ(C);if(H)console.log(A.dim(`profile: ${H}`))}})}function oZ(D){if(!D||typeof D!=="object")return null;let F=D;if(F.type==="developer"||F.type==="organization")return F.type;return null}function eZ(){let D=new eB().name("photon").description("Photon CLI — bring your agents to any interface").version(eF.version,"-v, --version","output the current version").option("--debug","verbose output incl. HTTP request/response").hook("preAction",(F)=>{let u=F.opts();GC(!!u.debug)});return vZ(D),xC(D),bZ(D),fZ(D),tZ(D),gZ(D),mZ(D),sZ(D),PC(D),CC(D),wC(D),D}z9();kB();var RW=eZ();RW.parseAsync(process.argv).catch(jW);function jW(D){if(D instanceof VF||D instanceof d){let F=D.envName==="production"?"":` --api-host <url> # for "${D.envName}"`;T(D.message,{hint:`Run \`photon login${F}\`.`})}if(D instanceof a0)T(D.message,{hint:"Re-run `photon login` if this was unintentional."});if(D instanceof O0)T(D.message,{hint:"Re-run `photon login` and approve more quickly."});if(D instanceof Error){if(/Unable to connect|fetch failed|ECONNREFUSED/i.test(D.message))T(D.message,{hint:"Check your connection, or set PHOTON_API_HOST / pass --api-host <url> to target a reachable backend."});T(D.message)}T(String(D))}
150
+ `}}}}).prompt();import E6 from"node:process";import JZ from"node:path";import{fileURLToPath as nA}from"node:url";import aA from"node:child_process";import rA,{constants as sA}from"node:fs/promises";import{promisify as _A}from"node:util";import LA from"node:child_process";import su,{constants as sC}from"node:fs/promises";import iC from"node:process";import VA from"node:os";import au from"node:fs";import NA from"node:fs";import lC from"node:fs";var pu;function UA(){try{return lC.statSync("/.dockerenv"),!0}catch{return!1}}function WA(){try{return lC.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function iu(){if(pu===void 0)pu=UA()||WA();return pu}var nu,$A=()=>{try{return NA.statSync("/run/.containerenv"),!0}catch{return!1}};function p0(){if(nu===void 0)nu=$A()||iu();return nu}var pC=()=>{if(iC.platform!=="linux")return!1;if(VA.release().toLowerCase().includes("microsoft")){if(p0())return!1;return!0}try{if(au.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!p0()}catch{}if(au.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||au.existsSync("/run/WSL"))return!p0();return!1},K0=iC.env.__IS_WSL_TEST__?pC:pC();import nC from"node:process";import{Buffer as IA}from"node:buffer";import{promisify as MA}from"node:util";import TA from"node:child_process";var OA=MA(TA.execFile),ru=()=>`${nC.env.SYSTEMROOT||nC.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;var fD=async(D,F={})=>{let{powerShellPath:u,...E}=F,B=fD.encodeCommand(D);return OA(u??ru(),[...fD.argumentsPrefix,B],{encoding:"utf8",...E})};fD.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];fD.encodeCommand=(D)=>IA.from(D,"utf16le").toString("base64");fD.escapeArgument=(D)=>`'${String(D).replaceAll("'","''")}'`;function aC(D){for(let F of D.split(`
151
+ `)){if(/^\s*#/.test(F))continue;let u=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(F);if(!u)continue;return u.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}var RA=_A(LA.execFile),jA=(()=>{let F;return async function(){if(F)return F;let u="/etc/wsl.conf",E=!1;try{await su.access(u,sC.F_OK),E=!0}catch{}if(!E)return"/mnt/";let B=await su.readFile(u,{encoding:"utf8"}),C=aC(B);if(C===void 0)return"/mnt/";return F=C,F=F.endsWith("/")?F:`${F}/`,F}})(),SA=async()=>{return`${await jA()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},s8=K0?SA:ru,rC,oC=async()=>{return rC??=(async()=>{try{let D=await s8();return await su.access(D,sC.X_OK),!0}catch{return!1}})(),rC},tC=async()=>{let D=await s8(),F=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:u}=await fD(F,{powerShellPath:D});return u.trim()},eC=async(D)=>{if(/^[a-z]+:\/\//i.test(D))return D;try{let{stdout:F}=await RA("wslpath",["-aw",D],{encoding:"utf8"});return F.trim()}catch{return D}};function i0(D,F,u){let E=(B)=>Object.defineProperty(D,F,{value:B,enumerable:!0,writable:!0});return Object.defineProperty(D,F,{configurable:!0,enumerable:!0,get(){let B=u();return E(B),B},set(B){E(B)}}),D}import{promisify as dA}from"node:util";import D6 from"node:process";import{execFile as cA}from"node:child_process";import{promisify as PA}from"node:util";import wA from"node:process";import{execFile as xA}from"node:child_process";var kA=PA(xA);async function ou(){if(wA.platform!=="darwin")throw Error("macOS only");let{stdout:D}=await kA("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),u=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(D)?.groups.id??"com.apple.Safari";if(u==="com.apple.safari")return"com.apple.Safari";return u}import yA from"node:process";import{promisify as bA}from"node:util";import{execFile as fA,execFileSync as GL}from"node:child_process";var vA=bA(fA);async function DZ(D,{humanReadableOutput:F=!0,signal:u}={}){if(yA.platform!=="darwin")throw Error("macOS only");let E=F?[]:["-ss"],B={};if(u)B.signal=u;let{stdout:C}=await vA("osascript",["-e",D,E],B);return C.trim()}async function tu(D){return DZ(`tell application "Finder" to set app_path to application file id "${D}" as string
152
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as hA}from"node:util";import{execFile as gA}from"node:child_process";var mA=hA(gA),o8={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},t8=new Map(Object.entries(o8));class FZ extends Error{}async function eu(D=mA){let{stdout:F}=await D("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),u=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(F);if(!u)throw new FZ(`Cannot find Windows browser in stdout: ${JSON.stringify(F)}`);let{id:E}=u.groups,B=E.lastIndexOf("."),C=E.lastIndexOf("-"),Z=B===-1?void 0:E.slice(0,B),J=C===-1?void 0:E.slice(0,C);return o8[E]??o8[Z]??o8[J]??{name:E,id:E}}var lA=dA(cA),pA=(D)=>D.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(F)=>F.toUpperCase());async function F6(){if(D6.platform==="darwin"){let D=await ou();return{name:await tu(D),id:D}}if(D6.platform==="linux"){let{stdout:D}=await lA("xdg-mime",["query","default","x-scheme-handler/http"]),F=D.trim();return{name:pA(F.replace(/.desktop$/,"").replace("-"," ")),id:F}}if(D6.platform==="win32")return eu();throw Error("Only macOS, Linux, and Windows are supported")}import u6 from"node:process";var iA=Boolean(u6.env.SSH_CONNECTION||u6.env.SSH_CLIENT||u6.env.SSH_TTY),uZ=iA;var e8=Symbol("fallbackAttempt"),B6=import.meta.url?JZ.dirname(nA(import.meta.url)):"",EZ=JZ.join(B6,"xdg-open"),{platform:WF,arch:BZ}=E6,CZ=async(D,F)=>{if(D.length===0)return;let u=[];for(let E of D)try{return await F(E)}catch(B){u.push(B)}throw AggregateError(u,"Failed to open in all supported apps")},D3=async(D)=>{D={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...D};let F=D[e8]===!0;if(delete D[e8],Array.isArray(D.app))return CZ(D.app,(H)=>D3({...D,app:H,[e8]:!0}));let{name:u,arguments:E=[]}=D.app??{};if(E=[...E],Array.isArray(u))return CZ(u,(H)=>D3({...D,app:{name:H,arguments:E},[e8]:!0}));if(u==="browser"||u==="browserPrivate"){let H={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},Y={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},G;if(K0){let K=await tC();G=t8.get(K)??{}}else G=await F6();if(G.id in H){let K=H[G.id.toLowerCase()];if(u==="browserPrivate"){if(K==="safari")throw Error("Safari doesn't support opening in private mode via command line");E.push(Y[K])}return D3({...D,app:{name:NF[K],arguments:E}})}throw Error(`${G.name} is not supported as a default browser`)}let B,C=[],Z={},J=!1;if(K0&&!p0()&&!uZ&&!u)J=await oC();if(WF==="darwin"){if(B="open",D.wait)C.push("--wait-apps");if(D.background)C.push("--background");if(D.newInstance)C.push("--new");if(u)C.push("-a",u)}else if(WF==="win32"||J){if(B=await s8(),C.push(...fD.argumentsPrefix),!K0)Z.windowsVerbatimArguments=!0;if(K0&&D.target)D.target=await eC(D.target);let H=["$ProgressPreference = 'SilentlyContinue';","Start"];if(D.wait)H.push("-Wait");if(u){if(H.push(fD.escapeArgument(u)),D.target)E.push(D.target)}else if(D.target)H.push(fD.escapeArgument(D.target));if(E.length>0)E=E.map((Y)=>fD.escapeArgument(Y)),H.push("-ArgumentList",E.join(","));if(D.target=fD.encodeCommand(H.join(" ")),!D.wait)Z.stdio="ignore"}else{if(u)B=u;else{let H=!B6||B6==="/",Y=!1;try{await rA.access(EZ,sA.X_OK),Y=!0}catch{}B=E6.versions.electron??(WF==="android"||H||!Y)?"xdg-open":EZ}if(E.length>0)C.push(...E);if(!D.wait)Z.stdio="ignore",Z.detached=!0}if(WF==="darwin"&&E.length>0)C.push("--args",...E);if(D.target)C.push(D.target);let X=aA.spawn(B,C,Z);if(D.wait)return new Promise((H,Y)=>{X.once("error",Y),X.once("close",(G)=>{if(!D.allowNonzeroExitCode&&G!==0){Y(Error(`Exited with code ${G}`));return}H(X)})});if(F)return new Promise((H,Y)=>{X.once("error",Y),X.once("spawn",()=>{X.once("close",(G)=>{if(X.off("error",Y),G!==0){Y(Error(`Exited with code ${G}`));return}X.unref(),H(X)})})});return X.unref(),new Promise((H,Y)=>{X.once("error",Y),X.once("spawn",()=>{X.off("error",Y),H(X)})})},oA=(D,F)=>{if(typeof D!=="string")throw TypeError("Expected a `target`");return D3({...F,target:D})};function ZZ(D){if(typeof D==="string"||Array.isArray(D))return D;let{[BZ]:F}=D;if(!F)throw Error(`${BZ} is not supported`);return F}function J2({[WF]:D},{wsl:F}={}){if(F&&K0)return ZZ(F);if(!D)throw Error(`${WF} is not supported`);return ZZ(D)}var NF={browser:"browser",browserPrivate:"browserPrivate"};i0(NF,"chrome",()=>J2({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));i0(NF,"brave",()=>J2({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));i0(NF,"firefox",()=>J2({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));i0(NF,"edge",()=>J2({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));i0(NF,"safari",()=>J2({darwin:"Safari"}));var F3=oA;async function H2(D,F={}){let u=F.label??"Open";if(console.log(`${A.dim(u+":")} ${A.underline(A.cyan(D))}`),F.noBrowser)return"skipped";try{return await F3(D),"opened"}catch{return"failed"}}var T0=["pro","business","enterprise"];async function $F(D,F){let{data:u,error:E,status:B}=await D.api.billing.plans.get();if(B===401)throw new d(F);if(E)I(`Failed to list plans: ${h(E)}`);return u??[]}async function HZ(D,F,u){let{data:E,error:B,status:C}=await D.api.projects({id:F}).subscription.get();if(C===401)throw new d(u);if(B){let Z=typeof C==="number"?C:0;if(!(Z===0||Z>=500))I(`Failed to fetch subscription: ${h(B)}`);return console.error(A.warn(`Could not read subscription for project ${F}: ${h(B)}. Subscription state unknown.`)),{tier:"unknown",status:null}}return E??{}}function u3(D,F){let u=F.toLowerCase();for(let E of D){if(!E.name.toLowerCase().includes(u))continue;if(!E.prices?.length)continue;return E}return null}function E3(D){let F=D.toLowerCase();for(let u of T0)if(F.includes(u))return u;return}async function B3(D){if(!yD())I("Cannot prompt for a plan in non-interactive mode.",{hint:"Pass a tier (pro / business / enterprise) or --plan <price-id>."});let F=D.filter((B)=>B.prices&&B.prices.length>0);if(F.length===0)I("No subscription plans available.",{hint:"Contact support if you expected plans to be listed."});let u=[];for(let B of F)for(let C of B.prices??[])u.push({value:{plan:B,price:C},label:`${B.name} — ${tA(C)}`,hint:B.description});let E=await r8({message:"Pick a plan",options:u});if(UD(E))I("Aborted.");return E}function Y2({explicitNoBrowser:D,json:F}){if(F||D)return!0;return!yD()}async function C3(D){let{data:F,error:u,status:E}=await D.api.api.billing.checkout.post({projectId:D.projectId,priceId:D.priceId,quantity:D.quantity});if(E===401)throw new d(D.envName);if(u)I(`Failed to start checkout: ${h(u)}`);let B=F;if(B.error)I(B.error);if(!B.url)I("Server did not return a checkout URL.");let C={action:"checkout",url:B.url,...D.tierLabel?{tier:D.tierLabel}:{}};if(D.json)return a(C),C;if(await H2(C.url,{noBrowser:D.noBrowser,label:"Stripe checkout"})==="failed")console.log(A.warn("Could not open browser automatically — copy the URL above."));return C}async function Z3(D){let{data:F,error:u,status:E}=await D.api.api.projects({id:D.projectId}).subscription.manage.post();if(E===401)throw new d(D.envName);if(u)I(`Failed to open portal: ${h(u)}`);let B=F;if(B.error)I(B.error);if(!B.url)I("Server did not return a portal URL.");let C={action:"manage",url:B.url};if(D.json)return a(C),C;if(await H2(C.url,{noBrowser:D.noBrowser,label:"Stripe portal"})==="failed")console.log(A.warn("Could not open browser automatically — copy the URL above."));return C}function tA(D){if(D.unit_amount==null)return"—";let F=D.currency.toUpperCase(),u=2;try{u=new Intl.NumberFormat("en-US",{style:"currency",currency:F}).resolvedOptions().maximumFractionDigits??2}catch{}let E=10**u,B=(D.unit_amount/E).toFixed(u),C=D.recurring?.interval;return C?`${B} ${F} / ${C}`:`${B} ${F}`}var YZ=YD(Au(),1),{program:rL,createCommand:sL,createArgument:oL,createOption:tL,CommanderError:eL,InvalidArgumentError:C6,InvalidOptionArgumentError:DR,Command:FR,Argument:uR,Option:ER,Help:BR}=YZ.default;function J3(D){if(!/^\d+$/.test(D))throw new C6(`must be a positive integer (got "${D}")`);let F=Number.parseInt(D,10);if(!Number.isSafeInteger(F)||F<1)throw new C6(`must be a positive integer (got "${D}")`);return F}function XZ(D){let F=D.command("billing").description("view + manage your project's subscription");eA(F),DU(F),FU(F),EU(F)}function eA(D){D.command("plans").description("list available subscription plans").option("-p, --project <id>","project id (accepted for parity with other billing commands; not used)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{api:u,env:E}=await i({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:B,error:C,status:Z}=await u.api.billing.plans.get();if(Z===401)throw new d(E.name);if(C)I(`Failed to list plans: ${h(C)}`);let J=B??[];if(F.json)return a(J);if(J.length===0){console.log(A.dim("No plans available."));return}let X=J.flatMap((H)=>(H.prices??[{id:"—",unit_amount:null,currency:"—",recurring:null}]).map((Y)=>[H.name,Y.id,BU(Y),Y.recurring?.interval??A.dim("—")]));hD(["plan","price id","price","interval"],X)})}function DU(D){D.command("show").description("show the project's current subscription (defaults to $PHOTON_PROJECT_ID)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{projectId:u,env:E}=await e({flagProjectId:F.project,apiHost:F.apiHost}),{api:B}=await i({apiHost:E.url,token:F.token,requireAuth:!0}),{data:C,error:Z,status:J}=await B.api.projects({id:u}).subscription.get();if(J===401)throw new d(E.name);if(Z)I(`Failed to fetch subscription: ${h(Z)}`);if(F.json)return a(C??{});let X=C??{};if(console.log(A.bold("Subscription")),console.log(` ${A.dim("tier".padEnd(8))} ${CU(X.tier)}`),console.log(` ${A.dim("status".padEnd(8))} ${ZU(X.status??null)}`),X.subscriptionId)console.log(` ${A.dim("id".padEnd(8))} ${X.subscriptionId}`);if(X.tier==="unknown")console.log(),console.log(A.warn('Server returned tier "unknown". This is a known issue (architecture-review S3) — the subscription may still be active.'))})}function FU(D){D.command("checkout [tier]").description("start a subscription checkout (interactive picker when no tier / --plan)").option("--plan <price-id>","Stripe price id (escape hatch; overrides tier picker)").option("--qty <n>","quantity",J3).option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--no-browser","print the URL instead of launching a browser").option("--json","output JSON ({action,url,tier?}) and skip browser open").action(async(F,u)=>{let E=uU(F);if(F&&!E)I(`Unknown tier "${F}".`,{hint:`Use one of: ${T0.join(", ")} — or pass --plan <price-id>.`});let{projectId:B,env:C}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:Z}=await i({apiHost:C.url,token:u.token,requireAuth:!0}),J=Y2({explicitNoBrowser:u.browser===!1,json:u.json??!1}),X,H;if(u.plan)X=u.plan;else if(E){let Y=await $F(Z,C.name),G=u3(Y,E),K=G?.prices?.length===1?G.prices[0]:void 0;if(!G||!G.prices?.length)I(`No plan matching tier "${E}".`,{hint:"List options with `photon billing plans`."});if(!K)I(`Tier "${E}" has multiple billing intervals.`,{hint:"Pass --plan <price-id> to choose, or omit the tier to use the interactive picker."});X=K.id,H=E}else{let Y=await $F(Z,C.name),G=await B3(Y);X=G.price.id,H=E3(G.plan.name)}await C3({api:Z,projectId:B,priceId:X,quantity:u.qty,envName:C.name,json:u.json??!1,noBrowser:J,tierLabel:H})})}function uU(D){if(!D)return;let F=D.trim().toLowerCase();return T0.includes(F)?F:void 0}function EU(D){D.command("manage").alias("portal").description("open the Stripe customer portal for this project").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--no-browser","print the URL instead of launching a browser").option("--json","output JSON ({action,url}) and skip browser open").action(async(F)=>{let{projectId:u,env:E}=await e({flagProjectId:F.project,apiHost:F.apiHost}),{api:B}=await i({apiHost:E.url,token:F.token,requireAuth:!0}),C=Y2({explicitNoBrowser:F.browser===!1,json:F.json??!1});await Z3({api:B,projectId:u,envName:E.name,json:F.json??!1,noBrowser:C})})}function BU(D){if(D.unit_amount==null)return A.dim("—");let F=D.currency.toUpperCase(),u=2;try{u=new Intl.NumberFormat("en-US",{style:"currency",currency:F}).resolvedOptions().maximumFractionDigits??2}catch{}let E=10**u;return`${(D.unit_amount/E).toFixed(u)} ${F}`}function CU(D){if(!D)return A.dim("—");if(D==="free")return A.dim(D);if(D==="unknown")return A.yellow(D);return A.green(D)}function ZU(D){if(!D)return A.dim("—");switch(D){case"active":return A.green(D);case"past_due":case"unpaid":return A.red(D);case"trialing":return A.cyan(D);case"canceled":return A.dim(D);default:return D}}function GZ(D){D.command("config").description("inspect Photon CLI configuration").command("show",{isDefault:!0}).description("dump the active configuration (no secrets printed)").option("--json","output JSON").action(async(u)=>{let E=await PD(),B=await k8(),C=process.env.PHOTON_PROJECT_ID?.trim()||null,Z={configDir:w8(),currentEnv:{name:E.name,url:E.url},activeProject:C,authedEnvs:B};if(u.json)return a(Z);console.log(A.bold("Photon CLI configuration")),console.log();let J=18;X("config dir",Z.configDir),X("active backend",`${A.bold(Z.currentEnv.name)} ${A.dim(`(${Z.currentEnv.url})`)}`),X("active project",C?`${A.bold(C)} ${A.dim("(via $PHOTON_PROJECT_ID)")}`:A.dim("(none — pass --project <id> or set $PHOTON_PROJECT_ID)")),X("logged-in keys",B.length>0?B.join(", "):A.dim("none"));function X(H,Y){console.log(` ${A.dim(H.padEnd(J))} ${Y}`)}})}function QZ(D){D.command("env").description("show the active backend (set via PHOTON_API_HOST or --api-host)").command("current",{isDefault:!0}).description("print the resolved API host").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").action(async(u)=>{let E=await PD(u.apiHost);console.log(`${A.bold(E.name)} ${A.dim(`(${E.url})`)}`)})}var H3=Symbol.for("better-auth:broadcast-channel"),JU=()=>Math.floor(Date.now()/1000),HU=class{listeners=new Set;name;constructor(D="better-auth.message"){this.name=D}subscribe(D){return this.listeners.add(D),()=>{this.listeners.delete(D)}}post(D){if(typeof window>"u")return;try{localStorage.setItem(this.name,JSON.stringify({...D,timestamp:JU()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};let D=(F)=>{if(F.key!==this.name)return;let u=JSON.parse(F.newValue??"{}");if(u?.event!=="session"||!u?.data)return;this.listeners.forEach((E)=>E(u))};return window.addEventListener("storage",D),()=>{window.removeEventListener("storage",D)}}};function X2(D="better-auth.message"){if(!globalThis[H3])globalThis[H3]=new HU(D);return globalThis[H3]}var Y3=Symbol.for("better-auth:focus-manager"),YU=class{listeners=new Set;subscribe(D){return this.listeners.add(D),()=>{this.listeners.delete(D)}}setFocused(D){this.listeners.forEach((F)=>F(D))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};let D=()=>{if(document.visibilityState==="visible")this.setFocused(!0)};return document.addEventListener("visibilitychange",D,!1),()=>{document.removeEventListener("visibilitychange",D,!1)}}};function Z6(){if(!globalThis[Y3])globalThis[Y3]=new YU;return globalThis[Y3]}var X3=Symbol.for("better-auth:online-manager"),XU=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(D){return this.listeners.add(D),()=>{this.listeners.delete(D)}}setOnline(D){this.isOnline=D,this.listeners.forEach((F)=>F(D))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};let D=()=>this.setOnline(!0),F=()=>this.setOnline(!1);return window.addEventListener("online",D,!1),window.addEventListener("offline",F,!1),()=>{window.removeEventListener("online",D,!1),window.removeEventListener("offline",F,!1)}}};function G3(){if(!globalThis[X3])globalThis[X3]=new XU;return globalThis[X3]}var G2=Symbol("clean");var rD=[],O0=0,Q3=4,GU=globalThis.nanostoresGlobal||={epoch:0},Q2=(D)=>{let F=[],u={get(){if(!u.lc)u.listen(()=>{})();return u.value},init:D,lc:0,listen(E){return u.lc=F.push(E),()=>{for(let C=O0+Q3;C<rD.length;)if(rD[C]===E)rD.splice(C,Q3);else C+=Q3;let B=F.indexOf(E);if(~B){if(F.splice(B,1),!--u.lc)u.off()}}},notify(E,B){GU.epoch++;let C=!rD.length;for(let Z of F)rD.push(Z,u.value,E,B);if(C){for(O0=0;O0<rD.length;O0+=Q3)rD[O0](rD[O0+1],rD[O0+2],rD[O0+3]);rD.length=0}},off(){},set(E){let B=u.value;if(B!==E)u.value=E,u.notify(B)},subscribe(E){let B=u.listen(E);return E(u.value),B},value:D};return u[G2]=()=>{F=[],u.lc=0,u.off()},u};var QU=5,VF=6,K3=10,KU=(D,F,u,E)=>{if(D.events=D.events||{},!D.events[u+K3])D.events[u+K3]=E((B)=>{D.events[u].reduceRight((C,Z)=>(Z(C),C),{shared:{},...B})});return D.events[u]=D.events[u]||[],D.events[u].push(F),()=>{let B=D.events[u],C=B.indexOf(F);if(B.splice(C,1),!B.length)delete D.events[u],D.events[u+K3](),delete D.events[u+K3]}};var KZ=1000,K2=(D,F)=>{return KU(D,(E)=>{let B=F(E);if(B)D.events[VF].push(B)},QU,(E)=>{let B=D.listen;D.listen=(...Z)=>{if(!D.lc&&!D.active)D.active=!0,E();return B(...Z)};let C=D.off;D.events[VF]=[],D.off=()=>{C(),setTimeout(()=>{if(D.active&&!D.lc){D.active=!1;for(let Z of D.events[VF])Z();D.events[VF]=[]}},KZ)};{let Z=D[G2];D[G2]=()=>{for(let J of D.events[VF])J();D.events[VF]=[],D.active=!1,Z()}}return()=>{D.listen=B,D.off=C}})};var zU=()=>typeof window>"u",z3=(D,F,u,E)=>{let B=Q2({data:null,error:null,isPending:!0,isRefetching:!1,refetch:(J)=>C(J)}),C=async(J)=>{return new Promise((X)=>{let H=typeof E==="function"?E({data:B.get().data,error:B.get().error,isPending:B.get().isPending}):E;u(F,{...H,query:{...H?.query,...J?.query},async onSuccess(Y){B.set({data:Y.data,error:null,isPending:!1,isRefetching:!1,refetch:B.value.refetch}),await H?.onSuccess?.(Y)},async onError(Y){let{request:G}=Y,K=typeof G.retry==="number"?G.retry:G.retry?.attempts,Q=G.retryAttempt||0;if(K&&Q<K)return;B.set({error:Y.error,data:null,isPending:!1,isRefetching:!1,refetch:B.value.refetch}),await H?.onError?.(Y)},async onRequest(Y){let G=B.get();B.set({isPending:G.data===null,data:G.data,error:null,isRefetching:!0,refetch:B.value.refetch}),await H?.onRequest?.(Y)}}).catch((Y)=>{B.set({error:Y,data:null,isPending:!1,isRefetching:!1,refetch:B.value.refetch})}).finally(()=>{X(void 0)})})};D=Array.isArray(D)?D:[D];let Z=!1;for(let J of D)J.subscribe(async()=>{if(zU())return;if(Z)await C();else K2(B,()=>{let X=setTimeout(async()=>{if(!Z)await C(),Z=!0},0);return()=>{B.off(),J.off(),clearTimeout(X)}})});return B};var IF=()=>Math.floor(Date.now()/1000),qU=5;function J6(D){let{sessionAtom:F,sessionSignal:u,$fetch:E,options:B={}}=D,C=B.sessionOptions?.refetchInterval??0,Z=B.sessionOptions?.refetchOnWindowFocus??!0,J=B.sessionOptions?.refetchWhenOffline??!1,X={lastSync:0,lastSessionRequest:0,cachedSession:void 0},H=()=>{return J||G3().isOnline},Y=(M)=>{if(!H())return;if(M?.event==="storage"){X.lastSync=IF(),u.set(!u.get());return}let $=F.get();if(M?.event==="poll"){X.lastSessionRequest=IF(),E("/get-session").then((W)=>{if(W.error)F.set({...$,data:null,error:W.error});else F.set({...$,data:W.data,error:null});X.lastSync=IF(),u.set(!u.get())}).catch(()=>{});return}if(M?.event==="visibilitychange"){if(IF()-X.lastSessionRequest<qU)return;X.lastSessionRequest=IF()}if($?.data===null||$?.data===void 0||M?.event==="visibilitychange")X.lastSync=IF(),u.set(!u.get())},G=(M)=>{X2().post({event:"session",data:{trigger:M},clientId:Math.random().toString(36).substring(7)})},K=()=>{if(C&&C>0)X.pollInterval=setInterval(()=>{if(F.get()?.data)Y({event:"poll"})},C*1000)},Q=()=>{X.unsubscribeBroadcast=X2().subscribe(()=>{Y({event:"storage"})})},z=()=>{if(!Z)return;X.unsubscribeFocus=Z6().subscribe(()=>{Y({event:"visibilitychange"})})},q=()=>{X.unsubscribeOnline=G3().subscribe((M)=>{if(M)Y({event:"visibilitychange"})})};return{init:()=>{K(),Q(),z(),q(),X2().setup(),Z6().setup(),G3().setup()},cleanup:()=>{if(X.pollInterval)clearInterval(X.pollInterval),X.pollInterval=void 0;if(X.unsubscribeBroadcast)X.unsubscribeBroadcast(),X.unsubscribeBroadcast=void 0;if(X.unsubscribeFocus)X.unsubscribeFocus(),X.unsubscribeFocus=void 0;if(X.unsubscribeOnline)X.unsubscribeOnline(),X.unsubscribeOnline=void 0;X.lastSync=0,X.lastSessionRequest=0,X.cachedSession=void 0},triggerRefetch:Y,broadcastSessionUpdate:G}}var q3=Object.create(null),z2=(D)=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(D?q3:globalThis),jD=new Proxy(q3,{get(D,F){return z2()[F]??q3[F]},has(D,F){return F in z2()||F in q3},set(D,F,u){let E=z2(!0);return E[F]=u,!0},deleteProperty(D,F){if(!F)return!1;let u=z2(!0);return delete u[F],!0},ownKeys(){let D=z2(!0);return Object.keys(D)}});var AU=typeof process<"u"&&process.env&&"development"||"";function o(D,F){if(typeof process<"u"&&process.env)return process.env[D]??F;if(typeof Deno<"u")return Deno.env.get(D)??F;if(typeof Bun<"u")return Bun.env[D]??F;return F}var UU=Object.freeze({get BETTER_AUTH_SECRET(){return o("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return o("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return o("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return o("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return o("NODE_ENV","development")},get PACKAGE_VERSION(){return o("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return o("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});var q2=1,GD=4,C0=8,vD=24,zZ={eterm:GD,cons25:GD,console:GD,cygwin:GD,dtterm:GD,gnome:GD,hurd:GD,jfbterm:GD,konsole:GD,kterm:GD,mlterm:GD,mosh:vD,putty:GD,st:GD,"rxvt-unicode-24bit":vD,terminator:vD,"xterm-kitty":vD},WU=new Map(Object.entries({APPVEYOR:C0,BUILDKITE:C0,CIRCLECI:vD,DRONE:C0,GITEA_ACTIONS:vD,GITHUB_ACTIONS:vD,GITLAB_CI:C0,TRAVIS:C0})),NU=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function H6(){if(o("FORCE_COLOR")!==void 0)switch(o("FORCE_COLOR")){case"":case"1":case"true":return GD;case"2":return C0;case"3":return vD;default:return q2}if(o("NODE_DISABLE_COLORS")!==void 0&&o("NODE_DISABLE_COLORS")!==""||o("NO_COLOR")!==void 0&&o("NO_COLOR")!==""||o("TERM")==="dumb")return q2;if(o("TMUX"))return vD;if("TF_BUILD"in jD&&"AGENT_NAME"in jD)return GD;if("CI"in jD){for(let{0:D,1:F}of WU)if(D in jD)return F;if(o("CI_NAME")==="codeship")return C0;return q2}if("TEAMCITY_VERSION"in jD)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(o("TEAMCITY_VERSION"))!==null?GD:q2;switch(o("TERM_PROGRAM")){case"iTerm.app":if(!o("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(o("TERM_PROGRAM_VERSION"))!==null)return C0;return vD;case"HyperTerm":case"MacTerm":return vD;case"Apple_Terminal":return C0}if(o("COLORTERM")==="truecolor"||o("COLORTERM")==="24bit")return vD;if(o("TERM")){if(/truecolor/.exec(o("TERM"))!==null)return vD;if(/^xterm-256/.exec(o("TERM"))!==null)return C0;let D=o("TERM").toLowerCase();if(zZ[D])return zZ[D];if(NU.some((F)=>F.exec(D)!==null))return GD}if(o("COLORTERM"))return GD;return q2}var sD={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",undim:"\x1B[22m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",fg:{black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},bg:{black:"\x1B[40m",red:"\x1B[41m",green:"\x1B[42m",yellow:"\x1B[43m",blue:"\x1B[44m",magenta:"\x1B[45m",cyan:"\x1B[46m",white:"\x1B[47m"}},A3=["debug","info","success","warn","error"];function qZ(D,F){return A3.indexOf(F)>=A3.indexOf(D)}var $U={info:sD.fg.blue,success:sD.fg.green,warn:sD.fg.yellow,error:sD.fg.red,debug:sD.fg.magenta},VU=(D,F,u)=>{let E=new Date().toISOString();if(u)return`${sD.dim}${E}${sD.reset} ${$U[D]}${D.toUpperCase()}${sD.reset} ${sD.bright}[Better Auth]:${sD.reset} ${F}`;return`${E} ${D.toUpperCase()} [Better Auth]: ${F}`},AZ=(D)=>{let F=D?.disabled!==!0,u=D?.level??"warn",E=D?.disableColors!==void 0?!D.disableColors:H6()!==1,B=(C,Z,J=[])=>{if(!F||!qZ(u,C))return;let X=VU(C,Z,E);if(!D||typeof D.log!=="function"){if(C==="error")console.error(X,...J);else if(C==="warn")console.warn(X,...J);else console.log(X,...J);return}D.log(C==="success"?"info":C,Z,...J)};return{...Object.fromEntries(A3.map((C)=>[C,(...[Z,...J])=>B(C,Z,J)])),get level(){return u}}},UZ=AZ();function Y6(D){return D}function X6(D){return D.charAt(0).toUpperCase()+D.slice(1)}var IU=Y6({USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account.",CROSS_SITE_NAVIGATION_LOGIN_BLOCKED:"Cross-site navigation login blocked. This request appears to be a CSRF attack.",VERIFICATION_EMAIL_NOT_ENABLED:"Verification email isn't enabled",EMAIL_ALREADY_VERIFIED:"Email is already verified",EMAIL_MISMATCH:"Email mismatch",SESSION_NOT_FRESH:"Session is not fresh",LINKED_ACCOUNT_ALREADY_EXISTS:"Linked account already exists",INVALID_ORIGIN:"Invalid origin",INVALID_CALLBACK_URL:"Invalid callbackURL",INVALID_REDIRECT_URL:"Invalid redirectURL",INVALID_ERROR_CALLBACK_URL:"Invalid errorCallbackURL",INVALID_NEW_USER_CALLBACK_URL:"Invalid newUserCallbackURL",MISSING_OR_NULL_ORIGIN:"Missing or null Origin",CALLBACK_URL_REQUIRED:"callbackURL is required",FAILED_TO_CREATE_VERIFICATION:"Unable to create verification",FIELD_NOT_ALLOWED:"Field not allowed to be set",ASYNC_VALIDATION_NOT_SUPPORTED:"Async validation is not supported",VALIDATION_ERROR:"Validation Error",MISSING_FIELD:"Field is required"});var _0=class extends Error{constructor(D,F){super(D,F);this.name="BetterAuthError",this.message=D,this.stack=""}};function MU(D){try{return(new URL(D).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new _0(`Invalid base URL: ${D}. Please provide a valid base URL.`)}}function TU(D){try{let F=new URL(D);if(F.protocol!=="http:"&&F.protocol!=="https:")throw new _0(`Invalid base URL: ${D}. URL must include 'http://' or 'https://'`)}catch(F){if(F instanceof _0)throw F;throw new _0(`Invalid base URL: ${D}. Please provide a valid base URL.`,{cause:F})}}function A2(D,F="/api/auth"){if(TU(D),MU(D))return D;let u=D.replace(/\/+$/,"");if(!F||F==="/")return u;return F=F.startsWith("/")?F:`/${F}`,`${u}${F}`}function WZ(D,F){if(!D||D.trim()==="")return!1;if(F==="proto")return D==="http"||D==="https";if(F==="host"){if([/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some((u)=>u.test(D)))return!1;return/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(D)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(D)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(D)||/^localhost(:[0-9]{1,5})?$/i.test(D)}return!1}function NZ(D,F,u,E,B){if(D)return A2(D,F);if(E!==!1){let J=jD.BETTER_AUTH_URL||jD.NEXT_PUBLIC_BETTER_AUTH_URL||jD.PUBLIC_BETTER_AUTH_URL||jD.NUXT_PUBLIC_BETTER_AUTH_URL||jD.NUXT_PUBLIC_AUTH_URL||(jD.BASE_URL!=="/"?jD.BASE_URL:void 0);if(J)return A2(J,F)}let C=u?.headers.get("x-forwarded-host"),Z=u?.headers.get("x-forwarded-proto");if(C&&Z&&B){if(WZ(Z,"proto")&&WZ(C,"host"))try{return A2(`${Z}://${C}`,F)}catch(J){}}if(u){let J=OU(u.url);if(!J)throw new _0("Could not get origin from request. Please provide a valid base URL.");return A2(J,F)}if(typeof window<"u"&&window.location)return A2(window.location.origin,F)}function OU(D){try{let F=new URL(D);return F.origin==="null"?null:F.origin}catch{return null}}var $Z={id:"redirect",name:"Redirect",hooks:{onSuccess(D){if(D.data?.url&&D.data?.redirect){if(typeof window<"u"&&window.location){if(window.location)try{window.location.href=D.data.url}catch{}}}}}};var _U={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},LU=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,VZ={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},RU=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function jU(D){return D instanceof Date&&!isNaN(D.getTime())}function SU(D){let F=RU.exec(D);if(!F)return null;let[,u,E,B,C,Z,J,X,H,Y,G]=F,K=new Date(Date.UTC(parseInt(u,10),parseInt(E,10)-1,parseInt(B,10),parseInt(C,10),parseInt(Z,10),parseInt(J,10),X?parseInt(X.padEnd(3,"0"),10):0));if(H){let Q=(parseInt(Y,10)*60+parseInt(G,10))*(H==="+"?-1:1);K.setUTCMinutes(K.getUTCMinutes()+Q)}return jU(K)?K:null}function PU(D,F={}){let{strict:u=!1,warnings:E=!1,reviver:B,parseDates:C=!0}=F;if(typeof D!=="string")return D;let Z=D.trim();if(Z.length>0&&Z[0]==='"'&&Z.endsWith('"')&&!Z.slice(1,-1).includes('"'))return Z.slice(1,-1);let J=Z.toLowerCase();if(J.length<=9&&J in VZ)return VZ[J];if(!LU.test(Z)){if(u)throw SyntaxError("[better-json] Invalid JSON");return D}if(Object.entries(_U).some(([X,H])=>{let Y=H.test(Z);if(Y&&E)console.warn(`[better-json] Detected potential prototype pollution attempt using ${X} pattern`);return Y})&&u)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(Z,(H,Y)=>{if(H==="__proto__"||H==="constructor"&&Y&&typeof Y==="object"&&"prototype"in Y){if(E)console.warn(`[better-json] Dropping "${H}" key to prevent prototype pollution`);return}if(C&&typeof Y==="string"){let G=SU(Y);if(G)return G}return B?B(H,Y):Y})}catch(X){if(u)throw X;return D}}function IZ(D,F={strict:!0}){return PU(D,F)}function MZ(D,F){let u=Q2(!1),E=z3(u,"/get-session",D,{method:"GET"});return K2(E,()=>{let B=J6({sessionAtom:E,sessionSignal:u,$fetch:D,options:F});return B.init(),()=>{B.cleanup()}}),{session:E,$sessionSignal:u}}function G6(D){if(D===null||typeof D!=="object")return!1;let F=Object.getPrototypeOf(D);if(F!==null&&F!==Object.prototype&&Object.getPrototypeOf(F)!==null)return!1;if(Symbol.iterator in D)return!1;if(Symbol.toStringTag in D)return Object.prototype.toString.call(D)==="[object Module]";return!0}function Q6(D,F,u=".",E){if(!G6(F))return Q6(D,{},u,E);let B={...F};for(let C of Object.keys(D)){if(C==="__proto__"||C==="constructor")continue;let Z=D[C];if(Z===null||Z===void 0)continue;if(E&&E(B,C,Z,u))continue;if(Array.isArray(Z)&&Array.isArray(B[C]))B[C]=[...Z,...B[C]];else if(G6(Z)&&G6(B[C]))B[C]=Q6(Z,B[C],(u?`${u}.`:"")+C.toString(),E);else B[C]=Z}return B}function K6(D){return(...F)=>F.reduce((u,E)=>Q6(u,E,"",D),{})}var TZ=K6(),_S=K6((D,F,u)=>{if(D[F]!==void 0&&typeof u==="function")return D[F]=u(D[F]),!0}),LS=K6((D,F,u)=>{if(Array.isArray(D[F])&&typeof u==="function")return D[F]=u(D[F]),!0});var{defineProperty:wU,defineProperties:xU,getOwnPropertyDescriptors:kU,getOwnPropertySymbols:OZ}=Object,yU=Object.prototype.hasOwnProperty,bU=Object.prototype.propertyIsEnumerable,_Z=(D,F,u)=>(F in D)?wU(D,F,{enumerable:!0,configurable:!0,writable:!0,value:u}):D[F]=u,oD=(D,F)=>{for(var u in F||(F={}))if(yU.call(F,u))_Z(D,u,F[u]);if(OZ){for(var u of OZ(F))if(bU.call(F,u))_Z(D,u,F[u])}return D},Z0=(D,F)=>xU(D,kU(F)),fU=class extends Error{constructor(D,F,u){super(F||D.toString(),{cause:u});this.status=D,this.statusText=F,this.error=u,Error.captureStackTrace(this,this.constructor)}},vU=async(D,F)=>{var u,E,B,C,Z,J;let X=F||{},H={onRequest:[F==null?void 0:F.onRequest],onResponse:[F==null?void 0:F.onResponse],onSuccess:[F==null?void 0:F.onSuccess],onError:[F==null?void 0:F.onError],onRetry:[F==null?void 0:F.onRetry]};if(!F||!(F==null?void 0:F.plugins))return{url:D,options:X,hooks:H};for(let Y of(F==null?void 0:F.plugins)||[]){if(Y.init){let G=await((u=Y.init)==null?void 0:u.call(Y,D.toString(),F));X=G.options||X,D=G.url}H.onRequest.push((E=Y.hooks)==null?void 0:E.onRequest),H.onResponse.push((B=Y.hooks)==null?void 0:B.onResponse),H.onSuccess.push((C=Y.hooks)==null?void 0:C.onSuccess),H.onError.push((Z=Y.hooks)==null?void 0:Z.onError),H.onRetry.push((J=Y.hooks)==null?void 0:J.onRetry)}return{url:D,options:X,hooks:H}},LZ=class{constructor(D){this.options=D}shouldAttemptRetry(D,F){if(this.options.shouldRetry)return Promise.resolve(D<this.options.attempts&&this.options.shouldRetry(F));return Promise.resolve(D<this.options.attempts)}getDelay(){return this.options.delay}},hU=class{constructor(D){this.options=D}shouldAttemptRetry(D,F){if(this.options.shouldRetry)return Promise.resolve(D<this.options.attempts&&this.options.shouldRetry(F));return Promise.resolve(D<this.options.attempts)}getDelay(D){return Math.min(this.options.maxDelay,this.options.baseDelay*2**D)}};function gU(D){if(typeof D==="number")return new LZ({type:"linear",attempts:D,delay:1000});switch(D.type){case"linear":return new LZ(D);case"exponential":return new hU(D);default:throw Error("Invalid retry strategy")}}var mU=async(D)=>{let F={},u=async(E)=>typeof E==="function"?await E():E;if(D==null?void 0:D.auth){if(D.auth.type==="Bearer"){let E=await u(D.auth.token);if(!E)return F;F.authorization=`Bearer ${E}`}else if(D.auth.type==="Basic"){let[E,B]=await Promise.all([u(D.auth.username),u(D.auth.password)]);if(!E||!B)return F;F.authorization=`Basic ${btoa(`${E}:${B}`)}`}else if(D.auth.type==="Custom"){let[E,B]=await Promise.all([u(D.auth.prefix),u(D.auth.value)]);if(!B)return F;F.authorization=`${E!=null?E:""} ${B}`}}return F},dU=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function cU(D){let F=D.headers.get("content-type"),u=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!F)return"json";let E=F.split(";").shift()||"";if(dU.test(E))return"json";if(u.has(E)||E.startsWith("text/"))return"text";return"blob"}function lU(D){try{return JSON.parse(D),!0}catch(F){return!1}}function z6(D){if(D===void 0)return!1;let F=typeof D;if(F==="string"||F==="number"||F==="boolean"||F===null)return!0;if(F!=="object")return!1;if(Array.isArray(D))return!0;if(D.buffer)return!1;return D.constructor&&D.constructor.name==="Object"||typeof D.toJSON==="function"}function RZ(D){try{return JSON.parse(D)}catch(F){return D}}function jZ(D){return typeof D==="function"}function pU(D){if(D==null?void 0:D.customFetchImpl)return D.customFetchImpl;if(typeof globalThis<"u"&&jZ(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&jZ(window.fetch))return window.fetch;throw Error("No fetch implementation found")}async function iU(D){let F=new Headers(D==null?void 0:D.headers),u=await mU(D);for(let[E,B]of Object.entries(u||{}))F.set(E,B);if(!F.has("content-type")){let E=nU(D==null?void 0:D.body);if(E)F.set("content-type",E)}return F}function nU(D){if(z6(D))return"application/json";return null}function aU(D){if(!(D==null?void 0:D.body))return null;let F=new Headers(D==null?void 0:D.headers);if(z6(D.body)&&!F.has("content-type")){for(let[u,E]of Object.entries(D==null?void 0:D.body))if(E instanceof Date)D.body[u]=E.toISOString();return JSON.stringify(D.body)}if(F.has("content-type")&&F.get("content-type")==="application/x-www-form-urlencoded"){if(z6(D.body))return new URLSearchParams(D.body).toString();return D.body}return D.body}function rU(D,F){var u;if(F==null?void 0:F.method)return F.method.toUpperCase();if(D.startsWith("@")){let E=(u=D.split("@")[1])==null?void 0:u.split("/")[0];if(!SZ.includes(E))return(F==null?void 0:F.body)?"POST":"GET";return E.toUpperCase()}return(F==null?void 0:F.body)?"POST":"GET"}function sU(D,F){let u;if(!(D==null?void 0:D.signal)&&(D==null?void 0:D.timeout))u=setTimeout(()=>F==null?void 0:F.abort(),D==null?void 0:D.timeout);return{abortTimeout:u,clearTimeout:()=>{if(u)clearTimeout(u)}}}var oU=class D extends Error{constructor(F,u){super(u||JSON.stringify(F,null,2));this.issues=F,Object.setPrototypeOf(this,D.prototype)}};async function U3(D,F){let u=await D["~standard"].validate(F);if(u.issues)throw new oU(u.issues);return u.value}var SZ=["get","post","put","patch","delete"];var tU=(D)=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(F,u){var E,B,C,Z;let J=((B=(E=D.plugins)==null?void 0:E.find((X)=>{var H;return((H=X.schema)==null?void 0:H.config)?F.startsWith(X.schema.config.baseURL||"")||F.startsWith(X.schema.config.prefix||""):!1}))==null?void 0:B.schema)||D.schema;if(J){let X=F;if((C=J.config)==null?void 0:C.prefix){if(X.startsWith(J.config.prefix)){if(X=X.replace(J.config.prefix,""),J.config.baseURL)F=F.replace(J.config.prefix,J.config.baseURL)}}if((Z=J.config)==null?void 0:Z.baseURL){if(X.startsWith(J.config.baseURL))X=X.replace(J.config.baseURL,"")}let H=J.schema[X];if(H){let Y=Z0(oD({},u),{method:H.method,output:H.output});if(!(u==null?void 0:u.disableValidation))Y=Z0(oD({},Y),{body:H.input?await U3(H.input,u==null?void 0:u.body):u==null?void 0:u.body,params:H.params?await U3(H.params,u==null?void 0:u.params):u==null?void 0:u.params,query:H.query?await U3(H.query,u==null?void 0:u.query):u==null?void 0:u.query});return{url:F,options:Y}}}return{url:F,options:u}}}),PZ=(D)=>{async function F(u,E){let B=Z0(oD(oD({},D),E),{plugins:[...(D==null?void 0:D.plugins)||[],tU(D||{}),...(E==null?void 0:E.plugins)||[]]});if(D==null?void 0:D.catchAllError)try{return await q6(u,B)}catch(C){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:C}}}return await q6(u,B)}return F};function eU(D,F){let{baseURL:u,params:E,query:B}=F||{query:{},params:{},baseURL:""},C=D.startsWith("http")?D.split("/").slice(0,3).join("/"):u||"";if(D.startsWith("@")){let G=D.toString().split("@")[1].split("/")[0];if(SZ.includes(G))D=D.replace(`@${G}/`,"/")}if(!C.endsWith("/"))C+="/";let[Z,J]=D.replace(C,"").split("?"),X=new URLSearchParams(J);for(let[G,K]of Object.entries(B||{})){if(K==null)continue;let Q;if(typeof K==="string")Q=K;else if(Array.isArray(K)){for(let z of K)X.append(G,z);continue}else Q=JSON.stringify(K);X.set(G,Q)}if(E)if(Array.isArray(E)){let G=Z.split("/").filter((K)=>K.startsWith(":"));for(let[K,Q]of G.entries()){let z=E[K];Z=Z.replace(Q,z)}}else for(let[G,K]of Object.entries(E))Z=Z.replace(`:${G}`,String(K));if(Z=Z.split("/").map(encodeURIComponent).join("/"),Z.startsWith("/"))Z=Z.slice(1);let H=X.toString();if(H=H.length>0?`?${H}`.replace(/\+/g,"%20"):"",!C.startsWith("http"))return`${C}${Z}${H}`;return new URL(`${Z}${H}`,C)}var q6=async(D,F)=>{var u,E,B,C,Z,J,X,H;let{hooks:Y,url:G,options:K}=await vU(D,F),Q=pU(K),z=new AbortController,q=(u=K.signal)!=null?u:z.signal,U=eU(G,K),N=aU(K),M=await iU(K),$=rU(G,K),W=Z0(oD({},K),{url:U,headers:M,body:N,method:$,signal:q});for(let w of Y.onRequest)if(w){let R=await w(W);if(typeof R==="object"&&R!==null)W=R}if("pipeTo"in W&&typeof W.pipeTo==="function"||typeof((E=F==null?void 0:F.body)==null?void 0:E.pipe)==="function"){if(!("duplex"in W))W.duplex="half"}let{clearTimeout:j}=sU(K,z),P=await Q(W.url,W);j();let L={response:P,request:W};for(let w of Y.onResponse)if(w){let R=await w(Z0(oD({},L),{response:((B=F==null?void 0:F.hookOptions)==null?void 0:B.cloneResponse)?P.clone():P}));if(R instanceof Response)P=R;else if(typeof R==="object"&&R!==null)P=R.response}if(P.ok){if(W.method==="HEAD")return{data:"",error:null};let R=cU(P),S={data:null,response:P,request:W};if(R==="json"||R==="text"){let b=await P.text(),f=(C=W.jsonParser)!=null?C:RZ;S.data=await f(b)}else S.data=await P[R]();if(W==null?void 0:W.output){if(W.output&&!W.disableValidation)S.data=await U3(W.output,S.data)}for(let b of Y.onSuccess)if(b)await b(Z0(oD({},S),{response:((Z=F==null?void 0:F.hookOptions)==null?void 0:Z.cloneResponse)?P.clone():P}));if(F==null?void 0:F.throw)return S.data;return{data:S.data,error:null}}let v=(J=F==null?void 0:F.jsonParser)!=null?J:RZ,V=await P.text(),_=lU(V),O=_?await v(V):null,g={response:P,responseText:V,request:W,error:Z0(oD({},O),{status:P.status,statusText:P.statusText})};for(let w of Y.onError)if(w)await w(Z0(oD({},g),{response:((X=F==null?void 0:F.hookOptions)==null?void 0:X.cloneResponse)?P.clone():P}));if(F==null?void 0:F.retry){let w=gU(F.retry),R=(H=F.retryAttempt)!=null?H:0;if(await w.shouldAttemptRetry(R,P)){for(let b of Y.onRetry)if(b)await b(L);let S=w.getDelay(R);return await new Promise((b)=>setTimeout(b,S)),await q6(D,Z0(oD({},F),{retryAttempt:R+1}))}}if(F==null?void 0:F.throw)throw new fU(P.status,P.statusText,_?O:V);return{data:null,error:Z0(oD({},O),{status:P.status,statusText:P.statusText})}};var wZ=(D,F)=>{let u="credentials"in Request.prototype,E=NZ(D?.baseURL,D?.basePath,void 0,F)??"/api/auth",B=D?.plugins?.flatMap((W)=>W.fetchPlugins).filter((W)=>W!==void 0)||[],C={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:D?.fetchOptions?.onSuccess,onError:D?.fetchOptions?.onError,onRequest:D?.fetchOptions?.onRequest,onResponse:D?.fetchOptions?.onResponse}},{onSuccess:Z,onError:J,onRequest:X,onResponse:H,...Y}=D?.fetchOptions||{},G=PZ({baseURL:E,...u?{credentials:"include"}:{},method:"GET",jsonParser(W){if(!W)return null;return IZ(W,{strict:!1})},customFetchImpl:fetch,...Y,plugins:[C,...Y.plugins||[],...D?.disableDefaultFetchPlugins?[]:[$Z],...B]}),{$sessionSignal:K,session:Q}=MZ(G,D),z=D?.plugins||[],q={},U={$sessionSignal:K,session:Q},N={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},M=[{signal:"$sessionSignal",matcher(W){return W==="/sign-out"||W==="/update-user"||W==="/sign-up/email"||W==="/sign-in/email"||W==="/delete-user"||W==="/verify-email"||W==="/revoke-sessions"||W==="/revoke-session"||W==="/change-email"}}];for(let W of z){if(W.getAtoms)Object.assign(U,W.getAtoms?.(G));if(W.pathMethods)Object.assign(N,W.pathMethods);if(W.atomListeners)M.push(...W.atomListeners)}let $={notify:(W)=>{U[W].set(!U[W].get())},listen:(W,j)=>{U[W].subscribe(j)},atoms:U};for(let W of z)if(W.getActions)q=TZ(W.getActions?.(G,$,D)??{},q);return{get baseURL(){return E},pluginsActions:q,pluginsAtoms:U,pluginPathMethods:N,atomListeners:M,$fetch:G,$store:$}};function xZ(D){return typeof D==="object"&&D!==null&&"get"in D&&typeof D.get==="function"&&"lc"in D&&typeof D.lc==="number"}function DW(D,F,u){let E=F[D],{fetchOptions:B,query:C,...Z}=u||{};if(E)return E;if(B?.method)return B.method;if(Z&&Object.keys(Z).length>0)return"POST";return"GET"}function kZ(D,F,u,E,B){function C(Z=[]){return new Proxy(function(){},{get(J,X){if(typeof X!=="string")return;if(X==="then"||X==="catch"||X==="finally")return;let H=[...Z,X],Y=D;for(let G of H)if(Y&&typeof Y==="object"&&G in Y)Y=Y[G];else{Y=void 0;break}if(typeof Y==="function")return Y;if(xZ(Y))return Y;return C(H)},apply:async(J,X,H)=>{let Y="/"+Z.map((M)=>M.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)).join("/"),G=H[0]||{},K=H[1]||{},{query:Q,fetchOptions:z,...q}=G,U={...K,...z},N=DW(Y,u,G);return await F(Y,{...U,body:N==="GET"?void 0:{...q,...U?.body||{}},query:Q||U?.query,method:N,async onSuccess(M){if(await U?.onSuccess?.(M),!B||U.disableSignal)return;let $=B.filter((j)=>j.matcher(Y));if(!$.length)return;let W=new Set;for(let j of $){let P=E[j.signal];if(!P)return;if(W.has(j.signal))continue;W.add(j.signal);let L=P.get();setTimeout(()=>{P.set(!L)},10)}}})}})}return C()}function A6(D){let{pluginPathMethods:F,pluginsActions:u,pluginsAtoms:E,$fetch:B,atomListeners:C,$store:Z}=wZ(D),J={};for(let[X,H]of Object.entries(E))J[`use${X6(X)}`]=H;return kZ({...u,...J,$fetch:B,$store:Z},B,F,E,C)}function yZ(D){return{authorize(F,u="AND"){let E=!1;for(let[B,C]of Object.entries(F)){let Z=D[B];if(!Z)return{success:!1,error:`You are not allowed to access resource: ${B}`};if(Array.isArray(C))E=C.every((J)=>Z.includes(J));else if(typeof C==="object"){let J=C;if(J.connector==="OR")E=J.actions.some((X)=>Z.includes(X));else E=J.actions.every((X)=>Z.includes(X))}else throw new _0("Invalid access control request");if(E&&u==="OR")return{success:E};if(!E&&u==="AND")return{success:!1,error:`unauthorized to access resource "${B}"`}}if(E)return{success:E};return{success:!1,error:"Not authorized"}},statements:D}}function U2(D){return{newRole(F){return yZ(F)},statements:D}}var bZ={user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]},U6=U2(bZ),fZ=U6.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),vZ=U6.newRole({user:[],session:[]});var W6=()=>{return{id:"device-authorization",$InferServerPlugin:{},pathMethods:{"/device/code":"POST","/device/token":"POST","/device":"GET","/device/approve":"POST","/device/deny":"POST"}}};var hZ={organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]},W3=U2(hZ),gZ=W3.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),mZ=W3.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),dZ=W3.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]});var N6="photon-cli",cZ="openid profile email";function N3(D){return A6({baseURL:D,plugins:[W6()]})}function lZ(D){D.command("login").description("authenticate via the device authorization flow").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("--no-browser","don't auto-open the verification URL").action(async(F)=>{try{await BW(F)}catch(u){if(u instanceof r0||u instanceof L0)I(u.message);throw u}})}async function BW({apiHost:D,browser:F=!0}){let u=await PD(D);console.log(A.info(`Authenticating to ${A.bold(u.name)} ${A.dim(`(${u.url})`)}`));let E=N3(u.url),B;try{B=await E.device.code({client_id:N6,scope:cZ})}catch(q){I(`Could not reach ${u.url} — ${q instanceof Error?q.message:String(q)}`)}if(B.error||!B.data)I(`Failed to start device flow: ${h(B.error)}`);let{device_code:C,user_code:Z,verification_uri:J,verification_uri_complete:X,interval:H=5,expires_in:Y=1800}=B.data;if(console.log(),console.log(` ${A.dim("Visit:")} ${A.underline(A.cyan(J))}`),console.log(` ${A.dim("Code: ")} ${A.bold(Z)}`),console.log(),F){let q=X??J;try{await F3(q),console.log(A.dim(` Opened ${q}`))}catch{}}else console.log(A.dim(" --no-browser set; open the URL above manually"));console.log();let G=cC();G.start(`Waiting for approval (polling every ${H}s)`);let K=await CW({auth:E,deviceCode:C,initialInterval:H,expiresInSec:Y,onSlowDown:(q)=>{G.message(`Server asked us to slow down — polling every ${q}s`)}}).catch((q)=>{throw G.error(q instanceof Error?q.message:"Failed"),q});G.stop("Authorized");let z=(await E.getSession({fetchOptions:{headers:{Authorization:`Bearer ${K}`}}})).data?.user;if(!z)I("Token issued but session lookup failed — server might be misconfigured.");await XC({accessToken:K,user:{id:z.id,email:z.email,name:z.name},envName:u.name,apiUrl:u.url,issuedAt:new Date().toISOString()}),console.log(),console.log(A.success(`Logged in to ${A.bold(u.name)} as ${A.bold(z.email)}`))}async function CW(D){let F=D.initialInterval,u=Date.now()+D.expiresInSec*1000;while(Date.now()<u){await new Promise((Z)=>setTimeout(Z,F*1000));let E=await D.auth.device.token({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:D.deviceCode,client_id:N6});if(E.data?.access_token)return E.data.access_token;let B=ZW(E.error);if(JW(E.error)===429){F+=10,D.onSlowDown(F);continue}switch(B){case"authorization_pending":continue;case"slow_down":F+=5,D.onSlowDown(F);continue;case"access_denied":throw new r0;case"expired_token":throw new L0;default:throw Error(`Device flow error: ${h(E.error)}`)}}throw new L0}function ZW(D){if(D&&typeof D==="object"&&"error"in D){let F=D.error;return typeof F==="string"?F:void 0}return}function JW(D){if(D&&typeof D==="object"&&"status"in D){let F=D.status;return typeof F==="number"?F:void 0}return}function pZ(D){D.command("logout").description("clear stored credentials for the active backend").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").action(async(F)=>{let u=await PD(F.apiHost),E=await qF(u.name);if(!E){console.log(A.dim(`Not logged in to ${A.bold(u.name)} — nothing to do.`));return}try{await N3(E.apiUrl).signOut({fetchOptions:{headers:{Authorization:`Bearer ${E.accessToken}`}}})}catch{}await GC(u.name),console.log(A.success(`Logged out of ${A.bold(u.name)}`))})}function iZ(D){D.command("ping").description("hit the Photon Dashboard /api/health endpoint").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-u, --url <url>","raw API URL (bypasses env resolution)").action(async(F)=>{let{api:u,env:E}=await i({apiHost:F.apiHost,url:F.url});console.log(A.dim(`→ ${E.url}`));let B=performance.now(),{data:C,error:Z,status:J}=await u.api.health.get(),X=Math.round(performance.now()-B);if(Z)console.error(A.error(`${J} (${X}ms): ${h(Z)}`)),process.exit(1);console.log(A.success(`${J} (${X}ms): ${JSON.stringify(C)}`))})}function aZ(D){let F=D.command("profile").description("view or manage your developer / organization profile");HW(F),YW(F),QW(F)}function HW(D){D.command("show",{isDefault:!0}).description("show your profile").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{api:u,creds:E,env:B}=await i({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:C,error:Z}=await u.api.profile.get();if(Z){if(Z.status===401)throw new d(B.name);I(`Failed to fetch profile: ${h(Z)}`)}let J=C;if(F.json){a({user:E?.user??null,profile:J});return}if(E)console.log(A.bold(E.user.name)+A.dim(` <${E.user.email}>`));else console.log(A.dim(`token-authenticated on env ${B.name}`));if(console.log(),!J){console.log(A.dim("No developer or organization profile yet.")),console.log(A.hint("Set one up: `photon profile init`."));return}console.log(A.bold(`${J.type} profile`));let X=J.profile,H=Object.entries(X).filter(([G])=>!["id","userId","createdAt","updatedAt"].includes(G)),Y=Math.max(...H.map(([G])=>G.length));for(let[G,K]of H)console.log(` ${A.dim(G.padEnd(Y))} ${KW(K)}`)})}function YW(D){D.command("init").description("set up your developer or organization profile").option("--type <type>","developer | organization").option("--languages <list>","developer: comma-separated languages").option("--referral <text>","how did you hear about us?").option("--company-name <name>","organization: company name").option("--role <role>","organization: your role").option("--company-size <size>","organization: company size (e.g. 1-10, 11-50)").option("--website <url>","organization: company website").option("--platforms <list>","organization: comma-separated platforms").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{api:u,env:E}=await i({apiHost:F.apiHost,token:F.token,requireAuth:!0}),B=await u.api.profile.get();if(B.status===401)throw new d(E.name);if(B.error)I(`Failed to check existing profile: ${h(B.error)}`);if(B.data)I("A profile already exists for this account.",{hint:"Use `photon profile update` to change it."});let{type:C,payload:Z}=await XW(F);if(C==="developer"){let J=await u.api.profile.developer.post(Z);if(J.status===401)throw new d(E.name);if(J.error)I(`Failed to save profile: ${h(J.error)}`)}else{let J=await u.api.profile.organization.post(Z);if(J.status===401)throw new d(E.name);if(J.error)I(`Failed to save profile: ${h(J.error)}`)}if(F.json){a({type:C,profile:Z});return}console.log(A.success(`Created ${C} profile.`))})}async function XW(D){if(!yD()){if(!D.type)I("--type is required in non-interactive mode (developer | organization).");if(D.type!=="developer"&&D.type!=="organization")I(`Unknown profile type "${D.type}". Use "developer" or "organization".`);if(D.type==="developer"){if(!(D.languages!==void 0||D.referral!==void 0))I("At least one of --languages / --referral is required for a developer profile.",{hint:"Pass `--languages typescript,python` and/or `--referral 'word of mouth'`."});return{type:"developer",payload:{languages:n0(D.languages??""),referralSource:D.referral??""}}}if(!(D.companyName!==void 0||D.role!==void 0||D.companySize!==void 0||D.website!==void 0||D.platforms!==void 0||D.referral!==void 0))I("At least one organization field is required (--company-name, --role, --company-size, --website, --platforms, --referral).");return{type:"organization",payload:{companyName:D.companyName,role:D.role,companySize:D.companySize,website:D.website,platforms:D.platforms!==void 0?n0(D.platforms):void 0,referralSource:D.referral}}}a8(A.cyan("Set up your profile"));let F=D.type;if(!F){let X=await r8({message:"What kind of profile?",options:[{value:"developer",label:"Developer",hint:"individual contributor"},{value:"organization",label:"Organization",hint:"company / team"}]});if(UD(X))I("Aborted.");F=String(X)}if(F!=="developer"&&F!=="organization")I(`Unknown profile type "${F}". Use "developer" or "organization".`);if(F==="developer"){let X=await nZ("Languages (comma-separated, e.g. typescript,python)",D.languages),H=await GW("How did you hear about us?",D.referral);return Z2(A.dim("Submitting…")),{type:"developer",payload:{languages:X,referralSource:H}}}let u=await W2("Company name",D.companyName),E=await W2("Your role",D.role),B=await W2("Company size (e.g. 1-10, 11-50, 51-200)",D.companySize),C=await W2("Website URL",D.website),Z=D.platforms!==void 0?n0(D.platforms):await nZ("Platforms (comma-separated, e.g. ios,android,web)",void 0,!0),J=await W2("How did you hear about us?",D.referral);return Z2(A.dim("Submitting…")),{type:"organization",payload:{companyName:u,role:E,companySize:B,website:C,platforms:Z.length>0?Z:void 0,referralSource:J}}}async function GW(D,F){if(F!==void 0)return F;let u=await Q0({message:D});if(UD(u))I("Aborted.");return u??""}async function W2(D,F){if(F!==void 0)return F;let u=await Q0({message:D,placeholder:"(skip)"});if(UD(u))I("Aborted.");let E=u?.trim();return E?E:void 0}async function nZ(D,F,u=!1){if(F!==void 0)return n0(F);let E=await Q0({message:D,placeholder:u?"(skip)":void 0});if(UD(E))I("Aborted.");return n0(E??"")}function n0(D){return D.split(",").map((F)=>F.trim()).filter(Boolean)}function QW(D){D.command("update").alias("edit").description("update your existing profile (preserves unchanged fields)").option("--languages <list>","developer: comma-separated languages").option("--referral <text>","how did you hear about us?").option("--company-name <name>","organization: company name").option("--role <role>","organization: your role").option("--company-size <size>","organization: company size").option("--website <url>","organization: company website").option("--platforms <list>","organization: comma-separated platforms").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{if(!(F.languages!==void 0||F.referral!==void 0||F.companyName!==void 0||F.role!==void 0||F.companySize!==void 0||F.website!==void 0||F.platforms!==void 0))I("Nothing to update.",{hint:"Pass at least one field flag — see `photon profile update --help`."});let{api:E,env:B}=await i({apiHost:F.apiHost,token:F.token,requireAuth:!0}),C=await E.api.profile.get();if(C.status===401)throw new d(B.name);if(C.error)I(`Failed to fetch profile: ${h(C.error)}`);let Z=C.data;if(!Z)I("No profile to update.",{hint:"Create one first: `photon profile init`."});let J=["--languages"],X=["--company-name","--role","--company-size","--website","--platforms"],H=[];if(F.languages!==void 0)H.push("--languages");let Y=[];if(F.companyName!==void 0)Y.push("--company-name");if(F.role!==void 0)Y.push("--role");if(F.companySize!==void 0)Y.push("--company-size");if(F.website!==void 0)Y.push("--website");if(F.platforms!==void 0)Y.push("--platforms");if(Z.type==="developer"&&Y.length>0)I(`Flags ${Y.join(", ")} apply to organization profiles, but yours is a developer profile.`,{hint:`Valid flags for developer: ${J.join(", ")}, --referral.`});if(Z.type==="organization"&&H.length>0)I(`Flags ${H.join(", ")} apply to developer profiles, but yours is an organization profile.`,{hint:`Valid flags for organization: ${X.join(", ")}, --referral.`});if(Z.type==="developer"){let G=Z.profile,K={languages:F.languages!==void 0?n0(F.languages):G.languages??[],referralSource:F.referral??G.referralSource??""},Q=await E.api.profile.developer.post(K);if(Q.status===401)throw new d(B.name);if(Q.error)I(`Failed to update profile: ${h(Q.error)}`);if(F.json)return a({type:"developer",profile:K});console.log(A.success("Developer profile updated."))}else{let G=Z.profile,K={companyName:F.companyName??G.companyName,role:F.role??G.role,companySize:F.companySize??G.companySize,website:F.website??G.website,platforms:F.platforms!==void 0?n0(F.platforms):G.platforms,referralSource:F.referral??G.referralSource},Q=await E.api.profile.organization.post(K);if(Q.status===401)throw new d(B.name);if(Q.error)I(`Failed to update profile: ${h(Q.error)}`);if(F.json)return a({type:"organization",profile:K});console.log(A.success("Organization profile updated."))}})}function KW(D){if(D===null||D===void 0||D==="")return A.dim("—");if(typeof D==="boolean")return D?A.green("yes"):A.dim("no");if(D instanceof Date)return D.toLocaleString();if(typeof D==="object")return JSON.stringify(D);return String(D)}async function a0(D){if(D.yes)return;if(!yD())I("Confirmation required for this destructive action.",{hint:D.fallbackHint??"Pass --yes to confirm."});let F=await n8({message:D.message,initialValue:!1});if(UD(F)||!F)I("Aborted.")}function sZ(D){let F=D.command("projects").alias("project").description("manage your Photon Dashboard projects");zW(F),qW(F),AW(F),WW(F),NW(F),$W(F),VW(F),IW(F),TW(F)}function zW(D){D.command("list",{isDefault:!0}).alias("ls").description("list your projects").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let{api:u,env:E}=await i({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:B,error:C}=await u.api.projects.get();if(C){if(C.status===401)throw new d(E.name);I(`Failed to list projects: ${h(C)}`)}let Z=B??[];if(F.json){a(Z);return}if(Z.length===0){console.log(A.dim("No projects yet.")),console.log(A.hint("Create one with `photon projects create`."));return}let J=Z.map((X)=>[OW(X.id,8),X.name,X.location,oZ(X.status),X.spectrum?A.green("on"):A.dim("off"),new Date(X.updatedAt).toLocaleDateString()]);hD(["id","name","location","status","spectrum","updated"],J)})}function qW(D){D.command("show [id]").alias("get").description("show details for one project (defaults to $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F,u)=>{let{projectId:E,env:B}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).get();if(X===401)throw new d(B.name);if(X===404||!J&&!Z)I(`Project not found: ${E}`,{hint:"List your projects with `photon projects ls`."});if(J)I(`Failed to fetch project: ${h(J)}`);if(u.json){a(Z);return}let H=Z;console.log(A.bold(H.name)+A.dim(` (${H.id})`)),console.log(),_W([["status",oZ(H.status)],["location",H.location],["spectrum",H.spectrum?A.green("enabled"):A.dim("disabled")],["spectrumProjectId",H.spectrumProjectId??A.dim("—")],["template",H.template?"yes":"no"],["observability",H.observability?"yes":"no"],["subscription",H.subscriptionStatus??A.dim("—")],["createdAt",new Date(H.createdAt).toLocaleString()],["updatedAt",new Date(H.updatedAt).toLocaleString()]])})}function AW(D){D.command("create").alias("new").description("create a new project").option("-n, --name <name>","project name").option("-l, --location <location>",'location (default: "United States")').option("--spectrum","enable Spectrum").option("--no-spectrum","disable Spectrum").option("--template","use as template").option("--observability","enable observability").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F)=>{let u=await UW(F),{api:E,env:B}=await i({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:C,error:Z,status:J}=await E.api.projects.post({name:u.name,location:u.location,spectrum:u.spectrum,template:u.template,observability:u.observability});if(J===401)throw new d(B.name);if(Z)I(`Failed to create project: ${h(Z)}`);let X=C;if(X.error)I(X.error);if(!X.id)I("Server did not return a project id.");if(F.json){a({id:X.id,name:u.name,env:B.name});return}console.log(A.success(`Created ${A.bold(u.name)} ${A.dim(`(${X.id})`)} on ${A.bold(B.name)}`)),console.log(A.dim(` To make this the active project: export PHOTON_PROJECT_ID='${X.id}'`))})}async function UW(D){if(!yD()){if(!D.name?.trim())I("--name is required in non-interactive mode.",{hint:"Run from a terminal for the interactive prompt, or pass --name <name>."});return{name:D.name.trim(),location:D.location??"United States",spectrum:D.spectrum??!1,template:D.template??!1,observability:D.observability??!1}}a8(A.cyan("Create a new project"));let F=D.name?.trim();if(!F){let Z=await Q0({message:"Project name",validate:(J)=>J&&J.trim()?void 0:"Project name is required"});if(UD(Z))I("Aborted.");F=Z.trim()}let u=D.location;if(u===void 0){let Z=await Q0({message:"Location",placeholder:"United States",defaultValue:"United States"});if(UD(Z))I("Aborted.");u=Z||"United States"}let E=D.spectrum??await $6("Enable Spectrum?",!1),B=D.template??await $6("Use as template?",!1),C=D.observability??await $6("Enable observability?",!1);return Z2(A.dim("Submitting…")),{name:F,location:u,spectrum:E,template:B,observability:C}}async function $6(D,F){let u=await n8({message:D,initialValue:F});if(UD(u))I("Aborted.");return Boolean(u)}function WW(D){D.command("update [id]").alias("edit").alias("set").description("update an existing project (defaults to $PHOTON_PROJECT_ID)").option("-n, --name <name>","new name").option("--spectrum","enable Spectrum").option("--no-spectrum","disable Spectrum").option("--template","use as template").option("--no-template","stop using as template").option("--observability","enable observability").option("--no-observability","disable observability").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F,u)=>{let E=u.name?.trim();if(u.name!==void 0&&!E)I("--name must not be empty.",{hint:"Either pass a non-empty name or omit --name to keep the current one."});if(!(E!==void 0||u.spectrum!==void 0||u.template!==void 0||u.observability!==void 0))I("Nothing to update.",{hint:"Pass at least one of --name / --spectrum / --template / --observability."});let{projectId:C,env:Z}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),{api:J}=await i({apiHost:Z.url,token:u.token,requireAuth:!0}),X=await J.api.projects({id:C}).get();if(X.status===401)throw new d(Z.name);if(X.status===404||!X.error&&!X.data)I(`Project not found: ${C}`,{hint:"List your projects with `photon projects ls`."});if(X.error||!X.data)I(`Failed to load current project: ${h(X.error)}`);let H=X.data,Y={name:E??H.name,spectrum:u.spectrum??H.spectrum,template:u.template??H.template,observability:u.observability??H.observability},{error:G,status:K,data:Q}=await J.api.projects({id:C}).patch(Y);if(K===401)throw new d(Z.name);if(G)I(`Failed to update project: ${h(G)}`);let z=Q;if(z.error)I(z.error);if(u.json){a({id:C,...Y});return}console.log(A.success(`Updated ${A.bold(Y.name)} ${A.dim(`(${C})`)}`))})}function NW(D){D.command("delete [id]").alias("rm").alias("remove").description("permanently delete a project (defaults to $PHOTON_PROJECT_ID)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("-y, --yes","skip confirmation").action(async(F,u)=>{let{projectId:E,env:B}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0}),Z=await C.api.projects({id:E}).get();if(Z.status===401)throw new d(B.name);if(Z.status===404||!Z.error&&!Z.data)I(`Project not found: ${E}`,{hint:"Already deleted? `photon projects ls` to confirm."});if(Z.error)I(`Failed to look up project: ${h(Z.error)}`);let J=Z.data;await a0({message:`Delete project ${A.bold(J.name)} (${E})? This cannot be undone.`,yes:u.yes??!1,fallbackHint:`Pass --yes to delete ${J.name}.`});let{error:X,status:H}=await C.api.projects({id:E}).delete();if(H===401)throw new d(B.name);if(X)I(`Failed to delete project: ${h(X)}`);if(console.log(A.success(`Deleted ${A.bold(J.name)} ${A.dim(`(${E})`)}`)),process.env.PHOTON_PROJECT_ID===E)console.error(A.warn("Active project just deleted. Run `unset PHOTON_PROJECT_ID` to clear."))})}function $W(D){D.command("regenerate-secret [id]").alias("rotate-secret").description("rotate the project's Spectrum API secret (defaults to $PHOTON_PROJECT_ID)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("-y, --yes","skip confirmation").option("--json","output JSON").action(async(F,u)=>{let{projectId:E,env:B}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0});await a0({message:`Rotate the API secret for project ${E}? Existing integrations using the old secret will stop working immediately.`,yes:u.yes??!1,fallbackHint:"Pass --yes to rotate the secret."});let{data:Z,error:J,status:X}=await C.api.projects({id:E})["regenerate-secret"].post();if(X===401)throw new d(B.name);if(J)I(`Failed to rotate secret: ${h(J)}`);let H=Z;if(H.error)I(H.error);if(!H.projectSecret)I("Server did not return a new secret.");if(u.json){a({id:E,projectSecret:H.projectSecret});return}console.log(A.success(`New secret for ${E}:`)),console.log(` ${A.bold(H.projectSecret)}`),M0.warn("This is shown once. Store it somewhere safe — re-rotating is the only way to recover.")})}function VW(D){D.command("open [id]").description("open the project in the dashboard web UI (defaults to $PHOTON_PROJECT_ID)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("--no-browser","print the URL instead of launching a browser").action(async(F,u)=>{let{projectId:E,env:B}=await e({flagProjectId:F??u.project,apiHost:u.apiHost}),C=new URL(`/dashboard/${E}`,B.url).toString();await H2(C,{noBrowser:!u.browser,label:"URL"})})}function IW(D){D.command("upgrade [id] [tier]").description("subscribe / pay for a project (smart-routes to Stripe checkout or billing portal)").option("--plan <price-id>","Stripe price id (escape hatch; overrides tier picker)").option("--qty <n>","quantity (default 1)",J3).option("--checkout","force checkout flow (even if currently subscribed)").option("--manage","force Stripe portal (downgrade / cancel / change card)").option("-p, --project <id>","project id (overrides positional [id] and $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--no-browser","print the URL instead of launching a browser").option("--json","output JSON ({action,url,tier?}) and skip browser open").action(async(F,u,E)=>{if(E.checkout&&E.manage)I("--checkout and --manage are mutually exclusive.");let B=F,C=rZ(u);if(!C&&B&&MW(B)&&!u)C=rZ(B),B=void 0;if(u&&!C)I(`Unknown tier "${u}".`,{hint:`Use one of: ${T0.join(", ")} — or pass --plan <price-id>.`});let{projectId:Z,env:J}=await e({flagProjectId:E.project??B,apiHost:E.apiHost}),{api:X}=await i({apiHost:J.url,token:E.token,requireAuth:!0}),H=Y2({explicitNoBrowser:E.browser===!1,json:E.json??!1}),Y;if(E.manage)Y="manage";else if(E.checkout||E.plan||C)Y="checkout";else{let Q=await HZ(X,Z,J.name);if(Q.tier==="unknown")I(`Cannot determine the subscription state of project ${Z}.`,{hint:"Re-run with --checkout to subscribe, or --manage to open the Stripe portal."});if(Y=Q.status==="active"||Q.status==="past_due"?"manage":"checkout",Y==="manage"&&!E.json)console.log(A.info(`Project ${A.bold(Z)} is on ${Q.tier??"—"} (${Q.status??"—"}). Opening Stripe portal…`)),console.log(A.dim(" To pick a different plan instead, re-run with --checkout."))}if(Y==="manage"){await Z3({api:X,projectId:Z,envName:J.name,json:E.json??!1,noBrowser:H});return}let G,K;if(E.plan)G=E.plan;else if(C){let Q=await $F(X,J.name),z=u3(Q,C),q=z?.prices?.length===1?z.prices[0]:void 0;if(!z||!z.prices?.length)I(`No plan matching tier "${C}".`,{hint:"List options with `photon billing plans`."});if(!q)I(`Tier "${C}" has multiple billing intervals.`,{hint:"Pass --plan <price-id> to choose, or omit the tier to use the interactive picker."});G=q.id,K=C}else{let Q=await $F(X,J.name),z=await B3(Q);G=z.price.id,K=E3(z.plan.name)}await C3({api:X,projectId:Z,priceId:G,quantity:E.qty,envName:J.name,json:E.json??!1,noBrowser:H,tierLabel:K})})}function MW(D){return T0.includes(D.trim().toLowerCase())}function rZ(D){if(!D)return;let F=D.trim().toLowerCase();return T0.includes(F)?F:void 0}function TW(D){D.command("check-phone <number>").description("check whether a phone number is available on Spectrum").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(F,u)=>{let{api:E,env:B}=await i({apiHost:u.apiHost,token:u.token,requireAuth:!0}),{data:C,error:Z,status:J}=await E.api.projects["check-availability"].get({query:{phoneNumber:F}});if(J===401)throw new d(B.name);if(Z)I(`Failed to check phone availability: ${h(Z)}`);if(u.json){a(C);return}if(C.available)console.log(A.success(`${F} is available.`));else console.log(A.warn(`${F} is taken.`))})}function oZ(D){switch(D){case"running":return A.green(D);case"paused":return A.yellow(D);case"error":return A.red(D);default:return D}}function OW(D,F){return D.length>F?`${D.slice(0,F)}…`:D}function _W(D){let F=Math.max(...D.map(([u])=>u.length));for(let[u,E]of D)console.log(` ${A.dim(u.padEnd(F))} ${E}`)}import{readFile as LW,stat as RW}from"node:fs/promises";import{extname as jW}from"node:path";var SW={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif"};function tZ(D){D.command("avatar").description("manage the Spectrum avatar image").command("upload <file>").description("upload an image as the Spectrum avatar").option("--no-update-profile","only upload, don't update the profile to use the new avatar").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").action(async(u,E)=>{let B=await RW(u).catch(()=>null);if(!B)I(`File not found: ${u}`);let C=await LW(u),Z=B.size,J=SW[jW(u).toLowerCase()]||"application/octet-stream",{projectId:X,env:H}=await e({flagProjectId:E.project,apiHost:E.apiHost}),{api:Y}=await i({apiHost:H.url,token:E.token,requireAuth:!0}),G=await Y.api.projects({id:X}).spectrum.avatar.upload.post({contentType:J});if(G.status===401)throw new d(H.name);if(G.error)I(`Failed to get upload URL: ${h(G.error)}`);let K=G.data;if(K.error)I(K.error);if(!K.uploadUrl||!K.key)I("Server did not return uploadUrl + key.");console.log(A.dim(`Uploading ${u} (${(Z/1024).toFixed(1)} KB)…`));let Q=await fetch(K.uploadUrl,{method:"PUT",body:C,headers:{"Content-Type":J}});if(!Q.ok)I(`Upload failed: ${Q.status} ${Q.statusText}`);let z=await Y.api.projects({id:X}).spectrum.avatar.commit.post({key:K.key});if(z.status===401)throw new d(H.name);if(z.error)I(`Uploaded, but commit failed: ${h(z.error)}`);let q=z.data;if(q.error)I(q.error);if(!q.avatarUrl)I("Server did not return an avatar URL after commit.");let U=q.avatarUrl;if(E.updateProfile!==!1){let N=await Y.api.projects({id:X}).spectrum.profile.patch({avatarUrl:U});if(N.status===401)throw new d(H.name);if(N.error){let M=PW({projectId:X,apiHost:H.url,token:E.token,avatarUrl:U});I(`Uploaded, but failed to update profile: ${h(N.error)}`,{hint:`Update manually: ${M}`,context:`Avatar URL: ${U}`})}}console.log(A.success(`Uploaded avatar from ${u}`)),console.log(A.dim(` URL: ${U}`))})}function PW(D){let F=["photon spectrum profile update"];if(F.push(`--project ${$3(D.projectId)}`),D.apiHost!==P8)F.push(`--api-host ${$3(D.apiHost)}`);if(D.token!==void 0)F.push(`--token ${$3(D.token)}`);return F.push(`--avatar-url ${$3(D.avatarUrl)}`),F.join(" ")}function $3(D){return`'${D.replace(/'/g,"'\\''")}'`}function eZ(D){let F=D.command("lines").description("manage Spectrum phone lines on a project");F.command("list",{isDefault:!0}).alias("ls").description("list lines for the active project").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).lines.get();if(X===401)throw new d(B.name);if(J)I(`Failed to list lines: ${h(J)}`);let H=Z??[];if(u.json)return a(H);if(H.length===0){console.log(A.dim("No lines yet.")),console.log(A.hint("Add one with `photon spectrum lines add`."));return}let Y=H.map((G)=>[wW(G.id,10),G.platform??"—",G.phoneNumber??A.dim("—"),G.status??A.dim("—")]);hD(["id","platform","number","status"],Y)}),F.command("add").alias("create").description("add a new line (currently iMessage only)").option("--platform <name>","platform (only 'imessage' supported today)","imessage").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{if(u.platform!=="imessage")I(`Unsupported platform "${u.platform}".`,{hint:"The server currently only accepts 'imessage'."});let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).lines.post({platform:"imessage"});if(X===401)throw new d(B.name);if(J)I(`Failed to add line: ${h(J)}`);let H=Z;if(H.error)I(H.error);if(u.json)return a(H.line??{});console.log(A.success(`Added ${H.line?.platform??"imessage"} line${H.line?.id?A.dim(` (${H.line.id})`):""}`))}),F.command("remove <line-id>").alias("rm").alias("delete").description("remove a line").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("-y, --yes","skip confirmation").action(async(u,E)=>{let{projectId:B,env:C}=await e({flagProjectId:E.project,apiHost:E.apiHost}),{api:Z}=await i({apiHost:C.url,token:E.token,requireAuth:!0});await a0({message:`Remove line ${u} from project ${B}?`,yes:E.yes??!1,fallbackHint:`Pass --yes to remove line ${u}.`});let{error:J,status:X}=await Z.api.projects({id:B}).lines({lineId:u}).delete();if(X===401)throw new d(C.name);if(J)I(`Failed to remove line: ${h(J)}`);console.log(A.success(`Removed line ${u}`))})}function wW(D,F){return D.length>F?`${D.slice(0,F)}…`:D}function FJ(D){let F=D.command("platforms").description("manage Spectrum platform integrations on a project");F.command("list",{isDefault:!0}).alias("ls").description("list platforms and their enabled state").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).platforms.get();if(X===401)throw new d(B.name);if(J)I(`Failed to list platforms: ${h(J)}`);let H=Z??{};if(u.json)return a(H);let Y=Object.entries(H);if(Y.length===0){console.log(A.dim("No platforms configured for this project."));return}let G=Y.sort(([K],[Q])=>K.localeCompare(Q)).map(([K,Q])=>[K,Q?A.green("on"):A.dim("off")]);hD(["platform","state"],G)}),F.command("enable <name>").description("enable a platform").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u,E)=>{await DJ(u,!0,E)}),F.command("disable <name>").description("disable a platform").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u,E)=>{await DJ(u,!1,E)})}async function DJ(D,F,u){let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).platforms.toggle.post({platformId:D,enabled:F});if(X===401)throw new d(B.name);if(J)I(`Failed to ${F?"enable":"disable"} ${D}: ${h(J)}`);let H=Z;if(H.error)I(H.error,{hint:H.error==="Unsupported platform"?"Run `photon spectrum platforms ls` to see available platforms.":void 0});if(u.json)return a(H.platforms??{});console.log(A.success(`${F?"Enabled":"Disabled"} ${A.bold(D)}`))}function uJ(D){let F=D.command("profile").description("view or update the Spectrum profile (display name, avatar)");F.command("show",{isDefault:!0}).description("show the Spectrum profile").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).spectrum.profile.get();if(X===401)throw new d(B.name);if(J)I(`Failed to fetch Spectrum profile: ${h(J)}`);if(u.json)return a(Z??{});if(!Z||typeof Z!=="object"){console.log(A.dim("No Spectrum profile."));return}let H=Object.entries(Z).filter(([G])=>!["id"].includes(G));if(H.length===0){console.log(A.dim("Empty Spectrum profile."));return}let Y=Math.max(...H.map(([G])=>G.length));for(let[G,K]of H)console.log(` ${A.dim(G.padEnd(Y))} ${xW(K)}`)}),F.command("update").alias("edit").description("update the Spectrum profile (preserves unset fields)").option("--first-name <name>").option("--last-name <name>").option("--avatar-url <url>","avatar image URL (use `spectrum avatar upload` instead)").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{if(!(u.firstName!==void 0||u.lastName!==void 0||u.avatarUrl!==void 0))I("Nothing to update.",{hint:"Pass at least one of --first-name / --last-name / --avatar-url."});let{projectId:B,env:C}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:Z}=await i({apiHost:C.url,token:u.token,requireAuth:!0}),J={};if(u.firstName!==void 0)J.firstName=u.firstName;if(u.lastName!==void 0)J.lastName=u.lastName;if(u.avatarUrl!==void 0)J.avatarUrl=u.avatarUrl;let{data:X,error:H,status:Y}=await Z.api.projects({id:B}).spectrum.profile.patch(J);if(Y===401)throw new d(C.name);if(H)I(`Failed to update Spectrum profile: ${h(H)}`);let G=X;if(G.error)I(G.error);if(u.json)return a(G.profile??{});console.log(A.success("Spectrum profile updated."))})}function xW(D){if(D===null||D===void 0||D==="")return A.dim("—");if(typeof D==="boolean")return D?A.green("yes"):A.dim("no");if(typeof D==="object")return JSON.stringify(D);return String(D)}function BJ(D){let F=D.command("users").description("manage Spectrum users on a project");F.command("list",{isDefault:!0}).alias("ls").description("list Spectrum users for the active project").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0}),{data:Z,error:J,status:X}=await C.api.projects({id:E}).spectrum.users.get();if(X===401)throw new d(B.name);if(J)I(`Failed to list users: ${h(J)}`);let H=Z??[];if(u.json)return a(H);if(H.length===0){console.log(A.dim("No Spectrum users yet.")),console.log(A.hint("Add one with `photon spectrum users add`."));return}let Y=H.map((G)=>[yW(G.id,10),EJ(G),G.email??A.dim("—"),G.phoneNumber??A.dim("—")]);hD(["id","name","email","phone"],Y)}),F.command("add").alias("create").description("add a Spectrum user to the active project").option("--first-name <name>","first name").option("--last-name <name>","last name").option("--email <email>","email address").option("--phone <number>","phone number (E.164)").option("--invite","send an onboarding invite to this user").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("--json","output JSON").action(async(u)=>{let{projectId:E,env:B}=await e({flagProjectId:u.project,apiHost:u.apiHost}),{api:C}=await i({apiHost:B.url,token:u.token,requireAuth:!0}),Z=await kW(u),{data:J,error:X,status:H}=await C.api.projects({id:E}).spectrum.users.post({firstName:Z.firstName,lastName:Z.lastName,email:Z.email,phoneNumber:Z.phone,sendInvite:u.invite??!1});if(H===401)throw new d(B.name);if(X)I(`Failed to add user: ${h(X)}`);let Y=J;if(Y.error)I(Y.error);if(u.json)return a(Y.user??{});let G=Y.user;if(console.log(A.success(`Added ${EJ(G??Z)} ${G?.id?A.dim(`(${G.id})`):""}`)),u.invite)console.log(A.dim(" Invite sent."))}),F.command("remove <user-id>").alias("rm").alias("delete").description("remove a Spectrum user").option("-p, --project <id>","project id (overrides $PHOTON_PROJECT_ID)").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").option("-y, --yes","skip confirmation").action(async(u,E)=>{let{projectId:B,env:C}=await e({flagProjectId:E.project,apiHost:E.apiHost}),{api:Z}=await i({apiHost:C.url,token:E.token,requireAuth:!0});await a0({message:`Remove user ${u} from project ${B}?`,yes:E.yes??!1,fallbackHint:`Pass --yes to remove user ${u}.`});let{error:J,status:X}=await Z.api.projects({id:B}).spectrum.users({userId:u}).delete();if(X===401)throw new d(C.name);if(J)I(`Failed to remove user: ${h(J)}`);console.log(A.success(`Removed user ${u}`))})}async function kW(D){if(!yD()){let F=[];if(!D.firstName)F.push("--first-name");if(!D.lastName)F.push("--last-name");if(!D.email)F.push("--email");if(!D.phone)F.push("--phone");if(F.length>0)I(`Missing required flags in non-interactive mode: ${F.join(", ")}`);return{firstName:D.firstName,lastName:D.lastName,email:D.email,phone:D.phone}}return{firstName:D.firstName??await V3("First name"),lastName:D.lastName??await V3("Last name"),email:D.email??await V3("Email"),phone:D.phone??await V3("Phone (E.164, e.g. +14155551234)")}}async function V3(D){let F=await Q0({message:D,validate:(u)=>u&&u.trim()?void 0:"Required"});if(UD(F))I("Aborted.");return F.trim()}function EJ(D){let F=[D.firstName,D.lastName].filter(Boolean);return F.length>0?F.join(" "):A.dim("(no name)")}function yW(D,F){return D.length>F?`${D.slice(0,F)}…`:D}function CJ(D){let F=D.command("spectrum").description("manage Spectrum users, lines, platforms, and profile");uJ(F),BJ(F),eZ(F),FJ(F),tZ(F)}function JJ(D){D.command("whoami").description("show the user authenticated for the active backend").option("--api-host <url>","API host URL (defaults to PHOTON_API_HOST or built-in production)").option("-t, --token <token>","API token (overrides stored creds)").action(async(F)=>{let{api:u,env:E,creds:B}=await i({apiHost:F.apiHost,token:F.token,requireAuth:!0}),{data:C,error:Z,status:J}=await u.api.profile.get();if(J===401)throw new d(E.name);if(Z)I(`Failed to fetch profile: ${h(Z)}`);if(!B){if(console.log(A.dim(`authenticated via token on backend ${E.name} (${E.url})`)),C&&typeof C==="object"){let H=ZJ(C);if(H)console.log(A.dim(`profile: ${H}`))}return}let X=B.user;if(console.log(A.bold(X.name)+A.dim(` <${X.email}>`)),console.log(A.dim(`backend: ${E.name} (${E.url})`)),console.log(A.dim(`signed in: ${new Date(B.issuedAt).toLocaleString()}`)),C&&typeof C==="object"){let H=ZJ(C);if(H)console.log(A.dim(`profile: ${H}`))}})}function ZJ(D){if(!D||typeof D!=="object")return null;let F=D;if(F.type==="developer"||F.type==="organization")return F.type;return null}function HJ(){let D=new ZC().name("photon").description("Photon CLI — bring your agents to any interface").version(D2.version,"-v, --version","output the current version").option("--debug","verbose output incl. HTTP request/response").hook("preAction",(F)=>{let u=F.opts();WC(!!u.debug)});return iZ(D),QZ(D),lZ(D),pZ(D),JJ(D),aZ(D),sZ(D),CJ(D),XZ(D),QC(D),GZ(D),D}mB();var bW=HJ();bW.parseAsync(process.argv).catch(fW);function fW(D){if(D instanceof MF||D instanceof d){let F=D.envName==="production"?"":` --api-host <url> # for "${D.envName}"`;I(D.message,{hint:`Run \`photon login${F}\`.`})}if(D instanceof r0)I(D.message,{hint:"Re-run `photon login` if this was unintentional."});if(D instanceof L0)I(D.message,{hint:"Re-run `photon login` and approve more quickly."});if(D instanceof Error){if(/Unable to connect|fetch failed|ECONNREFUSED/i.test(D.message))I(D.message,{hint:"Check your connection, or set PHOTON_API_HOST / pass --api-host <url> to target a reachable backend."});I(D.message)}I(String(D))}