{
  "version": 3,
  "sources": ["../../../../src/lib/ui/components/BackToContent.tsx"],
  "sourcesContent": ["import { useEditor } from '@bigbluebutton/editor'\nimport { useEffect, useState } from 'react'\nimport { useActions } from '../hooks/useActions'\nimport { Button } from './primitives/Button'\n\nexport function BackToContent() {\n\tconst editor = useEditor()\n\n\tconst actions = useActions()\n\tconst action = actions['back-to-content']\n\n\tconst [showBackToContent, setShowBackToContent] = useState(false)\n\n\tuseEffect(() => {\n\t\tlet showBackToContentPrev = false\n\n\t\tconst interval = setInterval(() => {\n\t\t\tconst renderingShapes = editor.getRenderingShapes()\n\t\t\tconst renderingBounds = editor.getRenderingBounds()\n\n\t\t\t// renderingShapes will also include shapes that have the canUnmount flag\n\t\t\t// set to true. These shapes will be on the canvas but may not be in the\n\t\t\t// viewport... so we also need to narrow down the list to only shapes that\n\t\t\t// are ALSO in the viewport.\n\t\t\tconst visibleShapes = renderingShapes.filter(\n\t\t\t\t(s) => s.maskedPageBounds && renderingBounds.includes(s.maskedPageBounds)\n\t\t\t)\n\t\t\tconst showBackToContentNow =\n\t\t\t\tvisibleShapes.length === 0 && editor.getCurrentPageShapes().length > 0\n\n\t\t\tif (showBackToContentPrev !== showBackToContentNow) {\n\t\t\t\tsetShowBackToContent(showBackToContentNow)\n\t\t\t\tshowBackToContentPrev = showBackToContentNow\n\t\t\t}\n\t\t}, 1000)\n\n\t\treturn () => {\n\t\t\tclearInterval(interval)\n\t\t}\n\t}, [editor])\n\n\tif (!showBackToContent) return null\n\n\treturn (\n\t\t<Button\n\t\t\ticonLeft={action.icon}\n\t\t\tlabel={action.label}\n\t\t\ttype=\"low\"\n\t\t\tonClick={() => {\n\t\t\t\taction.onSelect('helper-buttons')\n\t\t\t\tsetShowBackToContent(false)\n\t\t\t}}\n\t\t/>\n\t)\n}\n"],
  "mappings": "AA4CE;AA5CF,SAAS,iBAAiB;AAC1B,SAAS,WAAW,gBAAgB;AACpC,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AAEhB,SAAS,gBAAgB;AAC/B,QAAM,SAAS,UAAU;AAEzB,QAAM,UAAU,WAAW;AAC3B,QAAM,SAAS,QAAQ,iBAAiB;AAExC,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAS,KAAK;AAEhE,YAAU,MAAM;AACf,QAAI,wBAAwB;AAE5B,UAAM,WAAW,YAAY,MAAM;AAClC,YAAM,kBAAkB,OAAO,mBAAmB;AAClD,YAAM,kBAAkB,OAAO,mBAAmB;AAMlD,YAAM,gBAAgB,gBAAgB;AAAA,QACrC,CAAC,MAAM,EAAE,oBAAoB,gBAAgB,SAAS,EAAE,gBAAgB;AAAA,MACzE;AACA,YAAM,uBACL,cAAc,WAAW,KAAK,OAAO,qBAAqB,EAAE,SAAS;AAEtE,UAAI,0BAA0B,sBAAsB;AACnD,6BAAqB,oBAAoB;AACzC,gCAAwB;AAAA,MACzB;AAAA,IACD,GAAG,GAAI;AAEP,WAAO,MAAM;AACZ,oBAAc,QAAQ;AAAA,IACvB;AAAA,EACD,GAAG,CAAC,MAAM,CAAC;AAEX,MAAI,CAAC,kBAAmB,QAAO;AAE/B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,UAAU,OAAO;AAAA,MACjB,OAAO,OAAO;AAAA,MACd,MAAK;AAAA,MACL,SAAS,MAAM;AACd,eAAO,SAAS,gBAAgB;AAChC,6BAAqB,KAAK;AAAA,MAC3B;AAAA;AAAA,EACD;AAEF;",
  "names": []
}
