{"version":3,"file":"event-info.mjs","sources":["../../../src/events/event-info.ts"],"sourcesContent":["import { EventInfo, isPrimaryPointer } from \"motion-dom\"\n\nexport type EventListenerWithPointInfo = (\n    e: PointerEvent,\n    info: EventInfo\n) => void\n\nexport function extractEventInfo(event: PointerEvent): EventInfo {\n    return {\n        point: {\n            x: event.pageX,\n            y: event.pageY,\n        },\n    }\n}\n\nexport const addPointerInfo =\n    (handler: EventListenerWithPointInfo): EventListener =>\n    (event: PointerEvent) =>\n        isPrimaryPointer(event) && handler(event, extractEventInfo(event))\n"],"names":[],"mappings":";;AAOM,SAAU,gBAAgB,CAAC,KAAmB,EAAA;IAChD,OAAO;AACH,QAAA,KAAK,EAAE;YACH,CAAC,EAAE,KAAK,CAAC,KAAK;YACd,CAAC,EAAE,KAAK,CAAC,KAAK;AACjB,SAAA;KACJ;AACL;AAEO,MAAM,cAAc,GACvB,CAAC,OAAmC,KACpC,CAAC,KAAmB,KAChB,gBAAgB,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC;;;;"}