import{a as o}from"./chunk-CVKDPNYM.js";var h=0,i=[],a=o((e,t,n)=>{let s={type:e,id:String(++h),date:new Date};t&&(s.message=t),n&&(s.data=n),p(s)},"log"),x=o(({type:e,message:t,data:n,context:s})=>{let c={type:e,id:String(++h),date:new Date};t&&(c.message=t),n&&(c.data=n),s&&(c.context=s),p(c)},"trace"),r=class e{static{o(this,"LocalTracer")}constructor(t,n){this.type=t,this.context=n}trace(t,n){x({type:this.type,message:t,data:n,context:this.context})}getContext(){return this.context}setContext(t){this.context=t}updateContext(t){this.context=Object.assign(Object.assign({},this.context),t)}getType(){return this.type}setType(t){this.type=t}withType(t){return new e(t,this.context)}withContext(t){return new e(this.type,t)}withUpdatedContext(t){return new e(this.type,Object.assign(Object.assign({},this.context),t))}},d=o(e=>(i.push(e),()=>{let t=i.indexOf(e);t!==-1&&(i[t]=i[i.length-1],i.pop())}),"listen");function p(e){for(let t=0;t<i.length;t++)try{i[t](e)}catch(n){console.error(n)}}o(p,"dispatch");typeof window<"u"&&(window.__ledgerLogsListen=d);export{a,r as b};
//# sourceMappingURL=chunk-5QSDSOWH.js.map
