{"version":3,"file":"hitArea.mjs","names":[],"sources":["../../../../../src/plugins/AIComponents/VoiceVisualization/hitArea.ts"],"sourcesContent":["/** How far from the centre a tap still lands on the globe, as a share of the shorter side. */\nconst GLOBE_REACH = 0.32;\n\n/** Whether a point, centred and normalized to the shorter side with y up, lands on the globe. */\nexport const glowContains = (x: number, y: number) => Math.hypot(x, y) < GLOBE_REACH;\n\n/**\n * A pointer event's position in the renderers' coordinates: centred on the element, normalized\n * to its shorter side, y up.\n */\nexport const toLocalPoint = (event: {\n  clientX: number;\n  clientY: number;\n  currentTarget: Element;\n}) => {\n  const rect = event.currentTarget.getBoundingClientRect();\n  const side = Math.min(rect.width, rect.height) || 1;\n  return {\n    x: (event.clientX - rect.left - rect.width / 2) / side,\n    y: (rect.height / 2 - (event.clientY - rect.top)) / side,\n  };\n};\n"],"mappings":";;AACA,IAAM,cAAc;;AAGpB,IAAa,gBAAgB,GAAW,MAAc,KAAK,MAAM,GAAG,CAAC,IAAI;;;;;AAMzE,IAAa,gBAAgB,UAIvB;CACJ,MAAM,OAAO,MAAM,cAAc,sBAAsB;CACvD,MAAM,OAAO,KAAK,IAAI,KAAK,OAAO,KAAK,MAAM,KAAK;CAClD,OAAO;EACL,IAAI,MAAM,UAAU,KAAK,OAAO,KAAK,QAAQ,KAAK;EAClD,IAAI,KAAK,SAAS,KAAK,MAAM,UAAU,KAAK,QAAQ;CACtD;AACF"}