Rocky_Mountain_Vending/.pnpm-store/v10/files/08/93d971108247836b4af6c50e39e6704a0f2aa3a14777e04139dd34ee0f02d276d02141104d65a112334f1f67ca170db4e5501d8d2fdb08ac6b1011013049d6
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

46 lines
No EOL
1.2 KiB
Text

import mitt from '../../shared/lib/mitt';
class Span {
constructor(name, options, onSpanEnd){
this.name = name;
this.attributes = options.attributes ?? {};
this.startTime = options.startTime ?? Date.now();
this.onSpanEnd = onSpanEnd;
this.state = {
state: 'inprogress'
};
}
end(endTime) {
if (this.state.state === 'ended') {
throw Object.defineProperty(new Error('Span has already ended'), "__NEXT_ERROR_CODE", {
value: "E17",
enumerable: false,
configurable: true
});
}
this.state = {
state: 'ended',
endTime: endTime ?? Date.now()
};
this.onSpanEnd(this);
}
}
class Tracer {
startSpan(name, options) {
return new Span(name, options, this.handleSpanEnd);
}
onSpanEnd(cb) {
this._emitter.on('spanend', cb);
return ()=>{
this._emitter.off('spanend', cb);
};
}
constructor(){
this._emitter = mitt();
this.handleSpanEnd = (span)=>{
this._emitter.emit('spanend', span);
};
}
}
export default new Tracer();
//# sourceMappingURL=tracer.js.map