var i=class{constructor(e={}){this.config=e,this.enabled=e.enabled!==!1,this.priority=e.priority||50}getName(){throw new Error("EventEnricher.getName() must be implemented")}canEnrich(e){return this.enabled}async enrich(e,n){throw new Error("EventEnricher.enrich() must be implemented")}handleError(e,n){return console.warn(`[${this.getName()}] Enrichment failed for event ${n.type}:`,e.message),null}};var l=class extends i{getName(){return"PositionEnricher"}getPriority(){return 90}canEnrich(e){return!this.enabled||!e.element||!e.event?!1:["click","fill","type","selectOption","hover"].includes(e.event.type)}async enrich(e,n){try{let{page:o,element:s}=n,t=await s.boundingBox();if(!t)return null;let r=await o.evaluate(()=>({scrollX:window.scrollX,scrollY:window.scrollY,width:window.innerWidth,height:window.innerHeight})),a=t.y>=r.scrollY&&t.y+t.height<=r.scrollY+r.height&&t.x>=0&&t.x+t.width<=r.width;return{position:{boundingBox:t,viewport:r,inViewport:a,centerPoint:{x:Math.round(t.x+t.width/2),y:Math.round(t.y+t.height/2)}}}}catch(o){return this.handleError(o,e)}}},u=l;export{l as PositionEnricher,u as default};
