"use strict";var FD=Object.defineProperty;var r=(D,F)=>FD(D,"name",{value:F,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tD=require("node:process"),eD=require("node:child_process"),oD=require("node:fs"),CD=require("node:tty"),M=r(D=>D&&typeof D=="object"&&"default"in D?D.default:D,"_interopDefaultCompat"),m=M(tD),y=M(oD),ED=M(CD);function rD({onlyFirst:D=!1}={}){const u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(u,D?void 0:"g")}r(rD,"ansiRegex");const nD=rD();function Z(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(nD,"")}r(Z,"stripAnsi");function iD(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}r(iD,"isAmbiguous");function BD(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}r(BD,"isFullWidth");function aD(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}r(aD,"isWide");function lD(D){if(!Number.isSafeInteger(D))throw new TypeError(`Expected a code point, got \`${typeof D}\`.`)}r(lD,"validate");function sD(D,{ambiguousAsWide:F=!1}={}){return lD(D),BD(D)||aD(D)||F&&iD(D)?2:1}r(sD,"eastAsianWidth");const fD=r(()=>/[#*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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u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uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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-\uDED7\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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\uDD3D\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-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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]|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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,"emojiRegex"),AD=new Intl.Segmenter,cD=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function s(D,F={}){if(typeof D!="string"||D.length===0)return 0;const{ambiguousIsNarrow:u=!0,countAnsiEscapeCodes:t=!1}=F;if(t||(D=Z(D)),D.length===0)return 0;let o=0;const C={ambiguousAsWide:!u};for(const{segment:E}of AD.segment(D)){const e=E.codePointAt(0);if(!(e<=31||e>=127&&e<=159)&&!(e>=8203&&e<=8207||e===65279)&&!(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)&&!(e>=55296&&e<=57343)&&!(e>=65024&&e<=65039)&&!cD.test(E)){if(fD().test(E)){o+=2;continue}o+=sD(e,C)}}return o}r(s,"stringWidth");const V=80,Y=24,N=r((D,F,{shell:u,env:t}={})=>eD.execFileSync(D,F,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:u,env:t}).trim(),"exec$1"),T=r((D,F)=>({columns:Number.parseInt(D,10),rows:Number.parseInt(F,10)}),"create"),H=r((D,F)=>{const{columns:u,rows:t}=T(D,F);if(!(Number.isNaN(u)||Number.isNaN(t))&&!(u===V&&t===Y))return{columns:u,rows:t}},"createIfNotDefault");function J(){const{env:D,stdout:F,stderr:u}=m;if(F?.columns&&F?.rows)return T(F.columns,F.rows);if(u?.columns&&u?.rows)return T(u.columns,u.rows);if(D.COLUMNS&&D.LINES)return T(D.COLUMNS,D.LINES);const t={columns:V,rows:Y};return m.platform==="win32"?L()??t:m.platform==="darwin"?j()??L()??t:j()??L()??gD()??t}r(J,"terminalSize");const j=r(()=>{try{const D=m.platform==="darwin"?y.constants.O_EVTONLY|y.constants.O_NONBLOCK:y.constants.O_NONBLOCK,{columns:F,rows:u}=ED.WriteStream(y.openSync("/dev/tty",D));return{columns:F,rows:u}}catch{}},"devTty"),L=r(()=>{try{const D=N("tput",["cols"],{env:{TERM:"dumb",...m.env}}),F=N("tput",["lines"],{env:{TERM:"dumb",...m.env}});if(D&&F)return H(D,F)}catch{}},"tput"),gD=r(()=>{try{const D=N("resize",["-u"]).match(/\d+/g);if(D.length===2)return H(D[0],D[1])}catch{}},"resize"),_=10,k=r((D=0)=>F=>`\x1B[${F+D}m`,"wrapAnsi16"),I=r((D=0)=>F=>`\x1B[${38+D};5;${F}m`,"wrapAnsi256"),z=r((D=0)=>(F,u,t)=>`\x1B[${38+D};2;${F};${u};${t}m`,"wrapAnsi16m"),B={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(B.modifier);const hD=Object.keys(B.color),dD=Object.keys(B.bgColor);[...hD,...dD];function pD(){const D=new Map;for(const[F,u]of Object.entries(B)){for(const[t,o]of Object.entries(u))B[t]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},u[t]=B[t],D.set(o[0],o[1]);Object.defineProperty(B,F,{value:u,enumerable:!1})}return Object.defineProperty(B,"codes",{value:D,enumerable:!1}),B.color.close="\x1B[39m",B.bgColor.close="\x1B[49m",B.color.ansi=k(),B.color.ansi256=I(),B.color.ansi16m=z(),B.bgColor.ansi=k(_),B.bgColor.ansi256=I(_),B.bgColor.ansi16m=z(_),Object.defineProperties(B,{rgbToAnsi256:{value:r((F,u,t)=>F===u&&u===t?F<8?16:F>248?231:Math.round((F-8)/247*24)+232:16+36*Math.round(F/255*5)+6*Math.round(u/255*5)+Math.round(t/255*5),"value"),enumerable:!1},hexToRgb:{value:r(F=>{const u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!u)return[0,0,0];let[t]=u;t.length===3&&(t=[...t].map(C=>C+C).join(""));const o=Number.parseInt(t,16);return[o>>16&255,o>>8&255,o&255]},"value"),enumerable:!1},hexToAnsi256:{value:r(F=>B.rgbToAnsi256(...B.hexToRgb(F)),"value"),enumerable:!1},ansi256ToAnsi:{value:r(F=>{if(F<8)return 30+F;if(F<16)return 90+(F-8);let u,t,o;if(F>=232)u=((F-232)*10+8)/255,t=u,o=u;else{F-=16;const e=F%36;u=Math.floor(F/36)/5,t=Math.floor(e/6)/5,o=e%6/5}const C=Math.max(u,t,o)*2;if(C===0)return 30;let E=30+(Math.round(o)<<2|Math.round(t)<<1|Math.round(u));return C===2&&(E+=60),E},"value"),enumerable:!1},rgbToAnsi:{value:r((F,u,t)=>B.ansi256ToAnsi(B.rgbToAnsi256(F,u,t)),"value"),enumerable:!1},hexToAnsi:{value:r(F=>B.ansi256ToAnsi(B.hexToAnsi256(F)),"value"),enumerable:!1}}),B}r(pD,"assembleStyles");const mD=pD(),v=new Set(["\x1B","›"]),bD=39,O="\x07",Q="[",xD="]",X="m",S=`${xD}8;;`,W=r(D=>`${v.values().next().value}${Q}${D}${X}`,"wrapAnsiCode"),P=r(D=>`${v.values().next().value}${S}${D}${O}`,"wrapAnsiHyperlink"),wD=r(D=>D.split(" ").map(F=>s(F)),"wordLengths"),R=r((D,F,u)=>{const t=[...F];let o=!1,C=!1,E=s(Z(D.at(-1)));for(const[e,i]of t.entries()){const a=s(i);if(E+a<=u?D[D.length-1]+=i:(D.push(i),E=0),v.has(i)&&(o=!0,C=t.slice(e+1,e+1+S.length).join("")===S),o){C?i===O&&(o=!1,C=!1):i===X&&(o=!1);continue}E+=a,E===u&&e0&&D.length>1&&(D[D.length-2]+=D.pop())},"wrapWord"),yD=r(D=>{const F=D.split(" ");let u=F.length;for(;u>0&&!(s(F[u-1])>0);)u--;return u===F.length?D:F.slice(0,u).join(" ")+F.slice(u).join("")},"stringVisibleTrimSpacesRight"),TD=r((D,F,u={})=>{if(u.trim!==!1&&D.trim()==="")return"";let t="",o,C;const E=wD(D);let e=[""];for(const[A,n]of D.split(" ").entries()){u.trim!==!1&&(e[e.length-1]=e.at(-1).trimStart());let l=s(e.at(-1));if(A!==0&&(l>=F&&(u.wordWrap===!1||u.trim===!1)&&(e.push(""),l=0),(l>0||u.trim===!1)&&(e[e.length-1]+=" ",l++)),u.hard&&E[A]>F){const c=F-l,g=1+Math.floor((E[A]-c-1)/F);Math.floor((E[A]-1)/F)F&&l>0&&E[A]>0){if(u.wordWrap===!1&&lF&&u.wordWrap===!1){R(e,n,F);continue}e[e.length-1]+=n}u.trim!==!1&&(e=e.map(A=>yD(A)));const i=e.join(` `),a=[...i];let f=0;for(const[A,n]of a.entries()){if(t+=n,v.has(n)){const{groups:c}=new RegExp(`(?:\\${Q}(?\\d+)m|\\${S}(?.*)${O})`).exec(i.slice(f))||{groups:{}};if(c.code!==void 0){const g=Number.parseFloat(c.code);o=g===bD?void 0:g}else c.uri!==void 0&&(C=c.uri.length===0?void 0:c.uri)}const l=mD.codes.get(Number(o));a[A+1]===` `?(C&&(t+=P("")),o&&l&&(t+=W(l))):n===` `&&(o&&l&&(t+=W(o)),C&&(t+=P(C))),f+=n.length}return t},"exec");function DD(D,F,u){return String(D).normalize().replaceAll(`\r `,` `).split(` `).map(t=>TD(t,F,u)).join(` `)}r(DD,"wrapAnsi");var SD=Object.defineProperty,$=r((D,F)=>SD(D,"name",{value:F,configurable:!0}),"t");const vD=$((D,F)=>Math.floor((D-F)/2),"halfDiff"),LD=$((D,F)=>D-F,"fullDiff"),G=$((D,F={})=>{const u=F.align??"center";if(u==="left")return D;const t=F.split??` `,o=F.pad??" ",C=u==="right"?LD:vD;let E=!1;Array.isArray(D)||(E=!0,D=String(D).split(t));let e,i=0;return D=D.map(a=>(a=String(a),e=s(a),i=Math.max(e,i),{str:a,width:e})).map(a=>Array.from({length:C(i,a.width)+1}).join(o)+a.str),E?D.join(t):D},"alignAnsi"),_D={arrow:{bottom:"↑",bottomLeft:"↗",bottomRight:"↖",left:"→",right:"←",top:"↓",topLeft:"↘",topRight:"↙"},bold:{bottom:"━",bottomLeft:"┗",bottomRight:"┛",left:"┃",right:"┃",top:"━",topLeft:"┏",topRight:"┓"},classic:{bottom:"-",bottomLeft:"+",bottomRight:"+",left:"|",right:"|",top:"-",topLeft:"+",topRight:"+"},double:{bottom:"═",bottomLeft:"╚",bottomRight:"╝",left:"║",right:"║",top:"═",topLeft:"╔",topRight:"╗"},doubleSingle:{bottom:"═",bottomLeft:"╘",bottomRight:"╛",left:"│",right:"│",top:"═",topLeft:"╒",topRight:"╕"},round:{bottom:"─",bottomLeft:"╰",bottomRight:"╯",left:"│",right:"│",top:"─",topLeft:"╭",topRight:"╮"},single:{bottom:"─",bottomLeft:"└",bottomRight:"┘",left:"│",right:"│",top:"─",topLeft:"┌",topRight:"┐"},singleDouble:{bottom:"─",bottomLeft:"╙",bottomRight:"╜",left:"║",right:"║",top:"─",topLeft:"╓",topRight:"╖"}};var RD=Object.defineProperty,ND=r((D,F)=>RD(D,"name",{value:F,configurable:!0}),"i");const uD=ND(D=>{let F=0;for(const u of D.split(` `))F=Math.max(F,s(u));return F},"widestLine");var MD=Object.defineProperty,h=r((D,F)=>MD(D,"name",{value:F,configurable:!0}),"d");const p=` `,d=" ",x="none",q=h(D=>typeof D=="number"?{bottom:D,left:D*3,right:D*3,top:D}:{bottom:0,left:0,right:0,top:0,...D},"getObject"),w=h(D=>D===x?0:2,"getBorderWidth"),OD=h(D=>{const F=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"];let u;if(D===x){D={};for(const t of F)D[t]=""}if(typeof D=="string"){const t=_D[D];if(t===void 0)throw new TypeError(`Invalid border style: ${D}`);u=t}else{typeof D.vertical=="string"&&(D.left=D.vertical,D.right=D.vertical),typeof D.horizontal=="string"&&(D.top=D.horizontal,D.bottom=D.horizontal);for(const t of F)if(D[t]===null||typeof D[t]!="string")throw new TypeError(`Invalid border style: ${t}`);u=D}return u},"getBorderChars"),K=h((D,F,u,t,o)=>{let C="";D=F(D);const E=s(D);switch(o){case"left":{C=D+t(u.slice(E),s(u.slice(E)));break}case"right":{C=t(u.slice(E+2),s(u.slice(E))+2)+" "+D+" ";break}default:{if(u=u.slice(E),u.length%2===1)u=u.slice(Math.floor(u.length/2)),C=t(u.slice(1),s(u.slice(1)))+D+t(u,s(u));else{u=u.slice(u.length/2);const e=s(u);C=t(u,e)+D+t(u,e)}break}}return C},"wrapText"),$D=h((D,{height:F,padding:u,textAlignment:t,width:o})=>{D=G(D,{align:t});let C=D.split(p);const E=uD(D),e=o-u.left-u.right;if(E>e){const f=[];for(const A of C){const n=DD(A,e,{hard:!0}),l=G(n,{align:t}).split(` `),c=Math.max(...l.map(g=>s(g)));for(const g of l){let b;switch(t){case"center":{b=d.repeat((e-c)/2)+g;break}case"right":{b=d.repeat(e-c)+g;break}default:{b=g;break}}f.push(b)}}C=f}t==="center"&&Ed.repeat((e-E)/2)+f):t==="right"&&Ed.repeat(e-E)+f));const i=d.repeat(u.left),a=d.repeat(u.right);return C=C.map(f=>{const A=i+f+a;return A+d.repeat(o-s(A))}),u.top>0&&(C=[...Array.from({length:u.top}).fill(d.repeat(o)),...C]),u.bottom>0&&(C=[...C,...Array.from({length:u.bottom}).fill(d.repeat(o))]),F&&C.length>F?C=C.slice(0,F):F&&C.length{const o=h((n,l,c)=>t.borderColor?t.borderColor(n,l,c):n,"colorizeBorder"),C=h(n=>t.headerTextColor?t.headerTextColor(n):n,"colorizeHeaderText"),E=h(n=>t.footerTextColor?t.footerTextColor(n):n,"colorizeFooterText"),e=h(n=>t.textColor?t.textColor(n):n,"colorizeContent"),i=OD(t.borderStyle);let a=d.repeat(t.margin.left);if(t.float==="center"){const n=Math.max((u-F-w(t.borderStyle))/2,0);a=d.repeat(n)}else if(t.float==="right"){const n=Math.max(u-F-t.margin.right-w(t.borderStyle),0);a=d.repeat(n)}let f="";if(t.margin.top&&(f+=p.repeat(t.margin.top)),t.borderStyle!==x||t.headerText){let n=o(i.top.repeat(F),"top",F);t.headerText&&(n=K(t.headerText,C,i.top.repeat(F),(c,g)=>o(c,"top",g),t.headerAlignment));const l=o(a+i.topLeft,"topLeft",s(a+i.topLeft));f+=l+n+o(i.topRight,"topRight",s(i.topRight))+p}const A=D.split(p);if(f+=A.map(n=>a+o(i.left,"left",s(i.left))+e(n)+o(i.right,"right",s(i.right))).join(p),t.borderStyle!==x||t.footerText){const n=p+o(a+i.bottomLeft,"bottomLeft",s(a+i.bottomLeft));let l=o(i.bottom.repeat(F),"bottom",F);t.footerText&&(l=K(t.footerText,E,i.bottom.repeat(F),(c,g)=>o(c,"bottom",g),t.footerAlignment)),f+=n+l+o(i.bottomRight,"bottomRight",s(i.bottomRight))}return t.margin.bottom&&(f+=p.repeat(t.margin.bottom)),f},"boxContent"),kD=h(D=>{if(D.fullscreen){let F=J();typeof D.fullscreen=="function"&&(F=D.fullscreen(F.columns,F.rows)),D.width||(D.width=F.columns),D.height||(D.height=F.rows)}return D.width&&(D.width=Math.max(1,D.width-w(D.borderStyle))),D.height&&(D.height=Math.max(1,D.height-w(D.borderStyle))),D},"sanitizeOptions"),U=h((D,F)=>F===x?D:` ${D} `,"formatTitle"),ID=h((D,F,u)=>{u=kD(u);const t=u.width!==void 0,o=w(u.borderStyle),C=F-u.margin.left-u.margin.right-o,E=uD(DD(D,F-o,{hard:!0,trim:!1}))+u.padding.left+u.padding.right;if(u.headerText&&t?(u.headerText=u.headerText.slice(0,Math.max(0,u.width-2)),u.headerText&&(u.headerText=U(u.headerText,u.borderStyle))):u.headerText&&(u.headerText=u.headerText.slice(0,Math.max(0,C-2)),u.headerText&&(u.headerText=U(u.headerText,u.borderStyle),s(u.headerText)>E&&(u.width=s(u.headerText)))),u.width=u.width||E,!t){if(u.margin.left&&u.margin.right&&u.width>C){const e=(F-u.width-o)/(u.margin.left+u.margin.right);u.margin.left=Math.max(0,Math.floor(u.margin.left*e)),u.margin.right=Math.max(0,Math.floor(u.margin.right*e))}u.width=Math.min(u.width,F-o-u.margin.left-u.margin.right)}return u.width-(u.padding.left+u.padding.right)<=0&&(u.padding.left=0,u.padding.right=0),u.height&&u.height-(u.padding.top+u.padding.bottom)<=0&&(u.padding.top=0,u.padding.bottom=0),u},"determineDimensions"),zD=h((D,F={})=>{if(F.borderColor!==void 0&&typeof F.borderColor!="function")throw new Error('"borderColor" is not a valid function');if(F.textColor!==void 0&&typeof F.textColor!="function")throw new Error('"backgroundColor" is not a valid function');let u={borderStyle:"single",dimBorder:!1,float:"left",footerAlignment:"right",headerAlignment:"left",textAlignment:"left",transformTabToSpace:4,...F};u.padding=q(F.padding??0),u.margin=q(F.margin),u.transformTabToSpace&&(D=D.replaceAll(" "," ".repeat(u.transformTabToSpace)));const{columns:t}=J();return u=ID(D,t,u),jD($D(D,u),u.width,t,u)},"boxen");exports.boxen=zD;