@visulima/pail 4.0.0-alpha.13 → 4.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE.md +30 -0
  3. package/dist/index.browser.js +1 -1
  4. package/dist/index.server.js +1 -1
  5. package/dist/middleware/elysia.d.ts +3 -3
  6. package/dist/middleware/express.d.ts +3 -3
  7. package/dist/middleware/fastify.d.ts +3 -3
  8. package/dist/middleware/hono.d.ts +3 -3
  9. package/dist/middleware/next/handler.d.ts +3 -3
  10. package/dist/middleware/sveltekit.d.ts +3 -3
  11. package/dist/packem_shared/AbstractJsonReporter-D_Pb6kpB.js +1 -0
  12. package/dist/packem_shared/AbstractJsonReporter-PVC4ONf2.js +1 -0
  13. package/dist/packem_shared/{JsonReporter-15ln04rX.js → JsonReporter-BEEmb0W4.js} +1 -1
  14. package/dist/packem_shared/{JsonReporter-CerNvhg-.js → JsonReporter-CE-lw7R0.js} +1 -1
  15. package/dist/packem_shared/PrettyReporter-N7FvHzl5.js +44 -0
  16. package/dist/packem_shared/{abstract-json-reporter.d-Bz3lZEDi.d.ts → abstract-json-reporter.d-Boj5w068.d.ts} +1 -1
  17. package/dist/packem_shared/abstract-pretty-reporter-Bag7lQKf.js +33 -0
  18. package/dist/packem_shared/{create-middleware-logger.d-DeNLii5l.d.ts → create-middleware-logger.d-CMQdVeVE.d.ts} +2 -2
  19. package/dist/packem_shared/{types.d-ByY2ZuYG.d.ts → types.d-Ck_RSjLg.d.ts} +1 -1
  20. package/dist/packem_shared/{wide-event.d-Ke44zirU.d.ts → wide-event.d-DA-6dTPc.d.ts} +1 -1
  21. package/dist/processor/caller/caller-processor.d.ts +1 -1
  22. package/dist/processor/environment-processor.d.ts +1 -1
  23. package/dist/processor/message-formatter-processor.d.ts +1 -1
  24. package/dist/processor/opentelemetry-processor.d.ts +1 -1
  25. package/dist/processor/redact-processor.d.ts +1 -1
  26. package/dist/processor/sampling-processor.d.ts +1 -1
  27. package/dist/reporter/file/json-file-reporter.d.ts +2 -2
  28. package/dist/reporter/file/json-file-reporter.js +1 -1
  29. package/dist/reporter/http/abstract-http-reporter.d.ts +2 -2
  30. package/dist/reporter/http/abstract-http-reporter.js +1 -1
  31. package/dist/reporter/http/http-reporter.d.ts +2 -2
  32. package/dist/reporter/http/http-reporter.edge-light.js +2 -2
  33. package/dist/reporter/json/index.browser.js +1 -1
  34. package/dist/reporter/json/index.d.ts +2 -2
  35. package/dist/reporter/json/index.js +1 -1
  36. package/dist/reporter/pretty/index.d.ts +36 -3
  37. package/dist/reporter/pretty/index.js +1 -1
  38. package/dist/reporter/simple/simple-reporter.server.d.ts +1 -1
  39. package/dist/reporter/simple/simple-reporter.server.js +3 -3
  40. package/dist/wide-event.d.ts +2 -2
  41. package/package.json +1 -1
  42. package/dist/packem_shared/AbstractJsonReporter-BawNFYxI.js +0 -1
  43. package/dist/packem_shared/AbstractJsonReporter-Dt5-5x2R.js +0 -1
  44. package/dist/packem_shared/PrettyReporter-CgXnwIip.js +0 -44
  45. package/dist/packem_shared/abstract-pretty-reporter-BiHgKxG_.js +0 -33
