{
  "version": 3,
  "sources": ["../../../../src/lib/tools/selection-logic/updateHoveredId.ts"],
  "sourcesContent": ["import { Editor, HIT_TEST_MARGIN, TLShape } from '@bigbluebutton/editor'\n\nexport function updateHoveredId(editor: Editor) {\n\t// todo: consider replacing `get hoveredShapeId` with this; it would mean keeping hoveredShapeId in memory rather than in the store and possibly re-computing it more often than necessary\n\tconst hitShape = editor.getShapeAtPoint(editor.inputs.currentPagePoint, {\n\t\thitInside: false,\n\t\thitLabels: false,\n\t\tmargin: HIT_TEST_MARGIN / editor.getZoomLevel(),\n\t\trenderingOnly: true,\n\t})\n\n\tif (!hitShape) return editor.setHoveredShape(null)\n\n\tlet shapeToHover: TLShape | undefined = undefined\n\n\tconst outermostShape = editor.getOutermostSelectableShape(hitShape)\n\n\tif (outermostShape === hitShape) {\n\t\tshapeToHover = hitShape\n\t} else {\n\t\tif (\n\t\t\toutermostShape.id === editor.getFocusedGroupId() ||\n\t\t\teditor.getSelectedShapeIds().includes(outermostShape.id)\n\t\t) {\n\t\t\tshapeToHover = hitShape\n\t\t} else {\n\t\t\tshapeToHover = outermostShape\n\t\t}\n\t}\n\n\treturn editor.setHoveredShape(shapeToHover.id)\n}\n"],
  "mappings": "AAAA,SAAiB,uBAAgC;AAE1C,SAAS,gBAAgB,QAAgB;AAE/C,QAAM,WAAW,OAAO,gBAAgB,OAAO,OAAO,kBAAkB;AAAA,IACvE,WAAW;AAAA,IACX,WAAW;AAAA,IACX,QAAQ,kBAAkB,OAAO,aAAa;AAAA,IAC9C,eAAe;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,SAAU,QAAO,OAAO,gBAAgB,IAAI;AAEjD,MAAI,eAAoC;AAExC,QAAM,iBAAiB,OAAO,4BAA4B,QAAQ;AAElE,MAAI,mBAAmB,UAAU;AAChC,mBAAe;AAAA,EAChB,OAAO;AACN,QACC,eAAe,OAAO,OAAO,kBAAkB,KAC/C,OAAO,oBAAoB,EAAE,SAAS,eAAe,EAAE,GACtD;AACD,qBAAe;AAAA,IAChB,OAAO;AACN,qBAAe;AAAA,IAChB;AAAA,EACD;AAEA,SAAO,OAAO,gBAAgB,aAAa,EAAE;AAC9C;",
  "names": []
}
