@visulima/pail 4.0.0-alpha.16 → 4.0.0-alpha.18

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.
@@ -0,0 +1,33 @@
1
+ var Lt=Object.defineProperty;var b=(e,t)=>Lt(e,"name",{value:t,configurable:!0});import{createRequire as _t}from"node:module";import Je from"@visulima/colorize";const Mt=_t(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=b(e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[t,r]=_.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return _.getBuiltinModule(e)}return Mt(e)},"__cjs_getBuiltinModule"),{createRequire:Ct}=se("node:module"),k=_,{execFileSync:Rt}=se("node:child_process"),G=se("node:fs"),zt=se("node:tty"),Ha={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},Vt={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},warning:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},Da=Symbol("EMPTY");var Ht=Object.defineProperty,Dt=b((e,t)=>Ht(e,"name",{value:t,configurable:!0}),"g$6");const Ga=Dt(e=>{const t=Object.keys(e).map(r=>e[r].label??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestLabel");var Gt=Object.defineProperty,Ke=b((e,t)=>Gt(e,"name",{value:t,configurable:!0}),"T$4"),qt=Object.defineProperty,$=Ke((e,t)=>qt(e,"name",{value:t,configurable:!0}),"l"),Yt=Object.defineProperty,Ut=$((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"L");const S=Ut((e,t,r,n,i,a=", ")=>{const o=e.length;if(o===0)return"";let l=n;i!==void 0&&(l=i);const s=r.truncate;let c="",u="",f="";for(let g=0;g<o;g+=1){const d=g+1===e.length,p=g+2===e.length;f=`…(${String(e.length-g)})`;let m=e[g];r.truncate=s-c.length-(d?0:a.length);const h=u||l(m,t,r,n)+(d?"":a),v=c.length+h.length,j=v+f.length;if(d&&v>s&&c.length+f.length<=s||!d&&!p&&j>s)break;m=e[g+1];const P=p?"":a;if(d?u="":u=l(m,t,r,n)+P,!d&&p&&j>s&&v+u.length>s)break;if(c+=h,!d&&!p&&v+u.length>=s){f=`…(${String(e.length-g-1)})`;break}f=""}return`${c}${f}`},"inspectList");var Jt=Object.defineProperty,ce=$((e,t)=>Jt(e,"name",{value:t,configurable:!0}),"s$6");const Kt=ce(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),Qt=ce((e,t,r)=>{switch(e.nodeType){case 1:return Qe(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},"inspectNode"),we=ce((e,t,r,n)=>S(e,e,t,r,Qt,`
2
+ `),"inspectNodeCollection"),Qe=ce((e,t,r,n)=>{const i=e.getAttributeNames(),a=e.tagName.toLowerCase(),o=r.stylize(`<${a}`,"special"),l=r.stylize(">","special"),s=r.stylize(`</${a}>`,"special");r.truncate-=a.length*2+5;let c="";i.length>0&&(c+=" ",c+=S(i.map(g=>[g,e.getAttribute(g)]),t,r,n,Kt," ")),r.truncate-=c.length;const{truncate:u}=r;let f=we(e.children,r,n,void 0);return f&&f.length>u&&(f=`…(${String(e.children.length)})`),`${o}${c}${l}${f}${s}`},"inspectHTMLElement");var Zt=Object.defineProperty,Xt=$((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"n$4");const er=Xt((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${S(e,e,t,r)} ]`),"inspectArguments");var tr=Object.defineProperty,Ze=$((e,t)=>tr(e,"name",{value:t,configurable:!0}),"r$3");const rr=Ze((e,t)=>{let r;if(e===" ")r=" ";else if(typeof e=="number"&&e>0)r=Array.from({length:e+1}).join(" ");else return;return{base:r,prev:`
3
+ ${Array.from({length:t+1}).join(r)}`}},"getIndent"),ue=Ze((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var nr=Object.defineProperty,Xe=$((e,t)=>nr(e,"name",{value:t,configurable:!0}),"i$5");const ir=/^[a-z_]\w*$/i,ar=/^"|"$/g,or=Xe((e,t)=>{if(ir.test(e))return e;const r=JSON.stringify(e);return t.quoteStyle==="double"?r.replaceAll('"',String.raw`\"`):r.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(ar,"'")},"quoteComplexKey"),q=Xe(([e,t],r,n,i)=>{n.truncate-=2;let a;typeof e=="string"?a=or(e,n):typeof e=="number"?a=String(e):a=`[${i(e,r,n)}]`,n.truncate-=a.length;const o=i(t,r,n);return`${a}: ${o}`},"inspectProperty");var lr=Object.defineProperty,et=$((e,t)=>lr(e,"name",{value:t,configurable:!0}),"p$4");const sr=et(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),cr=et((e,t,r,n)=>{const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;let a=S(e,e,t,r);t.truncate-=a.length;let o="";i.length>0&&(o=S(i.map(s=>[s,e[s]]),e,t,r,q));const l=n&&sr(e);return l&&(a=ue(a,n)),`[${l?"":" "}${a}${o?`, ${o}`:""}${l?"":" "}]`},"inspectArray");var ur=Object.defineProperty,fr=$((e,t)=>ur(e,"name",{value:t,configurable:!0}),"o$7");const Te=/\d(?=(?:\d{3})+(?!\d))/g,dr=/\d{3}/g,gr=/_$/,tt=fr((e,t)=>{if(e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const r=e<0?-Math.floor(-e):Math.floor(e);if(r!==e){const n=String(r),i=t.slice(n.length+1);return`${n.replace(Te,"$&_")}.${i.replace(dr,"$&_").replace(gr,"")}`}}return t.replace(Te,"$&_")},"addNumericSeparator");var pr=Object.defineProperty,rt=$((e,t)=>pr(e,"name",{value:t,configurable:!0}),"i$4");const mr=rt(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),x=rt((e,t,r="…")=>{e=String(e);const n=r.length,i=e.length;if(n>t&&i>n)return r;if(i>t&&i>n){let a=t-n;return a>0&&mr(e[a-1])&&(a-=1),`${e.slice(0,a)}${r}`}return e},"truncate");var hr=Object.defineProperty,br=$((e,t)=>hr(e,"name",{value:t,configurable:!0}),"e$4");const Be=br((e,t)=>{let r=x(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?tt(e,r):r,"bigint")},"inspectBigInt");var $r=Object.defineProperty,vr=$((e,t)=>$r(e,"name",{value:t,configurable:!0}),"y");const yr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),re=vr((e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis||"global"in globalThis&&e===globalThis)return"{ [object globalThis] }";const i=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e),o=yr(e)===Object.prototype||e.constructor===Object,l=e instanceof Object?"":"null prototype";let s;!o&&Symbol.toStringTag in e?s=e[Symbol.toStringTag]:s=l?"Object":"";const c=s||l?`[${[s,l].filter(Boolean).join(": ")}] `:"";if(i.length===0&&a.length===0)return`${c}{}`;t.truncate-=4;const u=S(i.map(d=>[d,e[d]]),e,t,r,q),f=S(a.map(d=>[d,e[d]]),e,t,r,q);let g="";return u&&f&&(g=", "),n?`${c}{${ue(u+g+f,n)}}`:`${c}{ ${u}${g}${f} }`},"inspectObject");var wr=Object.defineProperty,Sr=$((e,t)=>wr(e,"name",{value:t,configurable:!0}),"s$3");const Or=Sr((e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${re(e,t,r,n)}`},"inspectClass");var Er=Object.defineProperty,jr=$((e,t)=>Er(e,"name",{value:t,configurable:!0}),"i$3");const Ar=jr((e,t)=>{const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),i=n[0];return t.stylize(`${i}T${x(n[1],t.truncate-i.length-1)}`,"date")},"inspectDate");var Nr=Object.defineProperty,xr=$((e,t)=>Nr(e,"name",{value:t,configurable:!0}),"c$4");const Ir=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Pr=xr((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(l=>!Ir.has(l)),{name:i}=e;t.truncate-=i.length;let a="";typeof e.message=="string"?a=x(e.message,t.truncate):n.unshift("message"),a=a?`: ${a}`:"",t.truncate-=a.length+5;const o=S(n.map(l=>[l,e[l]]),e,t,r,q);return`${i}${a}${o?` { ${o} }`:""}`},"inspectObject");var kr=Object.defineProperty,Tr=$((e,t)=>kr(e,"name",{value:t,configurable:!0}),"c$3");const We=Tr((e,t)=>{const r=e[Symbol.toStringTag]||"Function",n=e.toString();if(n.length<t.truncate-12)return t.stylize(`[${r}: ${n}]`,"special");const{name:i}=e;return i?t.stylize(`[${r} ${x(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},"inspectFunction");var Br=Object.defineProperty,nt=$((e,t)=>Br(e,"name",{value:t,configurable:!0}),"p$3");const Wr=nt(([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),"inspectMapEntry"),Fr=nt((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=S([...e.entries()],e,t,r,Wr);return n&&(i=ue(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectMap");var Lr=Object.defineProperty,_r=$((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"e$3");function Y(e,t){return Number.isNaN(e)?t.stylize("NaN","number"):e===Number.POSITIVE_INFINITY?t.stylize("Infinity","number"):e===Number.NEGATIVE_INFINITY?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===Number.POSITIVE_INFINITY?"+0":"-0","number"):t.stylize(x(t.numericSeparator?tt(e,e.toString()):e.toString(),t.truncate),"number")}b(Y,"j$5");Ke(Y,"P");$(Y,"u$3");_r(Y,"inspectNumber");var Mr=Object.defineProperty,Cr=$((e,t)=>Mr(e,"name",{value:t,configurable:!0}),"e$2");const Rr=Cr(()=>"Promise{…}","getPromiseValue");var zr=Object.defineProperty,Vr=$((e,t)=>zr(e,"name",{value:t,configurable:!0}),"p$1");const Hr=Vr((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${x(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var Dr=Object.defineProperty,Gr=$((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"i$1");const qr=Gr((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=S([...e],e,t,r);return n&&(i=ue(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectSet");var Yr=Object.defineProperty,Ur=$((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"l");const Jr=Ur((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var Kr=Object.defineProperty,it=$((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"e$1");const Fe=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),Qr={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Zr=16,Xr=it(e=>Qr[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Zr)}`.slice(-4)}`,"escape"),Le=it((e,t)=>(Fe.test(e)&&(e=e.replaceAll(Fe,Xr)),t.stylize(Jr(x(e,t.truncate-2),t),"string")),"inspectString");var en=Object.defineProperty,tn=$((e,t)=>en(e,"name",{value:t,configurable:!0}),"o");const _e=tn(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var rn=Object.defineProperty,at=$((e,t)=>rn(e,"name",{value:t,configurable:!0}),"f");const nn=at(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),O=at((e,t,r)=>{const n=nn(e);t.truncate-=n.length+4;const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return`${n}[]`;let a="";for(let l=0;l<e.length;l++){const s=`${t.stylize(x(e[l],t.truncate),"number")}${l===e.length-1?"":", "}`;if(t.truncate-=s.length,e[l]!==e.length&&t.truncate<=3){a+=`…(${String(e.length-e[l]+1)})`;break}a+=s}let o="";return i.length>0&&(o=S(i.map(l=>[l,e[l]]),e,t,r,q)),`${n}[ ${a}${o?`, ${o}`:""} ]`},"inspectTypedArray");var an=Object.defineProperty,w=$((e,t)=>an(e,"name",{value:t,configurable:!0}),"r");const oe=new WeakMap,Se={},on={Arguments:er,Array:cr,ArrayBuffer:w(()=>"","ArrayBuffer"),BigInt:Be,bigint:Be,Boolean:w((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:w((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:w(()=>"","DataView"),Date:Ar,Error:Pr,Float32Array:O,Float64Array:O,Function:We,function:We,Generator:w(()=>"","Generator"),HTMLCollection:we,Int8Array:O,Int16Array:O,Int32Array:O,Map:Fr,NodeList:we,null:w((e,t)=>t.stylize("null","null"),"null"),Number:Y,number:Y,Promise:Rr,RegExp:Hr,Set:qr,String:Le,string:Le,Symbol:_e,symbol:_e,Uint8Array:O,Uint8ClampedArray:O,Uint16Array:O,Uint32Array:O,undefined:w((e,t)=>t.stylize("undefined","undefined"),"undefined"),WeakMap:w((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),WeakSet:w((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet")},Me=Symbol.for("nodejs.util.inspect.custom"),ln=w((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[Me]=="function")return e[Me](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&oe.has(e.constructor))return oe.get(e.constructor)?.(e,t)??"unknown";const i=Se[r];return i?i(e,t):""},"inspectCustom"),ot=w((e,t,r,n)=>{if(n.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const i=w((c,u,f)=>(u&&(n=[...n,u]),ot(c,f,r+1,n)),"inspect"),a=t.indent?rr(t.indent,r):void 0;let o=e===null?"null":typeof e;o==="object"&&(o=Object.prototype.toString.call(e).slice(8,-1));const l=on[o];if(l!==void 0)return l(e,t,i,a);if(t.customInspect&&e){const c=ln(e,t,o,t.depth-r);if(c)return typeof c=="string"?c:i(c,e,t)}const s=e?Object.getPrototypeOf(e):!1;return s===Object.prototype||s===null?re(e,t,i,a):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Qe(e,e,t,i):"constructor"in e?e.constructor!==Object?Or(e,t,i,a):re(e,t,i,a):e===Object(e)?re(e,t,i,a):t.stylize(String(e),o)},"internalInspect"),qa=w((e,t={})=>{const r={breakLength:Number.POSITIVE_INFINITY,customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,showProxy:!1,stylize:w(n=>n,"stylize"),truncate:Number.POSITIVE_INFINITY,...t};if(r.indent!==void 0&&r.indent!==" "&&!(Number.parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');return ot(e,r,0,[])},"inspect");w((e,t)=>oe.has(e)?!1:(oe.set(e,t),!0),"registerConstructor");w((e,t)=>e in Se?!1:(Se[e]=t,!0),"registerStringTag");var sn=Object.defineProperty,cn=b((e,t)=>sn(e,"name",{value:t,configurable:!0}),"r$6");const Ya=cn((e,t)=>(t.__write??t.write.bind(t)).call(t,e),"writeStream");var un=Object.defineProperty,fn=b((e,t)=>un(e,"name",{value:t,configurable:!0}),"A$4"),dn=Object.defineProperty,je=fn((e,t)=>dn(e,"name",{value:t,configurable:!0}),"$"),gn=Object.defineProperty,pn=je((e,t)=>gn(e,"name",{value:t,configurable:!0}),"r$1");const mn=pn(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
4
+ `),"normalizeLF"),hn=globalThis.process??Object.create(null),Ce={versions:{}},Re=new Proxy(hn,{get(e,t){if(t in e)return e[t];if(t in Ce)return Ce[t]}});var bn=Object.defineProperty,$n=je((e,t)=>bn(e,"name",{value:t,configurable:!0}),"b");const vn=$n((e,t,r,n)=>{const i={column:0,line:-1,...e.start},a={...i,...e.end},o=i.line,l=i.column,s=a.line,c=a.column;let u=Math.max(o-(r+1),0),f=Math.min(t.length,s+n);o===-1&&(u=0),s===-1&&(f=t.length);const g=s-o,d={};if(g)for(let p=0;p<=g;p++){const m=p+o;if(!l)d[m]=!0;else if(p===0){const h=t[m-1]?.length;d[m]=[l,(h??0)-l+1]}else if(p===g)d[m]=[0,c];else{const h=t[m-p]?.length;d[m]=[0,h]}}else l===c?d[o]=l?[l,0]:!0:d[o]=[l,(c??0)-(l??0)];return{end:f,markerLines:d,start:u}},"getMarkerLines");var yn=Object.defineProperty,Z=je((e,t)=>yn(e,"name",{value:t,configurable:!0}),"t");const wn=Re.platform==="win32"&&!Re.env?.WT_SESSION?">":"❯",Sn=Z((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:Z(p=>p,"gutter"),marker:Z(p=>p,"marker"),message:Z(p=>p,"message"),...r?.color}},i=typeof t.start.column=="number";let a=mn(e).split(`
5
+ `);typeof n.tabWidth=="number"&&(a=a.map(p=>p.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:l,start:s}=vn(t,a,n.linesAbove,n.linesBelow),c=String(o).length,{gutter:u,marker:f,message:g}=n.color;let d=a.slice(s,o).map((p,m)=>{const h=s+1+m,v=l[h],j=` ${String(h)}`.slice(-c),P=!l[h+1],z=` ${j}${n.showGutter?" |":""}`;if(v){let V="";if(Array.isArray(v)){const Q=p.replaceAll(/[^\t]/g," ").slice(0,Math.max(v[0]-1,0)),H=v[1]||1;V=[`
6
+ `,n.prefix+u(z.replaceAll(/\d/g," "))," ",Q,f("^").repeat(H)].join(""),P&&n.message&&(V+=` ${g(n.message)}`)}return[n.prefix+f(wn),u(z),p.length>0?` ${p}`:"",V].join("")}return`${n.prefix} ${u(z)}${p.length>0?` ${p}`:""}`}).join(`
7
+ `);return n.message&&!i&&(d=`${n.prefix+" ".repeat(c+1)+n.message}
8
+ ${d}`),d},"codeFrame");var On=Object.defineProperty,En=b((e,t)=>On(e,"name",{value:t,configurable:!0}),"x$3"),jn=Object.defineProperty,An=En((e,t)=>jn(e,"name",{value:t,configurable:!0}),"x"),Nn=Object.defineProperty,E=An((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"u");const B=E((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),W="<unknown>",xn=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,In=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Pn=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,kn=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Tn=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Bn=/in\s(.*)\s\(at\s(.+)\)\sat/,Wn=/^(?:.*@)?(.*):(\d+):(\d+)$/,Fn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ln=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,_n=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,ze=/\(error: (.*)\)/,Mn=/at\s/,Cn=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Rn=/\S*(?:Error: |AggregateError:)/,lt=/^Anonymous function$/,zn=/^\s*in\s.*/,Vn=/^.*?\s*at\s.*/,Hn=/^.*?\s*@.*|\[native code\]/,st=E((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:W,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),ct=E((e,t)=>{const r=Pn.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),Dn=E(e=>{const t=Bn.exec(e);if(t){B(`parse nested node error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const n=t[2].split(":");return{column:n[2]?+n[2]:void 0,file:n[0],line:n[1]?+n[1]:void 0,methodName:t[1]??W,raw:e,type:void 0}}const r=Tn.exec(e);if(r){B(`parse node error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n={column:r[4]?+r[4]:void 0,file:r[2]?r[2].replace(Mn,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??W,raw:e,type:e.startsWith("internal")?"internal":void 0};return ct(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),Gn=E(e=>{const t=xn.exec(e);if(t){B(`parse chrome error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const r=t[2]?.startsWith("native"),n=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,a;if(n){const c=In.exec(e);if(c){const u=Cn.exec(c[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):c[2]&&(t[2]=c[1]),c[2]&&(i={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=kn.exec(e);u&&(a={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},i={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[o,l]=st(t[1]?t[1].replace(lt,"<anonymous>"):W,t[2]),s={column:t[4]?+t[4]:void 0,evalOrigin:i,file:l,line:t[3]?+t[3]:void 0,methodName:o,raw:e,type:n?"eval":r?"native":void 0};return a?(s.column=a.column,s.file=a.file,s.line=a.line):ct(s,`${l}:${t[3]}:${t[4]}`),s}},"parseChromium"),qn=E((e,t)=>{const r=Fn.exec(e);if(r){B(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&Ln.exec(r[3]);let a;n&&i&&(r[3]=i[1],a={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0,methodName:"eval",raw:e,type:"eval"},r[4]=i[2]);const[o,l]=st(r[1]?r[1].replace(lt,"<anonymous>"):W,r[3]);let s;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?s=t.column:!n&&r[5]&&(s=+r[5]);let c;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?c=t.line:r[4]&&(c=+r[4]),{column:s,evalOrigin:a,file:l,line:c,methodName:o,raw:e,type:n?"eval":l.includes("[native code]")?"native":void 0}}},"parseGecko"),Yn=E((e,t)=>{const r=_n.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return B(`parse firefox error stack line: "${e}"`,`found: ${JSON.stringify(r)}`),{column:r[4]?+r[4]:t?.column??void 0,file:r[2],line:r[3]?+r[3]:t?.line??void 0,methodName:r[1]||W,raw:e,type:void 0}},"parseFirefox"),Un=E(e=>{const t=Wn.exec(e);if(t)return B(`parse react android native error stack line: "${e}"`,`found: ${JSON.stringify(t)}`),{column:t[3]?+t[3]:void 0,file:t[1],line:t[2]?+t[2]:void 0,methodName:W,raw:e,type:void 0}},"parseReactAndroidNative"),ut=E((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
9
+ `).map(a=>(ze.test(a)?a.replace(ze,"$1"):a).trim()).filter(a=>!Rn.test(a)&&a!=="eval code");return t&&(i=i.filter(a=>t(a))),i=i.slice(0,r),i.reduce((a,o,l)=>{if(!o||o.length>1024)return a;let s;if(zn.test(o))s=Dn(o);else if(Vn.test(o))s=Gn(o);else if(Hn.test(o)){let c;if(l===0){const u=e,f=u.columnNumber,g=u.lineNumber,d=u.line,p=u.column;f||g?c={column:f,line:g,type:"firefox"}:(d||p)&&(c={column:p,line:d,type:"safari"})}s=Yn(o,c)??qn(o,c)}else s=Un(o);return s?a.push(s):B(`parse error stack line: "${o}"`,"not parser found"),a},[])},"parseStacktrace");var Jn=Object.defineProperty,Kn=b((e,t)=>Jn(e,"name",{value:t,configurable:!0}),"p$6"),Qn=Object.defineProperty,ft=Kn((e,t)=>Qn(e,"name",{value:t,configurable:!0}),"m");const Zn=Ct(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ae=ft(e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,r]=M.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return M.getBuiltinModule(e)}return Zn(e)},"__cjs_getBuiltinModule"),{existsSync:Xn,readFileSync:ei}=Ae("node:fs"),{relative:ti}=Ae("node:path"),{cwd:ri}=M,{fileURLToPath:ni}=Ae("node:url");var ii=Object.defineProperty,y=ft((e,t)=>ii(e,"name",{value:t,configurable:!0}),"o");const C=y((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),ai=y((e,t)=>{const r=e.replace("async file:","file:");return ti(t,r.startsWith("file:")?ni(r):r)},"getRelativePath"),oi=y((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),dt=y((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},a)=>`${C(i,n,a)}${oi(e,r,t)}
10
+ `,"getMessage"),gt=y((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const a=C(n,r,i);let o="";if(Array.isArray(e.hint))for(const l of e.hint)o+=`${a+l}
11
+ `;else o+=a+e.hint;return t.hint(o)},"getHint"),Ne=y((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:a},o=0)=>{const l=n?ai(e.file,r):e.file,{fileLine:s,method:c}=t;return`${C(a,i,o)}at ${e.methodName?`${c(e.methodName)} `:""}${s(l)}:${s(e.line?.toString()??"")}`},"getMainFrame"),pt=y((e,{color:t,indentation:r,linesAbove:n,linesBelow:i,prefix:a,showGutter:o,showLineNumbers:l,tabWidth:s},c)=>{if(e.file===void 0)return;const u=e.file.replace("file://","");if(!Xn(u))return;const f=ei(u,"utf8");return Sn(f,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:C(a,r,c),showGutter:o,showLineNumbers:l,tabWidth:s})},"getCode"),mt=y((e,t,r)=>{if(e.errors.length===0)return;let n=`${C(t.prefix,t.indentation,r)}Errors:
12
+
13
+ `,i=!0;for(const a of e.errors)i?i=!1:n+=`
14
+
15
+ `,n+=bt(a,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
16
+ ${n}`},"getErrors"),ht=y((e,t,r)=>{let n=`${C(t.prefix,t.indentation,r)}Caused by:
17
+
18
+ `;const i=e.cause;n+=dt(i,t,r);const a=ut(i).shift(),o=gt(i,t,r);if(o&&(n+=`${o}
19
+ `),a&&(n+=Ne(a,t,r),!t.hideErrorCauseCodeView)){const l=pt(a,t,r);l!==void 0&&(n+=`
20
+ ${l}`)}if(i.cause)n+=`
21
+ ${ht(i,t,r+1)}`;else if(i instanceof AggregateError){const l=mt(i,t,r);l!==void 0&&(n+=`
22
+ ${l}`)}return`
23
+ ${n}`},"getCause"),li=y((e,t)=>(e.length>0?`
24
+ `:"")+e.map(r=>Ne(r,t)).join(`
25
+ `),"getStacktrace"),bt=y((e,t,r)=>{const n={cwd:ri(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...t,color:{fileLine:y(o=>o,"fileLine"),gutter:y(o=>o,"gutter"),hint:y(o=>o,"hint"),marker:y(o=>o,"marker"),message:y(o=>o,"message"),method:y(o=>o,"method"),title:y(o=>o,"title"),...t.color}},i=ut(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),a=i.shift();return[t.hideMessage?void 0:dt(e,n,r),gt(e,n,r),a?Ne(a,n,r):void 0,a&&!n.hideErrorCodeView?pt(a,n,r):void 0,e instanceof AggregateError?mt(e,n,r):void 0,e.cause===void 0?void 0:ht(e,n,r),i.length>0?li(i,n):void 0].filter(Boolean).join(`
26
+ `).replaceAll("\\","/")},"internalRenderError"),Ua=y((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return bt(e,t,0)},"renderError");var si=Object.defineProperty,xe=b((e,t)=>si(e,"name",{value:t,configurable:!0}),"u$3"),ci=Object.defineProperty,fe=xe((e,t)=>ci(e,"name",{value:t,configurable:!0}),"l");const ui=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],fi=12288,di=65510,gi=[12288,12288,65281,65376,65504,65510],pi=8361,mi=65518,hi=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],bi=32,$i=10630,vi=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],yi=4352,wi=262141,$t=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Si=Object.defineProperty,Oi=fe((e,t)=>Si(e,"name",{value:t,configurable:!0}),"r$1");const U=Oi((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),a=i*2;if(t<e[a])n=i-1;else if(t>e[a+1])r=i+1;else return!0}return!1},"isInRange");var Ei=Object.defineProperty,F=fe((e,t)=>Ei(e,"name",{value:t,configurable:!0}),"r");const Ve=19968,[ji,Ai]=de($t);function de(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],a=e[n+1];if(Ve>=i&&Ve<=a)return[i,a];a-i>r-t&&(t=i,r=a)}return[t,r]}b(de,"c$2");xe(de,"f");fe(de,"k");F(de,"findWideFastPathRange");const vt=F(e=>e<161||e>1114109?!1:U(ui,e),"isAmbiguous"),yt=F(e=>e<fi||e>di?!1:U(gi,e),"isFullWidth"),Ni=F(e=>e<pi||e>mi?!1:U(hi,e),"isHalfWidth"),xi=F(e=>e<bi||e>$i?!1:U(vi,e),"isNarrow"),wt=F(e=>e>=ji&&e<=Ai?!0:e<yi||e>wi?!1:U($t,e),"isWide");function ge(e){return vt(e)?"ambiguous":yt(e)?"fullwidth":Ni(e)?"halfwidth":xi(e)?"narrow":wt(e)?"wide":"neutral"}b(ge,"g$4");xe(ge,"S");fe(ge,"getCategory");F(ge,"getCategory");var Ii=Object.defineProperty,pe=b((e,t)=>Ii(e,"name",{value:t,configurable:!0}),"i$3"),Pi=Object.defineProperty,me=pe((e,t)=>Pi(e,"name",{value:t,configurable:!0}),"a"),ki=Object.defineProperty,Ie=me((e,t)=>ki(e,"name",{value:t,configurable:!0}),"e");function J(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}b(J,"s$2");pe(J,"s");me(J,"r");Ie(J,"validate");function K(e){return J(e),ge(e)}b(K,"r$5");pe(K,"p");me(K,"eastAsianWidthType");Ie(K,"eastAsianWidthType");function Pe(e,{ambiguousAsWide:t=!1}={}){return J(e),yt(e)||wt(e)||t&&vt(e)?2:1}b(Pe,"o$5");pe(Pe,"W");me(Pe,"eastAsianWidth");Ie(Pe,"eastAsianWidth");var Ti=Object.defineProperty,Bi=b((e,t)=>Ti(e,"name",{value:t,configurable:!0}),"p$3"),Wi=Object.defineProperty,St=Bi((e,t)=>Wi(e,"name",{value:t,configurable:!0}),"e"),Fi=Object.defineProperty,Li=St((e,t)=>Fi(e,"name",{value:t,configurable:!0}),"E");const Ot=String.raw,He=Ot`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,_i=Li(()=>new RegExp(Ot`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${He}(?:\u200D${He})*`,"gu"),"default");var Mi=Object.defineProperty,Ci=St((e,t)=>Mi(e,"name",{value:t,configurable:!0}),"p");const R=new Set(["\x1B","›"]),he="\x07",Et="[",ke="m",le="]8;;",Ri=39,zi=/[\u200B\uFEFF\u2060-\u2064]/g,Vi=new RegExp(`(?:\\${Et}(?<code>\\d+)m|\\${le}(?<uri>.*)${he})`),Hi=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),D=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,X=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ne=_i();Ci(e=>e.replace(ne,""),"stripEmoji");var Di=Object.defineProperty,Gi=b((e,t)=>Di(e,"name",{value:t,configurable:!0}),"E"),qi=Object.defineProperty,Yi=Gi((e,t)=>qi(e,"name",{value:t,configurable:!0}),"A"),Ui=Object.defineProperty,be=Yi((e,t)=>Ui(e,"name",{value:t,configurable:!0}),"d");const De=new Map,ee=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ie=be(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),Ji=be((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=De.get(r);if(i||(i=new Map,De.set(r,i)),i.has(n))return i.get(n);let a;if(ie(e)==="latin")a=t.width.regular;else if(ie(e)==="control")a=t.width.control;else if(ie(e)==="wide")a=t.width.wide;else switch(K(e)){case"ambiguous":{a=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{a=t.width.fullWidth;break}case"wide":{a=t.width.wide;break}default:a=t.width.regular}return i.set(n,a),a},"getCachedCharWidth"),Ki=be(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Oe=be((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Oe(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,a=i>1e4;let o=0,l=0,s=i,c=!1;const u=e.includes("\x1B")||e.includes("›");for(;o<i;){if(u&&(e[o]==="\x1B"||e[o]==="›")){if(e.startsWith("\x1B]8;;",o)){const h="\x1B]8;;\x07",v=h.length,j=e.indexOf("\x07",o+5);if(j!==-1){const P=e.indexOf(h,j+1);if(P!==-1){const z=P+v,V=e.slice(j+1,P).replace(D,""),Q=Oe(V,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-l),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),H=Q.width;if(Q.truncated)c=!0,s=Math.min(s,o);else if(l+H>n&&(s=Math.min(s,o),c=!0,l+H>r.truncation.limit))break;if(l+=H,o=z,c&&l>=r.truncation.limit)break;continue}}}if(D.lastIndex=o,D.test(e)){const h=D.lastIndex-o,v=r.truncation.countAnsiEscapeCodes?h:r.width.ansi;if(l+v>n&&(s=Math.min(s,o),l+v>r.truncation.limit)){c=!0;break}l+=v,o=D.lastIndex;continue}}const d=e.codePointAt(o);if(d===8203||d===65279||d>=8288&&d<=8292){o+=1;continue}if(d===9){if(l+r.width.tab>n&&(s=Math.min(s,o),l+r.width.tab>r.truncation.limit)){c=!0;break}l+=r.width.tab,o+=1;continue}if(ee.lastIndex=o,ee.test(e)){const h=(ee.lastIndex-o)*r.width.regular;if(l+h>n){const v=Math.floor((n-l)/r.width.regular);if(s=Math.min(s,o+v),l+h>r.truncation.limit){c=!0;break}}l+=h,o=ee.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(X.lastIndex=o,X.test(e))){const h=(X.lastIndex-o)*r.width.control;if(l+h>n&&(s=Math.min(s,o+Math.floor((n-l)/r.width.control)),l+h>r.truncation.limit)){c=!0;break}l+=h,o=X.lastIndex;continue}if(ne.lastIndex=o,ne.test(e)){if(l+r.width.emoji>n&&(s=Math.min(s,o),l+r.width.emoji>r.truncation.limit)){c=!0;break}l+=r.width.emoji,o=ne.lastIndex;continue}const p=e.codePointAt(o)??0;if(Ki(p)){o+=p>65535?2:1;continue}let m;if(a)m=Ji(p,r);else switch(ie(p)){case"control":{m=r.width.control;break}case"latin":{m=r.width.regular;break}case"wide":{m=r.width.wide;break}case"zero":{m=0;break}default:switch(K(p)){case"ambiguous":{m=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{m=r.width.fullWidth;break}case"wide":{m=r.width.wide;break}default:m=r.width.regular}}if(l+m>n&&(s=Math.min(s,o),l+m>r.truncation.limit)){c=!0;break}l+=m,o+=p>65535?2:1}let f=l,g=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(f=r.truncation.limit,g=!0),{ellipsed:g,index:c?s:i,truncated:c,width:f}},"getStringTruncatedWidth");var Qi=Object.defineProperty,Zi=b((e,t)=>Qi(e,"name",{value:t,configurable:!0}),"i$1"),Xi=Object.defineProperty,ea=Zi((e,t)=>Xi(e,"name",{value:t,configurable:!0}),"e"),ta=Object.defineProperty,ra=ea((e,t)=>ta(e,"name",{value:t,configurable:!0}),"r");const A=ra((e,t={})=>Oe(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var na=Object.defineProperty,jt=b((e,t)=>na(e,"name",{value:t,configurable:!0}),"b"),ia=Object.defineProperty,L=jt((e,t)=>ia(e,"name",{value:t,configurable:!0}),"d"),aa=Object.defineProperty,oa=L((e,t)=>aa(e,"name",{value:t,configurable:!0}),"a");const la=/\x1B\[(\d+)m/;class At{static{b(this,"T")}static{jt(this,"T")}static{L(this,"d")}static{oa(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=la.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];i&&(this.activeFormatting=this.activeFormatting.filter(a=>!a.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(n=>{const i=r[n];i&&t.push(i)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var sa=Object.defineProperty,Nt=L((e,t)=>sa(e,"name",{value:t,configurable:!0}),"o");const xt=Nt((e,t)=>{if(!R.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+le.length).join("")===le;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),ca=Nt((e,t={})=>{const r=new At;let n="",i=!1,a="",o="",l=!1;const s=[...e];for(let c=0;c<s.length;c++){const u=s[c];if(u&&R.has(u)){if(n){const m=t.getWidth?.(n)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:n,width:m};if(l&&(h.isHyperlink=!0,h.hyperlinkUrl=o),t.onSegment?.(h,r)===!1)return;n=""}i=!0,a=u;const d=xt(s,c),{isInsideLinkEscape:p}=d;if(p){let m=c+1;for(o="";m<s.length;){const v=s[m];if(v===he)break;o+=v,m+=1}o=o.slice(4);const h={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(h,r)===!1)return;c=m,l=!0,i=!1,a="";continue}if(c+1<s.length&&s[c+1]==="\\"&&l){const m={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(m,r)===!1)return;l=!1,o="",c+=1,i=!1,a="";continue}}if(i){if(a!==u&&(a+=u),u===ke){i=!1,r.processEscape(a);const d={isEscapeSequence:!0,isGrapheme:!1,text:a,width:0};if(t.onSegment?.(d,r)===!1)return;a=""}continue}n+=u;const f=t.getWidth?.(n)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:n,width:f};if(l&&(g.isHyperlink=!0,g.hyperlinkUrl=o),t.onSegment?.(g,r)===!1)return;n=""}if(n){const c=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:c};l&&(u.isHyperlink=!0,u.hyperlinkUrl=o),t.onSegment?.(u,r)}if(a){const c={isEscapeSequence:!0,isGrapheme:!1,text:a,width:0};t.onSegment?.(c,r)}},"processAnsiString");var ua=Object.defineProperty,fa=L((e,t)=>ua(e,"name",{value:t,configurable:!0}),"t$1");const Ge=fa(e=>`${R.values().next().value}${Et}${String(e)}${ke}`,"wrapAnsiCode");var da=Object.defineProperty,ga=L((e,t)=>da(e,"name",{value:t,configurable:!0}),"s");const qe=ga(e=>`${R.values().next().value}${le}${e}${he}`,"wrapAnsiHyperlink");var pa=Object.defineProperty,ma=L((e,t)=>pa(e,"name",{value:t,configurable:!0}),"l");const ha=ma(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
27
+ `),a=[...i];let o=0;for(const[l,s]of a.entries()){if(t+=s,R.has(s)){const u=Vi.exec(i.slice(o))?.groups??{};if(u.code!==void 0){const f=Number.parseFloat(u.code);r=f===Ri?void 0:f}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=Hi.get(Number(r));a[l+1]===`
28
+ `?(n&&(t+=qe("")),r&&c&&(t+=Ge(c))):s===`
29
+ `&&(r&&c&&(t+=Ge(r)),n&&(t+=qe(n))),o+=s.length}return t},"preserveAnsi");var ba=Object.defineProperty,N=L((e,t)=>ba(e,"name",{value:t,configurable:!0}),"f");const It=/(?=\s)|(?<=\s)/,Pt=/^\s+$/,$e=N(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),T=N(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&A(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),kt=N((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new At;let a="",o=0,l=!1,s=!1,c="",u=0;for(;u<e.length;){const f=e[u];if(R.has(f)){l=!0,c=f,a+=f,s=xt([...e],u).isInsideLinkEscape,u+=1;continue}if(l){c+=f,a+=f,s?f===he&&(l=s=!1):f===ke&&(l=!1,i.processEscape(c)),u+=1;continue}const g=A(f),d=f===" ";if(g===0){a+=f,u+=1;continue}if(o+g>t&&(a&&n.push(a+i.getEndEscapesForAllActiveAttributes()),a=i.getStartEscapesForAllActiveAttributes(),o=A(a),d&&r)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(a+=f,o+=g,o===t&&u<e.length-1&&(n.push(a+i.getEndEscapesForAllActiveAttributes()),a=i.getStartEscapesForAllActiveAttributes(),o=A(a),u+1<e.length&&e[u+1]===" "&&r)){for(u+=1;u<e.length&&e[u]===" ";)u+=1;continue}u+=1}return a&&n.push(a+i.getEndEscapesForAllActiveAttributes()),r?n.map(f=>T(f)):n},"wrapWithBreakAtWidth"),$a=N((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let a="",o=0;return ca(n,{getWidth:A,onSegment:N((l,s)=>{const c=l.text??"";if(l.isEscapeSequence)a+=c;else{const u=c===" ";if(l.width===0)return a+=c,!0;if(o+l.width>t&&(a&&i.push(a),a=s.getStartEscapesForAllActiveAttributes(),o=0,u))return r||i.push(s.getStartEscapesForAllActiveAttributes()+c),!0;a+=c,o+=l.width}return!0},"onSegment")}),a&&i.push(a),r?i.map(l=>T(l)):i},"wrapCharByChar"),va=N((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(It),a=[];let o="",l=0,s=0;for(;s<i.length;){const c=i[s],u=Pt.test(c),f=A(c);if(c.length===0){s+=1;continue}if(r&&u&&l===0){s+=1;continue}if(l+f>t&&l>0){r?a.push(T(o)):a.push(o),o="",l=0;continue}o+=c,l+=f,s+=1}return o&&(r?a.push(T(o)):a.push(o)),a},"wrapWithWordBoundaries"),ya=N((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(It),a=[];let o="",l=0,s=0;for(;s<i.length;){const c=i[s],u=Pt.test(c),f=A(c);if(c.length===0){s+=1;continue}if(r&&u&&l===0){s+=1;continue}if(f>t){o&&a.push($e(r?T(o):o));const g=kt(c,t,r);if(g.length>0){for(let d=0;d<g.length-1;d+=1)a.push(g[d]);o=g.at(-1),l=A(o)}else o="",l=0;s+=1;continue}if(l+f>t&&l>0&&(a.push($e(r?T(o):o)),o="",l=0,r&&u)){s+=1;continue}o+=c,l+=f,s+=1}return o&&a.push($e(r?T(o):o)),a},"wrapAndBreakWords"),te={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},Ja=N((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:a=te.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
30
+ `,`
31
+ `);return r&&(o=o.replaceAll(zi,"")),o.split(`
32
+ `).map(l=>{if(n&&l.trim()==="")return"";let s;switch(a){case te.BREAK_AT_CHARACTERS:{s=$a(l,i,n);break}case te.BREAK_WORDS:{s=ya(l,i,n);break}case te.STRICT_WIDTH:{s=kt(l,i,n);break}default:s=va(l,i,n)}return ha(s)}).join(`
33
+ `)},"wordWrap");var wa=Object.defineProperty,I=b((e,t)=>wa(e,"name",{value:t,configurable:!0}),"n$2");const Tt=80,Bt=24,Ee=I((e,t,{shell:r,env:n}={})=>Rt(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),ae=I((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),Wt=I((e,t)=>{const{columns:r,rows:n}=ae(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===Tt&&n===Bt))return{columns:r,rows:n}},"createIfNotDefault"),Sa=I(()=>{if(k.platform!=="linux")return!0;try{const e=G.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}},"isForegroundProcess");function Oa(){const{env:e,stdout:t,stderr:r}=k;if(t?.columns&&t?.rows)return ae(t.columns,t.rows);if(r?.columns&&r?.rows)return ae(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return ae(e.COLUMNS,e.LINES);const n={columns:Tt,rows:Bt};return k.platform==="win32"?ve()??n:k.platform==="darwin"?Ye()??ve()??n:Ye()??ve()??Ea()??n}b(Oa,"O");I(Oa,"terminalSize");const Ye=I(()=>{try{const e=k.platform==="darwin"?G.constants.O_EVTONLY|G.constants.O_NONBLOCK:G.constants.O_NONBLOCK,{columns:t,rows:r}=zt.WriteStream(G.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),ve=I(()=>{try{const e=Ee("tput",["cols"],{env:{TERM:"dumb",...k.env}}),t=Ee("tput",["lines"],{env:{TERM:"dumb",...k.env}});if(e&&t)return Wt(e,t)}catch{}},"tput"),Ea=I(()=>{try{if(!Sa())return;const e=Ee("resize",["-u"]).match(/\d+/g);if(e.length===2)return Wt(e[0],e[1])}catch{}},"resize");var ja=Object.defineProperty,Aa=b((e,t)=>ja(e,"name",{value:t,configurable:!0}),"r$2");const Ka=Aa(e=>{const t=Object.keys(e).map(r=>e[r].badge??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestBadge");var Na=Object.defineProperty,xa=b((e,t)=>Na(e,"name",{value:t,configurable:!0}),"r$1");const{bold:Ia,cyan:Pa,green:Ue,grey:ka,magenta:Ta,red:Ba,yellow:ye}=Je,Qa={indent:2,quoteStyle:"single",stylize:xa((e,t)=>{const r={bigint:ye,boolean:ye,date:Ta,null:Ia,number:ye,regexp:Ba,special:Pa,string:Ue,symbol:Ue,undefined:ka};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var Wa=Object.defineProperty,Fa=b((e,t)=>Wa(e,"name",{value:t,configurable:!0}),"o$1");const{bold:La,underline:_a}=Je,Za=Fa((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?_a(r):r,t.bold.label&&(r=La(r)),r},"formatLabel");var Ma=Object.defineProperty,Ft=b((e,t)=>Ma(e,"name",{value:t,configurable:!0}),"o");const Ca=Ft(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class Xa{static{b(this,"AbstractPrettyReporter")}static{Ft(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:Ca,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=Vt}setLoggerTypes(t){this.loggerTypes=t}}export{Xa as A,te as B,Ha as E,Ua as G,Vt as L,Oa as O,Da as a,Ka as b,Za as c,Ja as d,Ya as i,A as o,qa as p,Ga as s,Qa as u};
@@ -1,5 +1,5 @@
1
1
  import { AnsiColors } from '@visulima/colorize';
2
- import '@visulima/interactive-manager';
2
+ import { InteractiveManager } from '@visulima/interactive-manager';
3
3
  import { LiteralUnion, Primitive } from 'type-fest';
4
4
  /**
5
5
  * Global namespace for extending Pail's metadata interface.
@@ -148,15 +148,17 @@ interface LoggerTypesAwareReporter<T extends string, L extends string> extends R
148
148
  setLoggerTypes: (types: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>) => void;
149
149
  }
150
150
  /**
151
- * Stringify-Aware Reporter Interface.
151
+ * Interactive Stream Reporter Interface.
152
152
  *
153
- * Extends Reporter with the ability to receive a custom stringify function.
154
- * Useful for reporters that need to serialize complex objects.
153
+ * Extends StreamAwareReporter with interactive capabilities for terminal UIs.
154
+ * Supports features like progress bars and dynamic updates.
155
155
  * @template L - The log level type
156
156
  */
157
- interface StringifyAwareReporter<L extends string> extends Reporter<L> {
158
- /** Set the stringify function for object serialization */
159
- setStringify: (stringify: any) => void;
157
+ interface InteractiveStreamReporter<L extends string> extends StreamAwareReporter<L> {
158
+ /** Set the interactive manager for handling interactive output */
159
+ setInteractiveManager: (manager?: InteractiveManager) => void;
160
+ /** Enable or disable interactive mode */
161
+ setIsInteractive: (interactive: boolean) => void;
160
162
  }
161
163
  /**
162
164
  * Processor Interface.
@@ -185,10 +187,15 @@ interface ConstructorOptions<T extends string, L extends string> {
185
187
  throttleMin?: number;
186
188
  types?: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>;
187
189
  }
190
+ interface ServerConstructorOptions<T extends string, L extends string> extends ConstructorOptions<T, L> {
191
+ interactive?: boolean;
192
+ stderr: NodeJS.WriteStream;
193
+ stdout: NodeJS.WriteStream;
194
+ }
188
195
  type Message = {
189
196
  context?: any[];
190
197
  message: any;
191
198
  prefix?: string;
192
199
  suffix?: string;
193
200
  };
194
- export { ConstructorOptions as C, DefaultLogTypes as D, ExtendedRfc5424LogLevels as E, LoggerTypesConfig as L, Meta as M, Processor as P, ReadonlyMeta as R, StringifyAwareReporter as S, LoggerTypesAwareReporter as a, Reporter as b, LoggerFunction as c, DefaultLoggerTypes as d, LoggerConfiguration as e, StreamAwareReporter as f };
201
+ export { ConstructorOptions as C, DefaultLogTypes as D, ExtendedRfc5424LogLevels as E, InteractiveStreamReporter as I, LoggerTypesConfig as L, Meta as M, Processor as P, Reporter as R, ServerConstructorOptions as S, LoggerFunction as a, DefaultLoggerTypes as b, LoggerConfiguration as c, LoggerTypesAwareReporter as d, StreamAwareReporter as e, ReadonlyMeta as f };
@@ -1,5 +1,5 @@
1
1
  import { AnsiColors } from '@visulima/colorize';
2
- import { InteractiveManager } from '@visulima/interactive-manager';
2
+ import '@visulima/interactive-manager';
3
3
  /**
4
4
  Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
5
5
 
@@ -183,17 +183,15 @@ interface LoggerTypesAwareReporter<T extends string, L extends string> extends R
183
183
  setLoggerTypes: (types: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>) => void;
184
184
  }
185
185
  /**
186
- * Interactive Stream Reporter Interface.
186
+ * Stringify-Aware Reporter Interface.
187
187
  *
188
- * Extends StreamAwareReporter with interactive capabilities for terminal UIs.
189
- * Supports features like progress bars and dynamic updates.
188
+ * Extends Reporter with the ability to receive a custom stringify function.
189
+ * Useful for reporters that need to serialize complex objects.
190
190
  * @template L - The log level type
191
191
  */
192
- interface InteractiveStreamReporter<L extends string> extends StreamAwareReporter<L> {
193
- /** Set the interactive manager for handling interactive output */
194
- setInteractiveManager: (manager?: InteractiveManager) => void;
195
- /** Enable or disable interactive mode */
196
- setIsInteractive: (interactive: boolean) => void;
192
+ interface StringifyAwareReporter<L extends string> extends Reporter<L> {
193
+ /** Set the stringify function for object serialization */
194
+ setStringify: (stringify: any) => void;
197
195
  }
198
196
  /**
199
197
  * Processor Interface.
@@ -222,15 +220,10 @@ interface ConstructorOptions<T extends string, L extends string> {
222
220
  throttleMin?: number;
223
221
  types?: LoggerTypesConfig<T, L> & Partial<LoggerTypesConfig<DefaultLogTypes, L>>;
224
222
  }
225
- interface ServerConstructorOptions<T extends string, L extends string> extends ConstructorOptions<T, L> {
226
- interactive?: boolean;
227
- stderr: NodeJS.WriteStream;
228
- stdout: NodeJS.WriteStream;
229
- }
230
223
  type Message = {
231
224
  context?: any[];
232
225
  message: any;
233
226
  prefix?: string;
234
227
  suffix?: string;
235
228
  };
236
- export { ConstructorOptions as C, DefaultLogTypes as D, ExtendedRfc5424LogLevels as E, InteractiveStreamReporter as I, LiteralUnion as L, Meta as M, Processor as P, Reporter as R, ServerConstructorOptions as S, LoggerTypesConfig as a, LoggerFunction as b, DefaultLoggerTypes as c, LoggerConfiguration as d, LoggerTypesAwareReporter as e, StreamAwareReporter as f, ReadonlyMeta as g };
229
+ export { ConstructorOptions as C, DefaultLogTypes as D, ExtendedRfc5424LogLevels as E, LiteralUnion as L, Meta as M, Processor as P, ReadonlyMeta as R, StringifyAwareReporter as S, LoggerTypesConfig as a, LoggerTypesAwareReporter as b, Reporter as c, LoggerFunction as d, DefaultLoggerTypes as e, LoggerConfiguration as f, StreamAwareReporter as g };
@@ -1,6 +1,5 @@
1
1
  import { stringify } from 'safe-stable-stringify';
2
- import { LiteralUnion } from 'type-fest';
3
- import { R as ReadonlyMeta, E as ExtendedRfc5424LogLevels, S as StringifyAwareReporter } from "../../packem_shared/types.d-C51XNfQz.js";
2
+ import { R as ReadonlyMeta, E as ExtendedRfc5424LogLevels, L as LiteralUnion, S as StringifyAwareReporter } from "../../packem_shared/types.d-xxE3FOD3.js";
4
3
  import '@visulima/colorize';
5
4
  import '@visulima/interactive-manager';
6
5
  /**
@@ -1,5 +1,4 @@
1
- import { LiteralUnion } from 'type-fest';
2
- import { D as DefaultLogTypes, L as LoggerTypesConfig, R as ReadonlyMeta, a as LoggerTypesAwareReporter } from "../../packem_shared/types.d-C51XNfQz.js";
1
+ import { D as DefaultLogTypes, L as LiteralUnion, a as LoggerTypesConfig, R as ReadonlyMeta, b as LoggerTypesAwareReporter } from "../../packem_shared/types.d-xxE3FOD3.js";
3
2
  import '@visulima/colorize';
4
3
  import '@visulima/interactive-manager';
5
4
  /**
@@ -1,43 +1,7 @@
1
1
  import { RenderErrorOptions } from '@visulima/error/error';
2
+ import { L as LiteralUnion, D as DefaultLogTypes, c as LoggerTypesConfig, R as ReadonlyMeta, f as LoggerTypesAwareReporter, E as ExtendedRfc5424LogLevels, I as InteractiveStreamReporter } from "../../packem_shared/types.d-BeLumqgD.js";
2
3
  import { InteractiveManager } from '@visulima/interactive-manager';
3
- import { D as DefaultLogTypes, L as LiteralUnion$1, c as LoggerTypesConfig, R as ReadonlyMeta, f as LoggerTypesAwareReporter, E as ExtendedRfc5424LogLevels, I as InteractiveStreamReporter } from "../../packem_shared/types.d-BeLumqgD.js";
4
4
  import '@visulima/colorize';
5
- /**
6
- Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
7
-
8
- @category Type
9
- */
10
- type Primitive = null | undefined | string | number | boolean | symbol | bigint;
11
- /**
12
- Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
13
-
14
- Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
15
-
16
- This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
17
-
18
- @example
19
- ```
20
- import type {LiteralUnion} from 'type-fest';
21
-
22
- // Before
23
-
24
- type Pet = 'dog' | 'cat' | string;
25
-
26
- const petWithoutAutocomplete: Pet = '';
27
- // Start typing in your TypeScript-enabled IDE.
28
- // You **will not** get auto-completion for `dog` and `cat` literals.
29
-
30
- // After
31
-
32
- type Pet2 = LiteralUnion<'dog' | 'cat', string>;
33
-
34
- const petWithAutoComplete: Pet2 = '';
35
- // You **will** get auto-completion for `dog` and `cat` literals.
36
- ```
37
-
38
- @category Type
39
- */
40
- type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
41
5
  interface Options {
42
6
  breakLength: number;
43
7
  customInspect: boolean;
@@ -73,7 +37,7 @@ declare abstract class AbstractPrettyReporter<T extends string = string, L exten
73
37
  /** Styling options for pretty formatting */
74
38
  protected readonly styles: PrettyStyleOptions;
75
39
  /** Logger type configurations for styling */
76
- protected loggerTypes: LoggerTypesConfig<LiteralUnion$1<DefaultLogTypes, T>, L>;
40
+ protected loggerTypes: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;
77
41
  /**
78
42
  * Creates a new AbstractPrettyReporter instance.
79
43
  * @param options Styling options for pretty formatting
@@ -84,7 +48,7 @@ declare abstract class AbstractPrettyReporter<T extends string = string, L exten
84
48
  * Sets the logger types configuration for styling.
85
49
  * @param types Logger type configurations with colors and labels
86
50
  */
87
- setLoggerTypes(types: LoggerTypesConfig<LiteralUnion$1<DefaultLogTypes, T>, L>): void;
51
+ setLoggerTypes(types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>): void;
88
52
  /**
89
53
  * Logs a message with pretty formatting.
90
54
  * @param meta The log metadata to format and output
@@ -181,6 +145,6 @@ declare class PrettyReporter<T extends string = string, L extends string = strin
181
145
  setIsInteractive(interactive: boolean): void;
182
146
  log(meta: ReadonlyMeta<L>): void;
183
147
  protected _formatMessage(data: ReadonlyMeta<L>): string;
184
- protected _log(message: string, logLevel: LiteralUnion$1<ExtendedRfc5424LogLevels, L>): void;
148
+ protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
185
149
  }
186
150
  export { PrettyReporter, type PrettyReporterOptions };
@@ -1 +1 @@
1
- import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-N7FvHzl5.js";export{t as PrettyReporter};
1
+ import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-BBs3xkv_.js";export{t as PrettyReporter};
@@ -1,5 +1,6 @@
1
+ import { LiteralUnion } from 'type-fest';
1
2
  import { InteractiveManager } from '@visulima/interactive-manager';
2
- import { D as DefaultLogTypes, L as LiteralUnion$1, a as LoggerTypesConfig, g as ReadonlyMeta, e as LoggerTypesAwareReporter, I as InteractiveStreamReporter } from "../../packem_shared/types.d-CM5ie2qm.js";
3
+ import { D as DefaultLogTypes, L as LoggerTypesConfig, f as ReadonlyMeta, d as LoggerTypesAwareReporter, I as InteractiveStreamReporter } from "../../packem_shared/types.d-Cz9S7jZh.js";
3
4
  import '@visulima/colorize';
4
5
  type ColorizeMethod = (value: string) => string;
5
6
  type CodeFrameOptions = {
@@ -35,42 +36,6 @@ type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
35
36
  indentation: number | " ";
36
37
  prefix: string;
37
38
  };
38
- /**
39
- Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
40
-
41
- @category Type
42
- */
43
- type Primitive = null | undefined | string | number | boolean | symbol | bigint;
44
- /**
45
- Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
46
-
47
- Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
48
-
49
- This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
50
-
51
- @example
52
- ```
53
- import type {LiteralUnion} from 'type-fest';
54
-
55
- // Before
56
-
57
- type Pet = 'dog' | 'cat' | string;
58
-
59
- const petWithoutAutocomplete: Pet = '';
60
- // Start typing in your TypeScript-enabled IDE.
61
- // You **will not** get auto-completion for `dog` and `cat` literals.
62
-
63
- // After
64
-
65
- type Pet2 = LiteralUnion<'dog' | 'cat', string>;
66
-
67
- const petWithAutoComplete: Pet2 = '';
68
- // You **will** get auto-completion for `dog` and `cat` literals.
69
- ```
70
-
71
- @category Type
72
- */
73
- type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
74
39
  interface Options {
75
40
  breakLength: number;
76
41
  customInspect: boolean;
@@ -106,7 +71,7 @@ declare abstract class AbstractPrettyReporter<T extends string = string, L exten
106
71
  /** Styling options for pretty formatting */
107
72
  protected readonly styles: PrettyStyleOptions;
108
73
  /** Logger type configurations for styling */
109
- protected loggerTypes: LoggerTypesConfig<LiteralUnion$1<DefaultLogTypes, T>, L>;
74
+ protected loggerTypes: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;
110
75
  /**
111
76
  * Creates a new AbstractPrettyReporter instance.
112
77
  * @param options Styling options for pretty formatting
@@ -117,7 +82,7 @@ declare abstract class AbstractPrettyReporter<T extends string = string, L exten
117
82
  * Sets the logger types configuration for styling.
118
83
  * @param types Logger type configurations with colors and labels
119
84
  */
120
- setLoggerTypes(types: LoggerTypesConfig<LiteralUnion$1<DefaultLogTypes, T>, L>): void;
85
+ setLoggerTypes(types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>): void;
121
86
  /**
122
87
  * Logs a message with pretty formatting.
123
88
  * @param meta The log metadata to format and output
@@ -1,4 +1,4 @@
1
- var F=Object.defineProperty;var x=(o,e)=>F(o,"name",{value:e,configurable:!0});import{createRequire as V}from"node:module";import A from"@visulima/colorize";import{A as G,u as W,i as H,O as K,b as Q,s as Z,o as d,c as J,a as N,p as R,d as U,B as X,G as S}from"../../packem_shared/abstract-pretty-reporter-Bag7lQKf.js";const le=V(import.meta.url),Y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:z,stderr:D}=Y;var ee=Object.defineProperty,B=x((o,e)=>ee(o,"name",{value:e,configurable:!0}),"b");const{bgGrey:te,bold:I,cyan:se,green:re,greenBright:ie,grey:a,red:T,underline:k,white:ae}=A,oe=/[\\/]pail[\\/]dist/,_=B(o=>!oe.test(o),"pailFileFilter");class ue extends G{static{x(this,"SimpleReporter")}static{B(this,"SimpleReporter")}#t;#s;#r;#a=!1;#i;#e;constructor(e={}){const{error:n,inspect:p,...i}=e;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...W,indent:void 0,...p},this.#e={...n,color:{fileLine:re,hint:se,marker:T,message:T,method:ie,title:T}},this.#t=z,this.#s=D}setStdout(e){this.#t=e}setStderr(e){this.#s=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#a=e}log(e){const n=this.formatMessage(e),p=e.type.level,i=["error","trace","warn"].includes(p)?"stderr":"stdout",h=i==="stderr"?this.#s:this.#t;this.#a&&this.#r!==void 0&&h.isTTY?this.#r.update(i,n.split(`
1
+ var F=Object.defineProperty;var x=(o,e)=>F(o,"name",{value:e,configurable:!0});import{createRequire as V}from"node:module";import A from"@visulima/colorize";import{A as G,u as W,i as H,O as K,b as Q,s as Z,o as d,c as J,a as N,p as R,d as U,B as X,G as S}from"../../packem_shared/abstract-pretty-reporter-DE6N5YR9.js";const le=V(import.meta.url),Y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:z,stderr:D}=Y;var ee=Object.defineProperty,B=x((o,e)=>ee(o,"name",{value:e,configurable:!0}),"b");const{bgGrey:te,bold:I,cyan:se,green:re,greenBright:ie,grey:a,red:T,underline:k,white:ae}=A,oe=/[\\/]pail[\\/]dist/,_=B(o=>!oe.test(o),"pailFileFilter");class ue extends G{static{x(this,"SimpleReporter")}static{B(this,"SimpleReporter")}#t;#s;#r;#a=!1;#i;#e;constructor(e={}){const{error:n,inspect:p,...i}=e;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...W,indent:void 0,...p},this.#e={...n,color:{fileLine:re,hint:se,marker:T,message:T,method:ie,title:T}},this.#t=z,this.#s=D}setStdout(e){this.#t=e}setStderr(e){this.#s=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#a=e}log(e){const n=this.formatMessage(e),p=e.type.level,i=["error","trace","warn"].includes(p)?"stderr":"stdout",h=i==="stderr"?this.#s:this.#t;this.#a&&this.#r!==void 0&&h.isTTY?this.#r.update(i,n.split(`
2
2
  `),0):H(`${n}
3
3
  `,h)}formatMessage(e){const{columns:n}=K();let p=n;typeof this.styles.messageLength=="number"&&(p=this.styles.messageLength);const{badge:i,context:h,date:c,error:j,file:u,groups:g,label:m,message:f,prefix:y,repeated:M,scope:$,suffix:b,traceError:v,type:L}=e,{color:w}=this.loggerTypes[L.name],E=w?A[w]:ae,l=g.map(()=>" ").join(""),t=[];if(g.length>0&&t.push(`${l+a(`[${g.at(-1)??""}]`)} `),c&&t.push(`${a(this.styles.dateFormatter(typeof c=="string"?new Date(c):c))} `),i)t.push(I(E(i)));else{const s=Q(this.loggerTypes);s.length>0&&t.push(a(" ".repeat(s.length)))}const O=Z(this.loggerTypes),C=d(O);if(m){const s=d(m),r=Math.max(0,C-s);t.push(`${I(E(J(m,this.styles)))} `," ".repeat(r))}else t.push(" ".repeat(C+1));M&&t.push(`${te.white(`[${String(M)}x]`)} `),Array.isArray($)&&$.length>0&&t.push(`${a(`[${$.join(" > ")}]`)} `),y&&t.push(`${a(`[${this.styles.underline.prefix?k(y):y}]`)} `);const P=d(t.join(""));if(f!==N){const s=typeof f=="string"?f:R(f,this.#i);t.push(l+U(s,{trim:!1,width:p-3,wrapMode:X.STRICT_WIDTH}))}if(h){let s=!1;t.push(...h.map(r=>{if(r instanceof Error)return s=!0,`
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/pail",
3
- "version": "4.0.0-alpha.16",
3
+ "version": "4.0.0-alpha.18",
4
4
  "description": "Highly configurable Logger for Node.js, Edge and Browser.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -56,15 +56,7 @@
56
56
  "winston"
57
57
  ],
58
58
  "homepage": "https://visulima.com/packages/pail/",
59
- "bugs": {
60
- "url": "https://github.com/visulima/visulima/issues"
61
- },
62
- "license": "MIT",
63
- "author": {
64
- "name": "Daniel Bannert",
65
- "email": "d.bannert@anolilab.de",
66
- "url": "https://danielbannert.com"
67
- },
59
+ "bugs": "https://github.com/visulima/visulima/issues",
68
60
  "repository": {
69
61
  "type": "git",
70
62
  "url": "git+https://github.com/visulima/visulima.git",
@@ -80,26 +72,21 @@
80
72
  "url": "https://anolilab.com/support"
81
73
  }
82
74
  ],
83
- "files": [
84
- "dist/**",
85
- "README.md",
86
- "CHANGELOG.md",
87
- "LICENSE.md"
88
- ],
89
- "os": [
90
- "darwin",
91
- "linux",
92
- "win32"
93
- ],
94
- "type": "module",
75
+ "license": "MIT",
76
+ "author": {
77
+ "name": "Daniel Bannert",
78
+ "email": "d.bannert@anolilab.de",
79
+ "url": "https://danielbannert.com"
80
+ },
95
81
  "sideEffects": false,
82
+ "type": "module",
96
83
  "exports": {
97
84
  ".": {
98
- "browser": "./dist/index.browser.js",
99
85
  "import": {
100
86
  "types": "./dist/index.server.d.ts",
101
87
  "default": "./dist/index.server.js"
102
- }
88
+ },
89
+ "browser": "./dist/index.browser.js"
103
90
  },
104
91
  "./browser": {
105
92
  "types": "./dist/index.browser.d.ts",
@@ -154,11 +141,11 @@
154
141
  }
155
142
  },
156
143
  "./reporter/json": {
157
- "browser": "./dist/reporter/json/index.browser.js",
158
144
  "import": {
159
145
  "types": "./dist/reporter/json/index.d.ts",
160
146
  "default": "./dist/reporter/json/index.js"
161
- }
147
+ },
148
+ "browser": "./dist/reporter/json/index.browser.js"
162
149
  },
163
150
  "./server/reporter/pretty": {
164
151
  "import": {
@@ -173,11 +160,11 @@
173
160
  }
174
161
  },
175
162
  "./reporter/pretty": {
176
- "browser": "./dist/reporter/pretty/index.browser.js",
177
163
  "import": {
178
164
  "types": "./dist/reporter/pretty/index.d.ts",
179
165
  "default": "./dist/reporter/pretty/index.js"
180
- }
166
+ },
167
+ "browser": "./dist/reporter/pretty/index.browser.js"
181
168
  },
182
169
  "./reporter/simple": {
183
170
  "types": "./dist/reporter/simple/simple-reporter.server.d.ts",
@@ -188,6 +175,10 @@
188
175
  "default": "./dist/reporter/http/abstract-http-reporter.js"
189
176
  },
190
177
  "./reporter/http": {
178
+ "import": {
179
+ "types": "./dist/reporter/http/http-reporter.d.ts",
180
+ "default": "./dist/reporter/http/http-reporter.js"
181
+ },
191
182
  "edge-light": {
192
183
  "types": "./dist/reporter/http/http-reporter.edge-light.d.ts",
193
184
  "default": "./dist/reporter/http/http-reporter.edge-light.js"
@@ -195,10 +186,6 @@
195
186
  "browser": {
196
187
  "types": "./dist/reporter/http/http-reporter.d.ts",
197
188
  "default": "./dist/reporter/http/http-reporter.js"
198
- },
199
- "import": {
200
- "types": "./dist/reporter/http/http-reporter.d.ts",
201
- "default": "./dist/reporter/http/http-reporter.js"
202
189
  }
203
190
  },
204
191
  "./object-tree": {
@@ -235,18 +222,20 @@
235
222
  },
236
223
  "./package.json": "./package.json"
237
224
  },
238
- "publishConfig": {
239
- "access": "public",
240
- "provenance": true
241
- },
225
+ "files": [
226
+ "dist/**",
227
+ "README.md",
228
+ "CHANGELOG.md",
229
+ "LICENSE.md"
230
+ ],
242
231
  "dependencies": {
243
- "@visulima/colorize": "2.0.0-alpha.11",
244
- "@visulima/interactive-manager": "1.0.0-alpha.2"
232
+ "@visulima/colorize": "2.0.0-alpha.12",
233
+ "@visulima/interactive-manager": "1.0.0-alpha.3"
245
234
  },
246
235
  "peerDependencies": {
247
236
  "@opentelemetry/api": "^1.9.1",
248
237
  "@sveltejs/kit": ">=2.0",
249
- "@visulima/redact": "3.0.0-alpha.11",
238
+ "@visulima/redact": "3.0.0-alpha.12",
250
239
  "elysia": ">=1.0",
251
240
  "express": ">=4.0",
252
241
  "fastify": ">=4.0",
@@ -285,5 +274,14 @@
285
274
  },
286
275
  "engines": {
287
276
  "node": "^22.14.0 || >=24.10.0"
277
+ },
278
+ "os": [
279
+ "darwin",
280
+ "linux",
281
+ "win32"
282
+ ],
283
+ "publishConfig": {
284
+ "access": "public",
285
+ "provenance": true
288
286
  }
289
287
  }