@@ -0,0 +1,33 @@
1
+ var Rt=Object.defineProperty;var b=(e,t)=>Rt(e,"name",{value:t,configurable:!0});import{createRequire as zt}from"node:module";import et from"@visulima/colorize";const Vt=zt(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 Vt(e)},"__cjs_getBuiltinModule"),{createRequire:Ht}=se("node:module"),k=_,{execFileSync:Dt}=se("node:child_process"),G=se("node:fs"),Gt=se("node:tty"),qa={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},qt={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"}},Ya=Symbol("EMPTY");var Yt=Object.defineProperty,Ut=b((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"g$6");const Ua=Ut(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 Jt=Object.defineProperty,tt=b((e,t)=>Jt(e,"name",{value:t,configurable:!0}),"T$5"),Kt=Object.defineProperty,$=tt((e,t)=>Kt(e,"name",{value:t,configurable:!0}),"l"),Qt=Object.defineProperty,Xt=$((e,t)=>Qt(e,"name",{value:t,configurable:!0}),"L");const S=Xt((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,A=v+f.length;if(d&&v>s&&c.length+f.length<=s||!d&&!p&&A>s)break;m=e[g+1];const P=p?"":a;if(d?u="":u=l(m,t,r,n)+P,!d&&p&&A>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 Zt=Object.defineProperty,ce=$((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"s$6");const er=ce(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),tr=ce((e,t,r)=>{switch(e.nodeType){case 1:return rt(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},"inspectNode"),Se=ce((e,t,r,n)=>S(e,e,t,r,tr,`
2
+ `),"inspectNodeCollection"),rt=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,er," ")),r.truncate-=c.length;const{truncate:u}=r;let f=Se(e.children,r,n,void 0);return f&&f.length>u&&(f=`…(${String(e.children.length)})`),`${o}${c}${l}${f}${s}`},"inspectHTMLElement");var rr=Object.defineProperty,nr=$((e,t)=>rr(e,"name",{value:t,configurable:!0}),"n$4");const ir=nr((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${S(e,e,t,r)} ]`),"inspectArguments");var ar=Object.defineProperty,nt=$((e,t)=>ar(e,"name",{value:t,configurable:!0}),"r$3");const or=nt((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=nt((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var lr=Object.defineProperty,it=$((e,t)=>lr(e,"name",{value:t,configurable:!0}),"i$5");const sr=/^[a-z_]\w*$/i,cr=/^"|"$/g,ur=it((e,t)=>{if(sr.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(cr,"'")},"quoteComplexKey"),q=it(([e,t],r,n,i)=>{n.truncate-=2;let a;typeof e=="string"?a=ur(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 fr=Object.defineProperty,at=$((e,t)=>fr(e,"name",{value:t,configurable:!0}),"p$4");const dr=at(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),gr=at((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&&dr(e);return l&&(a=ue(a,n)),`[${l?"":" "}${a}${o?`, ${o}`:""}${l?"":" "}]`},"inspectArray");var pr=Object.defineProperty,mr=$((e,t)=>pr(e,"name",{value:t,configurable:!0}),"o$7");const _e=/\d(?=(?:\d{3})+(?!\d))/g,hr=/\d{3}/g,br=/_$/,ot=mr((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(_e,"$&_")}.${i.replace(hr,"$&_").replace(br,"")}`}}return t.replace(_e,"$&_")},"addNumericSeparator");var $r=Object.defineProperty,lt=$((e,t)=>$r(e,"name",{value:t,configurable:!0}),"i$4");const vr=lt(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),x=lt((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&&vr(e[a-1])&&(a-=1),`${e.slice(0,a)}${r}`}return e},"truncate");var yr=Object.defineProperty,wr=$((e,t)=>yr(e,"name",{value:t,configurable:!0}),"e$4");const Me=wr((e,t)=>{let r=x(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?ot(e,r):r,"bigint")},"inspectBigInt");var Sr=Object.defineProperty,Or=$((e,t)=>Sr(e,"name",{value:t,configurable:!0}),"y");const Er=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),re=Or((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=Er(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 Ar=Object.defineProperty,jr=$((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"s$3");const Nr=jr((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 xr=Object.defineProperty,Ir=$((e,t)=>xr(e,"name",{value:t,configurable:!0}),"i$3");const Pr=Ir((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 kr=Object.defineProperty,Tr=$((e,t)=>kr(e,"name",{value:t,configurable:!0}),"c$4");const Br=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Wr=Tr((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(l=>!Br.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 Fr=Object.defineProperty,Lr=$((e,t)=>Fr(e,"name",{value:t,configurable:!0}),"c$3");const Ce=Lr((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 _r=Object.defineProperty,st=$((e,t)=>_r(e,"name",{value:t,configurable:!0}),"p$3");const Mr=st(([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),"inspectMapEntry"),Cr=st((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=S([...e.entries()],e,t,r,Mr);return n&&(i=ue(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectMap");var Rr=Object.defineProperty,zr=$((e,t)=>Rr(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?ot(e,e.toString()):e.toString(),t.truncate),"number")}b(Y,"j$5");tt(Y,"P");$(Y,"u$3");zr(Y,"inspectNumber");var Vr=Object.defineProperty,Hr=$((e,t)=>Vr(e,"name",{value:t,configurable:!0}),"e$2");const Dr=Hr(()=>"Promise{…}","getPromiseValue");var Gr=Object.defineProperty,qr=$((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"p$1");const Yr=qr((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${x(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var Ur=Object.defineProperty,Jr=$((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"i$1");const Kr=Jr((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 Qr=Object.defineProperty,Xr=$((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"l");const Zr=Xr((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var en=Object.defineProperty,ct=$((e,t)=>en(e,"name",{value:t,configurable:!0}),"e$1");const Re=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"),tn={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},rn=16,nn=ct(e=>tn[e]||String.raw`\u${`0000${e.codePointAt(0).toString(rn)}`.slice(-4)}`,"escape"),ze=ct((e,t)=>(Re.test(e)&&(e=e.replaceAll(Re,nn)),t.stylize(Zr(x(e,t.truncate-2),t),"string")),"inspectString");var an=Object.defineProperty,on=$((e,t)=>an(e,"name",{value:t,configurable:!0}),"o");const Ve=on(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var ln=Object.defineProperty,ut=$((e,t)=>ln(e,"name",{value:t,configurable:!0}),"f");const sn=ut(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),O=ut((e,t,r)=>{const n=sn(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 cn=Object.defineProperty,w=$((e,t)=>cn(e,"name",{value:t,configurable:!0}),"r");const oe=new WeakMap,Oe={},un={Arguments:ir,Array:gr,ArrayBuffer:w(()=>"","ArrayBuffer"),BigInt:Me,bigint:Me,Boolean:w((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:w((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:w(()=>"","DataView"),Date:Pr,Error:Wr,Float32Array:O,Float64Array:O,Function:Ce,function:Ce,Generator:w(()=>"","Generator"),HTMLCollection:Se,Int8Array:O,Int16Array:O,Int32Array:O,Map:Cr,NodeList:Se,null:w((e,t)=>t.stylize("null","null"),"null"),Number:Y,number:Y,Promise:Dr,RegExp:Yr,Set:Kr,String:ze,string:ze,Symbol:Ve,symbol:Ve,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")},He=Symbol.for("nodejs.util.inspect.custom"),fn=w((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[He]=="function")return e[He](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=Oe[r];return i?i(e,t):""},"inspectCustom"),ft=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]),ft(c,f,r+1,n)),"inspect"),a=t.indent?or(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=un[o];if(l!==void 0)return l(e,t,i,a);if(t.customInspect&&e){const c=fn(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?rt(e,e,t,i):"constructor"in e?e.constructor!==Object?Nr(e,t,i,a):re(e,t,i,a):e===Object(e)?re(e,t,i,a):t.stylize(String(e),o)},"internalInspect"),Ja=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 ft(e,r,0,[])},"inspect");w((e,t)=>oe.has(e)?!1:(oe.set(e,t),!0),"registerConstructor");w((e,t)=>e in Oe?!1:(Oe[e]=t,!0),"registerStringTag");var dn=Object.defineProperty,gn=b((e,t)=>dn(e,"name",{value:t,configurable:!0}),"r$6");const Ka=gn((e,t)=>(t.__write??t.write.bind(t)).call(t,e),"writeStream");var pn=Object.defineProperty,mn=b((e,t)=>pn(e,"name",{value:t,configurable:!0}),"A$4"),hn=Object.defineProperty,je=mn((e,t)=>hn(e,"name",{value:t,configurable:!0}),"$"),bn=Object.defineProperty,$n=je((e,t)=>bn(e,"name",{value:t,configurable:!0}),"r$1");const vn=$n(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
4
+ `),"normalizeLF"),yn=globalThis.process??Object.create(null),De={versions:{}},Ge=new Proxy(yn,{get(e,t){if(t in e)return e[t];if(t in De)return De[t]}});var wn=Object.defineProperty,Sn=je((e,t)=>wn(e,"name",{value:t,configurable:!0}),"b");const On=Sn((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 En=Object.defineProperty,X=je((e,t)=>En(e,"name",{value:t,configurable:!0}),"t");const An=Ge.platform==="win32"&&!Ge.env?.WT_SESSION?">":"❯",jn=X((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:X(p=>p,"gutter"),marker:X(p=>p,"marker"),message:X(p=>p,"message"),...r?.color}},i=typeof t.start.column=="number";let a=vn(e).split(`
5
+ `);typeof n.tabWidth=="number"&&(a=a.map(p=>p.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:l,start:s}=On(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],A=` ${String(h)}`.slice(-c),P=!l[h+1],z=` ${A}${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(An),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 Nn=Object.defineProperty,xn=b((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"x$3"),In=Object.defineProperty,Pn=xn((e,t)=>In(e,"name",{value:t,configurable:!0}),"x"),kn=Object.defineProperty,E=Pn((e,t)=>kn(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>",Tn=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Bn=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Wn=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Fn=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Ln=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,_n=/in\s(.*)\s\(at\s(.+)\)\sat/,Mn=/^(?:.*@)?(.*):(\d+):(\d+)$/,Cn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,zn=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,qe=/\(error: (.*)\)/,Vn=/at\s/,Hn=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Dn=/^\s+|\s+$/g,Gn=/\S*(?:Error: |AggregateError:)/,dt=/^Anonymous function$/,qn=/^\s*in\s.*/,Yn=/^.*?\s*at\s.*/,Un=/^.*?\s*@.*|\[native code\]/,gt=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"),pt=E((e,t)=>{const r=Wn.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),Jn=E(e=>{const t=_n.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=Ln.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(Vn,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??W,raw:e,type:e.startsWith("internal")?"internal":void 0};return pt(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),Kn=E(e=>{const t=Tn.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=Bn.exec(e);if(c){const u=Hn.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=Fn.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]=gt(t[1]?t[1].replace(dt,"<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):pt(s,`${l}:${t[3]}:${t[4]}`),s}},"parseChromium"),Qn=E((e,t)=>{const r=Cn.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]&&Rn.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]=gt(r[1]?r[1].replace(dt,"<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"),Xn=E((e,t)=>{const r=zn.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"),Zn=E(e=>{const t=Mn.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"),mt=E((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
9
+ `).map(a=>(qe.test(a)?a.replace(qe,"$1"):a).replaceAll(Dn,"")).filter(a=>!Gn.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(qn.test(o))s=Jn(o);else if(Yn.test(o))s=Kn(o);else if(Un.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=Xn(o,c)??Qn(o,c)}else s=Zn(o);return s?a.push(s):B(`parse error stack line: "${o}"`,"not parser found"),a},[])},"parseStacktrace");var ei=Object.defineProperty,ti=b((e,t)=>ei(e,"name",{value:t,configurable:!0}),"p$6"),ri=Object.defineProperty,ht=ti((e,t)=>ri(e,"name",{value:t,configurable:!0}),"m");const ni=Ht(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=ht(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 ni(e)},"__cjs_getBuiltinModule"),{existsSync:ii,readFileSync:ai}=Ne("node:fs"),{relative:oi}=Ne("node:path"),{cwd:li}=M,{fileURLToPath:si}=Ne("node:url");var ci=Object.defineProperty,y=ht((e,t)=>ci(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"),ui=y((e,t)=>{const r=e.replace("async file:","file:");return oi(t,r.startsWith("file:")?si(r):r)},"getRelativePath"),fi=y((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),bt=y((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},a)=>`${C(i,n,a)}${fi(e,r,t)}
10
+ `,"getMessage"),$t=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"),xe=y((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:a},o=0)=>{const l=n?ui(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"),vt=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(!ii(u))return;const f=ai(u,"utf8");return jn(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"),yt=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+=St(a,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
16
+ ${n}`},"getErrors"),wt=y((e,t,r)=>{let n=`${C(t.prefix,t.indentation,r)}Caused by:
17
+
18
+ `;const i=e.cause;n+=bt(i,t,r);const a=mt(i).shift(),o=$t(i,t,r);if(o&&(n+=`${o}
19
+ `),a&&(n+=xe(a,t,r),!t.hideErrorCauseCodeView)){const l=vt(a,t,r);l!==void 0&&(n+=`
20
+ ${l}`)}if(i.cause)n+=`
21
+ ${wt(i,t,r+1)}`;else if(i instanceof AggregateError){const l=yt(i,t,r);l!==void 0&&(n+=`
22
+ ${l}`)}return`
23
+ ${n}`},"getCause"),di=y((e,t)=>(e.length>0?`
24
+ `:"")+e.map(r=>xe(r,t)).join(`
25
+ `),"getStacktrace"),St=y((e,t,r)=>{const n={cwd:li(),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=mt(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),a=i.shift();return[t.hideMessage?void 0:bt(e,n,r),$t(e,n,r),a?xe(a,n,r):void 0,a&&!n.hideErrorCodeView?vt(a,n,r):void 0,e instanceof AggregateError?yt(e,n,r):void 0,e.cause===void 0?void 0:wt(e,n,r),i.length>0?di(i,n):void 0].filter(Boolean).join(`
26
+ `).replaceAll("\\","/")},"internalRenderError"),Qa=y((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return St(e,t,0)},"renderError");var gi=Object.defineProperty,Ie=b((e,t)=>gi(e,"name",{value:t,configurable:!0}),"s$3"),pi=Object.defineProperty,fe=Ie((e,t)=>pi(e,"name",{value:t,configurable:!0}),"l");const Pe=[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],ke=[12288,12288,65281,65376,65504,65510],Te=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Be=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],de=[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 mi=Object.defineProperty,hi=fe((e,t)=>mi(e,"name",{value:t,configurable:!0}),"r$1");const U=hi((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 bi=Object.defineProperty,F=fe((e,t)=>bi(e,"name",{value:t,configurable:!0}),"r");const $i=Pe[0],vi=Pe.at(-1),yi=ke[0],wi=ke.at(-1),Si=Te[0],Oi=Te.at(-1),Ei=Be[0],Ai=Be.at(-1),ji=de[0],Ni=de.at(-1),Ye=19968,[xi,Ii]=ge(de);function ge(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(Ye>=i&&Ye<=a)return[i,a];a-i>r-t&&(t=i,r=a)}return[t,r]}b(ge,"b$2");Ie(ge,"b");fe(ge,"N");F(ge,"findWideFastPathRange");const Ot=F(e=>e<$i||e>vi?!1:U(Pe,e),"isAmbiguous"),Et=F(e=>e<yi||e>wi?!1:U(ke,e),"isFullWidth"),Pi=F(e=>e<Si||e>Oi?!1:U(Te,e),"isHalfWidth"),ki=F(e=>e<Ei||e>Ai?!1:U(Be,e),"isNarrow"),At=F(e=>e>=xi&&e<=Ii?!0:e<ji||e>Ni?!1:U(de,e),"isWide");function pe(e){return Ot(e)?"ambiguous":Et(e)?"fullwidth":Pi(e)?"halfwidth":ki(e)?"narrow":At(e)?"wide":"neutral"}b(pe,"v$2");Ie(pe,"q");fe(pe,"getCategory");F(pe,"getCategory");var Ti=Object.defineProperty,me=b((e,t)=>Ti(e,"name",{value:t,configurable:!0}),"i$3"),Bi=Object.defineProperty,he=me((e,t)=>Bi(e,"name",{value:t,configurable:!0}),"a"),Wi=Object.defineProperty,We=he((e,t)=>Wi(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");me(J,"s");he(J,"r");We(J,"validate");function K(e){return J(e),pe(e)}b(K,"r$5");me(K,"p");he(K,"eastAsianWidthType");We(K,"eastAsianWidthType");function Fe(e,{ambiguousAsWide:t=!1}={}){return J(e),Et(e)||At(e)||t&&Ot(e)?2:1}b(Fe,"o$5");me(Fe,"W");he(Fe,"eastAsianWidth");We(Fe,"eastAsianWidth");var Fi=Object.defineProperty,Li=b((e,t)=>Fi(e,"name",{value:t,configurable:!0}),"p$3"),_i=Object.defineProperty,jt=Li((e,t)=>_i(e,"name",{value:t,configurable:!0}),"e"),Mi=Object.defineProperty,Ci=jt((e,t)=>Mi(e,"name",{value:t,configurable:!0}),"E");const Nt=String.raw,Ue=Nt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Ri=Ci(()=>new RegExp(Nt`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Ue}(?:\u200D${Ue})*`,"gu"),"default");var zi=Object.defineProperty,Vi=jt((e,t)=>zi(e,"name",{value:t,configurable:!0}),"p");const R=new Set(["\x1B","›"]),be="\x07",xt="[",Le="m",le="]8;;",Hi=39,Di=/[\u200B\uFEFF\u2060-\u2064]/g,Gi=new RegExp(`(?:\\${xt}(?<code>\\d+)m|\\${le}(?<uri>.*)${be})`),qi=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,Z=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ne=Ri();Vi(e=>e.replace(ne,""),"stripEmoji");var Yi=Object.defineProperty,Ui=b((e,t)=>Yi(e,"name",{value:t,configurable:!0}),"E"),Ji=Object.defineProperty,Ki=Ui((e,t)=>Ji(e,"name",{value:t,configurable:!0}),"A"),Qi=Object.defineProperty,$e=Ki((e,t)=>Qi(e,"name",{value:t,configurable:!0}),"d");const Je=new Map,ee=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ie=$e(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"),Xi=$e((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Je.get(r);if(i||(i=new Map,Je.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"),Zi=$e(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"),Ee=$e((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?Ee(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,A=e.indexOf("\x07",o+5);if(A!==-1){const P=e.indexOf(h,A+1);if(P!==-1){const z=P+v,V=e.slice(A+1,P).replace(D,""),Q=Ee(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)&&(Z.lastIndex=o,Z.test(e))){const h=(Z.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=Z.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(Zi(p)){o+=p>65535?2:1;continue}let m;if(a)m=Xi(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 ea=Object.defineProperty,ta=b((e,t)=>ea(e,"name",{value:t,configurable:!0}),"i$1"),ra=Object.defineProperty,na=ta((e,t)=>ra(e,"name",{value:t,configurable:!0}),"e"),ia=Object.defineProperty,aa=na((e,t)=>ia(e,"name",{value:t,configurable:!0}),"r");const j=aa((e,t={})=>Ee(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var oa=Object.defineProperty,It=b((e,t)=>oa(e,"name",{value:t,configurable:!0}),"b"),la=Object.defineProperty,L=It((e,t)=>la(e,"name",{value:t,configurable:!0}),"d"),sa=Object.defineProperty,ca=L((e,t)=>sa(e,"name",{value:t,configurable:!0}),"a");const ua=/\x1B\[(\d+)m/;class Pt{static{b(this,"T")}static{It(this,"T")}static{L(this,"d")}static{ca(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=ua.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 fa=Object.defineProperty,kt=L((e,t)=>fa(e,"name",{value:t,configurable:!0}),"o");const Tt=kt((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"),da=kt((e,t={})=>{const r=new Pt;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=Tt(s,c),{isInsideLinkEscape:p}=d;if(p){let m=c+1;for(o="";m<s.length;){const v=s[m];if(v===be)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===Le){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 ga=Object.defineProperty,pa=L((e,t)=>ga(e,"name",{value:t,configurable:!0}),"t$1");const Ke=pa(e=>`${R.values().next().value}${xt}${String(e)}${Le}`,"wrapAnsiCode");var ma=Object.defineProperty,ha=L((e,t)=>ma(e,"name",{value:t,configurable:!0}),"s");const Qe=ha(e=>`${R.values().next().value}${le}${e}${be}`,"wrapAnsiHyperlink");var ba=Object.defineProperty,$a=L((e,t)=>ba(e,"name",{value:t,configurable:!0}),"l");const va=$a(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=Gi.exec(i.slice(o))?.groups??{};if(u.code!==void 0){const f=Number.parseFloat(u.code);r=f===Hi?void 0:f}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=qi.get(Number(r));a[l+1]===`
28
+ `?(n&&(t+=Qe("")),r&&c&&(t+=Ke(c))):s===`
29
+ `&&(r&&c&&(t+=Ke(r)),n&&(t+=Qe(n))),o+=s.length}return t},"preserveAnsi");var ya=Object.defineProperty,N=L((e,t)=>ya(e,"name",{value:t,configurable:!0}),"f");const Bt=/(?=\s)|(?<=\s)/,Wt=/^\s+$/,ve=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&&j(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),Ft=N((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new Pt;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=Tt([...e],u).isInsideLinkEscape,u+=1;continue}if(l){c+=f,a+=f,s?f===be&&(l=s=!1):f===Le&&(l=!1,i.processEscape(c)),u+=1;continue}const g=j(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=j(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=j(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"),wa=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 da(n,{getWidth:j,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"),Sa=N((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Bt),a=[];let o="",l=0,s=0;for(;s<i.length;){const c=i[s],u=Wt.test(c),f=j(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"),Oa=N((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Bt),a=[];let o="",l=0,s=0;for(;s<i.length;){const c=i[s],u=Wt.test(c),f=j(c);if(c.length===0){s+=1;continue}if(r&&u&&l===0){s+=1;continue}if(f>t){o&&a.push(ve(r?T(o):o));const g=Ft(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=j(o)}else o="",l=0;s+=1;continue}if(l+f>t&&l>0&&(a.push(ve(r?T(o):o)),o="",l=0,r&&u)){s+=1;continue}o+=c,l+=f,s+=1}return o&&a.push(ve(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"},Xa=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(Di,"")),o.split(`
32
+ `).map(l=>{if(n&&l.trim()==="")return"";let s;switch(a){case te.BREAK_AT_CHARACTERS:{s=wa(l,i,n);break}case te.BREAK_WORDS:{s=Oa(l,i,n);break}case te.STRICT_WIDTH:{s=Ft(l,i,n);break}default:s=Sa(l,i,n)}return va(s)}).join(`
33
+ `)},"wordWrap");var Ea=Object.defineProperty,I=b((e,t)=>Ea(e,"name",{value:t,configurable:!0}),"n$2");const Lt=80,_t=24,Ae=I((e,t,{shell:r,env:n}={})=>Dt(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"),Mt=I((e,t)=>{const{columns:r,rows:n}=ae(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===Lt&&n===_t))return{columns:r,rows:n}},"createIfNotDefault"),Aa=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 ja(){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:Lt,rows:_t};return k.platform==="win32"?ye()??n:k.platform==="darwin"?Xe()??ye()??n:Xe()??ye()??Na()??n}b(ja,"O");I(ja,"terminalSize");const Xe=I(()=>{try{const e=k.platform==="darwin"?G.constants.O_EVTONLY|G.constants.O_NONBLOCK:G.constants.O_NONBLOCK,{columns:t,rows:r}=Gt.WriteStream(G.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),ye=I(()=>{try{const e=Ae("tput",["cols"],{env:{TERM:"dumb",...k.env}}),t=Ae("tput",["lines"],{env:{TERM:"dumb",...k.env}});if(e&&t)return Mt(e,t)}catch{}},"tput"),Na=I(()=>{try{if(!Aa())return;const e=Ae("resize",["-u"]).match(/\d+/g);if(e.length===2)return Mt(e[0],e[1])}catch{}},"resize");var xa=Object.defineProperty,Ia=b((e,t)=>xa(e,"name",{value:t,configurable:!0}),"r$2");const Za=Ia(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 Pa=Object.defineProperty,ka=b((e,t)=>Pa(e,"name",{value:t,configurable:!0}),"r$1");const{bold:Ta,cyan:Ba,green:Ze,grey:Wa,magenta:Fa,red:La,yellow:we}=et,eo={indent:2,quoteStyle:"single",stylize:ka((e,t)=>{const r={bigint:we,boolean:we,date:Fa,null:Ta,number:we,regexp:La,special:Ba,string:Ze,symbol:Ze,undefined:Wa};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var _a=Object.defineProperty,Ma=b((e,t)=>_a(e,"name",{value:t,configurable:!0}),"o$1");const{bold:Ca,underline:Ra}=et,to=Ma((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?Ra(r):r,t.bold.label&&(r=Ca(r)),r},"formatLabel");var za=Object.defineProperty,Ct=b((e,t)=>za(e,"name",{value:t,configurable:!0}),"o");const Va=Ct(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class ro{static{b(this,"AbstractPrettyReporter")}static{Ct(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:Va,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=qt}setLoggerTypes(t){this.loggerTypes=t}}export{ro as A,te as B,qa as E,Qa as G,qt as L,ja as O,Ya as a,Za as b,to as c,Xa as d,Ka as i,j as o,Ja as p,Ua as s,eo as u};
@@ -1,5 +1,5 @@
1
- import { P as PailBrowserImpl } from "./wide-event.d-Ke44zirU.js";
2
- import { D as DefaultLogTypes, d as LoggerFunction } from "./types.d-ByY2ZuYG.js";
1
+ import { P as PailBrowserImpl } from "./wide-event.d-DA-6dTPc.js";
2
+ import { D as DefaultLogTypes, e as LoggerFunction } from "./types.d-Ck_RSjLg.js";
3
3
  /**
4
4
  * Route configuration for a specific path pattern.
5
5
  */
@@ -243,4 +243,4 @@ type Message = {
243
243
  prefix?: string;
244
244
  suffix?: string;
245
245
  };
246
- export { ConstructorOptions as C, DefaultLogTypes as D, ExtendedRfc5424LogLevels as E, InteractiveStreamReporter as I, LiteralUnion as L, Meta as M, Processor as P, ReadonlyMeta as R, StringifyAwareReporter as S, StreamAwareReporter as a, LoggerTypesConfig as b, Reporter as c, LoggerFunction as d, StringifyAwareProcessor as e, LoggerTypesAwareReporter as f };
246
+ export { ConstructorOptions as C, DefaultLogTypes as D, ExtendedRfc5424LogLevels as E, InteractiveStreamReporter as I, LiteralUnion as L, Meta as M, Processor as P, ReadonlyMeta as R, StreamAwareReporter as S, StringifyAwareReporter as a, StringifyAwareProcessor as b, LoggerTypesConfig as c, Reporter as d, LoggerFunction as e, LoggerTypesAwareReporter as f };
@@ -1,5 +1,5 @@
1
1
  import { stringify } from 'safe-stable-stringify';
2
- import { M as Meta, D as DefaultLogTypes, L as LiteralUnion, b as LoggerTypesConfig, P as Processor, E as ExtendedRfc5424LogLevels, c as Reporter, d as LoggerFunction, C as ConstructorOptions } from "./types.d-ByY2ZuYG.js";
2
+ import { M as Meta, D as DefaultLogTypes, L as LiteralUnion, c as LoggerTypesConfig, P as Processor, E as ExtendedRfc5424LogLevels, d as Reporter, e as LoggerFunction, C as ConstructorOptions } from "./types.d-Ck_RSjLg.js";
3
3
  /**
4
4
  * Pail Browser Implementation.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { M as Meta, P as Processor } from "../../packem_shared/types.d-ByY2ZuYG.js";
1
+ import { M as Meta, P as Processor } from "../../packem_shared/types.d-Ck_RSjLg.js";
2
2
  import '@visulima/colorize';
3
3
  import '@visulima/interactive-manager';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { M as Meta, P as Processor } from "../packem_shared/types.d-ByY2ZuYG.js";
1
+ import { M as Meta, P as Processor } from "../packem_shared/types.d-Ck_RSjLg.js";
2
2
  import '@visulima/colorize';
3
3
  import '@visulima/interactive-manager';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { M as Meta, e as StringifyAwareProcessor } from "../packem_shared/types.d-ByY2ZuYG.js";
1
+ import { M as Meta, b as StringifyAwareProcessor } from "../packem_shared/types.d-Ck_RSjLg.js";
2
2
  import '@visulima/colorize';
3
3
  import '@visulima/interactive-manager';
4
4
  type FormatterFunction = (argument: any) => string;
@@ -1,4 +1,4 @@
1
- import { M as Meta, P as Processor } from "../packem_shared/types.d-ByY2ZuYG.js";
1
+ import { M as Meta, P as Processor } from "../packem_shared/types.d-Ck_RSjLg.js";
2
2
  import '@visulima/colorize';
3
3
  import '@visulima/interactive-manager';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { M as Meta, P as Processor } from "../packem_shared/types.d-ByY2ZuYG.js";
1
+ import { M as Meta, P as Processor } from "../packem_shared/types.d-Ck_RSjLg.js";
2
2
  import '@visulima/colorize';
3
3
  import '@visulima/interactive-manager';
4
4
  type StringAnonymize = {
@@ -1,4 +1,4 @@
1
- import { M as Meta, P as Processor } from "../packem_shared/types.d-ByY2ZuYG.js";
1
+ import { M as Meta, P as Processor } from "../packem_shared/types.d-Ck_RSjLg.js";
2
2
  import '@visulima/colorize';
3
3
  import '@visulima/interactive-manager';
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { Options } from 'rotating-file-stream';
2
- import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-Bz3lZEDi.js";
2
+ import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-Boj5w068.js";
3
3
  import 'safe-stable-stringify';
4
- import "../../packem_shared/types.d-ByY2ZuYG.js";
4
+ import "../../packem_shared/types.d-Ck_RSjLg.js";
5
5
  import '@visulima/colorize';
6
6
  import '@visulima/interactive-manager';
7
7
  /**
@@ -1,2 +1,2 @@
1
- var h=Object.defineProperty;var s=(e,t)=>h(e,"name",{value:t,configurable:!0});import{AbstractJsonReporter as n}from"../../packem_shared/AbstractJsonReporter-BawNFYxI.js";var o=Object.defineProperty,c=s((e,t)=>o(e,"name",{value:t,configurable:!0}),"e");class l{static{s(this,"n")}static{c(this,"SafeStreamHandler")}#t=!0;#e;#r;constructor(t,r){this.#e=t,this.#r=r}write(t){this.writeStream(t)}end(...t){this.#e.end(...t)}get isReady(){return this.#t}writeStream(t){if(!this.#t){console.warn(`Stream busy: ${this.#r}. Write will be dropped: "${t}"`);return}this.#t=!1,this.#e.on("error",r=>{throw r}),this.#e.on("drain",()=>{this.#t=!0}),this.#e.on("finish",()=>{this.#t=!0}),this.#t=this.#e.write(t,()=>{})}}var u=Object.defineProperty,m=s((e,t)=>u(e,"name",{value:t,configurable:!0}),"r$1");class d{static{s(this,"o")}static{m(this,"RotatingFileStream")}#t;#e;#r;#s;#i;constructor(t,r=!1,i={}){if(this.#t=t,this.#e=r,this.#s=i,!this.#e){try{this.#i=require("rotating-file-stream").createStream}catch{throw new Error("The 'rotating-file-stream' package is missing. Make sure to install the 'rotating-file-stream' package.")}this.#r=this.#i(this.#t,i)}}write(t){let r=this.#r;this.#e&&(r=this.#i(this.#t,this.#s));const i=new l(r,this.#t);i.write(t),this.#e&&i.end()}end(){this.#r!==void 0&&this.#r.end()}}var f=Object.defineProperty,p=s((e,t)=>f(e,"name",{value:t,configurable:!0}),"r");class v extends n{static{s(this,"JsonFileReporter")}static{p(this,"JsonFileReporter")}stream;constructor(t){super();const{filePath:r,writeImmediately:i=!1,...a}=t;this.stream=new d(r,i,{compress:"gzip",interval:"1d",size:"10M",...a})}_log(t){this.stream.write(`${t}
1
+ var h=Object.defineProperty;var s=(e,t)=>h(e,"name",{value:t,configurable:!0});import{AbstractJsonReporter as n}from"../../packem_shared/AbstractJsonReporter-PVC4ONf2.js";var o=Object.defineProperty,c=s((e,t)=>o(e,"name",{value:t,configurable:!0}),"e");class l{static{s(this,"n")}static{c(this,"SafeStreamHandler")}#t=!0;#e;#r;constructor(t,r){this.#e=t,this.#r=r}write(t){this.writeStream(t)}end(...t){this.#e.end(...t)}get isReady(){return this.#t}writeStream(t){if(!this.#t){console.warn(`Stream busy: ${this.#r}. Write will be dropped: "${t}"`);return}this.#t=!1,this.#e.on("error",r=>{throw r}),this.#e.on("drain",()=>{this.#t=!0}),this.#e.on("finish",()=>{this.#t=!0}),this.#t=this.#e.write(t,()=>{})}}var u=Object.defineProperty,m=s((e,t)=>u(e,"name",{value:t,configurable:!0}),"r$1");class d{static{s(this,"o")}static{m(this,"RotatingFileStream")}#t;#e;#r;#s;#i;constructor(t,r=!1,i={}){if(this.#t=t,this.#e=r,this.#s=i,!this.#e){try{this.#i=require("rotating-file-stream").createStream}catch{throw new Error("The 'rotating-file-stream' package is missing. Make sure to install the 'rotating-file-stream' package.")}this.#r=this.#i(this.#t,i)}}write(t){let r=this.#r;this.#e&&(r=this.#i(this.#t,this.#s));const i=new l(r,this.#t);i.write(t),this.#e&&i.end()}end(){this.#r!==void 0&&this.#r.end()}}var f=Object.defineProperty,p=s((e,t)=>f(e,"name",{value:t,configurable:!0}),"r");class v extends n{static{s(this,"JsonFileReporter")}static{p(this,"JsonFileReporter")}stream;constructor(t){super();const{filePath:r,writeImmediately:i=!1,...a}=t;this.stream=new d(r,i,{compress:"gzip",interval:"1d",size:"10M",...a})}_log(t){this.stream.write(`${t}
2
2
  `)}}export{v as JsonFileReporter};
@@ -1,5 +1,5 @@
1
- import { E as ExtendedRfc5424LogLevels, L as LiteralUnion, S as StringifyAwareReporter } from "../../packem_shared/types.d-ByY2ZuYG.js";
2
- import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-Bz3lZEDi.js";
1
+ import { E as ExtendedRfc5424LogLevels, L as LiteralUnion, a as StringifyAwareReporter } from "../../packem_shared/types.d-Ck_RSjLg.js";
2
+ import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-Boj5w068.js";
3
3
  import '@visulima/colorize';
4
4
  import '@visulima/interactive-manager';
5
5
  import 'safe-stable-stringify';
@@ -1,2 +1,2 @@
1
- var w=Object.defineProperty;var m=(t,e)=>w(t,"name",{value:e,configurable:!0});import{createRequire as x}from"node:module";import{AbstractJsonReporter as E}from"../../packem_shared/AbstractJsonReporter-BawNFYxI.js";const z=x(import.meta.url),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=m(t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,s]=p.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return p.getBuiltinModule(t)}return z(t)},"__cjs_getBuiltinModule"),{Buffer:y}=S("node:buffer"),{gzipSync:R}=S("node:zlib");var B=Object.defineProperty,v=m((t,e)=>B(t,"name",{value:e,configurable:!0}),"d");const D=v(async t=>{const e=globalThis.CompressionStream;if(e){const s=new e("gzip"),a=s.writable.getWriter(),i=s.readable.getReader(),r=new TextEncoder,h=[];await a.write(r.encode(t)),await a.close();let u=!1;for(;!u;){const n=await i.read();u=n.done,n.value&&h.push(n.value)}const c=h.reduce((n,b)=>n+b.length,0),o=new Uint8Array(c);let l=0;for(let n=0;n<h.length;n+=1){const b=h[n];o.set(b,l),l+=b.length}return o}return R(t)},"compressData");var P=Object.defineProperty,L=m((t,e)=>P(t,"name",{value:e,configurable:!0}),"n");class N extends Error{static{m(this,"u")}static{L(this,"LogSizeError")}logData;actualSize;maxSize;constructor(e,s,a,i){super(e),this.name="LogSizeError",this.logData=s,this.actualSize=a,this.maxSize=i}}var j=Object.defineProperty,d=m((t,e)=>j(t,"name",{value:e,configurable:!0}),"o");const g=d((t,e)=>t*2**e,"calculateBackoffDelay"),T=d(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),O=d(t=>typeof t=="string"?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),"prepareRequestBody"),_=d(async(t,e,s,a,i,r,h)=>{const u={};t.headers.forEach((l,n)=>{u[n]=l});const c=await t.text(),o={req:{body:i,headers:a,method:s,url:e},res:{body:c,headers:u,status:t.status,statusText:t.statusText}};if(r&&r(o),t.ok)return!1;if(t.status<500&&t.status!==429){const l=new Error(`HTTP ${String(t.status)}: ${t.statusText}`);throw h&&h(l),l}return!0},"processResponse"),C=d((t,e,s,a,i)=>{if(t.status===429&&e&&a<i){const r=t.headers.get("retry-after");return r?Number.parseInt(r,10)*1e3:g(s,a)}},"handleRateLimit"),q=d((t,e,s,a)=>{if(t.status>=500&&s<a)return g(e,s)},"handleServerError"),Q=d((t,e,s,a,i)=>{const r=C(t,e,s,a,i);return r!==void 0?r:q(t,s,a,i)},"calculateRetryDelay"),k=d(async(t,e,s,a,i)=>{if(e<s){const r=g(a,e);return await T(r),!0}return i&&i(t),!1},"handleRetryError"),M=d(async(t,e,s,a,i,r,h,u,c)=>{let o=0;for(;o<=i;)try{const l=O(a),n=await fetch(t,{body:l,headers:s,method:e});if(!await _(n,t,e,s,a,u,c))return;const b=Q(n,h,r,o,i);if(b!==void 0){await T(b),o+=1;continue}if(!n.ok){const f=new Error(`HTTP ${String(n.status)}: ${n.statusText}`);throw c&&c(f),f}return}catch(l){if(await k(l,o,i,r,c)){o+=1;continue}throw l}},"sendWithRetry");var F=Object.defineProperty,J=m((t,e)=>F(t,"name",{value:e,configurable:!0}),"c");class U extends E{static{m(this,"AbstractHttpReporter")}static{J(this,"AbstractHttpReporter")}url;method;headers;contentType;batchContentType;onError;onDebug;onDebugRequestResponse;payloadTemplate;compression;maxRetries;retryDelay;respectRateLimit;enableBatchSend;batchSize;batchSendTimeout;batchSendDelimiter;batchMode;batchFieldName;maxLogSize;maxPayloadSize;edgeCompat;batchQueue=[];batchTimeout;isProcessingBatch=!1;currentBatchSize=0;constructor(e){if(super(e),this.url=e.url,this.method=e.method??"POST",this.headers=e.headers??{},this.contentType=e.contentType??"application/json",this.batchContentType=e.batchContentType??"application/json",this.onError=e.onError,this.onDebug=e.onDebug,this.onDebugRequestResponse=e.onDebugRequestResponse,this.payloadTemplate=e.payloadTemplate??(s=>JSON.stringify(s)),this.compression=e.compression??!1,this.maxRetries=e.maxRetries??3,this.retryDelay=e.retryDelay??1e3,this.respectRateLimit=e.respectRateLimit??!0,this.enableBatchSend=e.enableBatchSend??!0,this.batchSize=e.batchSize??100,this.batchSendTimeout=e.batchSendTimeout??5e3,this.batchSendDelimiter=e.batchSendDelimiter??`
1
+ var w=Object.defineProperty;var m=(t,e)=>w(t,"name",{value:e,configurable:!0});import{createRequire as x}from"node:module";import{AbstractJsonReporter as E}from"../../packem_shared/AbstractJsonReporter-PVC4ONf2.js";const z=x(import.meta.url),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=m(t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,s]=p.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return p.getBuiltinModule(t)}return z(t)},"__cjs_getBuiltinModule"),{Buffer:y}=S("node:buffer"),{gzipSync:R}=S("node:zlib");var B=Object.defineProperty,v=m((t,e)=>B(t,"name",{value:e,configurable:!0}),"d");const D=v(async t=>{const e=globalThis.CompressionStream;if(e){const s=new e("gzip"),a=s.writable.getWriter(),i=s.readable.getReader(),r=new TextEncoder,h=[];await a.write(r.encode(t)),await a.close();let u=!1;for(;!u;){const n=await i.read();u=n.done,n.value&&h.push(n.value)}const c=h.reduce((n,b)=>n+b.length,0),o=new Uint8Array(c);let l=0;for(let n=0;n<h.length;n+=1){const b=h[n];o.set(b,l),l+=b.length}return o}return R(t)},"compressData");var P=Object.defineProperty,L=m((t,e)=>P(t,"name",{value:e,configurable:!0}),"n");class N extends Error{static{m(this,"u")}static{L(this,"LogSizeError")}logData;actualSize;maxSize;constructor(e,s,a,i){super(e),this.name="LogSizeError",this.logData=s,this.actualSize=a,this.maxSize=i}}var j=Object.defineProperty,d=m((t,e)=>j(t,"name",{value:e,configurable:!0}),"o");const g=d((t,e)=>t*2**e,"calculateBackoffDelay"),T=d(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),O=d(t=>typeof t=="string"?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),"prepareRequestBody"),_=d(async(t,e,s,a,i,r,h)=>{const u={};t.headers.forEach((l,n)=>{u[n]=l});const c=await t.text(),o={req:{body:i,headers:a,method:s,url:e},res:{body:c,headers:u,status:t.status,statusText:t.statusText}};if(r&&r(o),t.ok)return!1;if(t.status<500&&t.status!==429){const l=new Error(`HTTP ${String(t.status)}: ${t.statusText}`);throw h&&h(l),l}return!0},"processResponse"),C=d((t,e,s,a,i)=>{if(t.status===429&&e&&a<i){const r=t.headers.get("retry-after");return r?Number.parseInt(r,10)*1e3:g(s,a)}},"handleRateLimit"),q=d((t,e,s,a)=>{if(t.status>=500&&s<a)return g(e,s)},"handleServerError"),Q=d((t,e,s,a,i)=>{const r=C(t,e,s,a,i);return r!==void 0?r:q(t,s,a,i)},"calculateRetryDelay"),k=d(async(t,e,s,a,i)=>{if(e<s){const r=g(a,e);return await T(r),!0}return i&&i(t),!1},"handleRetryError"),M=d(async(t,e,s,a,i,r,h,u,c)=>{let o=0;for(;o<=i;)try{const l=O(a),n=await fetch(t,{body:l,headers:s,method:e});if(!await _(n,t,e,s,a,u,c))return;const b=Q(n,h,r,o,i);if(b!==void 0){await T(b),o+=1;continue}if(!n.ok){const f=new Error(`HTTP ${String(n.status)}: ${n.statusText}`);throw c&&c(f),f}return}catch(l){if(await k(l,o,i,r,c)){o+=1;continue}throw l}},"sendWithRetry");var F=Object.defineProperty,J=m((t,e)=>F(t,"name",{value:e,configurable:!0}),"c");class U extends E{static{m(this,"AbstractHttpReporter")}static{J(this,"AbstractHttpReporter")}url;method;headers;contentType;batchContentType;onError;onDebug;onDebugRequestResponse;payloadTemplate;compression;maxRetries;retryDelay;respectRateLimit;enableBatchSend;batchSize;batchSendTimeout;batchSendDelimiter;batchMode;batchFieldName;maxLogSize;maxPayloadSize;edgeCompat;batchQueue=[];batchTimeout;isProcessingBatch=!1;currentBatchSize=0;constructor(e){if(super(e),this.url=e.url,this.method=e.method??"POST",this.headers=e.headers??{},this.contentType=e.contentType??"application/json",this.batchContentType=e.batchContentType??"application/json",this.onError=e.onError,this.onDebug=e.onDebug,this.onDebugRequestResponse=e.onDebugRequestResponse,this.payloadTemplate=e.payloadTemplate??(s=>JSON.stringify(s)),this.compression=e.compression??!1,this.maxRetries=e.maxRetries??3,this.retryDelay=e.retryDelay??1e3,this.respectRateLimit=e.respectRateLimit??!0,this.enableBatchSend=e.enableBatchSend??!0,this.batchSize=e.batchSize??100,this.batchSendTimeout=e.batchSendTimeout??5e3,this.batchSendDelimiter=e.batchSendDelimiter??`
2
2
  `,this.batchMode=e.batchMode??"delimiter",this.batchFieldName=e.batchFieldName,this.batchMode==="field"&&!this.batchFieldName)throw new Error("batchFieldName is required when batchMode is 'field'");this.maxLogSize=e.maxLogSize??1048576,this.maxPayloadSize=e.maxPayloadSize??5242880,this.edgeCompat=e.edgeCompat??!1}_log(e,s){try{const a=JSON.parse(e),i=s,r=a.message,h={logLevel:i,message:r??""};if(a.data)h.data=a.data;else if(a.context)h.data=a.context;else{const o={...a};delete o.message,Object.keys(o).length>0&&(h.data=o)}const u=this.payloadTemplate(h);this.onDebug&&this.onDebug({data:h.data,logLevel:i,message:r});const c=this.edgeCompat||typeof TextEncoder>"u"?y.byteLength(u,"utf8"):new TextEncoder().encode(u).length;if(c>this.maxLogSize){const o=new N(`Log entry exceeds maximum size of ${String(this.maxLogSize)} bytes. Size: ${String(c)} bytes`,{data:h.data,logLevel:i,message:r},c,this.maxLogSize);this.onError&&this.onError(o);return}this.enableBatchSend?this.addToBatch(u,c):this.sendPayload(u).catch(o=>{this.onError&&this.onError(o)})}catch(a){this.onError&&this.onError(a)}}addToBatch(e,s){const a=this.currentBatchSize+s+this.batchSendDelimiter.length,i=this.maxPayloadSize*.9;a>i&&this.batchQueue.length>0&&this.processBatch(),this.batchQueue.push(e),this.currentBatchSize+=s+this.batchSendDelimiter.length,this.batchTimeout??=setTimeout(()=>{this.processBatch()},this.batchSendTimeout),this.batchQueue.length>=this.batchSize&&this.processBatch()}async processBatch(){if(this.isProcessingBatch||this.batchQueue.length===0)return;this.isProcessingBatch=!0,this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=void 0);const e=this.batchQueue.splice(0,this.batchSize);this.currentBatchSize=0;for(let s=0;s<this.batchQueue.length;s+=1){const a=this.batchQueue[s],i=this.edgeCompat||typeof TextEncoder>"u"?y.byteLength(a,"utf8"):new TextEncoder().encode(a).length;this.currentBatchSize+=i+(s<this.batchQueue.length-1?this.batchSendDelimiter.length:0)}try{await this.sendBatch(e)}catch(s){this.onError&&this.onError(s)}finally{this.isProcessingBatch=!1,this.batchQueue.length>0&&this.processBatch()}}async sendBatch(e){let s;switch(this.batchMode){case"array":{const a=e.map(i=>JSON.parse(i));s=JSON.stringify(a);break}case"field":{const a=e.map(r=>JSON.parse(r)),i=this.batchFieldName?{[this.batchFieldName]:a}:{};s=JSON.stringify(i);break}default:{s=e.join(this.batchSendDelimiter);break}}await this.sendPayload(s,this.batchContentType)}async sendPayload(e,s){const a=typeof this.headers=="function"?this.headers():{...this.headers};a["content-type"]??=s??this.contentType;let i=e;if(this.compression&&!this.edgeCompat)try{i=await D(e),a["content-encoding"]="gzip"}catch(r){this.onError&&this.onError(new Error(`Compression failed: ${String(r)}`))}await M(this.url,this.method,a,i,this.maxRetries,this.retryDelay,this.respectRateLimit,this.onDebugRequestResponse,this.onError)}}export{U as AbstractHttpReporter};
@@ -1,8 +1,8 @@
1
1
  import { AbstractHttpReporterOptions, AbstractHttpReporter } from "./abstract-http-reporter.js";
2
- import "../../packem_shared/types.d-ByY2ZuYG.js";
2
+ import "../../packem_shared/types.d-Ck_RSjLg.js";
3
3
  import '@visulima/colorize';
4
4
  import '@visulima/interactive-manager';
5
- import "../../packem_shared/abstract-json-reporter.d-Bz3lZEDi.js";
5
+ import "../../packem_shared/abstract-json-reporter.d-Boj5w068.js";
6
6
  import 'safe-stable-stringify';
7
7
  /**
8
8
  * HTTP Reporter.
@@ -1,2 +1,2 @@
1
- var D=Object.defineProperty;var b=(e,t)=>D(e,"name",{value:t,configurable:!0});import{createRequire as N}from"node:module";const R=N(import.meta.url),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=b(e=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[t,a]=p.versions.node.split(".").map(Number);if(t>22||t===22&&a>=3||t===20&&a>=16)return p.getBuiltinModule(e)}return R(e)},"__cjs_getBuiltinModule"),{Buffer:T}=j("node:buffer"),{gzipSync:B}=j("node:zlib");var L=Object.defineProperty,$=b((e,t)=>L(e,"name",{value:t,configurable:!0}),"e$1");function P(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}b(P,"r");$(P,"isPlainObject");var J=Object.defineProperty,m=b((e,t)=>J(e,"name",{value:t,configurable:!0}),"i");const _=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}}),g=new WeakSet,E=m(e=>{const t=Object.getOwnPropertyNames(e);for(const a of t){const r=Object.getOwnPropertyDescriptor(e,a);r&&(r.enumerable||Object.defineProperty(e,a,{...r,enumerable:!0}),r.value&&typeof r.value=="object"&&!Array.isArray(r.value)&&(Object.getPrototypeOf(r.value)===Object.prototype||Object.getPrototypeOf(r.value)===null)&&E(r.value))}},"makePropertiesEnumerable"),A=m(e=>{g.add(e);const t=e.toJSON();return g.delete(e),Object.isExtensible(t)&&E(t),t},"toJSON"),S=m((e,t,a,r)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return t.has(e)?"[Circular]":(a+=1,y(e,r,t,a));if(r.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(P(e)){if(r.maxDepth!==void 0&&r.maxDepth!==Number.POSITIVE_INFINITY&&a+1>=r.maxDepth)return{};a+=1;const s={};for(const i in e)s[i]=S(e[i],t,a,r);return s}try{return e}catch{return"[Not Available]"}},"serializeValue"),y=m((e,t,a,r)=>{if(a.add(e),t.maxDepth===0)return{};if(t.useToJSON&&typeof e.toJSON=="function"&&!g.has(e))return A(e);const s=Object.create(_);if(Object.defineProperty(s,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(s,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(s,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const o=[];for(const n of e.errors){if(!(n instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(a.has(n))return Object.defineProperty(s,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),s;o.push(y(n,t,a,r))}Object.defineProperty(s,"errors",{configurable:!0,enumerable:!0,value:o,writable:!0})}const i=e.cause;if(i!=null)if(i instanceof Error)a.has(i)?Object.defineProperty(s,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(s,"cause",{configurable:!0,enumerable:!0,value:y(i,t,a,r),writable:!0});else{const o=S(i,a,r,t);Object.defineProperty(s,"cause",{configurable:!0,enumerable:!0,value:o,writable:!0})}for(const o in e){if(o==="name"||o==="message"||o==="stack"||o==="cause"||o==="errors")continue;const n=e[o],u=S(n,a,r,t);Object.defineProperty(s,o,{configurable:!0,enumerable:!0,value:u,writable:!0})}if(Array.isArray(t.exclude)&&t.exclude.length>0)for(const o of t.exclude)try{delete s[o]}catch{}return s},"_serialize"),w=m((e,t={})=>y(e,{exclude:t.exclude??[],maxDepth:t.maxDepth??Number.POSITIVE_INFINITY,useToJSON:t.useToJSON??!1},new Set,0),"serialize"),x=Symbol("EMPTY");var C=Object.defineProperty,k=b((e,t)=>C(e,"name",{value:t,configurable:!0}),"f");class I{static{b(this,"AbstractJsonReporter")}static{k(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(t={}){this.errorOptions=t.error??{}}setStringify(t){this.stringify=t}log(t){const{context:a,error:r,file:s,message:i,type:o,...n}=t;if(n.label&&(n.label=n.label.trim()),s&&(n.file=`${s.name??""}:${String(s.line)}${s.column?`:${String(s.column)}`:""}`),n.message=i===x?void 0:i,r&&(n.error=w(r,this.errorOptions)),a){const u=[];for(let c=0;c<a.length;c+=1){const l=a[c];l!==x&&(l instanceof Error?u.push(w(l,this.errorOptions)):u.push(l))}n.context=u}this._log(this.stringify(n),o.level)}}var q=Object.defineProperty,F=b((e,t)=>q(e,"name",{value:t,configurable:!0}),"d");const M=F(async e=>{const t=globalThis.CompressionStream;if(t){const a=new t("gzip"),r=a.writable.getWriter(),s=a.readable.getReader(),i=new TextEncoder,o=[];await r.write(i.encode(e)),await r.close();let n=!1;for(;!n;){const h=await s.read();n=h.done,h.value&&o.push(h.value)}const u=o.reduce((h,d)=>h+d.length,0),c=new Uint8Array(u);let l=0;for(let h=0;h<o.length;h+=1){const d=o[h];c.set(d,l),l+=d.length}return c}return B(e)},"compressData");var Q=Object.defineProperty,H=b((e,t)=>Q(e,"name",{value:t,configurable:!0}),"n");class Y extends Error{static{b(this,"u")}static{H(this,"LogSizeError")}logData;actualSize;maxSize;constructor(t,a,r,s){super(t),this.name="LogSizeError",this.logData=a,this.actualSize=r,this.maxSize=s}}var U=Object.defineProperty,f=b((e,t)=>U(e,"name",{value:t,configurable:!0}),"o");const v=f((e,t)=>e*2**t,"calculateBackoffDelay"),z=f(e=>new Promise(t=>{setTimeout(t,e)}),"sleep"),V=f(e=>typeof e=="string"?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"prepareRequestBody"),W=f(async(e,t,a,r,s,i,o)=>{const n={};e.headers.forEach((l,h)=>{n[h]=l});const u=await e.text(),c={req:{body:s,headers:r,method:a,url:t},res:{body:u,headers:n,status:e.status,statusText:e.statusText}};if(i&&i(c),e.ok)return!1;if(e.status<500&&e.status!==429){const l=new Error(`HTTP ${String(e.status)}: ${e.statusText}`);throw o&&o(l),l}return!0},"processResponse"),G=f((e,t,a,r,s)=>{if(e.status===429&&t&&r<s){const i=e.headers.get("retry-after");return i?Number.parseInt(i,10)*1e3:v(a,r)}},"handleRateLimit"),K=f((e,t,a,r)=>{if(e.status>=500&&a<r)return v(t,a)},"handleServerError"),X=f((e,t,a,r,s)=>{const i=G(e,t,a,r,s);return i!==void 0?i:K(e,a,r,s)},"calculateRetryDelay"),Z=f(async(e,t,a,r,s)=>{if(t<a){const i=v(r,t);return await z(i),!0}return s&&s(e),!1},"handleRetryError"),ee=f(async(e,t,a,r,s,i,o,n,u)=>{let c=0;for(;c<=s;)try{const l=V(r),h=await fetch(e,{body:l,headers:a,method:t});if(!await W(h,e,t,a,r,n,u))return;const d=X(h,o,i,c,s);if(d!==void 0){await z(d),c+=1;continue}if(!h.ok){const O=new Error(`HTTP ${String(h.status)}: ${h.statusText}`);throw u&&u(O),O}return}catch(l){if(await Z(l,c,s,i,u)){c+=1;continue}throw l}},"sendWithRetry");var te=Object.defineProperty,re=b((e,t)=>te(e,"name",{value:t,configurable:!0}),"c");class ae extends I{static{b(this,"AbstractHttpReporter")}static{re(this,"AbstractHttpReporter")}url;method;headers;contentType;batchContentType;onError;onDebug;onDebugRequestResponse;payloadTemplate;compression;maxRetries;retryDelay;respectRateLimit;enableBatchSend;batchSize;batchSendTimeout;batchSendDelimiter;batchMode;batchFieldName;maxLogSize;maxPayloadSize;edgeCompat;batchQueue=[];batchTimeout;isProcessingBatch=!1;currentBatchSize=0;constructor(t){if(super(t),this.url=t.url,this.method=t.method??"POST",this.headers=t.headers??{},this.contentType=t.contentType??"application/json",this.batchContentType=t.batchContentType??"application/json",this.onError=t.onError,this.onDebug=t.onDebug,this.onDebugRequestResponse=t.onDebugRequestResponse,this.payloadTemplate=t.payloadTemplate??(a=>JSON.stringify(a)),this.compression=t.compression??!1,this.maxRetries=t.maxRetries??3,this.retryDelay=t.retryDelay??1e3,this.respectRateLimit=t.respectRateLimit??!0,this.enableBatchSend=t.enableBatchSend??!0,this.batchSize=t.batchSize??100,this.batchSendTimeout=t.batchSendTimeout??5e3,this.batchSendDelimiter=t.batchSendDelimiter??`
2
- `,this.batchMode=t.batchMode??"delimiter",this.batchFieldName=t.batchFieldName,this.batchMode==="field"&&!this.batchFieldName)throw new Error("batchFieldName is required when batchMode is 'field'");this.maxLogSize=t.maxLogSize??1048576,this.maxPayloadSize=t.maxPayloadSize??5242880,this.edgeCompat=t.edgeCompat??!1}_log(t,a){try{const r=JSON.parse(t),s=a,i=r.message,o={logLevel:s,message:i??""};if(r.data)o.data=r.data;else if(r.context)o.data=r.context;else{const c={...r};delete c.message,Object.keys(c).length>0&&(o.data=c)}const n=this.payloadTemplate(o);this.onDebug&&this.onDebug({data:o.data,logLevel:s,message:i});const u=this.edgeCompat||typeof TextEncoder>"u"?T.byteLength(n,"utf8"):new TextEncoder().encode(n).length;if(u>this.maxLogSize){const c=new Y(`Log entry exceeds maximum size of ${String(this.maxLogSize)} bytes. Size: ${String(u)} bytes`,{data:o.data,logLevel:s,message:i},u,this.maxLogSize);this.onError&&this.onError(c);return}this.enableBatchSend?this.addToBatch(n,u):this.sendPayload(n).catch(c=>{this.onError&&this.onError(c)})}catch(r){this.onError&&this.onError(r)}}addToBatch(t,a){const r=this.currentBatchSize+a+this.batchSendDelimiter.length,s=this.maxPayloadSize*.9;r>s&&this.batchQueue.length>0&&this.processBatch(),this.batchQueue.push(t),this.currentBatchSize+=a+this.batchSendDelimiter.length,this.batchTimeout??=setTimeout(()=>{this.processBatch()},this.batchSendTimeout),this.batchQueue.length>=this.batchSize&&this.processBatch()}async processBatch(){if(this.isProcessingBatch||this.batchQueue.length===0)return;this.isProcessingBatch=!0,this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=void 0);const t=this.batchQueue.splice(0,this.batchSize);this.currentBatchSize=0;for(let a=0;a<this.batchQueue.length;a+=1){const r=this.batchQueue[a],s=this.edgeCompat||typeof TextEncoder>"u"?T.byteLength(r,"utf8"):new TextEncoder().encode(r).length;this.currentBatchSize+=s+(a<this.batchQueue.length-1?this.batchSendDelimiter.length:0)}try{await this.sendBatch(t)}catch(a){this.onError&&this.onError(a)}finally{this.isProcessingBatch=!1,this.batchQueue.length>0&&this.processBatch()}}async sendBatch(t){let a;switch(this.batchMode){case"array":{const r=t.map(s=>JSON.parse(s));a=JSON.stringify(r);break}case"field":{const r=t.map(i=>JSON.parse(i)),s=this.batchFieldName?{[this.batchFieldName]:r}:{};a=JSON.stringify(s);break}default:{a=t.join(this.batchSendDelimiter);break}}await this.sendPayload(a,this.batchContentType)}async sendPayload(t,a){const r=typeof this.headers=="function"?this.headers():{...this.headers};r["content-type"]??=a??this.contentType;let s=t;if(this.compression&&!this.edgeCompat)try{s=await M(t),r["content-encoding"]="gzip"}catch(i){this.onError&&this.onError(new Error(`Compression failed: ${String(i)}`))}await ee(this.url,this.method,r,s,this.maxRetries,this.retryDelay,this.respectRateLimit,this.onDebugRequestResponse,this.onError)}}var se=Object.defineProperty,ie=b((e,t)=>se(e,"name",{value:t,configurable:!0}),"e");class ce extends ae{static{b(this,"s")}static{ie(this,"HttpReporterEdgeLight")}constructor(t){super({...t,edgeCompat:!0})}}export{ce as default};
1
+ var z=Object.defineProperty;var b=(t,e)=>z(t,"name",{value:e,configurable:!0});import{createRequire as D}from"node:module";const N=D(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,P=b(t=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[e,a]=m.versions.node.split(".").map(Number);if(e>22||e===22&&a>=3||e===20&&a>=16)return m.getBuiltinModule(t)}return N(t)},"__cjs_getBuiltinModule"),{Buffer:w}=P("node:buffer"),{gzipSync:R}=P("node:zlib");var B=Object.defineProperty,$=b((t,e)=>B(t,"name",{value:e,configurable:!0}),"f$1"),L=Object.defineProperty,J=$((t,e)=>L(t,"name",{value:e,configurable:!0}),"b");const _=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}});var A=Object.defineProperty,p=J((t,e)=>A(t,"name",{value:e,configurable:!0}),"i");const C=p(t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null},"isPlainObject"),g=new WeakSet,x=p(t=>{const e=Object.getOwnPropertyNames(t);for(const a of e){const r=Object.getOwnPropertyDescriptor(t,a);r&&(r.enumerable||Object.defineProperty(t,a,{...r,enumerable:!0}),r.value&&typeof r.value=="object"&&!Array.isArray(r.value)&&(Object.getPrototypeOf(r.value)===Object.prototype||Object.getPrototypeOf(r.value)===null)&&x(r.value))}},"makePropertiesEnumerable"),k=p(t=>{g.add(t);const e=t.toJSON();return g.delete(t),Object.isExtensible(e)&&x(e),e},"toJSON"),S=p((t,e,a,r)=>{if(t&&t instanceof Uint8Array&&t.constructor.name==="Buffer")return"[object Buffer]";if(t!==null&&typeof t=="object"&&"pipe"in t&&typeof t.pipe=="function")return"[object Stream]";if(t instanceof Error)return e.has(t)?"[Circular]":(a+=1,y(t,r,e,a));if(r.useToJSON&&t!==null&&typeof t=="object"&&"toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();if(t instanceof Date)return t.toISOString();if(typeof t=="function")return`[Function: ${t.name||"anonymous"}]`;if(typeof t=="bigint")return`${String(t)}n`;if(C(t)){if(r.maxDepth!==void 0&&r.maxDepth!==Number.POSITIVE_INFINITY&&a+1>=r.maxDepth)return{};a+=1;const s={};for(const i in t)s[i]=S(t[i],e,a,r);return s}try{return t}catch{return"[Not Available]"}},"serializeValue"),y=p((t,e,a,r)=>{if(a.add(t),e.maxDepth===0)return{};if(e.useToJSON&&typeof t.toJSON=="function"&&!g.has(t))return k(t);const s=Object.create(_);if(Object.defineProperty(s,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,writable:!0}),Object.defineProperty(s,"message",{configurable:!0,enumerable:!0,value:t.message,writable:!0}),Object.defineProperty(s,"stack",{configurable:!0,enumerable:!0,value:t.stack,writable:!0}),Array.isArray(t.errors)){const o=[];for(const n of t.errors){if(!(n instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(a.has(n))return Object.defineProperty(s,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),s;o.push(y(n,e,a,r))}Object.defineProperty(s,"errors",{configurable:!0,enumerable:!0,value:o,writable:!0})}const i=t.cause;if(i!=null)if(i instanceof Error)a.has(i)?Object.defineProperty(s,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(s,"cause",{configurable:!0,enumerable:!0,value:y(i,e,a,r),writable:!0});else{const o=S(i,a,r,e);Object.defineProperty(s,"cause",{configurable:!0,enumerable:!0,value:o,writable:!0})}for(const o in t){if(o==="name"||o==="message"||o==="stack"||o==="cause"||o==="errors")continue;const n=t[o],u=S(n,a,r,e);Object.defineProperty(s,o,{configurable:!0,enumerable:!0,value:u,writable:!0})}if(Array.isArray(e.exclude)&&e.exclude.length>0)for(const o of e.exclude)try{delete s[o]}catch{}return s},"_serialize"),T=p((t,e={})=>y(t,{exclude:e.exclude??[],maxDepth:e.maxDepth??Number.POSITIVE_INFINITY,useToJSON:e.useToJSON??!1},new Set,0),"serialize"),j=Symbol("EMPTY");var I=Object.defineProperty,q=b((t,e)=>I(t,"name",{value:e,configurable:!0}),"f");class F{static{b(this,"AbstractJsonReporter")}static{q(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(e={}){this.errorOptions=e.error??{}}setStringify(e){this.stringify=e}log(e){const{context:a,error:r,file:s,message:i,type:o,...n}=e;if(n.label&&(n.label=n.label.trim()),s&&(n.file=`${s.name??""}:${String(s.line)}${s.column?`:${String(s.column)}`:""}`),n.message=i===j?void 0:i,r&&(n.error=T(r,this.errorOptions)),a){const u=[];for(let c=0;c<a.length;c+=1){const l=a[c];l!==j&&(l instanceof Error?u.push(T(l,this.errorOptions)):u.push(l))}n.context=u}this._log(this.stringify(n),o.level)}}var M=Object.defineProperty,Q=b((t,e)=>M(t,"name",{value:e,configurable:!0}),"d");const H=Q(async t=>{const e=globalThis.CompressionStream;if(e){const a=new e("gzip"),r=a.writable.getWriter(),s=a.readable.getReader(),i=new TextEncoder,o=[];await r.write(i.encode(t)),await r.close();let n=!1;for(;!n;){const h=await s.read();n=h.done,h.value&&o.push(h.value)}const u=o.reduce((h,d)=>h+d.length,0),c=new Uint8Array(u);let l=0;for(let h=0;h<o.length;h+=1){const d=o[h];c.set(d,l),l+=d.length}return c}return R(t)},"compressData");var Y=Object.defineProperty,U=b((t,e)=>Y(t,"name",{value:e,configurable:!0}),"n");class V extends Error{static{b(this,"u")}static{U(this,"LogSizeError")}logData;actualSize;maxSize;constructor(e,a,r,s){super(e),this.name="LogSizeError",this.logData=a,this.actualSize=r,this.maxSize=s}}var W=Object.defineProperty,f=b((t,e)=>W(t,"name",{value:e,configurable:!0}),"o");const v=f((t,e)=>t*2**e,"calculateBackoffDelay"),E=f(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),G=f(t=>typeof t=="string"?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),"prepareRequestBody"),K=f(async(t,e,a,r,s,i,o)=>{const n={};t.headers.forEach((l,h)=>{n[h]=l});const u=await t.text(),c={req:{body:s,headers:r,method:a,url:e},res:{body:u,headers:n,status:t.status,statusText:t.statusText}};if(i&&i(c),t.ok)return!1;if(t.status<500&&t.status!==429){const l=new Error(`HTTP ${String(t.status)}: ${t.statusText}`);throw o&&o(l),l}return!0},"processResponse"),X=f((t,e,a,r,s)=>{if(t.status===429&&e&&r<s){const i=t.headers.get("retry-after");return i?Number.parseInt(i,10)*1e3:v(a,r)}},"handleRateLimit"),Z=f((t,e,a,r)=>{if(t.status>=500&&a<r)return v(e,a)},"handleServerError"),ee=f((t,e,a,r,s)=>{const i=X(t,e,a,r,s);return i!==void 0?i:Z(t,a,r,s)},"calculateRetryDelay"),te=f(async(t,e,a,r,s)=>{if(e<a){const i=v(r,e);return await E(i),!0}return s&&s(t),!1},"handleRetryError"),re=f(async(t,e,a,r,s,i,o,n,u)=>{let c=0;for(;c<=s;)try{const l=G(r),h=await fetch(t,{body:l,headers:a,method:e});if(!await K(h,t,e,a,r,n,u))return;const d=ee(h,o,i,c,s);if(d!==void 0){await E(d),c+=1;continue}if(!h.ok){const O=new Error(`HTTP ${String(h.status)}: ${h.statusText}`);throw u&&u(O),O}return}catch(l){if(await te(l,c,s,i,u)){c+=1;continue}throw l}},"sendWithRetry");var ae=Object.defineProperty,se=b((t,e)=>ae(t,"name",{value:e,configurable:!0}),"c");class ie extends F{static{b(this,"AbstractHttpReporter")}static{se(this,"AbstractHttpReporter")}url;method;headers;contentType;batchContentType;onError;onDebug;onDebugRequestResponse;payloadTemplate;compression;maxRetries;retryDelay;respectRateLimit;enableBatchSend;batchSize;batchSendTimeout;batchSendDelimiter;batchMode;batchFieldName;maxLogSize;maxPayloadSize;edgeCompat;batchQueue=[];batchTimeout;isProcessingBatch=!1;currentBatchSize=0;constructor(e){if(super(e),this.url=e.url,this.method=e.method??"POST",this.headers=e.headers??{},this.contentType=e.contentType??"application/json",this.batchContentType=e.batchContentType??"application/json",this.onError=e.onError,this.onDebug=e.onDebug,this.onDebugRequestResponse=e.onDebugRequestResponse,this.payloadTemplate=e.payloadTemplate??(a=>JSON.stringify(a)),this.compression=e.compression??!1,this.maxRetries=e.maxRetries??3,this.retryDelay=e.retryDelay??1e3,this.respectRateLimit=e.respectRateLimit??!0,this.enableBatchSend=e.enableBatchSend??!0,this.batchSize=e.batchSize??100,this.batchSendTimeout=e.batchSendTimeout??5e3,this.batchSendDelimiter=e.batchSendDelimiter??`
2
+ `,this.batchMode=e.batchMode??"delimiter",this.batchFieldName=e.batchFieldName,this.batchMode==="field"&&!this.batchFieldName)throw new Error("batchFieldName is required when batchMode is 'field'");this.maxLogSize=e.maxLogSize??1048576,this.maxPayloadSize=e.maxPayloadSize??5242880,this.edgeCompat=e.edgeCompat??!1}_log(e,a){try{const r=JSON.parse(e),s=a,i=r.message,o={logLevel:s,message:i??""};if(r.data)o.data=r.data;else if(r.context)o.data=r.context;else{const c={...r};delete c.message,Object.keys(c).length>0&&(o.data=c)}const n=this.payloadTemplate(o);this.onDebug&&this.onDebug({data:o.data,logLevel:s,message:i});const u=this.edgeCompat||typeof TextEncoder>"u"?w.byteLength(n,"utf8"):new TextEncoder().encode(n).length;if(u>this.maxLogSize){const c=new V(`Log entry exceeds maximum size of ${String(this.maxLogSize)} bytes. Size: ${String(u)} bytes`,{data:o.data,logLevel:s,message:i},u,this.maxLogSize);this.onError&&this.onError(c);return}this.enableBatchSend?this.addToBatch(n,u):this.sendPayload(n).catch(c=>{this.onError&&this.onError(c)})}catch(r){this.onError&&this.onError(r)}}addToBatch(e,a){const r=this.currentBatchSize+a+this.batchSendDelimiter.length,s=this.maxPayloadSize*.9;r>s&&this.batchQueue.length>0&&this.processBatch(),this.batchQueue.push(e),this.currentBatchSize+=a+this.batchSendDelimiter.length,this.batchTimeout??=setTimeout(()=>{this.processBatch()},this.batchSendTimeout),this.batchQueue.length>=this.batchSize&&this.processBatch()}async processBatch(){if(this.isProcessingBatch||this.batchQueue.length===0)return;this.isProcessingBatch=!0,this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=void 0);const e=this.batchQueue.splice(0,this.batchSize);this.currentBatchSize=0;for(let a=0;a<this.batchQueue.length;a+=1){const r=this.batchQueue[a],s=this.edgeCompat||typeof TextEncoder>"u"?w.byteLength(r,"utf8"):new TextEncoder().encode(r).length;this.currentBatchSize+=s+(a<this.batchQueue.length-1?this.batchSendDelimiter.length:0)}try{await this.sendBatch(e)}catch(a){this.onError&&this.onError(a)}finally{this.isProcessingBatch=!1,this.batchQueue.length>0&&this.processBatch()}}async sendBatch(e){let a;switch(this.batchMode){case"array":{const r=e.map(s=>JSON.parse(s));a=JSON.stringify(r);break}case"field":{const r=e.map(i=>JSON.parse(i)),s=this.batchFieldName?{[this.batchFieldName]:r}:{};a=JSON.stringify(s);break}default:{a=e.join(this.batchSendDelimiter);break}}await this.sendPayload(a,this.batchContentType)}async sendPayload(e,a){const r=typeof this.headers=="function"?this.headers():{...this.headers};r["content-type"]??=a??this.contentType;let s=e;if(this.compression&&!this.edgeCompat)try{s=await H(e),r["content-encoding"]="gzip"}catch(i){this.onError&&this.onError(new Error(`Compression failed: ${String(i)}`))}await re(this.url,this.method,r,s,this.maxRetries,this.retryDelay,this.respectRateLimit,this.onDebugRequestResponse,this.onError)}}var oe=Object.defineProperty,ne=b((t,e)=>oe(t,"name",{value:e,configurable:!0}),"e");class le extends ie{static{b(this,"s")}static{ne(this,"HttpReporterEdgeLight")}constructor(e){super({...e,edgeCompat:!0})}}export{le as default};
@@ -1 +1 @@
1
- import{AbstractJsonReporter as e}from"../../packem_shared/AbstractJsonReporter-Dt5-5x2R.js";import{default as p}from"../../packem_shared/JsonReporter-CerNvhg-.js";export{e as AbstractJsonReporter,p as JsonReporter};
1
+ import{AbstractJsonReporter as e}from"../../packem_shared/AbstractJsonReporter-D_Pb6kpB.js";import{default as p}from"../../packem_shared/JsonReporter-CE-lw7R0.js";export{e as AbstractJsonReporter,p as JsonReporter};
@@ -1,5 +1,5 @@
1
- import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-Bz3lZEDi.js";
2
- import { E as ExtendedRfc5424LogLevels, L as LiteralUnion, a as StreamAwareReporter } from "../../packem_shared/types.d-ByY2ZuYG.js";
1
+ import { A as AbstractJsonReporterOptions, a as AbstractJsonReporter } from "../../packem_shared/abstract-json-reporter.d-Boj5w068.js";
2
+ import { E as ExtendedRfc5424LogLevels, L as LiteralUnion, S as StreamAwareReporter } from "../../packem_shared/types.d-Ck_RSjLg.js";
3
3
  import 'safe-stable-stringify';
4
4
  import '@visulima/colorize';
5
5
  import '@visulima/interactive-manager';
@@ -1 +1 @@
1
- import{AbstractJsonReporter as e}from"../../packem_shared/AbstractJsonReporter-BawNFYxI.js";import{default as p}from"../../packem_shared/JsonReporter-15ln04rX.js";export{e as AbstractJsonReporter,p as JsonReporter};
1
+ import{AbstractJsonReporter as e}from"../../packem_shared/AbstractJsonReporter-PVC4ONf2.js";import{default as p}from"../../packem_shared/JsonReporter-BEEmb0W4.js";export{e as AbstractJsonReporter,p as JsonReporter};
@@ -1,7 +1,40 @@
1
- import { RenderErrorOptions } from '@visulima/error/error';
2
1
  import { InteractiveManager } from '@visulima/interactive-manager';
3
- import { D as DefaultLogTypes, L as LiteralUnion$1, b as LoggerTypesConfig, R as ReadonlyMeta, f as LoggerTypesAwareReporter, E as ExtendedRfc5424LogLevels, I as InteractiveStreamReporter } from "../../packem_shared/types.d-ByY2ZuYG.js";
2
+ 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-Ck_RSjLg.js";
4
3
  import '@visulima/colorize';
4
+ type ColorizeMethod = (value: string) => string;
5
+ type CodeFrameOptions = {
6
+ color?: {
7
+ gutter?: ColorizeMethod;
8
+ marker?: ColorizeMethod;
9
+ message?: ColorizeMethod;
10
+ };
11
+ linesAbove?: number;
12
+ linesBelow?: number;
13
+ message?: string;
14
+ prefix?: string;
15
+ showGutter?: boolean;
16
+ showLineNumbers?: boolean;
17
+ tabWidth?: number | false;
18
+ };
19
+ type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
20
+ color: CodeFrameOptions["color"] & {
21
+ fileLine: ColorizeMethod;
22
+ hint: ColorizeMethod;
23
+ method: ColorizeMethod;
24
+ title: ColorizeMethod;
25
+ };
26
+ cwd: string;
27
+ displayShortPath: boolean;
28
+ filterStacktrace: ((line: string) => boolean) | undefined;
29
+ framesMaxLimit: number;
30
+ hideErrorCauseCodeView: boolean;
31
+ hideErrorCodeView: boolean;
32
+ hideErrorErrorsCodeView: boolean;
33
+ hideErrorTitle: boolean;
34
+ hideMessage: boolean;
35
+ indentation: number | " ";
36
+ prefix: string;
37
+ };
5
38
  /**
6
39
  Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
7
40
 
@@ -125,7 +158,7 @@ type PrettyStyleOptions = {
125
158
  */
126
159
  type PrettyReporterOptions = PrettyStyleOptions & {
127
160
  /** Error rendering options */
128
- error: Partial<Omit<RenderErrorOptions, "color" | "prefix" | "indentation">>;
161
+ error: Partial<Omit<Options$1, "color" | "prefix" | "indentation">>;
129
162
  /** Object inspection options */
130
163
  inspect: Partial<Options>;
131
164
  };
@@ -1 +1 @@
1
- import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-CgXnwIip.js";export{t as PrettyReporter};
1
+ import{PrettyReporter as t}from"../../packem_shared/PrettyReporter-N7FvHzl5.js";export{t as PrettyReporter};
@@ -32,7 +32,7 @@ type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
32
32
  hideErrorErrorsCodeView: boolean;
33
33
  hideErrorTitle: boolean;
34
34
  hideMessage: boolean;
35
- indentation: number | "\t";
35
+ indentation: number | " ";
36
36
  prefix: string;
37
37
  };
38
38
  /**
@@ -1,8 +1,8 @@
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 W,u as G,i as H,O as K,b as Q,s as Z,o as d,c as J,a as N,p as C,d as U,B as X,R as S}from"../../packem_shared/abstract-pretty-reporter-BiHgKxG_.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 W{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={...G,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-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(`
2
2
  `),0):H(`${n}
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:$,repeated:M,scope:y,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),R=d(O);if(m){const s=d(m),r=Math.max(0,R-s);t.push(`${I(E(J(m,this.styles)))} `," ".repeat(r))}else t.push(" ".repeat(R+1));M&&t.push(`${te.white(`[${String(M)}x]`)} `),Array.isArray(y)&&y.length>0&&t.push(`${a(`[${y.join(" > ")}]`)} `),$&&t.push(`${a(`[${this.styles.underline.prefix?k($):$}]`)} `);const P=d(t.join(""));if(f!==N){const s=typeof f=="string"?f:C(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,`
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
 
5
- ${S(r,{...this.#e,filterStacktrace:_,prefix:l})}`;if(typeof r=="object")return` ${C(r,this.#i)}`;const q=(s?`
5
+ ${S(r,{...this.#e,filterStacktrace:_,prefix:l})}`;if(typeof r=="object")return` ${R(r,this.#i)}`;const q=(s?`
6
6
 
7
7
  `:" ")+String(r);return s=!1,q}))}if(j&&t.push(S(j,{...this.#e,filterStacktrace:_,prefix:l})),v&&t.push(`
8
8
 
@@ -1,5 +1,5 @@
1
- export { R as RequestLogEntry, S as SerializedError, W as WideEvent, a as WideEventFinishOptions, b as WideEventLevel, c as WideEventOptions, d as createWideEvent } from "./packem_shared/wide-event.d-Ke44zirU.js";
2
- import "./packem_shared/types.d-ByY2ZuYG.js";
1
+ export { R as RequestLogEntry, S as SerializedError, W as WideEvent, a as WideEventFinishOptions, b as WideEventLevel, c as WideEventOptions, d as createWideEvent } from "./packem_shared/wide-event.d-DA-6dTPc.js";
2
+ import "./packem_shared/types.d-Ck_RSjLg.js";
3
3
  import 'safe-stable-stringify';
4
4
  import '@visulima/colorize';
5
5
  import '@visulima/interactive-manager';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/pail",
3
- "version": "4.0.0-alpha.13",
3
+ "version": "4.0.0-alpha.14",
4
4
  "description": "Highly configurable Logger for Node.js, Edge and Browser.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -1 +0,0 @@
1
- var j=Object.defineProperty;var l=(e,r)=>j(e,"name",{value:r,configurable:!0});import{E as O}from"./constants-ep2nsfdy.js";var h=Object.defineProperty,S=l((e,r)=>h(e,"name",{value:r,configurable:!0}),"e");function v(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}l(v,"r");S(v,"isPlainObject");var P=Object.defineProperty,s=l((e,r)=>P(e,"name",{value:r,configurable:!0}),"i");const w=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}}),m=new WeakSet,d=s(e=>{const r=Object.getOwnPropertyNames(e);for(const n of r){const t=Object.getOwnPropertyDescriptor(e,n);t&&(t.enumerable||Object.defineProperty(e,n,{...t,enumerable:!0}),t.value&&typeof t.value=="object"&&!Array.isArray(t.value)&&(Object.getPrototypeOf(t.value)===Object.prototype||Object.getPrototypeOf(t.value)===null)&&d(t.value))}},"makePropertiesEnumerable"),N=s(e=>{m.add(e);const r=e.toJSON();return m.delete(e),Object.isExtensible(r)&&d(r),r},"toJSON"),y=s((e,r,n,t)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return r.has(e)?"[Circular]":(n+=1,b(e,t,r,n));if(t.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(v(e)){if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&n+1>=t.maxDepth)return{};n+=1;const o={};for(const i in e)o[i]=y(e[i],r,n,t);return o}try{return e}catch{return"[Not Available]"}},"serializeValue"),b=s((e,r,n,t)=>{if(n.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!m.has(e))return N(e);const o=Object.create(w);if(Object.defineProperty(o,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(o,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(o,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const u=[];for(const a of e.errors){if(!(a instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(n.has(a))return Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),o;u.push(b(a,r,n,t))}Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:u,writable:!0})}const i=e.cause;if(i!=null)if(i instanceof Error)n.has(i)?Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:b(i,r,n,t),writable:!0});else{const u=y(i,n,t,r);Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:u,writable:!0})}for(const u in e){if(u==="name"||u==="message"||u==="stack"||u==="cause"||u==="errors")continue;const a=e[u],c=y(a,n,t,r);Object.defineProperty(o,u,{configurable:!0,enumerable:!0,value:c,writable:!0})}if(Array.isArray(r.exclude)&&r.exclude.length>0)for(const u of r.exclude)try{delete o[u]}catch{}return o},"_serialize"),g=s((e,r={})=>b(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");var x=Object.defineProperty,E=l((e,r)=>x(e,"name",{value:r,configurable:!0}),"f");class I{static{l(this,"AbstractJsonReporter")}static{E(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:n,error:t,file:o,message:i,type:u,...a}=r;if(a.label&&(a.label=a.label.trim()),o&&(a.file=`${o.name??""}:${String(o.line)}${o.column?`:${String(o.column)}`:""}`),a.message=i===O?void 0:i,t&&(a.error=g(t,this.errorOptions)),n){const c=[];for(let p=0;p<n.length;p+=1){const f=n[p];f!==O&&(f instanceof Error?c.push(g(f,this.errorOptions)):c.push(f))}a.context=c}this._log(this.stringify(a),u.level)}}export{I as AbstractJsonReporter};
@@ -1 +0,0 @@
1
- var j=Object.defineProperty;var l=(e,r)=>j(e,"name",{value:r,configurable:!0});import{E as O}from"./constants-DKfCaSUR.js";var h=Object.defineProperty,S=l((e,r)=>h(e,"name",{value:r,configurable:!0}),"e");function v(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}l(v,"r");S(v,"isPlainObject");var P=Object.defineProperty,s=l((e,r)=>P(e,"name",{value:r,configurable:!0}),"i");const w=Object.create({},{cause:{enumerable:!1,value:void 0,writable:!0},code:{enumerable:!0,value:void 0,writable:!0},errors:{enumerable:!1,value:void 0,writable:!0},message:{enumerable:!1,value:void 0,writable:!0},name:{enumerable:!1,value:void 0,writable:!0},stack:{enumerable:!1,value:void 0,writable:!0}}),m=new WeakSet,d=s(e=>{const r=Object.getOwnPropertyNames(e);for(const n of r){const t=Object.getOwnPropertyDescriptor(e,n);t&&(t.enumerable||Object.defineProperty(e,n,{...t,enumerable:!0}),t.value&&typeof t.value=="object"&&!Array.isArray(t.value)&&(Object.getPrototypeOf(t.value)===Object.prototype||Object.getPrototypeOf(t.value)===null)&&d(t.value))}},"makePropertiesEnumerable"),N=s(e=>{m.add(e);const r=e.toJSON();return m.delete(e),Object.isExtensible(r)&&d(r),r},"toJSON"),y=s((e,r,n,t)=>{if(e&&e instanceof Uint8Array&&e.constructor.name==="Buffer")return"[object Buffer]";if(e!==null&&typeof e=="object"&&"pipe"in e&&typeof e.pipe=="function")return"[object Stream]";if(e instanceof Error)return r.has(e)?"[Circular]":(n+=1,b(e,t,r,n));if(t.useToJSON&&e!==null&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();if(e instanceof Date)return e.toISOString();if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="bigint")return`${String(e)}n`;if(v(e)){if(t.maxDepth!==void 0&&t.maxDepth!==Number.POSITIVE_INFINITY&&n+1>=t.maxDepth)return{};n+=1;const o={};for(const i in e)o[i]=y(e[i],r,n,t);return o}try{return e}catch{return"[Not Available]"}},"serializeValue"),b=s((e,r,n,t)=>{if(n.add(e),r.maxDepth===0)return{};if(r.useToJSON&&typeof e.toJSON=="function"&&!m.has(e))return N(e);const o=Object.create(w);if(Object.defineProperty(o,"name",{configurable:!0,enumerable:!0,value:Object.prototype.toString.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,writable:!0}),Object.defineProperty(o,"message",{configurable:!0,enumerable:!0,value:e.message,writable:!0}),Object.defineProperty(o,"stack",{configurable:!0,enumerable:!0,value:e.stack,writable:!0}),Array.isArray(e.errors)){const u=[];for(const a of e.errors){if(!(a instanceof Error))throw new TypeError("All errors in the 'errors' property must be instances of Error");if(n.has(a))return Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:[],writable:!0}),o;u.push(b(a,r,n,t))}Object.defineProperty(o,"errors",{configurable:!0,enumerable:!0,value:u,writable:!0})}const i=e.cause;if(i!=null)if(i instanceof Error)n.has(i)?Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:"[Circular]",writable:!0}):Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:b(i,r,n,t),writable:!0});else{const u=y(i,n,t,r);Object.defineProperty(o,"cause",{configurable:!0,enumerable:!0,value:u,writable:!0})}for(const u in e){if(u==="name"||u==="message"||u==="stack"||u==="cause"||u==="errors")continue;const a=e[u],c=y(a,n,t,r);Object.defineProperty(o,u,{configurable:!0,enumerable:!0,value:c,writable:!0})}if(Array.isArray(r.exclude)&&r.exclude.length>0)for(const u of r.exclude)try{delete o[u]}catch{}return o},"_serialize"),g=s((e,r={})=>b(e,{exclude:r.exclude??[],maxDepth:r.maxDepth??Number.POSITIVE_INFINITY,useToJSON:r.useToJSON??!1},new Set,0),"serialize");var x=Object.defineProperty,E=l((e,r)=>x(e,"name",{value:r,configurable:!0}),"f");class I{static{l(this,"AbstractJsonReporter")}static{E(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:n,error:t,file:o,message:i,type:u,...a}=r;if(a.label&&(a.label=a.label.trim()),o&&(a.file=`${o.name??""}:${String(o.line)}${o.column?`:${String(o.column)}`:""}`),a.message=i===O?void 0:i,t&&(a.error=g(t,this.errorOptions)),n){const c=[];for(let p=0;p<n.length;p+=1){const f=n[p];f!==O&&(f instanceof Error?c.push(g(f,this.errorOptions)):c.push(f))}a.context=c}this._log(this.stringify(a),u.level)}}export{I as AbstractJsonReporter};