@visulima/pail 1.1.13 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/LICENSE.md +185 -0
- package/README.md +1 -0
- package/dist/index.browser.cjs +1 -16
- package/dist/index.browser.d.cts +5 -5
- package/dist/index.browser.d.mts +10 -0
- package/dist/index.browser.d.ts +5 -5
- package/dist/index.browser.mjs +1 -0
- package/dist/index.server.cjs +4 -20
- package/dist/index.server.d.cts +7 -7
- package/dist/index.server.d.mts +30 -0
- package/dist/index.server.d.ts +7 -7
- package/dist/index.server.mjs +5 -0
- package/dist/processor.browser.cjs +1 -12
- package/dist/processor.browser.d.cts +1 -1
- package/dist/processor.browser.d.mts +15 -0
- package/dist/processor.browser.d.ts +1 -1
- package/dist/processor.browser.mjs +1 -0
- package/dist/processor.server.cjs +1 -18
- package/dist/processor.server.d.cts +3 -3
- package/dist/processor.server.d.mts +47 -0
- package/dist/processor.server.d.ts +3 -3
- package/dist/processor.server.mjs +1 -0
- package/dist/reporter.browser.cjs +4 -26
- package/dist/reporter.browser.d.cts +4 -4
- package/dist/reporter.browser.d.mts +17 -0
- package/dist/reporter.browser.d.ts +4 -4
- package/dist/reporter.browser.mjs +5 -0
- package/dist/reporter.server.cjs +9 -24
- package/dist/reporter.server.d.cts +25 -18
- package/dist/reporter.server.d.mts +64 -0
- package/dist/reporter.server.d.ts +25 -18
- package/dist/reporter.server.mjs +19 -0
- package/dist/shared/pail.3G15muTS.cjs +1 -0
- package/dist/shared/pail.B-Tp78gL.cjs +1 -0
- package/dist/shared/pail.B0AqLGpo.cjs +1 -0
- package/dist/shared/pail.B85Cx0UJ.cjs +1 -0
- package/dist/shared/pail.BP95fgQZ.mjs +1 -0
- package/dist/shared/pail.BlF6_AB7.mjs +1 -0
- package/dist/{pail.browser-pg1HpChf.d.cts → shared/pail.BsONPwkb.d.mts} +3 -3
- package/dist/{types-DrhFTME0.d.ts → shared/pail.BxGKtnGM.d.cts} +70 -17
- package/dist/{types-DrhFTME0.d.cts → shared/pail.BxGKtnGM.d.mts} +70 -17
- package/dist/shared/pail.BxGKtnGM.d.ts +176 -0
- package/dist/shared/pail.Bz_4Ee-U.mjs +1 -0
- package/dist/shared/pail.C0epjAht.cjs +1 -0
- package/dist/shared/pail.CKgnzwt6.mjs +1 -0
- package/dist/shared/pail.CNxJnpWG.mjs +1 -0
- package/dist/{pail.browser-DuX9zHSz.d.ts → shared/pail.CQyMoJfJ.d.ts} +3 -3
- package/dist/{abstract-pretty-reporter-DwzTRutd.d.cts → shared/pail.CW2izieN.d.cts} +4 -4
- package/dist/shared/pail.CY7GSNwy.d.cts +58 -0
- package/dist/shared/pail.Cn4oOlxI.mjs +1 -0
- package/dist/shared/pail.CyfBrVNa.d.mts +36 -0
- package/dist/shared/pail.D5MfZlaK.mjs +21 -0
- package/dist/shared/pail.DFhaFnnA.cjs +1 -0
- package/dist/shared/pail.DbDZ7fkY.mjs +1 -0
- package/dist/shared/pail.Di3NskY9.cjs +1 -0
- package/dist/shared/pail.NUhULbBB.cjs +21 -0
- package/dist/{abstract-pretty-reporter-B-VS5gYX.d.ts → shared/pail.QGbXqfVW.d.ts} +4 -4
- package/dist/shared/pail.nEbRCLhY.mjs +1 -0
- package/dist/shared/pail.nUyAB-mN.cjs +1 -0
- package/package.json +55 -36
- package/dist/chunk-2I5JHTDY.js +0 -9
- package/dist/chunk-2I5JHTDY.js.map +0 -1
- package/dist/chunk-5MNFJRLM.cjs +0 -10
- package/dist/chunk-5MNFJRLM.cjs.map +0 -1
- package/dist/chunk-AFMDCM5W.js +0 -5
- package/dist/chunk-AFMDCM5W.js.map +0 -1
- package/dist/chunk-F4FJCQ4L.cjs +0 -9
- package/dist/chunk-F4FJCQ4L.cjs.map +0 -1
- package/dist/chunk-KERJDMYV.js +0 -8
- package/dist/chunk-KERJDMYV.js.map +0 -1
- package/dist/chunk-N2UPJYJR.cjs +0 -7
- package/dist/chunk-N2UPJYJR.cjs.map +0 -1
- package/dist/chunk-NF47XQ47.js +0 -5
- package/dist/chunk-NF47XQ47.js.map +0 -1
- package/dist/chunk-QINSQ6TU.cjs +0 -9
- package/dist/chunk-QINSQ6TU.cjs.map +0 -1
- package/dist/chunk-R5F555RP.js +0 -5
- package/dist/chunk-R5F555RP.js.map +0 -1
- package/dist/chunk-S4PFPURC.cjs +0 -45
- package/dist/chunk-S4PFPURC.cjs.map +0 -1
- package/dist/chunk-SR3Q3EUO.js +0 -7
- package/dist/chunk-SR3Q3EUO.js.map +0 -1
- package/dist/chunk-TAH23BHM.js +0 -5
- package/dist/chunk-TAH23BHM.js.map +0 -1
- package/dist/chunk-VWAGNTLB.cjs +0 -7
- package/dist/chunk-VWAGNTLB.cjs.map +0 -1
- package/dist/chunk-WHEIXCFS.js +0 -33
- package/dist/chunk-WHEIXCFS.js.map +0 -1
- package/dist/chunk-YP3U3DTV.cjs +0 -10
- package/dist/chunk-YP3U3DTV.cjs.map +0 -1
- package/dist/chunk-ZB7IIFHO.js +0 -7
- package/dist/chunk-ZB7IIFHO.js.map +0 -1
- package/dist/chunk-ZHHJ42XL.cjs +0 -12
- package/dist/chunk-ZHHJ42XL.cjs.map +0 -1
- package/dist/chunk-ZJMTPHZR.cjs +0 -7
- package/dist/chunk-ZJMTPHZR.cjs.map +0 -1
- package/dist/index.browser.cjs.map +0 -1
- package/dist/index.browser.js +0 -13
- package/dist/index.browser.js.map +0 -1
- package/dist/index.server.cjs.map +0 -1
- package/dist/index.server.js +0 -18
- package/dist/index.server.js.map +0 -1
- package/dist/processor.browser.cjs.map +0 -1
- package/dist/processor.browser.js +0 -3
- package/dist/processor.browser.js.map +0 -1
- package/dist/processor.server.cjs.map +0 -1
- package/dist/processor.server.js +0 -8
- package/dist/processor.server.js.map +0 -1
- package/dist/reporter.browser.cjs.map +0 -1
- package/dist/reporter.browser.js +0 -17
- package/dist/reporter.browser.js.map +0 -1
- package/dist/reporter.server.cjs.map +0 -1
- package/dist/reporter.server.js +0 -15
- package/dist/reporter.server.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var ED=Object.defineProperty;var E=(D,u)=>ED(D,"name",{value:u,configurable:!0});import b,{stdout as CD,stderr as tD}from"node:process";import rD,{red as nD,grey as f,cyan as BD,underline as M,bold as sD,white as iD,bgGrey as oD}from"@visulima/colorize";import{execFileSync as aD}from"node:child_process";import w from"node:fs";import AD from"node:tty";import{A as lD,s as cD}from"./pail.BlF6_AB7.mjs";import{s as fD}from"./pail.CKgnzwt6.mjs";const q=80,H=24,L=E((D,u,{shell:F,env:e}={})=>aD(D,u,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:F,env:e}).trim(),"exec$1"),x=E((D,u)=>({columns:Number.parseInt(D,10),rows:Number.parseInt(u,10)}),"create"),J=E((D,u)=>{const{columns:F,rows:e}=x(D,u);if(!(Number.isNaN(F)||Number.isNaN(e))&&!(F===q&&e===H))return{columns:F,rows:e}},"createIfNotDefault");function gD(){const{env:D,stdout:u,stderr:F}=b;if(u?.columns&&u?.rows)return x(u.columns,u.rows);if(F?.columns&&F?.rows)return x(F.columns,F.rows);if(D.COLUMNS&&D.LINES)return x(D.COLUMNS,D.LINES);const e={columns:q,rows:H};return b.platform==="win32"?T()??e:b.platform==="darwin"?G()??T()??e:G()??T()??hD()??e}E(gD,"terminalSize");const G=E(()=>{try{const D=b.platform==="darwin"?w.constants.O_EVTONLY|w.constants.O_NONBLOCK:w.constants.O_NONBLOCK,{columns:u,rows:F}=AD.WriteStream(w.openSync("/dev/tty",D));return{columns:u,rows:F}}catch{}},"devTty"),T=E(()=>{try{const D=L("tput",["cols"],{env:{TERM:"dumb",...b.env}}),u=L("tput",["lines"],{env:{TERM:"dumb",...b.env}});if(D&&u)return J(D,u)}catch{}},"tput"),hD=E(()=>{try{const D=L("resize",["-u"]).match(/\d+/g);if(D.length===2)return J(D[0],D[1])}catch{}},"resize");function pD({onlyFirst:D=!1}={}){const u=["[\\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(u,D?void 0:"g")}E(pD,"ansiRegex");const dD=pD();function R(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(dD,"")}E(R,"stripAnsi");function mD(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}E(mD,"isAmbiguous");function bD(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}E(bD,"isFullWidth");function yD(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}E(yD,"isWide");function wD(D){if(!Number.isSafeInteger(D))throw new TypeError(`Expected a code point, got \`${typeof D}\`.`)}E(wD,"validate");function xD(D,{ambiguousAsWide:u=!1}={}){return wD(D),bD(D)||yD(D)||u&&mD(D)?2:1}E(xD,"eastAsianWidth");const vD=E(()=>/[#*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\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD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2642]\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\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\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"),SD=new Intl.Segmenter;function y(D,u={}){if(typeof D!="string"||D.length===0)return 0;const{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:e=!1}=u;if(e||(D=R(D)),D.length===0)return 0;let t=0;const B={ambiguousAsWide:!F};for(const{segment:r}of SD.segment(D)){const C=r.codePointAt(0);if(!(C<=31||C>=127&&C<=159)&&!(C>=768&&C<=879)){if(vD().test(r)){t+=2;continue}t+=xD(C,B)}}return t}E(y,"stringWidth");const $=10,U=E((D=0)=>u=>`\x1B[${u+D}m`,"wrapAnsi16"),K=E((D=0)=>u=>`\x1B[${38+D};5;${u}m`,"wrapAnsi256"),Y=E((D=0)=>(u,F,e)=>`\x1B[${38+D};2;${u};${F};${e}m`,"wrapAnsi16m"),n={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(n.modifier);const ND=Object.keys(n.color),_D=Object.keys(n.bgColor);[...ND,..._D];function TD(){const D=new Map;for(const[u,F]of Object.entries(n)){for(const[e,t]of Object.entries(F))n[e]={open:`\x1B[${t[0]}m`,close:`\x1B[${t[1]}m`},F[e]=n[e],D.set(t[0],t[1]);Object.defineProperty(n,u,{value:F,enumerable:!1})}return Object.defineProperty(n,"codes",{value:D,enumerable:!1}),n.color.close="\x1B[39m",n.bgColor.close="\x1B[49m",n.color.ansi=U(),n.color.ansi256=K(),n.color.ansi16m=Y(),n.bgColor.ansi=U($),n.bgColor.ansi256=K($),n.bgColor.ansi16m=Y($),Object.defineProperties(n,{rgbToAnsi256:{value:E((u,F,e)=>u===F&&F===e?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(e/255*5),"value"),enumerable:!1},hexToRgb:{value:E(u=>{const F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[e]=F;e.length===3&&(e=[...e].map(B=>B+B).join(""));const t=Number.parseInt(e,16);return[t>>16&255,t>>8&255,t&255]},"value"),enumerable:!1},hexToAnsi256:{value:E(u=>n.rgbToAnsi256(...n.hexToRgb(u)),"value"),enumerable:!1},ansi256ToAnsi:{value:E(u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,e,t;if(u>=232)F=((u-232)*10+8)/255,e=F,t=F;else{u-=16;const C=u%36;F=Math.floor(u/36)/5,e=Math.floor(C/6)/5,t=C%6/5}const B=Math.max(F,e,t)*2;if(B===0)return 30;let r=30+(Math.round(t)<<2|Math.round(e)<<1|Math.round(F));return B===2&&(r+=60),r},"value"),enumerable:!1},rgbToAnsi:{value:E((u,F,e)=>n.ansi256ToAnsi(n.rgbToAnsi256(u,F,e)),"value"),enumerable:!1},hexToAnsi:{value:E(u=>n.ansi256ToAnsi(n.hexToAnsi256(u)),"value"),enumerable:!1}}),n}E(TD,"assembleStyles");const $D=TD(),S=new Set(["\x1B",""]),jD=39,k="\x07",Q="[",OD="]",X="m",v=`${OD}8;;`,Z=E(D=>`${S.values().next().value}${Q}${D}${X}`,"wrapAnsiCode"),V=E(D=>`${S.values().next().value}${v}${D}${k}`,"wrapAnsiHyperlink"),ID=E(D=>D.split(" ").map(u=>y(u)),"wordLengths"),j=E((D,u,F)=>{const e=[...u];let t=!1,B=!1,r=y(R(D.at(-1)));for(const[C,o]of e.entries()){const A=y(o);if(r+A<=F?D[D.length-1]+=o:(D.push(o),r=0),S.has(o)&&(t=!0,B=e.slice(C+1,C+1+v.length).join("")===v),t){B?o===k&&(t=!1,B=!1):o===X&&(t=!1);continue}r+=A,r===F&&C<e.length-1&&(D.push(""),r=0)}!r&&D.at(-1).length>0&&D.length>1&&(D[D.length-2]+=D.pop())},"wrapWord"),MD=E(D=>{const u=D.split(" ");let F=u.length;for(;F>0&&!(y(u[F-1])>0);)F--;return F===u.length?D:u.slice(0,F).join(" ")+u.slice(F).join("")},"stringVisibleTrimSpacesRight"),LD=E((D,u,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let e="",t,B;const r=ID(D);let C=[""];for(const[i,l]of D.split(" ").entries()){F.trim!==!1&&(C[C.length-1]=C.at(-1).trimStart());let a=y(C.at(-1));if(i!==0&&(a>=u&&(F.wordWrap===!1||F.trim===!1)&&(C.push(""),a=0),(a>0||F.trim===!1)&&(C[C.length-1]+=" ",a++)),F.hard&&r[i]>u){const c=u-a,p=1+Math.floor((r[i]-c-1)/u);Math.floor((r[i]-1)/u)<p&&C.push(""),j(C,l,u);continue}if(a+r[i]>u&&a>0&&r[i]>0){if(F.wordWrap===!1&&a<u){j(C,l,u);continue}C.push("")}if(a+r[i]>u&&F.wordWrap===!1){j(C,l,u);continue}C[C.length-1]+=l}F.trim!==!1&&(C=C.map(i=>MD(i)));const o=C.join(`
|
|
2
|
+
`),A=[...o];let g=0;for(const[i,l]of A.entries()){if(e+=l,S.has(l)){const{groups:c}=new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${v}(?<uri>.*)${k})`).exec(o.slice(g))||{groups:{}};if(c.code!==void 0){const p=Number.parseFloat(c.code);t=p===jD?void 0:p}else c.uri!==void 0&&(B=c.uri.length===0?void 0:c.uri)}const a=$D.codes.get(Number(t));A[i+1]===`
|
|
3
|
+
`?(B&&(e+=V("")),t&&a&&(e+=Z(a))):l===`
|
|
4
|
+
`&&(t&&a&&(e+=Z(t)),B&&(e+=V(B))),g+=l.length}return e},"exec");function DD(D,u,F){return String(D).normalize().replaceAll(`\r
|
|
5
|
+
`,`
|
|
6
|
+
`).split(`
|
|
7
|
+
`).map(e=>LD(e,u,F)).join(`
|
|
8
|
+
`)}E(DD,"wrapAnsi");var RD=Object.defineProperty,kD=E((D,u)=>RD(D,"name",{value:u,configurable:!0}),"r");const WD=kD((D,u)=>(u.__write??u.write).call(u,D),"writeStream"),PD=new Intl.Segmenter;function O(D,{countAnsiEscapeCodes:u=!1}={}){if(D===""||(u||(D=R(D)),D===""))return 0;let F=0;for(const e of PD.segment(D))F++;return F}E(O,"stringLength");var zD=Object.defineProperty,GD=E((D,u)=>zD(D,"name",{value:u,configurable:!0}),"o$1");const I=GD((D,u,F,e=!1)=>{const{message:t,name:B,stack:r}=D,C=[];if(C.push(...e?[]:[F+nD(B),": "],DD(t,u-3,{hard:!0,trim:!0,wordWrap:!0})),r){const o=r.split(`
|
|
9
|
+
`).splice(1).map(A=>F+A.trim().replace("file://","")).filter(A=>!A.includes("/pail/dist"));C.push(`
|
|
10
|
+
`,o.map(A=>" "+A.replace(/^at +/,g=>f(g)).replace(/\((.+)\)/,(g,i)=>"("+BD(i)+")")).join(`
|
|
11
|
+
`))}return C.join("")},"formatError");var UD=Object.defineProperty,KD=E((D,u)=>UD(D,"name",{value:u,configurable:!0}),"o");const YD=KD((D,u)=>{let F=u.uppercase.label?D.toUpperCase():D;return F=u.underline.label?M(F):F,u.bold.label&&(F=sD(F)),F},"formatLabel");var ZD=Object.defineProperty,VD=E((D,u)=>ZD(D,"name",{value:u,configurable:!0}),"E");class qD extends lD{static{E(this,"q")}static{VD(this,"PrettyReporter")}#D;#u;#F;#e=!1;constructor(u={}){super({uppercase:{label:!0,...u.uppercase},...u}),this.#D=CD,this.#u=tD}setStdout(u){this.#D=u}setStderr(u){this.#u=u}setInteractiveManager(u){this.#F=u}setIsInteractive(u){this.#e=u}log(u){this._log(this._formatMessage(u),u.type.level)}_formatMessage(u){const{columns:F}=gD();let e=F;typeof this._styles.messageLength=="number"&&(e=this._styles.messageLength);const{badge:t,context:B,date:r,error:C,file:o,groups:A,label:g,message:i,prefix:l,repeated:a,scope:c,suffix:p,traceError:N,type:uD}=u,{color:W}=this._loggerTypes[uD.name],P=W?rD[W]:iD,m=A.map(()=>" ").join(""),s=[];if(A.length>0&&s.push(m+f("["+A.at(-1)+"]")+" "),r&&s.push(f(this._styles.dateFormatter(typeof r=="string"?new Date(r):r))+" "),t)s.push(P(t));else{const h=cD(this._loggerTypes);h.length>0&&s.push(f(".".repeat(h.length))+" ")}const z=fD(this._loggerTypes);g?s.push(P(YD(g,this._styles))+" ",f(".".repeat(z.length-O(g)))):s.push(f(".".repeat(z.length+2))),a&&s.push(oD.white("["+a+"x]")+" "),Array.isArray(c)&&c.length>0&&s.push(" "+f("["+c.join(" > ")+"]")+" "),l&&s.push(f((Array.isArray(c)&&c.length>0?". ":" ")+"["+(this._styles.underline.prefix?M(l):l)+"]")+" ");const _=O(s.join(" "));if(o){const h=o.name+(o.line?":"+o.line:""),d=O(h);d+_+2>e?s.push(f(" "+h)):s.push(f(".".repeat(e-_-d-2)+" "+h))}else s.push(f(".".repeat(e-_-1)));s.length>0&&s.push(`
|
|
12
|
+
|
|
13
|
+
`);const FD=typeof i=="string"?i:this._stringify(i);if(s.push(m+DD(FD??"undefined",e-3,{hard:!0,trim:!0,wordWrap:!0})),B){let h=!1;s.push(...B.map(d=>{if(d instanceof Error)return h=!0,`
|
|
14
|
+
|
|
15
|
+
`+I(d,e,m);if(typeof d=="object")return" "+this._stringify(d);const eD=(h?`
|
|
16
|
+
|
|
17
|
+
`:" ")+d;return h=!1,eD}))}return C&&s.push(I(C,e,m)),N&&s.push(I(N,e,m,!0)),p&&s.push(`
|
|
18
|
+
`,m+f(this._styles.underline.suffix?M(p):p)),s.join("")+`
|
|
19
|
+
`}_log(u,F){const e=["error","trace","warn"].includes(F)?"stderr":"stdout",t=e==="stderr"?this.#u:this.#D;this.#e&&this.#F!==void 0&&t.isTTY?this.#F.update(e,u.split(`
|
|
20
|
+
`),0):WD(u+`
|
|
21
|
+
`,t)}}const Eu=qD;export{Eu as a,YD as b,I as c,WD as n,O as s,gD as t,DD as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=Object.defineProperty;var s=(l,t)=>r(l,"name",{value:t,configurable:!0});var a=Object.defineProperty,o=s((l,t)=>a(l,"name",{value:t,configurable:!0}),"n");class c{static{s(this,"o")}static{o(this,"AbstractJsonReporter")}stringify;setStringify(t){this.stringify=t}log(t){const{file:e,type:n,...i}=t;i.label&&(i.label=i.label.trim()),e&&(i.file=e.name+":"+e.line+(e.column?":"+e.column:"")),this._log(this.stringify(i),n.level)}}exports.o=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var n=(r,e)=>f(r,"name",{value:e,configurable:!0});import{configure as m}from"safe-stable-stringify";import{L as d,s as u,E as L}from"./pail.CKgnzwt6.mjs";import{t as y}from"./pail.BP95fgQZ.mjs";var b=Object.defineProperty,v=n((r,e)=>b(r,"name",{value:e,configurable:!0}),"t");class w{static{n(this,"i")}static{v(this,"RawReporter")}log(e){const{context:t=[],message:s,type:o}=e;y(o.level)(s,...t)}}var x=Object.defineProperty,_=n((r,e)=>x(r,"name",{value:e,configurable:!0}),"a");const M=_(r=>r===void 0?[]:Array.isArray(r)?r:[r],"arrayify");var T=Object.defineProperty,E=n((r,e)=>T(r,"name",{value:e,configurable:!0}),"g");const R=E((r,e)=>{const t={...r};return Object.keys(e).forEach(s=>{t[s]={...t[s],...e[s]}}),t},"mergeTypes");var j=Object.defineProperty,c=n((r,e)=>j(r,"name",{value:e,configurable:!0}),"l");const P={badge:void 0,context:void 0,error:void 0,label:void 0,message:void 0,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};class S{static{n(this,"PailBrowserImpl")}static{c(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5,this.stringify=m({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",this.types=R(d,e.types??{}),this.longestLabel=u(this.types),this.logLevels={...L,...e.logLevels},this.generalLogLevel=this._normalizeLogLevel(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.scopeName=M(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set;for(const t in this.types)this[t]=this._logger.bind(this,t,!1);this.lastLog={},Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new w),Array.isArray(e.processors)&&this.registerProcessors(e.processors)}wrapConsole(){for(const e in this.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e]}restoreConsole(){for(const e in this.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapException(){typeof process<"u"&&(process.on("uncaughtException",e=>{this.error(e)}),process.on("unhandledRejection",e=>{this.error(e)}))}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[]}time(e="default"){this.seqTimers.has(e)?this._logger("warn",!1,{message:"Timer '"+e+"' already exists",prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this._logger("start",!1,{message:this.startTimerMessage,prefix:e}))}timeLog(e,...t){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const s=Date.now()-this.timersMap.get(e);this._logger("info",!1,{context:t,message:s<1e3?s+" ms":(s/1e3).toFixed(2)+" s",prefix:e})}else this._logger("warn",!1,{context:t,message:"Timer not found",prefix:e})}timeEnd(e){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const t=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this._logger("stop",!1,{message:this.endTimerMessage+" "+(t<1e3?t+" ms":(t/1e3).toFixed(2)+" s"),prefix:e})}}group(e="console.group"){typeof window>"u"?console.group(e):this.groups.push(e)}groupEnd(){typeof window>"u"?console.groupEnd():this.groups.pop()}count(e="default"){const t=this.countMap.get(e)??0;this.countMap.set(e,t+1),this._logger("log",!1,{message:e+": "+(t+1),prefix:e})}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this._logger("warn",!1,{message:"Count for "+e+" does not exist",prefix:e})}clear(){console.clear()}raw(e,...t){this.disabled||this._logger("log",!0,{context:t,message:e})}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(const t of e)this.reporters.add(this.extendReporter(t))}_report(e,t){if(t)this.rawReporter.log(Object.freeze(e));else for(const s of this.reporters)s.log(Object.freeze(e))}registerProcessors(e){for(const t of e)typeof t.setStringify=="function"&&t.setStringify(this.stringify),this.processors.add(t)}_normalizeLogLevel(e){return e&&this.logLevels[e]?e:"debug"}_buildMeta(e,t,...s){const o={...P};if(o.type={level:t.logLevel,name:e},o.groups=this.groups,o.scope=this.scopeName,o.date=new Date,s.length===1&&typeof s[0]=="object"&&s[0]!==null)if(s[0]instanceof Error)o.error=s[0];else if("message"in s[0]){const{context:i,message:g,prefix:h,suffix:a}=s[0];i&&(o.context=i),h&&(o.prefix=h),a&&(o.suffix=a),o.message=g}else o.message=s[0];else s.length>1&&typeof s[0]=="string"?(o.message=s[0],o.context=s.slice(1)):o.message=s[0];return t.logLevel==="trace"&&(o.traceError=new Error("Trace")),t.badge&&(o.badge=t.badge),t.label&&(o.label=t.label),o}_logger(e,t,...s){if(this.disabled)return;const o=this._normalizeLogLevel(this.types[e].logLevel);if(this.logLevels[o]>=this.logLevels[this.generalLogLevel]){let i=this._buildMeta(e,this.types[e],...s);const g=c((a=!1)=>{const l=(this.lastLog.count||0)-this.throttleMin;if(this.lastLog.object&&l>0){const p={...this.lastLog.object};l>1&&(p.repeated=l),this._report(p,t),this.lastLog.count=1}if(a){for(const p of this.processors)i={...p.process(i)};this.lastLog.object=i,this._report(i,t)}},"resolveLog");clearTimeout(this.lastLog.timeout);const h=this.lastLog.time&&i.date?new Date(i.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(i.date),h<this.throttle)try{const a=JSON.stringify([i.label,i.scope,i.type,i.message,i.prefix,i.suffix,i.context]),l=this.lastLog.serialized===a;if(this.lastLog.serialized=a,l&&(this.lastLog.count=(this.lastLog.count||0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(g,this.throttle);return}}catch{}g(!0)}}}const N=S;export{N as P,S as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var n=(r,e)=>m(r,"name",{value:e,configurable:!0});const u=require("safe-stable-stringify"),p=require("./pail.B0AqLGpo.cjs"),L=require("./pail.3G15muTS.cjs");var y=Object.defineProperty,b=n((r,e)=>y(r,"name",{value:e,configurable:!0}),"t");class v{static{n(this,"i")}static{b(this,"RawReporter")}log(e){const{context:t=[],message:s,type:o}=e;L.t(o.level)(s,...t)}}var w=Object.defineProperty,x=n((r,e)=>w(r,"name",{value:e,configurable:!0}),"a");const _=x(r=>r===void 0?[]:Array.isArray(r)?r:[r],"arrayify");var M=Object.defineProperty,T=n((r,e)=>M(r,"name",{value:e,configurable:!0}),"g");const E=T((r,e)=>{const t={...r};return Object.keys(e).forEach(s=>{t[s]={...t[s],...e[s]}}),t},"mergeTypes");var R=Object.defineProperty,f=n((r,e)=>R(r,"name",{value:e,configurable:!0}),"l");const S={badge:void 0,context:void 0,error:void 0,label:void 0,message:void 0,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};class d{static{n(this,"PailBrowserImpl")}static{f(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5,this.stringify=u.configure({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",this.types=E(p.LOG_TYPES,e.types??{}),this.longestLabel=p.s(this.types),this.logLevels={...p.EXTENDED_RFC_5424_LOG_LEVELS,...e.logLevels},this.generalLogLevel=this._normalizeLogLevel(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.scopeName=_(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set;for(const t in this.types)this[t]=this._logger.bind(this,t,!1);this.lastLog={},Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new v),Array.isArray(e.processors)&&this.registerProcessors(e.processors)}wrapConsole(){for(const e in this.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e]}restoreConsole(){for(const e in this.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapException(){typeof process<"u"&&(process.on("uncaughtException",e=>{this.error(e)}),process.on("unhandledRejection",e=>{this.error(e)}))}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[]}time(e="default"){this.seqTimers.has(e)?this._logger("warn",!1,{message:"Timer '"+e+"' already exists",prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this._logger("start",!1,{message:this.startTimerMessage,prefix:e}))}timeLog(e,...t){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const s=Date.now()-this.timersMap.get(e);this._logger("info",!1,{context:t,message:s<1e3?s+" ms":(s/1e3).toFixed(2)+" s",prefix:e})}else this._logger("warn",!1,{context:t,message:"Timer not found",prefix:e})}timeEnd(e){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){const t=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this._logger("stop",!1,{message:this.endTimerMessage+" "+(t<1e3?t+" ms":(t/1e3).toFixed(2)+" s"),prefix:e})}}group(e="console.group"){typeof window>"u"?console.group(e):this.groups.push(e)}groupEnd(){typeof window>"u"?console.groupEnd():this.groups.pop()}count(e="default"){const t=this.countMap.get(e)??0;this.countMap.set(e,t+1),this._logger("log",!1,{message:e+": "+(t+1),prefix:e})}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this._logger("warn",!1,{message:"Count for "+e+" does not exist",prefix:e})}clear(){console.clear()}raw(e,...t){this.disabled||this._logger("log",!0,{context:t,message:e})}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(const t of e)this.reporters.add(this.extendReporter(t))}_report(e,t){if(t)this.rawReporter.log(Object.freeze(e));else for(const s of this.reporters)s.log(Object.freeze(e))}registerProcessors(e){for(const t of e)typeof t.setStringify=="function"&&t.setStringify(this.stringify),this.processors.add(t)}_normalizeLogLevel(e){return e&&this.logLevels[e]?e:"debug"}_buildMeta(e,t,...s){const o={...S};if(o.type={level:t.logLevel,name:e},o.groups=this.groups,o.scope=this.scopeName,o.date=new Date,s.length===1&&typeof s[0]=="object"&&s[0]!==null)if(s[0]instanceof Error)o.error=s[0];else if("message"in s[0]){const{context:i,message:g,prefix:h,suffix:a}=s[0];i&&(o.context=i),h&&(o.prefix=h),a&&(o.suffix=a),o.message=g}else o.message=s[0];else s.length>1&&typeof s[0]=="string"?(o.message=s[0],o.context=s.slice(1)):o.message=s[0];return t.logLevel==="trace"&&(o.traceError=new Error("Trace")),t.badge&&(o.badge=t.badge),t.label&&(o.label=t.label),o}_logger(e,t,...s){if(this.disabled)return;const o=this._normalizeLogLevel(this.types[e].logLevel);if(this.logLevels[o]>=this.logLevels[this.generalLogLevel]){let i=this._buildMeta(e,this.types[e],...s);const g=f((a=!1)=>{const l=(this.lastLog.count||0)-this.throttleMin;if(this.lastLog.object&&l>0){const c={...this.lastLog.object};l>1&&(c.repeated=l),this._report(c,t),this.lastLog.count=1}if(a){for(const c of this.processors)i={...c.process(i)};this.lastLog.object=i,this._report(i,t)}},"resolveLog");clearTimeout(this.lastLog.timeout);const h=this.lastLog.time&&i.date?new Date(i.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(i.date),h<this.throttle)try{const a=JSON.stringify([i.label,i.scope,i.type,i.message,i.prefix,i.suffix,i.context]),l=this.lastLog.serialized===a;if(this.lastLog.serialized=a,l&&(this.lastLog.count=(this.lastLog.count||0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(g,this.throttle);return}}catch{}g(!0)}}}const j=d;exports.PailBrowser=j;exports.PailBrowserImpl=d;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";var BD=Object.defineProperty;var E=(D,u)=>BD(D,"name",{value:u,configurable:!0});const M=require("node:process"),i=require("@visulima/colorize"),sD=require("node:child_process"),iD=require("node:fs"),oD=require("node:tty"),U=require("./pail.nUyAB-mN.cjs"),aD=require("./pail.B0AqLGpo.cjs"),N=E(D=>D&&typeof D=="object"&&"default"in D?D.default:D,"_interopDefaultCompat"),b=N(M),AD=N(i),w=N(iD),lD=N(oD),Q=80,X=24,R=E((D,u,{shell:F,env:e}={})=>sD.execFileSync(D,u,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:F,env:e}).trim(),"exec$1"),_=E((D,u)=>({columns:Number.parseInt(D,10),rows:Number.parseInt(u,10)}),"create"),DD=E((D,u)=>{const{columns:F,rows:e}=_(D,u);if(!(Number.isNaN(F)||Number.isNaN(e))&&!(F===Q&&e===X))return{columns:F,rows:e}},"createIfNotDefault");function uD(){const{env:D,stdout:u,stderr:F}=b;if(u?.columns&&u?.rows)return _(u.columns,u.rows);if(F?.columns&&F?.rows)return _(F.columns,F.rows);if(D.COLUMNS&&D.LINES)return _(D.COLUMNS,D.LINES);const e={columns:Q,rows:X};return b.platform==="win32"?O()??e:b.platform==="darwin"?K()??O()??e:K()??O()??cD()??e}E(uD,"terminalSize");const K=E(()=>{try{const D=b.platform==="darwin"?w.constants.O_EVTONLY|w.constants.O_NONBLOCK:w.constants.O_NONBLOCK,{columns:u,rows:F}=lD.WriteStream(w.openSync("/dev/tty",D));return{columns:u,rows:F}}catch{}},"devTty"),O=E(()=>{try{const D=R("tput",["cols"],{env:{TERM:"dumb",...b.env}}),u=R("tput",["lines"],{env:{TERM:"dumb",...b.env}});if(D&&u)return DD(D,u)}catch{}},"tput"),cD=E(()=>{try{const D=R("resize",["-u"]).match(/\d+/g);if(D.length===2)return DD(D[0],D[1])}catch{}},"resize");function fD({onlyFirst:D=!1}={}){const u=["[\\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(u,D?void 0:"g")}E(fD,"ansiRegex");const gD=fD();function k(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(gD,"")}E(k,"stripAnsi");function hD(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}E(hD,"isAmbiguous");function pD(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}E(pD,"isFullWidth");function dD(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}E(dD,"isWide");function mD(D){if(!Number.isSafeInteger(D))throw new TypeError(`Expected a code point, got \`${typeof D}\`.`)}E(mD,"validate");function bD(D,{ambiguousAsWide:u=!1}={}){return mD(D),pD(D)||dD(D)||u&&hD(D)?2:1}E(bD,"eastAsianWidth");const yD=E(()=>/[#*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\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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\uD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?(?:\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\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\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"),wD=new Intl.Segmenter;function y(D,u={}){if(typeof D!="string"||D.length===0)return 0;const{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:e=!1}=u;if(e||(D=k(D)),D.length===0)return 0;let t=0;const B={ambiguousAsWide:!F};for(const{segment:r}of wD.segment(D)){const C=r.codePointAt(0);if(!(C<=31||C>=127&&C<=159)&&!(C>=768&&C<=879)){if(yD().test(r)){t+=2;continue}t+=bD(C,B)}}return t}E(y,"stringWidth");const L=10,Y=E((D=0)=>u=>`\x1B[${u+D}m`,"wrapAnsi16"),Z=E((D=0)=>u=>`\x1B[${38+D};5;${u}m`,"wrapAnsi256"),V=E((D=0)=>(u,F,e)=>`\x1B[${38+D};2;${u};${F};${e}m`,"wrapAnsi16m"),n={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(n.modifier);const _D=Object.keys(n.color),xD=Object.keys(n.bgColor);[..._D,...xD];function SD(){const D=new Map;for(const[u,F]of Object.entries(n)){for(const[e,t]of Object.entries(F))n[e]={open:`\x1B[${t[0]}m`,close:`\x1B[${t[1]}m`},F[e]=n[e],D.set(t[0],t[1]);Object.defineProperty(n,u,{value:F,enumerable:!1})}return Object.defineProperty(n,"codes",{value:D,enumerable:!1}),n.color.close="\x1B[39m",n.bgColor.close="\x1B[49m",n.color.ansi=Y(),n.color.ansi256=Z(),n.color.ansi16m=V(),n.bgColor.ansi=Y(L),n.bgColor.ansi256=Z(L),n.bgColor.ansi16m=V(L),Object.defineProperties(n,{rgbToAnsi256:{value:E((u,F,e)=>u===F&&F===e?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(e/255*5),"value"),enumerable:!1},hexToRgb:{value:E(u=>{const F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[e]=F;e.length===3&&(e=[...e].map(B=>B+B).join(""));const t=Number.parseInt(e,16);return[t>>16&255,t>>8&255,t&255]},"value"),enumerable:!1},hexToAnsi256:{value:E(u=>n.rgbToAnsi256(...n.hexToRgb(u)),"value"),enumerable:!1},ansi256ToAnsi:{value:E(u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,e,t;if(u>=232)F=((u-232)*10+8)/255,e=F,t=F;else{u-=16;const C=u%36;F=Math.floor(u/36)/5,e=Math.floor(C/6)/5,t=C%6/5}const B=Math.max(F,e,t)*2;if(B===0)return 30;let r=30+(Math.round(t)<<2|Math.round(e)<<1|Math.round(F));return B===2&&(r+=60),r},"value"),enumerable:!1},rgbToAnsi:{value:E((u,F,e)=>n.ansi256ToAnsi(n.rgbToAnsi256(u,F,e)),"value"),enumerable:!1},hexToAnsi:{value:E(u=>n.ansi256ToAnsi(n.hexToAnsi256(u)),"value"),enumerable:!1}}),n}E(SD,"assembleStyles");const vD=SD(),T=new Set(["\x1B",""]),ND=39,W="\x07",FD="[",TD="]",eD="m",v=`${TD}8;;`,H=E(D=>`${T.values().next().value}${FD}${D}${eD}`,"wrapAnsiCode"),J=E(D=>`${T.values().next().value}${v}${D}${W}`,"wrapAnsiHyperlink"),jD=E(D=>D.split(" ").map(u=>y(u)),"wordLengths"),I=E((D,u,F)=>{const e=[...u];let t=!1,B=!1,r=y(k(D.at(-1)));for(const[C,a]of e.entries()){const l=y(a);if(r+l<=F?D[D.length-1]+=a:(D.push(a),r=0),T.has(a)&&(t=!0,B=e.slice(C+1,C+1+v.length).join("")===v),t){B?a===W&&(t=!1,B=!1):a===eD&&(t=!1);continue}r+=l,r===F&&C<e.length-1&&(D.push(""),r=0)}!r&&D.at(-1).length>0&&D.length>1&&(D[D.length-2]+=D.pop())},"wrapWord"),$D=E(D=>{const u=D.split(" ");let F=u.length;for(;F>0&&!(y(u[F-1])>0);)F--;return F===u.length?D:u.slice(0,F).join(" ")+u.slice(F).join("")},"stringVisibleTrimSpacesRight"),OD=E((D,u,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let e="",t,B;const r=jD(D);let C=[""];for(const[o,c]of D.split(" ").entries()){F.trim!==!1&&(C[C.length-1]=C.at(-1).trimStart());let A=y(C.at(-1));if(o!==0&&(A>=u&&(F.wordWrap===!1||F.trim===!1)&&(C.push(""),A=0),(A>0||F.trim===!1)&&(C[C.length-1]+=" ",A++)),F.hard&&r[o]>u){const f=u-A,p=1+Math.floor((r[o]-f-1)/u);Math.floor((r[o]-1)/u)<p&&C.push(""),I(C,c,u);continue}if(A+r[o]>u&&A>0&&r[o]>0){if(F.wordWrap===!1&&A<u){I(C,c,u);continue}C.push("")}if(A+r[o]>u&&F.wordWrap===!1){I(C,c,u);continue}C[C.length-1]+=c}F.trim!==!1&&(C=C.map(o=>$D(o)));const a=C.join(`
|
|
2
|
+
`),l=[...a];let g=0;for(const[o,c]of l.entries()){if(e+=c,T.has(c)){const{groups:f}=new RegExp(`(?:\\${FD}(?<code>\\d+)m|\\${v}(?<uri>.*)${W})`).exec(a.slice(g))||{groups:{}};if(f.code!==void 0){const p=Number.parseFloat(f.code);t=p===ND?void 0:p}else f.uri!==void 0&&(B=f.uri.length===0?void 0:f.uri)}const A=vD.codes.get(Number(t));l[o+1]===`
|
|
3
|
+
`?(B&&(e+=J("")),t&&A&&(e+=H(A))):c===`
|
|
4
|
+
`&&(t&&A&&(e+=H(t)),B&&(e+=J(B))),g+=c.length}return e},"exec");function P(D,u,F){return String(D).normalize().replaceAll(`\r
|
|
5
|
+
`,`
|
|
6
|
+
`).split(`
|
|
7
|
+
`).map(e=>OD(e,u,F)).join(`
|
|
8
|
+
`)}E(P,"wrapAnsi");var LD=Object.defineProperty,ID=E((D,u)=>LD(D,"name",{value:u,configurable:!0}),"r");const ED=ID((D,u)=>(u.__write??u.write).call(u,D),"writeStream"),MD=new Intl.Segmenter;function x(D,{countAnsiEscapeCodes:u=!1}={}){if(D===""||(u||(D=k(D)),D===""))return 0;let F=0;for(const e of MD.segment(D))F++;return F}E(x,"stringLength");var RD=Object.defineProperty,kD=E((D,u)=>RD(D,"name",{value:u,configurable:!0}),"o$1");const S=kD((D,u,F,e=!1)=>{const{message:t,name:B,stack:r}=D,C=[];if(C.push(...e?[]:[F+i.red(B),": "],P(t,u-3,{hard:!0,trim:!0,wordWrap:!0})),r){const a=r.split(`
|
|
9
|
+
`).splice(1).map(l=>F+l.trim().replace("file://","")).filter(l=>!l.includes("/pail/dist"));C.push(`
|
|
10
|
+
`,a.map(l=>" "+l.replace(/^at +/,g=>i.grey(g)).replace(/\((.+)\)/,(g,o)=>"("+i.cyan(o)+")")).join(`
|
|
11
|
+
`))}return C.join("")},"formatError");var WD=Object.defineProperty,PD=E((D,u)=>WD(D,"name",{value:u,configurable:!0}),"o");const CD=PD((D,u)=>{let F=u.uppercase.label?D.toUpperCase():D;return F=u.underline.label?i.underline(F):F,u.bold.label&&(F=i.bold(F)),F},"formatLabel");var zD=Object.defineProperty,qD=E((D,u)=>zD(D,"name",{value:u,configurable:!0}),"E");class GD extends U.AbstractPrettyReporter{static{E(this,"q")}static{qD(this,"PrettyReporter")}#D;#u;#F;#e=!1;constructor(u={}){super({uppercase:{label:!0,...u.uppercase},...u}),this.#D=M.stdout,this.#u=M.stderr}setStdout(u){this.#D=u}setStderr(u){this.#u=u}setInteractiveManager(u){this.#F=u}setIsInteractive(u){this.#e=u}log(u){this._log(this._formatMessage(u),u.type.level)}_formatMessage(u){const{columns:F}=uD();let e=F;typeof this._styles.messageLength=="number"&&(e=this._styles.messageLength);const{badge:t,context:B,date:r,error:C,file:a,groups:l,label:g,message:o,prefix:c,repeated:A,scope:f,suffix:p,traceError:j,type:tD}=u,{color:z}=this._loggerTypes[tD.name],q=z?AD[z]:i.white,m=l.map(()=>" ").join(""),s=[];if(l.length>0&&s.push(m+i.grey("["+l.at(-1)+"]")+" "),r&&s.push(i.grey(this._styles.dateFormatter(typeof r=="string"?new Date(r):r))+" "),t)s.push(q(t));else{const h=U.s(this._loggerTypes);h.length>0&&s.push(i.grey(".".repeat(h.length))+" ")}const G=aD.s(this._loggerTypes);g?s.push(q(CD(g,this._styles))+" ",i.grey(".".repeat(G.length-x(g)))):s.push(i.grey(".".repeat(G.length+2))),A&&s.push(i.bgGrey.white("["+A+"x]")+" "),Array.isArray(f)&&f.length>0&&s.push(" "+i.grey("["+f.join(" > ")+"]")+" "),c&&s.push(i.grey((Array.isArray(f)&&f.length>0?". ":" ")+"["+(this._styles.underline.prefix?i.underline(c):c)+"]")+" ");const $=x(s.join(" "));if(a){const h=a.name+(a.line?":"+a.line:""),d=x(h);d+$+2>e?s.push(i.grey(" "+h)):s.push(i.grey(".".repeat(e-$-d-2)+" "+h))}else s.push(i.grey(".".repeat(e-$-1)));s.length>0&&s.push(`
|
|
12
|
+
|
|
13
|
+
`);const rD=typeof o=="string"?o:this._stringify(o);if(s.push(m+P(rD??"undefined",e-3,{hard:!0,trim:!0,wordWrap:!0})),B){let h=!1;s.push(...B.map(d=>{if(d instanceof Error)return h=!0,`
|
|
14
|
+
|
|
15
|
+
`+S(d,e,m);if(typeof d=="object")return" "+this._stringify(d);const nD=(h?`
|
|
16
|
+
|
|
17
|
+
`:" ")+d;return h=!1,nD}))}return C&&s.push(S(C,e,m)),j&&s.push(S(j,e,m,!0)),p&&s.push(`
|
|
18
|
+
`,m+i.grey(this._styles.underline.suffix?i.underline(p):p)),s.join("")+`
|
|
19
|
+
`}_log(u,F){const e=["error","trace","warn"].includes(F)?"stderr":"stdout",t=e==="stderr"?this.#u:this.#D;this.#e&&this.#F!==void 0&&t.isTTY?this.#F.update(e,u.split(`
|
|
20
|
+
`),0):ED(u+`
|
|
21
|
+
`,t)}}const UD=GD;exports.a=UD;exports.n=ED;exports.n$1=CD;exports.stringLength=x;exports.terminalSize=uD;exports.w=S;exports.wrapAnsi=P;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { stringify } from 'safe-stable-stringify';
|
|
2
|
-
import { h as StringifyAwareReporter, g as ReadonlyMeta, e as LiteralUnion, E as ExtendedRfc5424LogLevels, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, a as DefaultLogTypes } from './
|
|
2
|
+
import { h as StringifyAwareReporter, g as ReadonlyMeta, e as LiteralUnion, E as ExtendedRfc5424LogLevels, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, a as DefaultLogTypes } from './pail.BxGKtnGM.js';
|
|
3
3
|
|
|
4
|
-
declare abstract class AbstractJsonReporter<L extends string =
|
|
5
|
-
protected
|
|
4
|
+
declare abstract class AbstractJsonReporter<L extends string = string> implements StringifyAwareReporter<L> {
|
|
5
|
+
protected stringify: typeof stringify | undefined;
|
|
6
6
|
setStringify(function_: any): void;
|
|
7
7
|
log(meta: ReadonlyMeta<L>): void;
|
|
8
8
|
protected abstract _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
declare abstract class AbstractPrettyReporter<T extends string =
|
|
11
|
+
declare abstract class AbstractPrettyReporter<T extends string = string, L extends string = string> implements LoggerTypesAwareReporter<T, L>, StringifyAwareReporter<L> {
|
|
12
12
|
protected readonly _styles: PrettyStyleOptions;
|
|
13
13
|
protected _loggerTypes: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;
|
|
14
14
|
protected _stringify: typeof stringify | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=Object.defineProperty;var n=(r,t)=>a(r,"name",{value:t,configurable:!0});import{build as c}from"@visulima/fmt";var y=Object.defineProperty,f=n((r,t)=>y(r,"name",{value:t,configurable:!0}),"o");class g{static{n(this,"p")}static{f(this,"MessageFormatterProcessor")}#t;#e;constructor(t={}){this.#e=t.formatters}setStringify(t){this.#t=t}process(t){const e=c({formatters:this.#e,stringify:f(s=>{const o=this.#t(s);return o===void 0?(console.warn("Unable to stringify value of type "+typeof s,s),"undefined"):o},"stringify")});return t.message!==void 0&&(t.message=this._format(e,t.message,t.context??[])),t}_format(t,e,s=[]){if(typeof e=="string")return t(e,s);if(typeof e=="object"&&e!==null)for(const o in e){const i=e[o];(typeof i=="string"||Array.isArray(i)||typeof i=="object")&&(e[o]=this._format(t,i,s))}return e}}const u=g;export{u as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var s=(t,e)=>g(t,"name",{value:e,configurable:!0});const n=require("./pail.B0AqLGpo.cjs");var i=Object.defineProperty,l=s((t,e)=>i(t,"name",{value:e,configurable:!0}),"r$1");const c=l(t=>{const e=Object.keys(t).map(r=>t[r].badge??"");return e.length===0?"":e.reduce((r,a)=>r.length>a.length?r:a)},"getLongestBadge");var p=Object.defineProperty,o=s((t,e)=>p(t,"name",{value:e,configurable:!0}),"r");const y=o(t=>[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,"0")).join(":"),"dateFormatter");class b{static{s(this,"AbstractPrettyReporter")}static{o(this,"AbstractPrettyReporter")}_styles;_loggerTypes;_stringify;constructor(e){this._styles={bold:{label:!1},dateFormatter:y,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...e},this._loggerTypes=n.LOG_TYPES}setStringify(e){this._stringify=e}setLoggerTypes(e){this._loggerTypes=e}}exports.AbstractPrettyReporter=b;exports.s=c;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/pail",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Find a file or directory by walking up parent directories.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"ansi",
|
|
6
7
|
"anolilab",
|
|
7
8
|
"browser",
|
|
8
9
|
"browser-logger",
|
|
@@ -36,6 +37,8 @@
|
|
|
36
37
|
"logger",
|
|
37
38
|
"logging",
|
|
38
39
|
"node",
|
|
40
|
+
"stream",
|
|
41
|
+
"pretty",
|
|
39
42
|
"node-logger",
|
|
40
43
|
"pail",
|
|
41
44
|
"pino",
|
|
@@ -47,6 +50,7 @@
|
|
|
47
50
|
"rotating-log",
|
|
48
51
|
"show error",
|
|
49
52
|
"timer",
|
|
53
|
+
"universal",
|
|
50
54
|
"visulima",
|
|
51
55
|
"warning-logging",
|
|
52
56
|
"winston"
|
|
@@ -77,14 +81,14 @@
|
|
|
77
81
|
"type": "module",
|
|
78
82
|
"exports": {
|
|
79
83
|
".": {
|
|
80
|
-
"browser": "./dist/index.browser.
|
|
84
|
+
"browser": "./dist/index.browser.mjs",
|
|
81
85
|
"require": {
|
|
82
86
|
"types": "./dist/index.server.d.cts",
|
|
83
87
|
"default": "./dist/index.server.cjs"
|
|
84
88
|
},
|
|
85
89
|
"import": {
|
|
86
|
-
"types": "./dist/index.server.d.
|
|
87
|
-
"default": "./dist/index.server.
|
|
90
|
+
"types": "./dist/index.server.d.mts",
|
|
91
|
+
"default": "./dist/index.server.mjs"
|
|
88
92
|
}
|
|
89
93
|
},
|
|
90
94
|
"./browser": {
|
|
@@ -93,8 +97,8 @@
|
|
|
93
97
|
"default": "./dist/index.browser.cjs"
|
|
94
98
|
},
|
|
95
99
|
"import": {
|
|
96
|
-
"types": "./dist/index.browser.d.
|
|
97
|
-
"default": "./dist/index.browser.
|
|
100
|
+
"types": "./dist/index.browser.d.mts",
|
|
101
|
+
"default": "./dist/index.browser.mjs"
|
|
98
102
|
}
|
|
99
103
|
},
|
|
100
104
|
"./server": {
|
|
@@ -103,58 +107,79 @@
|
|
|
103
107
|
"default": "./dist/index.server.cjs"
|
|
104
108
|
},
|
|
105
109
|
"import": {
|
|
106
|
-
"types": "./dist/index.server.d.
|
|
107
|
-
"default": "./dist/index.server.
|
|
110
|
+
"types": "./dist/index.server.d.mts",
|
|
111
|
+
"default": "./dist/index.server.mjs"
|
|
108
112
|
}
|
|
109
113
|
},
|
|
110
114
|
"./reporter": {
|
|
111
|
-
"browser": "./dist/reporter.browser.
|
|
115
|
+
"browser": "./dist/reporter.browser.mjs",
|
|
112
116
|
"require": {
|
|
113
117
|
"types": "./dist/reporter.server.d.cts",
|
|
114
118
|
"default": "./dist/reporter.server.cjs"
|
|
115
119
|
},
|
|
116
120
|
"import": {
|
|
117
|
-
"types": "./dist/reporter.server.d.
|
|
118
|
-
"default": "./dist/reporter.server.
|
|
121
|
+
"types": "./dist/reporter.server.d.mts",
|
|
122
|
+
"default": "./dist/reporter.server.mjs"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"./server/reporter": {
|
|
126
|
+
"require": {
|
|
127
|
+
"types": "./dist/reporter.server.d.cts",
|
|
128
|
+
"default": "./dist/reporter.server.cjs"
|
|
129
|
+
},
|
|
130
|
+
"import": {
|
|
131
|
+
"types": "./dist/reporter.server.d.mts",
|
|
132
|
+
"default": "./dist/reporter.server.mjs"
|
|
119
133
|
}
|
|
120
134
|
},
|
|
121
135
|
"./browser/reporter": {
|
|
136
|
+
"browser": "./dist/reporter.browser.mjs",
|
|
122
137
|
"require": {
|
|
123
138
|
"types": "./dist/reporter.browser.d.cts",
|
|
124
139
|
"default": "./dist/reporter.browser.cjs"
|
|
125
140
|
},
|
|
126
141
|
"import": {
|
|
127
|
-
"types": "./dist/reporter.browser.d.
|
|
128
|
-
"default": "./dist/reporter.browser.
|
|
142
|
+
"types": "./dist/reporter.browser.d.mts",
|
|
143
|
+
"default": "./dist/reporter.browser.mjs"
|
|
129
144
|
}
|
|
130
145
|
},
|
|
131
|
-
"./
|
|
132
|
-
"browser": "./dist/
|
|
146
|
+
"./processor": {
|
|
147
|
+
"browser": "./dist/processor.browser.mjs",
|
|
133
148
|
"require": {
|
|
134
|
-
"types": "./dist/
|
|
135
|
-
"default": "./dist/
|
|
149
|
+
"types": "./dist/processor.server.d.cts",
|
|
150
|
+
"default": "./dist/processor.server.cjs"
|
|
136
151
|
},
|
|
137
152
|
"import": {
|
|
138
|
-
"types": "./dist/
|
|
139
|
-
"default": "./dist/
|
|
153
|
+
"types": "./dist/processor.server.d.mts",
|
|
154
|
+
"default": "./dist/processor.server.mjs"
|
|
140
155
|
}
|
|
141
156
|
},
|
|
142
|
-
"./processor": {
|
|
143
|
-
"browser": "./dist/processor.browser.js",
|
|
157
|
+
"./server/processor": {
|
|
144
158
|
"require": {
|
|
145
159
|
"types": "./dist/processor.server.d.cts",
|
|
146
160
|
"default": "./dist/processor.server.cjs"
|
|
147
161
|
},
|
|
148
162
|
"import": {
|
|
149
|
-
"types": "./dist/processor.server.d.
|
|
150
|
-
"default": "./dist/processor.server.
|
|
163
|
+
"types": "./dist/processor.server.d.mts",
|
|
164
|
+
"default": "./dist/processor.server.mjs"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"./browser/processor": {
|
|
168
|
+
"browser": "./dist/processor.browser.mjs",
|
|
169
|
+
"require": {
|
|
170
|
+
"types": "./dist/processor.browser.d.cts",
|
|
171
|
+
"default": "./dist/processor.browser.cjs"
|
|
172
|
+
},
|
|
173
|
+
"import": {
|
|
174
|
+
"types": "./dist/processor.browser.d.mts",
|
|
175
|
+
"default": "./dist/processor.browser.mjs"
|
|
151
176
|
}
|
|
152
177
|
},
|
|
153
178
|
"./package.json": "./package.json"
|
|
154
179
|
},
|
|
155
180
|
"main": "dist/index.server.cjs",
|
|
156
|
-
"module": "dist/index.server.
|
|
157
|
-
"browser": "dist/index.browser.
|
|
181
|
+
"module": "dist/index.server.mjs",
|
|
182
|
+
"browser": "dist/index.browser.mjs",
|
|
158
183
|
"types": "dist/index.server.d.ts",
|
|
159
184
|
"files": [
|
|
160
185
|
"dist/**",
|
|
@@ -177,10 +202,12 @@
|
|
|
177
202
|
"@secretlint/secretlint-rule-preset-recommend": "^8.2.4",
|
|
178
203
|
"@total-typescript/ts-reset": "^0.5.1",
|
|
179
204
|
"@types/node": "18.19.15",
|
|
205
|
+
"@visulima/packem": "^1.0.0-alpha.41",
|
|
180
206
|
"@vitest/coverage-v8": "^1.6.0",
|
|
181
207
|
"@vitest/ui": "^1.6.0",
|
|
182
208
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
183
209
|
"cross-env": "^7.0.3",
|
|
210
|
+
"esbuild": "^0.21.4",
|
|
184
211
|
"eslint": "^8.57.0",
|
|
185
212
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
186
213
|
"eslint-plugin-etc": "^2.0.3",
|
|
@@ -190,12 +217,12 @@
|
|
|
190
217
|
"eslint-plugin-vitest-globals": "^1.5.0",
|
|
191
218
|
"prettier": "^3.3.2",
|
|
192
219
|
"rimraf": "^5.0.7",
|
|
220
|
+
"type-fest": "^4.20.0",
|
|
193
221
|
"rotating-file-stream": "^3.2.3",
|
|
194
222
|
"secretlint": "8.2.4",
|
|
195
223
|
"semantic-release": "24.0.0",
|
|
196
224
|
"string-length": "^6.0.0",
|
|
197
225
|
"terminal-size": "^4.0.0",
|
|
198
|
-
"tsup": "^8.1.0",
|
|
199
226
|
"typescript": "^5.4.5",
|
|
200
227
|
"vitest": "^1.6.0",
|
|
201
228
|
"wrap-ansi": "^9.0.0"
|
|
@@ -232,17 +259,9 @@
|
|
|
232
259
|
"info_on_disabling_etc_no_deprecated": false
|
|
233
260
|
}
|
|
234
261
|
},
|
|
235
|
-
"sources": [
|
|
236
|
-
"src/index.browser.ts",
|
|
237
|
-
"src/index.server.ts",
|
|
238
|
-
"src/processor.browser.ts",
|
|
239
|
-
"src/processor.server.ts",
|
|
240
|
-
"src/reporter.browser.ts",
|
|
241
|
-
"src/reporter.server.ts"
|
|
242
|
-
],
|
|
243
262
|
"scripts": {
|
|
244
|
-
"build": "cross-env NODE_ENV=development
|
|
245
|
-
"build:prod": "
|
|
263
|
+
"build": "cross-env NODE_ENV=development packem build",
|
|
264
|
+
"build:prod": "cross-env NODE_ENV=production packem build",
|
|
246
265
|
"clean": "rimraf node_modules dist .eslintcache",
|
|
247
266
|
"dev": "pnpm run build --watch",
|
|
248
267
|
"lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
|
package/dist/chunk-2I5JHTDY.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { a as a$1 } from './chunk-AFMDCM5W.js';
|
|
2
|
-
import { b as b$1, c as c$1, a } from './chunk-NF47XQ47.js';
|
|
3
|
-
import { configure } from 'safe-stable-stringify';
|
|
4
|
-
|
|
5
|
-
var c=class{log(e){let{context:t=[],message:s,type:r}=e;a$1(r.level)(s,...t);}};var T=i=>i===void 0?[]:Array.isArray(i)?i:[i];var w=(i,e)=>{let t={...i};return Object.keys(e).forEach(s=>{t[s]={...t[s],...e[s]};}),t};var v=(i,e)=>i.length>=e?i:i.padEnd(e);var b={badge:void 0,context:void 0,error:void 0,label:void 0,message:void 0,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0},L=class{timersMap;countMap;seqTimers;lastLog;logLevels;disabled;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;constructor(e){this.throttle=e.throttle??1e3,this.throttleMin=e.throttleMin??5,this.stringify=configure({strict:!0}),this.startTimerMessage=e.messages?.timerStart??"Initialized timer...",this.endTimerMessage=e.messages?.timerEnd??"Timer run for:",this.types=w(b$1,e.types??{}),this.longestLabel=c$1(this.types),this.logLevels={...a,...e.logLevels},this.generalLogLevel=this._normalizeLogLevel(e.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=e.disabled??!1,this.scopeName=T(e.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set;for(let t in this.types)this[t]=this._logger.bind(this,t,!1);this.lastLog={},Array.isArray(e.reporters)&&this.registerReporters(e.reporters),this.rawReporter=this.extendReporter(e.rawReporter??new c),Array.isArray(e.processors)&&this.registerProcessors(e.processors);}wrapConsole(){for(let e in this.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e];}restoreConsole(){for(let e in this.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e]);}wrapException(){process.on("uncaughtException",e=>{this.error(e);}),process.on("unhandledRejection",e=>{this.error(e);});}disable(){this.disabled=!0;}enable(){this.disabled=!1;}isEnabled(){return !this.disabled}scope(...e){if(e.length===0)throw new Error("No scope name was defined.");return this.scopeName=e.flat(),this}unscope(){this.scopeName=[];}time(e="default"){this.seqTimers.has(e)?this._logger("warn",!1,{message:"Timer '"+e+"' already exists",prefix:e}):(this.seqTimers.add(e),this.timersMap.set(e,Date.now()),this._logger("start",!1,{message:this.startTimerMessage,prefix:e}));}timeLog(e,...t){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){let s=Date.now()-this.timersMap.get(e);this._logger("info",!1,{context:t,message:s<1e3?s+" ms":(s/1e3).toFixed(2)+" s",prefix:e});}else this._logger("warn",!1,{context:t,message:"Timer not found",prefix:e});}timeEnd(e){if(!e&&this.seqTimers.size>0&&(e=[...this.seqTimers].pop()),e&&this.timersMap.has(e)){let t=Date.now()-this.timersMap.get(e);this.timersMap.delete(e),this._logger("stop",!1,{message:this.endTimerMessage+" "+(t<1e3?t+" ms":(t/1e3).toFixed(2)+" s"),prefix:e});}}group(e="console.group"){typeof window>"u"?console.group(e):this.groups.push(e);}groupEnd(){typeof window>"u"?console.groupEnd():this.groups.pop();}count(e="default"){let t=this.countMap.get(e)??0;this.countMap.set(e,t+1),this._logger("log",!1,{message:e+": "+(t+1),prefix:e});}countReset(e="default"){this.countMap.has(e)?this.countMap.delete(e):this._logger("warn",!1,{message:"Count for "+e+" does not exist",prefix:e});}clear(){console.clear();}raw(e,...t){this.disabled||this._logger("log",!0,{context:t,message:e});}extendReporter(e){return typeof e.setLoggerTypes=="function"&&e.setLoggerTypes(this.types),typeof e.setStringify=="function"&&e.setStringify(this.stringify),e}registerReporters(e){for(let t of e)this.reporters.add(this.extendReporter(t));}_report(e,t){if(t)this.rawReporter.log(Object.freeze(e));else for(let s of this.reporters)s.log(Object.freeze(e));}registerProcessors(e){for(let t of e)typeof t.setStringify=="function"&&t.setStringify(this.stringify),this.processors.add(t);}_normalizeLogLevel(e){return e&&this.logLevels[e]?e:"debug"}_buildMeta(e,t,...s){let r={...b};if(r.type={level:t.logLevel,name:e},r.groups=this.groups,r.scope=this.scopeName,r.date=new Date,s.length===1&&typeof s[0]=="object"&&s[0]!==null)if(s[0]instanceof Error)r.error=s[0];else if("message"in s[0]){let{context:o,message:p,prefix:g,suffix:n}=s[0];o&&(r.context=o),g&&(r.prefix=g),n&&(r.suffix=n),r.message=p;}else r.message=s[0];else s.length>1&&typeof s[0]=="string"?(r.message=s[0],r.context=s.slice(1)):r.message=s[0];return t.logLevel==="trace"&&(r.traceError=new Error("Trace")),t.badge&&(r.badge=v(t.badge,t.badge.length+1)),t.label&&(r.label=t.label),r}_logger(e,t,...s){if(this.disabled)return;let r=this._normalizeLogLevel(this.types[e].logLevel);if(this.logLevels[r]>=this.logLevels[this.generalLogLevel]){let o=this._buildMeta(e,this.types[e],...s),p=(n=!1)=>{let a=(this.lastLog.count||0)-this.throttleMin;if(this.lastLog.object&&a>0){let l={...this.lastLog.object};a>1&&(l.repeated=a),this._report(l,t),this.lastLog.count=1;}if(n){for(let l of this.processors)o={...l.process(o)};this.lastLog.object=o,this._report(o,t);}};clearTimeout(this.lastLog.timeout);let g=this.lastLog.time&&o.date?new Date(o.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(o.date),g<this.throttle)try{let n=JSON.stringify([o.label,o.scope,o.type,o.message,o.prefix,o.suffix,o.context]),a=this.lastLog.serialized===n;if(this.lastLog.serialized=n,a&&(this.lastLog.count=(this.lastLog.count||0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(p,this.throttle);return}}catch{}p(!0);}}},q=L;
|
|
6
|
-
|
|
7
|
-
export { L as a, q as b };
|
|
8
|
-
//# sourceMappingURL=out.js.map
|
|
9
|
-
//# sourceMappingURL=chunk-2I5JHTDY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/pail.browser.ts","../src/reporter/raw/raw.browser.ts","../src/util/arrayify.ts","../src/util/merge-types.ts","../src/util/pad-end.ts"],"names":["stringifyConfigure","RawReporter","meta","context","message","type","writeConsoleLogBasedOnLevel","arrayify","x","mergeTypes","standard","custom","types","padEnd","string_","targetLength","EMPTY_META","PailBrowserImpl","options","LOG_TYPES","getLongestLabel","EXTENDED_RFC_5424_LOG_LEVELS","error","name","label","data","span","current","arguments_","reporter","reporters","raw","processors","processor","level","typeName","prefix","suffix","messageObject","logLevel","resolveLog","newLog","repeated","lastMeta","diffTime","serializedLog","isSameLog","PailBrowser"],"mappings":"8FACA,OAAS,aAAaA,MAA0B,wBCEzC,IAAMC,EAAN,KAAmE,CA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C,GAFA,KAAK,QAAQ,WAAaA,EAEtBC,IAEA,KAAK,QAAQ,OAAS,KAAK,QAAQ,OAAS,GAAK,EAE7C,KAAK,QAAQ,MAAQ,KAAK,aAAa,CAEvC,KAAK,QAAQ,QAAU,WAAWN,EAAY,KAAK,QAAQ,EAE3D,MACJ,CAER,MAAQ,CAER,CAGJA,EAAW,EAAI,CACnB,CACJ,CACJ,EASaO,EAAc9B","sourcesContent":["import type { stringify } from \"safe-stable-stringify\";\nimport { configure as stringifyConfigure } from \"safe-stable-stringify\";\n\nimport { EXTENDED_RFC_5424_LOG_LEVELS, LOG_TYPES } from \"./constants\";\nimport { RawReporter } from \"./reporter/raw/raw.browser\";\nimport type {\n ConstructorOptions,\n DefaultLogTypes,\n ExtendedRfc5424LogLevels,\n LiteralUnion,\n LoggerConfiguration,\n LoggerFunction,\n LoggerTypesAwareReporter,\n LoggerTypesConfig,\n Message,\n Meta,\n Primitive,\n Processor,\n Reporter,\n StringifyAwareProcessor,\n StringifyAwareReporter,\n} from \"./types\";\nimport { arrayify } from \"./util/arrayify\";\nimport { getLongestLabel } from \"./util/get-longest-label\";\nimport { mergeTypes } from \"./util/merge-types\";\nimport { padEnd } from \"./util/pad-end\";\n\nconst EMPTY_META = {\n badge: undefined,\n context: undefined,\n error: undefined,\n label: undefined,\n message: undefined,\n prefix: undefined,\n repeated: undefined,\n scope: undefined,\n suffix: undefined,\n};\n\nexport class PailBrowserImpl<T extends string = never, L extends string = never> {\n protected timersMap: Map<string, number>;\n\n protected countMap: Map<string, number>;\n\n protected seqTimers: Set<string>;\n\n protected readonly lastLog: {\n count?: number;\n object?: Meta<L>;\n serialized?: string;\n time?: Date;\n timeout?: ReturnType<typeof setTimeout>;\n };\n\n protected readonly logLevels: Record<string, number>;\n\n protected disabled: boolean;\n\n protected scopeName: string[];\n\n protected readonly types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;\n\n protected readonly longestLabel: string;\n\n protected readonly processors: Set<Processor<L>>;\n\n protected readonly generalLogLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>;\n\n protected reporters: Set<Reporter<L>>;\n\n protected readonly throttle: number;\n\n protected readonly throttleMin: number;\n\n protected readonly stringify: typeof stringify;\n\n protected groups: string[];\n\n protected readonly startTimerMessage: string;\n\n protected readonly endTimerMessage: string;\n\n protected rawReporter: Reporter<L>;\n\n public constructor(options: ConstructorOptions<T, L>) {\n this.throttle = options.throttle ?? 1000;\n this.throttleMin = options.throttleMin ?? 5;\n\n this.stringify = stringifyConfigure({\n strict: true,\n });\n\n this.startTimerMessage = options.messages?.timerStart ?? \"Initialized timer...\";\n this.endTimerMessage = options.messages?.timerEnd ?? \"Timer run for:\";\n this.types = mergeTypes<L, T>(LOG_TYPES, (options.types ?? {}) as LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>);\n this.longestLabel = getLongestLabel<L, T>(this.types);\n\n this.logLevels = { ...EXTENDED_RFC_5424_LOG_LEVELS, ...options.logLevels };\n this.generalLogLevel = this._normalizeLogLevel(options.logLevel);\n\n this.reporters = new Set();\n this.processors = new Set();\n\n this.disabled = options.disabled ?? false;\n\n this.scopeName = arrayify(options.scope).filter(Boolean) as string[];\n\n this.timersMap = new Map();\n this.countMap = new Map();\n\n this.groups = [];\n\n this.seqTimers = new Set();\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax,guard-for-in\n for (const type in this.types) {\n // @ts-expect-error - dynamic property\n // eslint-disable-next-line security/detect-object-injection\n this[type] = this._logger.bind(this, type as T, false);\n }\n\n // Track of last log\n this.lastLog = {};\n\n if (Array.isArray(options.reporters)) {\n this.registerReporters(options.reporters);\n }\n\n this.rawReporter = this.extendReporter(options.rawReporter ?? new RawReporter<L>());\n\n if (Array.isArray(options.processors)) {\n this.registerProcessors(options.processors);\n }\n }\n\n public wrapConsole(): void {\n // eslint-disable-next-line guard-for-in,no-loops/no-loops,no-restricted-syntax\n for (const type in this.types) {\n // Backup original value\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!(console as any)[\"__\" + type]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,security/detect-object-injection\n (console as any)[\"__\" + type] = (console as any)[type];\n }\n // Override\n // @TODO: Fix typings\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,security/detect-object-injection\n (console as any)[type] = (this as unknown as PailBrowserImpl<T, L>)[type as keyof PailBrowserImpl<T, L>];\n }\n }\n\n public restoreConsole(): void {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const type in this.types) {\n // Restore if backup is available\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((console as any)[\"__\" + type]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,security/detect-object-injection\n (console as any)[type] = (console as any)[\"__\" + type];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-dynamic-delete\n delete (console as any)[\"__\" + type];\n }\n }\n }\n\n public wrapException(): void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n process.on(\"uncaughtException\", (error: any) => {\n // @TODO: Fix typings\n // @ts-expect-error - dynamic property\n (this as unknown as PailBrowserImpl<T, L>).error(error);\n });\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n process.on(\"unhandledRejection\", (error: any) => {\n // @TODO: Fix typings\n // @ts-expect-error - dynamic property\n (this as unknown as PailBrowserImpl<T, L>).error(error);\n });\n }\n\n /**\n * Disables logging\n */\n public disable(): void {\n this.disabled = true;\n }\n\n /**\n * Enables logging\n */\n public enable(): void {\n this.disabled = false;\n }\n\n public isEnabled(): boolean {\n return !this.disabled;\n }\n\n public scope<N extends string = T>(...name: string[]): PailBrowserType<N, L> {\n if (name.length === 0) {\n throw new Error(\"No scope name was defined.\");\n }\n\n this.scopeName = name.flat();\n\n return this as unknown as PailBrowserType<N, L>;\n }\n\n public unscope(): void {\n this.scopeName = [];\n }\n\n public time(label = \"default\"): void {\n if (this.seqTimers.has(label)) {\n this._logger(\"warn\", false, {\n message: \"Timer '\" + label + \"' already exists\",\n prefix: label,\n });\n } else {\n this.seqTimers.add(label);\n this.timersMap.set(label, Date.now());\n\n this._logger(\"start\", false, {\n message: this.startTimerMessage,\n prefix: label,\n });\n }\n }\n\n public timeLog(label?: string, ...data: unknown[]): void {\n if (!label && this.seqTimers.size > 0) {\n // eslint-disable-next-line no-param-reassign\n label = [...this.seqTimers].pop();\n }\n\n if (label && this.timersMap.has(label)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const span = Date.now() - this.timersMap.get(label)!;\n\n this._logger(\"info\", false, {\n context: data,\n message: span < 1000 ? span + \" ms\" : (span / 1000).toFixed(2) + \" s\",\n prefix: label,\n });\n } else {\n this._logger(\"warn\", false, {\n context: data,\n message: \"Timer not found\",\n prefix: label,\n });\n }\n }\n\n public timeEnd(label?: string): void {\n if (!label && this.seqTimers.size > 0) {\n // eslint-disable-next-line no-param-reassign\n label = [...this.seqTimers].pop();\n }\n\n if (label && this.timersMap.has(label)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const span = Date.now() - this.timersMap.get(label)!;\n\n this.timersMap.delete(label);\n\n this._logger(\"stop\", false, {\n message: this.endTimerMessage + \" \" + (span < 1000 ? span + \" ms\" : (span / 1000).toFixed(2) + \" s\"),\n prefix: label,\n });\n }\n }\n\n public group(label = \"console.group\"): void {\n if (typeof window === \"undefined\") {\n // eslint-disable-next-line no-console\n console.group(label);\n } else {\n this.groups.push(label);\n }\n }\n\n public groupEnd(): void {\n if (typeof window === \"undefined\") {\n // eslint-disable-next-line no-console\n console.groupEnd();\n } else {\n this.groups.pop();\n }\n }\n\n public count(label = \"default\"): void {\n const current = this.countMap.get(label) ?? 0;\n\n this.countMap.set(label, current + 1);\n\n this._logger(\"log\", false, {\n message: label + \": \" + (current + 1),\n prefix: label,\n });\n }\n\n public countReset(label = \"default\"): void {\n if (this.countMap.has(label)) {\n this.countMap.delete(label);\n } else {\n this._logger(\"warn\", false, {\n message: \"Count for \" + label + \" does not exist\",\n prefix: label,\n });\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n public clear(): void {\n // eslint-disable-next-line no-console\n console.clear();\n }\n\n public raw(message: string, ...arguments_: unknown[]): void {\n if (this.disabled) {\n return;\n }\n\n this._logger(\"log\", true, {\n context: arguments_,\n message,\n });\n }\n\n protected extendReporter(reporter: Reporter<L>): Reporter<L> {\n if (typeof (reporter as LoggerTypesAwareReporter<T, L>).setLoggerTypes === \"function\") {\n (reporter as LoggerTypesAwareReporter<T, L>).setLoggerTypes(this.types);\n }\n\n if (typeof (reporter as StringifyAwareReporter<L>).setStringify === \"function\") {\n (reporter as StringifyAwareReporter<L>).setStringify(this.stringify);\n }\n\n return reporter;\n }\n\n protected registerReporters(reporters: Reporter<L>[]): void {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const reporter of reporters) {\n this.reporters.add(this.extendReporter(reporter));\n }\n }\n\n private _report(meta: Meta<L>, raw: boolean): void {\n if (raw) {\n this.rawReporter.log(Object.freeze(meta));\n } else {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const reporter of this.reporters) {\n reporter.log(Object.freeze(meta));\n }\n }\n }\n\n private registerProcessors(processors: Processor<L>[]): void {\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const processor of processors) {\n if (typeof (processor as StringifyAwareProcessor<L>).setStringify === \"function\") {\n (processor as StringifyAwareProcessor<L>).setStringify(this.stringify);\n }\n\n this.processors.add(processor as Processor<L>);\n }\n }\n\n private _normalizeLogLevel(level: LiteralUnion<ExtendedRfc5424LogLevels, L> | undefined): LiteralUnion<ExtendedRfc5424LogLevels, L> {\n // eslint-disable-next-line security/detect-object-injection\n return level && this.logLevels[level] ? level : \"debug\";\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity,@typescript-eslint/no-explicit-any\n private _buildMeta(typeName: string, type: Partial<LoggerConfiguration<L>>, ...arguments_: any[]): Meta<L> {\n const meta = { ...EMPTY_META } as Meta<L>;\n\n meta.type = {\n level: type.logLevel as LiteralUnion<ExtendedRfc5424LogLevels, L>,\n name: typeName,\n };\n\n meta.groups = this.groups;\n meta.scope = this.scopeName;\n meta.date = new Date();\n\n if (arguments_.length === 1 && typeof arguments_[0] === \"object\" && arguments_[0] !== null) {\n if (arguments_[0] instanceof Error) {\n // eslint-disable-next-line prefer-destructuring\n meta.error = arguments_[0];\n } else if (\"message\" in arguments_[0]) {\n const { context, message, prefix, suffix } = arguments_[0] as Message;\n\n if (context) {\n meta.context = context;\n }\n\n if (prefix) {\n meta.prefix = prefix;\n }\n\n if (suffix) {\n meta.suffix = suffix;\n }\n\n meta.message = message;\n } else {\n meta.message = arguments_[0] as Primitive | ReadonlyArray<unknown> | Record<PropertyKey, unknown>;\n }\n } else if (arguments_.length > 1 && typeof arguments_[0] === \"string\") {\n meta.message = arguments_[0] as string;\n meta.context = arguments_.slice(1);\n } else {\n // eslint-disable-next-line prefer-destructuring\n meta.message = arguments_[0];\n }\n\n if (type.logLevel === \"trace\") {\n meta.traceError = new Error(\"Trace\");\n }\n\n if (type.badge) {\n meta.badge = padEnd(type.badge, type.badge.length + 1);\n }\n\n if (type.label) {\n meta.label = type.label;\n }\n\n return meta;\n }\n\n // eslint-disable-next-line sonarjs/cognitive-complexity,@typescript-eslint/no-explicit-any\n private _logger(type: LiteralUnion<DefaultLogTypes, T>, raw: boolean, ...messageObject: any[]): void {\n if (this.disabled) {\n return;\n }\n\n // eslint-disable-next-line security/detect-object-injection\n const logLevel = this._normalizeLogLevel(this.types[type].logLevel);\n\n // eslint-disable-next-line security/detect-object-injection\n if ((this.logLevels[logLevel] as number) >= (this.logLevels[this.generalLogLevel] as number)) {\n // eslint-disable-next-line security/detect-object-injection\n let meta = this._buildMeta(type, this.types[type], ...messageObject);\n\n /**\n * @param newLog false if the throttle expired and we don't want to log a duplicate\n */\n const resolveLog = (newLog = false) => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n const repeated = (this.lastLog.count || 0) - this.throttleMin;\n\n if (this.lastLog.object && repeated > 0) {\n const lastMeta = { ...this.lastLog.object };\n\n if (repeated > 1) {\n lastMeta.repeated = repeated;\n }\n\n this._report(lastMeta, raw);\n\n this.lastLog.count = 1;\n }\n\n if (newLog) {\n // Apply global processors\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const processor of this.processors) {\n meta = { ...processor.process(meta) };\n }\n\n this.lastLog.object = meta;\n\n this._report(meta, raw);\n }\n };\n\n clearTimeout(this.lastLog.timeout);\n\n const diffTime = this.lastLog.time && meta.date ? new Date(meta.date as Date | string).getTime() - this.lastLog.time.getTime() : 0;\n\n this.lastLog.time = new Date(meta.date as Date | string);\n\n if (diffTime < this.throttle) {\n try {\n const serializedLog = JSON.stringify([meta.label, meta.scope, meta.type, meta.message, meta.prefix, meta.suffix, meta.context]);\n const isSameLog = this.lastLog.serialized === serializedLog;\n\n this.lastLog.serialized = serializedLog;\n\n if (isSameLog) {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n this.lastLog.count = (this.lastLog.count || 0) + 1;\n\n if (this.lastLog.count > this.throttleMin) {\n // Auto-resolve when throttle is timed out\n this.lastLog.timeout = setTimeout(resolveLog, this.throttle);\n\n return; // SPAM!\n }\n }\n } catch {\n // Circular References\n }\n }\n\n resolveLog(true);\n }\n }\n}\n\nexport type PailBrowserType<T extends string = never, L extends string = never> = PailBrowserImpl<T, L> &\n Record<DefaultLogTypes, LoggerFunction> &\n Record<T, LoggerFunction> &\n (new<TC extends string = never, LC extends string = never>(options?: ConstructorOptions<TC, LC>) => PailBrowserType<TC, LC>);\n\nexport type PailConstructor<T extends string = never, L extends string = never> = new (options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;\n\nexport const PailBrowser = PailBrowserImpl as unknown as PailBrowserType;\n","import type { ReadonlyMeta, Reporter } from \"../../types\";\nimport { writeConsoleLogBasedOnLevel } from \"../../util/write-console-log\";\n\nexport class RawReporter<L extends string = never> implements Reporter<L> {\n // eslint-disable-next-line class-methods-use-this\n public log(meta: ReadonlyMeta<L>): void {\n const { context = [], message, type } = meta;\n\n const consoleLogFunction = writeConsoleLogBasedOnLevel(type.level);\n\n consoleLogFunction(message, ...context);\n }\n}\n","export const arrayify = <T>(x: T | T[]): T[] => {\n if (x === undefined) {\n return [] as T[];\n }\n\n return Array.isArray(x) ? x : ([x] as T[]);\n};\n","import type { DefaultLoggerTypes, DefaultLogTypes, LiteralUnion, LoggerTypesConfig } from \"../types\";\n\nexport const mergeTypes = <L extends string, T extends string>(\n standard: DefaultLoggerTypes<L>,\n custom: LoggerTypesConfig<T, L>,\n): LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L> => {\n const types = { ...standard } as LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;\n\n Object.keys(custom).forEach((type) => {\n types[type as T] = { ...types[type as T], ...custom[type as T] };\n });\n\n return types;\n};\n","export const padEnd = (string_: string, targetLength: number): string => {\n if (string_.length >= targetLength) {\n return string_;\n }\n\n return string_.padEnd(targetLength);\n};\n"]}
|
package/dist/chunk-5MNFJRLM.cjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkN2UPJYJR_cjs = require('./chunk-N2UPJYJR.cjs');
|
|
4
|
-
var chunkZJMTPHZR_cjs = require('./chunk-ZJMTPHZR.cjs');
|
|
5
|
-
|
|
6
|
-
var t=class extends chunkZJMTPHZR_cjs.a{constructor(){super();}_log(n,r){chunkN2UPJYJR_cjs.a(r)(n);}};
|
|
7
|
-
|
|
8
|
-
exports.a = t;
|
|
9
|
-
//# sourceMappingURL=out.js.map
|
|
10
|
-
//# sourceMappingURL=chunk-5MNFJRLM.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/reporter/json/json.browser.ts"],"names":["JsonReporter","AbstractJsonReporter","message","logLevel","writeConsoleLogBasedOnLevel"],"mappings":"kFAIO,IAAMA,EAAN,cAAqDC,CAAwB,CACzE,aAAc,CACjB,MAAM,CACV,CAGmB,KAAKC,EAAiBC,EAA2D,CACrEC,EAA4BD,CAAQ,EAE5CD,CAAO,CAC9B,CACJ","sourcesContent":["import type { ExtendedRfc5424LogLevels, LiteralUnion } from \"../../types\";\nimport { writeConsoleLogBasedOnLevel } from \"../../util/write-console-log\";\nimport { AbstractJsonReporter } from \"./abstract-json-reporter\";\n\nexport class JsonReporter<L extends string = never> extends AbstractJsonReporter<L> {\n public constructor() {\n super();\n }\n\n // eslint-disable-next-line class-methods-use-this\n protected override _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void {\n const consoleLogFunction = writeConsoleLogBasedOnLevel(logLevel);\n\n consoleLogFunction(message);\n }\n}\n"]}
|
package/dist/chunk-AFMDCM5W.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/write-console-log.ts"],"names":["writeConsoleLogBasedOnLevel","level"],"mappings":"AAGO,IAAMA,EAAyDC,GAC9DA,IAAU,QAEF,QAAgB,SAAW,QAAQ,MAG3CA,IAAU,OAEF,QAAgB,QAAU,QAAQ,KAG1CA,IAAU,QAEF,QAAgB,SAAW,QAAQ,MAIvC,QAAgB,OAAS,QAAQ","sourcesContent":["import type { ExtendedRfc5424LogLevels, LiteralUnion } from \"../types\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const writeConsoleLogBasedOnLevel = <L extends string = never>(level: LiteralUnion<ExtendedRfc5424LogLevels, L>): ((...data: any[]) => void) => {\n if (level === \"error\") {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,no-console\n return (console as any).__error ?? console.error;\n }\n\n if (level === \"warn\") {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,no-console\n return (console as any).__warn ?? console.warn;\n }\n\n if (level === \"trace\") {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,no-console\n return (console as any).__trace ?? console.trace;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any,no-console\n return (console as any).__log ?? console.log;\n};\n"]}
|
package/dist/chunk-F4FJCQ4L.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var fmt = require('@visulima/fmt');
|
|
4
|
-
|
|
5
|
-
var o=class{#t;#n;constructor(t={}){this.#n=t.formatters;}setStringify(t){this.#t=t;}process(t){let n=fmt.build({formatters:this.#n,stringify:r=>{let i=this.#t(r);return i===void 0?(console.warn("Unable to stringify value of type "+typeof r,r),"undefined"):i}});return t.message!==void 0&&(t.message=this._format(n,t.message,t.context??[])),t}_format(t,n,r=[]){if(typeof n=="string")return t(n,r);if(typeof n=="object"&&n!==null)for(let i in n){let e=n[i];(typeof e=="string"||Array.isArray(e)||typeof e=="object")&&(n[i]=this._format(t,e,r));}return n}};
|
|
6
|
-
|
|
7
|
-
exports.a = o;
|
|
8
|
-
//# sourceMappingURL=out.js.map
|
|
9
|
-
//# sourceMappingURL=chunk-F4FJCQ4L.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/processor/message-formatter-processor.ts"],"names":["build","MessageFormatterProcessor","#stringify","#formatters","options","function_","meta","formatter","value","stringified","data","arguments_","index"],"mappings":"AACA,OAAS,SAAAA,MAAa,gBAKf,IAAMC,EAAN,KAAiG,CAEpGC,GAESC,GAEF,YAAYC,EAA8D,CAAC,EAAG,CACjF,KAAKD,GAAcC,EAAQ,UAC/B,CAGO,aAAaC,EAAsB,CACtC,KAAKH,GAAaG,CACtB,CAEO,QAAQC,EAAwB,CACnC,IAAMC,EAAYP,EAAM,CACpB,WAAY,KAAKG,GACjB,UAAYK,GAAmB,CAC3B,IAAMC,EAAe,KAAKP,GAAgCM,CAAK,EAE/D,OAAIC,IAAgB,QAEhB,QAAQ,KAAK,qCAAuC,OAAOD,EAAOA,CAAK,EAEhE,aAGJC,CACX,CACJ,CAAY,EAEZ,OAAIH,EAAK,UAAY,SAEjBA,EAAK,QAAU,KAAK,QAAQC,EAAWD,EAAK,QAASA,EAAK,SAAW,CAAC,CAAC,GAGpEA,CACX,CAGQ,QAAQC,EAA0BG,EAAWC,EAAwB,CAAC,EAAQ,CAClF,GAAI,OAAOD,GAAS,SAChB,OAAOH,EAAUG,EAAgBC,CAAU,EAG/C,GAAI,OAAOD,GAAS,UAAYA,IAAS,KAErC,QAAWE,KAASF,EAAuD,CAEvE,IAAMF,EAASE,EAAaE,CAAK,GAE7B,OAAOJ,GAAU,UAAY,MAAM,QAAQA,CAAK,GAAK,OAAOA,GAAU,YAEtEE,EAAKE,CAAK,EAAI,KAAK,QAAQL,EAAWC,EAAOG,CAAU,EAE/D,CAGJ,OAAOD,CACX,CACJ","sourcesContent":["import type { format, FormatterFunction, Options } from \"@visulima/fmt\";\nimport { build } from \"@visulima/fmt\";\nimport type { stringify } from \"safe-stable-stringify\";\n\nimport type { Meta, StringifyAwareProcessor } from \"../types\";\n\nexport class MessageFormatterProcessor<L extends string = string> implements StringifyAwareProcessor<L> {\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n #stringify: typeof stringify | undefined;\n\n readonly #formatters: Record<string, FormatterFunction> | undefined;\n\n public constructor(options: { formatters?: Record<string, FormatterFunction> } = {}) {\n this.#formatters = options.formatters;\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n public setStringify(function_: any): void {\n this.#stringify = function_;\n }\n\n public process(meta: Meta<L>): Meta<L> {\n const formatter = build({\n formatters: this.#formatters,\n stringify: (value: unknown) => {\n const stringified = (this.#stringify as typeof stringify)(value);\n\n if (stringified === undefined) {\n // eslint-disable-next-line no-console\n console.warn(\"Unable to stringify value of type \" + typeof value, value);\n\n return \"undefined\";\n }\n\n return stringified;\n },\n } as Options);\n\n if (meta.message !== undefined) {\n // eslint-disable-next-line no-param-reassign\n meta.message = this._format(formatter, meta.message, meta.context ?? []);\n }\n\n return meta;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _format(formatter: typeof format, data: any, arguments_: unknown[] = []): any {\n if (typeof data === \"string\") {\n return formatter(data as string, arguments_);\n }\n\n if (typeof data === \"object\" && data !== null) {\n // eslint-disable-next-line guard-for-in,no-loops/no-loops,no-restricted-syntax\n for (const index in data as Record<string, unknown> | [string, unknown[]]) {\n // eslint-disable-next-line security/detect-object-injection,@typescript-eslint/no-explicit-any\n const value = (data as any)[index];\n\n if (typeof value === \"string\" || Array.isArray(value) || typeof value === \"object\") {\n // eslint-disable-next-line no-param-reassign,security/detect-object-injection\n data[index] = this._format(formatter, value, arguments_);\n }\n }\n }\n\n return data;\n }\n}\n"]}
|