@mavea/mavea 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/.vite/manifest.json +298 -298
  3. package/dist/assets/{AnnotationLayer-qV6CIUZv.js → AnnotationLayer-8JABh1Dm.js} +0 -0
  4. package/dist/assets/{AppCommandPalette-BHaYBZ5e.js → AppCommandPalette-CgDUWU08.js} +1 -1
  5. package/dist/assets/{CheckLogRail-DkHIHL0E.js → CheckLogRail-DO7sbZwC.js} +1 -1
  6. package/dist/assets/{ConversationVideoStudio-C1sd4k53.js → ConversationVideoStudio-tpqQQnOs.js} +1 -1
  7. package/dist/assets/{CourseLessonReader-YCcNKEW7.js → CourseLessonReader-PFJn-4tj.js} +2 -2
  8. package/dist/assets/{CoursesApp-Dz6xjf4V.js → CoursesApp-5pnHYJR8.js} +1 -1
  9. package/dist/assets/{DashPresent-5SRScC2i.js → DashPresent-B6MP1i_4.js} +1 -1
  10. package/dist/assets/{DashboardDetail-DOfm8UCQ.js → DashboardDetail-DYFghZ4p.js} +1 -1
  11. package/dist/assets/{DashboardLoopGate-Cf0y_HQ7.js → DashboardLoopGate-C0blM1w9.js} +2 -2
  12. package/dist/assets/DashboardLoopRuntime-C9R-z9-o.js +1 -0
  13. package/dist/assets/{DashboardsApp-_gbfdbX6.js → DashboardsApp-Dh_jh1dF.js} +2 -2
  14. package/dist/assets/{DeepZoomApp-BOLEl-kQ.js → DeepZoomApp-UEPtylG7.js} +1 -1
  15. package/dist/assets/{DelegatePanel-CHEB-OZl.js → DelegatePanel-DKWsRY9I.js} +1 -1
  16. package/dist/assets/{DemoGallery-DBqnu8TR.js → DemoGallery-CkuqAXje.js} +1 -1
  17. package/dist/assets/{DropSelect-DjbdVfIR.js → DropSelect-QcBm3N4D.js} +1 -1
  18. package/dist/assets/{ExportModal-CLobMv1F.js → ExportModal-Ya0VBbxa.js} +1 -1
  19. package/dist/assets/{ExtractionPreview-QZ2VHmsb.js → ExtractionPreview-BFrmqKDo.js} +1 -1
  20. package/dist/assets/{FeatureUseNotice-Dc8joBGM.js → FeatureUseNotice-Dc3GNBvy.js} +1 -1
  21. package/dist/assets/{FlagshipCommandPalette-DnWuBjYI.js → FlagshipCommandPalette-B1yHwI6V.js} +1 -1
  22. package/dist/assets/{FlagshipShowcase-3qQDOK6g.js → FlagshipShowcase-BHAlRDAE.js} +1 -1
  23. package/dist/assets/{FlashcardsApp-BQGM-Tr1.js → FlashcardsApp-DteNeHpz.js} +1 -1
  24. package/dist/assets/{GalleryApp-BWQ-J450.js → GalleryApp-DziLKFJZ.js} +1 -1
  25. package/dist/assets/{HonestByDesign-57LDf-gm.js → HonestByDesign-DZltb3Ss.js} +1 -1
  26. package/dist/assets/{HowItWorks-DMfPX3GK.js → HowItWorks-D-hgfN6a.js} +1 -1
  27. package/dist/assets/{LegalApp-CcO5Qq6R.js → LegalApp-ChzcKiY0.js} +1 -1
  28. package/dist/assets/{LegalMarkdownDocument-Be_fQbZ_.js → LegalMarkdownDocument-j6UHhPnp.js} +1 -1
  29. package/dist/assets/{LegalPageShell-B-HY1WG7.js → LegalPageShell-Wcsviye1.js} +1 -1
  30. package/dist/assets/{LibraryOverlay-BilW6q_z.js → LibraryOverlay-YHBrdVKo.js} +1 -1
  31. package/dist/assets/{LiveApp-DH3OxJFV.js → LiveApp-D6vkyhZb.js} +3 -3
  32. package/dist/assets/{LiveSettings-CuVMy7rZ.js → LiveSettings-C9cKOrSb.js} +1 -1
  33. package/dist/assets/{PinToDashboard-Cz5UJCmq.js → PinToDashboard-BCiWaSg8.js} +1 -1
  34. package/dist/assets/{PlanReview-CmUxzNqL.js → PlanReview-BIERfK1t.js} +1 -1
  35. package/dist/assets/{PresentationDeck-B_EI33Pp.js → PresentationDeck-BW_7qecK.js} +1 -1
  36. package/dist/assets/{PrismApp-DtLsPiQF.js → PrismApp-BY71jJvW.js} +2 -2
  37. package/dist/assets/{PrismBriefingPlayer-DzdtnFj4.js → PrismBriefingPlayer-DLAPs6eZ.js} +2 -2
  38. package/dist/assets/{PrismOverlay-D1cDZamt.js → PrismOverlay-DJDGPGxo.js} +3 -3
  39. package/dist/assets/{PrismWorkbench-BEIp4MiL.js → PrismWorkbench-DHLvpguj.js} +1 -1
  40. package/dist/assets/{PrivacyApp-B4DT2RUz.js → PrivacyApp-uMjq2z14.js} +1 -1
  41. package/dist/assets/{ReplayCard-Dx46HCBT.js → ReplayCard-F7U3LYAg.js} +2 -2
  42. package/dist/assets/{ReplayOverlay-CnJAxf0u.js → ReplayOverlay-BTldvkU7.js} +1 -1
  43. package/dist/assets/{RippleApp-D5j2VCt2.js → RippleApp-DZw8op-E.js} +2 -2
  44. package/dist/assets/{RippleOverlay-zcXAHPuJ.js → RippleOverlay-D7ItTvS-.js} +2 -2
  45. package/dist/assets/{SeeDontRead-Dqfzha0V.js → SeeDontRead-DmmtWAzn.js} +1 -1
  46. package/dist/assets/{ShareModal-DWxlrJSz.js → ShareModal-9jSn52Mw.js} +2 -2
  47. package/dist/assets/{ShipCourse-BavQppkt.js → ShipCourse-Up9gRR07.js} +1 -1
  48. package/dist/assets/{SignatureLoop-L8W2h62w.js → SignatureLoop-Cq790dMw.js} +1 -1
  49. package/dist/assets/{SynthesisApp-C2O6pFeM.js → SynthesisApp-4ZPLZgmJ.js} +2 -2
  50. package/dist/assets/{SynthesisOverlay-DLvwiSMv.js → SynthesisOverlay-iesJ0hEt.js} +1 -1
  51. package/dist/assets/{TermsApp-CxY1yorm.js → TermsApp-DL2hFKsv.js} +1 -1
  52. package/dist/assets/{TopicCanvas-LMI0zC7R.js → TopicCanvas-DozfZFto.js} +2 -2
  53. package/dist/assets/{TourPrism-CI-iJZil.js → TourPrism-kInUOv-M.js} +1 -1
  54. package/dist/assets/{TrackerTile-oz6IoG8m.js → TrackerTile-BryDo0sm.js} +2 -2
  55. package/dist/assets/{TwoSurfaces-Rnf-_WgY.js → TwoSurfaces-Cmj95ofx.js} +1 -1
  56. package/dist/assets/{WorldOverlay-BaQNNClA.js → WorldOverlay-yhxq328s.js} +1 -1
  57. package/dist/assets/{WowFeatures-C4efSbNV.js → WowFeatures-DDICbxl_.js} +1 -1
  58. package/dist/assets/{ZoomDeck-CBrr0yfy.js → ZoomDeck-CKOjYS9z.js} +1 -1
  59. package/dist/assets/canvas-vqIFVmtP.js +1 -0
  60. package/dist/assets/{capture-D8uPIcfj.js → capture-9OrAc1p2.js} +1 -1
  61. package/dist/assets/{confirmAdd-DzMO9jKV.js → confirmAdd-DkmbWaSk.js} +1 -1
  62. package/dist/assets/{dashboardEvents-DKl5rrTD.js → dashboardEvents-D-XVj666.js} +1 -1
  63. package/dist/assets/{generateBeats-DZHkvFvh.js → generateBeats-DtptFLlG.js} +1 -1
  64. package/dist/assets/{index-DmKgC_TJ.css → index-DrzNHwlO.css} +1 -1
  65. package/dist/assets/{index-Dk0QapqQ.js → index-zIa6h_8b.js} +3 -3
  66. package/dist/assets/{kokoro-P_fkcX-A.js → kokoro-B3oG_8sd.js} +1 -1
  67. package/dist/assets/{loader-DKJEcbPm.js → loader-DCA6Njbf.js} +2 -2
  68. package/dist/assets/{notes-B0-EE0FK.js → notes-B6eX5XWk.js} +1 -1
  69. package/dist/assets/{perfProbe-B9zJpjo9.js → perfProbe-CE7hsUEo.js} +1 -1
  70. package/dist/assets/{pin-CZAIlpXt.js → pin-BZuh1acO.js} +1 -1
  71. package/dist/assets/{portal-Dogggsub.js → portal-k_BMgWND.js} +1 -1
  72. package/dist/assets/{prewarm-B4ELBOxf.js → prewarm-uKxmzjjd.js} +1 -1
  73. package/dist/assets/{quietHours-CeBje_uU.js → quietHours-DI1ayIIq.js} +1 -1
  74. package/dist/assets/{registry-GeAC3ZD7.js → registry-1wlTAh5b.js} +1 -1
  75. package/dist/assets/{registry-CqhpLHM7.js → registry-B2QzCuWH.js} +1 -1
  76. package/dist/assets/{registry-CD1s3eQ-.js → registry-DtV2UjBx.js} +1 -1
  77. package/dist/assets/{registry-6MOD-I7p.js → registry-Dwbh-GWu.js} +1 -1
  78. package/dist/assets/{relate-BYdM5eiV.js → relate-UW-sUlJH.js} +1 -1
  79. package/dist/assets/{replay-TYXO0Brm.js → replay-B5TkHPri.js} +1 -1
  80. package/dist/assets/{useDashboardLoop-DDqCFJKY.js → useDashboardLoop-BoVNM-pT.js} +1 -1
  81. package/dist/assets/{useStudy-GwNcQWtv.js → useStudy-5CsF_L-s.js} +1 -1
  82. package/dist/assets/{walkSync-CPsd-xu7.js → walkSync-CT8kmbzY.js} +1 -1
  83. package/dist/index.html +2 -2
  84. package/package.json +1 -1
  85. package/dist/assets/DashboardLoopRuntime-CnN5VayH.js +0 -1
  86. package/dist/assets/canvas-Bsx3eSaS.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-kNHRtoqd.js","assets/rolldown-runtime-DkW27tQK.js","assets/preload-helper-CiWYd9n-.js","assets/generateLive-B6purd69.js","assets/blockLabel-FogyzEQY.js","assets/layout-CEoNLr-w.js","assets/catalog-BHjl-1uH.js","assets/history-D2EH2X6D.js","assets/catalog-Db9GWM6N.js","assets/facts-BUGuVUIc.js","assets/blockTypes-DUDdP3pB.js","assets/streamParse-B-Gjwa9T.js","assets/liveSchema-B4bQtO88.js","assets/icons-gLFQTv74.js","assets/jsx-runtime-DeHZSEgm.js","assets/spokenText-C88IQJ0M.js","assets/safeImageUrl-BINWXOTz.js","assets/sourceHost-BV3t2XDb.js","assets/annotations-CftUUB13.js","assets/screen-DFWKge3-.js","assets/attachments-BW-vki-E.js","assets/providers-BovElgRL.js","assets/http-Lar_UMKb.js","assets/info-CiqHR5cs.js","assets/shapes-Cx5SCKgj.js","assets/speed-K5_Ebj-8.js","assets/cache-CvbSI-pr.js","assets/validate-sGUCmPAs.js","assets/types-C42I77wh.js","assets/json-B0N3XRZU.js","assets/verbatim-DBTj9sPD.js","assets/citation-BsSvaaer.js","assets/number-zqlPMliA.js","assets/receipts-D7zveV-I.js","assets/officeDoc-GU6Cssjf.js","assets/csv-DAqzYXUs.js","assets/search-ZN7v_P5B.js","assets/store-BWLbFXiY.js","assets/contentVault-xfUwSJ3i.js","assets/keyVault-Aw5Y2PjT.js","assets/ready-jtAUOb62.js","assets/now-C9-UAzTC.js","assets/TopicCanvas-LMI0zC7R.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/index-Dk0QapqQ.js","assets/useInView-CXTOAEV3.js","assets/coreIcons-DDTChE1H.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-7IrMJ70_.js","assets/index-DmKgC_TJ.css","assets/loader-DKJEcbPm.js","assets/FallbackCard-ap_4wOfj.js","assets/FallbackCard-D_6ps1xA.css","assets/useFocusTrap-DBtkeyRy.js","assets/motion-BY_Egaxm.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/CanvasSkeleton-CRGWlafo.js","assets/CanvasSkeleton-iy6DBvde.css","assets/richText-BkxJhl9N.js","assets/toast-BBNs2h3L.js","assets/format-q0LwBjID.js","assets/useValidatedImage-BQi2c66o.js","assets/lib-B7OE1ZQQ.js","assets/BlockEmpty-B82uCse8.js","assets/motion-DxHSlPN6.js","assets/lib-DMAxsZKm.css","assets/TopicCanvas-uRuHi99s.css","assets/HowItWorks-DMfPX3GK.js","assets/generateBeats-DZHkvFvh.js","assets/walkSync-CPsd-xu7.js","assets/kokoro-P_fkcX-A.js","assets/nextFrame-12y0UrAd.js","assets/canvas-Bsx3eSaS.js","assets/ReplayCard-Dx46HCBT.js","assets/annotationReel-K2FYv-3B.js","assets/registry-Dd1lcXrO.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/ReplayCard-Cs6mzTRa.css","assets/CommandPalette-Bs6tpdZl.js","assets/registry-DGNSqTxE.js","assets/CommandPalette-Bb-eErih.css","assets/Library-DmdzY2se.js","assets/neighborhoods-D7QjURnE.js","assets/chapters-Dqm4iLDa.js","assets/threads-Cu2t3070.js","assets/time-BHTmJR1s.js","assets/Library-DmrtHjUf.css","assets/LiveSettings-CuVMy7rZ.js","assets/FeatureUseNotice-Dc8joBGM.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/useLiveConfig-Cpy0_E_-.js","assets/store-gohr8YVT.js","assets/friendlyAsk-BBdRZIar.js","assets/quietHours-CeBje_uU.js","assets/DropSelect-DjbdVfIR.js","assets/DropSelect-DilESAgA.css","assets/useStudy-GwNcQWtv.js","assets/store-D2IJF4SA.js","assets/queue-Adae4IzW.js","assets/LiveSettings-CmgrMqvK.css","assets/DashboardDetail-DOfm8UCQ.js","assets/store-CsjDEADX.js","assets/route-D4kd-D3B.js","assets/useDashboards-SRk8LqHe.js","assets/format-g3dP8OI3.js","assets/ledger-Cv0LBflx.js","assets/dataPending-DGdCvY5Y.js","assets/AreaChart-DZGCSEwt.js","assets/tiles-D-s6v-mA.js","assets/tiles-CBiVVjtT.css","assets/useDashboardLoop-DDqCFJKY.js","assets/predictions-CkVKHq-5.js","assets/notify-Bz4wuE4T.js","assets/dashboardEvents-DKl5rrTD.js","assets/confirmAdd-DzMO9jKV.js","assets/planTracker-KKAtTBWs.js","assets/pin-CZAIlpXt.js","assets/pin-D-4Zjiik.css","assets/CadenceCard-P4teI7Se.js","assets/CheckLogRail-DkHIHL0E.js","assets/useLedger-1WVXef68.js","assets/checkLogModel-BMtruriG.js","assets/CheckLogRail-BOaXnqWK.css","assets/DashboardDetail-8J8TsdQg.css","assets/dashboards-C1u2ks-d.css","assets/DashboardSettings-CE0B2y2y.js","assets/UnderstoodPanel-DmJph4el.js","assets/UnderstoodPanel-Q6GX1TFq.css","assets/ZoomDeck-CBrr0yfy.js","assets/portal-Dogggsub.js","assets/useZoomGesture-CN0p0lHL.js","assets/ZoomDeck-B2SjNwY7.css","assets/AtlasView-B82UfrEX.js","assets/store-D-f8ZuaK.js","assets/AtlasView-B5fkQhO6.css","assets/RippleOverlay-zcXAHPuJ.js","assets/buildShip-BgFg98tH.js","assets/parseDiff-D8uBQ9mQ.js","assets/incident-D3bmMmES.js","assets/githubToken-Bwa7V9YT.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/RippleOverlay-_iiZsQVZ.css","assets/CardEditor-DABIhGdQ.js","assets/CardEditor-BY1bZiV6.css","assets/CourseRail-DXt3bzjU.js","assets/store-BfHRbVKz.js","assets/generateCourse-C9qvaJRo.js","assets/useSrsCards-C27o39fF.js","assets/deckLine-NBd3MyGT.js","assets/CourseRail-CUa7uIGG.css","assets/MindMapViewerDrawer-DI_S7fRZ.js","assets/MindShape-C_Bo9hW9.js","assets/Presence-UqXfH4Y-.js","assets/geometry-DXAbnb0J.js","assets/MindShape-CaPeUo-a.css","assets/Recap-T9DtFaEk.js","assets/Recap-DCiiWNiV.css","assets/LibraryOverlay-BilW6q_z.js","assets/LibraryOverlay-CnKWDMG_.css","assets/ReplayOverlay-CnJAxf0u.js","assets/replay-TYXO0Brm.js","assets/AnnotationLayer-qV6CIUZv.js","assets/gesture-Bouqjr3g.js","assets/emphasize-BqCIst-B.js","assets/AnnotationLayer-ClU-e6qL.css","assets/ReplayOverlay-DzkcTnCA.css","assets/ShareModal-DWxlrJSz.js","assets/capture-D8uPIcfj.js","assets/share-kW3pZ027.js","assets/ReelJelly-D5e-jt-8.js","assets/ShareModal-D1QuQEko.css","assets/ExportModal-CLobMv1F.js","assets/notes-B0-EE0FK.js","assets/registry-CPiwQhAm.js","assets/scale-Bcgfo6Hp.js","assets/registry-types-D3q_LrlV.js","assets/fitText-DQ2omSN0.js","assets/registry-CNgybLQv.css","assets/registry-6DGRAB1m.js","assets/openWorld-BHTJM39n.js","assets/display-CAb_PiGv.js","assets/registry-BZuT2Epw.css","assets/registry-CcOO8UZr.js","assets/registry-2GJZ46M8.css","assets/registry-CPImC7mO.js","assets/empty-BO1NC9qY.js","assets/registry-B1KQ1VPZ.css","assets/registry-B0GIHERt.js","assets/spreadLabels-CQ8hufvK.js","assets/registry-CuVk7MAI.css","assets/registry-D8O0apUT.js","assets/CodeOutput-DF892aIR.js","assets/useTimeout-Cm4yzted.js","assets/registry-BzNLfje1.css","assets/registry-Vp8VuMV0.js","assets/registry-twSIyxJQ.css","assets/registry-BFbfXK-W.js","assets/registry-UFIuwh3i.css","assets/registry-7poQfBaM.js","assets/registry-ZOWzhOHk.css","assets/registry-C28gYnVq.js","assets/registry-CRisz4Ca.css","assets/registry-Bv1f5UU4.js","assets/registry-CvylL2BN.css","assets/registry-Ci65uThi.js","assets/useSpotlightWalk-DxlxBezO.js","assets/registry-BAoRB8rd.css","assets/registry-GeAC3ZD7.js","assets/registry-T3i2Q9SI.css","assets/registry-BFrgx1tE.js","assets/registry-Cse2wF7x.css","assets/registry-CD1s3eQ-.js","assets/quizResult-DB8yeqDr.js","assets/stepDriver-DwjFet6U.js","assets/registry-B5S3brjM.css","assets/registry-w4R6c89s.js","assets/safeCssColor-di93BXgG.js","assets/registry-4mMEt1Xy.css","assets/registry-DO4hGO5e.js","assets/registry-CRM7y8QT.css","assets/registry-CqhpLHM7.js","assets/registry-Dye5m3qt.css","assets/registry-BSX3aFUw.js","assets/registry-C3ezxLR3.css","assets/registry-6MOD-I7p.js","assets/registry-tkd3UhWn.css","assets/registry-WHd1PwU3.js","assets/registry-DpMI23iE.css","assets/registry-Daypk4uR.js","assets/registry-GeSy4i7R.css","assets/registry-Xl8mAnKq.js","assets/registry-Dru0JcTa.css","assets/registry-DLyrLfe-.js","assets/notes-A9t4jdfx.css","assets/ready-Ba6nk9O1.js","assets/ExportModal-D4WpAg2c.css","assets/ExtractionPreview-QZ2VHmsb.js","assets/store-DpObYU1u.js","assets/relate-BYdM5eiV.js","assets/PinToDashboard-Cz5UJCmq.js","assets/PrismOverlay-D1cDZamt.js","assets/penStrokes-DlHnO9xE.js","assets/types-CaO6xOn5.js","assets/pen-DNMslo3e.js","assets/PrismOverlay-BTfAicBt.css","assets/WorldOverlay-BaQNNClA.js","assets/value-Dx7DZob4.js","assets/types-DuEbJpIA.js","assets/engine-BiM6INsW.js","assets/engine-CTvOaA86.css","assets/WorldOverlay-D7ay5y4D.css","assets/SynthesisOverlay-DLvwiSMv.js","assets/PresentationDeck-B_EI33Pp.js","assets/pageVisibility-BxUVsw7Z.js","assets/DelegatePanel-CHEB-OZl.js","assets/DelegatePanel-Cf85-0qE.css","assets/SrsReview-DhWNYYv7.js","assets/SrsReview-B1B2VekR.css","assets/TourPrism-CI-iJZil.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{t as n}from"./compiler-runtime-qQQXpJgv.js";import{t as r}from"./jsx-runtime-DeHZSEgm.js";import{n as i,t as a}from"./preload-helper-CiWYd9n-.js";import{r as o,t as s}from"./preloadableLazy-MIX1ApBW.js";import{A as c,B as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,N as v,P as y,Q as b,R as x,T as S,U as C,V as w,W as T,Y as E,a as D,et as O,f as k,it as A,j,k as M,p as N,q as P,r as F,t as I,u as L,z as R}from"./index-Dk0QapqQ.js";import{n as z}from"./icons-gLFQTv74.js";import{n as ee,t as te}from"./spokenText-C88IQJ0M.js";import{a as ne,i as B,n as re}from"./loader-DKJEcbPm.js";import{n as ie,r as ae}from"./blockLabel-FogyzEQY.js";import{t as oe}from"./useFocusTrap-DBtkeyRy.js";import{t as se}from"./motion-BY_Egaxm.js";import{n as V,o as ce,t as le}from"./CanvasSkeleton-CRGWlafo.js";import{t as ue}from"./Presence-UqXfH4Y-.js";import{t as de}from"./MindShape-C_Bo9hW9.js";import{n as fe}from"./openWorld-BHTJM39n.js";import{i as pe,r as me,t as he}from"./display-CAb_PiGv.js";import{r as H,t as ge}from"./sourceHost-BV3t2XDb.js";import{t as _e}from"./stepDriver-DwjFet6U.js";import{A as ve,C as ye,D as be,E as xe,O as Se,T as Ce,_ as we,b as Te,c as Ee,d as De,h as Oe,j as ke,l as Ae,o as je,r as Me,u as Ne,v as Pe,w as Fe,y as Ie}from"./kokoro-P_fkcX-A.js";import{t as Le}from"./portal-Dogggsub.js";import{a as Re,i as ze,o as Be,r as Ve,s as He}from"./threads-Cu2t3070.js";import{t as Ue}from"./FeatureUseNotice-Dc8joBGM.js";import{n as We,r as Ge}from"./history-D2EH2X6D.js";import{n as Ke}from"./nextFrame-12y0UrAd.js";import{a as qe,d as Je,i as Ye,l as Xe,n as Ze,o as Qe,r as $e,s as et,t as tt,u as nt}from"./walkSync-CPsd-xu7.js";import{n as rt,t as it}from"./generateBeats-DZHkvFvh.js";import{n as at,r as ot,t as st}from"./AnnotationLayer-qV6CIUZv.js";import{n as ct}from"./emphasize-BqCIst-B.js";import{a as lt,s as ut}from"./streamParse-B-Gjwa9T.js";import{n as dt,t as ft}from"./registry-DLyrLfe-.js";import{t as pt}from"./ready-Ba6nk9O1.js";import{t as mt}from"./registry-DGNSqTxE.js";import{i as ht,r as gt}from"./info-CiqHR5cs.js";import{t as _t}from"./friendlyAsk-BBdRZIar.js";import{a as vt,c as yt,i as bt,n as xt,r as St,s as Ct}from"./store-DpObYU1u.js";import{n as wt,r as Tt}from"./chapters-Dqm4iLDa.js";/* empty css */import{g as Et,h as Dt,l as Ot,m as kt,p as At,s as jt,t as Mt,v as Nt}from"./attachments-BW-vki-E.js";import{t as Pt}from"./types-CaO6xOn5.js";import{J as Ft,Z as It,a as Lt,c as Rt,m as zt,q as Bt,u as Vt}from"./store-CsjDEADX.js";import{t as Ht}from"./providers-BovElgRL.js";import{a as Ut,c as Wt,l as Gt,n as Kt,o as qt,r as Jt,s as Yt,u as Xt}from"./useLiveConfig-Cpy0_E_-.js";import{prewarmLive as Zt}from"./prewarm-B4ELBOxf.js";import{_ as Qt,c as $t,f as en,h as tn,i as nn,n as rn,p as an,v as on,x as sn,y as cn}from"./shapes-Cx5SCKgj.js";import{t as ln}from"./TopbarMenu-DQXxqSWY.js";import{a as un,o as dn,r as fn}from"./store-gohr8YVT.js";import{a as pn,c as mn,d as hn,f as gn,i as _n,l as vn,m as yn,o as bn,p as xn,s as Sn,t as Cn}from"./quietHours-CeBje_uU.js";import{a as wn,c as Tn,d as En,i as Dn,n as On,t as kn,u as An}from"./store-BWLbFXiY.js";import{n as jn}from"./speed-K5_Ebj-8.js";import{i as Mn,n as Nn,t as Pn}from"./cache-CvbSI-pr.js";import{r as Fn}from"./verbatim-DBTj9sPD.js";import{n as In}from"./citation-BsSvaaer.js";import{n as Ln,o as Rn,t as zn}from"./validate-sGUCmPAs.js";import{n as Bn,t as Vn}from"./number-zqlPMliA.js";import{a as Hn,i as Un,r as Wn,s as Gn}from"./useStudy-GwNcQWtv.js";import{t as Kn}from"./ready-jtAUOb62.js";import{t as qn}from"./DropSelect-DjbdVfIR.js";import{t as Jn}from"./route-D4kd-D3B.js";import{t as Yn}from"./useDashboards-SRk8LqHe.js";import{n as Xn,r as Zn}from"./value-Dx7DZob4.js";import{a as Qn,d as $n,g as er,l as tr,n as nr,p as rr,r as ir}from"./store-D2IJF4SA.js";import{t as ar}from"./useZoomGesture-CN0p0lHL.js";import{a as or,o as sr,t as cr}from"./store-D-f8ZuaK.js";import{SEED_SHIP as lr}from"./seed-b1xc0dj2.js";import{t as ur}from"./buildShip-BgFg98tH.js";import{n as dr}from"./parseDiff-D8uBQ9mQ.js";import{enrichShipModel as fr}from"./generate-Dl2EJ_SR.js";import{a as pr,c as mr,g as hr,h as gr,l as _r,o as vr,p as yr,r as br,t as xr}from"./store-BfHRbVKz.js";import{r as Sr}from"./courseSeed-CZdNBTTs.js";import{i as Cr,n as wr,r as Tr,t as Er}from"./mastery-CUfDeuqO.js";var U=t(),Dr=A(),Or=/\?\s*$|^\s*(what|why|how|when|where|who|which|can|could|should|would|is|are|do|does|tell me|show me|explain)\b/i;function kr(e){return Or.test(e.trim())}function Ar(e,t){let n=e.key,r=t.trim();if(!r)return null;switch(e.kind){case`number`:{let t=r.replace(/,/g,``).match(/-?\d+(\.\d+)?/);if(!t)return null;let i=Number(t[0]);return Number.isFinite(i)?{kind:`number`,key:n,value:i,...e.unit?{unit:e.unit}:{}}:null}case`choice`:{let t=e.options?.find(e=>r.toLowerCase().includes(e.toLowerCase()));return t?{kind:`choice`,key:n,value:t}:null}case`card`:return null;case`date`:return{kind:`date`,key:n,value:r};default:return{kind:`text`,key:n,value:r}}}function jr(e,t){if(e.phase!==`awaiting_input`||!e.activeKey)return!1;let n=e.blanks.find(t=>t.key===e.activeKey);if(!n)return!1;let r=Ar(n,t),i=kr(t);return r&&!i?(e.fill(r),!0):!r&&!i}function Mr(e){return e.alwaysOn&&e.sttOk&&!e.composerHasText}function Nr(e,t){let n=(0,U.useRef)({...e,...t});n.current={...e,...t};let r=e.listening||Mr(e);(0,U.useEffect)(()=>{if(!r)return;let e=()=>{document.hidden?n.current.listening&&n.current.stop():Mr(n.current)&&!n.current.listening&&n.current.start()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[r])}var W=r(),Pr=200;function Fr(e){let t=e.trim().split(/\s+/).filter(Boolean).length;return Math.min(8e3,700+t*360)}function Ir(e,t){let n=(0,U.useRef)(e);n.current=e;let[r,i]=(0,U.useState)(null),a=(0,U.useRef)(null),o=(0,U.useCallback)(e=>{a.current=e,i(e)},[]),s=(0,U.useRef)(void 0),c=(0,U.useRef)(void 0),l=(0,U.useCallback)(()=>{s.current!==void 0&&clearTimeout(s.current),c.current!==void 0&&clearTimeout(c.current),s.current=void 0,c.current=void 0},[]),u=(0,U.useCallback)(e=>{let t=n.current,r=e.id??null;if(t.takeWheel(),t.moveSpot(e),r&&r===a.current){t.hush(),l(),o(null);return}t.hush(),l();let i=r?t.lineFor(e):null;if(!i||!t.canSpeak()){o(null);return}o(r),s.current=setTimeout(()=>{s.current=void 0,n.current.speakLine(i),c.current=setTimeout(()=>{c.current=void 0,a.current===r&&o(null)},Fr(i))},Pr)},[l,o]);return(0,U.useEffect)(()=>()=>{l(),o(null)},[t,l,o]),{narrate:u,narratingId:r}}var Lr=`mavea-view-mode`,G=Lr,Rr=`everything`,zr=new Set([`canvas`,`world`]);function Br(e){return e===`focus`||e===`everything`||e===`canvas`||e===`world`}var K=null;function Vr(){try{if(typeof localStorage>`u`)return Rr;let e=localStorage.getItem(Lr);return Br(e)&&!zr.has(e)?e:Rr}catch{return Rr}}function Hr(){return Vr()}function q(){return K||(K=Vr(),K)}function Ur(e){if(Br(e)){K=e;try{typeof localStorage<`u`&&!zr.has(e)&&localStorage.setItem(Lr,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(G))}catch{}}}function Wr(){let[e,t]=(0,U.useState)(()=>q());return(0,U.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(q());return window.addEventListener(G,e),()=>window.removeEventListener(G,e)},[]),[e,(0,U.useCallback)(Ur,[])]}function Gr({value:e,onChange:t,onSend:n,listening:r,onMic:i,micMode:a=`tap`,micArmed:o=!1,micPaused:s=!1,micProcessing:c=!1,micDisabled:l=!1,placeholder:u,disabled:d,heard:f,focusSignal:p,onFiles:m,attachTitle:h,attachPulse:g,onMicDown:_,onForceStop:v,onMicCancel:y,tools:b,micExtra:x}){let S=(0,U.useRef)(null),C=(0,U.useRef)(null),[w,T]=(0,U.useState)(!1);(0,U.useEffect)(()=>{if(!g)return;T(!0);let e=setTimeout(()=>T(!1),1100);return()=>clearTimeout(e)},[g]);let E=(0,U.useRef)(!1),D=(0,U.useRef)(null),O=(0,U.useRef)(!1),k=(0,U.useRef)(y);k.current=y,(0,U.useEffect)(()=>()=>{E.current&&k.current?.()},[]),(0,U.useEffect)(()=>{a!==`hold`&&(O.current=!1,E.current&&(E.current=!1,D.current=null,k.current?.()))},[a]),(0,U.useEffect)(()=>{!r&&S.current&&S.current.focus()},[r]),(0,U.useEffect)(()=>{p&&S.current&&S.current.focus()},[p]);let A=(0,U.useCallback)(e=>{a!==`hold`||l||c||r||E.current||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),E.current=!0,D.current=e.pointerId,O.current=!0,_?.())},[l,c,r,a,_]),j=(0,U.useCallback)(()=>{E.current&&(E.current=!1,D.current=null,v?.())},[v]),M=(0,U.useCallback)(e=>{D.current===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),j())},[j]),N=(0,U.useCallback)(e=>{E.current&&(e&&D.current===e.pointerId&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),E.current=!1,D.current=null,y?.())},[y]),P=(0,U.useCallback)(e=>{a!==`hold`||l||c||r||E.current||e.repeat||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),E.current=!0,O.current=!0,_?.())},[r,l,a,c,_]),F=(0,U.useCallback)(e=>{a!==`hold`||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),j())},[j,a]),I=(0,U.useCallback)(()=>{if(a===`hold`||O.current){O.current=!1;return}l||c&&a!==`always`||i()},[i,l,a,c]),L=l?`Microphone off`:c&&a!==`always`?`Finishing voice input`:r?`Finish and send`:s?`Resume always-on`:o?`Pause always-on`:a===`hold`?`Hold to talk`:`Talk to Mavéa`,R=(0,W.jsx)(`button`,{className:`mic-btn`+(r?` listening`:``)+(o?` armed`:``)+(s?` paused`:``)+(c?` processing`:``)+(l?` mic-off`:``),onClick:I,onPointerDown:A,onPointerUp:M,onPointerCancel:N,onKeyDown:P,onKeyUp:F,title:L,"aria-label":L,"aria-busy":c,children:l?(0,W.jsx)(z.micOff,{}):(0,W.jsx)(z.mic,{})});return(0,W.jsxs)(`div`,{className:`composer`,children:[x?(0,W.jsxs)(`div`,{className:`mic-btn-wrap`,children:[R,x]}):R,f&&!e?(0,W.jsx)(`div`,{className:`live-listen heard`,children:(0,W.jsxs)(`span`,{style:{color:`var(--text-primary)`},children:[`"`,f,`"`]})}):r&&!e?(0,W.jsxs)(`div`,{className:`live-listen`,children:[(0,W.jsx)(`span`,{className:`wave`,children:[14,18,10,20,8,16,12].map((e,t)=>(0,W.jsx)(`i`,{style:{height:e}},t))}),`Listening…`]}):(0,W.jsx)(`input`,{ref:S,className:`composer-input`,name:`mavea-ask`,"aria-label":u||`Ask Mavéa anything`,autoComplete:`off`,value:e,disabled:d,placeholder:u||`Ask Mavéa anything — or just talk`,onChange:e=>t(e.target.value),onKeyDown:t=>{t.key===`Enter`&&e.trim()&&n(e)}}),m&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`input`,{ref:C,type:`file`,name:`mavea-attach`,accept:Mt,multiple:!0,disabled:d,hidden:!0,"aria-hidden":`true`,onChange:e=>{let t=Array.from(e.target.files??[]);t.length&&m(t),e.target.value=``}}),(0,W.jsx)(`button`,{type:`button`,className:`composer-tool`+(w?` is-pulsing`:``),title:h||`Attach a file`,"aria-label":h||`Attach a file`,disabled:d,onClick:()=>C.current?.click(),children:(0,W.jsx)(z.paperclip,{})})]}),b,(0,W.jsx)(`button`,{className:`send-btn`,disabled:d||!e.trim(),onClick:()=>n(e),title:`Send`,"aria-label":`Send`,children:(0,W.jsx)(z.send,{})})]})}i();var Kr=null;async function qr(){return Kr||(Kr=(await a(()=>import(`./corpus.generated-oX9uU93S.js`),[])).default,Kr)}function Jr(e){return Kr?.conversations.find(t=>t.id===e)}function Yr(e){return e.replace(/\b([\p{L}]+)-ish\b/gu,`roughly $1`).replace(/\s*[—–]\s*/g,`, `).replace(/(\p{L})-(?=\p{L})/gu,`$1 `).replace(/\s+-\s+/g,`, `).replace(/,\s*,+/g,`, `).replace(/\s{2,}/g,` `).trim()}function Xr(e){return{...e,question:Yr(e.question),narration:Yr(e.narration),spoken:e.spoken?Yr(e.spoken):e.spoken,tour:e.tour.map(e=>({...e,say:e.say?Yr(e.say):e.say,saySpoken:e.saySpoken?Yr(e.saySpoken):e.saySpoken}))}}var Zr=[{id:`talk`,title:`Speak naturally`,mode:`voice`,coach:`Start by speaking naturally or typing. I will understand either and respond out loud.`,spotlight:`.mic-btn`,action:{kind:`mic`},durationMs:6e3},{id:`connect`,title:`Bring your own model`,mode:`explain`,coach:`Choose Gemini, Claude, GPT, Grok, or OpenRouter, then paste your own API key. Start with a fast, lower cost model and move up only when a task needs it. The key stays in memory unless you choose Remember. Requests pass through this deployment, and your provider's usage charges, privacy, and retention terms apply.`,spotlight:`.settings-model-connect`,action:{kind:`connect`},durationMs:12e3},{id:`draws`,title:`See the answer`,mode:`explain`,coach:`Ask anything. I build a visual answer while I explain the important parts. Use the voice toggle labeled Mavéa's voice to turn speech off and reveal everything immediately. Your microphone stays unchanged.`,spotlight:`.voice-switch`,action:{kind:`answer`,convoId:`money`,ask:`How does $10,000 grow at 7% over 30 years?`},durationMs:9e3},{id:`mark`,title:`Follow the explanation`,mode:`explain`,coach:`Watch the Pen circle the result, then underline why it matters. Its marks stay with the answer.`,spotlight:`.pen-toggle-pill`,action:{kind:`penDemo`},durationMs:1e4,needsCanvas:!0},{id:`ask`,title:`Ask across the answer`,mode:`explain`,coach:`Choose Ask on two cards, then type a question. I will use both pieces of context together.`,spotlight:`.topic-wrap .block-ask, .ask-hint`,action:{kind:`askMulti`},durationMs:12e3,needsCanvas:!0},{id:`canvas`,title:`Explore the canvas`,mode:`explain`,coach:`Switch to Canvas when you want to explore the whole answer spatially.`,action:{kind:`canvas`,convoId:`travel`},durationMs:15e3},{id:`living-answer`,title:`Walk the why`,mode:`explain`,coach:`A living answer lays out the causes behind an answer. Watch as I walk it cause by cause and say what each one did.`,action:{kind:`showcase`,featureId:`living-answer`},durationMs:26e3},{id:`prism`,title:`Check the evidence`,mode:`explain`,coach:`Prism checks a document claim by claim and ties every finding to its source.`,action:{kind:`prism`},durationMs:32e3},{id:`share`,title:`Present or publish`,mode:`explain`,coach:`Turn a useful answer into a polished presentation or document.`,action:{kind:`export`},durationMs:16e3,needsCanvas:!0},{id:`yours`,title:`Try it yourself`,mode:`voice`,coach:`That is the tour. Now ask your first question.`,spotlight:`.mic-btn`,action:{kind:`mic`},durationMs:6e3}],Qr=[{id:`bend`,title:`Make it yours`,mode:`explain`,coach:`These are starting assumptions. Drag the rent and watch the comparison update.`,spotlight:`.bend-strip`,action:{kind:`bend`,convoId:`mortgage`},durationMs:8e3,needsCanvas:!0,glyph:`🎚️`,hook:`Drag a number, watch it recompute`},{id:`chips`,title:`Go deeper`,mode:`explain`,coach:`When an answer offers ways to go deeper, tap one and I'll take it further.`,spotlight:`.footer-keepgoing`,action:{kind:`chip`,convoId:`monthly`,label:`What if I added $500 monthly?`},durationMs:9e3,needsCanvas:!0,glyph:`💬`,hook:`Tap a suggestion, go deeper`},{id:`rail`,title:`Session history`,mode:`explain`,coach:`Settled turns stay on the left for this session. Jump back anytime.`,spotlight:`.rail-chat`,action:{kind:`rail`},durationMs:8e3,needsCanvas:!0,glyph:`📜`,hook:`Settled turns, replayable on the left`},{id:`highlight`,title:`Highlight to ask`,mode:`explain`,coach:`Choose Highlight, draw around any part of an answer, then ask about exactly what you marked.`,spotlight:`.mark-toggle`,action:{kind:`mark`},durationMs:8e3,needsCanvas:!0,glyph:`✎`,hook:`Draw around the exact part you mean`},{id:`range`,title:`A fitting picture`,mode:`explain`,coach:`Answers can choose from diagrams, flows, charts, and interactive maps.`,action:{kind:`montage`,convoIds:[`space`,`krebs`,`travel`]},durationMs:9e3,glyph:`🎨`,hook:`See the visual range`},{id:`focus`,title:`One card at a time`,mode:`explain`,coach:`Feeling overwhelmed? Focus puts one card center stage, one at a time.`,spotlight:`.focus-toggle`,action:{kind:`focusWalk`,convoId:`money`},durationMs:11e3,glyph:`🎯`,hook:`One card at a time, center stage`},{id:`think`,title:`Think out loud`,mode:`explain`,coach:`Not sure what to ask yet? Think out loud, and I will map your thoughts live.`,action:{kind:`listen`},durationMs:16e3,glyph:`🧠`,hook:`Think out loud, I map it live`},{id:`atlas`,title:`Memory and Atlas`,mode:`explain`,coach:`When Memory is enabled, saved facts and kept topics can shape Atlas.`,action:{kind:`atlas`},durationMs:9e3,glyph:`🗺️`,hook:`Kept topics become a place`},{id:`export`,title:`Export the answer`,mode:`explain`,coach:`Need to share it? Export the current answer as a styled slide deck or document.`,action:{kind:`export`},durationMs:12e3,needsCanvas:!0,glyph:`📄`,hook:`Any answer becomes a deck or document`},{id:`flashcards`,title:`Make it stick`,mode:`explain`,coach:`Learning something? Any card becomes a flashcard, kept right here on your device.`,action:{kind:`flashcards`},durationMs:8e3,needsCanvas:!0,glyph:`🎴`,hook:`Turn any card into a flashcard`},{id:`course`,title:`Master a subject`,mode:`explain`,coach:`Want to truly master something? I'll build you a course and teach it, one lesson at a time.`,spotlight:`.course-rail`,action:{kind:`course`},durationMs:12e3,glyph:`🎓`,hook:`A full course, a lesson at a time`},{id:`present`,title:`Fill the room`,mode:`explain`,coach:`Present fills the room with the answer while the microphone stays live.`,action:{kind:`present`},durationMs:9e3,needsCanvas:!0,glyph:`🖥️`,hook:`Fill the room, chrome falls away`},{id:`palette`,title:`Feature index, one key away`,mode:`explain`,coach:`Browse the feature index with one keystroke. Just press Command K.`,spotlight:`.cmdk-panel`,action:{kind:`palette`},durationMs:9e3,glyph:`⌘`,hook:`Feature index, one keystroke away`},{id:`ripple`,title:`See a change ripple`,mode:`explain`,coach:`Here is a real code change. See what it touches, what could break, and the safest order to ship it.`,action:{kind:`showcase`,featureId:`ripple`},durationMs:12e3,glyph:`🌊`,hook:`A code change's whole blast radius`},{id:`deepzoom`,title:`Telescope any topic`,mode:`explain`,coach:`Telescope a topic from the big picture all the way down to the finest detail.`,action:{kind:`showcase`,featureId:`deepzoom`},durationMs:1e4,glyph:`🔭`,hook:`From big picture to finest detail`},{id:`synthesis`,title:`Fuse many documents`,mode:`explain`,coach:`Drop in several documents and I combine them into one map of agreements, contradictions, and gaps.`,action:{kind:`showcase`,featureId:`synthesis`},durationMs:1e4,glyph:`🧬`,hook:`Many documents into one map`},{id:`memory`,title:`What I remember`,mode:`explain`,coach:`Everything I remember about you lives here. Review it, edit it, or forget it. It stays on your device.`,action:{kind:`showcase`,featureId:`memory`},durationMs:9e3,glyph:`🔖`,hook:`See, edit, or forget what I know`},{id:`library`,title:`Past conversations`,mode:`explain`,coach:`Every canvas you build is kept. Reopen any past conversation where you left it.`,action:{kind:`showcase`,featureId:`library`},durationMs:9e3,glyph:`📚`,hook:`Reopen a canvas you built before`},{id:`review`,title:`Study your cards`,mode:`explain`,coach:`Open Study to go through your flashcards. Keep it a plain pile, or let Mavéa space them out so the ones you find hard come back sooner.`,action:{kind:`showcase`,featureId:`review`},durationMs:9e3,glyph:`🧠`,hook:`Go through your flashcards`},{id:`manage-flashcards`,title:`Manage your deck`,mode:`explain`,coach:`Open your flashcard library to organize decks, edit cards, and choose what to study.`,action:{kind:`showcase`,featureId:`flashcards`},durationMs:9e3,glyph:`🗂️`,hook:`Organize and edit every study card`},{id:`track`,title:`Build a living dashboard`,mode:`explain`,coach:`Choose the parts you want to keep live, set a refresh schedule, and create a dashboard from this answer.`,action:{kind:`showcase`,featureId:`track`},durationMs:12e3,needsCanvas:!0,glyph:`📈`,hook:`Choose what stays live and how often`},{id:`delegate`,title:`Rehearse it first`,mode:`explain`,coach:`Prepare a hard conversation before you have it. Take the seat and practice your own lines, or send me to argue your side and read the debrief.`,action:{kind:`showcase`,featureId:`delegate`},durationMs:9e3,glyph:`🤝`,hook:`Practice it, or send me to scout it`},{id:`just-listen`,title:`Just listen`,mode:`explain`,coach:`Think out loud and I save what you say without answering, so you can sort it later.`,action:{kind:`showcase`,featureId:`just-listen`},durationMs:9e3,glyph:`👂`,hook:`Bank everything you say, sort it later`},{id:`recap`,title:`Recap the session`,mode:`explain`,coach:`Lost the thread? I'll recap everything we've covered this session at a glance.`,action:{kind:`showcase`,featureId:`recap`},durationMs:9e3,glyph:`📋`,hook:`Everything we've covered, at a glance`},{id:`ghost`,title:`Ghost answers`,mode:`explain`,coach:`While you listen, I quietly draft a response, so it is ready when you want it.`,action:{kind:`showcase`,featureId:`ghost`},durationMs:9e3,glyph:`👻`,hook:`I draft what I would say, quietly`},{id:`whisper`,title:`Whisper mode`,mode:`explain`,coach:`Need to stay quiet? Whisper mode lowers my voice to a soft murmur.`,action:{kind:`showcase`,featureId:`whisper`},durationMs:9e3,glyph:`🤫`,hook:`A quiet voice when you need it`},{id:`morning-brief`,title:`Morning brief`,mode:`explain`,coach:`Start the day with a brief of what changed across the things you track. It stays off until you turn it on.`,action:{kind:`showcase`,featureId:`morning-brief`},durationMs:9e3,glyph:`☀️`,hook:`Open the day with what's changed`},{id:`settings`,title:`Bring your own model`,mode:`explain`,coach:`Bring your own model, connect a provider, and tune how I answer. You control the key and the terms.`,action:{kind:`showcase`,featureId:`settings`},durationMs:9e3,glyph:`⚙️`,hook:`Connect a provider, tune the answers`},{id:`zoom-deck`,title:`Chapter view`,mode:`explain`,coach:`Pull back from the cards to the whole session, with every topic shown as a chapter.`,action:{kind:`showcase`,featureId:`zoom-deck`},durationMs:1e4,glyph:`📖`,hook:`Pull back to the whole session`},{id:`blanks`,title:`Fill in your own`,mode:`explain`,coach:`Some numbers are only yours to give. I leave glowing spaces and finish the answer around what you add.`,spotlight:`.blank-slot`,action:{kind:`blanksDemo`},durationMs:1e4,glyph:`◌`,hook:`Holes for the numbers only you know`}],$r=[...Zr,...Qr];function ei(e){return $r.find(t=>t.id===e)}var ti={money:`How does $10,000 grow at 7% over 30 years?`,monthly:`What if I added $500 monthly?`,mortgage:`Should I buy or rent a $500,000 home?`,space:`How does a black hole bend light?`,travel:`Plan me 5 days in Japan.`,budget:`Where does the US federal budget actually go?`,krebs:`Explain the Krebs cycle.`,url:`What actually happens when I open a website?`,neural:`How does a neural network learn?`,fitness:`Design me a 3-day strength routine.`};function ni(e,t){let n=Jr(e),r=n?.frames[0];if(!n||!r)return null;let i=Yr(t??ti[e]??n.question);return{frame:Xr({...r,question:i}),question:i}}var ri=[{key:`savings`,label:`Your savings`,prompt:`How much have you set aside for the break?`,kind:`number`,unit:`$`,placeholder:`e.g. 18,000`},{key:`spend`,label:`Monthly spend`,prompt:`Roughly what will you spend a month while travelling?`,kind:`number`,unit:`$/mo`,placeholder:`e.g. 2,400`}],ii=[{type:`insight`,id:`blanks-lede`,col:12,props:{title:`The money side of a 6-month break`,summary:`I've mapped the typical costs and what to sort out before you leave. Two numbers, though, are yours to give — so I've left them as holes rather than guess.`}},{type:`blanks`,id:`blanks-holes`,col:12,props:{title:`The parts only you can answer`,icon:`spark`,iconColor:`var(--presence)`,intro:`I've weighed everything I can. Fill these in and I'll finish the runway math around them.`,slots:ri}}],ai=[{type:`insight`,id:`blanks-verdict`,col:12,props:{title:`You can afford it — with a cushion`,summary:`$18,000 saved against $2,400 a month is about 7.5 months of runway — enough for a 6-month break with room to spare.`,stat:`7.5 months`,delta:`+1.5 vs. the plan`,deltaDir:`up`}},{type:`breakdown`,id:`blanks-runway`,col:12,props:{title:`Your runway`,rows:[{name:`Saved`,val:`$18,000`,pct:100},{name:`Spend / month`,val:`$2,400`,pct:32},{name:`6-month cost`,val:`$14,400`,pct:80},{name:`Left over`,val:`$3,600`,pct:20,tag:`cushion`,tagColor:`var(--presence)`}]}}];function oi(e,t){return{question:`Can I afford a 6-month career break?`,narration:t,mode:`replace`,tour:[],spec:e,at:0}}function si(e){let t={...e,title:`Can I afford a 6-month career break?`,sub:`The money side`,bend:void 0,sources:void 0,track:void 0},n={...t,blocks:ii,blanks:ri,awaiting:!0},r={...t,blocks:ai,blanks:void 0,awaiting:!1};return{holes:oi(n,``),filled:oi(r,`With eighteen thousand saved and twenty-four hundred a month, that’s about seven and a half months of runway — enough for six, with a cushion.`)}}function ci(){let e=!1,t=[];return{after(n,r){t.push(setTimeout(()=>!e&&r(),n))},cancel(){e=!0,t.forEach(clearTimeout)}}}function li(e,t){if(k()){t();return}let n=Date.now(),r=()=>{if(k()||Date.now()-n>=8e3){t();return}e(200,r)};e(200,r)}function ui(e,t,n,r=0){for(let i=1;i<=n.length;i++)e(r+i*22,()=>t(n.slice(0,i)));return r+n.length*22}function di(e){let t=Date.now(),n=e.maxExtraMs??2e4,r=0,i=window.setInterval(()=>{let a=Date.now()-t;a<e.minHoldMs||(r=e.isQuiet()?r+1:0,(r>=7||a>=e.minHoldMs+n)&&(window.clearInterval(i),e.advance()))},250);return()=>window.clearInterval(i)}var fi=450,pi=1600;function mi(e,t){if(e<=0)return[];let n=Math.max(pi,Math.floor((t-fi-400)/e));return Array.from({length:e},(e,t)=>fi+t*n)}var hi=1500,gi=900;function _i(e,t){let n=1850;if(e<=0)return{focusAt:hi,spotlightAt:[]};let r=Math.max(gi,Math.floor((t-n)/e));return{focusAt:hi,spotlightAt:Array.from({length:e},(e,t)=>n+t*r)}}var vi=[`I keep thinking about moving to Austin.`,`My sister already lives there.`,`But I'm worried about starting over.`,`And my lease runs until March.`,`Is it even the right time?`];function yi(e){return!!e&&Qr.some(t=>t.id===e)}function bi(e){return!!e&&Zr.some(t=>t.id===e)}function xi(e){let{active:t}=e,[n,r]=(0,U.useState)(()=>{let t=e.startChapter;return yi(t)||bi(t)&&e.solo?t??null:null}),[i,a]=(0,U.useState)(()=>{let t=e.startChapter;if(yi(t)||bi(t)&&e.solo)return 0;let n=t?Zr.findIndex(e=>e.id===t):-1;return n>=0?n:0}),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(!1),f=(0,U.useRef)(u);f.current=u;let[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(0),_=(0,U.useRef)(e.ops);_.current=e.ops;let v=n?ei(n):void 0,y=v?[v]:Zr,b=(0,U.useRef)(y);b.current=y;let x=y.length,S=t?y[i]??null:null,[C,w]=(0,U.useState)(!1),[T,E]=(0,U.useState)(!1),[D,A]=(0,U.useState)(0);(0,U.useEffect)(()=>{if(!t)return;let e=!0;return(async()=>{for(let t=0;e&&t<2;t++)try{await qr(),e&&w(!0);return}catch{}e&&E(!0)})(),()=>{e=!1}},[t,D]);let j=(0,U.useCallback)(()=>{E(!1),A(e=>e+1)},[]),M=(0,U.useCallback)(()=>{let e=_.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,U.useEffect)(()=>{if(!t||!o||p||!C)return;let e=b.current[i];if(!e)return;O(e.id,!!n);let r=_.current,a=ci(),s=a.after,c=e=>li(s,e),l=e=>c(()=>r.speak(e)),u=e=>r.showFrame(e.frame,e.question,{silent:!0});if(M(),e.needsCanvas&&!r.hasCanvas()){let e=ni(`money`);e&&u(e)}r.setMuted(f.current||e.mode===`silent`);let d=e.action;if(d.kind===`answer`){let e=ni(d.convoId,d.ask);if(e){let t=e.question,n={...e.frame,narration:``,spoken:``,tour:e.frame.tour.slice(0,4).map(e=>({...e,say:``,saySpoken:``}))};s(ui(s,r.typeInto,t)+360,()=>c(()=>r.showFrame(n,e.question)))}}else if(d.kind===`chip`){let e=ni(`money`);e&&u(e),s(1400,()=>r.pressKeepGoing(d.label)),s(2e3,()=>{let e=ni(d.convoId,d.label);e&&r.showFrame(e.frame,e.question)})}else if(d.kind===`montage`){let t=d.convoIds.map(e=>ni(e)).filter(Boolean),n=mi(t.length,e.durationMs);t.forEach((e,t)=>s(n[t],()=>u(e)))}else if(d.kind===`ask`)s(1300,()=>r.pinFirstBlock()),ui(s,r.typeInto,`Why does it grow faster after year 20?`,1700);else if(d.kind===`askMulti`){let e=ni(`money`);e&&u(e),s(1300,()=>r.pinFirstBlocks(2)),ui(s,r.typeInto,`How do these two parts explain the final total?`,2600)}else if(d.kind===`bend`){if(d.convoId){let e=ni(d.convoId);e&&u(e)}s(1400,()=>r.bendIt())}else if(d.kind===`rail`)s(1300,()=>r.toggleRail()),s(2600,()=>r.toggleRail());else if(d.kind===`export`)s(500,()=>r.openExport());else if(d.kind===`mark`)s(400,()=>r.setInkArmed(!0)),s(900,()=>r.scriptedMark());else if(d.kind===`penDemo`){let e=ni(`money`);e&&u(e),s(1200,()=>r.drawPenTourStep(`result`)),s(3900,()=>r.drawPenTourStep(`reason`)),s(7200,()=>r.setSpot(null))}else if(d.kind===`focus`)s(500,()=>r.setViewMode(`focus`));else if(d.kind===`canvas`){let e=ni(d.convoId);e&&u(e),s(1500,()=>r.setViewMode(`canvas`));let t=(e?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,3);t.forEach((e,t)=>s(2700+t*1900,()=>r.setSpot(e))),s(2700+t.length*1900,()=>r.setSpot(null))}else if(d.kind===`focusWalk`){let t=ni(d.convoId);t&&u(t);let n=(t?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e),{focusAt:i,spotlightAt:a}=_i(n.length,e.durationMs);s(i,()=>r.setViewMode(`focus`)),n.forEach((e,t)=>s(a[t],()=>r.setSpot(e)))}else if(d.kind===`listen`){s(400,()=>r.startWatchThinking());let e=800;for(let t of vi)e=ui(s,r.typeInto,t,e)+300,s(e,()=>{r.typeInto(``),r.bankThought(t)}),e+=800}else if(d.kind===`flashcards`)s(700,()=>r.openFlashcards());else if(d.kind===`course`)s(500,()=>r.openTourCourse());else if(d.kind===`connect`)s(400,()=>r.openModelSettings());else if(d.kind===`present`)s(500,()=>r.setPresenting(!0));else if(d.kind===`share`)s(500,()=>r.setShareOpen(!0)),s(3100,()=>r.shareRemix()),s(4900,()=>r.sharePalette(`Ember`));else if(d.kind===`palette`)s(500,()=>r.setPaletteOpen(!0));else if(d.kind===`atlas`)s(500,()=>r.openAtlas());else if(d.kind===`prism`)s(400,()=>r.openPrism(0));else if(d.kind===`memory`)s(700,()=>r.fireMemoryGlow());else if(d.kind===`showcase`)d.featureId===`recap`||d.featureId===`zoom-deck`?([`money`,`space`,`travel`].forEach((e,t)=>{let n=ni(e);n&&s(t*200,()=>u(n))}),s(1400,()=>r.showcaseFeature(d.featureId))):s(500,()=>r.showcaseFeature(d.featureId));else if(d.kind===`blanksDemo`){let e=ni(`money`)?.frame.spec;if(e){let{holes:t,filled:n}=si(e);u({frame:t,question:t.question}),s(5200,()=>r.showFrame(n,n.question))}}return e.mode!==`silent`&&!f.current&&s(160,()=>l(Yr(e.coach))),a.cancel},[i,h,t,o,p,C,n,M]),(0,U.useEffect)(()=>{if(!t||!o||p||!c||!C)return;let e=b.current[i];if(!e)return;let n=_.current;return di({minHoldMs:e.durationMs,isQuiet:()=>!n.isSpeaking()&&!n.isBusy(),advance:()=>{i+1>=x?(M(),m(!0)):a(i+1)}})},[i,h,t,o,p,c,C,x,n,M]),(0,U.useEffect)(()=>()=>M(),[M]);let N=(0,U.useCallback)(()=>{k(),s(!0),l(!0),m(!1)},[]),P=(0,U.useCallback)((e,t)=>{k(),m(!1),t?.keepPlaying||l(!1),a(Math.max(0,Math.min(b.current.length-1,e))),g(e=>e+1)},[]),F=(0,U.useCallback)(()=>{i+1>=x?(M(),m(!0)):P(i+1,{keepPlaying:!0})},[i,x,P,M]),I=(0,U.useCallback)(()=>P(i-1),[i,P]),L=(0,U.useCallback)(e=>P(e),[P]),R=(0,U.useCallback)(()=>{M(),r(null),s(!0),P(0),l(!0)},[P,M]),z=(0,U.useCallback)(e=>{yi(e)&&(k(),r(e),s(!0),m(!1),l(!0),a(0),g(e=>e+1))},[]),ee=(0,U.useCallback)(()=>{if(k(),!o){N();return}if(p){R();return}l(e=>!e)},[p,R,N,o]),te=(0,U.useCallback)(()=>{k();let e=!f.current;f.current=e,d(e);let t=b.current[i],n=t?.mode===`silent`,r=_.current;r.setMuted(e||n),e?r.cancelSpeech():o&&!p&&t&&!n&&r.speak(Yr(t.coach))},[p,i,o]),ne=(0,U.useCallback)(()=>{M(),m(!0)},[M]);return{active:t,started:o,index:i,total:x,chapter:S,coach:Yr(S?.coach??``),spotlight:S?.spotlight,playing:c,muted:u,done:p,corpusError:T,retryCorpus:j,solo:!!n,start:N,next:F,prev:I,jumpTo:L,toggle:ee,toggleMute:te,replay:R,skip:ne,playExtra:z}}var J=n();function Si(e){let t=window.innerWidth,n=window.innerHeight,r=Math.min(e.right,t)-Math.max(e.left,0),i=Math.min(e.bottom,n)-Math.max(e.top,0);return r>e.width*.5&&i>e.height*.5}var Ci=/^(hidden|auto|scroll|clip)$/;function wi(e,t){let n=e.top,r=e.left,i=e.right,a=e.bottom;for(let e=t.parentElement;e;e=e.parentElement){let t=getComputedStyle(e),o=Ci.test(t.overflowY),s=Ci.test(t.overflowX);if(!o&&!s)continue;let c=e.getBoundingClientRect();o&&(n=Math.max(n,c.top),a=Math.min(a,c.bottom)),s&&(r=Math.max(r,c.left),i=Math.min(i,c.right))}return new DOMRect(r,n,Math.max(0,i-r),Math.max(0,a-n))}function Ti(e,t){let n=(0,J.c)(4),[r,i]=(0,U.useState)(null),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(null);return}let n=!0,r=0,a=null,o=e=>{e===a||e!==null&&a!==null&&Math.abs(e.top-a.top)<.5&&Math.abs(e.left-a.left)<.5&&Math.abs(e.width-a.width)<.5&&Math.abs(e.height-a.height)<.5||(a=e,i(e))},s=e.split(`,`).map(Ai).filter(Boolean),c=()=>{if(!n)return;let e=null,t=null;for(let n of s){let r=Array.from(document.querySelectorAll(n)).filter(ki).map(Oi).filter(Di),i=r.find(Ei)??r[0];if(i){e=i.hit,t=i.rect;break}}if(!e||!t){o(null);return}let i=t;if(!Si(i)){let t=Date.now();t-r>1200&&(r=t,e.scrollIntoView({block:`center`,behavior:`smooth`})),o(null);return}o(i)};c();let l=window.setInterval(c,250);return window.addEventListener(`resize`,c),window.addEventListener(`scroll`,c,!0),()=>{n=!1,window.clearInterval(l),window.removeEventListener(`resize`,c),window.removeEventListener(`scroll`,c,!0)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,U.useEffect)(a,o),r}function Ei(e){let{rect:t}=e;return Si(t)}function Di(e){let{raw:t}=e;return t.width>0&&t.height>0}function Oi(e){let t=e.getBoundingClientRect();return{hit:e,raw:t,rect:wi(t,e)}}function ki(e){return!e.checkVisibility||e.checkVisibility({checkOpacity:!0})}function Ai(e){return e.trim()}function ji(e){let t=(0,J.c)(82),{driver:n}=e,r=Ti(n.spotlight,n.active&&n.started&&!n.done),i=(0,U.useRef)(null),a=n.active&&!n.done&&!n.started&&!n.corpusError,o;t[0]===a?o=t[1]:(o={active:a},t[0]=a,t[1]=o),oe(i,o);let s=n.active&&n.started&&!n.done?n.chapter?.id:void 0,c,l;if(t[2]===s?(c=t[3],l=t[4]):(c=()=>{if(s)return document.body.dataset.tourChapter=s,Ni},l=[s],t[2]=s,t[3]=c,t[4]=l),(0,U.useEffect)(c,l),!n.active||n.done)return null;if(n.corpusError){let e,r,i;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,W.jsx)(`h2`,{children:`This walkthrough couldn’t load`}),i=(0,W.jsx)(`p`,{children:`The recorded scenes did not come through. Check your connection and try again.`}),t[5]=e,t[6]=r,t[7]=i):(e=t[5],r=t[6],i=t[7]);let a;t[8]===n.retryCorpus?a=t[9]:(a=(0,W.jsx)(`button`,{type:`button`,className:`tourx-welcome-start`,onClick:n.retryCorpus,children:`Retry`}),t[8]=n.retryCorpus,t[9]=a);let o;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:Mi,children:`Back to home`}),t[10]=o):o=t[10];let s;return t[11]===a?s=t[12]:(s=(0,W.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{className:`tourx-welcome`,role:`alert`,children:[e,r,i,(0,W.jsxs)(`div`,{className:`tourx-welcome-actions`,children:[a,o]})]})}),t[11]=a,t[12]=s),s}if(!n.started){let e,r;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,W.jsx)(`h2`,{id:`tourx-welcome-title`,children:`See Mavéa in action`}),t[13]=e,t[14]=r):(e=t[13],r=t[14]);let a=n.total===1?`scene plays`:`scenes play`,o;t[15]!==n.total||t[16]!==a?(o=(0,W.jsxs)(`p`,{children:[n.total,` short `,a,` automatically. Pause, skip, or move at your own pace.`]}),t[15]=n.total,t[16]=a,t[17]=o):o=t[17];let s;t[18]===n.start?s=t[19]:(s=(0,W.jsx)(`button`,{type:`button`,className:`tourx-welcome-start`,onClick:n.start,children:`Start the tour`}),t[18]=n.start,t[19]=s);let c;t[20]===n.skip?c=t[21]:(c=(0,W.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:n.skip,children:`Skip tour`}),t[20]=n.skip,t[21]=c);let l;t[22]!==c||t[23]!==s?(l=(0,W.jsxs)(`div`,{className:`tourx-welcome-actions`,children:[s,c]}),t[22]=c,t[23]=s,t[24]=l):l=t[24];let u;return t[25]!==l||t[26]!==o?(u=(0,W.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{ref:i,className:`tourx-welcome`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tourx-welcome-title`,children:[e,r,o,l]})}),t[25]=l,t[26]=o,t[27]=u):u=t[27],u}let u=s===`ask`||!!r&&r.top+r.height/2>window.innerHeight*.58,d;t[28]===r?d=t[29]:(d=r&&(0,W.jsx)(`div`,{className:`tourx-ring`,style:{top:r.top-8,left:r.left-8,width:r.width+16,height:r.height+16}}),t[28]=r,t[29]=d);let f=`tourx-panel`+(n.solo?` is-solo`:``)+(u?` is-top`:``),p=n.solo?`Mini-demo controls`:`Walkthrough controls`,m=`head-`+n.index,h=n.solo?`Mini demo`:`${n.index+1} / ${n.total}`,g;t[30]===h?g=t[31]:(g=(0,W.jsx)(`span`,{className:`tourx-count`,children:h}),t[30]=h,t[31]=g);let _=n.chapter?.title,v;t[32]===_?v=t[33]:(v=(0,W.jsx)(`span`,{className:`tourx-title`,children:_}),t[32]=_,t[33]=v);let y;t[34]!==g||t[35]!==v||t[36]!==m?(y=(0,W.jsxs)(`div`,{className:`tourx-head`,children:[g,v]},m),t[34]=g,t[35]=v,t[36]=m,t[37]=y):y=t[37];let b=`coach-`+n.index,x;t[38]!==n.coach||t[39]!==b?(x=(0,W.jsx)(`p`,{className:`tourx-coach`,children:n.coach},b),t[38]=n.coach,t[39]=b,t[40]=x):x=t[40];let S;t[41]!==n.index||t[42]!==n.prev||t[43]!==n.solo?(S=!n.solo&&(0,W.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.prev,disabled:n.index===0,"aria-label":`Previous chapter`,children:(0,W.jsx)(z.chevL,{className:`tourx-ic`})}),t[41]=n.index,t[42]=n.prev,t[43]=n.solo,t[44]=S):S=t[44];let C=n.playing?`Pause autoplay`:`Turn on autoplay`,w;t[45]===n.playing?w=t[46]:(w=n.playing?(0,W.jsx)(z.pause,{className:`tourx-ic`}):(0,W.jsx)(z.play,{className:`tourx-ic`}),t[45]=n.playing,t[46]=w);let T=n.playing?`Pause`:`Autoplay`,E;t[47]===T?E=t[48]:(E=(0,W.jsx)(`span`,{children:T}),t[47]=T,t[48]=E);let D;t[49]!==n.toggle||t[50]!==C||t[51]!==w||t[52]!==E?(D=(0,W.jsxs)(`button`,{type:`button`,className:`tourx-btn tourx-play tourx-auto`,onClick:n.toggle,"aria-label":C,children:[w,E]}),t[49]=n.toggle,t[50]=C,t[51]=w,t[52]=E,t[53]=D):D=t[53];let O=n.muted?`Turn narration on`:`Mute narration`,k=n.muted?`Turn narration on`:`Mute narration`,A;t[54]===n.muted?A=t[55]:(A=n.muted?(0,W.jsx)(z.speakerOff,{className:`tourx-ic`}):(0,W.jsx)(z.speaker,{className:`tourx-ic`}),t[54]=n.muted,t[55]=A);let j;t[56]!==n.muted||t[57]!==n.toggleMute||t[58]!==O||t[59]!==k||t[60]!==A?(j=(0,W.jsx)(`button`,{type:`button`,className:`tourx-btn tourx-mute`,onClick:n.toggleMute,"aria-label":O,"aria-pressed":n.muted,title:k,children:A}),t[56]=n.muted,t[57]=n.toggleMute,t[58]=O,t[59]=k,t[60]=A,t[61]=j):j=t[61];let M;t[62]===n?M=t[63]:(M=!n.solo&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.next,"aria-label":`Next chapter`,children:(0,W.jsx)(z.chevR,{className:`tourx-ic`})}),(0,W.jsx)(`div`,{className:`tourx-dots`,role:`tablist`,"aria-label":`Chapters`,children:Array.from({length:n.total},(e,t)=>(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===n.index,"aria-label":`Chapter ${t+1}`,className:`tourx-dot`+(t===n.index?` is-active`:``),onClick:()=>n.jumpTo(t)},t))})]}),t[62]=n,t[63]=M);let N=n.solo?`Back to demos`:`Skip`,P;t[64]!==n.skip||t[65]!==N?(P=(0,W.jsx)(`button`,{type:`button`,className:`tourx-skip`,onClick:n.skip,children:N}),t[64]=n.skip,t[65]=N,t[66]=P):P=t[66];let F;t[67]!==S||t[68]!==D||t[69]!==j||t[70]!==M||t[71]!==P?(F=(0,W.jsxs)(`div`,{className:`tourx-controls`,children:[S,D,j,M,P]}),t[67]=S,t[68]=D,t[69]=j,t[70]=M,t[71]=P,t[72]=F):F=t[72];let I;t[73]!==y||t[74]!==x||t[75]!==F||t[76]!==f||t[77]!==p?(I=(0,W.jsxs)(`div`,{className:f,role:`group`,"aria-label":p,children:[y,x,F]}),t[73]=y,t[74]=x,t[75]=F,t[76]=f,t[77]=p,t[78]=I):I=t[78];let L;return t[79]!==I||t[80]!==d?(L=(0,W.jsxs)(`div`,{className:`tourx`,"aria-live":`polite`,children:[d,I]}),t[79]=I,t[80]=d,t[81]=L):L=t[81],L}function Mi(){window.location.hash=`#/`}function Ni(){delete document.body.dataset.tourChapter}function Pi({onStart:e,onReplay:t,onPlayExtra:n,hasStoredSession:r=!1}){let i=(0,U.useRef)(null);return oe(i),(0,W.jsx)(`div`,{ref:i,className:`tour-end`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-end-title`,children:(0,W.jsxs)(`section`,{className:`tour-end-card`,children:[(0,W.jsxs)(`header`,{className:`tour-end-intro`,children:[(0,W.jsx)(`div`,{className:`tour-end-mascot`,"aria-hidden":`true`,children:(0,W.jsx)(ue,{state:`idle`,emotion:`neutral`,gaze:`center`})}),(0,W.jsx)(`h2`,{id:`tour-end-title`,className:`tour-end-title tour-end-line`,children:`That's Mavéa.`}),(0,W.jsx)(`p`,{className:`tour-end-tagline tour-end-line`,children:`Talk to AI. See what it means.`}),(0,W.jsx)(`p`,{className:`tour-end-copy tour-end-line`,children:`Try it now, or open any scripted mini-demo below to see that feature operate on the real interface.`}),(0,W.jsxs)(`div`,{className:`tour-end-actions tour-end-line`,children:[(0,W.jsx)(`button`,{type:`button`,className:`tour-end-start`,onClick:e,children:r?`Back to your session`:`Start Mavéa`}),(0,W.jsx)(`button`,{type:`button`,className:`tour-end-replay`,onClick:t,children:`Replay the tour`})]})]}),(0,W.jsxs)(`div`,{className:`tour-end-extras`,children:[(0,W.jsx)(`h3`,{children:`More to explore`}),(0,W.jsx)(`div`,{className:`tour-end-grid`,children:Qr.map(e=>(0,W.jsxs)(`button`,{type:`button`,className:`tour-end-extra`,onClick:()=>n(e.id),"aria-label":`Play scripted mini-demo: ${e.title}`,children:[(0,W.jsx)(`span`,{className:`tour-end-glyph`,"aria-hidden":`true`,children:e.glyph}),(0,W.jsxs)(`span`,{className:`tour-end-extra-copy`,children:[(0,W.jsx)(`strong`,{children:e.title}),(0,W.jsx)(`small`,{children:e.hook})]})]},e.id))})]})]})})}var Fi=new Map([{persona:`cfo`,steps:[{ask:`Run my quarterly review: ARR grew from $12.4M to $15.1M, churn ticked up from 2.1% to 2.8%, and regions came in at NA $8.2M, EMEA $4.6M, APAC $2.3M.`,bakeAsk:`Run my quarterly review: ARR grew from $12.4M to $15.1M, churn ticked up from 2.1% to 2.8%, and regions came in at NA $8.2M, EMEA $4.6M, APAC $2.3M. Build the full picture, including growth, the churn drift, and how the regions stack up.`,expect:{minBlocks:4,suggests:!0}},{ask:`Walk me through the bridge: new business added $1.9M, expansion $1.3M, and churn gave back $0.5M.`,beats:[{kind:`pin`,atMs:900}],note:`Renata pins the bridge. The next question uses that context.`,expect:{minBlocks:2,suggests:!0}},{ask:`Forecast for next quarter`,bakeAsk:`Forecast for next quarter: if churn keeps drifting at this pace, where does ARR land? Model it from the numbers we established.`,viaChip:!0,expect:{minBlocks:2}},{beats:[{kind:`export`,atMs:500,format:`presentation`}],note:`One tap: the whole review becomes a board deck.`,holdMs:6500},{beats:[{kind:`dashboard`,atMs:500,settings:!0}],note:`A living dashboard keeps a board like this up to date.`,holdMs:6500},{beats:[{kind:`present`,atMs:500}],note:`…or presents itself, full screen.`,holdMs:6e3}]},{persona:`student`,steps:[{ask:`What does saving $200 a month at 5% become after 10 years?`,bakeAsk:`What does saving $200 a month at 5% interest become after 10 years? Chart it year by year, split what I put in from what the interest earned, and make the monthly amount adjustable.`,beats:[{kind:`bend`,atMs:1100}],note:`Grab the dial. The whole answer updates live.`,expect:{minBlocks:3,bend:!0,suggests:!0}},{ask:`Why does compound interest beat simple interest? It's on my econ exam.`,beats:[{kind:`pen`,atMs:1400}],note:`Mavéa’s Pen marks the exact part Maya is studying.`,expect:{minBlocks:2}},{beats:[{kind:`flashcards`,atMs:600}],note:`Any card can become a flashcard and join her study deck.`,holdMs:6e3}]},{persona:`dev`,steps:[{ask:`Explain how OAuth login works, step by step. I'm adding it to our app.`,beats:[{kind:`focus`,atMs:1200,walk:!0}],note:`Focus mode: one card at a time, everything else dims.`,expect:{minBlocks:3,suggests:!0}},{ask:`Compare session cookies and JWTs for keeping users signed in. Focus on tradeoffs, not dogma.`,bakeAsk:`Compare session cookies and JWTs for keeping users signed in. Show the real tradeoffs side by side, including revocation, statelessness, size, XSS and CSRF exposure, and when each wins.`,beats:[{kind:`pin`,atMs:1e3}],expect:{minBlocks:2}},{beats:[{kind:`palette`,atMs:600}],note:`Press Command K. Every feature is a keystroke away.`,holdMs:5e3},{beats:[{kind:`export`,atMs:500,format:`presentation`}],note:`The whole session becomes a polished presentation.`,holdMs:7500}]},{persona:`traveler`,steps:[{ask:`Plan a long weekend in Lisbon. Three days, first visit, and we love food and views.`,expect:{minBlocks:4,suggests:!0}},{ask:`How do we plan a great day trip to Sintra on Saturday?`,beats:[{kind:`canvas`,atMs:1e3}],note:`The spatial canvas: the whole trip on one board.`,expect:{minBlocks:2}},{beats:[{kind:`export`,atMs:500,format:`document`}],note:`The plan is ready to print for the plane.`,holdMs:7500}]}].map(e=>[e.persona,e]));function Ii(e){return Fi.get(e)}function Li(e){return e.steps.filter(e=>!!e.ask)}var Ri=1300,zi=900;function Bi(e,t){return(e?.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,t)}function Vi(e,t,n,r){switch(e.kind){case`pin`:r(e.atMs,()=>t.pinFirstBlock());break;case`bend`:n?.spec.bend&&r(e.atMs,()=>t.bendIt());break;case`mark`:r(e.atMs,()=>t.setInkArmed(!0)),r(e.atMs+500,()=>t.scriptedMark());break;case`pen`:r(e.atMs,()=>t.drawPenOnFirstBlock());break;case`focus`:r(e.atMs,()=>t.setViewMode(`focus`)),e.walk&&Bi(n,4).forEach((n,i)=>r(e.atMs+zi+i*Ri,()=>t.setSpot(n)));break;case`canvas`:{r(e.atMs,()=>t.setViewMode(`canvas`));let i=Bi(n,3);i.forEach((n,i)=>r(e.atMs+zi+i*Ri,()=>t.setSpot(n))),r(e.atMs+zi+i.length*Ri,()=>t.setSpot(null));break}case`export`:r(e.atMs,()=>t.openExport()),e.format===`document`&&r(e.atMs+1800,()=>t.exportSetFormat(`document`)),r(e.atMs+3e3,()=>t.exportPickTemplate(1));break;case`dashboard`:r(e.atMs,()=>t.openDashboards()),e.settings&&r(e.atMs+2600,()=>t.dashboardShowSettings());break;case`flashcards`:r(e.atMs,()=>t.openFlashcards());break;case`present`:r(e.atMs,()=>t.setPresenting(!0));break;case`share`:r(e.atMs,()=>t.setShareOpen(!0));break;case`palette`:r(e.atMs,()=>t.setPaletteOpen(!0))}}function Hi(e){switch(e.kind){case`canvas`:return 6400;case`focus`:return e.walk?7300:1600;case`export`:return e.format===`document`?4800:3800;case`dashboard`:return e.settings?4400:2600;case`mark`:return 2400;case`pen`:return 3200;default:return 1600}}function Ui(e){return e?.length?Math.max(...e.map(e=>e.atMs+Hi(e))):0}i();var Y=Object.assign({"./cfo.generated.json":()=>a(()=>import(`./cfo.generated-j5CXp1Zz.js`),[]),"./dev.generated.json":()=>a(()=>import(`./dev.generated-DYgVxL_4.js`),[]),"./student.generated.json":()=>a(()=>import(`./student.generated-DS_acPaJ.js`),[]),"./traveler.generated.json":()=>a(()=>import(`./traveler.generated-Beun9X7y.js`),[])});async function Wi(e){let t=Y[`./${e}.generated.json`];if(!t)return null;try{return(await t()).default??null}catch{return null}}var Gi=4500,Ki=1e3,qi=6e4;function Ji(e,t,n){if(!e[t]?.ask)return null;let r=e.slice(0,t+1).filter(e=>!!e.ask).length-1;return n.frames[r]??null}function Yi(e,t,n){let r=e.slice(0,t+1).filter(e=>!!e.ask).length;return n.frames[Math.max(0,r-1)]??null}function Xi(e){let{active:t,personaId:n}=e,r=n?Ii(n):void 0,i=r?.steps??[],a=i.length,[o,s]=(0,U.useState)(null),[c,u]=(0,U.useState)(`loading`),[d,f]=(0,U.useState)(()=>Math.max(0,Math.min(a-1,e.startStep??0))),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(!1),y=(0,U.useRef)(_);y.current=_;let[b,x]=(0,U.useState)(!1),[S,C]=(0,U.useState)(0),[w,T]=(0,U.useState)(null),E=(0,U.useRef)(e.ops);E.current=e.ops;let D=(0,U.useRef)(null),O=(0,U.useRef)(0),A=(0,U.useCallback)(()=>{if(!t||!n)return;u(`loading`);let e=++O.current;Wi(n).then(t=>{if(e!==O.current)return;let n=r?Li(r).length:0,i=!!t&&!!r&&t.frames.length===n;s(i?t:null),u(i?`ready`:`error`)})},[t,n,r]);(0,U.useEffect)(A,[A]);let j=(0,U.useCallback)(()=>{let e=E.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,U.useEffect)(()=>{if(!t||!p||b||c!==`ready`||!o||!r)return;let e=r.steps[d];if(!e)return;l(r.persona,d);let n=E.current,i=ci(),a=i.after;T(null),D.current=null,j(),n.setMuted(y.current);let s=Ji(r.steps,d,o),u=s??Yi(r.steps,d,o),f=e.ask?Yr(e.ask):null,m=s?Xr({...s,question:f??s.question}):null,h=u?Xr(u):null,g=()=>{let t=e.beats??[];for(let e of t)Vi(e,n,h,a);if(e.note){let n=t.length?Math.min(...t.map(e=>e.atMs)):0;a(n,()=>T(Yr(e.note??``)))}D.current=Date.now()+Ui(t)+(e.holdMs??Gi)},_=e=>{let t=Date.now(),r=0,i=()=>{if(Date.now()-t>=qi){g();return}if(r=n.isSpeaking()||n.isBusy()?0:r+1,r>=7){g();return}a(250,i)};a(e,i)};if(e.ask&&m){let t=r.steps.slice(0,d+1).filter(e=>!!e.ask).length-1,i=t>0?o.frames[t-1]??null:null,s=!!e.viaChip&&!!i?.spec.suggests?.some(t=>t.label===e.ask),c=f??e.ask,l;s?(a(700,()=>n.pressKeepGoing(e.ask??c)),l=1600):l=ui(a,n.typeInto,c,400)+360,a(l,()=>li(a,()=>n.showFrame(m,c))),_(l+Ki)}else!n.hasCanvas()&&h&&n.showFrame(h,h.question,{silent:!0}),a(300,g);return i.cancel},[d,S,t,p,b,c,o,r,j]),(0,U.useEffect)(()=>{if(!t||!p||b||!h||c!==`ready`)return;let e=E.current,n=window.setInterval(()=>{let t=D.current;!t||Date.now()<t||e.isSpeaking()||e.isBusy()||(window.clearInterval(n),d+1>=a?(j(),x(!0)):f(d+1))},250);return()=>window.clearInterval(n)},[d,S,t,p,b,h,a,c,j]),(0,U.useEffect)(()=>()=>j(),[j]);let M=(0,U.useCallback)(()=>{k(),m(!0),g(!0),x(!1)},[]),N=(0,U.useCallback)((e,t)=>{k(),x(!1),t?.keepPlaying||g(!1),f(Math.max(0,Math.min(a-1,e))),C(e=>e+1)},[a]),P=(0,U.useCallback)(()=>{d+1>=a?(j(),x(!0)):N(d+1,{keepPlaying:!0})},[d,a,N,j]),F=(0,U.useCallback)(()=>N(d-1),[d,N]),I=(0,U.useCallback)(e=>N(e),[N]),L=(0,U.useCallback)(()=>{j(),m(!0),N(0),g(!0)},[N,j]),R=(0,U.useCallback)(()=>{if(k(),!p){M();return}if(b){L();return}g(e=>!e)},[b,L,M,p]),z=(0,U.useCallback)(()=>{k();let e=!y.current;y.current=e,v(e),E.current.setMuted(e),e&&E.current.cancelSpeech()},[]),ee=(0,U.useCallback)(()=>{j(),x(!0)},[j]);return{active:t,started:p,loadState:c,model:o?.model??null,reload:A,index:d,total:a,step:t?i[d]??null:null,note:w,playing:h,muted:_,done:b,start:M,next:P,prev:F,jumpTo:I,toggle:R,toggleMute:z,replay:L,skip:ee}}function Zi(e){return/\p{Extended_Pictographic}/u.test(e)}function Qi(){window.location.hash=`#/`}function $i({driver:e,member:t,onExit:n}){let r=(0,U.useRef)(null),i=e.active&&e.loadState===`ready`&&(!e.started||e.done);if(oe(r,{active:i}),!e.active)return null;let a={"--accent":t.accent};if(e.loadState===`loading`)return(0,W.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{className:`demox-load`,style:a,children:[(0,W.jsx)(z.spinner,{className:`demox-spinner`}),`Loading curated replay…`]})});if(e.loadState===`error`)return(0,W.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{className:`demox-card`,style:a,role:`alert`,children:[(0,W.jsx)(`p`,{className:`demox-card-title`,children:`This demo couldn’t load`}),(0,W.jsx)(`p`,{className:`demox-card-body`,children:`The curated prerecorded example did not come through. Check your connection and try again.`}),(0,W.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.reload,children:`Retry`}),(0,W.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:Qi,children:`Back to home`})]})]})});if(!e.started)return(0,W.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{ref:r,className:`demox-card demox-start`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-start-title`,children:[(0,W.jsx)(`span`,{className:`demox-avatar`+(Zi(t.avatar)?` emoji`:``),children:t.avatar}),(0,W.jsx)(`span`,{className:`demox-card-kicker`,children:`Curated prerecorded example`}),(0,W.jsxs)(`p`,{id:`demox-start-title`,className:`demox-card-title`,children:[`Watch: `,t.useCase]}),(0,W.jsx)(`p`,{className:`demox-card-body`,children:`This fictional scenario replays prerecorded, model-generated answers with curated feature choreography. Pause or move between steps at any time.`}),(0,W.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.start,children:`Start demo`}),(0,W.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:Qi,children:`Back to home`})]})]})});if(e.done){let i=I.filter(e=>e.id!==t.id);return(0,W.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{ref:r,className:`demox-card demox-end`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-end-title`,children:[(0,W.jsx)(`span`,{className:`demox-avatar`+(Zi(t.avatar)?` emoji`:``),children:t.avatar}),(0,W.jsx)(`p`,{id:`demox-end-title`,className:`demox-card-title`,children:`End of curated replay`}),(0,W.jsx)(`p`,{className:`demox-card-body`,children:`These model-generated answers were prerecorded, then replayed with curated feature choreography. The scenario is illustrative, not a live result or customer testimonial. Try your own question with your selected provider.`}),(0,W.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:n,children:`Try it yourself`}),(0,W.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:e.replay,children:`Replay`})]}),(0,W.jsx)(`div`,{className:`demox-others`,role:`group`,"aria-label":`More curated replays`,children:i.map(e=>(0,W.jsxs)(`button`,{type:`button`,className:`demox-other`,style:{"--accent":e.accent},onClick:()=>g(e.id),title:`${e.name} · ${e.role}`,children:[(0,W.jsx)(`span`,{className:`demox-other-avatar`+(Zi(e.avatar)?` emoji`:``),children:e.avatar}),e.useCase]},e.id))})]})})}return(0,W.jsxs)(`div`,{className:`demox`,"aria-live":`polite`,children:[(0,W.jsxs)(`div`,{className:`demox-banner`,style:a,children:[(0,W.jsx)(`span`,{className:`demox-avatar`+(Zi(t.avatar)?` emoji`:``),children:t.avatar}),(0,W.jsxs)(`span`,{className:`demox-who`,children:[(0,W.jsx)(`span`,{className:`demox-name`,children:t.useCase}),(0,W.jsxs)(`span`,{className:`demox-role`,children:[t.name,` · `,t.role]})]}),(0,W.jsx)(`span`,{className:`demox-badge`,children:`Curated replay`})]}),e.note&&(0,W.jsx)(`div`,{className:`demox-note`,style:a,children:e.note},e.note),(0,W.jsxs)(`div`,{className:`demox-panel`,style:a,role:`group`,"aria-label":`Demo controls`,children:[(0,W.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.prev,disabled:e.index===0,"aria-label":`Previous step`,children:(0,W.jsx)(z.chevL,{className:`demox-ic`})}),(0,W.jsx)(`button`,{type:`button`,className:`demox-btn demox-play`,onClick:e.toggle,"aria-label":e.playing?`Pause autoplay`:`Turn on autoplay`,children:e.playing?(0,W.jsx)(z.pause,{className:`demox-ic`}):(0,W.jsx)(z.play,{className:`demox-ic`})}),(0,W.jsx)(`button`,{type:`button`,className:`demox-btn demox-mute`,onClick:e.toggleMute,"aria-label":e.muted?`Turn narration on`:`Mute narration`,"aria-pressed":e.muted,title:e.muted?`Turn narration on`:`Mute narration`,children:e.muted?(0,W.jsx)(z.speakerOff,{className:`demox-ic`}):(0,W.jsx)(z.speaker,{className:`demox-ic`})}),(0,W.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.next,"aria-label":`Next step`,children:(0,W.jsx)(z.chevR,{className:`demox-ic`})}),(0,W.jsx)(`div`,{className:`demox-dots`,role:`tablist`,"aria-label":`Steps`,children:Array.from({length:e.total},(t,n)=>(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":n===e.index,"aria-label":`Step ${n+1}`,className:`demox-dot`+(n===e.index?` is-active`:``),onClick:()=>e.jumpTo(n)},n))}),(0,W.jsxs)(`button`,{type:`button`,className:`demox-skip`,onClick:n,"aria-label":`Exit demo, try it yourself`,children:[(0,W.jsx)(`span`,{className:`demox-skip-full`,children:`Exit, try it yourself`}),(0,W.jsx)(`span`,{className:`demox-skip-short`,"aria-hidden":`true`,children:`Exit`})]})]})]})}i();var ea=[`nasa-cfd`,`fomc`,`weather`,`cars`,`react-readme`],ta=null;async function na(){return ta||(ta=[...(await a(()=>import(`./prism.generated-BQkO5r6r.js`),[])).default.docs].sort((e,t)=>{let n=ea.indexOf(e.id),r=ea.indexOf(t.id);return(n<0?99:n)-(r<0?99:r)}).map(e=>({id:e.id,type:e.type,name:e.name,doc:{name:e.name,mime:e.mime,data:e.data,size:e.size},spec:{...e.spec,claims:e.spec.claims.map(e=>({...e,kind:Pt(e.kind)}))},proposed:e.proposed})),ta)}var ra=`How does $10,000 grow at 7% over 30 years?`;function ia(){let e=Jr(`money`)?.frames[0]?.spec.blocks??[],t=Jr(`monthly`)?.frames[0]?.spec.blocks??[],n=[],r=(e,t,r=1)=>{for(let i of t)for(let t of e)t.type===i&&t.id&&!n.includes(t)&&r-->0&&n.push(t)};return r(e,[`chart`]),r(e,[`stacked`,`stack`]),r(t,[`chart`]),r(t,[`kpi`,`stack`,`stacked`]),r(e,[`breakdown`]),n}function aa(){let e=zt().find(e=>e.question===ra);if(e)return e.id;let t=ia();if(t.length===0)return null;let n=Vt({title:`Investment growth · $10k at 7%`,question:ra,topic:`money`});return n.thesis={text:`Your initial $10,000 grows by more than 7.6× through the power of compounding interest.`,saidAt:n.createdAt},n.widgets=t.map(e=>Rt(e,`tour`)),n.cadence={data:`hourly`,ai:`daily`},n.nextDataAt=It(n.createdAt,Ft[n.cadence.data]),n.nextAiAt=It(n.createdAt,Bt[n.cadence.ai]),Lt(n),n.id}function oa(e,t){let n=e.length,r=new ArrayBuffer(44+n*2),i=new DataView(r);function a(e,t){for(let n=0;n<t.length;n++)i.setUint8(e+n,t.charCodeAt(n))}a(0,`RIFF`),i.setUint32(4,36+n*2,!0),a(8,`WAVE`),a(12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*2,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),a(36,`data`),i.setUint32(40,n*2,!0);let o=44;for(let t=0;t<n;t++){let n=Math.max(-1,Math.min(1,e[t]));i.setInt16(o,n<0?n*32768:n*32767,!0),o+=2}return r}i();var sa=12,ca=2813,la=3;function ua(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function da(e){let t=e&&typeof e==`object`&&`name`in e?String(e.name):void 0;return t===`NotAllowedError`||t===`SecurityError`?`not-allowed`:`audio`}function fa(e){return e?45e3:25e3}var pa=class t{mode=`vad`;capabilities;vad=null;vadLoading=!1;vadFailed=!1;phase=`idle`;muted=!1;wantRunning=!1;continuous=!1;disposed=!1;sessionId=0;transcriptionAbort=null;transcriptionChain=Promise.resolve();queuedTranscriptions=0;preRollFrames=[];utteranceFrames=[];maveaSpeaking=!1;echoTailUntil=0;onBargeIn;utteranceIsEcho=!1;bargeInTimer=null;static ECHO_TAIL_MS=600;static WHISPER_RETRY_MS=1e4;whisperOk=null;whisperRetryAt=0;resultSubs=new Set;stateSubs=new Set;constructor(){let e=typeof navigator<`u`&&typeof navigator.mediaDevices?.getUserMedia==`function`;this.capabilities={stt:e,tts:!1,canUseRealVoice:e}}start(e){if(!this.muted){if(e?.continuous!==void 0&&(this.continuous=e.continuous),this.wantRunning||(this.sessionId+=1),this.wantRunning=!0,this.vadFailed){this.emitState({phase:`idle`,error:`unsupported`});return}this.vad?this.startVad():this.loadVad()}}stop(){this.wantRunning=!1,this.continuous=!1,this.sessionId+=1,this.transcriptionAbort?.abort(),this.transcriptionAbort=null,this.pauseVad(),this.clearBargeInTimer(),this.preRollFrames=[],this.utteranceFrames=[],this.phase!==`idle`&&this.emitState({phase:`idle`})}forceStop(){if(this.phase===`transcribing`){this.continuous=!1,this.wantRunning=!1,this.pauseVad();return}let e=this.continuous;this.wantRunning=e,this.pauseVad(),this.clearBargeInTimer();let t=ua([...this.utteranceFrames,...this.preRollFrames]);this.preRollFrames=[],this.utteranceFrames=[],this.utteranceIsEcho=!1,t.length>0?(this.emitState({phase:`transcribing`}),this.enqueueTranscription(t,this.sessionId,e)):(this.emitState({phase:`idle`}),e&&this.startVad())}speak(e){return Promise.resolve()}cancel(){this.stop()}setMuted(e){this.muted=e,e&&this.stop()}setMaveaSpeaking(e){this.maveaSpeaking&&!e&&(this.echoTailUntil=Date.now()+t.ECHO_TAIL_MS),this.maveaSpeaking=e}setSoundEnabled(e){}onResult(e){return this.resultSubs.add(e),()=>this.resultSubs.delete(e)}onStateChange(e){return this.stateSubs.add(e),()=>this.stateSubs.delete(e)}dispose(){this.disposed=!0,this.wantRunning=!1,this.sessionId+=1,this.transcriptionAbort?.abort(),this.transcriptionAbort=null,this.clearBargeInTimer(),this.vad&&=(this.vad.destroy().catch(()=>{}),null),this.resultSubs.clear(),this.stateSubs.clear()}async loadVad(){if(!this.vadLoading){this.vadLoading=!0;try{let{MicVAD:t}=await a(async()=>{let{MicVAD:t}=await import(`./dist-kNHRtoqd.js`).then(t=>e(t.default,1));return{MicVAD:t}},__vite__mapDeps([0,1,2]));if(this.vad=await t.new({model:`v5`,startOnLoad:!1,baseAssetPath:`/`,onnxWASMBasePath:`/`,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechMs:280,preSpeechPadMs:500,redemptionMs:1600,onFrameProcessed:(e,t)=>this.captureFrame(t),onSpeechStart:()=>this.handleSpeechStart(),onSpeechRealStart:()=>this.handleSpeechRealStart(),onSpeechEnd:e=>void this.handleSpeechEnd(e),onVADMisfire:()=>this.handleMisfire()}),this.disposed){this.vad.destroy().catch(()=>{}),this.vad=null;return}this.vadLoading=!1,this.wantRunning&&this.startVad()}catch(e){console.warn(`[VadVoice] Local Silero VAD failed to load`,e),this.vadLoading=!1,this.vadFailed=!0,this.wantRunning&&this.emitState({phase:`idle`,error:`unsupported`})}}}clearBargeInTimer(){this.bargeInTimer!==null&&(clearTimeout(this.bargeInTimer),this.bargeInTimer=null)}startVad(){this.vad&&Promise.resolve(this.vad.start()).catch(e=>{!this.disposed&&this.wantRunning&&(this.wantRunning=!1,this.emitState({phase:`idle`,error:da(e)}))})}pauseVad(){this.vad&&Promise.resolve(this.vad.pause()).catch(()=>{})}captureFrame(e){let t=e.slice();if(this.phase===`listening`&&!this.utteranceIsEcho){this.utteranceFrames.length<ca&&this.utteranceFrames.push(t);return}this.preRollFrames.push(t),this.preRollFrames.length>sa&&this.preRollFrames.shift()}handleSpeechStart(){this.muted||(this.utteranceIsEcho=Date.now()<this.echoTailUntil,this.utteranceFrames=this.preRollFrames,this.preRollFrames=[],!this.utteranceIsEcho&&this.emitState({phase:`listening`}))}handleSpeechRealStart(){this.muted||(this.utteranceIsEcho&&!this.maveaSpeaking&&(this.utteranceIsEcho=!1,this.utteranceFrames=[...this.utteranceFrames,...this.preRollFrames],this.preRollFrames=[],this.emitState({phase:`listening`})),!this.utteranceIsEcho&&this.maveaSpeaking&&this.onBargeIn?.())}handleMisfire(){this.clearBargeInTimer(),this.utteranceIsEcho=!1,this.utteranceFrames=[],this.continuous||(this.wantRunning=!1,this.pauseVad()),this.phase!==`idle`&&this.emitState({phase:`idle`})}handleSpeechEnd(e){if(this.clearBargeInTimer(),this.utteranceIsEcho){this.utteranceIsEcho=!1,this.utteranceFrames=[],this.emitState({phase:`idle`});return}this.utteranceFrames=[],this.continuous||(this.wantRunning=!1,this.pauseVad()),this.emitState({phase:`transcribing`}),this.enqueueTranscription(e,this.sessionId)}enqueueTranscription(e,t,n=!1){if(this.queuedTranscriptions>=la){this.emitState({phase:`idle`,error:`audio`}),n&&this.wantRunning&&this.startVad();return}this.queuedTranscriptions+=1,this.transcriptionChain=this.transcriptionChain.catch(()=>{}).then(async()=>{try{if(this.disposed||t!==this.sessionId)return;let r=new AbortController;this.transcriptionAbort=r;let i=await this.transcribeWhisper(e,r.signal);if(this.transcriptionAbort===r&&(this.transcriptionAbort=null),this.disposed||r.signal.aborted||t!==this.sessionId)return;let a=i.text.trim();if(a){let e=i.confidence!==void 0&&i.confidence<.7||(i.noSpeechProbability??0)>=.6;this.emitState({phase:`heard`,transcript:a}),this.emitResult({transcript:a,confidence:i.confidence,noSpeechProbability:i.noSpeechProbability,lowConfidence:e})}else{this.emitState({phase:`idle`,error:i.error??`no-speech`}),n&&this.wantRunning&&this.startVad();return}this.emitState({phase:`idle`}),n&&this.wantRunning&&this.startVad()}finally{--this.queuedTranscriptions}})}async transcribeWhisper(e,t){let n=await this.transcribeWhisperDetailed(e,t);return t?n:n.text}async transcribeWhisperDetailed(e,n){if(this.whisperOk===!1&&Date.now()<this.whisperRetryAt)return{text:``,error:`transcription`};try{let t=oa(e,16e3),r=new FormData;r.append(`file`,new Blob([t],{type:`audio/wav`}),`speech.wav`),r.append(`language`,`en`),r.append(`response_format`,`verbose_json`);let i=fa(this.whisperOk===!0),a=AbortSignal.timeout(i),o=n?AbortSignal.any([n,a]):a,s=await fetch(`/stt/inference`,{method:`POST`,body:r,signal:o});if(s.ok){let e=await s.json(),t=e.text?.trim()??``;if(this.whisperOk=!0,this.whisperRetryAt=0,t){let n=[...e.words??[],...(e.segments??[]).flatMap(e=>e.words??[])].map(e=>e.probability).filter(e=>Number.isFinite(e)),r=(e.segments??[]).map(e=>e.avg_logprob).filter(e=>Number.isFinite(e)),i=n.length>0?n.reduce((e,t)=>e+t,0)/n.length:r.length>0?Math.exp(r.reduce((e,t)=>e+t,0)/r.length):void 0,a=(e.segments??[]).map(e=>e.no_speech_prob).filter(e=>Number.isFinite(e));return{text:t,confidence:i,noSpeechProbability:a.length>0?Math.max(...a):void 0}}return{text:``,error:`no-speech`}}}catch(e){if(e instanceof DOMException&&(e.name===`TimeoutError`||e.name===`AbortError`))return{text:``,error:`transcription`}}return this.whisperOk!==!0&&(this.whisperOk=!1,this.whisperRetryAt=Date.now()+t.WHISPER_RETRY_MS),{text:``,error:`transcription`}}emitResult(e){this.resultSubs.forEach(t=>t(e))}emitState(e){this.phase=e.phase,this.stateSubs.forEach(t=>t(e))}};function ma(){return new pa}function ha(e={}){let t=(0,U.useRef)(e.onResult),n=(0,U.useRef)(e.onStateChange),r=(0,U.useRef)(e.onBargeIn);t.current=e.onResult,n.current=e.onStateChange,r.current=e.onBargeIn;let i=(0,U.useMemo)(()=>ma(),[]);return(0,U.useEffect)(()=>{let e=i.onResult(e=>t.current?.(e)),a=i.onStateChange(e=>n.current?.(e));return`onBargeIn`in i&&(i.onBargeIn=()=>r.current?.()),()=>{e(),a(),i.dispose()}},[i]),(0,U.useMemo)(()=>({mode:i.mode,capabilities:i.capabilities,start:e=>i.start(e),stop:()=>i.stop(),speak:e=>i.speak(e),cancel:()=>i.cancel(),setMuted:e=>i.setMuted(e),setSoundEnabled:e=>i.setSoundEnabled(e),setMaveaSpeaking:e=>i.setMaveaSpeaking?.(e),forceStop:()=>i.forceStop?.()}),[i])}var ga=`mavea-always-on`;function _a(e,t,n=!1,r=`neutral`,i=!1){if(t)return{state:`listening`,emotion:`neutral`,gaze:`center`};if(n)return i?{state:`showing`,emotion:`surprised`,gaze:`center`}:{state:`speaking`,emotion:`surprised`,gaze:`center`};switch(e){case`thinking`:return{state:`loading`,emotion:`neutral`,gaze:`center`};case`speaking`:return i?{state:`showing`,emotion:r,gaze:`center`}:{state:`speaking`,emotion:r,gaze:`center`};case`showing`:return{state:`showing`,emotion:r,gaze:`right`};default:return{state:`idle`,emotion:r,gaze:`center`}}}var va=new Set([`no`,`caution`,`avoid`,`risk`,`wait`]),ya=new Set([`yes`,`go`,`recommended`,`good`]);function ba(e,t){let n=e.props[t];return typeof n==`string`?n.toLowerCase():void 0}function xa(e){let t=e?.blocks;if(!t?.length)return`neutral`;let n=!1,r=e?.awaiting===!0;for(let e of t){let t=ba(e,`tone`);(t===`warn`||t===`neg`)&&(n=!0),t===`pos`&&(r=!0);let i=ba(e,`stance`);i&&va.has(i)&&(n=!0),i&&ya.has(i)&&(r=!0),e.type===`insight`&&e.props.conf===`unverified`&&(n=!0)}return n?`concerned`:r?`warm`:`neutral`}function Sa(e){switch(e){case`concerned`:return`concerned`;case`warm`:return`warm`;default:return`neutral`}}function Ca(e){return Sa(xa(e))}function wa(e){let t=e?.blocks;return!t?.length||xa(e)!==`warm`?!1:t.some(e=>{let t=ba(e,`stance`);return t!==void 0&&ya.has(t)})}var Ta={clipShared:[`Nice — that one's worth sharing.`,`Off it goes.`,`Clipped and ready to share.`]};Object.keys(Ta);function Ea(e,t,n){let r=Ta[e];if(r.length===0)return``;let i=Math.abs(Math.trunc(t))%r.length;return r.length>1&&r[i]===n&&(i=(i+1)%r.length),r[i]}function Da(){return{lastAt:0,lastTurn:-1/0}}function Oa(e,t){return!(e.lastAt!==0&&t.now-e.lastAt<9e4||t.turnCount-e.lastTurn<3)}function ka(e,t){return{lastAt:t.now,lastTurn:t.turnCount}}var Aa=1100,ja=6e3,Ma=150,Na=950,Pa=350,Fa=8;function Ia(e){let{muted:t,turnCount:n,gates:r}=e,i=(0,U.useRef)(e.speak),a=(0,U.useRef)(e.cancelSpeak),o=(0,U.useRef)(e.isSpeaking);i.current=e.speak,a.current=e.cancelSpeak,o.current=e.isSpeaking;let[s,c]=(0,U.useState)([]),[l,u]=(0,U.useState)(!1),[d,f]=(0,U.useState)(null),[p,m]=(0,U.useState)(0),h=(0,U.useRef)(Da()),g=(0,U.useRef)(void 0),_=(0,U.useRef)(null),v=(0,U.useRef)(null),y=(0,U.useCallback)(()=>{_.current&&=(clearTimeout(_.current),null),v.current&&=(clearTimeout(v.current),null)},[]),b=(0,U.useCallback)(e=>{c(t=>t.length>=Fa||t[t.length-1]===e?t:[...t,e])},[]),x=(0,U.useCallback)(()=>{y(),u(!1),v.current=setTimeout(()=>{v.current=null,f(null)},Na)},[y]),S=(0,U.useCallback)(e=>{let t=()=>{let n=Date.now()-e;n>=Aa&&!o.current()||n>=ja?x():_.current=setTimeout(t,Ma)};_.current=setTimeout(t,Aa)},[x]),C=r.atRest&&!r.busy&&!r.listening&&!r.introHold&&r.hasCanvas&&!r.modalOpen;(0,U.useEffect)(()=>{if(l||d!==null||!C||s.length===0)return;if(o.current()){let e=setTimeout(()=>m(e=>e+1),Pa);return()=>clearTimeout(e)}let e=s[0],r=Date.now();if(!Oa(h.current,{type:e,now:r,turnCount:n})){c(e=>e.slice(1));return}h.current=ka(h.current,{type:e,now:r,turnCount:n});let a=Ea(e,r,g.current);g.current=a,c(e=>e.slice(1)),f(a),u(!0),!t&&a&&i.current(a),S(r)},[l,d,C,s,n,t,S,p]),(0,U.useEffect)(()=>{if(!l)return;let e=r.busy||!r.atRest,t=r.listening||r.modalOpen;!e&&!t||(y(),u(!1),f(null),c([]),g.current=void 0,t&&!e&&a.current())},[l,r.busy,r.atRest,r.listening,r.modalOpen,y]);let w=(0,U.useCallback)(()=>{y(),c([]),u(!1),f(null),h.current=Da(),g.current=void 0},[y]);return(0,U.useEffect)(()=>()=>y(),[y]),{interjecting:l,line:d,enqueue:b,reset:w}}function La(e){let t=(0,J.c)(36),{chapters:n,currentIndex:r,onJump:i,onClose:a}=e,o=(0,U.useRef)(null),s;if(t[0]===a?s=t[1]:(s={onEscape:a},t[0]=a,t[1]=s),oe(o,s),n.length===0)return null;let c;t[2]===n?c=t[3]:(c=wt(n),t[2]=n,t[3]=c);let l=c,u;t[4]!==n||t[5]!==r?(u=n.find(e=>e.moments.some(e=>e.frameIndex===r))?.color,t[4]=n,t[5]=r,t[6]=u):u=t[6];let d=u,f;t[7]===a?f=t[8]:(f=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},t[7]=a,t[8]=f);let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsx)(`h2`,{className:`ovw-title`,children:`Your conversation`}),t[9]=p):p=t[9];let m=n.length===1?`chapter`:`chapters`,h=l===1?`moment`:`moments`,g;t[10]!==n.length||t[11]!==m||t[12]!==h||t[13]!==l?(g=(0,W.jsxs)(`header`,{className:`ovw-head`,children:[p,(0,W.jsxs)(`p`,{className:`ovw-sub`,children:[n.length,` `,m,` · `,l,` `,h,` — tap anywhere to dive back in`]})]}),t[10]=n.length,t[11]=m,t[12]=h,t[13]=l,t[14]=g):g=t[14];let _;if(t[15]!==n||t[16]!==r||t[17]!==a||t[18]!==i){let e;t[20]!==r||t[21]!==a||t[22]!==i?(e=e=>(0,W.jsxs)(`section`,{className:`ovw-card`,style:{"--card-c":e.color},children:[(0,W.jsxs)(`div`,{className:`ovw-card-head`,children:[(0,W.jsx)(`span`,{className:`ovw-card-dot`}),(0,W.jsx)(`h3`,{className:`ovw-card-title`,children:e.title}),(0,W.jsx)(`span`,{className:`ovw-card-count`,children:e.moments.length})]}),(0,W.jsx)(`ul`,{className:`ovw-moments`,children:e.moments.map(e=>{let t=e.frameIndex===r,n=z[e.icon]||z.mic;return(0,W.jsxs)(`li`,{children:[(0,W.jsxs)(`button`,{type:`button`,className:`ovw-moment`+(t?` is-current`:``),onClick:()=>{i(e.frameIndex),a()},"aria-current":t?`true`:void 0,children:[(0,W.jsx)(n,{}),(0,W.jsx)(`span`,{className:`ovw-moment-q`,children:e.question||`Moment`})]}),e.elements.length>0&&(0,W.jsx)(`ul`,{className:`ovw-els`,children:e.elements.map(t=>{let n=t.icon&&z[t.icon]||z.spark;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,className:`ovw-el`,onClick:()=>{i(e.frameIndex,t.id),a()},"aria-label":`Jump to "${t.label}" in "${e.question||`this moment`}"`,children:[(0,W.jsx)(n,{}),(0,W.jsx)(`span`,{className:`ovw-el-label`,children:t.label})]})},t.id)})})]},e.frameIndex)})})]},e.id),t[20]=r,t[21]=a,t[22]=i,t[23]=e):e=t[23],_=n.map(e),t[15]=n,t[16]=r,t[17]=a,t[18]=i,t[19]=_}else _=t[19];let v;t[24]===_?v=t[25]:(v=(0,W.jsx)(`div`,{className:`ovw-grid`,children:_}),t[24]=_,t[25]=v);let y;t[26]!==v||t[27]!==g?(y=(0,W.jsxs)(`div`,{className:`ovw-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":`Conversation overview`,ref:o,onClick:Ra,children:[g,v]}),t[26]=v,t[27]=g,t[28]=y):y=t[28];let b;t[29]!==a||t[30]!==y||t[31]!==f?(b=(0,W.jsx)(`div`,{className:`ovw-scrim`,onClick:a,role:`button`,tabIndex:0,"aria-label":`Close conversation overview`,onKeyDown:f,children:y}),t[29]=a,t[30]=y,t[31]=f,t[32]=b):b=t[32];let x;return t[33]!==d||t[34]!==b?(x=(0,W.jsx)(Le,{accent:d,children:b}),t[33]=d,t[34]=b,t[35]=x):x=t[35],x}function Ra(e){return e.stopPropagation()}function za(e){let t=new Map;for(let n of e)for(let e of n.spec?.sources??[])e?.url&&!t.has(e.url)&&t.set(e.url,e);return[...t.values()]}function Ba(e,t={}){if(e.length<2)return null;let n=e[e.length-1]?.spec;if(!n)return null;let r=t.cap??1/0,i=e.reduce((e,t)=>Re(e,t.spec?.blocks??[],`augment`).blocks,[]),a=i.length>r,o=a?i.slice(0,r):i,s=e.length,c=a?`${s} moments in this thread · showing the first ${r} cards`:`${s} moments in this thread`,l=za(e);return{...n,id:t.id??n.id,title:t.title??n.title,sub:c,blocks:o,sources:l.length?l:n.sources,tint:t.tint??n.tint,suggests:[],bend:void 0,awaiting:void 0,blanks:void 0}}var Va=240;function Ha(e){let{stops:t,from:n=0,spokenWalk:r,withNotes:i,teach:a,marksById:o}=e,s=[],c=0;for(let e=n;e<t.length;e++){let n=t[e].spot;if(!n)continue;let l=t[e].line;if(r&&e>0&&i&&l){let e=ot(l);e&&s.push({spot:n,line:l,noteText:e})}let u=o.get(n);if(u?.length){let e=u.length>1;for(let t=0;t<u.length;t++){let r=t===u.length-1;s.push({spot:n,line:l,mark:u[t],generous:a,delayMs:c*Va,badgeMs:r?at+(u.length-1)*Va:void 0,stepNumber:e?t+1:void 0}),c++}}else a&&(s.push({spot:n,line:l,generous:!0,delayMs:c*Va}),c++)}return s}var Ua=1100,Wa=1700;function Ga(e,t,n){let{controller:r,release:i}=e,a=!1,o=e=>{a||(a=!0,i(),n(e))},s=()=>t.isCancelled()?`cancelled`:t.isDismissed()?`dismissed`:null;(async()=>{for(let e=0;e<r.count;e++){let n=s();if(n){o(n);return}let i=r.spokenFor(e)??r.captionFor(e);if(i){let n=t.speakLine(i),a=await nt(n),c=s();if(c){o(c);return}r.setIndex(e),a?await Xe(n,Wa,Ua):await Qe(Wa)}else r.setIndex(e),await Qe(Wa)}let e=s();o(e??`complete`)})()}function Ka(e,t,n){if(e.length===0)return e;let r=new Map;n.forEach((e,t)=>{let n=Ve(e),i=r.get(n);i?i.push(t):r.set(n,[t])});let i=new Map;n.forEach((e,t)=>{let n=Ve(e);i.has(n)||i.set(n,t)});let a=e=>{if(e.kind!==`connect`)return e;let n=t[e.onIndex??-1],r=n?i.get(Ve(n)):void 0;return r===void 0?void 0:{...e,onIndex:r}},o=e=>{let t=(e.marks??(e.mark?[e.mark]:[])).map(a).filter(e=>!!e);return t.length?{mark:t[0],...t.length>1?{marks:t}:{}}:{}},s=[],c=new Set;for(let n of e){let e=t[n.index];if(!e)continue;let i=r.get(Ve(e))?.shift();if(i===void 0||c.has(i))continue;c.add(i);let{mark:a,marks:l}=o(n),u={...n,index:i,mark:a,marks:l},d=i===n.index&&a===n.mark&&l===n.marks;s.push(d?n:u)}return s}function qa(e,t,n,r,i){let a={question:n,narration:r.narration,title:r.spec.title,blockTypes:r.spec.blocks.map(e=>e.type)},o=Be(e,a,r.continuity,r.tier),s=!e||o===`replace`&&He(e,a)<.15,c=i?.forceReplace?`replace`:o,l=Re(t,r.spec.blocks,c);c!==`replace`&&l.overflow&&(c=`replace`,l=Re(t,r.spec.blocks,`replace`));let u={...r.spec,blocks:l.blocks};c!==`replace`&&delete u.bend;let d=c===`replace`?l.blocks.find(e=>e.id)?.id??null:l.firstNewId,f=Ka(r.tour??[],r.spec.blocks,l.blocks),p=Date.now();return{frame:{id:We(p),question:n,narration:r.narration,...r.spoken?{spoken:r.spoken}:{},mode:c,topicShift:s,tour:f,spec:u,at:p,...r.corrects?{corrects:r.corrects}:{}},mode:c,spot:d,snap:a}}var Ja={like:`Likes`,love:`Loves`,prefer:`Prefers`,enjoy:`Enjoys`,hate:`Hates`,dislike:`Dislikes`,need:`Needs`,want:`Wants`,own:`Owns`,use:`Uses`,drive:`Drives`,play:`Plays`,speak:`Speaks`,work:`Works`,live:`Lives`,study:`Studies`,train:`Trains`,teach:`Teaches`,code:`Codes`,run:`Runs`,cook:`Cooks`,travel:`Travels`},Ya=3,Xa=140;function Za(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Qa(e){let t=e.trim().replace(/\s+/g,` `);if(!t||t.length>Xa||t.includes(`?`))return``;let n=t.toLowerCase(),r;if(r=t.match(/^i(?:'m| am)\s+(an?\s+.+)/i))return $a(`Is ${r[1]}`);if(r=t.match(/^i(?:'m| am)\s+(.+)/i))return $a(r[1]);if(r=t.match(/^i(?:'ve| have)\s+(?:got\s+)?(.+)/i))return $a(`Has ${r[1]}`);if(r=t.match(/^my\s+(.+?)\s+(is|are)\s+(.+)/i))return $a(`${r[1]} ${r[2]} ${r[3]}`);if(r=n.match(/^i\s+(\w+)\s+(.+)/)){let e=Ja[r[1]];if(e)return $a(`${e} ${t.slice(t.toLowerCase().indexOf(r[2]))}`)}return``}function $a(e){let t=Za(e.trim().replace(/\s+/g,` `));return t.length>=6&&t.length<=Xa?t:``}function eo(e){if(!e)return[];let t=e.split(/[.!?\n]+|,?\s+\band\b\s+/i),n=[];for(let e of t){let t=Qa(e);if(t&&!n.includes(t)&&n.push(t),n.length>=Ya)break}return n}var to=.6,no=.5;function ro(e){return(e.match(/\d[\d,.]*\d|\d/g)??[]).map(e=>e.replace(/,/g,``).replace(/\.+$/,``))}function io(e,t){let n=ro(e);if(!n.length)return!1;let r=new Set(ro(t));return n.some(e=>!r.has(e))}function ao(e,t,n={}){if(!io(e,t)){let n=En(e),r=En(t);if(n.size>0&&An(n,r)>=to)return`user-stated`}return n.webGrounded?`web-grounded`:`model-inferred`}function oo(e,t){let n=ro(e),r=new Set(ro(t));if(n.length)return n.every(e=>r.has(e))?`user-stated`:`model-inferred`;let i=En(e);return i.size>0&&An(i,En(t))>=no?`user-stated`:`model-inferred`}var so=24;function co(e,t=`item`){let n=e.toLowerCase().match(/[a-z][a-z0-9]*/g);return(n&&n[0]?n[0]:t).slice(0,so)}function lo(e,t={}){return{concept:`corrections.${co(e.what)}`,body:`On "${e.what}", an earlier answer said ${e.was}; the user corrected it to ${e.now}. Use the corrected value and double-check figures like this before stating them.`,kind:`procedural`,source:t.source??`user-stated`,verify:!0,outcome:`loss`,turnId:t.turnId,quote:e.now}}var uo=4,fo=1600,po=24,mo=`Break ONE cause into the parts it is MADE OF (components or segments) — never its causes or its effects, which are separate nodes. Return ONLY compact JSON, one line.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-kNHRtoqd.js","assets/rolldown-runtime-DkW27tQK.js","assets/preload-helper-CiWYd9n-.js","assets/generateLive-B6purd69.js","assets/blockLabel-FogyzEQY.js","assets/layout-CEoNLr-w.js","assets/catalog-BHjl-1uH.js","assets/history-D2EH2X6D.js","assets/catalog-Db9GWM6N.js","assets/facts-BUGuVUIc.js","assets/blockTypes-DUDdP3pB.js","assets/streamParse-B-Gjwa9T.js","assets/liveSchema-B4bQtO88.js","assets/icons-gLFQTv74.js","assets/jsx-runtime-DeHZSEgm.js","assets/spokenText-C88IQJ0M.js","assets/safeImageUrl-BINWXOTz.js","assets/sourceHost-BV3t2XDb.js","assets/annotations-CftUUB13.js","assets/screen-DFWKge3-.js","assets/attachments-BW-vki-E.js","assets/providers-BovElgRL.js","assets/http-Lar_UMKb.js","assets/info-CiqHR5cs.js","assets/shapes-Cx5SCKgj.js","assets/speed-K5_Ebj-8.js","assets/cache-CvbSI-pr.js","assets/validate-sGUCmPAs.js","assets/types-C42I77wh.js","assets/json-B0N3XRZU.js","assets/verbatim-DBTj9sPD.js","assets/citation-BsSvaaer.js","assets/number-zqlPMliA.js","assets/receipts-D7zveV-I.js","assets/officeDoc-GU6Cssjf.js","assets/csv-DAqzYXUs.js","assets/search-ZN7v_P5B.js","assets/store-BWLbFXiY.js","assets/contentVault-xfUwSJ3i.js","assets/keyVault-Aw5Y2PjT.js","assets/ready-jtAUOb62.js","assets/now-C9-UAzTC.js","assets/TopicCanvas-DozfZFto.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/index-zIa6h_8b.js","assets/useInView-CXTOAEV3.js","assets/coreIcons-DDTChE1H.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-7IrMJ70_.js","assets/index-DrzNHwlO.css","assets/loader-DCA6Njbf.js","assets/FallbackCard-ap_4wOfj.js","assets/FallbackCard-D_6ps1xA.css","assets/useFocusTrap-DBtkeyRy.js","assets/motion-BY_Egaxm.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/CanvasSkeleton-CRGWlafo.js","assets/CanvasSkeleton-iy6DBvde.css","assets/richText-BkxJhl9N.js","assets/toast-BBNs2h3L.js","assets/format-q0LwBjID.js","assets/useValidatedImage-BQi2c66o.js","assets/lib-B7OE1ZQQ.js","assets/BlockEmpty-B82uCse8.js","assets/motion-DxHSlPN6.js","assets/lib-DMAxsZKm.css","assets/TopicCanvas-uRuHi99s.css","assets/HowItWorks-D-hgfN6a.js","assets/generateBeats-DtptFLlG.js","assets/walkSync-CT8kmbzY.js","assets/kokoro-B3oG_8sd.js","assets/nextFrame-12y0UrAd.js","assets/canvas-vqIFVmtP.js","assets/ReplayCard-F7U3LYAg.js","assets/annotationReel-K2FYv-3B.js","assets/registry-Dd1lcXrO.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/ReplayCard-Cs6mzTRa.css","assets/CommandPalette-Bs6tpdZl.js","assets/registry-DGNSqTxE.js","assets/CommandPalette-Bb-eErih.css","assets/Library-DmdzY2se.js","assets/neighborhoods-D7QjURnE.js","assets/chapters-Dqm4iLDa.js","assets/threads-Cu2t3070.js","assets/time-BHTmJR1s.js","assets/Library-DmrtHjUf.css","assets/LiveSettings-C9cKOrSb.js","assets/FeatureUseNotice-Dc3GNBvy.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/useLiveConfig-Cpy0_E_-.js","assets/store-gohr8YVT.js","assets/friendlyAsk-BBdRZIar.js","assets/quietHours-DI1ayIIq.js","assets/DropSelect-QcBm3N4D.js","assets/DropSelect-DilESAgA.css","assets/useStudy-5CsF_L-s.js","assets/store-D2IJF4SA.js","assets/queue-Adae4IzW.js","assets/LiveSettings-CmgrMqvK.css","assets/DashboardDetail-DYFghZ4p.js","assets/store-CsjDEADX.js","assets/route-D4kd-D3B.js","assets/useDashboards-SRk8LqHe.js","assets/format-g3dP8OI3.js","assets/ledger-Cv0LBflx.js","assets/dataPending-DGdCvY5Y.js","assets/AreaChart-DZGCSEwt.js","assets/tiles-D-s6v-mA.js","assets/tiles-CBiVVjtT.css","assets/useDashboardLoop-BoVNM-pT.js","assets/predictions-CkVKHq-5.js","assets/notify-Bz4wuE4T.js","assets/dashboardEvents-D-XVj666.js","assets/confirmAdd-DkmbWaSk.js","assets/planTracker-KKAtTBWs.js","assets/pin-BZuh1acO.js","assets/pin-D-4Zjiik.css","assets/CadenceCard-P4teI7Se.js","assets/CheckLogRail-DO7sbZwC.js","assets/useLedger-1WVXef68.js","assets/checkLogModel-BMtruriG.js","assets/CheckLogRail-BOaXnqWK.css","assets/DashboardDetail-8J8TsdQg.css","assets/dashboards-C1u2ks-d.css","assets/DashboardSettings-CE0B2y2y.js","assets/UnderstoodPanel-DmJph4el.js","assets/UnderstoodPanel-Q6GX1TFq.css","assets/ZoomDeck-CKOjYS9z.js","assets/portal-k_BMgWND.js","assets/useZoomGesture-CN0p0lHL.js","assets/ZoomDeck-B2SjNwY7.css","assets/AtlasView-B82UfrEX.js","assets/store-D-f8ZuaK.js","assets/AtlasView-B5fkQhO6.css","assets/RippleOverlay-D7ItTvS-.js","assets/buildShip-BgFg98tH.js","assets/parseDiff-D8uBQ9mQ.js","assets/incident-D3bmMmES.js","assets/githubToken-Bwa7V9YT.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/RippleOverlay-_iiZsQVZ.css","assets/CardEditor-DABIhGdQ.js","assets/CardEditor-BY1bZiV6.css","assets/CourseRail-DXt3bzjU.js","assets/store-BfHRbVKz.js","assets/generateCourse-C9qvaJRo.js","assets/useSrsCards-C27o39fF.js","assets/deckLine-NBd3MyGT.js","assets/CourseRail-CUa7uIGG.css","assets/MindMapViewerDrawer-DI_S7fRZ.js","assets/MindShape-C_Bo9hW9.js","assets/Presence-UqXfH4Y-.js","assets/geometry-DXAbnb0J.js","assets/MindShape-CaPeUo-a.css","assets/Recap-T9DtFaEk.js","assets/Recap-DCiiWNiV.css","assets/LibraryOverlay-YHBrdVKo.js","assets/LibraryOverlay-CnKWDMG_.css","assets/ReplayOverlay-BTldvkU7.js","assets/replay-B5TkHPri.js","assets/AnnotationLayer-8JABh1Dm.js","assets/gesture-Bouqjr3g.js","assets/emphasize-BqCIst-B.js","assets/AnnotationLayer-ClU-e6qL.css","assets/ReplayOverlay-DzkcTnCA.css","assets/ShareModal-9jSn52Mw.js","assets/capture-9OrAc1p2.js","assets/share-kW3pZ027.js","assets/ReelJelly-D5e-jt-8.js","assets/ShareModal-D1QuQEko.css","assets/ExportModal-Ya0VBbxa.js","assets/notes-B6eX5XWk.js","assets/registry-CPiwQhAm.js","assets/scale-Bcgfo6Hp.js","assets/registry-types-D3q_LrlV.js","assets/fitText-DQ2omSN0.js","assets/registry-CNgybLQv.css","assets/registry-6DGRAB1m.js","assets/openWorld-BHTJM39n.js","assets/display-CAb_PiGv.js","assets/registry-BZuT2Epw.css","assets/registry-CcOO8UZr.js","assets/registry-2GJZ46M8.css","assets/registry-CPImC7mO.js","assets/empty-BO1NC9qY.js","assets/registry-B1KQ1VPZ.css","assets/registry-B0GIHERt.js","assets/spreadLabels-CQ8hufvK.js","assets/registry-CuVk7MAI.css","assets/registry-D8O0apUT.js","assets/CodeOutput-DF892aIR.js","assets/useTimeout-Cm4yzted.js","assets/registry-BzNLfje1.css","assets/registry-Vp8VuMV0.js","assets/registry-twSIyxJQ.css","assets/registry-BFbfXK-W.js","assets/registry-UFIuwh3i.css","assets/registry-7poQfBaM.js","assets/registry-ZOWzhOHk.css","assets/registry-C28gYnVq.js","assets/registry-CRisz4Ca.css","assets/registry-Bv1f5UU4.js","assets/registry-CvylL2BN.css","assets/registry-Ci65uThi.js","assets/useSpotlightWalk-DxlxBezO.js","assets/registry-BAoRB8rd.css","assets/registry-1wlTAh5b.js","assets/registry-T3i2Q9SI.css","assets/registry-BFrgx1tE.js","assets/registry-Cse2wF7x.css","assets/registry-DtV2UjBx.js","assets/quizResult-DB8yeqDr.js","assets/stepDriver-DwjFet6U.js","assets/registry-B5S3brjM.css","assets/registry-w4R6c89s.js","assets/safeCssColor-di93BXgG.js","assets/registry-4mMEt1Xy.css","assets/registry-DO4hGO5e.js","assets/registry-CRM7y8QT.css","assets/registry-B2QzCuWH.js","assets/registry-Dye5m3qt.css","assets/registry-BSX3aFUw.js","assets/registry-C3ezxLR3.css","assets/registry-Dwbh-GWu.js","assets/registry-tkd3UhWn.css","assets/registry-WHd1PwU3.js","assets/registry-DpMI23iE.css","assets/registry-Daypk4uR.js","assets/registry-GeSy4i7R.css","assets/registry-Xl8mAnKq.js","assets/registry-Dru0JcTa.css","assets/registry-DLyrLfe-.js","assets/notes-A9t4jdfx.css","assets/ready-Ba6nk9O1.js","assets/ExportModal-D4WpAg2c.css","assets/ExtractionPreview-BFrmqKDo.js","assets/store-DpObYU1u.js","assets/relate-UW-sUlJH.js","assets/PinToDashboard-BCiWaSg8.js","assets/PrismOverlay-DJDGPGxo.js","assets/penStrokes-DlHnO9xE.js","assets/types-CaO6xOn5.js","assets/pen-DNMslo3e.js","assets/PrismOverlay-BTfAicBt.css","assets/WorldOverlay-yhxq328s.js","assets/value-Dx7DZob4.js","assets/types-DuEbJpIA.js","assets/engine-BiM6INsW.js","assets/engine-CTvOaA86.css","assets/WorldOverlay-D7ay5y4D.css","assets/SynthesisOverlay-iesJ0hEt.js","assets/PresentationDeck-BW_7qecK.js","assets/pageVisibility-BxUVsw7Z.js","assets/DelegatePanel-DKWsRY9I.js","assets/DelegatePanel-Cf85-0qE.css","assets/SrsReview-DhWNYYv7.js","assets/SrsReview-B1B2VekR.css","assets/TourPrism-kInUOv-M.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{t as n}from"./compiler-runtime-qQQXpJgv.js";import{t as r}from"./jsx-runtime-DeHZSEgm.js";import{n as i,t as a}from"./preload-helper-CiWYd9n-.js";import{r as o,t as s}from"./preloadableLazy-MIX1ApBW.js";import{A as c,B as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,N as v,P as y,Q as b,R as x,T as S,U as C,V as w,W as T,Y as E,a as D,et as O,f as k,it as A,j,k as M,p as N,q as P,r as F,t as I,u as L,z as R}from"./index-zIa6h_8b.js";import{n as z}from"./icons-gLFQTv74.js";import{n as ee,t as te}from"./spokenText-C88IQJ0M.js";import{a as ne,i as B,n as re}from"./loader-DCA6Njbf.js";import{n as ie,r as ae}from"./blockLabel-FogyzEQY.js";import{t as oe}from"./useFocusTrap-DBtkeyRy.js";import{t as se}from"./motion-BY_Egaxm.js";import{n as V,o as ce,t as le}from"./CanvasSkeleton-CRGWlafo.js";import{t as ue}from"./Presence-UqXfH4Y-.js";import{t as de}from"./MindShape-C_Bo9hW9.js";import{n as fe}from"./openWorld-BHTJM39n.js";import{i as pe,r as me,t as he}from"./display-CAb_PiGv.js";import{r as H,t as ge}from"./sourceHost-BV3t2XDb.js";import{t as _e}from"./stepDriver-DwjFet6U.js";import{A as ve,C as ye,D as be,E as xe,O as Se,T as Ce,_ as we,b as Te,c as Ee,d as De,h as Oe,j as ke,l as Ae,o as je,r as Me,u as Ne,v as Pe,w as Fe,y as Ie}from"./kokoro-B3oG_8sd.js";import{t as Le}from"./portal-k_BMgWND.js";import{a as Re,i as ze,o as Be,r as Ve,s as He}from"./threads-Cu2t3070.js";import{t as Ue}from"./FeatureUseNotice-Dc3GNBvy.js";import{n as We,r as Ge}from"./history-D2EH2X6D.js";import{n as Ke}from"./nextFrame-12y0UrAd.js";import{a as qe,d as Je,i as Ye,l as Xe,n as Ze,o as Qe,r as $e,s as et,t as tt,u as nt}from"./walkSync-CT8kmbzY.js";import{n as rt,t as it}from"./generateBeats-DtptFLlG.js";import{n as at,r as ot,t as st}from"./AnnotationLayer-8JABh1Dm.js";import{n as ct}from"./emphasize-BqCIst-B.js";import{a as lt,s as ut}from"./streamParse-B-Gjwa9T.js";import{n as dt,t as ft}from"./registry-DLyrLfe-.js";import{t as pt}from"./ready-Ba6nk9O1.js";import{t as mt}from"./registry-DGNSqTxE.js";import{i as ht,r as gt}from"./info-CiqHR5cs.js";import{t as _t}from"./friendlyAsk-BBdRZIar.js";import{a as vt,c as yt,i as bt,n as xt,r as St,s as Ct}from"./store-DpObYU1u.js";import{n as wt,r as Tt}from"./chapters-Dqm4iLDa.js";/* empty css */import{g as Et,h as Dt,l as Ot,m as kt,p as At,s as jt,t as Mt,v as Nt}from"./attachments-BW-vki-E.js";import{t as Pt}from"./types-CaO6xOn5.js";import{J as Ft,Z as It,a as Lt,c as Rt,m as zt,q as Bt,u as Vt}from"./store-CsjDEADX.js";import{t as Ht}from"./providers-BovElgRL.js";import{a as Ut,c as Wt,l as Gt,n as Kt,o as qt,r as Jt,s as Yt,u as Xt}from"./useLiveConfig-Cpy0_E_-.js";import{prewarmLive as Zt}from"./prewarm-uKxmzjjd.js";import{_ as Qt,c as $t,f as en,h as tn,i as nn,n as rn,p as an,v as on,x as sn,y as cn}from"./shapes-Cx5SCKgj.js";import{t as ln}from"./TopbarMenu-DQXxqSWY.js";import{a as un,o as dn,r as fn}from"./store-gohr8YVT.js";import{a as pn,c as mn,d as hn,f as gn,i as _n,l as vn,m as yn,o as bn,p as xn,s as Sn,t as Cn}from"./quietHours-DI1ayIIq.js";import{a as wn,c as Tn,d as En,i as Dn,n as On,t as kn,u as An}from"./store-BWLbFXiY.js";import{n as jn}from"./speed-K5_Ebj-8.js";import{i as Mn,n as Nn,t as Pn}from"./cache-CvbSI-pr.js";import{r as Fn}from"./verbatim-DBTj9sPD.js";import{n as In}from"./citation-BsSvaaer.js";import{n as Ln,o as Rn,t as zn}from"./validate-sGUCmPAs.js";import{n as Bn,t as Vn}from"./number-zqlPMliA.js";import{a as Hn,i as Un,r as Wn,s as Gn}from"./useStudy-5CsF_L-s.js";import{t as Kn}from"./ready-jtAUOb62.js";import{t as qn}from"./DropSelect-QcBm3N4D.js";import{t as Jn}from"./route-D4kd-D3B.js";import{t as Yn}from"./useDashboards-SRk8LqHe.js";import{n as Xn,r as Zn}from"./value-Dx7DZob4.js";import{a as Qn,d as $n,g as er,l as tr,n as nr,p as rr,r as ir}from"./store-D2IJF4SA.js";import{t as ar}from"./useZoomGesture-CN0p0lHL.js";import{a as or,o as sr,t as cr}from"./store-D-f8ZuaK.js";import{SEED_SHIP as lr}from"./seed-b1xc0dj2.js";import{t as ur}from"./buildShip-BgFg98tH.js";import{n as dr}from"./parseDiff-D8uBQ9mQ.js";import{enrichShipModel as fr}from"./generate-Dl2EJ_SR.js";import{a as pr,c as mr,g as hr,h as gr,l as _r,o as vr,p as yr,r as br,t as xr}from"./store-BfHRbVKz.js";import{r as Sr}from"./courseSeed-CZdNBTTs.js";import{i as Cr,n as wr,r as Tr,t as Er}from"./mastery-CUfDeuqO.js";var U=t(),Dr=A(),Or=/\?\s*$|^\s*(what|why|how|when|where|who|which|can|could|should|would|is|are|do|does|tell me|show me|explain)\b/i;function kr(e){return Or.test(e.trim())}function Ar(e,t){let n=e.key,r=t.trim();if(!r)return null;switch(e.kind){case`number`:{let t=r.replace(/,/g,``).match(/-?\d+(\.\d+)?/);if(!t)return null;let i=Number(t[0]);return Number.isFinite(i)?{kind:`number`,key:n,value:i,...e.unit?{unit:e.unit}:{}}:null}case`choice`:{let t=e.options?.find(e=>r.toLowerCase().includes(e.toLowerCase()));return t?{kind:`choice`,key:n,value:t}:null}case`card`:return null;case`date`:return{kind:`date`,key:n,value:r};default:return{kind:`text`,key:n,value:r}}}function jr(e,t){if(e.phase!==`awaiting_input`||!e.activeKey)return!1;let n=e.blanks.find(t=>t.key===e.activeKey);if(!n)return!1;let r=Ar(n,t),i=kr(t);return r&&!i?(e.fill(r),!0):!r&&!i}function Mr(e){return e.alwaysOn&&e.sttOk&&!e.composerHasText}function Nr(e,t){let n=(0,U.useRef)({...e,...t});n.current={...e,...t};let r=e.listening||Mr(e);(0,U.useEffect)(()=>{if(!r)return;let e=()=>{document.hidden?n.current.listening&&n.current.stop():Mr(n.current)&&!n.current.listening&&n.current.start()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[r])}var W=r(),Pr=200;function Fr(e){let t=e.trim().split(/\s+/).filter(Boolean).length;return Math.min(8e3,700+t*360)}function Ir(e,t){let n=(0,U.useRef)(e);n.current=e;let[r,i]=(0,U.useState)(null),a=(0,U.useRef)(null),o=(0,U.useCallback)(e=>{a.current=e,i(e)},[]),s=(0,U.useRef)(void 0),c=(0,U.useRef)(void 0),l=(0,U.useCallback)(()=>{s.current!==void 0&&clearTimeout(s.current),c.current!==void 0&&clearTimeout(c.current),s.current=void 0,c.current=void 0},[]),u=(0,U.useCallback)(e=>{let t=n.current,r=e.id??null;if(t.takeWheel(),t.moveSpot(e),r&&r===a.current){t.hush(),l(),o(null);return}t.hush(),l();let i=r?t.lineFor(e):null;if(!i||!t.canSpeak()){o(null);return}o(r),s.current=setTimeout(()=>{s.current=void 0,n.current.speakLine(i),c.current=setTimeout(()=>{c.current=void 0,a.current===r&&o(null)},Fr(i))},Pr)},[l,o]);return(0,U.useEffect)(()=>()=>{l(),o(null)},[t,l,o]),{narrate:u,narratingId:r}}var Lr=`mavea-view-mode`,G=Lr,Rr=`everything`,zr=new Set([`canvas`,`world`]);function Br(e){return e===`focus`||e===`everything`||e===`canvas`||e===`world`}var K=null;function Vr(){try{if(typeof localStorage>`u`)return Rr;let e=localStorage.getItem(Lr);return Br(e)&&!zr.has(e)?e:Rr}catch{return Rr}}function Hr(){return Vr()}function q(){return K||(K=Vr(),K)}function Ur(e){if(Br(e)){K=e;try{typeof localStorage<`u`&&!zr.has(e)&&localStorage.setItem(Lr,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(G))}catch{}}}function Wr(){let[e,t]=(0,U.useState)(()=>q());return(0,U.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(q());return window.addEventListener(G,e),()=>window.removeEventListener(G,e)},[]),[e,(0,U.useCallback)(Ur,[])]}function Gr({value:e,onChange:t,onSend:n,listening:r,onMic:i,micMode:a=`tap`,micArmed:o=!1,micPaused:s=!1,micProcessing:c=!1,micDisabled:l=!1,placeholder:u,disabled:d,heard:f,focusSignal:p,onFiles:m,attachTitle:h,attachPulse:g,onMicDown:_,onForceStop:v,onMicCancel:y,tools:b,micExtra:x}){let S=(0,U.useRef)(null),C=(0,U.useRef)(null),[w,T]=(0,U.useState)(!1);(0,U.useEffect)(()=>{if(!g)return;T(!0);let e=setTimeout(()=>T(!1),1100);return()=>clearTimeout(e)},[g]);let E=(0,U.useRef)(!1),D=(0,U.useRef)(null),O=(0,U.useRef)(!1),k=(0,U.useRef)(y);k.current=y,(0,U.useEffect)(()=>()=>{E.current&&k.current?.()},[]),(0,U.useEffect)(()=>{a!==`hold`&&(O.current=!1,E.current&&(E.current=!1,D.current=null,k.current?.()))},[a]),(0,U.useEffect)(()=>{!r&&S.current&&S.current.focus()},[r]),(0,U.useEffect)(()=>{p&&S.current&&S.current.focus()},[p]);let A=(0,U.useCallback)(e=>{a!==`hold`||l||c||r||E.current||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),E.current=!0,D.current=e.pointerId,O.current=!0,_?.())},[l,c,r,a,_]),j=(0,U.useCallback)(()=>{E.current&&(E.current=!1,D.current=null,v?.())},[v]),M=(0,U.useCallback)(e=>{D.current===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),j())},[j]),N=(0,U.useCallback)(e=>{E.current&&(e&&D.current===e.pointerId&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),E.current=!1,D.current=null,y?.())},[y]),P=(0,U.useCallback)(e=>{a!==`hold`||l||c||r||E.current||e.repeat||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),E.current=!0,O.current=!0,_?.())},[r,l,a,c,_]),F=(0,U.useCallback)(e=>{a!==`hold`||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),j())},[j,a]),I=(0,U.useCallback)(()=>{if(a===`hold`||O.current){O.current=!1;return}l||c&&a!==`always`||i()},[i,l,a,c]),L=l?`Microphone off`:c&&a!==`always`?`Finishing voice input`:r?`Finish and send`:s?`Resume always-on`:o?`Pause always-on`:a===`hold`?`Hold to talk`:`Talk to Mavéa`,R=(0,W.jsx)(`button`,{className:`mic-btn`+(r?` listening`:``)+(o?` armed`:``)+(s?` paused`:``)+(c?` processing`:``)+(l?` mic-off`:``),onClick:I,onPointerDown:A,onPointerUp:M,onPointerCancel:N,onKeyDown:P,onKeyUp:F,title:L,"aria-label":L,"aria-busy":c,children:l?(0,W.jsx)(z.micOff,{}):(0,W.jsx)(z.mic,{})});return(0,W.jsxs)(`div`,{className:`composer`,children:[x?(0,W.jsxs)(`div`,{className:`mic-btn-wrap`,children:[R,x]}):R,f&&!e?(0,W.jsx)(`div`,{className:`live-listen heard`,children:(0,W.jsxs)(`span`,{style:{color:`var(--text-primary)`},children:[`"`,f,`"`]})}):r&&!e?(0,W.jsxs)(`div`,{className:`live-listen`,children:[(0,W.jsx)(`span`,{className:`wave`,children:[14,18,10,20,8,16,12].map((e,t)=>(0,W.jsx)(`i`,{style:{height:e}},t))}),`Listening…`]}):(0,W.jsx)(`input`,{ref:S,className:`composer-input`,name:`mavea-ask`,"aria-label":u||`Ask Mavéa anything`,autoComplete:`off`,value:e,disabled:d,placeholder:u||`Ask Mavéa anything — or just talk`,onChange:e=>t(e.target.value),onKeyDown:t=>{t.key===`Enter`&&e.trim()&&n(e)}}),m&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`input`,{ref:C,type:`file`,name:`mavea-attach`,accept:Mt,multiple:!0,disabled:d,hidden:!0,"aria-hidden":`true`,onChange:e=>{let t=Array.from(e.target.files??[]);t.length&&m(t),e.target.value=``}}),(0,W.jsx)(`button`,{type:`button`,className:`composer-tool`+(w?` is-pulsing`:``),title:h||`Attach a file`,"aria-label":h||`Attach a file`,disabled:d,onClick:()=>C.current?.click(),children:(0,W.jsx)(z.paperclip,{})})]}),b,(0,W.jsx)(`button`,{className:`send-btn`,disabled:d||!e.trim(),onClick:()=>n(e),title:`Send`,"aria-label":`Send`,children:(0,W.jsx)(z.send,{})})]})}i();var Kr=null;async function qr(){return Kr||(Kr=(await a(()=>import(`./corpus.generated-oX9uU93S.js`),[])).default,Kr)}function Jr(e){return Kr?.conversations.find(t=>t.id===e)}function Yr(e){return e.replace(/\b([\p{L}]+)-ish\b/gu,`roughly $1`).replace(/\s*[—–]\s*/g,`, `).replace(/(\p{L})-(?=\p{L})/gu,`$1 `).replace(/\s+-\s+/g,`, `).replace(/,\s*,+/g,`, `).replace(/\s{2,}/g,` `).trim()}function Xr(e){return{...e,question:Yr(e.question),narration:Yr(e.narration),spoken:e.spoken?Yr(e.spoken):e.spoken,tour:e.tour.map(e=>({...e,say:e.say?Yr(e.say):e.say,saySpoken:e.saySpoken?Yr(e.saySpoken):e.saySpoken}))}}var Zr=[{id:`talk`,title:`Speak naturally`,mode:`voice`,coach:`Start by speaking naturally or typing. I will understand either and respond out loud.`,spotlight:`.mic-btn`,action:{kind:`mic`},durationMs:6e3},{id:`connect`,title:`Bring your own model`,mode:`explain`,coach:`Choose Gemini, Claude, GPT, Grok, or OpenRouter, then paste your own API key. Start with a fast, lower cost model and move up only when a task needs it. The key stays in memory unless you choose Remember. Requests pass through this deployment, and your provider's usage charges, privacy, and retention terms apply.`,spotlight:`.settings-model-connect`,action:{kind:`connect`},durationMs:12e3},{id:`draws`,title:`See the answer`,mode:`explain`,coach:`Ask anything. I build a visual answer while I explain the important parts. Use the voice toggle labeled Mavéa's voice to turn speech off and reveal everything immediately. Your microphone stays unchanged.`,spotlight:`.voice-switch`,action:{kind:`answer`,convoId:`money`,ask:`How does $10,000 grow at 7% over 30 years?`},durationMs:9e3},{id:`mark`,title:`Follow the explanation`,mode:`explain`,coach:`Watch the Pen circle the result, then underline why it matters. Its marks stay with the answer.`,spotlight:`.pen-toggle-pill`,action:{kind:`penDemo`},durationMs:1e4,needsCanvas:!0},{id:`ask`,title:`Ask across the answer`,mode:`explain`,coach:`Choose Ask on two cards, then type a question. I will use both pieces of context together.`,spotlight:`.topic-wrap .block-ask, .ask-hint`,action:{kind:`askMulti`},durationMs:12e3,needsCanvas:!0},{id:`canvas`,title:`Explore the canvas`,mode:`explain`,coach:`Switch to Canvas when you want to explore the whole answer spatially.`,action:{kind:`canvas`,convoId:`travel`},durationMs:15e3},{id:`living-answer`,title:`Walk the why`,mode:`explain`,coach:`A living answer lays out the causes behind an answer. Watch as I walk it cause by cause and say what each one did.`,action:{kind:`showcase`,featureId:`living-answer`},durationMs:26e3},{id:`prism`,title:`Check the evidence`,mode:`explain`,coach:`Prism checks a document claim by claim and ties every finding to its source.`,action:{kind:`prism`},durationMs:32e3},{id:`share`,title:`Present or publish`,mode:`explain`,coach:`Turn a useful answer into a polished presentation or document.`,action:{kind:`export`},durationMs:16e3,needsCanvas:!0},{id:`yours`,title:`Try it yourself`,mode:`voice`,coach:`That is the tour. Now ask your first question.`,spotlight:`.mic-btn`,action:{kind:`mic`},durationMs:6e3}],Qr=[{id:`bend`,title:`Make it yours`,mode:`explain`,coach:`These are starting assumptions. Drag the rent and watch the comparison update.`,spotlight:`.bend-strip`,action:{kind:`bend`,convoId:`mortgage`},durationMs:8e3,needsCanvas:!0,glyph:`🎚️`,hook:`Drag a number, watch it recompute`},{id:`chips`,title:`Go deeper`,mode:`explain`,coach:`When an answer offers ways to go deeper, tap one and I'll take it further.`,spotlight:`.footer-keepgoing`,action:{kind:`chip`,convoId:`monthly`,label:`What if I added $500 monthly?`},durationMs:9e3,needsCanvas:!0,glyph:`💬`,hook:`Tap a suggestion, go deeper`},{id:`rail`,title:`Session history`,mode:`explain`,coach:`Settled turns stay on the left for this session. Jump back anytime.`,spotlight:`.rail-chat`,action:{kind:`rail`},durationMs:8e3,needsCanvas:!0,glyph:`📜`,hook:`Settled turns, replayable on the left`},{id:`highlight`,title:`Highlight to ask`,mode:`explain`,coach:`Choose Highlight, draw around any part of an answer, then ask about exactly what you marked.`,spotlight:`.mark-toggle`,action:{kind:`mark`},durationMs:8e3,needsCanvas:!0,glyph:`✎`,hook:`Draw around the exact part you mean`},{id:`range`,title:`A fitting picture`,mode:`explain`,coach:`Answers can choose from diagrams, flows, charts, and interactive maps.`,action:{kind:`montage`,convoIds:[`space`,`krebs`,`travel`]},durationMs:9e3,glyph:`🎨`,hook:`See the visual range`},{id:`focus`,title:`One card at a time`,mode:`explain`,coach:`Feeling overwhelmed? Focus puts one card center stage, one at a time.`,spotlight:`.focus-toggle`,action:{kind:`focusWalk`,convoId:`money`},durationMs:11e3,glyph:`🎯`,hook:`One card at a time, center stage`},{id:`think`,title:`Think out loud`,mode:`explain`,coach:`Not sure what to ask yet? Think out loud, and I will map your thoughts live.`,action:{kind:`listen`},durationMs:16e3,glyph:`🧠`,hook:`Think out loud, I map it live`},{id:`atlas`,title:`Memory and Atlas`,mode:`explain`,coach:`When Memory is enabled, saved facts and kept topics can shape Atlas.`,action:{kind:`atlas`},durationMs:9e3,glyph:`🗺️`,hook:`Kept topics become a place`},{id:`export`,title:`Export the answer`,mode:`explain`,coach:`Need to share it? Export the current answer as a styled slide deck or document.`,action:{kind:`export`},durationMs:12e3,needsCanvas:!0,glyph:`📄`,hook:`Any answer becomes a deck or document`},{id:`flashcards`,title:`Make it stick`,mode:`explain`,coach:`Learning something? Any card becomes a flashcard, kept right here on your device.`,action:{kind:`flashcards`},durationMs:8e3,needsCanvas:!0,glyph:`🎴`,hook:`Turn any card into a flashcard`},{id:`course`,title:`Master a subject`,mode:`explain`,coach:`Want to truly master something? I'll build you a course and teach it, one lesson at a time.`,spotlight:`.course-rail`,action:{kind:`course`},durationMs:12e3,glyph:`🎓`,hook:`A full course, a lesson at a time`},{id:`present`,title:`Fill the room`,mode:`explain`,coach:`Present fills the room with the answer while the microphone stays live.`,action:{kind:`present`},durationMs:9e3,needsCanvas:!0,glyph:`🖥️`,hook:`Fill the room, chrome falls away`},{id:`palette`,title:`Feature index, one key away`,mode:`explain`,coach:`Browse the feature index with one keystroke. Just press Command K.`,spotlight:`.cmdk-panel`,action:{kind:`palette`},durationMs:9e3,glyph:`⌘`,hook:`Feature index, one keystroke away`},{id:`ripple`,title:`See a change ripple`,mode:`explain`,coach:`Here is a real code change. See what it touches, what could break, and the safest order to ship it.`,action:{kind:`showcase`,featureId:`ripple`},durationMs:12e3,glyph:`🌊`,hook:`A code change's whole blast radius`},{id:`deepzoom`,title:`Telescope any topic`,mode:`explain`,coach:`Telescope a topic from the big picture all the way down to the finest detail.`,action:{kind:`showcase`,featureId:`deepzoom`},durationMs:1e4,glyph:`🔭`,hook:`From big picture to finest detail`},{id:`synthesis`,title:`Fuse many documents`,mode:`explain`,coach:`Drop in several documents and I combine them into one map of agreements, contradictions, and gaps.`,action:{kind:`showcase`,featureId:`synthesis`},durationMs:1e4,glyph:`🧬`,hook:`Many documents into one map`},{id:`memory`,title:`What I remember`,mode:`explain`,coach:`Everything I remember about you lives here. Review it, edit it, or forget it. It stays on your device.`,action:{kind:`showcase`,featureId:`memory`},durationMs:9e3,glyph:`🔖`,hook:`See, edit, or forget what I know`},{id:`library`,title:`Past conversations`,mode:`explain`,coach:`Every canvas you build is kept. Reopen any past conversation where you left it.`,action:{kind:`showcase`,featureId:`library`},durationMs:9e3,glyph:`📚`,hook:`Reopen a canvas you built before`},{id:`review`,title:`Study your cards`,mode:`explain`,coach:`Open Study to go through your flashcards. Keep it a plain pile, or let Mavéa space them out so the ones you find hard come back sooner.`,action:{kind:`showcase`,featureId:`review`},durationMs:9e3,glyph:`🧠`,hook:`Go through your flashcards`},{id:`manage-flashcards`,title:`Manage your deck`,mode:`explain`,coach:`Open your flashcard library to organize decks, edit cards, and choose what to study.`,action:{kind:`showcase`,featureId:`flashcards`},durationMs:9e3,glyph:`🗂️`,hook:`Organize and edit every study card`},{id:`track`,title:`Build a living dashboard`,mode:`explain`,coach:`Choose the parts you want to keep live, set a refresh schedule, and create a dashboard from this answer.`,action:{kind:`showcase`,featureId:`track`},durationMs:12e3,needsCanvas:!0,glyph:`📈`,hook:`Choose what stays live and how often`},{id:`delegate`,title:`Rehearse it first`,mode:`explain`,coach:`Prepare a hard conversation before you have it. Take the seat and practice your own lines, or send me to argue your side and read the debrief.`,action:{kind:`showcase`,featureId:`delegate`},durationMs:9e3,glyph:`🤝`,hook:`Practice it, or send me to scout it`},{id:`just-listen`,title:`Just listen`,mode:`explain`,coach:`Think out loud and I save what you say without answering, so you can sort it later.`,action:{kind:`showcase`,featureId:`just-listen`},durationMs:9e3,glyph:`👂`,hook:`Bank everything you say, sort it later`},{id:`recap`,title:`Recap the session`,mode:`explain`,coach:`Lost the thread? I'll recap everything we've covered this session at a glance.`,action:{kind:`showcase`,featureId:`recap`},durationMs:9e3,glyph:`📋`,hook:`Everything we've covered, at a glance`},{id:`ghost`,title:`Ghost answers`,mode:`explain`,coach:`While you listen, I quietly draft a response, so it is ready when you want it.`,action:{kind:`showcase`,featureId:`ghost`},durationMs:9e3,glyph:`👻`,hook:`I draft what I would say, quietly`},{id:`whisper`,title:`Whisper mode`,mode:`explain`,coach:`Need to stay quiet? Whisper mode lowers my voice to a soft murmur.`,action:{kind:`showcase`,featureId:`whisper`},durationMs:9e3,glyph:`🤫`,hook:`A quiet voice when you need it`},{id:`morning-brief`,title:`Morning brief`,mode:`explain`,coach:`Start the day with a brief of what changed across the things you track. It stays off until you turn it on.`,action:{kind:`showcase`,featureId:`morning-brief`},durationMs:9e3,glyph:`☀️`,hook:`Open the day with what's changed`},{id:`settings`,title:`Bring your own model`,mode:`explain`,coach:`Bring your own model, connect a provider, and tune how I answer. You control the key and the terms.`,action:{kind:`showcase`,featureId:`settings`},durationMs:9e3,glyph:`⚙️`,hook:`Connect a provider, tune the answers`},{id:`zoom-deck`,title:`Chapter view`,mode:`explain`,coach:`Pull back from the cards to the whole session, with every topic shown as a chapter.`,action:{kind:`showcase`,featureId:`zoom-deck`},durationMs:1e4,glyph:`📖`,hook:`Pull back to the whole session`},{id:`blanks`,title:`Fill in your own`,mode:`explain`,coach:`Some numbers are only yours to give. I leave glowing spaces and finish the answer around what you add.`,spotlight:`.blank-slot`,action:{kind:`blanksDemo`},durationMs:1e4,glyph:`◌`,hook:`Holes for the numbers only you know`}],$r=[...Zr,...Qr];function ei(e){return $r.find(t=>t.id===e)}var ti={money:`How does $10,000 grow at 7% over 30 years?`,monthly:`What if I added $500 monthly?`,mortgage:`Should I buy or rent a $500,000 home?`,space:`How does a black hole bend light?`,travel:`Plan me 5 days in Japan.`,budget:`Where does the US federal budget actually go?`,krebs:`Explain the Krebs cycle.`,url:`What actually happens when I open a website?`,neural:`How does a neural network learn?`,fitness:`Design me a 3-day strength routine.`};function ni(e,t){let n=Jr(e),r=n?.frames[0];if(!n||!r)return null;let i=Yr(t??ti[e]??n.question);return{frame:Xr({...r,question:i}),question:i}}var ri=[{key:`savings`,label:`Your savings`,prompt:`How much have you set aside for the break?`,kind:`number`,unit:`$`,placeholder:`e.g. 18,000`},{key:`spend`,label:`Monthly spend`,prompt:`Roughly what will you spend a month while travelling?`,kind:`number`,unit:`$/mo`,placeholder:`e.g. 2,400`}],ii=[{type:`insight`,id:`blanks-lede`,col:12,props:{title:`The money side of a 6-month break`,summary:`I've mapped the typical costs and what to sort out before you leave. Two numbers, though, are yours to give — so I've left them as holes rather than guess.`}},{type:`blanks`,id:`blanks-holes`,col:12,props:{title:`The parts only you can answer`,icon:`spark`,iconColor:`var(--presence)`,intro:`I've weighed everything I can. Fill these in and I'll finish the runway math around them.`,slots:ri}}],ai=[{type:`insight`,id:`blanks-verdict`,col:12,props:{title:`You can afford it — with a cushion`,summary:`$18,000 saved against $2,400 a month is about 7.5 months of runway — enough for a 6-month break with room to spare.`,stat:`7.5 months`,delta:`+1.5 vs. the plan`,deltaDir:`up`}},{type:`breakdown`,id:`blanks-runway`,col:12,props:{title:`Your runway`,rows:[{name:`Saved`,val:`$18,000`,pct:100},{name:`Spend / month`,val:`$2,400`,pct:32},{name:`6-month cost`,val:`$14,400`,pct:80},{name:`Left over`,val:`$3,600`,pct:20,tag:`cushion`,tagColor:`var(--presence)`}]}}];function oi(e,t){return{question:`Can I afford a 6-month career break?`,narration:t,mode:`replace`,tour:[],spec:e,at:0}}function si(e){let t={...e,title:`Can I afford a 6-month career break?`,sub:`The money side`,bend:void 0,sources:void 0,track:void 0},n={...t,blocks:ii,blanks:ri,awaiting:!0},r={...t,blocks:ai,blanks:void 0,awaiting:!1};return{holes:oi(n,``),filled:oi(r,`With eighteen thousand saved and twenty-four hundred a month, that’s about seven and a half months of runway — enough for six, with a cushion.`)}}function ci(){let e=!1,t=[];return{after(n,r){t.push(setTimeout(()=>!e&&r(),n))},cancel(){e=!0,t.forEach(clearTimeout)}}}function li(e,t){if(k()){t();return}let n=Date.now(),r=()=>{if(k()||Date.now()-n>=8e3){t();return}e(200,r)};e(200,r)}function ui(e,t,n,r=0){for(let i=1;i<=n.length;i++)e(r+i*22,()=>t(n.slice(0,i)));return r+n.length*22}function di(e){let t=Date.now(),n=e.maxExtraMs??2e4,r=0,i=window.setInterval(()=>{let a=Date.now()-t;a<e.minHoldMs||(r=e.isQuiet()?r+1:0,(r>=7||a>=e.minHoldMs+n)&&(window.clearInterval(i),e.advance()))},250);return()=>window.clearInterval(i)}var fi=450,pi=1600;function mi(e,t){if(e<=0)return[];let n=Math.max(pi,Math.floor((t-fi-400)/e));return Array.from({length:e},(e,t)=>fi+t*n)}var hi=1500,gi=900;function _i(e,t){let n=1850;if(e<=0)return{focusAt:hi,spotlightAt:[]};let r=Math.max(gi,Math.floor((t-n)/e));return{focusAt:hi,spotlightAt:Array.from({length:e},(e,t)=>n+t*r)}}var vi=[`I keep thinking about moving to Austin.`,`My sister already lives there.`,`But I'm worried about starting over.`,`And my lease runs until March.`,`Is it even the right time?`];function yi(e){return!!e&&Qr.some(t=>t.id===e)}function bi(e){return!!e&&Zr.some(t=>t.id===e)}function xi(e){let{active:t}=e,[n,r]=(0,U.useState)(()=>{let t=e.startChapter;return yi(t)||bi(t)&&e.solo?t??null:null}),[i,a]=(0,U.useState)(()=>{let t=e.startChapter;if(yi(t)||bi(t)&&e.solo)return 0;let n=t?Zr.findIndex(e=>e.id===t):-1;return n>=0?n:0}),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(!1),f=(0,U.useRef)(u);f.current=u;let[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(0),_=(0,U.useRef)(e.ops);_.current=e.ops;let v=n?ei(n):void 0,y=v?[v]:Zr,b=(0,U.useRef)(y);b.current=y;let x=y.length,S=t?y[i]??null:null,[C,w]=(0,U.useState)(!1),[T,E]=(0,U.useState)(!1),[D,A]=(0,U.useState)(0);(0,U.useEffect)(()=>{if(!t)return;let e=!0;return(async()=>{for(let t=0;e&&t<2;t++)try{await qr(),e&&w(!0);return}catch{}e&&E(!0)})(),()=>{e=!1}},[t,D]);let j=(0,U.useCallback)(()=>{E(!1),A(e=>e+1)},[]),M=(0,U.useCallback)(()=>{let e=_.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,U.useEffect)(()=>{if(!t||!o||p||!C)return;let e=b.current[i];if(!e)return;O(e.id,!!n);let r=_.current,a=ci(),s=a.after,c=e=>li(s,e),l=e=>c(()=>r.speak(e)),u=e=>r.showFrame(e.frame,e.question,{silent:!0});if(M(),e.needsCanvas&&!r.hasCanvas()){let e=ni(`money`);e&&u(e)}r.setMuted(f.current||e.mode===`silent`);let d=e.action;if(d.kind===`answer`){let e=ni(d.convoId,d.ask);if(e){let t=e.question,n={...e.frame,narration:``,spoken:``,tour:e.frame.tour.slice(0,4).map(e=>({...e,say:``,saySpoken:``}))};s(ui(s,r.typeInto,t)+360,()=>c(()=>r.showFrame(n,e.question)))}}else if(d.kind===`chip`){let e=ni(`money`);e&&u(e),s(1400,()=>r.pressKeepGoing(d.label)),s(2e3,()=>{let e=ni(d.convoId,d.label);e&&r.showFrame(e.frame,e.question)})}else if(d.kind===`montage`){let t=d.convoIds.map(e=>ni(e)).filter(Boolean),n=mi(t.length,e.durationMs);t.forEach((e,t)=>s(n[t],()=>u(e)))}else if(d.kind===`ask`)s(1300,()=>r.pinFirstBlock()),ui(s,r.typeInto,`Why does it grow faster after year 20?`,1700);else if(d.kind===`askMulti`){let e=ni(`money`);e&&u(e),s(1300,()=>r.pinFirstBlocks(2)),ui(s,r.typeInto,`How do these two parts explain the final total?`,2600)}else if(d.kind===`bend`){if(d.convoId){let e=ni(d.convoId);e&&u(e)}s(1400,()=>r.bendIt())}else if(d.kind===`rail`)s(1300,()=>r.toggleRail()),s(2600,()=>r.toggleRail());else if(d.kind===`export`)s(500,()=>r.openExport());else if(d.kind===`mark`)s(400,()=>r.setInkArmed(!0)),s(900,()=>r.scriptedMark());else if(d.kind===`penDemo`){let e=ni(`money`);e&&u(e),s(1200,()=>r.drawPenTourStep(`result`)),s(3900,()=>r.drawPenTourStep(`reason`)),s(7200,()=>r.setSpot(null))}else if(d.kind===`focus`)s(500,()=>r.setViewMode(`focus`));else if(d.kind===`canvas`){let e=ni(d.convoId);e&&u(e),s(1500,()=>r.setViewMode(`canvas`));let t=(e?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,3);t.forEach((e,t)=>s(2700+t*1900,()=>r.setSpot(e))),s(2700+t.length*1900,()=>r.setSpot(null))}else if(d.kind===`focusWalk`){let t=ni(d.convoId);t&&u(t);let n=(t?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e),{focusAt:i,spotlightAt:a}=_i(n.length,e.durationMs);s(i,()=>r.setViewMode(`focus`)),n.forEach((e,t)=>s(a[t],()=>r.setSpot(e)))}else if(d.kind===`listen`){s(400,()=>r.startWatchThinking());let e=800;for(let t of vi)e=ui(s,r.typeInto,t,e)+300,s(e,()=>{r.typeInto(``),r.bankThought(t)}),e+=800}else if(d.kind===`flashcards`)s(700,()=>r.openFlashcards());else if(d.kind===`course`)s(500,()=>r.openTourCourse());else if(d.kind===`connect`)s(400,()=>r.openModelSettings());else if(d.kind===`present`)s(500,()=>r.setPresenting(!0));else if(d.kind===`share`)s(500,()=>r.setShareOpen(!0)),s(3100,()=>r.shareRemix()),s(4900,()=>r.sharePalette(`Ember`));else if(d.kind===`palette`)s(500,()=>r.setPaletteOpen(!0));else if(d.kind===`atlas`)s(500,()=>r.openAtlas());else if(d.kind===`prism`)s(400,()=>r.openPrism(0));else if(d.kind===`memory`)s(700,()=>r.fireMemoryGlow());else if(d.kind===`showcase`)d.featureId===`recap`||d.featureId===`zoom-deck`?([`money`,`space`,`travel`].forEach((e,t)=>{let n=ni(e);n&&s(t*200,()=>u(n))}),s(1400,()=>r.showcaseFeature(d.featureId))):s(500,()=>r.showcaseFeature(d.featureId));else if(d.kind===`blanksDemo`){let e=ni(`money`)?.frame.spec;if(e){let{holes:t,filled:n}=si(e);u({frame:t,question:t.question}),s(5200,()=>r.showFrame(n,n.question))}}return e.mode!==`silent`&&!f.current&&s(160,()=>l(Yr(e.coach))),a.cancel},[i,h,t,o,p,C,n,M]),(0,U.useEffect)(()=>{if(!t||!o||p||!c||!C)return;let e=b.current[i];if(!e)return;let n=_.current;return di({minHoldMs:e.durationMs,isQuiet:()=>!n.isSpeaking()&&!n.isBusy(),advance:()=>{i+1>=x?(M(),m(!0)):a(i+1)}})},[i,h,t,o,p,c,C,x,n,M]),(0,U.useEffect)(()=>()=>M(),[M]);let N=(0,U.useCallback)(()=>{k(),s(!0),l(!0),m(!1)},[]),P=(0,U.useCallback)((e,t)=>{k(),m(!1),t?.keepPlaying||l(!1),a(Math.max(0,Math.min(b.current.length-1,e))),g(e=>e+1)},[]),F=(0,U.useCallback)(()=>{i+1>=x?(M(),m(!0)):P(i+1,{keepPlaying:!0})},[i,x,P,M]),I=(0,U.useCallback)(()=>P(i-1),[i,P]),L=(0,U.useCallback)(e=>P(e),[P]),R=(0,U.useCallback)(()=>{M(),r(null),s(!0),P(0),l(!0)},[P,M]),z=(0,U.useCallback)(e=>{yi(e)&&(k(),r(e),s(!0),m(!1),l(!0),a(0),g(e=>e+1))},[]),ee=(0,U.useCallback)(()=>{if(k(),!o){N();return}if(p){R();return}l(e=>!e)},[p,R,N,o]),te=(0,U.useCallback)(()=>{k();let e=!f.current;f.current=e,d(e);let t=b.current[i],n=t?.mode===`silent`,r=_.current;r.setMuted(e||n),e?r.cancelSpeech():o&&!p&&t&&!n&&r.speak(Yr(t.coach))},[p,i,o]),ne=(0,U.useCallback)(()=>{M(),m(!0)},[M]);return{active:t,started:o,index:i,total:x,chapter:S,coach:Yr(S?.coach??``),spotlight:S?.spotlight,playing:c,muted:u,done:p,corpusError:T,retryCorpus:j,solo:!!n,start:N,next:F,prev:I,jumpTo:L,toggle:ee,toggleMute:te,replay:R,skip:ne,playExtra:z}}var J=n();function Si(e){let t=window.innerWidth,n=window.innerHeight,r=Math.min(e.right,t)-Math.max(e.left,0),i=Math.min(e.bottom,n)-Math.max(e.top,0);return r>e.width*.5&&i>e.height*.5}var Ci=/^(hidden|auto|scroll|clip)$/;function wi(e,t){let n=e.top,r=e.left,i=e.right,a=e.bottom;for(let e=t.parentElement;e;e=e.parentElement){let t=getComputedStyle(e),o=Ci.test(t.overflowY),s=Ci.test(t.overflowX);if(!o&&!s)continue;let c=e.getBoundingClientRect();o&&(n=Math.max(n,c.top),a=Math.min(a,c.bottom)),s&&(r=Math.max(r,c.left),i=Math.min(i,c.right))}return new DOMRect(r,n,Math.max(0,i-r),Math.max(0,a-n))}function Ti(e,t){let n=(0,J.c)(4),[r,i]=(0,U.useState)(null),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(null);return}let n=!0,r=0,a=null,o=e=>{e===a||e!==null&&a!==null&&Math.abs(e.top-a.top)<.5&&Math.abs(e.left-a.left)<.5&&Math.abs(e.width-a.width)<.5&&Math.abs(e.height-a.height)<.5||(a=e,i(e))},s=e.split(`,`).map(Ai).filter(Boolean),c=()=>{if(!n)return;let e=null,t=null;for(let n of s){let r=Array.from(document.querySelectorAll(n)).filter(ki).map(Oi).filter(Di),i=r.find(Ei)??r[0];if(i){e=i.hit,t=i.rect;break}}if(!e||!t){o(null);return}let i=t;if(!Si(i)){let t=Date.now();t-r>1200&&(r=t,e.scrollIntoView({block:`center`,behavior:`smooth`})),o(null);return}o(i)};c();let l=window.setInterval(c,250);return window.addEventListener(`resize`,c),window.addEventListener(`scroll`,c,!0),()=>{n=!1,window.clearInterval(l),window.removeEventListener(`resize`,c),window.removeEventListener(`scroll`,c,!0)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,U.useEffect)(a,o),r}function Ei(e){let{rect:t}=e;return Si(t)}function Di(e){let{raw:t}=e;return t.width>0&&t.height>0}function Oi(e){let t=e.getBoundingClientRect();return{hit:e,raw:t,rect:wi(t,e)}}function ki(e){return!e.checkVisibility||e.checkVisibility({checkOpacity:!0})}function Ai(e){return e.trim()}function ji(e){let t=(0,J.c)(82),{driver:n}=e,r=Ti(n.spotlight,n.active&&n.started&&!n.done),i=(0,U.useRef)(null),a=n.active&&!n.done&&!n.started&&!n.corpusError,o;t[0]===a?o=t[1]:(o={active:a},t[0]=a,t[1]=o),oe(i,o);let s=n.active&&n.started&&!n.done?n.chapter?.id:void 0,c,l;if(t[2]===s?(c=t[3],l=t[4]):(c=()=>{if(s)return document.body.dataset.tourChapter=s,Ni},l=[s],t[2]=s,t[3]=c,t[4]=l),(0,U.useEffect)(c,l),!n.active||n.done)return null;if(n.corpusError){let e,r,i;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,W.jsx)(`h2`,{children:`This walkthrough couldn’t load`}),i=(0,W.jsx)(`p`,{children:`The recorded scenes did not come through. Check your connection and try again.`}),t[5]=e,t[6]=r,t[7]=i):(e=t[5],r=t[6],i=t[7]);let a;t[8]===n.retryCorpus?a=t[9]:(a=(0,W.jsx)(`button`,{type:`button`,className:`tourx-welcome-start`,onClick:n.retryCorpus,children:`Retry`}),t[8]=n.retryCorpus,t[9]=a);let o;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:Mi,children:`Back to home`}),t[10]=o):o=t[10];let s;return t[11]===a?s=t[12]:(s=(0,W.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{className:`tourx-welcome`,role:`alert`,children:[e,r,i,(0,W.jsxs)(`div`,{className:`tourx-welcome-actions`,children:[a,o]})]})}),t[11]=a,t[12]=s),s}if(!n.started){let e,r;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,W.jsx)(`h2`,{id:`tourx-welcome-title`,children:`See Mavéa in action`}),t[13]=e,t[14]=r):(e=t[13],r=t[14]);let a=n.total===1?`scene plays`:`scenes play`,o;t[15]!==n.total||t[16]!==a?(o=(0,W.jsxs)(`p`,{children:[n.total,` short `,a,` automatically. Pause, skip, or move at your own pace.`]}),t[15]=n.total,t[16]=a,t[17]=o):o=t[17];let s;t[18]===n.start?s=t[19]:(s=(0,W.jsx)(`button`,{type:`button`,className:`tourx-welcome-start`,onClick:n.start,children:`Start the tour`}),t[18]=n.start,t[19]=s);let c;t[20]===n.skip?c=t[21]:(c=(0,W.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:n.skip,children:`Skip tour`}),t[20]=n.skip,t[21]=c);let l;t[22]!==c||t[23]!==s?(l=(0,W.jsxs)(`div`,{className:`tourx-welcome-actions`,children:[s,c]}),t[22]=c,t[23]=s,t[24]=l):l=t[24];let u;return t[25]!==l||t[26]!==o?(u=(0,W.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{ref:i,className:`tourx-welcome`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tourx-welcome-title`,children:[e,r,o,l]})}),t[25]=l,t[26]=o,t[27]=u):u=t[27],u}let u=s===`ask`||!!r&&r.top+r.height/2>window.innerHeight*.58,d;t[28]===r?d=t[29]:(d=r&&(0,W.jsx)(`div`,{className:`tourx-ring`,style:{top:r.top-8,left:r.left-8,width:r.width+16,height:r.height+16}}),t[28]=r,t[29]=d);let f=`tourx-panel`+(n.solo?` is-solo`:``)+(u?` is-top`:``),p=n.solo?`Mini-demo controls`:`Walkthrough controls`,m=`head-`+n.index,h=n.solo?`Mini demo`:`${n.index+1} / ${n.total}`,g;t[30]===h?g=t[31]:(g=(0,W.jsx)(`span`,{className:`tourx-count`,children:h}),t[30]=h,t[31]=g);let _=n.chapter?.title,v;t[32]===_?v=t[33]:(v=(0,W.jsx)(`span`,{className:`tourx-title`,children:_}),t[32]=_,t[33]=v);let y;t[34]!==g||t[35]!==v||t[36]!==m?(y=(0,W.jsxs)(`div`,{className:`tourx-head`,children:[g,v]},m),t[34]=g,t[35]=v,t[36]=m,t[37]=y):y=t[37];let b=`coach-`+n.index,x;t[38]!==n.coach||t[39]!==b?(x=(0,W.jsx)(`p`,{className:`tourx-coach`,children:n.coach},b),t[38]=n.coach,t[39]=b,t[40]=x):x=t[40];let S;t[41]!==n.index||t[42]!==n.prev||t[43]!==n.solo?(S=!n.solo&&(0,W.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.prev,disabled:n.index===0,"aria-label":`Previous chapter`,children:(0,W.jsx)(z.chevL,{className:`tourx-ic`})}),t[41]=n.index,t[42]=n.prev,t[43]=n.solo,t[44]=S):S=t[44];let C=n.playing?`Pause autoplay`:`Turn on autoplay`,w;t[45]===n.playing?w=t[46]:(w=n.playing?(0,W.jsx)(z.pause,{className:`tourx-ic`}):(0,W.jsx)(z.play,{className:`tourx-ic`}),t[45]=n.playing,t[46]=w);let T=n.playing?`Pause`:`Autoplay`,E;t[47]===T?E=t[48]:(E=(0,W.jsx)(`span`,{children:T}),t[47]=T,t[48]=E);let D;t[49]!==n.toggle||t[50]!==C||t[51]!==w||t[52]!==E?(D=(0,W.jsxs)(`button`,{type:`button`,className:`tourx-btn tourx-play tourx-auto`,onClick:n.toggle,"aria-label":C,children:[w,E]}),t[49]=n.toggle,t[50]=C,t[51]=w,t[52]=E,t[53]=D):D=t[53];let O=n.muted?`Turn narration on`:`Mute narration`,k=n.muted?`Turn narration on`:`Mute narration`,A;t[54]===n.muted?A=t[55]:(A=n.muted?(0,W.jsx)(z.speakerOff,{className:`tourx-ic`}):(0,W.jsx)(z.speaker,{className:`tourx-ic`}),t[54]=n.muted,t[55]=A);let j;t[56]!==n.muted||t[57]!==n.toggleMute||t[58]!==O||t[59]!==k||t[60]!==A?(j=(0,W.jsx)(`button`,{type:`button`,className:`tourx-btn tourx-mute`,onClick:n.toggleMute,"aria-label":O,"aria-pressed":n.muted,title:k,children:A}),t[56]=n.muted,t[57]=n.toggleMute,t[58]=O,t[59]=k,t[60]=A,t[61]=j):j=t[61];let M;t[62]===n?M=t[63]:(M=!n.solo&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.next,"aria-label":`Next chapter`,children:(0,W.jsx)(z.chevR,{className:`tourx-ic`})}),(0,W.jsx)(`div`,{className:`tourx-dots`,role:`tablist`,"aria-label":`Chapters`,children:Array.from({length:n.total},(e,t)=>(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===n.index,"aria-label":`Chapter ${t+1}`,className:`tourx-dot`+(t===n.index?` is-active`:``),onClick:()=>n.jumpTo(t)},t))})]}),t[62]=n,t[63]=M);let N=n.solo?`Back to demos`:`Skip`,P;t[64]!==n.skip||t[65]!==N?(P=(0,W.jsx)(`button`,{type:`button`,className:`tourx-skip`,onClick:n.skip,children:N}),t[64]=n.skip,t[65]=N,t[66]=P):P=t[66];let F;t[67]!==S||t[68]!==D||t[69]!==j||t[70]!==M||t[71]!==P?(F=(0,W.jsxs)(`div`,{className:`tourx-controls`,children:[S,D,j,M,P]}),t[67]=S,t[68]=D,t[69]=j,t[70]=M,t[71]=P,t[72]=F):F=t[72];let I;t[73]!==y||t[74]!==x||t[75]!==F||t[76]!==f||t[77]!==p?(I=(0,W.jsxs)(`div`,{className:f,role:`group`,"aria-label":p,children:[y,x,F]}),t[73]=y,t[74]=x,t[75]=F,t[76]=f,t[77]=p,t[78]=I):I=t[78];let L;return t[79]!==I||t[80]!==d?(L=(0,W.jsxs)(`div`,{className:`tourx`,"aria-live":`polite`,children:[d,I]}),t[79]=I,t[80]=d,t[81]=L):L=t[81],L}function Mi(){window.location.hash=`#/`}function Ni(){delete document.body.dataset.tourChapter}function Pi({onStart:e,onReplay:t,onPlayExtra:n,hasStoredSession:r=!1}){let i=(0,U.useRef)(null);return oe(i),(0,W.jsx)(`div`,{ref:i,className:`tour-end`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-end-title`,children:(0,W.jsxs)(`section`,{className:`tour-end-card`,children:[(0,W.jsxs)(`header`,{className:`tour-end-intro`,children:[(0,W.jsx)(`div`,{className:`tour-end-mascot`,"aria-hidden":`true`,children:(0,W.jsx)(ue,{state:`idle`,emotion:`neutral`,gaze:`center`})}),(0,W.jsx)(`h2`,{id:`tour-end-title`,className:`tour-end-title tour-end-line`,children:`That's Mavéa.`}),(0,W.jsx)(`p`,{className:`tour-end-tagline tour-end-line`,children:`Talk to AI. See what it means.`}),(0,W.jsx)(`p`,{className:`tour-end-copy tour-end-line`,children:`Try it now, or open any scripted mini-demo below to see that feature operate on the real interface.`}),(0,W.jsxs)(`div`,{className:`tour-end-actions tour-end-line`,children:[(0,W.jsx)(`button`,{type:`button`,className:`tour-end-start`,onClick:e,children:r?`Back to your session`:`Start Mavéa`}),(0,W.jsx)(`button`,{type:`button`,className:`tour-end-replay`,onClick:t,children:`Replay the tour`})]})]}),(0,W.jsxs)(`div`,{className:`tour-end-extras`,children:[(0,W.jsx)(`h3`,{children:`More to explore`}),(0,W.jsx)(`div`,{className:`tour-end-grid`,children:Qr.map(e=>(0,W.jsxs)(`button`,{type:`button`,className:`tour-end-extra`,onClick:()=>n(e.id),"aria-label":`Play scripted mini-demo: ${e.title}`,children:[(0,W.jsx)(`span`,{className:`tour-end-glyph`,"aria-hidden":`true`,children:e.glyph}),(0,W.jsxs)(`span`,{className:`tour-end-extra-copy`,children:[(0,W.jsx)(`strong`,{children:e.title}),(0,W.jsx)(`small`,{children:e.hook})]})]},e.id))})]})]})})}var Fi=new Map([{persona:`cfo`,steps:[{ask:`Run my quarterly review: ARR grew from $12.4M to $15.1M, churn ticked up from 2.1% to 2.8%, and regions came in at NA $8.2M, EMEA $4.6M, APAC $2.3M.`,bakeAsk:`Run my quarterly review: ARR grew from $12.4M to $15.1M, churn ticked up from 2.1% to 2.8%, and regions came in at NA $8.2M, EMEA $4.6M, APAC $2.3M. Build the full picture, including growth, the churn drift, and how the regions stack up.`,expect:{minBlocks:4,suggests:!0}},{ask:`Walk me through the bridge: new business added $1.9M, expansion $1.3M, and churn gave back $0.5M.`,beats:[{kind:`pin`,atMs:900}],note:`Renata pins the bridge. The next question uses that context.`,expect:{minBlocks:2,suggests:!0}},{ask:`Forecast for next quarter`,bakeAsk:`Forecast for next quarter: if churn keeps drifting at this pace, where does ARR land? Model it from the numbers we established.`,viaChip:!0,expect:{minBlocks:2}},{beats:[{kind:`export`,atMs:500,format:`presentation`}],note:`One tap: the whole review becomes a board deck.`,holdMs:6500},{beats:[{kind:`dashboard`,atMs:500,settings:!0}],note:`A living dashboard keeps a board like this up to date.`,holdMs:6500},{beats:[{kind:`present`,atMs:500}],note:`…or presents itself, full screen.`,holdMs:6e3}]},{persona:`student`,steps:[{ask:`What does saving $200 a month at 5% become after 10 years?`,bakeAsk:`What does saving $200 a month at 5% interest become after 10 years? Chart it year by year, split what I put in from what the interest earned, and make the monthly amount adjustable.`,beats:[{kind:`bend`,atMs:1100}],note:`Grab the dial. The whole answer updates live.`,expect:{minBlocks:3,bend:!0,suggests:!0}},{ask:`Why does compound interest beat simple interest? It's on my econ exam.`,beats:[{kind:`pen`,atMs:1400}],note:`Mavéa’s Pen marks the exact part Maya is studying.`,expect:{minBlocks:2}},{beats:[{kind:`flashcards`,atMs:600}],note:`Any card can become a flashcard and join her study deck.`,holdMs:6e3}]},{persona:`dev`,steps:[{ask:`Explain how OAuth login works, step by step. I'm adding it to our app.`,beats:[{kind:`focus`,atMs:1200,walk:!0}],note:`Focus mode: one card at a time, everything else dims.`,expect:{minBlocks:3,suggests:!0}},{ask:`Compare session cookies and JWTs for keeping users signed in. Focus on tradeoffs, not dogma.`,bakeAsk:`Compare session cookies and JWTs for keeping users signed in. Show the real tradeoffs side by side, including revocation, statelessness, size, XSS and CSRF exposure, and when each wins.`,beats:[{kind:`pin`,atMs:1e3}],expect:{minBlocks:2}},{beats:[{kind:`palette`,atMs:600}],note:`Press Command K. Every feature is a keystroke away.`,holdMs:5e3},{beats:[{kind:`export`,atMs:500,format:`presentation`}],note:`The whole session becomes a polished presentation.`,holdMs:7500}]},{persona:`traveler`,steps:[{ask:`Plan a long weekend in Lisbon. Three days, first visit, and we love food and views.`,expect:{minBlocks:4,suggests:!0}},{ask:`How do we plan a great day trip to Sintra on Saturday?`,beats:[{kind:`canvas`,atMs:1e3}],note:`The spatial canvas: the whole trip on one board.`,expect:{minBlocks:2}},{beats:[{kind:`export`,atMs:500,format:`document`}],note:`The plan is ready to print for the plane.`,holdMs:7500}]}].map(e=>[e.persona,e]));function Ii(e){return Fi.get(e)}function Li(e){return e.steps.filter(e=>!!e.ask)}var Ri=1300,zi=900;function Bi(e,t){return(e?.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,t)}function Vi(e,t,n,r){switch(e.kind){case`pin`:r(e.atMs,()=>t.pinFirstBlock());break;case`bend`:n?.spec.bend&&r(e.atMs,()=>t.bendIt());break;case`mark`:r(e.atMs,()=>t.setInkArmed(!0)),r(e.atMs+500,()=>t.scriptedMark());break;case`pen`:r(e.atMs,()=>t.drawPenOnFirstBlock());break;case`focus`:r(e.atMs,()=>t.setViewMode(`focus`)),e.walk&&Bi(n,4).forEach((n,i)=>r(e.atMs+zi+i*Ri,()=>t.setSpot(n)));break;case`canvas`:{r(e.atMs,()=>t.setViewMode(`canvas`));let i=Bi(n,3);i.forEach((n,i)=>r(e.atMs+zi+i*Ri,()=>t.setSpot(n))),r(e.atMs+zi+i.length*Ri,()=>t.setSpot(null));break}case`export`:r(e.atMs,()=>t.openExport()),e.format===`document`&&r(e.atMs+1800,()=>t.exportSetFormat(`document`)),r(e.atMs+3e3,()=>t.exportPickTemplate(1));break;case`dashboard`:r(e.atMs,()=>t.openDashboards()),e.settings&&r(e.atMs+2600,()=>t.dashboardShowSettings());break;case`flashcards`:r(e.atMs,()=>t.openFlashcards());break;case`present`:r(e.atMs,()=>t.setPresenting(!0));break;case`share`:r(e.atMs,()=>t.setShareOpen(!0));break;case`palette`:r(e.atMs,()=>t.setPaletteOpen(!0))}}function Hi(e){switch(e.kind){case`canvas`:return 6400;case`focus`:return e.walk?7300:1600;case`export`:return e.format===`document`?4800:3800;case`dashboard`:return e.settings?4400:2600;case`mark`:return 2400;case`pen`:return 3200;default:return 1600}}function Ui(e){return e?.length?Math.max(...e.map(e=>e.atMs+Hi(e))):0}i();var Y=Object.assign({"./cfo.generated.json":()=>a(()=>import(`./cfo.generated-j5CXp1Zz.js`),[]),"./dev.generated.json":()=>a(()=>import(`./dev.generated-DYgVxL_4.js`),[]),"./student.generated.json":()=>a(()=>import(`./student.generated-DS_acPaJ.js`),[]),"./traveler.generated.json":()=>a(()=>import(`./traveler.generated-Beun9X7y.js`),[])});async function Wi(e){let t=Y[`./${e}.generated.json`];if(!t)return null;try{return(await t()).default??null}catch{return null}}var Gi=4500,Ki=1e3,qi=6e4;function Ji(e,t,n){if(!e[t]?.ask)return null;let r=e.slice(0,t+1).filter(e=>!!e.ask).length-1;return n.frames[r]??null}function Yi(e,t,n){let r=e.slice(0,t+1).filter(e=>!!e.ask).length;return n.frames[Math.max(0,r-1)]??null}function Xi(e){let{active:t,personaId:n}=e,r=n?Ii(n):void 0,i=r?.steps??[],a=i.length,[o,s]=(0,U.useState)(null),[c,u]=(0,U.useState)(`loading`),[d,f]=(0,U.useState)(()=>Math.max(0,Math.min(a-1,e.startStep??0))),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(!1),y=(0,U.useRef)(_);y.current=_;let[b,x]=(0,U.useState)(!1),[S,C]=(0,U.useState)(0),[w,T]=(0,U.useState)(null),E=(0,U.useRef)(e.ops);E.current=e.ops;let D=(0,U.useRef)(null),O=(0,U.useRef)(0),A=(0,U.useCallback)(()=>{if(!t||!n)return;u(`loading`);let e=++O.current;Wi(n).then(t=>{if(e!==O.current)return;let n=r?Li(r).length:0,i=!!t&&!!r&&t.frames.length===n;s(i?t:null),u(i?`ready`:`error`)})},[t,n,r]);(0,U.useEffect)(A,[A]);let j=(0,U.useCallback)(()=>{let e=E.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,U.useEffect)(()=>{if(!t||!p||b||c!==`ready`||!o||!r)return;let e=r.steps[d];if(!e)return;l(r.persona,d);let n=E.current,i=ci(),a=i.after;T(null),D.current=null,j(),n.setMuted(y.current);let s=Ji(r.steps,d,o),u=s??Yi(r.steps,d,o),f=e.ask?Yr(e.ask):null,m=s?Xr({...s,question:f??s.question}):null,h=u?Xr(u):null,g=()=>{let t=e.beats??[];for(let e of t)Vi(e,n,h,a);if(e.note){let n=t.length?Math.min(...t.map(e=>e.atMs)):0;a(n,()=>T(Yr(e.note??``)))}D.current=Date.now()+Ui(t)+(e.holdMs??Gi)},_=e=>{let t=Date.now(),r=0,i=()=>{if(Date.now()-t>=qi){g();return}if(r=n.isSpeaking()||n.isBusy()?0:r+1,r>=7){g();return}a(250,i)};a(e,i)};if(e.ask&&m){let t=r.steps.slice(0,d+1).filter(e=>!!e.ask).length-1,i=t>0?o.frames[t-1]??null:null,s=!!e.viaChip&&!!i?.spec.suggests?.some(t=>t.label===e.ask),c=f??e.ask,l;s?(a(700,()=>n.pressKeepGoing(e.ask??c)),l=1600):l=ui(a,n.typeInto,c,400)+360,a(l,()=>li(a,()=>n.showFrame(m,c))),_(l+Ki)}else!n.hasCanvas()&&h&&n.showFrame(h,h.question,{silent:!0}),a(300,g);return i.cancel},[d,S,t,p,b,c,o,r,j]),(0,U.useEffect)(()=>{if(!t||!p||b||!h||c!==`ready`)return;let e=E.current,n=window.setInterval(()=>{let t=D.current;!t||Date.now()<t||e.isSpeaking()||e.isBusy()||(window.clearInterval(n),d+1>=a?(j(),x(!0)):f(d+1))},250);return()=>window.clearInterval(n)},[d,S,t,p,b,h,a,c,j]),(0,U.useEffect)(()=>()=>j(),[j]);let M=(0,U.useCallback)(()=>{k(),m(!0),g(!0),x(!1)},[]),N=(0,U.useCallback)((e,t)=>{k(),x(!1),t?.keepPlaying||g(!1),f(Math.max(0,Math.min(a-1,e))),C(e=>e+1)},[a]),P=(0,U.useCallback)(()=>{d+1>=a?(j(),x(!0)):N(d+1,{keepPlaying:!0})},[d,a,N,j]),F=(0,U.useCallback)(()=>N(d-1),[d,N]),I=(0,U.useCallback)(e=>N(e),[N]),L=(0,U.useCallback)(()=>{j(),m(!0),N(0),g(!0)},[N,j]),R=(0,U.useCallback)(()=>{if(k(),!p){M();return}if(b){L();return}g(e=>!e)},[b,L,M,p]),z=(0,U.useCallback)(()=>{k();let e=!y.current;y.current=e,v(e),E.current.setMuted(e),e&&E.current.cancelSpeech()},[]),ee=(0,U.useCallback)(()=>{j(),x(!0)},[j]);return{active:t,started:p,loadState:c,model:o?.model??null,reload:A,index:d,total:a,step:t?i[d]??null:null,note:w,playing:h,muted:_,done:b,start:M,next:P,prev:F,jumpTo:I,toggle:R,toggleMute:z,replay:L,skip:ee}}function Zi(e){return/\p{Extended_Pictographic}/u.test(e)}function Qi(){window.location.hash=`#/`}function $i({driver:e,member:t,onExit:n}){let r=(0,U.useRef)(null),i=e.active&&e.loadState===`ready`&&(!e.started||e.done);if(oe(r,{active:i}),!e.active)return null;let a={"--accent":t.accent};if(e.loadState===`loading`)return(0,W.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{className:`demox-load`,style:a,children:[(0,W.jsx)(z.spinner,{className:`demox-spinner`}),`Loading curated replay…`]})});if(e.loadState===`error`)return(0,W.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{className:`demox-card`,style:a,role:`alert`,children:[(0,W.jsx)(`p`,{className:`demox-card-title`,children:`This demo couldn’t load`}),(0,W.jsx)(`p`,{className:`demox-card-body`,children:`The curated prerecorded example did not come through. Check your connection and try again.`}),(0,W.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.reload,children:`Retry`}),(0,W.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:Qi,children:`Back to home`})]})]})});if(!e.started)return(0,W.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{ref:r,className:`demox-card demox-start`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-start-title`,children:[(0,W.jsx)(`span`,{className:`demox-avatar`+(Zi(t.avatar)?` emoji`:``),children:t.avatar}),(0,W.jsx)(`span`,{className:`demox-card-kicker`,children:`Curated prerecorded example`}),(0,W.jsxs)(`p`,{id:`demox-start-title`,className:`demox-card-title`,children:[`Watch: `,t.useCase]}),(0,W.jsx)(`p`,{className:`demox-card-body`,children:`This fictional scenario replays prerecorded, model-generated answers with curated feature choreography. Pause or move between steps at any time.`}),(0,W.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.start,children:`Start demo`}),(0,W.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:Qi,children:`Back to home`})]})]})});if(e.done){let i=I.filter(e=>e.id!==t.id);return(0,W.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,W.jsxs)(`div`,{ref:r,className:`demox-card demox-end`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-end-title`,children:[(0,W.jsx)(`span`,{className:`demox-avatar`+(Zi(t.avatar)?` emoji`:``),children:t.avatar}),(0,W.jsx)(`p`,{id:`demox-end-title`,className:`demox-card-title`,children:`End of curated replay`}),(0,W.jsx)(`p`,{className:`demox-card-body`,children:`These model-generated answers were prerecorded, then replayed with curated feature choreography. The scenario is illustrative, not a live result or customer testimonial. Try your own question with your selected provider.`}),(0,W.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:n,children:`Try it yourself`}),(0,W.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:e.replay,children:`Replay`})]}),(0,W.jsx)(`div`,{className:`demox-others`,role:`group`,"aria-label":`More curated replays`,children:i.map(e=>(0,W.jsxs)(`button`,{type:`button`,className:`demox-other`,style:{"--accent":e.accent},onClick:()=>g(e.id),title:`${e.name} · ${e.role}`,children:[(0,W.jsx)(`span`,{className:`demox-other-avatar`+(Zi(e.avatar)?` emoji`:``),children:e.avatar}),e.useCase]},e.id))})]})})}return(0,W.jsxs)(`div`,{className:`demox`,"aria-live":`polite`,children:[(0,W.jsxs)(`div`,{className:`demox-banner`,style:a,children:[(0,W.jsx)(`span`,{className:`demox-avatar`+(Zi(t.avatar)?` emoji`:``),children:t.avatar}),(0,W.jsxs)(`span`,{className:`demox-who`,children:[(0,W.jsx)(`span`,{className:`demox-name`,children:t.useCase}),(0,W.jsxs)(`span`,{className:`demox-role`,children:[t.name,` · `,t.role]})]}),(0,W.jsx)(`span`,{className:`demox-badge`,children:`Curated replay`})]}),e.note&&(0,W.jsx)(`div`,{className:`demox-note`,style:a,children:e.note},e.note),(0,W.jsxs)(`div`,{className:`demox-panel`,style:a,role:`group`,"aria-label":`Demo controls`,children:[(0,W.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.prev,disabled:e.index===0,"aria-label":`Previous step`,children:(0,W.jsx)(z.chevL,{className:`demox-ic`})}),(0,W.jsx)(`button`,{type:`button`,className:`demox-btn demox-play`,onClick:e.toggle,"aria-label":e.playing?`Pause autoplay`:`Turn on autoplay`,children:e.playing?(0,W.jsx)(z.pause,{className:`demox-ic`}):(0,W.jsx)(z.play,{className:`demox-ic`})}),(0,W.jsx)(`button`,{type:`button`,className:`demox-btn demox-mute`,onClick:e.toggleMute,"aria-label":e.muted?`Turn narration on`:`Mute narration`,"aria-pressed":e.muted,title:e.muted?`Turn narration on`:`Mute narration`,children:e.muted?(0,W.jsx)(z.speakerOff,{className:`demox-ic`}):(0,W.jsx)(z.speaker,{className:`demox-ic`})}),(0,W.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.next,"aria-label":`Next step`,children:(0,W.jsx)(z.chevR,{className:`demox-ic`})}),(0,W.jsx)(`div`,{className:`demox-dots`,role:`tablist`,"aria-label":`Steps`,children:Array.from({length:e.total},(t,n)=>(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":n===e.index,"aria-label":`Step ${n+1}`,className:`demox-dot`+(n===e.index?` is-active`:``),onClick:()=>e.jumpTo(n)},n))}),(0,W.jsxs)(`button`,{type:`button`,className:`demox-skip`,onClick:n,"aria-label":`Exit demo, try it yourself`,children:[(0,W.jsx)(`span`,{className:`demox-skip-full`,children:`Exit, try it yourself`}),(0,W.jsx)(`span`,{className:`demox-skip-short`,"aria-hidden":`true`,children:`Exit`})]})]})]})}i();var ea=[`nasa-cfd`,`fomc`,`weather`,`cars`,`react-readme`],ta=null;async function na(){return ta||(ta=[...(await a(()=>import(`./prism.generated-BQkO5r6r.js`),[])).default.docs].sort((e,t)=>{let n=ea.indexOf(e.id),r=ea.indexOf(t.id);return(n<0?99:n)-(r<0?99:r)}).map(e=>({id:e.id,type:e.type,name:e.name,doc:{name:e.name,mime:e.mime,data:e.data,size:e.size},spec:{...e.spec,claims:e.spec.claims.map(e=>({...e,kind:Pt(e.kind)}))},proposed:e.proposed})),ta)}var ra=`How does $10,000 grow at 7% over 30 years?`;function ia(){let e=Jr(`money`)?.frames[0]?.spec.blocks??[],t=Jr(`monthly`)?.frames[0]?.spec.blocks??[],n=[],r=(e,t,r=1)=>{for(let i of t)for(let t of e)t.type===i&&t.id&&!n.includes(t)&&r-->0&&n.push(t)};return r(e,[`chart`]),r(e,[`stacked`,`stack`]),r(t,[`chart`]),r(t,[`kpi`,`stack`,`stacked`]),r(e,[`breakdown`]),n}function aa(){let e=zt().find(e=>e.question===ra);if(e)return e.id;let t=ia();if(t.length===0)return null;let n=Vt({title:`Investment growth · $10k at 7%`,question:ra,topic:`money`});return n.thesis={text:`Your initial $10,000 grows by more than 7.6× through the power of compounding interest.`,saidAt:n.createdAt},n.widgets=t.map(e=>Rt(e,`tour`)),n.cadence={data:`hourly`,ai:`daily`},n.nextDataAt=It(n.createdAt,Ft[n.cadence.data]),n.nextAiAt=It(n.createdAt,Bt[n.cadence.ai]),Lt(n),n.id}function oa(e,t){let n=e.length,r=new ArrayBuffer(44+n*2),i=new DataView(r);function a(e,t){for(let n=0;n<t.length;n++)i.setUint8(e+n,t.charCodeAt(n))}a(0,`RIFF`),i.setUint32(4,36+n*2,!0),a(8,`WAVE`),a(12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*2,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),a(36,`data`),i.setUint32(40,n*2,!0);let o=44;for(let t=0;t<n;t++){let n=Math.max(-1,Math.min(1,e[t]));i.setInt16(o,n<0?n*32768:n*32767,!0),o+=2}return r}i();var sa=12,ca=2813,la=3;function ua(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function da(e){let t=e&&typeof e==`object`&&`name`in e?String(e.name):void 0;return t===`NotAllowedError`||t===`SecurityError`?`not-allowed`:`audio`}function fa(e){return e?45e3:25e3}var pa=class t{mode=`vad`;capabilities;vad=null;vadLoading=!1;vadFailed=!1;phase=`idle`;muted=!1;wantRunning=!1;continuous=!1;disposed=!1;sessionId=0;transcriptionAbort=null;transcriptionChain=Promise.resolve();queuedTranscriptions=0;preRollFrames=[];utteranceFrames=[];maveaSpeaking=!1;echoTailUntil=0;onBargeIn;utteranceIsEcho=!1;bargeInTimer=null;static ECHO_TAIL_MS=600;static WHISPER_RETRY_MS=1e4;whisperOk=null;whisperRetryAt=0;resultSubs=new Set;stateSubs=new Set;constructor(){let e=typeof navigator<`u`&&typeof navigator.mediaDevices?.getUserMedia==`function`;this.capabilities={stt:e,tts:!1,canUseRealVoice:e}}start(e){if(!this.muted){if(e?.continuous!==void 0&&(this.continuous=e.continuous),this.wantRunning||(this.sessionId+=1),this.wantRunning=!0,this.vadFailed){this.emitState({phase:`idle`,error:`unsupported`});return}this.vad?this.startVad():this.loadVad()}}stop(){this.wantRunning=!1,this.continuous=!1,this.sessionId+=1,this.transcriptionAbort?.abort(),this.transcriptionAbort=null,this.pauseVad(),this.clearBargeInTimer(),this.preRollFrames=[],this.utteranceFrames=[],this.phase!==`idle`&&this.emitState({phase:`idle`})}forceStop(){if(this.phase===`transcribing`){this.continuous=!1,this.wantRunning=!1,this.pauseVad();return}let e=this.continuous;this.wantRunning=e,this.pauseVad(),this.clearBargeInTimer();let t=ua([...this.utteranceFrames,...this.preRollFrames]);this.preRollFrames=[],this.utteranceFrames=[],this.utteranceIsEcho=!1,t.length>0?(this.emitState({phase:`transcribing`}),this.enqueueTranscription(t,this.sessionId,e)):(this.emitState({phase:`idle`}),e&&this.startVad())}speak(e){return Promise.resolve()}cancel(){this.stop()}setMuted(e){this.muted=e,e&&this.stop()}setMaveaSpeaking(e){this.maveaSpeaking&&!e&&(this.echoTailUntil=Date.now()+t.ECHO_TAIL_MS),this.maveaSpeaking=e}setSoundEnabled(e){}onResult(e){return this.resultSubs.add(e),()=>this.resultSubs.delete(e)}onStateChange(e){return this.stateSubs.add(e),()=>this.stateSubs.delete(e)}dispose(){this.disposed=!0,this.wantRunning=!1,this.sessionId+=1,this.transcriptionAbort?.abort(),this.transcriptionAbort=null,this.clearBargeInTimer(),this.vad&&=(this.vad.destroy().catch(()=>{}),null),this.resultSubs.clear(),this.stateSubs.clear()}async loadVad(){if(!this.vadLoading){this.vadLoading=!0;try{let{MicVAD:t}=await a(async()=>{let{MicVAD:t}=await import(`./dist-kNHRtoqd.js`).then(t=>e(t.default,1));return{MicVAD:t}},__vite__mapDeps([0,1,2]));if(this.vad=await t.new({model:`v5`,startOnLoad:!1,baseAssetPath:`/`,onnxWASMBasePath:`/`,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechMs:280,preSpeechPadMs:500,redemptionMs:1600,onFrameProcessed:(e,t)=>this.captureFrame(t),onSpeechStart:()=>this.handleSpeechStart(),onSpeechRealStart:()=>this.handleSpeechRealStart(),onSpeechEnd:e=>void this.handleSpeechEnd(e),onVADMisfire:()=>this.handleMisfire()}),this.disposed){this.vad.destroy().catch(()=>{}),this.vad=null;return}this.vadLoading=!1,this.wantRunning&&this.startVad()}catch(e){console.warn(`[VadVoice] Local Silero VAD failed to load`,e),this.vadLoading=!1,this.vadFailed=!0,this.wantRunning&&this.emitState({phase:`idle`,error:`unsupported`})}}}clearBargeInTimer(){this.bargeInTimer!==null&&(clearTimeout(this.bargeInTimer),this.bargeInTimer=null)}startVad(){this.vad&&Promise.resolve(this.vad.start()).catch(e=>{!this.disposed&&this.wantRunning&&(this.wantRunning=!1,this.emitState({phase:`idle`,error:da(e)}))})}pauseVad(){this.vad&&Promise.resolve(this.vad.pause()).catch(()=>{})}captureFrame(e){let t=e.slice();if(this.phase===`listening`&&!this.utteranceIsEcho){this.utteranceFrames.length<ca&&this.utteranceFrames.push(t);return}this.preRollFrames.push(t),this.preRollFrames.length>sa&&this.preRollFrames.shift()}handleSpeechStart(){this.muted||(this.utteranceIsEcho=Date.now()<this.echoTailUntil,this.utteranceFrames=this.preRollFrames,this.preRollFrames=[],!this.utteranceIsEcho&&this.emitState({phase:`listening`}))}handleSpeechRealStart(){this.muted||(this.utteranceIsEcho&&!this.maveaSpeaking&&(this.utteranceIsEcho=!1,this.utteranceFrames=[...this.utteranceFrames,...this.preRollFrames],this.preRollFrames=[],this.emitState({phase:`listening`})),!this.utteranceIsEcho&&this.maveaSpeaking&&this.onBargeIn?.())}handleMisfire(){this.clearBargeInTimer(),this.utteranceIsEcho=!1,this.utteranceFrames=[],this.continuous||(this.wantRunning=!1,this.pauseVad()),this.phase!==`idle`&&this.emitState({phase:`idle`})}handleSpeechEnd(e){if(this.clearBargeInTimer(),this.utteranceIsEcho){this.utteranceIsEcho=!1,this.utteranceFrames=[],this.emitState({phase:`idle`});return}this.utteranceFrames=[],this.continuous||(this.wantRunning=!1,this.pauseVad()),this.emitState({phase:`transcribing`}),this.enqueueTranscription(e,this.sessionId)}enqueueTranscription(e,t,n=!1){if(this.queuedTranscriptions>=la){this.emitState({phase:`idle`,error:`audio`}),n&&this.wantRunning&&this.startVad();return}this.queuedTranscriptions+=1,this.transcriptionChain=this.transcriptionChain.catch(()=>{}).then(async()=>{try{if(this.disposed||t!==this.sessionId)return;let r=new AbortController;this.transcriptionAbort=r;let i=await this.transcribeWhisper(e,r.signal);if(this.transcriptionAbort===r&&(this.transcriptionAbort=null),this.disposed||r.signal.aborted||t!==this.sessionId)return;let a=i.text.trim();if(a){let e=i.confidence!==void 0&&i.confidence<.7||(i.noSpeechProbability??0)>=.6;this.emitState({phase:`heard`,transcript:a}),this.emitResult({transcript:a,confidence:i.confidence,noSpeechProbability:i.noSpeechProbability,lowConfidence:e})}else{this.emitState({phase:`idle`,error:i.error??`no-speech`}),n&&this.wantRunning&&this.startVad();return}this.emitState({phase:`idle`}),n&&this.wantRunning&&this.startVad()}finally{--this.queuedTranscriptions}})}async transcribeWhisper(e,t){let n=await this.transcribeWhisperDetailed(e,t);return t?n:n.text}async transcribeWhisperDetailed(e,n){if(this.whisperOk===!1&&Date.now()<this.whisperRetryAt)return{text:``,error:`transcription`};try{let t=oa(e,16e3),r=new FormData;r.append(`file`,new Blob([t],{type:`audio/wav`}),`speech.wav`),r.append(`language`,`en`),r.append(`response_format`,`verbose_json`);let i=fa(this.whisperOk===!0),a=AbortSignal.timeout(i),o=n?AbortSignal.any([n,a]):a,s=await fetch(`/stt/inference`,{method:`POST`,body:r,signal:o});if(s.ok){let e=await s.json(),t=e.text?.trim()??``;if(this.whisperOk=!0,this.whisperRetryAt=0,t){let n=[...e.words??[],...(e.segments??[]).flatMap(e=>e.words??[])].map(e=>e.probability).filter(e=>Number.isFinite(e)),r=(e.segments??[]).map(e=>e.avg_logprob).filter(e=>Number.isFinite(e)),i=n.length>0?n.reduce((e,t)=>e+t,0)/n.length:r.length>0?Math.exp(r.reduce((e,t)=>e+t,0)/r.length):void 0,a=(e.segments??[]).map(e=>e.no_speech_prob).filter(e=>Number.isFinite(e));return{text:t,confidence:i,noSpeechProbability:a.length>0?Math.max(...a):void 0}}return{text:``,error:`no-speech`}}}catch(e){if(e instanceof DOMException&&(e.name===`TimeoutError`||e.name===`AbortError`))return{text:``,error:`transcription`}}return this.whisperOk!==!0&&(this.whisperOk=!1,this.whisperRetryAt=Date.now()+t.WHISPER_RETRY_MS),{text:``,error:`transcription`}}emitResult(e){this.resultSubs.forEach(t=>t(e))}emitState(e){this.phase=e.phase,this.stateSubs.forEach(t=>t(e))}};function ma(){return new pa}function ha(e={}){let t=(0,U.useRef)(e.onResult),n=(0,U.useRef)(e.onStateChange),r=(0,U.useRef)(e.onBargeIn);t.current=e.onResult,n.current=e.onStateChange,r.current=e.onBargeIn;let i=(0,U.useMemo)(()=>ma(),[]);return(0,U.useEffect)(()=>{let e=i.onResult(e=>t.current?.(e)),a=i.onStateChange(e=>n.current?.(e));return`onBargeIn`in i&&(i.onBargeIn=()=>r.current?.()),()=>{e(),a(),i.dispose()}},[i]),(0,U.useMemo)(()=>({mode:i.mode,capabilities:i.capabilities,start:e=>i.start(e),stop:()=>i.stop(),speak:e=>i.speak(e),cancel:()=>i.cancel(),setMuted:e=>i.setMuted(e),setSoundEnabled:e=>i.setSoundEnabled(e),setMaveaSpeaking:e=>i.setMaveaSpeaking?.(e),forceStop:()=>i.forceStop?.()}),[i])}var ga=`mavea-always-on`;function _a(e,t,n=!1,r=`neutral`,i=!1){if(t)return{state:`listening`,emotion:`neutral`,gaze:`center`};if(n)return i?{state:`showing`,emotion:`surprised`,gaze:`center`}:{state:`speaking`,emotion:`surprised`,gaze:`center`};switch(e){case`thinking`:return{state:`loading`,emotion:`neutral`,gaze:`center`};case`speaking`:return i?{state:`showing`,emotion:r,gaze:`center`}:{state:`speaking`,emotion:r,gaze:`center`};case`showing`:return{state:`showing`,emotion:r,gaze:`right`};default:return{state:`idle`,emotion:r,gaze:`center`}}}var va=new Set([`no`,`caution`,`avoid`,`risk`,`wait`]),ya=new Set([`yes`,`go`,`recommended`,`good`]);function ba(e,t){let n=e.props[t];return typeof n==`string`?n.toLowerCase():void 0}function xa(e){let t=e?.blocks;if(!t?.length)return`neutral`;let n=!1,r=e?.awaiting===!0;for(let e of t){let t=ba(e,`tone`);(t===`warn`||t===`neg`)&&(n=!0),t===`pos`&&(r=!0);let i=ba(e,`stance`);i&&va.has(i)&&(n=!0),i&&ya.has(i)&&(r=!0),e.type===`insight`&&e.props.conf===`unverified`&&(n=!0)}return n?`concerned`:r?`warm`:`neutral`}function Sa(e){switch(e){case`concerned`:return`concerned`;case`warm`:return`warm`;default:return`neutral`}}function Ca(e){return Sa(xa(e))}function wa(e){let t=e?.blocks;return!t?.length||xa(e)!==`warm`?!1:t.some(e=>{let t=ba(e,`stance`);return t!==void 0&&ya.has(t)})}var Ta={clipShared:[`Nice — that one's worth sharing.`,`Off it goes.`,`Clipped and ready to share.`]};Object.keys(Ta);function Ea(e,t,n){let r=Ta[e];if(r.length===0)return``;let i=Math.abs(Math.trunc(t))%r.length;return r.length>1&&r[i]===n&&(i=(i+1)%r.length),r[i]}function Da(){return{lastAt:0,lastTurn:-1/0}}function Oa(e,t){return!(e.lastAt!==0&&t.now-e.lastAt<9e4||t.turnCount-e.lastTurn<3)}function ka(e,t){return{lastAt:t.now,lastTurn:t.turnCount}}var Aa=1100,ja=6e3,Ma=150,Na=950,Pa=350,Fa=8;function Ia(e){let{muted:t,turnCount:n,gates:r}=e,i=(0,U.useRef)(e.speak),a=(0,U.useRef)(e.cancelSpeak),o=(0,U.useRef)(e.isSpeaking);i.current=e.speak,a.current=e.cancelSpeak,o.current=e.isSpeaking;let[s,c]=(0,U.useState)([]),[l,u]=(0,U.useState)(!1),[d,f]=(0,U.useState)(null),[p,m]=(0,U.useState)(0),h=(0,U.useRef)(Da()),g=(0,U.useRef)(void 0),_=(0,U.useRef)(null),v=(0,U.useRef)(null),y=(0,U.useCallback)(()=>{_.current&&=(clearTimeout(_.current),null),v.current&&=(clearTimeout(v.current),null)},[]),b=(0,U.useCallback)(e=>{c(t=>t.length>=Fa||t[t.length-1]===e?t:[...t,e])},[]),x=(0,U.useCallback)(()=>{y(),u(!1),v.current=setTimeout(()=>{v.current=null,f(null)},Na)},[y]),S=(0,U.useCallback)(e=>{let t=()=>{let n=Date.now()-e;n>=Aa&&!o.current()||n>=ja?x():_.current=setTimeout(t,Ma)};_.current=setTimeout(t,Aa)},[x]),C=r.atRest&&!r.busy&&!r.listening&&!r.introHold&&r.hasCanvas&&!r.modalOpen;(0,U.useEffect)(()=>{if(l||d!==null||!C||s.length===0)return;if(o.current()){let e=setTimeout(()=>m(e=>e+1),Pa);return()=>clearTimeout(e)}let e=s[0],r=Date.now();if(!Oa(h.current,{type:e,now:r,turnCount:n})){c(e=>e.slice(1));return}h.current=ka(h.current,{type:e,now:r,turnCount:n});let a=Ea(e,r,g.current);g.current=a,c(e=>e.slice(1)),f(a),u(!0),!t&&a&&i.current(a),S(r)},[l,d,C,s,n,t,S,p]),(0,U.useEffect)(()=>{if(!l)return;let e=r.busy||!r.atRest,t=r.listening||r.modalOpen;!e&&!t||(y(),u(!1),f(null),c([]),g.current=void 0,t&&!e&&a.current())},[l,r.busy,r.atRest,r.listening,r.modalOpen,y]);let w=(0,U.useCallback)(()=>{y(),c([]),u(!1),f(null),h.current=Da(),g.current=void 0},[y]);return(0,U.useEffect)(()=>()=>y(),[y]),{interjecting:l,line:d,enqueue:b,reset:w}}function La(e){let t=(0,J.c)(36),{chapters:n,currentIndex:r,onJump:i,onClose:a}=e,o=(0,U.useRef)(null),s;if(t[0]===a?s=t[1]:(s={onEscape:a},t[0]=a,t[1]=s),oe(o,s),n.length===0)return null;let c;t[2]===n?c=t[3]:(c=wt(n),t[2]=n,t[3]=c);let l=c,u;t[4]!==n||t[5]!==r?(u=n.find(e=>e.moments.some(e=>e.frameIndex===r))?.color,t[4]=n,t[5]=r,t[6]=u):u=t[6];let d=u,f;t[7]===a?f=t[8]:(f=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},t[7]=a,t[8]=f);let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsx)(`h2`,{className:`ovw-title`,children:`Your conversation`}),t[9]=p):p=t[9];let m=n.length===1?`chapter`:`chapters`,h=l===1?`moment`:`moments`,g;t[10]!==n.length||t[11]!==m||t[12]!==h||t[13]!==l?(g=(0,W.jsxs)(`header`,{className:`ovw-head`,children:[p,(0,W.jsxs)(`p`,{className:`ovw-sub`,children:[n.length,` `,m,` · `,l,` `,h,` — tap anywhere to dive back in`]})]}),t[10]=n.length,t[11]=m,t[12]=h,t[13]=l,t[14]=g):g=t[14];let _;if(t[15]!==n||t[16]!==r||t[17]!==a||t[18]!==i){let e;t[20]!==r||t[21]!==a||t[22]!==i?(e=e=>(0,W.jsxs)(`section`,{className:`ovw-card`,style:{"--card-c":e.color},children:[(0,W.jsxs)(`div`,{className:`ovw-card-head`,children:[(0,W.jsx)(`span`,{className:`ovw-card-dot`}),(0,W.jsx)(`h3`,{className:`ovw-card-title`,children:e.title}),(0,W.jsx)(`span`,{className:`ovw-card-count`,children:e.moments.length})]}),(0,W.jsx)(`ul`,{className:`ovw-moments`,children:e.moments.map(e=>{let t=e.frameIndex===r,n=z[e.icon]||z.mic;return(0,W.jsxs)(`li`,{children:[(0,W.jsxs)(`button`,{type:`button`,className:`ovw-moment`+(t?` is-current`:``),onClick:()=>{i(e.frameIndex),a()},"aria-current":t?`true`:void 0,children:[(0,W.jsx)(n,{}),(0,W.jsx)(`span`,{className:`ovw-moment-q`,children:e.question||`Moment`})]}),e.elements.length>0&&(0,W.jsx)(`ul`,{className:`ovw-els`,children:e.elements.map(t=>{let n=t.icon&&z[t.icon]||z.spark;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,className:`ovw-el`,onClick:()=>{i(e.frameIndex,t.id),a()},"aria-label":`Jump to "${t.label}" in "${e.question||`this moment`}"`,children:[(0,W.jsx)(n,{}),(0,W.jsx)(`span`,{className:`ovw-el-label`,children:t.label})]})},t.id)})})]},e.frameIndex)})})]},e.id),t[20]=r,t[21]=a,t[22]=i,t[23]=e):e=t[23],_=n.map(e),t[15]=n,t[16]=r,t[17]=a,t[18]=i,t[19]=_}else _=t[19];let v;t[24]===_?v=t[25]:(v=(0,W.jsx)(`div`,{className:`ovw-grid`,children:_}),t[24]=_,t[25]=v);let y;t[26]!==v||t[27]!==g?(y=(0,W.jsxs)(`div`,{className:`ovw-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":`Conversation overview`,ref:o,onClick:Ra,children:[g,v]}),t[26]=v,t[27]=g,t[28]=y):y=t[28];let b;t[29]!==a||t[30]!==y||t[31]!==f?(b=(0,W.jsx)(`div`,{className:`ovw-scrim`,onClick:a,role:`button`,tabIndex:0,"aria-label":`Close conversation overview`,onKeyDown:f,children:y}),t[29]=a,t[30]=y,t[31]=f,t[32]=b):b=t[32];let x;return t[33]!==d||t[34]!==b?(x=(0,W.jsx)(Le,{accent:d,children:b}),t[33]=d,t[34]=b,t[35]=x):x=t[35],x}function Ra(e){return e.stopPropagation()}function za(e){let t=new Map;for(let n of e)for(let e of n.spec?.sources??[])e?.url&&!t.has(e.url)&&t.set(e.url,e);return[...t.values()]}function Ba(e,t={}){if(e.length<2)return null;let n=e[e.length-1]?.spec;if(!n)return null;let r=t.cap??1/0,i=e.reduce((e,t)=>Re(e,t.spec?.blocks??[],`augment`).blocks,[]),a=i.length>r,o=a?i.slice(0,r):i,s=e.length,c=a?`${s} moments in this thread · showing the first ${r} cards`:`${s} moments in this thread`,l=za(e);return{...n,id:t.id??n.id,title:t.title??n.title,sub:c,blocks:o,sources:l.length?l:n.sources,tint:t.tint??n.tint,suggests:[],bend:void 0,awaiting:void 0,blanks:void 0}}var Va=240;function Ha(e){let{stops:t,from:n=0,spokenWalk:r,withNotes:i,teach:a,marksById:o}=e,s=[],c=0;for(let e=n;e<t.length;e++){let n=t[e].spot;if(!n)continue;let l=t[e].line;if(r&&e>0&&i&&l){let e=ot(l);e&&s.push({spot:n,line:l,noteText:e})}let u=o.get(n);if(u?.length){let e=u.length>1;for(let t=0;t<u.length;t++){let r=t===u.length-1;s.push({spot:n,line:l,mark:u[t],generous:a,delayMs:c*Va,badgeMs:r?at+(u.length-1)*Va:void 0,stepNumber:e?t+1:void 0}),c++}}else a&&(s.push({spot:n,line:l,generous:!0,delayMs:c*Va}),c++)}return s}var Ua=1100,Wa=1700;function Ga(e,t,n){let{controller:r,release:i}=e,a=!1,o=e=>{a||(a=!0,i(),n(e))},s=()=>t.isCancelled()?`cancelled`:t.isDismissed()?`dismissed`:null;(async()=>{for(let e=0;e<r.count;e++){let n=s();if(n){o(n);return}let i=r.spokenFor(e)??r.captionFor(e);if(i){let n=t.speakLine(i),a=await nt(n),c=s();if(c){o(c);return}r.setIndex(e),a?await Xe(n,Wa,Ua):await Qe(Wa)}else r.setIndex(e),await Qe(Wa)}let e=s();o(e??`complete`)})()}function Ka(e,t,n){if(e.length===0)return e;let r=new Map;n.forEach((e,t)=>{let n=Ve(e),i=r.get(n);i?i.push(t):r.set(n,[t])});let i=new Map;n.forEach((e,t)=>{let n=Ve(e);i.has(n)||i.set(n,t)});let a=e=>{if(e.kind!==`connect`)return e;let n=t[e.onIndex??-1],r=n?i.get(Ve(n)):void 0;return r===void 0?void 0:{...e,onIndex:r}},o=e=>{let t=(e.marks??(e.mark?[e.mark]:[])).map(a).filter(e=>!!e);return t.length?{mark:t[0],...t.length>1?{marks:t}:{}}:{}},s=[],c=new Set;for(let n of e){let e=t[n.index];if(!e)continue;let i=r.get(Ve(e))?.shift();if(i===void 0||c.has(i))continue;c.add(i);let{mark:a,marks:l}=o(n),u={...n,index:i,mark:a,marks:l},d=i===n.index&&a===n.mark&&l===n.marks;s.push(d?n:u)}return s}function qa(e,t,n,r,i){let a={question:n,narration:r.narration,title:r.spec.title,blockTypes:r.spec.blocks.map(e=>e.type)},o=Be(e,a,r.continuity,r.tier),s=!e||o===`replace`&&He(e,a)<.15,c=i?.forceReplace?`replace`:o,l=Re(t,r.spec.blocks,c);c!==`replace`&&l.overflow&&(c=`replace`,l=Re(t,r.spec.blocks,`replace`));let u={...r.spec,blocks:l.blocks};c!==`replace`&&delete u.bend;let d=c===`replace`?l.blocks.find(e=>e.id)?.id??null:l.firstNewId,f=Ka(r.tour??[],r.spec.blocks,l.blocks),p=Date.now();return{frame:{id:We(p),question:n,narration:r.narration,...r.spoken?{spoken:r.spoken}:{},mode:c,topicShift:s,tour:f,spec:u,at:p,...r.corrects?{corrects:r.corrects}:{}},mode:c,spot:d,snap:a}}var Ja={like:`Likes`,love:`Loves`,prefer:`Prefers`,enjoy:`Enjoys`,hate:`Hates`,dislike:`Dislikes`,need:`Needs`,want:`Wants`,own:`Owns`,use:`Uses`,drive:`Drives`,play:`Plays`,speak:`Speaks`,work:`Works`,live:`Lives`,study:`Studies`,train:`Trains`,teach:`Teaches`,code:`Codes`,run:`Runs`,cook:`Cooks`,travel:`Travels`},Ya=3,Xa=140;function Za(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Qa(e){let t=e.trim().replace(/\s+/g,` `);if(!t||t.length>Xa||t.includes(`?`))return``;let n=t.toLowerCase(),r;if(r=t.match(/^i(?:'m| am)\s+(an?\s+.+)/i))return $a(`Is ${r[1]}`);if(r=t.match(/^i(?:'m| am)\s+(.+)/i))return $a(r[1]);if(r=t.match(/^i(?:'ve| have)\s+(?:got\s+)?(.+)/i))return $a(`Has ${r[1]}`);if(r=t.match(/^my\s+(.+?)\s+(is|are)\s+(.+)/i))return $a(`${r[1]} ${r[2]} ${r[3]}`);if(r=n.match(/^i\s+(\w+)\s+(.+)/)){let e=Ja[r[1]];if(e)return $a(`${e} ${t.slice(t.toLowerCase().indexOf(r[2]))}`)}return``}function $a(e){let t=Za(e.trim().replace(/\s+/g,` `));return t.length>=6&&t.length<=Xa?t:``}function eo(e){if(!e)return[];let t=e.split(/[.!?\n]+|,?\s+\band\b\s+/i),n=[];for(let e of t){let t=Qa(e);if(t&&!n.includes(t)&&n.push(t),n.length>=Ya)break}return n}var to=.6,no=.5;function ro(e){return(e.match(/\d[\d,.]*\d|\d/g)??[]).map(e=>e.replace(/,/g,``).replace(/\.+$/,``))}function io(e,t){let n=ro(e);if(!n.length)return!1;let r=new Set(ro(t));return n.some(e=>!r.has(e))}function ao(e,t,n={}){if(!io(e,t)){let n=En(e),r=En(t);if(n.size>0&&An(n,r)>=to)return`user-stated`}return n.webGrounded?`web-grounded`:`model-inferred`}function oo(e,t){let n=ro(e),r=new Set(ro(t));if(n.length)return n.every(e=>r.has(e))?`user-stated`:`model-inferred`;let i=En(e);return i.size>0&&An(i,En(t))>=no?`user-stated`:`model-inferred`}var so=24;function co(e,t=`item`){let n=e.toLowerCase().match(/[a-z][a-z0-9]*/g);return(n&&n[0]?n[0]:t).slice(0,so)}function lo(e,t={}){return{concept:`corrections.${co(e.what)}`,body:`On "${e.what}", an earlier answer said ${e.was}; the user corrected it to ${e.now}. Use the corrected value and double-check figures like this before stating them.`,kind:`procedural`,source:t.source??`user-stated`,verify:!0,outcome:`loss`,turnId:t.turnId,quote:e.now}}var uo=4,fo=1600,po=24,mo=`Break ONE cause into the parts it is MADE OF (components or segments) — never its causes or its effects, which are separate nodes. Return ONLY compact JSON, one line.
3
3
 
4
4
  At most ${uo} children; fewer beats padding. Nothing honest to split? {"children":[]}.
5
5
  "tier":"T2" with a VERBATIM "quote" from SOURCES is the only way to give a "value" — otherwise "tier":"T0" and no numbers, no quote. Never invent a figure or a citation. Empty SOURCES ⇒ every child T0.
@@ -76,4 +76,4 @@ Only genuinely new atoms (each needs a verbatim quote from the NEW speech). Reus
76
76
  `).trim()}function Hd(e,t){let n=e.center?.trim(),r=Vd(e);return[n?`I've been thinking out loud and here's what it comes down to: ${n}`:`I've been thinking out loud. Here's the shape of it.`,``,r,``,t===`plan`?`Pull this together and give me a concrete plan — the clear next steps, in order, that move me forward given everything above.`:`Pull this together and help me with it — weigh what matters most, address the tensions head-on, and give me a clear, useful answer.`].filter(e=>e!==void 0).join(`
77
77
  `).trim()}function Ud(e){return/^(ok(ay)?[,.\s]+)?(any |your |so[,.\s]+)?thoughts\s*[?.!]*$/i.test(e.trim())}function Wd(e,t){return e?t>0?`Discard ${t} banked — or tap Thoughts? to sort them`:`Stop banking and go back to answering`:`Bank everything you say without answering — say "thoughts?" when you want the sort`}function Gd(e){let t=e.trim();return t.length>0&&!Ud(t)}function Kd(e,t){let n=e.map((e,t)=>`(${t+1}) ${e.trim()}`).join(`
78
78
  `);return[`I just thought out loud for about ${Math.max(1,t)} minute${t>=2?`s`:``}. Sort what I actually said — do NOT add ideas of your own:`,`- the DECISIONS I made (even tentative ones),`,`- the TODOS I gave myself,`,`- any CONTRADICTIONS (quote both moments and ask me which one I mean).`,`My words, in order:`,n].join(`
79
- `)}var qd=/https?:\/\/[^\s<>"')\]]+/i;function Jd(e){let t=e.match(qd);return t?t[0].replace(/[.,;:!?]+$/,``):null}function Yd(e){let t=Jd(e);return t?e.replace(t,``).trim().split(/\s+/).filter(Boolean).length<=12:!1}function Xd(e){return`Check this for me: ${e} — what's actually true, what's shaky, and what's missing context? Ground every verdict in real sources.`}var Zd=`Check the claim in this screenshot — what's actually true, what's shaky, and what's missing context? Ground every verdict in real sources.`;function Qd(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable:!1}var $d=dt.map(e=>{let t=ft[e];return{id:e,label:t.label,description:`${t.archetype} — ${t.blurb}`,accent:t.tokens.accent}}),ef=`mavea-preso-style`;function tf(e){return $d.some(t=>t.id===e)}function nf(){try{let e=localStorage.getItem(ef);return tf(e)?e:`folio`}catch{return`folio`}}function rf(e){try{localStorage.setItem(ef,e)}catch{}}function af(e){return e<5?`Late night`:e<12?`This morning`:e<17?`This afternoon`:`Tonight`}function of(e){let t=Math.max(1,Math.round(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function sf(e,t){if(e.length===0||t.length===0)return null;let n=e[0],r=e[e.length-1],i=`${af(new Date(n.at).getHours())}, so far.`,a=[`${rc(n.at)} – ${rc(r.at)}`,of(r.at-n.at),`${t.length} ${t.length===1?`topic`:`topics`}`,`${e.length} ${e.length===1?`moment`:`moments`}`].join(` · `),o=nc(e),s=[];for(let n of t){let t=n.moments[0],r=n.moments[n.moments.length-1],i=e[r.frameIndex],a=i?.narration||i?.question||``;if(!a)continue;let c=n.moments.map(e=>o.get(e.frameIndex)).find(Boolean);s.push({title:n.title,clock:rc(e[t.frameIndex]?.at),line:a,frameIndex:r.frameIndex,...c?{corrected:`Corrected — ${c.note.what}: was ${c.note.was}, now ${c.note.now}`}:{}})}return s.length?{heading:i,meta:a,rows:s}:null}function cf(e){let t=(0,J.c)(10),{transcript:n,mode:r,note:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,W.jsxs)(`span`,{className:`listen-eq`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]}),t[0]=a):a=t[0];let o=n?`“${n}`:`Listening`,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,W.jsx)(`span`,{className:`listen-caret`,"aria-hidden":`true`}),t[1]=s):s=t[1];let c=n?`”`:``,l;t[2]!==o||t[3]!==c?(l=(0,W.jsxs)(`div`,{className:`listen-line`,children:[o,s,c]}),t[2]=o,t[3]=c,t[4]=l):l=t[4];let u=i??(r===`always`?`Always on — Mavéa answers when you finish a thought.`:r===`hold`?`Release the mic or shortcut to send.`:`It sends when you pause — or tap the mic to send now.`),d;t[5]===u?d=t[6]:(d=(0,W.jsx)(`div`,{className:`listen-note`,role:`status`,"aria-live":`polite`,children:u}),t[5]=u,t[6]=d);let f;return t[7]!==l||t[8]!==d?(f=(0,W.jsx)(`div`,{className:`listen-stage`,children:(0,W.jsxs)(`div`,{className:`listen-card`,children:[a,(0,W.jsxs)(`div`,{className:`listen-body`,children:[l,d]})]})}),t[7]=l,t[8]=d,t[9]=f):f=t[9],f}var lf=250;function uf(e){let t=(0,J.c)(6),{cards:n}=e,[r,i]=(0,U.useState)(!1),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.setTimeout(()=>i(!0),lf);return()=>window.clearTimeout(e)},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,U.useEffect)(a,o),!r||n.length===0)return null;let s;t[2]===n?s=t[3]:(s=n.map(df),t[2]=n,t[3]=s);let c;return t[4]===s?c=t[5]:(c=(0,W.jsx)(`div`,{className:`skel-grid`,role:`status`,"aria-label":`Building the answer`,children:s}),t[4]=s,t[5]=c),c}function df(e,t){return(0,W.jsxs)(`div`,{className:`skel-card`,children:[(0,W.jsxs)(`span`,{className:`skel-eyebrow`,children:[`✦ `,e.label,`…`]}),e.lines.map(ff)]},t)}function ff(e,t){return(0,W.jsx)(`span`,{className:`skel-line`,style:{width:`${e}%`}},t)}function pf({thinking:e=!1}){return(0,W.jsxs)(`div`,{className:`composing-status`,role:`status`,"aria-live":`polite`,children:[(0,W.jsx)(`span`,{className:`composing-orb`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{children:e?`Thinking it through`:`Composing your answer`}),(0,W.jsxs)(`span`,{className:`composing-dots`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]})]})}function mf(e){let t=(0,J.c)(14),{activity:n,sources:r}=e,i,a,o,s,c,l;if(t[0]!==n||t[1]!==r){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.slice(0,3),t=n===`searching`;if(!t&&e.length===0){l=null;break bb0}i=`turn-chips`,a=`status`,o=`polite`,s=t&&e.length===0&&(0,W.jsxs)(`span`,{className:`turn-chip`,children:[(0,W.jsx)(z.globe,{}),` Searching the web…`]}),c=e.map(hf)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;return t[8]!==i||t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==c?(u=(0,W.jsxs)(`div`,{className:i,role:a,"aria-live":o,children:[s,c]}),t[8]=i,t[9]=a,t[10]=o,t[11]=s,t[12]=c,t[13]=u):u=t[13],u}function hf(e,t){return(0,W.jsxs)(`span`,{className:`turn-chip src`,children:[(0,W.jsx)(`i`,{className:`turn-chip-dot`,"aria-hidden":`true`}),ge(e.url)??e.title]},t)}function gf(){return(0,U.useSyncExternalStore)(ke,Ce,_f)}function _f(){return!1}var vf=600,yf=!1,bf=null,xf=null,Sf=new Set;function Cf(){if(xe()){bf===null&&!yf&&(bf=window.setTimeout(()=>{bf=null,yf=!0;for(let e of Sf)e()},vf));return}if(bf!==null&&(window.clearTimeout(bf),bf=null),yf){yf=!1;for(let e of Sf)e()}}function wf(e){return Sf.add(e),xf??=ke(Cf),()=>{Sf.delete(e),Sf.size===0&&(xf?.(),xf=null,bf!==null&&(window.clearTimeout(bf),bf=null),yf=!1)}}function Tf(){return(0,U.useSyncExternalStore)(wf,Df,Ef)}function Ef(){return!1}function Df(){return yf}var Of={scalar:`Key figure`,series:`Trend`,composition:`Breakdown`,comparison:`Comparison`,ranking:`Ranking`,distribution:`Distribution`,relationship:`Relationship`,hierarchy:`Structure`,flow:`Process`,sequence:`Timeline`,keyvalue:`Readouts`,list:`Checklist`,geo:`Map`,code:`Code`,tabular:`Table`,status:`Status`},kf=/^(please|hey|ok(ay)?|so|now|can|could|would|will|you|how|what|why|when|where|which|who|should|is|are|do|does|did|tell|show|give|make|build|plan|help|i|me|us|my|about|the|a|an)\b[\s,'’]*/i;function Af(e,t=4){let n=e.trim().replace(/\s+/g,` `);for(let e=0;e<8;e++){let e=n.replace(kf,``);if(e===n)break;n=e}return n.replace(/[?!.]+$/,``).split(` `).slice(0,t).join(` `).trim()}var jf=[[78,52],[64,88],[82,40]];function Mf(e,t){let n=Af(e),r=rn(e,t),i=Object.entries(r).filter(([e,t])=>t>0&&Of[e]).sort((e,t)=>t[1]-e[1]).map(([e])=>Of[e]),a=en(e)===`rich`?3:2,o=[`Finding`];for(let e of i){if(o.length>=a)break;o.includes(e)||o.push(e)}for(;o.length<a;)o.push(o.length===1?`Readouts`:`Details`);return o.map((e,t)=>({label:n?`${e} — ${n}`:e,lines:jf[t%jf.length]}))}function Nf(e){let t=e&&Of[e]||(e===`text`?`Finding`:null);return{label:t?`Building — ${t.toLowerCase()}`:`Building`,lines:jf[0]}}function Pf(e){return e.paletteOpen||e.shareOpen||e.exportOpen||e.dashOpen||e.showSettings||e.proofOpen||e.showHow||e.replayAt!==null||e.recapOpen||e.atlasOpen||e.delegateOpen||e.srsOpen||e.zoomLevel!==null||e.mindViewOpen}function Ff(e,t){let n=e.left-t.left+e.width/2,r=e.top-t.top+e.height/2,i=Math.min(e.width/2+14,t.width*.45),a=e.height/2+10,o=Math.PI*2*1.12,s=[];for(let e=0;e<=32;e++){let t=-Math.PI/2+o*e/32;s.push({x:n+Math.cos(t)*i,y:r+Math.sin(t)*a})}return s}var If=`Local voice input isn’t available here — check browser microphone support, or type instead.`,Lf=`Microphone access is blocked — allow mic access for this site to talk to Mavéa.`,Rf=`Couldn’t reach your microphone — check it’s connected and not in use by another app.`,zf=`Local transcription is still starting or unavailable — try again in a moment, or type instead.`;function Bf(){let e=(0,J.c)(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,U.useState)(t),[i,a]=(0,U.useState)(null),[o,s]=(0,U.useState)(!1),c;e[1]===n.length?c=e[2]:(c=async e=>{a(null);let t=6-n.length;if(t<=0){a(`You can attach up to 6 files.`);return}let i=[],o=null;for(let n of e.slice(0,t)){let e=await Ot(n);if(e.ok&&e.attachment)i.push(e.attachment);else if(!o){let t=/\.(pdf|docx|pptx|xlsx)$/i.test(n.name);o=e.error===`too-large`?`"${n.name}" is too large (max ${t?40:10} MB).`:`"${n.name}" isn't a supported type (images, PDF, Office docs, or text/data files like CSV, TXT, Markdown, JSON).`}}e.length>t&&(o=`Only the first ${t} file(s) were added.`),i.length&&r(e=>[...e,...i]),o&&a(o)},e[1]=n.length,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{r(t=>t.filter((t,n)=>n!==e))},e[3]=u):u=e[3];let d=u,f;return e[4]!==i||e[5]!==n||e[6]!==l||e[7]!==o?(f={attached:n,setAttached:r,attachError:i,setAttachError:a,turnHadFiles:o,setTurnHadFiles:s,onFiles:l,removeAttachment:d},e[4]=i,e[5]=n,e[6]=l,e[7]=o,e[8]=f):f=e[8],f}var Vf=`mavea-live-bookmarks`;function Hf(){let[e,t]=(0,U.useState)(()=>{try{let e=localStorage.getItem(Vf);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}});return{bookmarks:e,toggleBookmark:(0,U.useCallback)(e=>{t(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{localStorage.setItem(Vf,JSON.stringify([...n]))}catch{}return n})},[])}}var Uf=`mavea-live-ask-hint`;function Wf(){let e=(0,J.c)(3),[t,n]=(0,U.useState)(Gf),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{n(!0);try{localStorage.setItem(Uf,`1`)}catch{}},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a={askHintSeen:t,dismissAskHint:i},e[1]=t,e[2]=a),a}function Gf(){try{return localStorage.getItem(Uf)===`1`}catch{return!1}}i();var Kf=(0,U.lazy)(()=>a(()=>import(`./TopicCanvas-LMI0zC7R.js`).then(e=>e.n).then(e=>({default:e.TopicCanvas})),__vite__mapDeps([42,1,43,44,14,2,45,46,47,48,49,50,51,52,13,53,54,4,55,56,57,58,59,60,61,62,63,16,64,5,6,22,65,66,67,68,69]))),qf=[{col:6},{col:6},{col:12}],Jf=`mavea-live-rail-collapsed-v1`,Yf=`View as living answer`,Xf=`Why this answer is true — the causal web behind it, and its receipts`,Zf=`mavea-mic-hold-preferred`,Qf=`I may have misheard that. Review the draft, then send it.`,$f=6400,ep=Wa+tt;function tp(e){return Qd(e.target)?!0:(e.key===` `||e.key===`Spacebar`)&&e.target instanceof HTMLElement&&!!e.target.closest(`button`)}var np=s(()=>a(()=>import(`./HowItWorks-DMfPX3GK.js`).then(e=>({default:e.HowItWorks})),__vite__mapDeps([70,43,1,14,13,42,44,2,45,46,47,48,49,50,51,52,53,54,4,55,56,57,58,59,60,61,62,63,16,64,5,6,22,65,66,67,68,69,71,72,73,15,74,75,76,77,78,79,80,81,19]))),rp=np.Component,ip=s(()=>a(()=>import(`./CommandPalette-Bs6tpdZl.js`).then(e=>({default:e.CommandPalette})),__vite__mapDeps([82,43,1,14,48,49,50,13,83,84]))),ap=ip.Component,op=s(()=>a(()=>import(`./Library-DmdzY2se.js`).then(e=>({default:e.Library})),__vite__mapDeps([85,43,1,44,14,13,4,86,87,88,89,90]))).Component,sp=s(()=>a(()=>import(`./LiveSettings-CuVMy7rZ.js`).then(e=>({default:e.LiveSettings})),__vite__mapDeps([91,43,1,44,14,2,45,46,47,48,49,50,51,52,13,56,73,15,92,93,23,89,21,22,10,20,94,39,95,96,38,97,37,98,99,100,101,102,103]))),cp=sp.Component,lp=s(()=>a(()=>import(`./DashboardDetail-DOfm8UCQ.js`).then(e=>({default:e.DashboardDetail})),__vite__mapDeps([104,43,1,44,14,2,13,42,45,46,47,48,49,50,51,52,53,54,4,55,56,57,58,59,60,61,62,63,16,64,5,6,22,65,66,67,68,69,17,75,76,77,78,79,80,15,81,105,96,38,39,94,23,21,10,20,106,107,108,109,110,111,112,113,114,29,32,41,115,116,117,73,118,119,120,121,122,123,124,125,126,127,128]))).Component,up=s(()=>a(()=>import(`./DashboardSettings-CE0B2y2y.js`).then(e=>({default:e.DashboardSettings})),__vite__mapDeps([129,43,1,44,14,105,96,38,39,106,107,108,109,116,122,112,113]))).Component,dp=s(()=>a(()=>import(`./UnderstoodPanel-DmJph4el.js`).then(e=>({default:e.UnderstoodPanel})),__vite__mapDeps([130,43,1,44,14,131]))).Component,fp=s(()=>a(()=>import(`./ZoomDeck-CBrr0yfy.js`).then(e=>({default:e.ZoomDeck})),__vite__mapDeps([132,43,1,44,14,13,56,133,45,46,47,2,48,49,50,51,52,134,135]))),pp=fp.Component,mp=s(()=>a(()=>import(`./AtlasView-B82UfrEX.js`).then(e=>({default:e.AtlasView})),__vite__mapDeps([136,43,1,14,86,87,4,88,89,137,96,38,39,138]))),hp=mp.Component,gp=s(()=>a(()=>import(`./RippleOverlay-zcXAHPuJ.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([139,43,1,44,14,2,49,48,50,45,46,47,51,52,56,58,92,93,26,140,141,142,143,39,144,145,146]))),_p=gp.Component,vp=s(()=>a(()=>import(`./CardEditor-DABIhGdQ.js`).then(e=>({default:e.CardEditor})),__vite__mapDeps([147,43,1,14,56,101,148]))).Component,yp=s(()=>a(()=>import(`./CourseRail-DXt3bzjU.js`).then(e=>({default:e.CourseRail})),__vite__mapDeps([149,43,1,44,14,13,94,23,39,21,22,10,20,101,150,151,152,153,154]))).Component,bp=s(()=>a(()=>import(`./MindMapViewerDrawer-DI_S7fRZ.js`).then(e=>({default:e.MindMapViewerDrawer})),__vite__mapDeps([155,44,1,43,14,13,156,58,157,47,158,159]))).Component,xp=s(()=>a(()=>import(`./Recap-T9DtFaEk.js`).then(e=>({default:e.Recap})),__vite__mapDeps([160,43,1,44,14,56,161]))),Sp=xp.Component,Cp=s(()=>a(()=>import(`./LibraryOverlay-BilW6q_z.js`).then(e=>({default:e.LibraryOverlay})),__vite__mapDeps([162,43,1,44,14,13,56,133,45,46,47,2,48,49,50,51,52,85,4,86,87,88,89,90,163]))),wp=Cp.Component,Tp=s(()=>a(()=>import(`./ReplayOverlay-CnJAxf0u.js`).then(e=>({default:e.ReplayOverlay})),__vite__mapDeps([164,43,1,14,42,44,2,45,46,47,48,49,50,51,52,13,53,54,4,55,56,57,58,59,60,61,62,63,16,64,5,6,22,65,66,67,68,69,165,71,72,73,15,74,75,76,77,78,79,80,81,166,167,168,169,170]))).Component,Ep=s(()=>a(()=>import(`./ShareModal-DWxlrJSz.js`).then(e=>({default:e.ShareModal})),__vite__mapDeps([171,43,1,44,14,2,48,49,50,13,78,79,80,15,56,62,172,45,46,47,51,52,73,173,174,158,88,92,93,175]))),Dp=Ep.Component,Op=s(()=>a(()=>import(`./ExportModal-CLobMv1F.js`).then(e=>({default:e.ExportModal})),__vite__mapDeps([176,43,1,44,14,2,45,46,47,48,49,50,51,52,80,4,56,17,173,92,93,74,177,54,13,55,16,178,61,63,179,66,65,67,68,180,181,182,183,156,58,157,158,159,184,185,28,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,57,211,212,213,214,215,216,217,218,73,15,219,220,64,221,222,223,224,225,133,226,227,228,229,230,231,232,233,234,235,18,236,9,237,238,239,240]))),kp=Op.Component,Ap=s(()=>a(()=>import(`./ExtractionPreview-QZ2VHmsb.js`).then(e=>({default:e.ExtractionPreview})),__vite__mapDeps([241,43,1,44,14,56,242,7,96,38,39,105,21,22,10,23,20,94,95,29,106,114,2,32,109,108,110,41,115,116,117,15,73,45,46,47,48,49,50,51,52,118,243,128]))),jp=Ap.Component,Mp=s(()=>a(()=>import(`./PinToDashboard-Cz5UJCmq.js`).then(e=>({default:e.PinToDashboard})),__vite__mapDeps([244,43,1,44,14,13,4,56,105,96,38,39,94,23,21,22,10,20,108,109,120,114,2,29,32,110,41,115,116,117,15,73,45,46,47,48,49,50,51,52,121]))).Component,Np=s(()=>a(()=>import(`./PrismOverlay-D1cDZamt.js`).then(e=>e.n).then(e=>({default:e.PrismOverlay})),__vite__mapDeps([245,1,43,44,14,2,49,48,50,45,46,47,51,52,56,62,17,246,167,20,247,21,22,10,23,30,34,35,248,11,31,36,249]))),Pp=Np.Component,Fp=s(()=>a(()=>import(`./WorldOverlay-BaQNNClA.js`).then(e=>({default:e.WorldOverlay})),__vite__mapDeps([250,43,1,44,14,2,15,53,50,56,58,63,179,193,185,28,17,218,72,73,45,46,47,48,49,51,52,74,168,27,29,30,31,32,33,251,252,253,254,255]))),Ip=Fp.Component,Lp=s(()=>a(()=>import(`./SynthesisOverlay-DLvwiSMv.js`).then(e=>({default:e.SynthesisOverlay})),__vite__mapDeps([256,43,1,44,14,20,21,22,10,23,30,245,2,49,48,50,45,46,47,51,52,56,62,17,246,167,247,34,35,248,11,31,36,249]))),Rp=Lp.Component,zp=s(()=>a(()=>import(`./PresentationDeck-B_EI33Pp.js`).then(e=>({default:e.PresentationDeck})),__vite__mapDeps([257,43,1,44,14,177,80,54,13,4,55,16,178,61,63,179,66,65,67,68,180,181,182,183,156,58,157,47,158,159,184,185,28,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,2,204,205,17,206,207,208,209,210,57,211,212,45,46,48,49,50,51,52,213,214,215,216,217,218,73,15,219,220,64,221,222,223,224,225,56,133,226,227,228,229,230,231,232,233,234,235,18,236,9,237,238,258]))),Bp=zp.Component,Vp=s(()=>a(()=>import(`./DelegatePanel-CHEB-OZl.js`).then(e=>({default:e.DelegatePanel})),__vite__mapDeps([259,43,1,44,14,15,56,157,47,158,73,45,46,2,48,49,50,51,52,92,93,21,22,10,23,20,258,260]))),Hp=Vp.Component,Up=s(()=>a(()=>import(`./SrsReview-DhWNYYv7.js`).then(e=>({default:e.SrsReview})),__vite__mapDeps([261,43,1,14,56,101,102,262]))),Wp=Up.Component,Gp=s(()=>a(()=>import(`./TourPrism-CI-iJZil.js`).then(e=>({default:e.TourPrism})),__vite__mapDeps([263,43,1,44,14,245,2,49,48,50,45,46,47,51,52,56,62,17,246,167,20,247,21,22,10,23,30,34,35,248,11,31,36,249]))),Kp=Gp.Component;function $({children:e,label:t=`Feature`}){return(0,W.jsx)(M,{label:t,overlay:!0,children:e})}function qp(){try{window.location.hash=``}catch{}}function Jp(e){return j(e)??Promise.resolve()}function Yp(e){let t=e.toLowerCase().trim().replace(/[.,!?]+$/,``);return t.split(/\s+/).filter(Boolean).length<=3&&/^(yeah|yep|yes|ok|okay|sure|right|uh huh|uh-huh|mhm|mm|hmm|hm|go on|go ahead|carry on|continue|keep going|please continue|please go on|go ahead|keep it up|got it|alright)$/.test(t)?!0:/\b(keep going|go on|continue|carry on|go ahead|please continue|please go on)\b/.test(t)}function Xp(){let[e]=Xt(),t=ht(e.provider),n=e.models[e.provider]||t.defaultModel;(0,U.useLayoutEffect)(()=>S(document),[]),(0,U.useEffect)(()=>{let t=document.documentElement;return e.fontScale===`normal`?delete t.dataset.fontScale:t.dataset.fontScale=e.fontScale,()=>{delete t.dataset.fontScale}},[e.fontScale]);let r=(0,U.useRef)(u()),i=(0,U.useRef)(Sr()),s=(0,U.useRef)(m()),l=(0,U.useRef)(s.current?P():null),g=(0,U.useRef)(s.current?E():!1),O=(0,U.useRef)((()=>{if(s.current)return null;let e=x();return e&&F(e)?e:null})()),k=(0,U.useRef)(O.current?R():null);(0,U.useEffect)(()=>{s.current&&C(),l.current&&f(),g.current&&T(),O.current&&p()},[]);let[A,j]=(0,U.useState)(``),{attached:M,setAttached:N,attachError:I,setAttachError:L,turnHadFiles:ee,setTurnHadFiles:te,onFiles:ne,removeAttachment:oe}=Bf(),[V,ce]=(0,U.useState)([]),[de,pe]=(0,U.useState)(!1),{askHintSeen:me,dismissAskHint:he}=Wf(),[H,ge]=(0,U.useState)(!1),[ye,xe]=(0,U.useState)(`idle`),[Se,Te]=(0,U.useState)(null),[Ee,Oe]=(0,U.useState)(null),[Ae,Ne]=(0,U.useState)(null),[Le,Re]=(0,U.useState)(!1),[ze,Be]=(0,U.useState)(!1),[Ve,He]=(0,U.useState)(!1),[We,Ke]=(0,U.useState)(!1),[Ye,ot]=(0,U.useState)(null),[ct,lt]=(0,U.useState)(!1),[ut,dt]=(0,U.useState)(null),[ft,gt]=(0,U.useState)(null),[_t,yt]=(0,U.useState)(()=>new Set),[Ct,wt]=(0,U.useState)(null),[Ot,Mt]=(0,U.useState)(null),Pt=(0,U.useRef)(void 0),[Ft,It]=(0,U.useState)(null),Lt=(0,U.useRef)(void 0),[Rt,zt]=(0,U.useState)(!1),[Bt,Vt]=(0,U.useState)(!1),[Ut,Jt]=(0,U.useState)(!1),[Yt,Qt]=(0,U.useState)(!1),[$t,en]=(0,U.useState)(!1),[tn,nn]=(0,U.useState)(()=>cr().length),rn=Yn().length;(0,U.useEffect)(()=>{let e=()=>void sn(),t={once:!0,passive:!0};return window.addEventListener(`keydown`,e,t),window.addEventListener(`pointerdown`,e,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`pointerdown`,e)}},[]),(0,U.useEffect)(()=>wr(),[]);let[an,on]=(0,U.useState)(null),[pn,mn]=(0,U.useState)(null),[hn,gn]=(0,U.useState)(null),vn=(0,U.useCallback)(e=>{e.length>=4?gn(e):e.length>0&&on(e)},[]),[bn,xn]=(0,U.useState)(null);(0,U.useEffect)(()=>{h()&&(w(),xn(lr))},[]);let[Sn,Tn]=(0,U.useState)({open:!1,spec:null}),[En,Dn]=(0,U.useState)(!1),On=(0,U.useRef)(!1);On.current=En;let[An,jn]=(0,U.useState)(()=>nf()),[Mn,Nn]=(0,U.useState)(!1),[Pn,Fn]=(0,U.useState)(new Set),[In,Ln]=(0,U.useState)(null),[Rn,zn]=(0,U.useState)(null),[Bn,Vn]=(0,U.useState)(null),[Wn,Kn]=(0,U.useState)(!1),qn=(0,U.useCallback)((e,t=!1)=>{Vn(e),Kn(e!==null&&t)},[]),Jn=(0,U.useCallback)(()=>{Vn(null),Kn(!1)},[]),Xn=(0,U.useRef)(new _u).current,Zn=(0,U.useMemo)(()=>e.quality===`fast`?null:Gt(e),[e]),[mr,gr]=(0,U.useState)(!1),Or=(0,U.useRef)(!1);Or.current=mr;let kr=(0,U.useRef)([]),[Ar,Pr]=(0,U.useState)(0),Fr=(0,U.useRef)(0),Lr=Wd(mr,Ar),[G,Rr]=(0,U.useState)(!1),zr=(0,U.useRef)(!1);zr.current=G;let Br=(0,U.useRef)([]),K=Pd((0,U.useMemo)(()=>Gt(e),[e])),Vr=(0,U.useRef)(K);Vr.current=K;let q=(0,U.useRef)(null),Ur=(0,U.useRef)(!1),Kr=(0,U.useRef)(`idle`),qr=(0,U.useCallback)(()=>{let e=Br.current.join(` `).trim();e&&Vr.current.phase===`listening`&&Vr.current.onSpeechEnd(e)},[]),Yr=_n(),[Xr,Zr]=(0,U.useState)(!1),[Qr,$r]=(0,U.useState)(()=>{try{return localStorage.getItem(Jf)===`true`}catch{return!1}});(0,U.useEffect)(()=>{try{localStorage.setItem(Jf,String(Qr))}catch{}},[Qr]);let[ei,ti]=(0,U.useState)(!1),[ni,ri]=(0,U.useState)(!1),[ii,ai]=(0,U.useState)(!1),[oi,si]=(0,U.useState)(),[ci,li]=(0,U.useState)(!1);(0,U.useEffect)(()=>{ii||li(!1)},[ii]);let{open:ui,openPalette:di,closePalette:fi}=y(),[pi,mi]=(0,U.useState)(!1),[hi,gi]=(0,U.useState)(0),[_i,vi]=(0,U.useState)(0),[yi,bi]=(0,U.useState)(!1),[J,Si]=(0,U.useState)(()=>{try{return localStorage.getItem(ga)===`true`}catch{return!1}}),[Ci,wi]=(0,U.useState)(!1),Ti=(0,U.useRef)(null),[Ei,Di]=(0,U.useState)(()=>{try{return localStorage.getItem(Zf)===`true`}catch{return!1}}),Oi=J?`always`:Ei?`hold`:`tap`;(0,U.useEffect)(()=>{try{let e=De(localStorage.getItem(`mavea-voice-mavea`)||`heart`);e&&je(`mavea`,e.kokoro)}catch{}},[]),(0,U.useEffect)(()=>{if(typeof window>`u`)return;let e,t=t=>{let n=t.detail?.changed;Array.isArray(n)&&n.length>0&&(ri(!0),e&&clearTimeout(e),e=setTimeout(()=>ri(!1),2600))};return window.addEventListener(kn,t),()=>{window.removeEventListener(kn,t),e&&clearTimeout(e)}},[]);let ki=(0,U.useCallback)(e=>{try{localStorage.setItem(ga,String(e))}catch{}},[]);(0,U.useEffect)(()=>{let e=Ti.current;ki(e?e.enabled:J)},[J,ki]),(0,U.useEffect)(()=>{try{localStorage.setItem(Zf,String(Ei))}catch{}},[Ei]);let Ai=(0,U.useRef)(null),Mi=(0,U.useRef)(Le);Mi.current=Le;let Ni=(0,U.useRef)(null),[Fi,Ii]=(0,U.useState)(null),[Li,Ri]=(0,U.useState)(!1),zi=(0,U.useRef)([]),Bi=(0,U.useRef)(()=>{}),Vi=(0,U.useCallback)(e=>{Mi.current||Ai.current?.setMaveaSpeaking(!0);let t=!Ce(),n=ve(e,`mavea`);return t&&(Ni.current=n),n},[]);(0,U.useEffect)(()=>{we(Le),Le?Ai.current?.setMaveaSpeaking(!1):Ce()&&Ai.current?.setMaveaSpeaking(!0)},[Le]);let[Hi]=(0,U.useState)(()=>r.current||i.current?(xt(),null):s.current||O.current?null:bt()),Ui=(0,U.useRef)(St()).current,Y=No({canRun:D,getConfig:()=>Gt(Kt()),getCaps:()=>Wt(Kt()),speak:Vi,cancelSpeak:Fe,getLibraryEnabled:()=>Kt().libraryEnabled,initial:Hi?Mo(Hi):void 0}),Wi=ad(H,Se,Zn,Y.busy),Gi=(0,U.useCallback)(()=>{window.location.hash=`#/live`,window.location.reload()},[]),Ki=(0,U.useCallback)(()=>{b(),window.location.hash=`#/live`,window.location.reload()},[]),qi=(0,U.useRef)(`normal`);qi.current=Y.phase;let Ji=(0,U.useRef)(null);Ji.current=Y.activeBlank;let Yi=(0,U.useRef)([]);Yi.current=Y.spec?.blanks??[],(0,U.useEffect)(()=>{Zt()},[]),(0,U.useEffect)(()=>{s.current||O.current||Y.frames.length>0&&vt(Y.history,Y.frames)},[Y.frames,Y.history]),(0,U.useEffect)(()=>{if(!(Y.frames.length===0||Y.busy))return o(Ep.preload)},[Y.frames.length,Y.busy]),(0,U.useEffect)(()=>{if(!s.current)return;let e=g.current&&l.current===`prism`;if(!(g.current&&!e))return o(()=>Promise.all([Gp.preload(),na()]).then(()=>void 0),e?300:2500)},[]);let Zi=(0,U.useMemo)(()=>Y.frames.map((e,t)=>({index:t,label:e.question||`Answer ${t+1}`,spec:e.spec})),[Y.frames]),Qi=(0,U.useCallback)(e=>{if(e.length){if(!Qn().styleAsked&&ir().length===e.length){It({count:e.length,deck:e[0].deck}),Lt.current&&clearTimeout(Lt.current),Lt.current=setTimeout(()=>{$n(),It(null)},12e3);return}Mt({count:e.length,ids:e.map(e=>e.id)}),Pt.current&&clearTimeout(Pt.current),Pt.current=setTimeout(()=>Mt(null),6e3)}},[]),ea=(0,U.useCallback)(e=>{Lt.current&&clearTimeout(Lt.current),e?er(e):$n(),It(null)},[]);(0,U.useEffect)(()=>()=>{Pt.current&&clearTimeout(Pt.current),Lt.current&&clearTimeout(Lt.current)},[]),(0,U.useEffect)(()=>{if(!e.autoSaveFlashcards)return;let t=Y.frames[Y.frames.length-1];if(!t)return;let n=El(t.spec.blocks);if(n.length>0){let e=nr(n,{deck:t.spec.topic||t.spec.title||`General`,origin:`auto`});Qi(e)}},[Y.frames,e.autoSaveFlashcards,Qi]);let ta=(0,U.useCallback)(t=>{let n=Y.viewSpec??Y.spec,r=n?.topic||n?.title||`General`,{cards:i,exact:a}=Il(t),o={ts:Date.now(),...t.id?{blockId:t.id}:{},...Ee?{question:Ee}:{},...n?.topic?{topic:n.topic}:{}},s=Gt(e),c=!!s.apiKey;wt({block:t,initial:i,deck:r,source:o,enrich:!a&&c?()=>Bl(t,s):void 0})},[Y.viewSpec,Y.spec,Ee,e]),ra=(0,U.useRef)(null),ia=(0,U.useRef)(null),oa=(0,U.useRef)(()=>{}),sa=(0,U.useRef)([]),ca=(0,U.useRef)(()=>{}),la=(0,U.useRef)(()=>{});ca.current=()=>{let e=document.querySelector(`.bend-slider`);if(!e)return;e.scrollIntoView({block:`center`,behavior:`smooth`});let t=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set;if(!t)return;sa.current.forEach(e=>window.clearTimeout(e)),sa.current.length=0;let n=Number(e.min||0),r=Number(e.max||100),i=Number(e.step||1)||1,a=Number(e.value),o=Math.min(r,n+(r-n)*.78);for(let n=1;n<=26;n++)sa.current.push(window.setTimeout(()=>{let r=a+(o-a)*n/26,s=Math.round(r/i)*i;t.call(e,String(s)),e.dispatchEvent(new Event(`input`,{bubbles:!0}))},500+n*90))},(0,U.useEffect)(()=>{let e=sa.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]);let ua=(0,U.useRef)(()=>{}),da=(0,U.useRef)(null),fa=(0,U.useRef)(null),pa=(0,U.useRef)(null),ma=(0,U.useRef)(!1),va=(0,U.useRef)(null),ya=(0,U.useRef)(!1),ba=(0,U.useRef)(null),[xa,Sa]=(0,U.useState)(!1),[Ta,Ea]=(0,U.useState)(!1),Da=(0,U.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id,i=n.saySpoken??n.say;r&&i&&e.set(r,i)}return e},[Y.tour,Y.spec]),Oa=(0,U.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id;r&&n.mark&&e.set(r,n.mark)}return e},[Y.tour,Y.spec]),ka=(0,U.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id,i=n.marks??(n.mark?[n.mark]:[]);r&&i.length&&e.set(r,i)}return e},[Y.tour,Y.spec]),[Aa,ja]=(0,U.useState)([]),[Ma,Na]=(0,U.useState)(()=>new Set),Pa=(0,U.useCallback)(e=>{Na(t=>t.has(e)?t:new Set(t).add(e))},[]),Fa=(0,U.useMemo)(()=>Aa.filter(e=>e.noteText!==void 0||Ma.has(e)),[Aa,Ma]),Ra=(0,U.useRef)(Date.now()),za=(0,U.useRef)(null),Va=(0,U.useRef)(null),Ua=(0,U.useCallback)(e=>{Va.current=e,za.current??=requestAnimationFrame(()=>{za.current=null,Va.current!=null&&Te(Va.current)})},[]);(0,U.useEffect)(()=>()=>{za.current!=null&&cancelAnimationFrame(za.current)},[]),(0,U.useEffect)(()=>{ja([]),Na(new Set),Ra.current=Date.now()},[Y.turn]);let[Wa,Ka]=(0,U.useState)(!1);(0,U.useEffect)(()=>Ka(!1),[Y.turn]);let[qa,Ja]=(0,U.useState)(()=>new Set);(0,U.useEffect)(()=>Ja(new Set),[Y.turn]);let Ya=(0,U.useRef)(!1);(0,U.useEffect)(()=>{let e=!!Y.error;e&&!Ya.current&&ra.current?.scrollTo({top:0,behavior:`smooth`}),Ya.current=e},[Y.error]);let[Xa,Za]=(0,U.useState)(!1);(0,U.useEffect)(()=>{let e=ra.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>Za(e.clientWidth>=1280),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[Y.turn]);let Qa=(0,U.useMemo)(()=>Aa.filter(e=>e.noteText&&!qa.has(e.spot)).map(e=>({spot:e.spot,text:e.noteText})),[Aa,qa]),{bookmarks:$a,toggleBookmark:eo}=Hf(),to=(0,U.useRef)(null);(0,U.useEffect)(()=>{if(!Wa)return;function e(e){to.current&&!to.current.contains(e.target)&&Ka(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[Wa]);let no=(0,U.useRef)(Y.spec);no.current=Y.spec;let ro=(0,U.useCallback)((e,t,n,r,i,a,o,s)=>{e&&ja(c=>{if(s?c.some(t=>t.spot===e&&t.noteText!==void 0):c.some(t=>t.spot===e&&t.kind===n?.kind&&t.at===n?.at&&t.noteText===void 0))return c;let l=!t&&!n?.at?no.current?.blocks.find(t=>t.id===e)??null:null,u=n?.kind===`connect`&&typeof n.onIndex==`number`?no.current?.blocks[n.onIndex]?.id:void 0,d={spot:e,line:t??(l?ie(l):void 0),mark:n,generous:r,kind:n?.kind??(s?`note`:void 0),at:n?.at,...n?.kind===`connect`&&n.to?{to:n.to}:{},color:n?.color,inkedAt:Date.now(),...i?{delayMs:i}:{},...a?{badgeMs:a}:{},...o?{stepNumber:o}:{},...u?{toSpot:u}:{},...s?{noteText:s}:{}};return[...c,d]})},[]),io=e.teachMode||hc(Ee),ao=(0,U.useRef)(e.annotationsEnabled);ao.current=e.annotationsEnabled;let oo=(0,U.useRef)(J);oo.current=J;let so=(0,U.useRef)(null);so.current=Y.narration??null;let co=(0,U.useRef)(!1),lo=(0,U.useRef)(!1);lo.current=Y.busy;let uo=(0,U.useRef)(null),fo=(0,U.useRef)(Y.frames);fo.current=Y.frames;let po=(0,U.useRef)([]),mo=(0,U.useCallback)(()=>{let e=!ao.current;uo.current=null,qt({annotationsEnabled:e,teachMode:e}),e?(ja(po.current),po.current=[]):ja(e=>(po.current=e,[]))},[]),ho=(0,U.useRef)(null),go=(0,U.useCallback)((e,t)=>{let n=ia.current,r=n?.querySelector(`[data-spot-id="${CSS.escape(e)}"]`);if(!r)return;let i=t?n?.querySelector(`[data-spot-id="${CSS.escape(t)}"]`):null,a=ra.current;if(i&&a){let e=a.getBoundingClientRect(),t=r.getBoundingClientRect(),n=i.getBoundingClientRect(),o=(Math.min(t.top,n.top)+Math.max(t.top+t.height,n.top+n.height))/2-e.top-a.clientHeight/2;a.scrollTo({top:Math.max(0,a.scrollTop+o),behavior:`smooth`})}else r.scrollIntoView({behavior:`smooth`,block:`center`});let o=[r,i].filter(e=>!!e);o.forEach(e=>e.classList.add(`ink-jump-glow`)),ho.current!=null&&window.clearTimeout(ho.current),ho.current=window.setTimeout(()=>{o.forEach(e=>e.classList.remove(`ink-jump-glow`)),ho.current=null},800)},[]);(0,U.useEffect)(()=>()=>{ho.current!=null&&window.clearTimeout(ho.current)},[]);let _o=(0,U.useRef)(null),vo=(0,U.useCallback)((e,t)=>{Y.jumpTo(e),t&&(_o.current!=null&&cancelAnimationFrame(_o.current),_o.current=requestAnimationFrame(()=>{_o.current=null,go(t)}))},[Y,go]);(0,U.useEffect)(()=>()=>{_o.current!=null&&cancelAnimationFrame(_o.current)},[]);let yo=(0,U.useCallback)(e=>{Ja(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[bo,xo]=Wr(),[So,Co]=(0,U.useState)(0),wo=(0,U.useRef)(bo);wo.current!==bo&&(wo.current=bo,Co(e=>e+1));let To=(0,U.useCallback)(()=>{let e=uo.current;e&&(uo.current=null,ao.current=e.annotationsEnabled,qt(e))},[]),Eo=(0,U.useCallback)(()=>{if(ao.current)return;let{annotationsEnabled:e,teachMode:t}=Kt();uo.current??={annotationsEnabled:e,teachMode:t},ao.current=!0,qt({annotationsEnabled:!0,teachMode:!0})},[]),Do={isBusy:()=>Y.busy||ya.current,isSpeaking:()=>Ce(),hasCanvas:()=>!!Y.spec,showFrame:(e,t,n)=>{Oe(t),j(``),Y.showFrame(e,t,{interrupt:!1,revealNow:Mi.current,silent:n?.silent})},typeInto:j,speak:e=>(Hc(e),Vi(e)),cancelSpeech:Fe,setMuted:Re,setViewMode:xo,setInkArmed:pe,setPresenting:Dn,setShareOpen:Be,setPaletteOpen:e=>e?di():fi(),pressKeepGoing:e=>{let t=document.querySelectorAll(`.footer-keepgoing .kg-row`),n=Array.from(t).find(t=>t.textContent?.includes(e))??t[0];n&&(n.classList.add(`kg-tour-press`),window.setTimeout(()=>n.classList.remove(`kg-tour-press`),620))},pinFirstBlock:()=>{let e=no.current?.blocks.find(e=>!!e.id);e&&Ts(e)},pinFirstBlocks:e=>{let t=(no.current?.blocks??[]).filter(e=>!!e.id).slice(0,e);ce(t)},startWatchThinking:()=>{Rr(!0),zr.current=!0},bankThought:e=>{Br.current=[...Br.current,e],K.onTranscript(Br.current.join(` `))},openAtlas:()=>{if(cr().length<3){for(let e of[`money`,`space`,`travel`,`budget`]){let t=Jr(e),n=t?.frames[0]?.spec;t&&n&&dn(n,t.question)}nn(sr(fn()))}en(!0)},openPrism:e=>{na().then(t=>{jo.current.chapter?.action.kind===`prism`&&mn(t[e]??null)})},showcaseFeature:e=>{if(e===`library`&&fn().length<3)for(let e of[`money`,`space`,`travel`]){let t=Jr(e),n=t?.frames[0]?.spec;t&&n&&dn(n,t.question)}if(e===`deepzoom`){window.location.hash=`#/deepzoom?demo=1`;return}if(e===`synthesis`){window.location.hash=`#/synthesis?demo=1`;return}if(e===`living-answer`&&zi.current.length===0){a(async()=>{let{WORLD_SEED:e}=await import(`./seed-D_P5jyog.js`);return{WORLD_SEED:e}},[]).then(({WORLD_SEED:e})=>{Ii({type:`world`,id:`tour-world`,col:12,props:{title:e.title,world:e}}),Ri(!0),Bi.current(`tour-world`)});return}Oo.current[e]?.run()},setSpot:e=>Y.setSpot(e),scriptedMark:()=>oa.current(),drawPenTourStep:e=>{Eo(),e===`result`?(ra.current?.scrollTo({top:0,behavior:`smooth`}),ro(`live-1`,`After thirty years, the investment reaches seventy-six thousand one hundred twenty-three dollars.`,{kind:`circle`,at:`$76,123`,color:`key`},!1,void 0,5600,1)):ro(`live-1`,`Compounding grows the original investment by more than seven point six times.`,{kind:`underline`,at:`7.6x`,color:`warm`},!1,void 0,3e3,2)},drawPenOnFirstBlock:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e?.id&&(Eo(),ra.current?.scrollTo({top:0,behavior:`smooth`}),ro(e.id,e.note,void 0,!0,void 0,3200))},openDashboards:()=>{let e=aa();e?ot(e):Ke(!0)},dashboardShowSettings:()=>lt(!0),openModelSettings:()=>{si(`model`),ai(!0)},openExport:()=>He(!0),shareRemix:()=>{document.querySelector(`.shm-remix`)?.click()},sharePalette:e=>{Array.from(document.querySelectorAll(`.shm-chip`)).find(t=>t.textContent?.trim().toLowerCase()===e.toLowerCase())?.click()},exportSetFormat:e=>{document.querySelector(`[data-export-format="${e}"]`)?.click()},exportPickTemplate:e=>{document.querySelectorAll(`[data-export-template]`)[e]?.click()},toggleRail:()=>$r(e=>!e),bendIt:()=>ca.current(),openFlashcards:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e&&ta(e)},openTourCourse:()=>la.current(),fireMemoryGlow:()=>{ri(!0),window.setTimeout(()=>ri(!1),2600)},stopRevealWalk:()=>{ma.current=!0},closeAllOverlays:()=>{Y.setSpot(null),ce([]),j(``),xo(`everything`),pe(!1),ua.current(),ja([]),Na(new Set),Ja(new Set),Ka(!1),Dn(!1),Be(!1),fi(),xn(null),en(!1),on(null),mn(null),gn(null),wt(null),Qt(!1),He(!1),Ke(!1),ot(null),lt(!1),$r(!1),Vt(!1),Jt(!1),ai(!1),Rr(!1),gr(!1),ss(null),ls(0),ds(null)}},Oo=(0,U.useRef)({}),ko=xi({active:s.current,startChapter:l.current,solo:g.current,ops:Do}),Ao=Xi({active:!!O.current,personaId:O.current,startStep:k.current,ops:Do}),jo=(0,U.useRef)(ko);jo.current=ko,(0,U.useEffect)(()=>{if(!s.current)return;let e=e=>{let t=jo.current;if(e.key===`Escape`)t.skip();else if(tp(e))return;else e.key===`ArrowRight`?(e.preventDefault(),t.next()):e.key===`ArrowLeft`?(e.preventDefault(),t.prev()):(e.key===` `||e.key===`Spacebar`)&&(e.preventDefault(),t.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Po=(0,U.useRef)(Ao);Po.current=Ao,(0,U.useEffect)(()=>{if(!O.current)return;let e=e=>{let t=Po.current;if(e.key===`Escape`)t.skip();else if(tp(e))return;else e.key===`ArrowRight`?(e.preventDefault(),t.next()):e.key===`ArrowLeft`?(e.preventDefault(),t.prev()):(e.key===` `||e.key===`Spacebar`)&&(e.preventDefault(),t.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,U.useEffect)(()=>{(ko.done||Ao.done)&&To()},[ko.done,Ao.done,To]),(0,U.useEffect)(()=>()=>To(),[To]);let{narrate:Fo,narratingId:Io}=Ir({takeWheel:()=>{ma.current=!0},hush:Fe,moveSpot:e=>{Y.setSpot(e.id??null),ao.current&&ro(e.id,e.note??(e.id?Da.get(e.id):void 0)??void 0,e.id?Oa.get(e.id):void 0,!0)},canSpeak:()=>!Mi.current,lineFor:e=>e.noteSpoken??e.note??(e.id?Da.get(e.id):void 0)??ae(e),speakLine:Vi},Y.turn),[Ro,zo]=(0,U.useState)(!1),[Bo,Vo]=(0,U.useState)(!!Hi||!!r.current&&Lo()||!!i.current&&Lo()||s.current||!!O.current),Ho=yn();(0,U.useEffect)(()=>{nn(sr(Ho))},[Ho]),(0,U.useEffect)(()=>{let e=Y.spec;if(!e||va.current===Y.turn)return;if(va.current=Y.turn,Hi&&Y.turn===0){Y.spot&&Y.setSpot(null);return}if(s.current&&!Y.narration&&Y.tour.length===0){Y.spot&&Y.setSpot(null);return}let t=[];for(let n of Y.tour){let r=e.blocks[n.index]?.id;r&&t.push(n.say?{spot:r,say:n.say}:{spot:r})}let n=[];if(t.length?n=it(e.blocks,{opener:Y.narration,tour:t,maxStops:5}):rt({blockCount:e.blocks.length,mode:Y.mode,hasModelTour:!1,teach:io})&&(n=it(e.blocks,{opener:Y.narration,maxStops:io?e.blocks.length:3,startId:Y.spot??void 0})),!n.length){Y.spot&&Y.setSpot(null);return}let r=t.length>0,i=Mi.current&&r&&ao.current;Sa(i);let a=n.map(e=>({spot:e.set&&`spot`in e.set?e.set.spot??void 0:void 0,line:e.set&&`caption`in e.set?e.set.caption:void 0}));if(Mi.current){if(ao.current){let e=Ha({stops:a,spokenWalk:r,withNotes:i,teach:io,marksById:ka});for(let t of e)ro(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}Y.setSpot(null);return}ma.current=!1,ya.current=!0;let o=!1,c,l,u=0,d=null,f=()=>{d&&=(d(),null)},p=()=>{ya.current=!1,ba.current=null,l&&clearTimeout(l),Ea(!1),Hc(null)},m=()=>o?!0:ma.current?(p(),Y.setSpot(null),!0):!1,h=(e,t)=>{if(e!==void 0&&Y.setSpot(e??null),r&&t&&Hc(t),e&&ao.current){let n=ka.get(e);if(n?.length){let r=at+(n.length-1)*900,i=n.length>1;for(let a=0;a<n.length;a++){let o=a*900,s=a===n.length-1?r:void 0;ro(e,t,n[a],io,o,s,i?a+1:void 0)}}else io&&ro(e,t,void 0,io)}},g=e=>{let t=e&&!Mi.current&&!se()?_e(e):null;if(!t){b();return}d=t.release,Ga(t,{speakLine:Vi,isCancelled:()=>o,isDismissed:()=>ma.current},e=>{if(d=null,e===`dismissed`){p(),Y.setSpot(null);return}e!==`cancelled`&&b()})},_=e=>{let t=e.set&&`spot`in e.set?e.set.spot:void 0,n=e.set&&`caption`in e.set?e.set.caption:void 0;return(t?Da.get(t):void 0)??n},v=e=>{for(let t=e+1;t<n.length;t++){let e=_(n[t]);if(e){be(e,`mavea`);return}}},y=async(e,t,n,r,i)=>{let a=e.ms??1700;if(t===0||!i){if(h(n,r),v(t),await Je({floorMs:tt,capMs:et(a)}),m())return;g(n);return}let o=Vi(i),s=await nt(o);m()||(h(n,r),v(t),s?await Xe(o,a):await Qe(a),!m()&&g(n))},b=()=>{if(o||u>=n.length){p();return}if(ma.current){p(),Y.setSpot(null);return}let e=u,t=n[u++],i=t.set&&`caption`in t.set?t.set.caption:void 0,a=t.set&&`spot`in t.set?t.set.spot:void 0,s=_(t);r?y(t,e,a,i,s):(h(a,i),c=setTimeout(b,t.ms??0))};return ba.current=()=>{if(o=!0,c&&clearTimeout(c),f(),Fe(),ao.current){let e=Ha({stops:a,from:u,spokenWalk:r,withNotes:!1,teach:io,marksById:ka});for(let t of e)ro(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}p(),Y.setSpot(null)},(async()=>{l=setTimeout(()=>{o||Ea(!0)},600);let t=ra.current;await qe({loadFams:()=>B(re(e.blocks)),settle:t?()=>pt(t,{timeoutMs:$e,perImageMs:Ze}):void 0,firstLine:Ni.current,wantVoice:!Mi.current&&Me()!==!1}),l&&clearTimeout(l),Ea(!1),!m()&&b()})(),()=>{o=!0,ba.current=null,ya.current=!1,c&&clearTimeout(c),l&&clearTimeout(l),Ea(!1),f()}},[Y.turn]),(0,U.useEffect)(()=>{let e=Y.spot,t=Y.spec;if(!t||!e)return;let n=0,r=0,i=()=>{let a=ra.current;if(!a)return;let o=a.querySelector(`.spotlit`);if(!o){++n<12&&(r=window.setTimeout(i,90));return}let s=a.getBoundingClientRect(),c=o.getBoundingClientRect(),l=c.top-s.top-(a.clientHeight-c.height)/2,u=ka.get(e)?.find(e=>e.kind===`connect`),d=u&&typeof u.onIndex==`number`?t.blocks[u.onIndex]?.id:void 0,f=d?a.querySelector(`[data-spot-id="${CSS.escape(d)}"]`):null;if(f){let e=f.getBoundingClientRect(),t=(Math.min(c.top,e.top)+Math.max(c.top+c.height,e.top+e.height))/2-s.top-a.clientHeight/2,n=a.clientHeight*.35;l=Math.max(l-n,Math.min(l+n,t))}a.scrollTo({top:Math.max(0,a.scrollTop+l),behavior:`smooth`})};return r=window.setTimeout(i,90),()=>window.clearTimeout(r)},[Y.spot,Y.spec,ka]);let Uo=(0,U.useCallback)(()=>{Y.spot&&(ma.current=!0,Y.setSpot(null))},[Y]),Wo=(0,U.useCallback)(()=>{let e=ba.current;e?e():(Fe(),Uo())},[Uo]),[Go,Ko]=(0,U.useState)(!1),[qo,Jo]=(0,U.useState)(!1),Yo=(0,U.useCallback)(async(...e)=>{(0,Dr.flushSync)(()=>Ko(!0)),Jo(!0);try{await B(re(e[0].blocks))}catch{}finally{Jo(!1)}Y.restore(...e)},[Y]);(0,U.useEffect)(()=>{Y.busy&&Ko(!0)},[Y.busy]),(0,U.useEffect)(()=>{Ko(!1)},[Y.turn]),(0,U.useEffect)(()=>{if(!Y.spot)return;let e=e=>{e.key===`Escape`&&Wo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Y.spot,Wo]);let[Xo,Zo]=(0,U.useState)(null);(0,U.useEffect)(()=>Zo(null),[Y.turn]),(0,U.useEffect)(()=>mi(!1),[Y.turn]),(0,U.useEffect)(()=>ce([]),[Y.turn]),(0,U.useEffect)(()=>Zr(!1),[Y.turn]);let[Qo,$o]=(0,U.useState)(null),es=(0,U.useRef)(!1),ts=(0,U.useCallback)(e=>{es.current=!0,$o(e)},[]);(0,U.useEffect)(()=>{if(es.current){es.current=!1;return}$o(null)},[Y.turn]);let ns=(()=>{let e=Y.spec?.blocks.find(e=>e.type===`insight`);return e&&e.type===`insight`?e.props.conf:void 0})(),rs=Zc({resetKey:Y.turn,onCommit:e=>{let{intents:t,blocks:n}=nl(e,(Y.viewSpec??Y.spec)?.blocks??[]);if(!t.length)return;let r=tl([...V,...n]);ce([]),Y.run(el(t),void 0,r.length?r:void 0,void 0,t)}});oa.current=()=>{let e=ia.current,t=e?.querySelector(`[data-spot-id]`);!e||!t||(t.scrollIntoView({block:`center`,behavior:`smooth`}),window.setTimeout(()=>is(e,t),560))};let is=(e,t)=>{let n=e.querySelector(`.ink-user-overlay`);if(!n)return;let r=(Array.from(t.querySelectorAll(`*`)).filter(e=>e.children.length===0&&e.offsetHeight>0&&/\d/.test(e.textContent??``)).sort((e,t)=>parseFloat(getComputedStyle(t).fontSize)-parseFloat(getComputedStyle(e).fontSize))[0]??t).getBoundingClientRect(),i=n.getBoundingClientRect(),a=Ff(r,i);rs.onStroke(a,{stage:e,svgRect:i});let o=t.getAttribute(`data-spot-id`);o&&Y.setSpot(o)};ua.current=()=>rs.clear();let as=(0,U.useCallback)((t,n=!1)=>{let r=t.trim();if(zr.current&&r){j(``),q.current!==null&&(window.clearTimeout(q.current),q.current=null),Br.current=[...Br.current,r],K.onTranscript(Br.current.join(` `));return}if(r&&(/^diff --git /m.test(r)||/^@@ .* @@/m.test(r))){let t=ur(dr(r));if(t.changes.length>0){j(``),xn(t);let n=Gt(e);n&&fr(t,r,n).then(e=>xn(t=>t&&e));return}}if(!r&&M.length===0&&rs.intents.length===0)return;Te(null),Oe(r||null),j(``);let i=M;te(i.length>0),N([]),L(null);let a=Y.viewSpec??Y.spec,{intents:o,blocks:s}=nl(rs.intents,a?.blocks??[]),c=tl([...V,...s]);ce([]),rs.clear(),Y.run(r||el(o),i.length?i:void 0,c.length?c:void 0,void 0,o.length?o:void 0,void 0,void 0,n?{force:!0}:void 0)},[Y,M,V,rs,K,e,Te,N,L,te]);(0,U.useEffect)(()=>{if(r.current&&Lo()){let e=r.current;r.current=``,as(e)}},[]);let[os,ss]=(0,U.useState)(null),[cs,ls]=(0,U.useState)(0),[us,ds]=(0,U.useState)(null),fs=(0,U.useRef)(null),ps=(0,U.useCallback)((e,t)=>{let n=e.lessons[t];if(!n)return;let r=_r(e.id);ss(e),ls(t),ds(r),hr(e.id,t),Vo(!0);let i=`Lesson ${t+1}: ${n.title}`,a=pr(e.id,n.id);if(a){Oe(i),Y.showFrame(a,i);return}let o=Cr(e,t,r,Tr(e.topic));fs.current={courseId:e.id,lessonId:n.id,framesBefore:Y.frames.length},Oe(i),Y.run(`Teach this lesson: "${n.title}" — ${n.goal}`,void 0,void 0,void 0,void 0,i,void 0,{lesson:o})},[Y]);la.current=()=>{let e=Wl();if(!e)return;let t=e.lessons[0];ss(e),ls(0),ds(_r(e.id)),hr(e.id,0),Vo(!0);let n=pr(e.id,t.id);if(n){let e=`Lesson 1: ${t.title}`;Oe(e),Y.showFrame({...n,narration:``,tour:[]},e,{interrupt:!1})}},(0,U.useEffect)(()=>{let e=i.current;if(!e||(i.current=void 0,!Lo()))return;let t=vr(e.courseId);if(!t)return;let n=Math.min(Math.max(e.lessonIdx,0),t.lessons.length-1);ps(t,n)},[]),(0,U.useEffect)(()=>{let e=fs.current;!e||Y.busy||(fs.current=null,!(Y.frames.length<=e.framesBefore)&&br(e.courseId,e.lessonId,Y.frames[Y.frames.length-1]))},[Y.frames,Y.busy]);let ms=(0,U.useCallback)(e=>{if(!os)return;let t=os.lessons[cs];t&&(yr(os.id,t.id,e),ds(_r(os.id)))},[os,cs]);(0,U.useEffect)(()=>{if(typeof window>`u`||!os)return;let e=()=>ds(_r(os.id));return window.addEventListener(xr,e),()=>window.removeEventListener(xr,e)},[os]);let[hs,gs]=(0,U.useState)(null);(0,U.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{let t=e.detail;t?.missedCards.length&&gs(t)};return window.addEventListener(Er,e),()=>window.removeEventListener(Er,e)},[]);let _s=(0,U.useCallback)(e=>{let t=e.missedCards.flatMap(t=>nr([t],{deck:e.courseTitle,tags:[e.lessonTitle,`checkpoint`],source:{question:t.front,topic:e.topic,ts:e.at},origin:`auto`}));gs(null),Qi(t)},[Qi]),vs=(0,U.useMemo)(()=>new Set(V.map(e=>e.id)),[V]),Cs=(0,U.useCallback)((e,t)=>{Oe(`Correction: ${t}`),Y.run(`Correction — you understood "${e}", but it's actually "${t}". Keep the rest of your understanding and update the answer wherever this changes it.`,void 0,void 0,void 0,void 0,`Correction: ${t}`)},[Y]),ws=(0,U.useCallback)(e=>{let t=e.map(ie),n=e.length===2?`Fuse these two: what is the real relationship between "${t[0]}" and "${t[1]}"? Lead with the single most useful connection, and be explicit about correlation versus cause.`:`Fuse these ${e.length}: what are the most important connections and patterns across ${t.map(e=>`"${e}"`).join(`, `)}? Lead with the strongest insight, then note any correlations, trade-offs, or cause-and-effect you can support from the data.`;Oe(`Fuse: ${t.join(` × `)}`),ce([]),Y.run(n,void 0,e,void 0,void 0,`Fuse: ${t.join(` × `)}`)},[Y]),Ts=(0,U.useCallback)(e=>{e.id&&(ce(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e]),gi(e=>e+1),he())},[he]),Ds=V.length>1?[`How do these relate?`,`Compare them`,`Summarize these`]:[`Explain this`,`Why it matters`,`Go deeper`],ks=Ht(e.provider).capabilities.vision;(0,U.useEffect)(()=>{let e=e=>{if(Qd(e.target))return;let t=e.clipboardData;if(!t)return;let n=[...t.files].filter(e=>e.type.startsWith(`image/`));if(n.length){e.preventDefault(),ne(n),j(Zd),gi(e=>e+1);return}let r=t.getData(`text/plain`);r&&Yd(r)&&(e.preventDefault(),j(Xd(Jd(r))),gi(e=>e+1))},t=null,n=e=>{e.dataTransfer?.types.some(e=>e===`Files`||e===`text/uri-list`)&&(e.preventDefault(),bi(!0),t&&clearTimeout(t),t=setTimeout(()=>bi(!1),200))},r=e=>{bi(!1);let t=e.dataTransfer;if(!t)return;if(Qd(e.target)){t.files.length&&e.preventDefault();return}let n=[...t.files],r=n.filter(e=>e.type.startsWith(`image/`)),i=n.filter(e=>!e.type.startsWith(`image/`)),a=n.length?null:Jd(t.getData(`text/uri-list`)||t.getData(`text/plain`)||``);!n.length&&!a||(e.preventDefault(),r.length?(ne(r),j(Zd)):i.length?ne(i):a&&j(Xd(a)),gi(e=>e+1))};return window.addEventListener(`paste`,e),window.addEventListener(`dragover`,n),window.addEventListener(`drop`,r),()=>{window.removeEventListener(`paste`,e),window.removeEventListener(`dragover`,n),window.removeEventListener(`drop`,r),t&&clearTimeout(t)}},[ne]);let As=(0,U.useRef)(bo);As.current=bo,(0,U.useEffect)(()=>{if(!En)return;let e=As.current;xo(`focus`),document.documentElement.requestFullscreen?.().catch(()=>{});let t=e=>{e.key===`Escape`&&Dn(!1)};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t),xo(e),document.fullscreenElement&&document.exitFullscreen().catch(()=>{})}},[En,xo]);let js=(0,U.useRef)(0);(0,U.useEffect)(()=>{let e=Y.frames.length;if(e>js.current&&On.current){let t=e-1;Fn(e=>new Set(e).add(t))}js.current=e},[Y.frames.length]);let X=ha({mode:`vad`,onBargeIn:()=>{Wo(),co.current=!0},onResult:e=>{let t=e.transcript.trim(),n=co.current;if(e.lowConfidence&&t){co.current=!1,Te(null),j(t),Ne(Qf),gi(e=>e+1),Ur.current&&zr.current&&(Ur.current=!1,Ai.current?.stop(),Br.current.length>0?qr():(zr.current=!1,Rr(!1)));return}if(co.current){co.current=!1;let e=so.current;if(!t||Yp(t)){e&&Vi(e);return}}if(t){if(Te(t),zr.current){Br.current=[...Br.current,t],Te(null);let e=Br.current.join(` `);K.onTranscript(e),Ur.current&&(Ur.current=!1,qr());return}if(Or.current){if(Te(null),Ud(t)){gr(!1);let e=kr.current;if(kr.current=[],Pr(0),e.length){let t=Math.round((Date.now()-Fr.current)/6e4);Oe(`Your thinking, sorted`),Y.run(Kd(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}}else Gd(t)&&(kr.current=[...kr.current,t],Pr(e=>e+1));return}if(jr({phase:qi.current,activeKey:Ji.current,blanks:Yi.current,fill:Y.fill},t)){Te(null);return}as(t,n||lo.current)}},onStateChange:e=>{if(Kr.current=e.phase,xe(e.phase),ge(e.phase===`listening`),e.phase===`idle`&&(co.current=!1),e.phase===`listening`)Ne(null),e.transcript&&Ua(e.transcript),q.current!==null&&(window.clearTimeout(q.current),q.current=null);else if(e.phase===`idle`&&zr.current&&Vr.current.phase===`listening`){if(Ur.current){Ur.current=!1,qr();return}q.current!==null&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>{q.current=null,Ai.current?.stop(),qr()},$f)}e.error===`not-allowed`?Ne(Lf):e.error===`unsupported`?Ne(If):e.error===`audio`?Ne(Rf):e.error===`transcription`&&Ne(zf)}}),Z=X.capabilities.stt;Ai.current=X;let Ms=(0,U.useCallback)(()=>{if(zr.current){if(q.current!==null&&(window.clearTimeout(q.current),q.current=null),H||Kr.current===`transcribing`){Ur.current=!0,H&&X.start({inCanvas:!!Y.spec,continuous:!1}),X.forceStop();return}if(X.stop(),Br.current.length===0){zr.current=!1,Rr(!1);return}qr()}},[H,qr,X,Y.spec]),Ns=(0,U.useCallback)(()=>{H&&X.stop(),q.current!==null&&(window.clearTimeout(q.current),q.current=null),Te(null),Ur.current=!1,Rr(!1)},[H,X]),Ps=En||Pf({paletteOpen:ui,shareOpen:ze,exportOpen:Ve,dashOpen:We,showSettings:ii,proofOpen:pi,showHow:Ro,replayAt:Xo,recapOpen:Ut,atlasOpen:$t,delegateOpen:Yt,srsOpen:Bt,zoomLevel:In,mindViewOpen:Sn.open});(0,U.useEffect)(()=>{if(!G||K.phase===`idle`||Ps)return;let e=e=>{e.key===`Escape`&&Ns()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[G,K.phase,Ps,Ns]),(0,U.useEffect)(()=>{let e=document.documentElement;return Yr?e.dataset.whisper=``:delete e.dataset.whisper,Ie(Yr?Cn:1),()=>{delete e.dataset.whisper,Ie(1)}},[Yr]),(0,U.useEffect)(()=>{mr?Fr.current=Date.now():(kr.current=[],Pr(0))},[mr]),(0,U.useEffect)(()=>{if(G&&H&&Se){let e=Vu(Se),t=Br.current.length>0?[...Br.current,e].join(` `).trim():e;t&&K.onTranscript(t)}},[Se,H,G]),(0,U.useEffect)(()=>{G||(Br.current=[],K.reset(),q.current!==null&&(window.clearTimeout(q.current),q.current=null))},[G]),(0,U.useEffect)(()=>()=>{q.current!==null&&window.clearTimeout(q.current)},[]),(0,U.useEffect)(()=>{let e=()=>X.setMaveaSpeaking(Ce()&&!Mi.current);return e(),ke(e)},[X]);let Fs=A.trim().length>0;(0,U.useEffect)(()=>{if(!Mr({alwaysOn:J&&!Ci,sttOk:Z,composerHasText:Fs}))return;let e=!1,t=setTimeout(()=>{e||X.start({inCanvas:!!Y.spec,continuous:!0})},100);return()=>{e=!0,clearTimeout(t),X.stop()}},[J,Ci,Z,X,Fs]),Nr({alwaysOn:J&&!Ci,sttOk:Z,composerHasText:Fs,listening:H},{start:()=>X.start({inCanvas:!!Y.spec,continuous:!0}),stop:X.stop});let Is=(0,U.useCallback)(()=>{if(!Z){Ne(If),gi(e=>e+1);return}J?H?X.forceStop():Ci?(wi(!1),Wo(),X.start({inCanvas:!!Y.spec,continuous:!0})):Kr.current===`transcribing`?(wi(!0),X.forceStop()):(wi(!0),X.stop()):H?X.forceStop():(Wo(),X.start({inCanvas:!!Y.spec}))},[Z,J,Ci,H,X,Y.spec,Wo]),[Rs,zs]=(0,U.useState)(!1),Vs=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=()=>{Vs.current!==null&&(window.clearTimeout(Vs.current),Vs.current=null)};if(Y.status===`thinking`){zs(!0),e();return}if(Y.status===`idle`){zs(!1),e();return}if(Rs&&Y.spec){zs(!1),e();return}Rs&&Vs.current===null&&(Vs.current=window.setTimeout(()=>{zs(!1),Vs.current=null},1100))},[Y.status,Y.spec,Rs]),(0,U.useEffect)(()=>()=>{Vs.current!==null&&window.clearTimeout(Vs.current)},[]);let Us=Ia({speak:Vi,cancelSpeak:Fe,isSpeaking:Ce,muted:Le,turnCount:Y.frames.length,gates:{atRest:Y.status===`showing`||Y.status===`idle`,busy:Y.busy,listening:H,introHold:Rs,hasCanvas:!!Y.spec,modalOpen:ui||ze||Ve||We||ii||pi||Ro||Xo!==null||Ut||Yt||Bt||$t||an!==null||hn!==null||Sn.open||In!==null}}),Gs=Us.interjecting,Ks=(0,U.useRef)(null),qs=(0,U.useMemo)(()=>{let e=Ca(Y.spec);return e===`warm`&&wa(Y.spec)&&(Ks.current===null||Ks.current===Y.spec)&&(Ks.current=Y.spec,e=`celebrate`),_a(Y.status,H,Gs,e,Le)},[Y.status,H,Gs,Y.spec,Le]),Ys=(0,U.useMemo)(()=>Es({status:Y.status,listening:H,interjecting:Gs,spec:Y.viewSpec??Y.spec}),[Y.status,H,Gs,Y.viewSpec,Y.spec]);(0,U.useEffect)(()=>(xs(document,Ys),()=>Ss(document)),[Ys]);let Xs=(0,U.useCallback)(()=>{let e=da.current,t=fa.current,n=pa.current;if(!e||!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();!r.width||!i.width||(e.style.setProperty(`--home-x`,`${Math.round(r.left+r.width/2-(i.left+i.width/2))}px`),e.style.setProperty(`--home-y`,`${Math.round(r.top+r.height/2-(i.top+i.height/2))}px`),e.style.setProperty(`--home-scale`,(Math.max(r.width,12)*1.3/150).toFixed(3)))},[]);(0,U.useLayoutEffect)(()=>(Xs(),window.addEventListener(`resize`,Xs),()=>window.removeEventListener(`resize`,Xs)),[Xs]),(0,U.useLayoutEffect)(()=>{Xs()},[Qr,Xs]);let Zs=!!Y.spec&&!(Rs||Gs),Qs=Bo,ec=Bo&&(!Y.spec||Rs||Gs),tc=!Y.spec&&!Bo;(0,U.useEffect)(()=>{if(!e.morningBrief||Rt||tc||Y.busy||Y.restored||!hl(St()))return;gl(),zt(!0);let t=Y.frames.slice(-3).map(e=>e.question).filter(Boolean);Y.run(_l(t),void 0,void 0,void 0,void 0,`Morning brief`)},[e.morningBrief,tc,Rt,Y.busy,Y.restored]),(0,U.useEffect)(()=>{Zs&&da.current&&(da.current.style.setProperty(`--scroll-dock`,`0`),Xs())},[Zs,Xs]);let nc=Gs?Us.line:Y.narration,rc=!Zs&&!!nc&&(Gs||Y.status===`speaking`||Y.status===`showing`),cc=ec&&Y.status===`speaking`,lc=(0,U.useRef)(new Map),[uc,dc]=(0,U.useState)(0);(0,U.useEffect)(()=>{let e=lc.current,t=new Set(Y.frames.map(e=>e.at)),n=!1;for(let r of[...e.keys()])t.has(r)||(e.delete(r),n=!0);let r=Y.frames.filter(t=>!e.has(t.at)),i=!1;return(async()=>{for(let t of r){let r=await cn(`${t.question} ${t.narration} ${t.spec?.title??``}`.trim());if(i)return;r&&(e.set(t.at,r),n=!0)}n&&dc(e=>e+1)})(),()=>{i=!0}},[Y.frames]);let mc=(0,U.useMemo)(()=>Tt(Y.frames,Y.frames.map(e=>lc.current.get(e.at)??null)),[Y.frames,uc]),gc=Y.frames.length-1,_c=Y.viewIndex??gc,vc=Y.viewOverride!=null,yc=!vc&&(Y.viewIndex==null||Y.viewIndex===gc),bc=Y.viewOverride?mc.find(e=>Y.viewOverride?.id===`thread-`+e.id):void 0,xc=mc.find(e=>e.moments.some(e=>e.frameIndex===_c)),Sc=mc.length>=2?xc?.color:void 0,Cc=Y.frames[gc],wc=mc[mc.length-1],Tc=mc.length>=2&&wc?.moments.length===1&&wc.moments[0].frameIndex===gc,Ec=yc&&!Y.busy&&Tc&&Cc?.mode===`replace`&&!!Cc&&lc.current.has(Cc.at),[Dc,Oc]=(0,U.useState)(null),kc=(0,U.useRef)(-1);(0,U.useEffect)(()=>{Ec&&kc.current!==gc&&(kc.current=gc,Oc(gc))},[Ec,gc]);let jc=(0,U.useCallback)(e=>{let t=Ba(e.moments.map(e=>Y.frames[e.frameIndex]).filter(e=>!!e),{title:e.title,tint:e.color,id:`thread-`+e.id});t&&(Y.previewSpec(t),ra.current?.scrollTo({top:0}))},[Y]),Mc=yc&&V.length===0?(Y.viewSpec??Y.spec)?.suggests??[]:[],Nc=Y.viewSpec??Y.spec,Pc=vc?Nc?{question:null,narration:Nc.title||`This thread`}:null:ac({spec:Nc,frames:Y.frames,viewIndex:Y.viewIndex,narration:Y.narration,lastAsk:Ee}),Fc=(0,U.useMemo)(()=>Bs(Nc),[Nc]),Ic=sc(oc(Y.status)),Lc=(0,U.useMemo)(()=>Y.busy?Y.status===`showing`?[Nf(Y.pendingShape)]:Mf(Ee??``,Y.history):[],[Y.busy,Y.status,Y.pendingShape,Ee,Y.history]),Rc=gf(),zc=Tf(),Bc=(0,U.useSyncExternalStore)(ru,iu,iu),[Vc,Hc]=(0,U.useState)(null);(0,U.useEffect)(()=>Hc(null),[Y.turn]),(0,U.useEffect)(()=>Sa(!1),[Y.turn]);let Uc=Rc&&!Le,[Wc,Gc]=(0,U.useState)(!1);(0,U.useEffect)(()=>{if(Uc){Gc(!0);return}let e=window.setTimeout(()=>Gc(!1),600);return()=>window.clearTimeout(e)},[Uc]),(0,U.useEffect)(()=>{Le&&ba.current?.()},[Le]);let[Kc,qc]=(0,U.useState)(!1);(0,U.useEffect)(()=>qc(!1),[Y.turn]),(0,U.useEffect)(()=>Jt(!1),[Y.turn]);let Jc=(0,U.useMemo)(()=>sf(Y.frames,mc),[Y.frames,mc]),Yc=Hn(),Xc=Un(),Qc=(0,U.useCallback)(e=>{if(s.current){jo.current.playExtra(e);return}Y.busy||d(e)},[Y.busy]),$c=(0,U.useCallback)(e=>{if(!Z){Ne(If);return}Wo(),Ti.current===null&&(Ti.current={enabled:J,paused:Ci}),wi(!1),Si(!0),e===`think`?(gr(!1),Or.current=!1,Rr(!0),zr.current=!0):(Rr(!1),zr.current=!1,gr(!0),Or.current=!0)},[Z,J,Ci,Wo]);(0,U.useEffect)(()=>{if(G||mr)return;let e=Ti.current;e!==null&&(Ti.current=null,wi(e.paused),Si(e.enabled),e.enabled&&!e.paused&&Z&&!A.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):X.stop())},[G,mr,Z,A,X,Y.spec]);let[rl,il]=(0,U.useState)(null),[al,cl]=(0,U.useState)(!1),[ll,ul]=(0,U.useState)(0),dl=(0,U.useMemo)(()=>{let e=((Y.viewSpec??Y.spec)?.blocks??[]).filter(e=>e.type===`world`);return e.length>0?e:Fi?[Fi]:[]},[Y.viewSpec,Y.spec,Fi]),fl=(0,U.useMemo)(()=>dl.find(e=>e.id===rl)??dl[0],[dl,rl]);zi.current=dl;let pl=fl!==void 0,ml=bo===`world`&&pl,vl=(0,U.useCallback)(e=>{e&&il(e),cl(!1),xo(`world`)},[xo]);Bi.current=vl;let yl=(0,U.useCallback)(()=>xo(Hr()),[xo]);(0,U.useEffect)(()=>fe(vl),[vl]),(0,U.useEffect)(()=>{bo===`world`&&!pl&&yl()},[bo,pl,yl]);let bl=ml?fl.id??null:null,Sl=ml&&fl.props.world===void 0,{generateWorld:Cl}=Y;(0,U.useEffect)(()=>{if(!bl||!Sl)return;let e=!0;return cl(!1),Cl(bl).then(t=>{e&&!t&&cl(!0)}),()=>{e=!1}},[bl,Sl,ll,Cl]);let{expandWorld:wl}=Y,Tl=(0,U.useCallback)((e,t)=>bl?wl(bl,e,t):Promise.resolve(null),[bl,wl]),Q={atlas:{available:tn>0,reason:`Fills in as you discuss things`,run:()=>en(!0),preload:mp.preload},"pdf-world":{available:M.some(At),reason:`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map`,run:()=>{let e=M.filter(At);if(e.length>0){vn(e);return}gi(e=>e+1),vi(e=>e+1),L(`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map of claims.`)},preload:Np.preload},synthesis:{available:!0,run:()=>{let e=M.filter(At);e.length>=2?gn(e):window.location.hash=`#/synthesis`},preload:()=>M.filter(At).length>=2?Lp.preload():Jp(`#/synthesis`)},ripple:{available:!0,run:()=>xn(lr),preload:gp.preload},review:{available:!0,run:()=>Vt(!0),preload:Up.preload},flashcards:{available:!0,run:()=>{window.location.hash=`#/flashcards`},preload:()=>Jp(`#/flashcards`)},courses:{available:!0,run:()=>{window.location.hash=`#/courses`},preload:()=>Jp(`#/courses`)},dashboards:{available:!0,run:()=>{window.location.hash=`#/dashboards`},preload:()=>Jp(`#/dashboards`)},gallery:{available:!0,run:()=>{window.location.hash=`#/gallery`},preload:()=>Jp(`#/gallery`)},recap:{available:!!Jc,reason:`Once we've covered something`,run:()=>Jt(!0),preload:xp.preload},present:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Dn(!0),preload:zp.preload},track:{available:!!Y.spec,reason:`Once there is a conversation to track`,run:()=>Ke(!0),preload:Ap.preload},share:{available:Y.frames.length>0,reason:`Once there is something to share`,run:()=>Be(!0),preload:Ep.preload},export:{available:Y.frames.length>0,reason:`Once there is an answer to export`,run:()=>He(!0),preload:Op.preload},focus:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>xo(`focus`)},board:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>xo(`canvas`)},"living-answer":{available:pl,reason:`Once an answer has causes to trace`,run:()=>vl(),preload:Fp.preload},ink:{available:!!Y.spec,reason:`Once there is an answer to mark`,run:()=>pe(!0)},blanks:{available:!0,run:()=>Ne(`When a number in an answer is truly yours to give, Mavéa leaves a glowing hole for it — type, say, or drop a card in, and it finishes the answer around your value.`)},"watch-me-think":{available:Z,reason:Z?void 0:If,run:()=>$c(`think`)},"just-listen":{available:Z,reason:Z?void 0:If,run:()=>$c(`listen`)},whisper:{available:!0,run:()=>{si(`you`),li(!0),ai(!0)},preload:sp.preload},ghost:{available:Z&&e.quality!==`fast`,reason:Z?e.quality===`fast`?`Needs Balanced quality or higher — you're on Fast`:void 0:If,run:()=>$c(`listen`)},delegate:{available:!0,run:()=>Qt(!0),preload:Vp.preload},memory:{available:!0,run:()=>{si(`you`),ai(!0)},preload:sp.preload},library:{available:Ho.length>0,reason:`Fills in as you save conversations`,run:()=>ti(!0),preload:Cp.preload},deepzoom:{available:!0,run:()=>{let e=Ee??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},preload:()=>Jp(`#/deepzoom`)},"zoom-deck":{available:!!Jc,reason:`Opens once there are a few answers to pull back from`,run:()=>Ln(`chapters`),preload:fp.preload},"morning-brief":{available:!0,run:()=>{si(`you`),li(!0),ai(!0)},preload:sp.preload},settings:{available:!0,run:()=>{si(void 0),ai(!0)},preload:sp.preload},how:{available:!0,run:()=>zo(!0),preload:np.preload}};Oo.current=Q;let Dl=mt.filter(e=>e.surface!==`demo`).map(e=>{let t=Q[e.id]??{available:!0,run:()=>void 0},n=e.id===`how`?Ki:e.tourChapter?()=>Qc(e.tourChapter):void 0;return{feature:e,available:t.available,reason:t.reason,run:t.run,preload:t.preload,watch:n}}),Ol=[{label:`New`,blurb:`Start a fresh session`,onClick:()=>{Y.reset(),Us.reset(),Vo(!1),te(!1),xt()},show:!!Y.spec},{label:`Dashboard`,blurb:`Open your living dashboards`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!!Y.spec}],kl=[{label:`Rehearse`,blurb:`Practice a hard conversation — take the seat, or send your Mavéa`,onClick:Q.delegate.run,preload:Q.delegate.preload,show:!0},{label:`Study`,blurb:Yc>0?`${Yc} card${Yc===1?``:`s`} ready`:Xc===`spaced`?`Go through what you have saved`:`Flip through your cards`,onClick:Q.review.run,preload:Q.review.preload,show:!0},{label:`Manage flashcards`,blurb:`See, organize, and edit your study deck`,onClick:Q.flashcards.run,preload:Q.flashcards.preload,show:!0},{label:`Courses`,blurb:`Turn a topic into a structured syllabus — a lesson at a time, at your pace`,onClick:Q.courses.run,preload:Q.courses.preload,show:!0},{label:`Recap`,blurb:`What we covered — the session so far`,onClick:Q.recap.run,preload:Q.recap.preload,show:!!Jc}],Al=[{label:`Present`,blurb:`Fill the room — the chrome falls away, the mic stays live`,onClick:Q.present.run,preload:Q.present.preload,show:!!Y.spec},{label:`Export`,blurb:`Choose a template and export a polished PDF`,onClick:Q.export.run,preload:Q.export.preload,show:Y.frames.length>0},{label:`Video`,blurb:`Share a moment, a topic, or the whole conversation`,onClick:Q.share.run,preload:Q.share.preload,show:Y.frames.length>0}],jl=[{label:`Search all features`,blurb:`Browse Mavéa’s feature index · ${v}`,onClick:di,preload:ip.preload,show:!0},{label:`Atlas`,blurb:`Kept conversations and topics, as a place`,onClick:Q.atlas.run,preload:Q.atlas.preload,show:tn>0},{label:`Watch me think`,blurb:`A live map of your thinking`,onClick:Q[`watch-me-think`].run,show:Q[`watch-me-think`].available},{label:`Prism`,blurb:Q[`pdf-world`].available?`Split your document into a map of its claims`:`Attach a PDF, Office doc, or data file — then split it into claims`,onClick:Q[`pdf-world`].run,preload:Q[`pdf-world`].preload,show:!0},{label:`Ripple`,blurb:`Model a code change’s impact, risks, and a proposed ship order`,onClick:Q.ripple.run,preload:Q.ripple.preload,show:!0},{label:`Dashboards`,blurb:rn>0?`${rn} dashboard${rn===1?``:`s`} set to refresh while Mavéa is open`:`Create a dashboard that refreshes on schedule while Mavéa is open`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!0},{label:`Deep Zoom`,blurb:Ee?`Zoom from field to mechanism — "${Ee.slice(0,50)}${Ee.length>50?`…`:``}"`:`Telescope any topic from big picture to finest detail`,onClick:()=>{let e=Ee??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},show:!0}],Ml=(0,U.useCallback)(e=>{e===`out`&&Jc&&Ln(`chapters`)},[Jc]);ar(ra,Ml),(0,U.useEffect)(()=>(Pe(uu),()=>Pe(null)),[]);let Nl=(0,U.useRef)(!0);(0,U.useEffect)(()=>{Y.busy&&(ou(),Nl.current=!1,zn(null),Jn())},[Y.busy,Y.turn,Jn]),(0,U.useEffect)(()=>(cu(Xo!==null),()=>cu(!1)),[Xo]),(0,U.useEffect)(()=>Jn(),[Y.viewIndex,Jn]);let Pl=Y.spec?.blocks.length??0;(0,U.useEffect)(()=>{Pl>0&&lu(Pl)},[Pl]),(0,U.useEffect)(()=>{if(Y.busy)return;if(Y.spec){let e=du();if(e){zn(e);let t=Y.frames.length-1,n=Y.frames[t];n&&Xn.set(Ge(n),e)}}if(Rc||Nl.current)return;let e=window.setTimeout(()=>{Nl.current=!0,su()},ep);return()=>window.clearTimeout(e)},[Rc,Y.busy,Y.spec,Bc,Y.frames,Xn]);let Fl=(0,U.useMemo)(()=>yc?Rn:Y.viewIndex!=null&&Y.frames[Y.viewIndex]?Xn.get(Ge(Y.frames[Y.viewIndex])):null,[yc,Rn,Y.viewIndex,Y.frames,Xn]),Ll=(0,U.useMemo)(()=>{if(!Wn||Bn===null||!Fl)return null;let e=yc?Y.spec:Y.viewSpec;if(!e)return null;let t=yc?Y.tour:Y.viewIndex==null?[]:Y.frames[Y.viewIndex]?.tour??[],n=hu(Fl,Bn,t,e.blocks.length);return{...e,blocks:e.blocks.slice(0,n)}},[Wn,Bn,Fl,yc,Y.spec,Y.viewSpec,Y.tour,Y.viewIndex,Y.frames]),Rl=Y.error?(0,W.jsxs)(`div`,{className:`live-error`,role:`alert`,children:[(0,W.jsxs)(`div`,{className:`live-error-head`,children:[(0,W.jsx)(z.alert,{}),(0,W.jsx)(`span`,{children:`Couldn’t answer`})]}),(0,W.jsx)(`p`,{className:`live-error-msg`,children:Y.error.message}),(0,W.jsxs)(`div`,{className:`live-error-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`live-error-btn primary`,onClick:()=>{let e=Y.error;e&&Y.run(e.retry,e.attachments,e.selectedBlocks,void 0,e.inkIntents,e.question)},disabled:Y.busy,children:`Retry`}),(0,W.jsx)(`button`,{type:`button`,className:`live-error-btn`,onClick:()=>ai(!0),children:`Open settings`})]})]}):null,zl=G,[Vl,Hl]=(0,U.useState)(160);(0,U.useEffect)(()=>{if(!zl)return;let e=document.querySelector(`.live-dock`);if(!e)return;let t=()=>Hl(Math.round(e.getBoundingClientRect().height)+8);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[zl]);let Ul=zl?(0,W.jsxs)(`div`,{className:`ms-stage-fill`,"data-phase":K.phase,style:{"--ms-bottom-reserve":`${Vl}px`},children:[(0,W.jsxs)(`button`,{type:`button`,className:`ms-exit`,onClick:Ns,title:`Back to the conversation (Esc)`,children:[(0,W.jsx)(z.chevL,{}),`Back to conversation`]}),(0,W.jsx)(Rd,{mindShape:K,onSettled:()=>{Vi(`I think this is the shape of it.`)},onConfirmUnsaid:()=>K.confirmUnsaid(),onDismissUnsaid:()=>K.dismissUnsaid(),onAction:(e,t)=>{if(e===`add-more`)Te(null),K.resume(),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:J&&!Ci});else if(e===`not-quite`)Br.current=[],K.resume(!1),Te(null),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:J&&!Ci});else if(e===`share`)Be(!0);else if(e===`present`)Dn(!0);else if(e===`answer`||e===`plan`||e===`commit-plan`||e===`tell-apart`){let n=K.spec,r=e===`commit-plan`||e===`plan`?`plan`:`answer`,i=n?Hd(n,r):Se??``;e===`tell-apart`&&t?.tension&&(i=`I keep coming back to “${t.tension.a}” but I also said “${t.tension.b}.” Help me tell these two reasons apart — are they the same thing or not?\n\n`+i);let a=Y.restored;if(H&&!J&&X.stop(),Te(null),K.reset(),Rr(!1),i){let t=e===`tell-apart`?`Telling them apart`:n?.center||(r===`plan`?`A plan`:`An answer`);Oe(t),Y.run(i,void 0,void 0,void 0,void 0,t,n??void 0,a?{freshStart:!0}:void 0)}}},liveTranscript:Se||void 0,thoughtCount:td([Br.current.join(` `),Se??``].join(` `))})]}):null,Gl=G?K.phase===`settled`||K.phase===`pausing`?`Add thought`:`Done thinking`:`Watch me think`;return(0,W.jsxs)(`div`,{className:`mavea-app with-rail live-voice canvas-flat`+(Zs?` face-homed`:``)+(tc?` in-wizard`:``)+(En?` presenting`:``)+(Qr?` rail-collapsed`:``)+(zl?` watch-thinking`:``),"data-title":Y.spec?.title??``,...En?{"data-preso":An}:{},ref:da,children:[s.current&&(0,W.jsx)(ji,{driver:ko}),s.current&&ko.done&&(0,W.jsx)(Pi,{onStart:Gi,onReplay:Ki,onPlayExtra:ko.playExtra,hasStoredSession:Ui}),O.current&&(()=>{let e=F(O.current);return e?(0,W.jsx)($i,{driver:Ao,member:e,onExit:Gi}):null})(),En&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`preso-style-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||Nn(!1)},children:[(0,W.jsxs)(`button`,{type:`button`,className:`preso-style-btn`+(Mn?` is-open`:``),onClick:()=>Nn(e=>!e),"aria-expanded":Mn,"aria-haspopup":`listbox`,children:[(0,W.jsx)(`span`,{className:`preso-swatch-sm`,style:{background:$d.find(e=>e.id===An)?.accent??`var(--presence)`}}),`Style`]}),Mn&&(0,W.jsx)(`div`,{className:`preso-menu`,role:`listbox`,"aria-label":`Presentation style`,children:$d.map(e=>(0,W.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":An===e.id,className:`preso-row`+(An===e.id?` is-active`:``),onClick:()=>{jn(e.id),rf(e.id),Nn(!1)},children:[(0,W.jsx)(`span`,{className:`preso-swatch`,style:{background:e.accent}}),(0,W.jsx)(`span`,{className:`preso-name`,children:e.label}),(0,W.jsx)(`span`,{className:`preso-desc`,children:e.description})]},e.id))})]}),(0,W.jsx)(`button`,{type:`button`,className:`present-exit`,onClick:()=>Dn(!1),title:`End the presentation (Esc)`,children:`End show · Esc`}),(0,W.jsx)($,{children:(0,W.jsx)(Bp,{spec:Y.viewSpec??Y.spec,question:Pc?.question??null,narration:Pc?.narration??Y.narration,skinId:An,autoAdvanceMs:s.current||O.current?2600:void 0,onExit:()=>Dn(!1)})})]}),(0,W.jsx)(`div`,{className:`presence-layer`+(Zs?` corner`:ec?``:` idlehome`)+(rc?` has-caption`:``)+(ni?` is-mem-save`:``),ref:pa,children:(0,W.jsxs)(`div`,{className:`presence-positioner`,children:[Bo&&(0,W.jsx)(`div`,{className:`presence-seed`,"aria-hidden":`true`},Y.turn),(0,W.jsx)(ue,{state:qs.state,emotion:qs.emotion,gaze:qs.gaze,muted:Le})]})}),(0,W.jsx)(`div`,{className:`presence-scrim`+(cc?` show`:``)}),rc&&(0,W.jsx)(`div`,{className:`center-caption`,role:`status`,"aria-live":`polite`,children:nc}),(0,W.jsx)(mf,{activity:Y.activity,sources:Y.busy?Y.liveSources:[]}),(0,W.jsxs)(`div`,{className:`topbar`,children:[(0,W.jsxs)(`button`,{className:`brand brand-link`,type:`button`,onClick:qp,title:`Back to the demo`,"aria-label":`Back to the demo`,children:[(0,W.jsx)(`span`,{className:`brand-dot jelly-mark`,ref:fa}),(0,W.jsx)(`span`,{className:`brand-name`,children:`Mavéa`}),Y.spec&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`brand-sep`}),(0,W.jsx)(`span`,{className:`workspace-name`,children:Y.error?`Couldn’t answer`:Y.spec.title})]})]}),(0,W.jsxs)(`span`,{className:`live-badge`,title:`Live · ${t.label}`,"aria-label":`Live mode`,children:[(0,W.jsx)(`span`,{className:`live-dot`}),`Live`]}),(0,W.jsx)(`div`,{className:`topbar-spacer`}),(0,W.jsx)(ln,{label:`Create`,items:Ol}),(0,W.jsx)(ln,{label:`Practice`,items:kl,badge:Yc}),(0,W.jsx)(ln,{label:`Share`,items:Al}),(0,W.jsx)(ln,{label:`Explore`,items:jl}),(0,W.jsx)(_,{onOpen:di,preload:ip.preload}),(0,W.jsx)(`span`,{className:`topbar-divider`,"aria-hidden":`true`}),(0,W.jsx)(Gn,{})]}),(0,W.jsx)(ic,{chapters:mc,frames:Y.frames,currentIndex:_c,onJump:Y.jumpTo,onReplay:Y.frames.length>0?()=>Zo(Y.frames.length-1):void 0,onOverview:Y.frames.length>0?()=>qc(!0):void 0,resumed:Y.restored,chatOpen:Xr,onToggleChat:()=>Zr(e=>!e),collapsed:Qr,onToggleCollapse:()=>$r(e=>!e),onOpenPast:Ho.length>0?()=>ti(!0):void 0,onStudy:()=>Vt(!0),roomIndices:Pn,bookmarks:$a,onToggleBookmark:eo,onViewMindMap:e=>{let t=Y.frames[e];t?.mind&&Tn({open:!0,spec:t.mind})},onSeeTogether:jc}),(0,W.jsxs)($s,{holdEnabled:Z&&Oi===`hold`,showHint:!1,pttKey:e.pttKey,pttSide:e.pttSide,onHoldStart:()=>{Wo(),X.start({inCanvas:!!Y.spec})},onHoldEnd:()=>X.forceStop(),onChangePttKey:e=>qt({pttKey:e}),onChangePttSide:e=>qt({pttSide:e}),children:[(Yr||J&&Z)&&(0,W.jsxs)(`div`,{className:`dock-modes`,role:`group`,"aria-label":`Listening modes`,children:[Yr&&(0,W.jsx)(`span`,{className:`whisper-badge`,children:`won't wake anyone`}),J&&Z&&(0,W.jsx)(`button`,{type:`button`,className:`listen-mode-chip`+(mr?` on`:``),"aria-pressed":mr,onClick:()=>{gr(e=>!e),G&&(zr.current=!1,Rr(!1))},title:Lr,"aria-label":Lr,children:mr?`Just listening · ${Ar} banked`:`Just listen`}),mr&&Ar>0&&(0,W.jsx)(`button`,{type:`button`,className:`listen-mode-chip`,onClick:()=>{gr(!1);let e=kr.current;if(kr.current=[],Pr(0),e.length){let t=Math.round((Date.now()-Fr.current)/6e4);Oe(`Your thinking, sorted`),Y.run(Kd(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}},children:`Thoughts?`})]}),Z&&(0,W.jsx)(Ue,{kind:`voice-data`,from:`live`}),Ae&&(0,W.jsxs)(`div`,{className:`voice-notice`,role:`status`,children:[Ae===Qf?(0,W.jsx)(z.spark,{}):(0,W.jsx)(z.micOff,{}),(0,W.jsx)(`span`,{children:Ae}),(0,W.jsx)(`button`,{type:`button`,className:`voice-notice-x`,"aria-label":`Dismiss voice notice`,onClick:()=>Ne(null),children:(0,W.jsx)(z.x,{})})]}),(M.length>0||I)&&(0,W.jsxs)(`div`,{className:`attach-strip`,role:`list`,"aria-label":`Attached files`,children:[M.map((e,t)=>(0,W.jsxs)(`span`,{className:`attach-chip`,role:`listitem`,children:[kt(e)?(0,W.jsx)(`img`,{className:`attach-thumb`,src:`data:${e.mime};base64,${e.data}`,alt:``}):(0,W.jsx)(z.paperclip,{}),(0,W.jsx)(`span`,{className:`attach-name`,children:jt(e)}),(Et(e)&&ks||Dt(e)||Nt(e))&&(0,W.jsx)(`button`,{type:`button`,className:`attach-explode`,"aria-label":`Explode ${e.name} into a map of its claims`,title:`Explode into a map of grounded claims`,onClick:()=>on([e]),children:`⊹ Explode`}),(0,W.jsx)(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove ${e.name}`,onClick:()=>oe(t),children:(0,W.jsx)(z.x,{})})]},t)),(()=>{let e=M.filter(e=>Dt(e)||Nt(e)||Et(e)&&ks);if(e.length<=1)return null;let t=(0,W.jsxs)(`button`,{type:`button`,className:`attach-explode attach-compare`,"aria-label":`Compare ${e.length} documents — map their claims and find where they agree and contradict`,title:`Explode all documents together and compare them`,onClick:()=>on(e),children:[`⊹ Compare `,e.length,` documents`]},`compare`),n=(0,W.jsxs)(`button`,{type:`button`,className:`attach-explode attach-compare`,"aria-label":`Synthesize ${e.length} sources — fuse them into one map of themes, contradictions, and gaps`,title:`Fuse all sources into one navigable Synthesis World`,onClick:()=>gn(e),children:[`⊹ Synthesize `,e.length,` sources`]},`synth`);return e.length>=4?n:e.length>=3?(0,W.jsxs)(W.Fragment,{children:[t,n]}):t})(),I&&(0,W.jsx)(`span`,{className:`attach-error`,role:`status`,children:I})]}),M.length>0&&(0,W.jsx)(Ue,{kind:`upload`,from:`live`}),Y.spec&&(0,W.jsx)(ol,{armed:de,pins:rs.pins,miss:rs.miss,onUndo:rs.undo,onSend:rs.send}),V.length>0&&(0,W.jsxs)(`div`,{className:`pin-dock`,children:[(0,W.jsx)(`div`,{className:`pin-strip`,role:`list`,"aria-label":`Elements you're asking about`,children:V.map(e=>(0,W.jsxs)(`span`,{className:`pin-chip`,role:`listitem`,children:[(0,W.jsx)(z.chat,{}),(0,W.jsx)(`span`,{className:`pin-name`,children:ie(e)}),(0,W.jsx)(`button`,{type:`button`,className:`pin-remove`,"aria-label":`Unpin ${ie(e)}`,onClick:()=>Ts(e),children:(0,W.jsx)(z.x,{})})]},e.id))}),(0,W.jsxs)(`div`,{className:`pin-suggests`,role:`list`,"aria-label":`Quick follow-ups`,children:[V.length>=2&&(0,W.jsxs)(`button`,{type:`button`,className:`live-chip pin-fuse-chip`,disabled:Y.busy,title:`Combine these ${V.length} cards into a single new answer — useful when you want Mavéa to find the pattern, trade-off, or story that runs across all of them at once`,onClick:()=>ws(V),children:[`Fuse `,V.length,` into one`]}),Ds.map(e=>(0,W.jsx)(`button`,{type:`button`,className:`live-chip`,onClick:()=>as(e),disabled:Y.busy,children:e},e))]})]}),(0,W.jsxs)(`div`,{className:Qs?`voice-capsule`:`composer-passthrough`,children:[Qs&&(0,W.jsxs)(`div`,{className:`voice-strip`,children:[Wc&&!zc?(0,W.jsxs)(`button`,{type:`button`,className:`vc-status`,onClick:Wo,title:`Tap to stop and show the whole answer at once`,"aria-label":`Stop speaking and show the whole answer`,children:[(0,W.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]}),(0,W.jsx)(`span`,{className:`vc-status-label`,children:`Speaking`})]}):Ta&&!Le?(0,W.jsxs)(`div`,{className:`vc-status vc-preparing`,role:`status`,"aria-busy":`true`,children:[(0,W.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]}),(0,W.jsx)(`span`,{className:`vc-status-label`,children:`Preparing voice…`})]}):zc&&!Le?(0,W.jsx)(`div`,{className:`vc-status vc-preparing vc-quiet`,role:`status`,"aria-busy":`true`,"aria-label":`Preparing voice`,children:(0,W.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]})}):null,(0,W.jsx)(`div`,{className:`vc-transcript`,"aria-hidden":`true`,children:Vc??Y.narration??``}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>Re(e=>!e),title:Le?`Unmute Mavéa's voice — your microphone is unaffected`:`Mute Mavéa's voice — muted answers land written out at once, with notes and pen marks standing in for the walk. Your microphone is unaffected.`,"aria-pressed":!Le,className:`voice-switch`+(Le?` is-muted`:``),children:[Le?(0,W.jsx)(z.speakerOff,{}):(0,W.jsx)(z.speaker,{}),(0,W.jsx)(`span`,{className:`voice-switch-label`,children:`Mavéa's voice`}),(0,W.jsx)(`span`,{className:`voice-switch-track`,"aria-hidden":`true`,children:(0,W.jsx)(`span`,{className:`voice-switch-thumb`})})]}),(0,W.jsx)(Au,{}),(0,W.jsx)(Nu,{}),(0,W.jsxs)(`button`,{className:`live-model-chip`,onClick:()=>ai(e=>!e),title:O.current?`The model that generated this curated prerecorded example`:Ic?`Model settings · last reply ${Ic}`:`Model settings`,children:[(0,W.jsx)(`span`,{className:`chip-dot`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`chip-model`,children:O.current?Ao.model??`—`:n}),(0,W.jsx)(`span`,{className:`chip-caret`,"aria-hidden":`true`})]})]}),(0,W.jsx)(Gr,{value:A,onChange:e=>{j(e)},onSend:as,listening:H,heard:Se,onMic:Is,micMode:Oi,micArmed:J&&!Ci,micPaused:J&&Ci,micProcessing:ye===`transcribing`,placeholder:G?`Talk, or type a thought — it lands on the map…`:V.length?V.length>1?`Ask about the selected elements…`:`Ask about the selected element…`:`Talk, or type — anything.`,focusSignal:hi,disabled:Y.busy,onFiles:ne,attachPulse:_i,attachTitle:ks?`Attach an image or PDF`:`Attach a doc or data file to explode — ${n} can't read images/PDFs directly`,onMicDown:()=>{Z&&(Wo(),X.start({inCanvas:!!Y.spec}))},onForceStop:()=>X.forceStop(),onMicCancel:()=>X.stop(),tools:(0,W.jsxs)(W.Fragment,{children:[Y.spec&&(0,W.jsx)(sl,{armed:de,onToggle:pe}),(0,W.jsxs)(`button`,{type:`button`,className:`composer-watch`+(G?` on`:``),"aria-pressed":G,"aria-label":Gl,onClick:()=>{G?K.phase===`settled`||K.phase===`pausing`?(Te(null),K.resume(),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:!0})):Ms():$c(`think`)},title:G?K.phase===`settled`||K.phase===`pausing`?`Add another thought`:`Finish now without waiting for silence`:`Build a live map while you think aloud`,children:[(0,W.jsx)(z.spark,{}),(0,W.jsx)(`span`,{children:Gl})]})]}),micExtra:Z?(0,W.jsx)(bs,{mode:Oi,pttKey:e.pttKey,pttSide:e.pttSide,onChange:e=>{Ti.current=null,wi(!1),Si(e===`always`),ki(e===`always`),Di(e===`hold`),e===`always`&&J&&!H&&!A.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):e!==`always`&&H&&X.stop()}}):void 0})]})]}),H&&!G&&(0,W.jsx)(cf,{transcript:Se,mode:Oi,note:mr?`Just listening · ${Math.max(1,Math.round((Date.now()-Fr.current)/6e4))}m — say "thoughts?" when you want me`:void 0}),H&&!G&&(0,W.jsx)(od,{ghosts:Wi}),Y.spec?(0,W.jsxs)(`div`,{className:`canvas-stage stage`,"data-active":`1`,ref:ia,children:[Dc!=null&&(0,W.jsx)(Ws,{tint:wc?.color,onDone:()=>Oc(null)},Dc),(0,W.jsx)(`div`,{className:`canvas-scroll`,ref:ra,onClick:Y.spot?e=>{e.target.closest(`.spotlit`)||Uo()}:void 0,children:(0,W.jsxs)(`div`,{className:`topic-wrap`,children:[(0,W.jsx)(Ac,{armed:de,rootRef:ia,onStroke:rs.onStroke,onTap:rs.onTap,strokes:rs.strokes,highlights:rs.highlights}),Rl,!yc&&(0,W.jsxs)(`div`,{className:`viewing-past`,role:`status`,children:[vc?(0,W.jsx)(z.table,{}):(0,W.jsx)(z.clock,{}),(0,W.jsx)(`span`,{children:vc?`Viewing this thread together`:`Viewing an earlier moment`}),(0,W.jsx)(`button`,{type:`button`,className:`viewing-past-back`,onClick:()=>vc?Y.previewSpec(null):Y.jumpTo(gc),children:`Return to live`})]}),!me&&V.length===0&&(0,W.jsxs)(`div`,{className:`ask-hint`,role:`note`,children:[(0,W.jsx)(z.chat,{}),(0,W.jsxs)(`span`,{children:[`Tap `,(0,W.jsx)(`strong`,{children:`Ask`}),` on any element to ask Mavéa about it.`]}),(0,W.jsx)(`button`,{type:`button`,className:`ask-hint-x`,"aria-label":`Dismiss tip`,onClick:he,children:(0,W.jsx)(z.x,{})})]}),os&&(0,W.jsx)($,{children:(0,W.jsx)(yp,{course:os,lessonIdx:cs,progress:us??_r(os.id),onPrev:()=>ps(os,cs-1),onNext:()=>ps(os,cs+1),onCheckpoint:ms,busy:Y.busy},`${os.id}:${cs}`)}),Pc&&!os&&(0,W.jsx)(Hs,{question:Pc.question,narration:Pc.narration,sources:Nc?.sources,inferred:Fc,tint:Sc}),qo&&(0,W.jsx)(c,{label:`Opening saved answer…`,overlay:!0}),(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(`div`,{className:`canvas-loading`,role:`status`,"aria-busy":`true`,"aria-label":`Loading canvas`,children:(0,W.jsx)(`div`,{className:`skel-grid`,children:(0,W.jsx)(le,{blocks:qf})})}),children:(0,W.jsx)(Kf,{data:Ll??Y.viewSpec??Y.spec,spot:yc?Y.spot:null,built:{},onProve:()=>mi(!0),onAskBlock:Ts,onAddToDashboard:e=>dt({block:e,question:Pc?.question??void 0}),selectedBlockIds:vs,onNarrate:Fo,narratingId:Io,muted:Le,viewMode:bo,onViewMode:xo,presenting:En,noteGutter:yc&&e.annotationsEnabled&&Xa&&xa,walkNotes:yc?Qa:void 0,blankFill:yc?{values:Y.filled,activeKey:Y.activeBlank,fill:Y.fill,unfill:Y.unfill,activate:Y.setActiveBlank,complete:Y.complete,busy:Y.busy}:void 0,bend:yc&&Bn===null?Y.spec?.bend:void 0,onAddToFlashcard:ta,flashedIds:_t,belowHeaderSlot:Pc&&Fl?(0,W.jsx)(ku,{audio:Fl,t:Bn,onSeek:qn}):void 0,viewSlot:pl?(0,W.jsxs)(`button`,{type:`button`,className:`canvas-open world-open`,title:Xf,"aria-label":Yf,onClick:()=>vl(),children:[(0,W.jsx)(z.globe,{className:`ic`,"aria-hidden":!0}),Yf]}):void 0,headerSlot:yc?(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`pen-anchor`,ref:to,children:[(0,W.jsx)(pc,{enabled:e.annotationsEnabled,open:Wa,inkCount:Fa.length,onClick:()=>Ka(e=>!e)}),Wa&&(0,W.jsx)(`div`,{className:`pen-popover`,children:(0,W.jsx)(fc,{entries:Fa,turnStartMs:Ra.current,annotationsEnabled:e.annotationsEnabled,hiddenSpots:qa,onToggle:mo,onKeep:()=>Ka(!1),onClear:()=>{ja([]),Na(new Set),Ja(new Set),Ka(!1)},onClip:()=>Be(!0),onJumpTo:go,onToggleSpot:yo})})]})}):void 0},vc?`thread-`+(Y.viewOverride?.id??``):yc?`live-`+Y.replaceEpoch:`view-`+Y.viewIndex)}),yc&&!zl&&!Go&&(0,W.jsx)(st,{spots:qa.size>0?Aa.filter(e=>!qa.has(e.spot)):Aa,revision:So,onPlaced:Pa}),Y.busy&&yc&&(0,W.jsxs)(`div`,{className:`working-col`,children:[(0,W.jsx)(uf,{cards:Lc}),(0,W.jsx)(pf,{thinking:Y.reasoning})]}),yc&&!Y.busy&&(0,W.jsx)($,{children:(0,W.jsx)(dp,{chips:Y.understood,onFix:Cs})}),(0,W.jsx)(Js,{spec:Y.viewSpec??Y.spec,followups:Mc,question:Ee??void 0,onAsk:as,onTrack:()=>Ke(!0),onDeepZoom:Ee?()=>{window.location.hash=`#/deepzoom?seed=${encodeURIComponent(Ee)}`}:void 0,onCanvas:()=>xo(`canvas`),onSeeAll:!vc&&xc&&xc.moments.length>=2?()=>jc(xc):void 0,threadCount:xc?.moments.length,busy:Y.busy})]})})]}):tc?(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(ys,{seed:r.current||void 0,speak:Vi,goDemo:qp,onStart:e=>{Vo(!0),as(e)},onStartTalking:()=>{if(Vo(!0),!Z){Ne(If),gi(e=>e+1);return}X.start({inCanvas:!1})},onSeeHow:()=>zo(!0),studySlot:(0,W.jsx)(xl,{onStudy:()=>Vt(!0)}),librarySlot:Ho.length>0?(0,W.jsx)($,{children:(0,W.jsx)(op,{entries:Ho,onResume:e=>{Vo(!0),te(!1),Oe(e.question??null),ts(e.id),Yo(e.spec,e.question)},onRemove:un,heading:`Pick up where you left off`,sub:`Your conversations stay on this device — tap one to step back in.`})}):void 0})}):(0,W.jsxs)(`div`,{className:`presence-stage stage`,"data-active":`1`,children:[Rl&&(0,W.jsx)(`div`,{className:`live-error-stage`,children:Rl}),Y.busy&&(0,W.jsx)(`div`,{className:`skel-stage`,children:(0,W.jsx)(uf,{cards:Lc})})]}),Ul,ml&&(0,W.jsx)($,{label:`Living answer`,children:(0,W.jsx)(Ip,{spec:fl.props.world??null,question:fl.props.title,failed:al,onRetry:()=>ul(e=>e+1),onClose:yl,view:fl.props.view,onExpandNode:Tl,autoWalk:Li&&fl.id===`tour-world`,speakLine:Vi})}),yi&&(0,W.jsxs)(`div`,{className:`drop-hint`,role:`status`,"aria-live":`polite`,children:[(0,W.jsx)(z.paperclip,{}),(0,W.jsx)(`span`,{children:`Drop to attach — Mavéa reads PDFs, Office docs, and data files`})]}),Ro&&(0,W.jsx)($,{children:(0,W.jsx)(rp,{onClose:()=>zo(!1),speak:Vi,onFullTour:Ki})}),ui&&(0,W.jsx)($,{children:(0,W.jsx)(ap,{items:Dl,surface:`live`,onClose:fi,pinned:s.current&&ko.chapter?.id===`palette`})}),ii&&(0,W.jsx)(`div`,{role:`presentation`,onClick:e=>e.target===e.currentTarget&&ai(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.45)`,display:`flex`,alignItems:`flex-start`,justifyContent:`center`,paddingTop:80,zIndex:50},children:(0,W.jsx)($,{children:(0,W.jsx)(cp,{onClose:()=>ai(!1),initialTab:oi,initialAdvancedYouOpen:ci})})}),Xo!==null&&(0,W.jsx)($,{children:(0,W.jsx)(Tp,{frames:Y.frames,initialIndex:Xo,speak:Vi,cancelSpeak:Fe,onClose:()=>Zo(null)})}),ze&&(0,W.jsx)($,{children:(0,W.jsx)(Dp,{frames:Y.frames,retainedAudio:e=>Xn.get(Ge(e)),onClose:()=>Be(!1),onShared:()=>Us.enqueue(`clipShared`)})}),Ve&&Zi.length>0&&(0,W.jsx)($,{children:(0,W.jsx)(kp,{answers:Zi,defaultIndex:bc?bc.moments[bc.moments.length-1].frameIndex:Zi.length-1,defaultIndices:bc?.moments.map(e=>e.frameIndex),onClose:()=>He(!1),guided:s.current&&ko.chapter?.action.kind===`export`})}),We&&(0,W.jsx)($,{children:(0,W.jsx)(jp,{onClose:()=>Ke(!1),initialSourceId:Qo?`lib-`+Qo:void 0})}),Ye&&(0,W.jsxs)(`div`,{className:`cv-takeover`,role:`dialog`,"aria-modal":`true`,"aria-label":`Living dashboard`,children:[(0,W.jsxs)(`header`,{className:`cv-takeover-head`,children:[(0,W.jsxs)(`div`,{className:`cv-takeover-id`,children:[(0,W.jsx)(`span`,{className:`cv-takeover-glyph`,"aria-hidden":`true`,children:`◎`}),(0,W.jsxs)(`div`,{className:`cv-takeover-titles`,children:[(0,W.jsx)(`span`,{className:`cv-takeover-eyebrow`,children:`Living dashboard`}),(0,W.jsx)(`span`,{className:`cv-takeover-title`,children:`Investment growth · $10k at 7%`})]})]}),(0,W.jsxs)(`button`,{type:`button`,className:`cv-takeover-close`,onClick:()=>ot(null),children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` Back to answer`]})]}),(0,W.jsx)(`div`,{className:`tour-dash-body`,children:(0,W.jsx)($,{children:ct?(0,W.jsx)(up,{id:Ye}):(0,W.jsx)(lp,{id:Ye})})})]}),ut&&(0,W.jsx)($,{children:(0,W.jsx)(Mp,{block:ut.block,question:ut.question,conversationTitle:Y.spec?.title,onClose:()=>dt(null),onAdded:(e,t)=>gt({id:e,title:t})})}),ft&&(0,W.jsx)(Os,{dashboardId:ft.id,dashboardTitle:ft.title,onDismiss:()=>gt(null)}),Y.spec&&(0,W.jsx)(Ls,{open:pi,onClose:()=>mi(!1),claim:Y.spec.title,conf:ns,sources:Y.spec.sources??[],hadFiles:ee,blocks:Y.spec.blocks}),Sn.open&&(0,W.jsx)($,{children:(0,W.jsx)(bp,{open:!0,spec:Sn.spec,onClose:()=>Tn(e=>({...e,open:!1}))})}),ei&&(0,W.jsx)($,{children:(0,W.jsx)(wp,{entries:Ho,onResume:e=>{Vo(!0),te(!1),Oe(e.question??null),ts(e.id),Yo(e.spec,e.question),ti(!1)},onRemove:un,onClose:()=>ti(!1)})}),Kc&&(0,W.jsx)(La,{chapters:mc,currentIndex:_c,onJump:vo,onClose:()=>qc(!1)}),In&&Jc&&(0,W.jsx)($,{children:(0,W.jsx)(pp,{model:Jc,level:In,onLevel:Ln,onJump:e=>{Y.jumpTo(e),Ln(null)},onClose:()=>Ln(null)})}),Yt&&(0,W.jsx)($,{children:(0,W.jsx)(Hp,{cfg:Gt(e),memoryNodes:wn(),speak:Vi,onDebrief:e=>{Qt(!1),j(e)},onClose:()=>Qt(!1),onPrepTurn:(e,t)=>{Qt(!1),Oe(t),Y.run(e,void 0,void 0,void 0,void 0,t)}})}),Ut&&Jc&&(0,W.jsx)($,{children:(0,W.jsx)(Sp,{model:Jc,onJump:e=>{Y.jumpTo(e),Jt(!1)},onShare:Y.frames.length>0?()=>{Jt(!1),Be(!0)}:void 0,onClose:()=>Jt(!1)})}),$t&&(0,W.jsx)($,{children:(0,W.jsx)(hp,{records:cr(),chapters:mc,onLand:e=>{en(!1);let t=or(e,Ho);Vo(!0),te(!1),t?(Oe(t.question??null),ts(t.id),Yo(t.spec,t.question)):(Oe(e.question),Y.run(e.question))},onGoDeeper:e=>{en(!1),Vo(!0),te(!1),Oe(e),Y.run(e)},autoTour:s.current,onClose:()=>en(!1)})}),an&&(0,W.jsx)($,{children:(0,W.jsx)(Pp,{pdf:an,cfg:Gt(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>on(null)})}),pn&&(0,W.jsx)($,{children:(0,W.jsx)(Kp,{doc:pn,cfg:Gt(e),onClose:()=>mn(null)},pn.id)}),hn&&(0,W.jsx)($,{children:(0,W.jsx)(Rp,{sources:hn,cfg:Gt(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>gn(null)})}),bn&&(0,W.jsx)($,{children:(0,W.jsx)(_p,{model:bn,cfg:Gt(e),speak:Vi,showcase:s.current,onClose:()=>xn(null)})}),Bt&&(0,W.jsx)($,{children:(0,W.jsx)(Wp,{onClose:()=>Vt(!1)})}),Ct&&(0,W.jsx)($,{children:(0,W.jsx)(vp,{mode:`add`,initial:Ct.initial,deck:Ct.deck,origin:`block`,source:Ct.source,heading:`Flashcards from ${ie(Ct.block)}`,enrich:Ct.enrich,decks:tr(),onSaved:e=>{if(e.length&&Ct.block.id){let e=Ct.block.id;yt(t=>new Set(t).add(e))}Qi(e)},onClose:()=>wt(null)})}),hs&&(0,W.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,W.jsx)(z.layers,{}),(0,W.jsxs)(`span`,{className:`cards-pill-text`,children:[hs.missedCards.length,` card`,hs.missedCards.length===1?``:`s`,` from this checkpoint`]}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>gs(null),children:`Dismiss`}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>_s(hs),children:`Add`})]}),!hs&&Ft&&(0,W.jsxs)(`div`,{className:`cards-pill is-ask`,role:`status`,"aria-live":`polite`,children:[(0,W.jsxs)(`div`,{className:`cards-pill-head`,children:[(0,W.jsx)(z.layers,{}),(0,W.jsxs)(`span`,{className:`cards-pill-text`,children:[Ft.count,` card`,Ft.count===1?``:`s`,` saved to “`,Ft.deck,`”`]})]}),(0,W.jsxs)(`div`,{className:`cards-pill-ask`,children:[(0,W.jsx)(`span`,{className:`cards-pill-q`,children:`Want Mavéa to help you remember these?`}),(0,W.jsx)(`span`,{className:`cards-pill-sub`,children:`They’ll come back for a quick practice every so often.`}),(0,W.jsxs)(`div`,{className:`cards-pill-choices`,children:[(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>ea(`collection`),children:`No thanks`}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>ea(`spaced`),children:`Yes`})]})]})]}),!hs&&!Ft&&Ot&&(0,W.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,W.jsx)(z.layers,{}),(0,W.jsxs)(`span`,{className:`cards-pill-text`,children:[Ot.count,` card`,Ot.count===1?``:`s`,` added`]}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>{rr(Ot.ids),Mt(null)},children:`Undo`}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>{window.location.hash=`#/flashcards`,Mt(null)},children:`View`})]})]})}export{Xp as LiveApp};
79
+ `)}var qd=/https?:\/\/[^\s<>"')\]]+/i;function Jd(e){let t=e.match(qd);return t?t[0].replace(/[.,;:!?]+$/,``):null}function Yd(e){let t=Jd(e);return t?e.replace(t,``).trim().split(/\s+/).filter(Boolean).length<=12:!1}function Xd(e){return`Check this for me: ${e} — what's actually true, what's shaky, and what's missing context? Ground every verdict in real sources.`}var Zd=`Check the claim in this screenshot — what's actually true, what's shaky, and what's missing context? Ground every verdict in real sources.`;function Qd(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable:!1}var $d=dt.map(e=>{let t=ft[e];return{id:e,label:t.label,description:`${t.archetype} — ${t.blurb}`,accent:t.tokens.accent}}),ef=`mavea-preso-style`;function tf(e){return $d.some(t=>t.id===e)}function nf(){try{let e=localStorage.getItem(ef);return tf(e)?e:`folio`}catch{return`folio`}}function rf(e){try{localStorage.setItem(ef,e)}catch{}}function af(e){return e<5?`Late night`:e<12?`This morning`:e<17?`This afternoon`:`Tonight`}function of(e){let t=Math.max(1,Math.round(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function sf(e,t){if(e.length===0||t.length===0)return null;let n=e[0],r=e[e.length-1],i=`${af(new Date(n.at).getHours())}, so far.`,a=[`${rc(n.at)} – ${rc(r.at)}`,of(r.at-n.at),`${t.length} ${t.length===1?`topic`:`topics`}`,`${e.length} ${e.length===1?`moment`:`moments`}`].join(` · `),o=nc(e),s=[];for(let n of t){let t=n.moments[0],r=n.moments[n.moments.length-1],i=e[r.frameIndex],a=i?.narration||i?.question||``;if(!a)continue;let c=n.moments.map(e=>o.get(e.frameIndex)).find(Boolean);s.push({title:n.title,clock:rc(e[t.frameIndex]?.at),line:a,frameIndex:r.frameIndex,...c?{corrected:`Corrected — ${c.note.what}: was ${c.note.was}, now ${c.note.now}`}:{}})}return s.length?{heading:i,meta:a,rows:s}:null}function cf(e){let t=(0,J.c)(10),{transcript:n,mode:r,note:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,W.jsxs)(`span`,{className:`listen-eq`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]}),t[0]=a):a=t[0];let o=n?`“${n}`:`Listening`,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,W.jsx)(`span`,{className:`listen-caret`,"aria-hidden":`true`}),t[1]=s):s=t[1];let c=n?`”`:``,l;t[2]!==o||t[3]!==c?(l=(0,W.jsxs)(`div`,{className:`listen-line`,children:[o,s,c]}),t[2]=o,t[3]=c,t[4]=l):l=t[4];let u=i??(r===`always`?`Always on — Mavéa answers when you finish a thought.`:r===`hold`?`Release the mic or shortcut to send.`:`It sends when you pause — or tap the mic to send now.`),d;t[5]===u?d=t[6]:(d=(0,W.jsx)(`div`,{className:`listen-note`,role:`status`,"aria-live":`polite`,children:u}),t[5]=u,t[6]=d);let f;return t[7]!==l||t[8]!==d?(f=(0,W.jsx)(`div`,{className:`listen-stage`,children:(0,W.jsxs)(`div`,{className:`listen-card`,children:[a,(0,W.jsxs)(`div`,{className:`listen-body`,children:[l,d]})]})}),t[7]=l,t[8]=d,t[9]=f):f=t[9],f}var lf=250;function uf(e){let t=(0,J.c)(6),{cards:n}=e,[r,i]=(0,U.useState)(!1),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.setTimeout(()=>i(!0),lf);return()=>window.clearTimeout(e)},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,U.useEffect)(a,o),!r||n.length===0)return null;let s;t[2]===n?s=t[3]:(s=n.map(df),t[2]=n,t[3]=s);let c;return t[4]===s?c=t[5]:(c=(0,W.jsx)(`div`,{className:`skel-grid`,role:`status`,"aria-label":`Building the answer`,children:s}),t[4]=s,t[5]=c),c}function df(e,t){return(0,W.jsxs)(`div`,{className:`skel-card`,children:[(0,W.jsxs)(`span`,{className:`skel-eyebrow`,children:[`✦ `,e.label,`…`]}),e.lines.map(ff)]},t)}function ff(e,t){return(0,W.jsx)(`span`,{className:`skel-line`,style:{width:`${e}%`}},t)}function pf({thinking:e=!1}){return(0,W.jsxs)(`div`,{className:`composing-status`,role:`status`,"aria-live":`polite`,children:[(0,W.jsx)(`span`,{className:`composing-orb`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{children:e?`Thinking it through`:`Composing your answer`}),(0,W.jsxs)(`span`,{className:`composing-dots`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]})]})}function mf(e){let t=(0,J.c)(14),{activity:n,sources:r}=e,i,a,o,s,c,l;if(t[0]!==n||t[1]!==r){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.slice(0,3),t=n===`searching`;if(!t&&e.length===0){l=null;break bb0}i=`turn-chips`,a=`status`,o=`polite`,s=t&&e.length===0&&(0,W.jsxs)(`span`,{className:`turn-chip`,children:[(0,W.jsx)(z.globe,{}),` Searching the web…`]}),c=e.map(hf)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;return t[8]!==i||t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==c?(u=(0,W.jsxs)(`div`,{className:i,role:a,"aria-live":o,children:[s,c]}),t[8]=i,t[9]=a,t[10]=o,t[11]=s,t[12]=c,t[13]=u):u=t[13],u}function hf(e,t){return(0,W.jsxs)(`span`,{className:`turn-chip src`,children:[(0,W.jsx)(`i`,{className:`turn-chip-dot`,"aria-hidden":`true`}),ge(e.url)??e.title]},t)}function gf(){return(0,U.useSyncExternalStore)(ke,Ce,_f)}function _f(){return!1}var vf=600,yf=!1,bf=null,xf=null,Sf=new Set;function Cf(){if(xe()){bf===null&&!yf&&(bf=window.setTimeout(()=>{bf=null,yf=!0;for(let e of Sf)e()},vf));return}if(bf!==null&&(window.clearTimeout(bf),bf=null),yf){yf=!1;for(let e of Sf)e()}}function wf(e){return Sf.add(e),xf??=ke(Cf),()=>{Sf.delete(e),Sf.size===0&&(xf?.(),xf=null,bf!==null&&(window.clearTimeout(bf),bf=null),yf=!1)}}function Tf(){return(0,U.useSyncExternalStore)(wf,Df,Ef)}function Ef(){return!1}function Df(){return yf}var Of={scalar:`Key figure`,series:`Trend`,composition:`Breakdown`,comparison:`Comparison`,ranking:`Ranking`,distribution:`Distribution`,relationship:`Relationship`,hierarchy:`Structure`,flow:`Process`,sequence:`Timeline`,keyvalue:`Readouts`,list:`Checklist`,geo:`Map`,code:`Code`,tabular:`Table`,status:`Status`},kf=/^(please|hey|ok(ay)?|so|now|can|could|would|will|you|how|what|why|when|where|which|who|should|is|are|do|does|did|tell|show|give|make|build|plan|help|i|me|us|my|about|the|a|an)\b[\s,'’]*/i;function Af(e,t=4){let n=e.trim().replace(/\s+/g,` `);for(let e=0;e<8;e++){let e=n.replace(kf,``);if(e===n)break;n=e}return n.replace(/[?!.]+$/,``).split(` `).slice(0,t).join(` `).trim()}var jf=[[78,52],[64,88],[82,40]];function Mf(e,t){let n=Af(e),r=rn(e,t),i=Object.entries(r).filter(([e,t])=>t>0&&Of[e]).sort((e,t)=>t[1]-e[1]).map(([e])=>Of[e]),a=en(e)===`rich`?3:2,o=[`Finding`];for(let e of i){if(o.length>=a)break;o.includes(e)||o.push(e)}for(;o.length<a;)o.push(o.length===1?`Readouts`:`Details`);return o.map((e,t)=>({label:n?`${e} — ${n}`:e,lines:jf[t%jf.length]}))}function Nf(e){let t=e&&Of[e]||(e===`text`?`Finding`:null);return{label:t?`Building — ${t.toLowerCase()}`:`Building`,lines:jf[0]}}function Pf(e){return e.paletteOpen||e.shareOpen||e.exportOpen||e.dashOpen||e.showSettings||e.proofOpen||e.showHow||e.replayAt!==null||e.recapOpen||e.atlasOpen||e.delegateOpen||e.srsOpen||e.zoomLevel!==null||e.mindViewOpen}function Ff(e,t){let n=e.left-t.left+e.width/2,r=e.top-t.top+e.height/2,i=Math.min(e.width/2+14,t.width*.45),a=e.height/2+10,o=Math.PI*2*1.12,s=[];for(let e=0;e<=32;e++){let t=-Math.PI/2+o*e/32;s.push({x:n+Math.cos(t)*i,y:r+Math.sin(t)*a})}return s}var If=`Local voice input isn’t available here — check browser microphone support, or type instead.`,Lf=`Microphone access is blocked — allow mic access for this site to talk to Mavéa.`,Rf=`Couldn’t reach your microphone — check it’s connected and not in use by another app.`,zf=`Local transcription is still starting or unavailable — try again in a moment, or type instead.`;function Bf(){let e=(0,J.c)(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,U.useState)(t),[i,a]=(0,U.useState)(null),[o,s]=(0,U.useState)(!1),c;e[1]===n.length?c=e[2]:(c=async e=>{a(null);let t=6-n.length;if(t<=0){a(`You can attach up to 6 files.`);return}let i=[],o=null;for(let n of e.slice(0,t)){let e=await Ot(n);if(e.ok&&e.attachment)i.push(e.attachment);else if(!o){let t=/\.(pdf|docx|pptx|xlsx)$/i.test(n.name);o=e.error===`too-large`?`"${n.name}" is too large (max ${t?40:10} MB).`:`"${n.name}" isn't a supported type (images, PDF, Office docs, or text/data files like CSV, TXT, Markdown, JSON).`}}e.length>t&&(o=`Only the first ${t} file(s) were added.`),i.length&&r(e=>[...e,...i]),o&&a(o)},e[1]=n.length,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{r(t=>t.filter((t,n)=>n!==e))},e[3]=u):u=e[3];let d=u,f;return e[4]!==i||e[5]!==n||e[6]!==l||e[7]!==o?(f={attached:n,setAttached:r,attachError:i,setAttachError:a,turnHadFiles:o,setTurnHadFiles:s,onFiles:l,removeAttachment:d},e[4]=i,e[5]=n,e[6]=l,e[7]=o,e[8]=f):f=e[8],f}var Vf=`mavea-live-bookmarks`;function Hf(){let[e,t]=(0,U.useState)(()=>{try{let e=localStorage.getItem(Vf);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}});return{bookmarks:e,toggleBookmark:(0,U.useCallback)(e=>{t(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{localStorage.setItem(Vf,JSON.stringify([...n]))}catch{}return n})},[])}}var Uf=`mavea-live-ask-hint`;function Wf(){let e=(0,J.c)(3),[t,n]=(0,U.useState)(Gf),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{n(!0);try{localStorage.setItem(Uf,`1`)}catch{}},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a={askHintSeen:t,dismissAskHint:i},e[1]=t,e[2]=a),a}function Gf(){try{return localStorage.getItem(Uf)===`1`}catch{return!1}}i();var Kf=(0,U.lazy)(()=>a(()=>import(`./TopicCanvas-DozfZFto.js`).then(e=>e.n).then(e=>({default:e.TopicCanvas})),__vite__mapDeps([42,1,43,44,14,2,45,46,47,48,49,50,51,52,13,53,54,4,55,56,57,58,59,60,61,62,63,16,64,5,6,22,65,66,67,68,69]))),qf=[{col:6},{col:6},{col:12}],Jf=`mavea-live-rail-collapsed-v1`,Yf=`View as living answer`,Xf=`Why this answer is true — the causal web behind it, and its receipts`,Zf=`mavea-mic-hold-preferred`,Qf=`I may have misheard that. Review the draft, then send it.`,$f=6400,ep=Wa+tt;function tp(e){return Qd(e.target)?!0:(e.key===` `||e.key===`Spacebar`)&&e.target instanceof HTMLElement&&!!e.target.closest(`button`)}var np=s(()=>a(()=>import(`./HowItWorks-D-hgfN6a.js`).then(e=>({default:e.HowItWorks})),__vite__mapDeps([70,43,1,14,13,42,44,2,45,46,47,48,49,50,51,52,53,54,4,55,56,57,58,59,60,61,62,63,16,64,5,6,22,65,66,67,68,69,71,72,73,15,74,75,76,77,78,79,80,81,19]))),rp=np.Component,ip=s(()=>a(()=>import(`./CommandPalette-Bs6tpdZl.js`).then(e=>({default:e.CommandPalette})),__vite__mapDeps([82,43,1,14,48,49,50,13,83,84]))),ap=ip.Component,op=s(()=>a(()=>import(`./Library-DmdzY2se.js`).then(e=>({default:e.Library})),__vite__mapDeps([85,43,1,44,14,13,4,86,87,88,89,90]))).Component,sp=s(()=>a(()=>import(`./LiveSettings-C9cKOrSb.js`).then(e=>({default:e.LiveSettings})),__vite__mapDeps([91,43,1,44,14,2,45,46,47,48,49,50,51,52,13,56,73,15,92,93,23,89,21,22,10,20,94,39,95,96,38,97,37,98,99,100,101,102,103]))),cp=sp.Component,lp=s(()=>a(()=>import(`./DashboardDetail-DYFghZ4p.js`).then(e=>({default:e.DashboardDetail})),__vite__mapDeps([104,43,1,44,14,2,13,42,45,46,47,48,49,50,51,52,53,54,4,55,56,57,58,59,60,61,62,63,16,64,5,6,22,65,66,67,68,69,17,75,76,77,78,79,80,15,81,105,96,38,39,94,23,21,10,20,106,107,108,109,110,111,112,113,114,29,32,41,115,116,117,73,118,119,120,121,122,123,124,125,126,127,128]))).Component,up=s(()=>a(()=>import(`./DashboardSettings-CE0B2y2y.js`).then(e=>({default:e.DashboardSettings})),__vite__mapDeps([129,43,1,44,14,105,96,38,39,106,107,108,109,116,122,112,113]))).Component,dp=s(()=>a(()=>import(`./UnderstoodPanel-DmJph4el.js`).then(e=>({default:e.UnderstoodPanel})),__vite__mapDeps([130,43,1,44,14,131]))).Component,fp=s(()=>a(()=>import(`./ZoomDeck-CKOjYS9z.js`).then(e=>({default:e.ZoomDeck})),__vite__mapDeps([132,43,1,44,14,13,56,133,45,46,47,2,48,49,50,51,52,134,135]))),pp=fp.Component,mp=s(()=>a(()=>import(`./AtlasView-B82UfrEX.js`).then(e=>({default:e.AtlasView})),__vite__mapDeps([136,43,1,14,86,87,4,88,89,137,96,38,39,138]))),hp=mp.Component,gp=s(()=>a(()=>import(`./RippleOverlay-D7ItTvS-.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([139,43,1,44,14,2,49,48,50,45,46,47,51,52,56,58,92,93,26,140,141,142,143,39,144,145,146]))),_p=gp.Component,vp=s(()=>a(()=>import(`./CardEditor-DABIhGdQ.js`).then(e=>({default:e.CardEditor})),__vite__mapDeps([147,43,1,14,56,101,148]))).Component,yp=s(()=>a(()=>import(`./CourseRail-DXt3bzjU.js`).then(e=>({default:e.CourseRail})),__vite__mapDeps([149,43,1,44,14,13,94,23,39,21,22,10,20,101,150,151,152,153,154]))).Component,bp=s(()=>a(()=>import(`./MindMapViewerDrawer-DI_S7fRZ.js`).then(e=>({default:e.MindMapViewerDrawer})),__vite__mapDeps([155,44,1,43,14,13,156,58,157,47,158,159]))).Component,xp=s(()=>a(()=>import(`./Recap-T9DtFaEk.js`).then(e=>({default:e.Recap})),__vite__mapDeps([160,43,1,44,14,56,161]))),Sp=xp.Component,Cp=s(()=>a(()=>import(`./LibraryOverlay-YHBrdVKo.js`).then(e=>({default:e.LibraryOverlay})),__vite__mapDeps([162,43,1,44,14,13,56,133,45,46,47,2,48,49,50,51,52,85,4,86,87,88,89,90,163]))),wp=Cp.Component,Tp=s(()=>a(()=>import(`./ReplayOverlay-BTldvkU7.js`).then(e=>({default:e.ReplayOverlay})),__vite__mapDeps([164,43,1,14,42,44,2,45,46,47,48,49,50,51,52,13,53,54,4,55,56,57,58,59,60,61,62,63,16,64,5,6,22,65,66,67,68,69,165,71,72,73,15,74,75,76,77,78,79,80,81,166,167,168,169,170]))).Component,Ep=s(()=>a(()=>import(`./ShareModal-9jSn52Mw.js`).then(e=>({default:e.ShareModal})),__vite__mapDeps([171,43,1,44,14,2,48,49,50,13,78,79,80,15,56,62,172,45,46,47,51,52,73,173,174,158,88,92,93,175]))),Dp=Ep.Component,Op=s(()=>a(()=>import(`./ExportModal-Ya0VBbxa.js`).then(e=>({default:e.ExportModal})),__vite__mapDeps([176,43,1,44,14,2,45,46,47,48,49,50,51,52,80,4,56,17,173,92,93,74,177,54,13,55,16,178,61,63,179,66,65,67,68,180,181,182,183,156,58,157,158,159,184,185,28,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,57,211,212,213,214,215,216,217,218,73,15,219,220,64,221,222,223,224,225,133,226,227,228,229,230,231,232,233,234,235,18,236,9,237,238,239,240]))),kp=Op.Component,Ap=s(()=>a(()=>import(`./ExtractionPreview-BFrmqKDo.js`).then(e=>({default:e.ExtractionPreview})),__vite__mapDeps([241,43,1,44,14,56,242,7,96,38,39,105,21,22,10,23,20,94,95,29,106,114,2,32,109,108,110,41,115,116,117,15,73,45,46,47,48,49,50,51,52,118,243,128]))),jp=Ap.Component,Mp=s(()=>a(()=>import(`./PinToDashboard-BCiWaSg8.js`).then(e=>({default:e.PinToDashboard})),__vite__mapDeps([244,43,1,44,14,13,4,56,105,96,38,39,94,23,21,22,10,20,108,109,120,114,2,29,32,110,41,115,116,117,15,73,45,46,47,48,49,50,51,52,121]))).Component,Np=s(()=>a(()=>import(`./PrismOverlay-DJDGPGxo.js`).then(e=>e.n).then(e=>({default:e.PrismOverlay})),__vite__mapDeps([245,1,43,44,14,2,49,48,50,45,46,47,51,52,56,62,17,246,167,20,247,21,22,10,23,30,34,35,248,11,31,36,249]))),Pp=Np.Component,Fp=s(()=>a(()=>import(`./WorldOverlay-yhxq328s.js`).then(e=>({default:e.WorldOverlay})),__vite__mapDeps([250,43,1,44,14,2,15,53,50,56,58,63,179,193,185,28,17,218,72,73,45,46,47,48,49,51,52,74,168,27,29,30,31,32,33,251,252,253,254,255]))),Ip=Fp.Component,Lp=s(()=>a(()=>import(`./SynthesisOverlay-iesJ0hEt.js`).then(e=>({default:e.SynthesisOverlay})),__vite__mapDeps([256,43,1,44,14,20,21,22,10,23,30,245,2,49,48,50,45,46,47,51,52,56,62,17,246,167,247,34,35,248,11,31,36,249]))),Rp=Lp.Component,zp=s(()=>a(()=>import(`./PresentationDeck-BW_7qecK.js`).then(e=>({default:e.PresentationDeck})),__vite__mapDeps([257,43,1,44,14,177,80,54,13,4,55,16,178,61,63,179,66,65,67,68,180,181,182,183,156,58,157,47,158,159,184,185,28,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,2,204,205,17,206,207,208,209,210,57,211,212,45,46,48,49,50,51,52,213,214,215,216,217,218,73,15,219,220,64,221,222,223,224,225,56,133,226,227,228,229,230,231,232,233,234,235,18,236,9,237,238,258]))),Bp=zp.Component,Vp=s(()=>a(()=>import(`./DelegatePanel-DKWsRY9I.js`).then(e=>({default:e.DelegatePanel})),__vite__mapDeps([259,43,1,44,14,15,56,157,47,158,73,45,46,2,48,49,50,51,52,92,93,21,22,10,23,20,258,260]))),Hp=Vp.Component,Up=s(()=>a(()=>import(`./SrsReview-DhWNYYv7.js`).then(e=>({default:e.SrsReview})),__vite__mapDeps([261,43,1,14,56,101,102,262]))),Wp=Up.Component,Gp=s(()=>a(()=>import(`./TourPrism-kInUOv-M.js`).then(e=>({default:e.TourPrism})),__vite__mapDeps([263,43,1,44,14,245,2,49,48,50,45,46,47,51,52,56,62,17,246,167,20,247,21,22,10,23,30,34,35,248,11,31,36,249]))),Kp=Gp.Component;function $({children:e,label:t=`Feature`}){return(0,W.jsx)(M,{label:t,overlay:!0,children:e})}function qp(){try{window.location.hash=``}catch{}}function Jp(e){return j(e)??Promise.resolve()}function Yp(e){let t=e.toLowerCase().trim().replace(/[.,!?]+$/,``);return t.split(/\s+/).filter(Boolean).length<=3&&/^(yeah|yep|yes|ok|okay|sure|right|uh huh|uh-huh|mhm|mm|hmm|hm|go on|go ahead|carry on|continue|keep going|please continue|please go on|go ahead|keep it up|got it|alright)$/.test(t)?!0:/\b(keep going|go on|continue|carry on|go ahead|please continue|please go on)\b/.test(t)}function Xp(){let[e]=Xt(),t=ht(e.provider),n=e.models[e.provider]||t.defaultModel;(0,U.useLayoutEffect)(()=>S(document),[]),(0,U.useEffect)(()=>{let t=document.documentElement;return e.fontScale===`normal`?delete t.dataset.fontScale:t.dataset.fontScale=e.fontScale,()=>{delete t.dataset.fontScale}},[e.fontScale]);let r=(0,U.useRef)(u()),i=(0,U.useRef)(Sr()),s=(0,U.useRef)(m()),l=(0,U.useRef)(s.current?P():null),g=(0,U.useRef)(s.current?E():!1),O=(0,U.useRef)((()=>{if(s.current)return null;let e=x();return e&&F(e)?e:null})()),k=(0,U.useRef)(O.current?R():null);(0,U.useEffect)(()=>{s.current&&C(),l.current&&f(),g.current&&T(),O.current&&p()},[]);let[A,j]=(0,U.useState)(``),{attached:M,setAttached:N,attachError:I,setAttachError:L,turnHadFiles:ee,setTurnHadFiles:te,onFiles:ne,removeAttachment:oe}=Bf(),[V,ce]=(0,U.useState)([]),[de,pe]=(0,U.useState)(!1),{askHintSeen:me,dismissAskHint:he}=Wf(),[H,ge]=(0,U.useState)(!1),[ye,xe]=(0,U.useState)(`idle`),[Se,Te]=(0,U.useState)(null),[Ee,Oe]=(0,U.useState)(null),[Ae,Ne]=(0,U.useState)(null),[Le,Re]=(0,U.useState)(!1),[ze,Be]=(0,U.useState)(!1),[Ve,He]=(0,U.useState)(!1),[We,Ke]=(0,U.useState)(!1),[Ye,ot]=(0,U.useState)(null),[ct,lt]=(0,U.useState)(!1),[ut,dt]=(0,U.useState)(null),[ft,gt]=(0,U.useState)(null),[_t,yt]=(0,U.useState)(()=>new Set),[Ct,wt]=(0,U.useState)(null),[Ot,Mt]=(0,U.useState)(null),Pt=(0,U.useRef)(void 0),[Ft,It]=(0,U.useState)(null),Lt=(0,U.useRef)(void 0),[Rt,zt]=(0,U.useState)(!1),[Bt,Vt]=(0,U.useState)(!1),[Ut,Jt]=(0,U.useState)(!1),[Yt,Qt]=(0,U.useState)(!1),[$t,en]=(0,U.useState)(!1),[tn,nn]=(0,U.useState)(()=>cr().length),rn=Yn().length;(0,U.useEffect)(()=>{let e=()=>void sn(),t={once:!0,passive:!0};return window.addEventListener(`keydown`,e,t),window.addEventListener(`pointerdown`,e,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`pointerdown`,e)}},[]),(0,U.useEffect)(()=>wr(),[]);let[an,on]=(0,U.useState)(null),[pn,mn]=(0,U.useState)(null),[hn,gn]=(0,U.useState)(null),vn=(0,U.useCallback)(e=>{e.length>=4?gn(e):e.length>0&&on(e)},[]),[bn,xn]=(0,U.useState)(null);(0,U.useEffect)(()=>{h()&&(w(),xn(lr))},[]);let[Sn,Tn]=(0,U.useState)({open:!1,spec:null}),[En,Dn]=(0,U.useState)(!1),On=(0,U.useRef)(!1);On.current=En;let[An,jn]=(0,U.useState)(()=>nf()),[Mn,Nn]=(0,U.useState)(!1),[Pn,Fn]=(0,U.useState)(new Set),[In,Ln]=(0,U.useState)(null),[Rn,zn]=(0,U.useState)(null),[Bn,Vn]=(0,U.useState)(null),[Wn,Kn]=(0,U.useState)(!1),qn=(0,U.useCallback)((e,t=!1)=>{Vn(e),Kn(e!==null&&t)},[]),Jn=(0,U.useCallback)(()=>{Vn(null),Kn(!1)},[]),Xn=(0,U.useRef)(new _u).current,Zn=(0,U.useMemo)(()=>e.quality===`fast`?null:Gt(e),[e]),[mr,gr]=(0,U.useState)(!1),Or=(0,U.useRef)(!1);Or.current=mr;let kr=(0,U.useRef)([]),[Ar,Pr]=(0,U.useState)(0),Fr=(0,U.useRef)(0),Lr=Wd(mr,Ar),[G,Rr]=(0,U.useState)(!1),zr=(0,U.useRef)(!1);zr.current=G;let Br=(0,U.useRef)([]),K=Pd((0,U.useMemo)(()=>Gt(e),[e])),Vr=(0,U.useRef)(K);Vr.current=K;let q=(0,U.useRef)(null),Ur=(0,U.useRef)(!1),Kr=(0,U.useRef)(`idle`),qr=(0,U.useCallback)(()=>{let e=Br.current.join(` `).trim();e&&Vr.current.phase===`listening`&&Vr.current.onSpeechEnd(e)},[]),Yr=_n(),[Xr,Zr]=(0,U.useState)(!1),[Qr,$r]=(0,U.useState)(()=>{try{return localStorage.getItem(Jf)===`true`}catch{return!1}});(0,U.useEffect)(()=>{try{localStorage.setItem(Jf,String(Qr))}catch{}},[Qr]);let[ei,ti]=(0,U.useState)(!1),[ni,ri]=(0,U.useState)(!1),[ii,ai]=(0,U.useState)(!1),[oi,si]=(0,U.useState)(),[ci,li]=(0,U.useState)(!1);(0,U.useEffect)(()=>{ii||li(!1)},[ii]);let{open:ui,openPalette:di,closePalette:fi}=y(),[pi,mi]=(0,U.useState)(!1),[hi,gi]=(0,U.useState)(0),[_i,vi]=(0,U.useState)(0),[yi,bi]=(0,U.useState)(!1),[J,Si]=(0,U.useState)(()=>{try{return localStorage.getItem(ga)===`true`}catch{return!1}}),[Ci,wi]=(0,U.useState)(!1),Ti=(0,U.useRef)(null),[Ei,Di]=(0,U.useState)(()=>{try{return localStorage.getItem(Zf)===`true`}catch{return!1}}),Oi=J?`always`:Ei?`hold`:`tap`;(0,U.useEffect)(()=>{try{let e=De(localStorage.getItem(`mavea-voice-mavea`)||`heart`);e&&je(`mavea`,e.kokoro)}catch{}},[]),(0,U.useEffect)(()=>{if(typeof window>`u`)return;let e,t=t=>{let n=t.detail?.changed;Array.isArray(n)&&n.length>0&&(ri(!0),e&&clearTimeout(e),e=setTimeout(()=>ri(!1),2600))};return window.addEventListener(kn,t),()=>{window.removeEventListener(kn,t),e&&clearTimeout(e)}},[]);let ki=(0,U.useCallback)(e=>{try{localStorage.setItem(ga,String(e))}catch{}},[]);(0,U.useEffect)(()=>{let e=Ti.current;ki(e?e.enabled:J)},[J,ki]),(0,U.useEffect)(()=>{try{localStorage.setItem(Zf,String(Ei))}catch{}},[Ei]);let Ai=(0,U.useRef)(null),Mi=(0,U.useRef)(Le);Mi.current=Le;let Ni=(0,U.useRef)(null),[Fi,Ii]=(0,U.useState)(null),[Li,Ri]=(0,U.useState)(!1),zi=(0,U.useRef)([]),Bi=(0,U.useRef)(()=>{}),Vi=(0,U.useCallback)(e=>{Mi.current||Ai.current?.setMaveaSpeaking(!0);let t=!Ce(),n=ve(e,`mavea`);return t&&(Ni.current=n),n},[]);(0,U.useEffect)(()=>{we(Le),Le?Ai.current?.setMaveaSpeaking(!1):Ce()&&Ai.current?.setMaveaSpeaking(!0)},[Le]);let[Hi]=(0,U.useState)(()=>r.current||i.current?(xt(),null):s.current||O.current?null:bt()),Ui=(0,U.useRef)(St()).current,Y=No({canRun:D,getConfig:()=>Gt(Kt()),getCaps:()=>Wt(Kt()),speak:Vi,cancelSpeak:Fe,getLibraryEnabled:()=>Kt().libraryEnabled,initial:Hi?Mo(Hi):void 0}),Wi=ad(H,Se,Zn,Y.busy),Gi=(0,U.useCallback)(()=>{window.location.hash=`#/live`,window.location.reload()},[]),Ki=(0,U.useCallback)(()=>{b(),window.location.hash=`#/live`,window.location.reload()},[]),qi=(0,U.useRef)(`normal`);qi.current=Y.phase;let Ji=(0,U.useRef)(null);Ji.current=Y.activeBlank;let Yi=(0,U.useRef)([]);Yi.current=Y.spec?.blanks??[],(0,U.useEffect)(()=>{Zt()},[]),(0,U.useEffect)(()=>{s.current||O.current||Y.frames.length>0&&vt(Y.history,Y.frames)},[Y.frames,Y.history]),(0,U.useEffect)(()=>{if(!(Y.frames.length===0||Y.busy))return o(Ep.preload)},[Y.frames.length,Y.busy]),(0,U.useEffect)(()=>{if(!s.current)return;let e=g.current&&l.current===`prism`;if(!(g.current&&!e))return o(()=>Promise.all([Gp.preload(),na()]).then(()=>void 0),e?300:2500)},[]);let Zi=(0,U.useMemo)(()=>Y.frames.map((e,t)=>({index:t,label:e.question||`Answer ${t+1}`,spec:e.spec})),[Y.frames]),Qi=(0,U.useCallback)(e=>{if(e.length){if(!Qn().styleAsked&&ir().length===e.length){It({count:e.length,deck:e[0].deck}),Lt.current&&clearTimeout(Lt.current),Lt.current=setTimeout(()=>{$n(),It(null)},12e3);return}Mt({count:e.length,ids:e.map(e=>e.id)}),Pt.current&&clearTimeout(Pt.current),Pt.current=setTimeout(()=>Mt(null),6e3)}},[]),ea=(0,U.useCallback)(e=>{Lt.current&&clearTimeout(Lt.current),e?er(e):$n(),It(null)},[]);(0,U.useEffect)(()=>()=>{Pt.current&&clearTimeout(Pt.current),Lt.current&&clearTimeout(Lt.current)},[]),(0,U.useEffect)(()=>{if(!e.autoSaveFlashcards)return;let t=Y.frames[Y.frames.length-1];if(!t)return;let n=El(t.spec.blocks);if(n.length>0){let e=nr(n,{deck:t.spec.topic||t.spec.title||`General`,origin:`auto`});Qi(e)}},[Y.frames,e.autoSaveFlashcards,Qi]);let ta=(0,U.useCallback)(t=>{let n=Y.viewSpec??Y.spec,r=n?.topic||n?.title||`General`,{cards:i,exact:a}=Il(t),o={ts:Date.now(),...t.id?{blockId:t.id}:{},...Ee?{question:Ee}:{},...n?.topic?{topic:n.topic}:{}},s=Gt(e),c=!!s.apiKey;wt({block:t,initial:i,deck:r,source:o,enrich:!a&&c?()=>Bl(t,s):void 0})},[Y.viewSpec,Y.spec,Ee,e]),ra=(0,U.useRef)(null),ia=(0,U.useRef)(null),oa=(0,U.useRef)(()=>{}),sa=(0,U.useRef)([]),ca=(0,U.useRef)(()=>{}),la=(0,U.useRef)(()=>{});ca.current=()=>{let e=document.querySelector(`.bend-slider`);if(!e)return;e.scrollIntoView({block:`center`,behavior:`smooth`});let t=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set;if(!t)return;sa.current.forEach(e=>window.clearTimeout(e)),sa.current.length=0;let n=Number(e.min||0),r=Number(e.max||100),i=Number(e.step||1)||1,a=Number(e.value),o=Math.min(r,n+(r-n)*.78);for(let n=1;n<=26;n++)sa.current.push(window.setTimeout(()=>{let r=a+(o-a)*n/26,s=Math.round(r/i)*i;t.call(e,String(s)),e.dispatchEvent(new Event(`input`,{bubbles:!0}))},500+n*90))},(0,U.useEffect)(()=>{let e=sa.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]);let ua=(0,U.useRef)(()=>{}),da=(0,U.useRef)(null),fa=(0,U.useRef)(null),pa=(0,U.useRef)(null),ma=(0,U.useRef)(!1),va=(0,U.useRef)(null),ya=(0,U.useRef)(!1),ba=(0,U.useRef)(null),[xa,Sa]=(0,U.useState)(!1),[Ta,Ea]=(0,U.useState)(!1),Da=(0,U.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id,i=n.saySpoken??n.say;r&&i&&e.set(r,i)}return e},[Y.tour,Y.spec]),Oa=(0,U.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id;r&&n.mark&&e.set(r,n.mark)}return e},[Y.tour,Y.spec]),ka=(0,U.useMemo)(()=>{let e=new Map,t=Y.spec?.blocks??[];for(let n of Y.tour){let r=t[n.index]?.id,i=n.marks??(n.mark?[n.mark]:[]);r&&i.length&&e.set(r,i)}return e},[Y.tour,Y.spec]),[Aa,ja]=(0,U.useState)([]),[Ma,Na]=(0,U.useState)(()=>new Set),Pa=(0,U.useCallback)(e=>{Na(t=>t.has(e)?t:new Set(t).add(e))},[]),Fa=(0,U.useMemo)(()=>Aa.filter(e=>e.noteText!==void 0||Ma.has(e)),[Aa,Ma]),Ra=(0,U.useRef)(Date.now()),za=(0,U.useRef)(null),Va=(0,U.useRef)(null),Ua=(0,U.useCallback)(e=>{Va.current=e,za.current??=requestAnimationFrame(()=>{za.current=null,Va.current!=null&&Te(Va.current)})},[]);(0,U.useEffect)(()=>()=>{za.current!=null&&cancelAnimationFrame(za.current)},[]),(0,U.useEffect)(()=>{ja([]),Na(new Set),Ra.current=Date.now()},[Y.turn]);let[Wa,Ka]=(0,U.useState)(!1);(0,U.useEffect)(()=>Ka(!1),[Y.turn]);let[qa,Ja]=(0,U.useState)(()=>new Set);(0,U.useEffect)(()=>Ja(new Set),[Y.turn]);let Ya=(0,U.useRef)(!1);(0,U.useEffect)(()=>{let e=!!Y.error;e&&!Ya.current&&ra.current?.scrollTo({top:0,behavior:`smooth`}),Ya.current=e},[Y.error]);let[Xa,Za]=(0,U.useState)(!1);(0,U.useEffect)(()=>{let e=ra.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>Za(e.clientWidth>=1280),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[Y.turn]);let Qa=(0,U.useMemo)(()=>Aa.filter(e=>e.noteText&&!qa.has(e.spot)).map(e=>({spot:e.spot,text:e.noteText})),[Aa,qa]),{bookmarks:$a,toggleBookmark:eo}=Hf(),to=(0,U.useRef)(null);(0,U.useEffect)(()=>{if(!Wa)return;function e(e){to.current&&!to.current.contains(e.target)&&Ka(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[Wa]);let no=(0,U.useRef)(Y.spec);no.current=Y.spec;let ro=(0,U.useCallback)((e,t,n,r,i,a,o,s)=>{e&&ja(c=>{if(s?c.some(t=>t.spot===e&&t.noteText!==void 0):c.some(t=>t.spot===e&&t.kind===n?.kind&&t.at===n?.at&&t.noteText===void 0))return c;let l=!t&&!n?.at?no.current?.blocks.find(t=>t.id===e)??null:null,u=n?.kind===`connect`&&typeof n.onIndex==`number`?no.current?.blocks[n.onIndex]?.id:void 0,d={spot:e,line:t??(l?ie(l):void 0),mark:n,generous:r,kind:n?.kind??(s?`note`:void 0),at:n?.at,...n?.kind===`connect`&&n.to?{to:n.to}:{},color:n?.color,inkedAt:Date.now(),...i?{delayMs:i}:{},...a?{badgeMs:a}:{},...o?{stepNumber:o}:{},...u?{toSpot:u}:{},...s?{noteText:s}:{}};return[...c,d]})},[]),io=e.teachMode||hc(Ee),ao=(0,U.useRef)(e.annotationsEnabled);ao.current=e.annotationsEnabled;let oo=(0,U.useRef)(J);oo.current=J;let so=(0,U.useRef)(null);so.current=Y.narration??null;let co=(0,U.useRef)(!1),lo=(0,U.useRef)(!1);lo.current=Y.busy;let uo=(0,U.useRef)(null),fo=(0,U.useRef)(Y.frames);fo.current=Y.frames;let po=(0,U.useRef)([]),mo=(0,U.useCallback)(()=>{let e=!ao.current;uo.current=null,qt({annotationsEnabled:e,teachMode:e}),e?(ja(po.current),po.current=[]):ja(e=>(po.current=e,[]))},[]),ho=(0,U.useRef)(null),go=(0,U.useCallback)((e,t)=>{let n=ia.current,r=n?.querySelector(`[data-spot-id="${CSS.escape(e)}"]`);if(!r)return;let i=t?n?.querySelector(`[data-spot-id="${CSS.escape(t)}"]`):null,a=ra.current;if(i&&a){let e=a.getBoundingClientRect(),t=r.getBoundingClientRect(),n=i.getBoundingClientRect(),o=(Math.min(t.top,n.top)+Math.max(t.top+t.height,n.top+n.height))/2-e.top-a.clientHeight/2;a.scrollTo({top:Math.max(0,a.scrollTop+o),behavior:`smooth`})}else r.scrollIntoView({behavior:`smooth`,block:`center`});let o=[r,i].filter(e=>!!e);o.forEach(e=>e.classList.add(`ink-jump-glow`)),ho.current!=null&&window.clearTimeout(ho.current),ho.current=window.setTimeout(()=>{o.forEach(e=>e.classList.remove(`ink-jump-glow`)),ho.current=null},800)},[]);(0,U.useEffect)(()=>()=>{ho.current!=null&&window.clearTimeout(ho.current)},[]);let _o=(0,U.useRef)(null),vo=(0,U.useCallback)((e,t)=>{Y.jumpTo(e),t&&(_o.current!=null&&cancelAnimationFrame(_o.current),_o.current=requestAnimationFrame(()=>{_o.current=null,go(t)}))},[Y,go]);(0,U.useEffect)(()=>()=>{_o.current!=null&&cancelAnimationFrame(_o.current)},[]);let yo=(0,U.useCallback)(e=>{Ja(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[bo,xo]=Wr(),[So,Co]=(0,U.useState)(0),wo=(0,U.useRef)(bo);wo.current!==bo&&(wo.current=bo,Co(e=>e+1));let To=(0,U.useCallback)(()=>{let e=uo.current;e&&(uo.current=null,ao.current=e.annotationsEnabled,qt(e))},[]),Eo=(0,U.useCallback)(()=>{if(ao.current)return;let{annotationsEnabled:e,teachMode:t}=Kt();uo.current??={annotationsEnabled:e,teachMode:t},ao.current=!0,qt({annotationsEnabled:!0,teachMode:!0})},[]),Do={isBusy:()=>Y.busy||ya.current,isSpeaking:()=>Ce(),hasCanvas:()=>!!Y.spec,showFrame:(e,t,n)=>{Oe(t),j(``),Y.showFrame(e,t,{interrupt:!1,revealNow:Mi.current,silent:n?.silent})},typeInto:j,speak:e=>(Hc(e),Vi(e)),cancelSpeech:Fe,setMuted:Re,setViewMode:xo,setInkArmed:pe,setPresenting:Dn,setShareOpen:Be,setPaletteOpen:e=>e?di():fi(),pressKeepGoing:e=>{let t=document.querySelectorAll(`.footer-keepgoing .kg-row`),n=Array.from(t).find(t=>t.textContent?.includes(e))??t[0];n&&(n.classList.add(`kg-tour-press`),window.setTimeout(()=>n.classList.remove(`kg-tour-press`),620))},pinFirstBlock:()=>{let e=no.current?.blocks.find(e=>!!e.id);e&&Ts(e)},pinFirstBlocks:e=>{let t=(no.current?.blocks??[]).filter(e=>!!e.id).slice(0,e);ce(t)},startWatchThinking:()=>{Rr(!0),zr.current=!0},bankThought:e=>{Br.current=[...Br.current,e],K.onTranscript(Br.current.join(` `))},openAtlas:()=>{if(cr().length<3){for(let e of[`money`,`space`,`travel`,`budget`]){let t=Jr(e),n=t?.frames[0]?.spec;t&&n&&dn(n,t.question)}nn(sr(fn()))}en(!0)},openPrism:e=>{na().then(t=>{jo.current.chapter?.action.kind===`prism`&&mn(t[e]??null)})},showcaseFeature:e=>{if(e===`library`&&fn().length<3)for(let e of[`money`,`space`,`travel`]){let t=Jr(e),n=t?.frames[0]?.spec;t&&n&&dn(n,t.question)}if(e===`deepzoom`){window.location.hash=`#/deepzoom?demo=1`;return}if(e===`synthesis`){window.location.hash=`#/synthesis?demo=1`;return}if(e===`living-answer`&&zi.current.length===0){a(async()=>{let{WORLD_SEED:e}=await import(`./seed-D_P5jyog.js`);return{WORLD_SEED:e}},[]).then(({WORLD_SEED:e})=>{Ii({type:`world`,id:`tour-world`,col:12,props:{title:e.title,world:e}}),Ri(!0),Bi.current(`tour-world`)});return}Oo.current[e]?.run()},setSpot:e=>Y.setSpot(e),scriptedMark:()=>oa.current(),drawPenTourStep:e=>{Eo(),e===`result`?(ra.current?.scrollTo({top:0,behavior:`smooth`}),ro(`live-1`,`After thirty years, the investment reaches seventy-six thousand one hundred twenty-three dollars.`,{kind:`circle`,at:`$76,123`,color:`key`},!1,void 0,5600,1)):ro(`live-1`,`Compounding grows the original investment by more than seven point six times.`,{kind:`underline`,at:`7.6x`,color:`warm`},!1,void 0,3e3,2)},drawPenOnFirstBlock:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e?.id&&(Eo(),ra.current?.scrollTo({top:0,behavior:`smooth`}),ro(e.id,e.note,void 0,!0,void 0,3200))},openDashboards:()=>{let e=aa();e?ot(e):Ke(!0)},dashboardShowSettings:()=>lt(!0),openModelSettings:()=>{si(`model`),ai(!0)},openExport:()=>He(!0),shareRemix:()=>{document.querySelector(`.shm-remix`)?.click()},sharePalette:e=>{Array.from(document.querySelectorAll(`.shm-chip`)).find(t=>t.textContent?.trim().toLowerCase()===e.toLowerCase())?.click()},exportSetFormat:e=>{document.querySelector(`[data-export-format="${e}"]`)?.click()},exportPickTemplate:e=>{document.querySelectorAll(`[data-export-template]`)[e]?.click()},toggleRail:()=>$r(e=>!e),bendIt:()=>ca.current(),openFlashcards:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e&&ta(e)},openTourCourse:()=>la.current(),fireMemoryGlow:()=>{ri(!0),window.setTimeout(()=>ri(!1),2600)},stopRevealWalk:()=>{ma.current=!0},closeAllOverlays:()=>{Y.setSpot(null),ce([]),j(``),xo(`everything`),pe(!1),ua.current(),ja([]),Na(new Set),Ja(new Set),Ka(!1),Dn(!1),Be(!1),fi(),xn(null),en(!1),on(null),mn(null),gn(null),wt(null),Qt(!1),He(!1),Ke(!1),ot(null),lt(!1),$r(!1),Vt(!1),Jt(!1),ai(!1),Rr(!1),gr(!1),ss(null),ls(0),ds(null)}},Oo=(0,U.useRef)({}),ko=xi({active:s.current,startChapter:l.current,solo:g.current,ops:Do}),Ao=Xi({active:!!O.current,personaId:O.current,startStep:k.current,ops:Do}),jo=(0,U.useRef)(ko);jo.current=ko,(0,U.useEffect)(()=>{if(!s.current)return;let e=e=>{let t=jo.current;if(e.key===`Escape`)t.skip();else if(tp(e))return;else e.key===`ArrowRight`?(e.preventDefault(),t.next()):e.key===`ArrowLeft`?(e.preventDefault(),t.prev()):(e.key===` `||e.key===`Spacebar`)&&(e.preventDefault(),t.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Po=(0,U.useRef)(Ao);Po.current=Ao,(0,U.useEffect)(()=>{if(!O.current)return;let e=e=>{let t=Po.current;if(e.key===`Escape`)t.skip();else if(tp(e))return;else e.key===`ArrowRight`?(e.preventDefault(),t.next()):e.key===`ArrowLeft`?(e.preventDefault(),t.prev()):(e.key===` `||e.key===`Spacebar`)&&(e.preventDefault(),t.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,U.useEffect)(()=>{(ko.done||Ao.done)&&To()},[ko.done,Ao.done,To]),(0,U.useEffect)(()=>()=>To(),[To]);let{narrate:Fo,narratingId:Io}=Ir({takeWheel:()=>{ma.current=!0},hush:Fe,moveSpot:e=>{Y.setSpot(e.id??null),ao.current&&ro(e.id,e.note??(e.id?Da.get(e.id):void 0)??void 0,e.id?Oa.get(e.id):void 0,!0)},canSpeak:()=>!Mi.current,lineFor:e=>e.noteSpoken??e.note??(e.id?Da.get(e.id):void 0)??ae(e),speakLine:Vi},Y.turn),[Ro,zo]=(0,U.useState)(!1),[Bo,Vo]=(0,U.useState)(!!Hi||!!r.current&&Lo()||!!i.current&&Lo()||s.current||!!O.current),Ho=yn();(0,U.useEffect)(()=>{nn(sr(Ho))},[Ho]),(0,U.useEffect)(()=>{let e=Y.spec;if(!e||va.current===Y.turn)return;if(va.current=Y.turn,Hi&&Y.turn===0){Y.spot&&Y.setSpot(null);return}if(s.current&&!Y.narration&&Y.tour.length===0){Y.spot&&Y.setSpot(null);return}let t=[];for(let n of Y.tour){let r=e.blocks[n.index]?.id;r&&t.push(n.say?{spot:r,say:n.say}:{spot:r})}let n=[];if(t.length?n=it(e.blocks,{opener:Y.narration,tour:t,maxStops:5}):rt({blockCount:e.blocks.length,mode:Y.mode,hasModelTour:!1,teach:io})&&(n=it(e.blocks,{opener:Y.narration,maxStops:io?e.blocks.length:3,startId:Y.spot??void 0})),!n.length){Y.spot&&Y.setSpot(null);return}let r=t.length>0,i=Mi.current&&r&&ao.current;Sa(i);let a=n.map(e=>({spot:e.set&&`spot`in e.set?e.set.spot??void 0:void 0,line:e.set&&`caption`in e.set?e.set.caption:void 0}));if(Mi.current){if(ao.current){let e=Ha({stops:a,spokenWalk:r,withNotes:i,teach:io,marksById:ka});for(let t of e)ro(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}Y.setSpot(null);return}ma.current=!1,ya.current=!0;let o=!1,c,l,u=0,d=null,f=()=>{d&&=(d(),null)},p=()=>{ya.current=!1,ba.current=null,l&&clearTimeout(l),Ea(!1),Hc(null)},m=()=>o?!0:ma.current?(p(),Y.setSpot(null),!0):!1,h=(e,t)=>{if(e!==void 0&&Y.setSpot(e??null),r&&t&&Hc(t),e&&ao.current){let n=ka.get(e);if(n?.length){let r=at+(n.length-1)*900,i=n.length>1;for(let a=0;a<n.length;a++){let o=a*900,s=a===n.length-1?r:void 0;ro(e,t,n[a],io,o,s,i?a+1:void 0)}}else io&&ro(e,t,void 0,io)}},g=e=>{let t=e&&!Mi.current&&!se()?_e(e):null;if(!t){b();return}d=t.release,Ga(t,{speakLine:Vi,isCancelled:()=>o,isDismissed:()=>ma.current},e=>{if(d=null,e===`dismissed`){p(),Y.setSpot(null);return}e!==`cancelled`&&b()})},_=e=>{let t=e.set&&`spot`in e.set?e.set.spot:void 0,n=e.set&&`caption`in e.set?e.set.caption:void 0;return(t?Da.get(t):void 0)??n},v=e=>{for(let t=e+1;t<n.length;t++){let e=_(n[t]);if(e){be(e,`mavea`);return}}},y=async(e,t,n,r,i)=>{let a=e.ms??1700;if(t===0||!i){if(h(n,r),v(t),await Je({floorMs:tt,capMs:et(a)}),m())return;g(n);return}let o=Vi(i),s=await nt(o);m()||(h(n,r),v(t),s?await Xe(o,a):await Qe(a),!m()&&g(n))},b=()=>{if(o||u>=n.length){p();return}if(ma.current){p(),Y.setSpot(null);return}let e=u,t=n[u++],i=t.set&&`caption`in t.set?t.set.caption:void 0,a=t.set&&`spot`in t.set?t.set.spot:void 0,s=_(t);r?y(t,e,a,i,s):(h(a,i),c=setTimeout(b,t.ms??0))};return ba.current=()=>{if(o=!0,c&&clearTimeout(c),f(),Fe(),ao.current){let e=Ha({stops:a,from:u,spokenWalk:r,withNotes:!1,teach:io,marksById:ka});for(let t of e)ro(t.spot,t.line,t.mark,t.generous,t.delayMs,t.badgeMs,t.stepNumber,t.noteText)}p(),Y.setSpot(null)},(async()=>{l=setTimeout(()=>{o||Ea(!0)},600);let t=ra.current;await qe({loadFams:()=>B(re(e.blocks)),settle:t?()=>pt(t,{timeoutMs:$e,perImageMs:Ze}):void 0,firstLine:Ni.current,wantVoice:!Mi.current&&Me()!==!1}),l&&clearTimeout(l),Ea(!1),!m()&&b()})(),()=>{o=!0,ba.current=null,ya.current=!1,c&&clearTimeout(c),l&&clearTimeout(l),Ea(!1),f()}},[Y.turn]),(0,U.useEffect)(()=>{let e=Y.spot,t=Y.spec;if(!t||!e)return;let n=0,r=0,i=()=>{let a=ra.current;if(!a)return;let o=a.querySelector(`.spotlit`);if(!o){++n<12&&(r=window.setTimeout(i,90));return}let s=a.getBoundingClientRect(),c=o.getBoundingClientRect(),l=c.top-s.top-(a.clientHeight-c.height)/2,u=ka.get(e)?.find(e=>e.kind===`connect`),d=u&&typeof u.onIndex==`number`?t.blocks[u.onIndex]?.id:void 0,f=d?a.querySelector(`[data-spot-id="${CSS.escape(d)}"]`):null;if(f){let e=f.getBoundingClientRect(),t=(Math.min(c.top,e.top)+Math.max(c.top+c.height,e.top+e.height))/2-s.top-a.clientHeight/2,n=a.clientHeight*.35;l=Math.max(l-n,Math.min(l+n,t))}a.scrollTo({top:Math.max(0,a.scrollTop+l),behavior:`smooth`})};return r=window.setTimeout(i,90),()=>window.clearTimeout(r)},[Y.spot,Y.spec,ka]);let Uo=(0,U.useCallback)(()=>{Y.spot&&(ma.current=!0,Y.setSpot(null))},[Y]),Wo=(0,U.useCallback)(()=>{let e=ba.current;e?e():(Fe(),Uo())},[Uo]),[Go,Ko]=(0,U.useState)(!1),[qo,Jo]=(0,U.useState)(!1),Yo=(0,U.useCallback)(async(...e)=>{(0,Dr.flushSync)(()=>Ko(!0)),Jo(!0);try{await B(re(e[0].blocks))}catch{}finally{Jo(!1)}Y.restore(...e)},[Y]);(0,U.useEffect)(()=>{Y.busy&&Ko(!0)},[Y.busy]),(0,U.useEffect)(()=>{Ko(!1)},[Y.turn]),(0,U.useEffect)(()=>{if(!Y.spot)return;let e=e=>{e.key===`Escape`&&Wo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Y.spot,Wo]);let[Xo,Zo]=(0,U.useState)(null);(0,U.useEffect)(()=>Zo(null),[Y.turn]),(0,U.useEffect)(()=>mi(!1),[Y.turn]),(0,U.useEffect)(()=>ce([]),[Y.turn]),(0,U.useEffect)(()=>Zr(!1),[Y.turn]);let[Qo,$o]=(0,U.useState)(null),es=(0,U.useRef)(!1),ts=(0,U.useCallback)(e=>{es.current=!0,$o(e)},[]);(0,U.useEffect)(()=>{if(es.current){es.current=!1;return}$o(null)},[Y.turn]);let ns=(()=>{let e=Y.spec?.blocks.find(e=>e.type===`insight`);return e&&e.type===`insight`?e.props.conf:void 0})(),rs=Zc({resetKey:Y.turn,onCommit:e=>{let{intents:t,blocks:n}=nl(e,(Y.viewSpec??Y.spec)?.blocks??[]);if(!t.length)return;let r=tl([...V,...n]);ce([]),Y.run(el(t),void 0,r.length?r:void 0,void 0,t)}});oa.current=()=>{let e=ia.current,t=e?.querySelector(`[data-spot-id]`);!e||!t||(t.scrollIntoView({block:`center`,behavior:`smooth`}),window.setTimeout(()=>is(e,t),560))};let is=(e,t)=>{let n=e.querySelector(`.ink-user-overlay`);if(!n)return;let r=(Array.from(t.querySelectorAll(`*`)).filter(e=>e.children.length===0&&e.offsetHeight>0&&/\d/.test(e.textContent??``)).sort((e,t)=>parseFloat(getComputedStyle(t).fontSize)-parseFloat(getComputedStyle(e).fontSize))[0]??t).getBoundingClientRect(),i=n.getBoundingClientRect(),a=Ff(r,i);rs.onStroke(a,{stage:e,svgRect:i});let o=t.getAttribute(`data-spot-id`);o&&Y.setSpot(o)};ua.current=()=>rs.clear();let as=(0,U.useCallback)((t,n=!1)=>{let r=t.trim();if(zr.current&&r){j(``),q.current!==null&&(window.clearTimeout(q.current),q.current=null),Br.current=[...Br.current,r],K.onTranscript(Br.current.join(` `));return}if(r&&(/^diff --git /m.test(r)||/^@@ .* @@/m.test(r))){let t=ur(dr(r));if(t.changes.length>0){j(``),xn(t);let n=Gt(e);n&&fr(t,r,n).then(e=>xn(t=>t&&e));return}}if(!r&&M.length===0&&rs.intents.length===0)return;Te(null),Oe(r||null),j(``);let i=M;te(i.length>0),N([]),L(null);let a=Y.viewSpec??Y.spec,{intents:o,blocks:s}=nl(rs.intents,a?.blocks??[]),c=tl([...V,...s]);ce([]),rs.clear(),Y.run(r||el(o),i.length?i:void 0,c.length?c:void 0,void 0,o.length?o:void 0,void 0,void 0,n?{force:!0}:void 0)},[Y,M,V,rs,K,e,Te,N,L,te]);(0,U.useEffect)(()=>{if(r.current&&Lo()){let e=r.current;r.current=``,as(e)}},[]);let[os,ss]=(0,U.useState)(null),[cs,ls]=(0,U.useState)(0),[us,ds]=(0,U.useState)(null),fs=(0,U.useRef)(null),ps=(0,U.useCallback)((e,t)=>{let n=e.lessons[t];if(!n)return;let r=_r(e.id);ss(e),ls(t),ds(r),hr(e.id,t),Vo(!0);let i=`Lesson ${t+1}: ${n.title}`,a=pr(e.id,n.id);if(a){Oe(i),Y.showFrame(a,i);return}let o=Cr(e,t,r,Tr(e.topic));fs.current={courseId:e.id,lessonId:n.id,framesBefore:Y.frames.length},Oe(i),Y.run(`Teach this lesson: "${n.title}" — ${n.goal}`,void 0,void 0,void 0,void 0,i,void 0,{lesson:o})},[Y]);la.current=()=>{let e=Wl();if(!e)return;let t=e.lessons[0];ss(e),ls(0),ds(_r(e.id)),hr(e.id,0),Vo(!0);let n=pr(e.id,t.id);if(n){let e=`Lesson 1: ${t.title}`;Oe(e),Y.showFrame({...n,narration:``,tour:[]},e,{interrupt:!1})}},(0,U.useEffect)(()=>{let e=i.current;if(!e||(i.current=void 0,!Lo()))return;let t=vr(e.courseId);if(!t)return;let n=Math.min(Math.max(e.lessonIdx,0),t.lessons.length-1);ps(t,n)},[]),(0,U.useEffect)(()=>{let e=fs.current;!e||Y.busy||(fs.current=null,!(Y.frames.length<=e.framesBefore)&&br(e.courseId,e.lessonId,Y.frames[Y.frames.length-1]))},[Y.frames,Y.busy]);let ms=(0,U.useCallback)(e=>{if(!os)return;let t=os.lessons[cs];t&&(yr(os.id,t.id,e),ds(_r(os.id)))},[os,cs]);(0,U.useEffect)(()=>{if(typeof window>`u`||!os)return;let e=()=>ds(_r(os.id));return window.addEventListener(xr,e),()=>window.removeEventListener(xr,e)},[os]);let[hs,gs]=(0,U.useState)(null);(0,U.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{let t=e.detail;t?.missedCards.length&&gs(t)};return window.addEventListener(Er,e),()=>window.removeEventListener(Er,e)},[]);let _s=(0,U.useCallback)(e=>{let t=e.missedCards.flatMap(t=>nr([t],{deck:e.courseTitle,tags:[e.lessonTitle,`checkpoint`],source:{question:t.front,topic:e.topic,ts:e.at},origin:`auto`}));gs(null),Qi(t)},[Qi]),vs=(0,U.useMemo)(()=>new Set(V.map(e=>e.id)),[V]),Cs=(0,U.useCallback)((e,t)=>{Oe(`Correction: ${t}`),Y.run(`Correction — you understood "${e}", but it's actually "${t}". Keep the rest of your understanding and update the answer wherever this changes it.`,void 0,void 0,void 0,void 0,`Correction: ${t}`)},[Y]),ws=(0,U.useCallback)(e=>{let t=e.map(ie),n=e.length===2?`Fuse these two: what is the real relationship between "${t[0]}" and "${t[1]}"? Lead with the single most useful connection, and be explicit about correlation versus cause.`:`Fuse these ${e.length}: what are the most important connections and patterns across ${t.map(e=>`"${e}"`).join(`, `)}? Lead with the strongest insight, then note any correlations, trade-offs, or cause-and-effect you can support from the data.`;Oe(`Fuse: ${t.join(` × `)}`),ce([]),Y.run(n,void 0,e,void 0,void 0,`Fuse: ${t.join(` × `)}`)},[Y]),Ts=(0,U.useCallback)(e=>{e.id&&(ce(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e]),gi(e=>e+1),he())},[he]),Ds=V.length>1?[`How do these relate?`,`Compare them`,`Summarize these`]:[`Explain this`,`Why it matters`,`Go deeper`],ks=Ht(e.provider).capabilities.vision;(0,U.useEffect)(()=>{let e=e=>{if(Qd(e.target))return;let t=e.clipboardData;if(!t)return;let n=[...t.files].filter(e=>e.type.startsWith(`image/`));if(n.length){e.preventDefault(),ne(n),j(Zd),gi(e=>e+1);return}let r=t.getData(`text/plain`);r&&Yd(r)&&(e.preventDefault(),j(Xd(Jd(r))),gi(e=>e+1))},t=null,n=e=>{e.dataTransfer?.types.some(e=>e===`Files`||e===`text/uri-list`)&&(e.preventDefault(),bi(!0),t&&clearTimeout(t),t=setTimeout(()=>bi(!1),200))},r=e=>{bi(!1);let t=e.dataTransfer;if(!t)return;if(Qd(e.target)){t.files.length&&e.preventDefault();return}let n=[...t.files],r=n.filter(e=>e.type.startsWith(`image/`)),i=n.filter(e=>!e.type.startsWith(`image/`)),a=n.length?null:Jd(t.getData(`text/uri-list`)||t.getData(`text/plain`)||``);!n.length&&!a||(e.preventDefault(),r.length?(ne(r),j(Zd)):i.length?ne(i):a&&j(Xd(a)),gi(e=>e+1))};return window.addEventListener(`paste`,e),window.addEventListener(`dragover`,n),window.addEventListener(`drop`,r),()=>{window.removeEventListener(`paste`,e),window.removeEventListener(`dragover`,n),window.removeEventListener(`drop`,r),t&&clearTimeout(t)}},[ne]);let As=(0,U.useRef)(bo);As.current=bo,(0,U.useEffect)(()=>{if(!En)return;let e=As.current;xo(`focus`),document.documentElement.requestFullscreen?.().catch(()=>{});let t=e=>{e.key===`Escape`&&Dn(!1)};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t),xo(e),document.fullscreenElement&&document.exitFullscreen().catch(()=>{})}},[En,xo]);let js=(0,U.useRef)(0);(0,U.useEffect)(()=>{let e=Y.frames.length;if(e>js.current&&On.current){let t=e-1;Fn(e=>new Set(e).add(t))}js.current=e},[Y.frames.length]);let X=ha({mode:`vad`,onBargeIn:()=>{Wo(),co.current=!0},onResult:e=>{let t=e.transcript.trim(),n=co.current;if(e.lowConfidence&&t){co.current=!1,Te(null),j(t),Ne(Qf),gi(e=>e+1),Ur.current&&zr.current&&(Ur.current=!1,Ai.current?.stop(),Br.current.length>0?qr():(zr.current=!1,Rr(!1)));return}if(co.current){co.current=!1;let e=so.current;if(!t||Yp(t)){e&&Vi(e);return}}if(t){if(Te(t),zr.current){Br.current=[...Br.current,t],Te(null);let e=Br.current.join(` `);K.onTranscript(e),Ur.current&&(Ur.current=!1,qr());return}if(Or.current){if(Te(null),Ud(t)){gr(!1);let e=kr.current;if(kr.current=[],Pr(0),e.length){let t=Math.round((Date.now()-Fr.current)/6e4);Oe(`Your thinking, sorted`),Y.run(Kd(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}}else Gd(t)&&(kr.current=[...kr.current,t],Pr(e=>e+1));return}if(jr({phase:qi.current,activeKey:Ji.current,blanks:Yi.current,fill:Y.fill},t)){Te(null);return}as(t,n||lo.current)}},onStateChange:e=>{if(Kr.current=e.phase,xe(e.phase),ge(e.phase===`listening`),e.phase===`idle`&&(co.current=!1),e.phase===`listening`)Ne(null),e.transcript&&Ua(e.transcript),q.current!==null&&(window.clearTimeout(q.current),q.current=null);else if(e.phase===`idle`&&zr.current&&Vr.current.phase===`listening`){if(Ur.current){Ur.current=!1,qr();return}q.current!==null&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>{q.current=null,Ai.current?.stop(),qr()},$f)}e.error===`not-allowed`?Ne(Lf):e.error===`unsupported`?Ne(If):e.error===`audio`?Ne(Rf):e.error===`transcription`&&Ne(zf)}}),Z=X.capabilities.stt;Ai.current=X;let Ms=(0,U.useCallback)(()=>{if(zr.current){if(q.current!==null&&(window.clearTimeout(q.current),q.current=null),H||Kr.current===`transcribing`){Ur.current=!0,H&&X.start({inCanvas:!!Y.spec,continuous:!1}),X.forceStop();return}if(X.stop(),Br.current.length===0){zr.current=!1,Rr(!1);return}qr()}},[H,qr,X,Y.spec]),Ns=(0,U.useCallback)(()=>{H&&X.stop(),q.current!==null&&(window.clearTimeout(q.current),q.current=null),Te(null),Ur.current=!1,Rr(!1)},[H,X]),Ps=En||Pf({paletteOpen:ui,shareOpen:ze,exportOpen:Ve,dashOpen:We,showSettings:ii,proofOpen:pi,showHow:Ro,replayAt:Xo,recapOpen:Ut,atlasOpen:$t,delegateOpen:Yt,srsOpen:Bt,zoomLevel:In,mindViewOpen:Sn.open});(0,U.useEffect)(()=>{if(!G||K.phase===`idle`||Ps)return;let e=e=>{e.key===`Escape`&&Ns()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[G,K.phase,Ps,Ns]),(0,U.useEffect)(()=>{let e=document.documentElement;return Yr?e.dataset.whisper=``:delete e.dataset.whisper,Ie(Yr?Cn:1),()=>{delete e.dataset.whisper,Ie(1)}},[Yr]),(0,U.useEffect)(()=>{mr?Fr.current=Date.now():(kr.current=[],Pr(0))},[mr]),(0,U.useEffect)(()=>{if(G&&H&&Se){let e=Vu(Se),t=Br.current.length>0?[...Br.current,e].join(` `).trim():e;t&&K.onTranscript(t)}},[Se,H,G]),(0,U.useEffect)(()=>{G||(Br.current=[],K.reset(),q.current!==null&&(window.clearTimeout(q.current),q.current=null))},[G]),(0,U.useEffect)(()=>()=>{q.current!==null&&window.clearTimeout(q.current)},[]),(0,U.useEffect)(()=>{let e=()=>X.setMaveaSpeaking(Ce()&&!Mi.current);return e(),ke(e)},[X]);let Fs=A.trim().length>0;(0,U.useEffect)(()=>{if(!Mr({alwaysOn:J&&!Ci,sttOk:Z,composerHasText:Fs}))return;let e=!1,t=setTimeout(()=>{e||X.start({inCanvas:!!Y.spec,continuous:!0})},100);return()=>{e=!0,clearTimeout(t),X.stop()}},[J,Ci,Z,X,Fs]),Nr({alwaysOn:J&&!Ci,sttOk:Z,composerHasText:Fs,listening:H},{start:()=>X.start({inCanvas:!!Y.spec,continuous:!0}),stop:X.stop});let Is=(0,U.useCallback)(()=>{if(!Z){Ne(If),gi(e=>e+1);return}J?H?X.forceStop():Ci?(wi(!1),Wo(),X.start({inCanvas:!!Y.spec,continuous:!0})):Kr.current===`transcribing`?(wi(!0),X.forceStop()):(wi(!0),X.stop()):H?X.forceStop():(Wo(),X.start({inCanvas:!!Y.spec}))},[Z,J,Ci,H,X,Y.spec,Wo]),[Rs,zs]=(0,U.useState)(!1),Vs=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=()=>{Vs.current!==null&&(window.clearTimeout(Vs.current),Vs.current=null)};if(Y.status===`thinking`){zs(!0),e();return}if(Y.status===`idle`){zs(!1),e();return}if(Rs&&Y.spec){zs(!1),e();return}Rs&&Vs.current===null&&(Vs.current=window.setTimeout(()=>{zs(!1),Vs.current=null},1100))},[Y.status,Y.spec,Rs]),(0,U.useEffect)(()=>()=>{Vs.current!==null&&window.clearTimeout(Vs.current)},[]);let Us=Ia({speak:Vi,cancelSpeak:Fe,isSpeaking:Ce,muted:Le,turnCount:Y.frames.length,gates:{atRest:Y.status===`showing`||Y.status===`idle`,busy:Y.busy,listening:H,introHold:Rs,hasCanvas:!!Y.spec,modalOpen:ui||ze||Ve||We||ii||pi||Ro||Xo!==null||Ut||Yt||Bt||$t||an!==null||hn!==null||Sn.open||In!==null}}),Gs=Us.interjecting,Ks=(0,U.useRef)(null),qs=(0,U.useMemo)(()=>{let e=Ca(Y.spec);return e===`warm`&&wa(Y.spec)&&(Ks.current===null||Ks.current===Y.spec)&&(Ks.current=Y.spec,e=`celebrate`),_a(Y.status,H,Gs,e,Le)},[Y.status,H,Gs,Y.spec,Le]),Ys=(0,U.useMemo)(()=>Es({status:Y.status,listening:H,interjecting:Gs,spec:Y.viewSpec??Y.spec}),[Y.status,H,Gs,Y.viewSpec,Y.spec]);(0,U.useEffect)(()=>(xs(document,Ys),()=>Ss(document)),[Ys]);let Xs=(0,U.useCallback)(()=>{let e=da.current,t=fa.current,n=pa.current;if(!e||!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();!r.width||!i.width||(e.style.setProperty(`--home-x`,`${Math.round(r.left+r.width/2-(i.left+i.width/2))}px`),e.style.setProperty(`--home-y`,`${Math.round(r.top+r.height/2-(i.top+i.height/2))}px`),e.style.setProperty(`--home-scale`,(Math.max(r.width,12)*1.3/150).toFixed(3)))},[]);(0,U.useLayoutEffect)(()=>(Xs(),window.addEventListener(`resize`,Xs),()=>window.removeEventListener(`resize`,Xs)),[Xs]),(0,U.useLayoutEffect)(()=>{Xs()},[Qr,Xs]);let Zs=!!Y.spec&&!(Rs||Gs),Qs=Bo,ec=Bo&&(!Y.spec||Rs||Gs),tc=!Y.spec&&!Bo;(0,U.useEffect)(()=>{if(!e.morningBrief||Rt||tc||Y.busy||Y.restored||!hl(St()))return;gl(),zt(!0);let t=Y.frames.slice(-3).map(e=>e.question).filter(Boolean);Y.run(_l(t),void 0,void 0,void 0,void 0,`Morning brief`)},[e.morningBrief,tc,Rt,Y.busy,Y.restored]),(0,U.useEffect)(()=>{Zs&&da.current&&(da.current.style.setProperty(`--scroll-dock`,`0`),Xs())},[Zs,Xs]);let nc=Gs?Us.line:Y.narration,rc=!Zs&&!!nc&&(Gs||Y.status===`speaking`||Y.status===`showing`),cc=ec&&Y.status===`speaking`,lc=(0,U.useRef)(new Map),[uc,dc]=(0,U.useState)(0);(0,U.useEffect)(()=>{let e=lc.current,t=new Set(Y.frames.map(e=>e.at)),n=!1;for(let r of[...e.keys()])t.has(r)||(e.delete(r),n=!0);let r=Y.frames.filter(t=>!e.has(t.at)),i=!1;return(async()=>{for(let t of r){let r=await cn(`${t.question} ${t.narration} ${t.spec?.title??``}`.trim());if(i)return;r&&(e.set(t.at,r),n=!0)}n&&dc(e=>e+1)})(),()=>{i=!0}},[Y.frames]);let mc=(0,U.useMemo)(()=>Tt(Y.frames,Y.frames.map(e=>lc.current.get(e.at)??null)),[Y.frames,uc]),gc=Y.frames.length-1,_c=Y.viewIndex??gc,vc=Y.viewOverride!=null,yc=!vc&&(Y.viewIndex==null||Y.viewIndex===gc),bc=Y.viewOverride?mc.find(e=>Y.viewOverride?.id===`thread-`+e.id):void 0,xc=mc.find(e=>e.moments.some(e=>e.frameIndex===_c)),Sc=mc.length>=2?xc?.color:void 0,Cc=Y.frames[gc],wc=mc[mc.length-1],Tc=mc.length>=2&&wc?.moments.length===1&&wc.moments[0].frameIndex===gc,Ec=yc&&!Y.busy&&Tc&&Cc?.mode===`replace`&&!!Cc&&lc.current.has(Cc.at),[Dc,Oc]=(0,U.useState)(null),kc=(0,U.useRef)(-1);(0,U.useEffect)(()=>{Ec&&kc.current!==gc&&(kc.current=gc,Oc(gc))},[Ec,gc]);let jc=(0,U.useCallback)(e=>{let t=Ba(e.moments.map(e=>Y.frames[e.frameIndex]).filter(e=>!!e),{title:e.title,tint:e.color,id:`thread-`+e.id});t&&(Y.previewSpec(t),ra.current?.scrollTo({top:0}))},[Y]),Mc=yc&&V.length===0?(Y.viewSpec??Y.spec)?.suggests??[]:[],Nc=Y.viewSpec??Y.spec,Pc=vc?Nc?{question:null,narration:Nc.title||`This thread`}:null:ac({spec:Nc,frames:Y.frames,viewIndex:Y.viewIndex,narration:Y.narration,lastAsk:Ee}),Fc=(0,U.useMemo)(()=>Bs(Nc),[Nc]),Ic=sc(oc(Y.status)),Lc=(0,U.useMemo)(()=>Y.busy?Y.status===`showing`?[Nf(Y.pendingShape)]:Mf(Ee??``,Y.history):[],[Y.busy,Y.status,Y.pendingShape,Ee,Y.history]),Rc=gf(),zc=Tf(),Bc=(0,U.useSyncExternalStore)(ru,iu,iu),[Vc,Hc]=(0,U.useState)(null);(0,U.useEffect)(()=>Hc(null),[Y.turn]),(0,U.useEffect)(()=>Sa(!1),[Y.turn]);let Uc=Rc&&!Le,[Wc,Gc]=(0,U.useState)(!1);(0,U.useEffect)(()=>{if(Uc){Gc(!0);return}let e=window.setTimeout(()=>Gc(!1),600);return()=>window.clearTimeout(e)},[Uc]),(0,U.useEffect)(()=>{Le&&ba.current?.()},[Le]);let[Kc,qc]=(0,U.useState)(!1);(0,U.useEffect)(()=>qc(!1),[Y.turn]),(0,U.useEffect)(()=>Jt(!1),[Y.turn]);let Jc=(0,U.useMemo)(()=>sf(Y.frames,mc),[Y.frames,mc]),Yc=Hn(),Xc=Un(),Qc=(0,U.useCallback)(e=>{if(s.current){jo.current.playExtra(e);return}Y.busy||d(e)},[Y.busy]),$c=(0,U.useCallback)(e=>{if(!Z){Ne(If);return}Wo(),Ti.current===null&&(Ti.current={enabled:J,paused:Ci}),wi(!1),Si(!0),e===`think`?(gr(!1),Or.current=!1,Rr(!0),zr.current=!0):(Rr(!1),zr.current=!1,gr(!0),Or.current=!0)},[Z,J,Ci,Wo]);(0,U.useEffect)(()=>{if(G||mr)return;let e=Ti.current;e!==null&&(Ti.current=null,wi(e.paused),Si(e.enabled),e.enabled&&!e.paused&&Z&&!A.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):X.stop())},[G,mr,Z,A,X,Y.spec]);let[rl,il]=(0,U.useState)(null),[al,cl]=(0,U.useState)(!1),[ll,ul]=(0,U.useState)(0),dl=(0,U.useMemo)(()=>{let e=((Y.viewSpec??Y.spec)?.blocks??[]).filter(e=>e.type===`world`);return e.length>0?e:Fi?[Fi]:[]},[Y.viewSpec,Y.spec,Fi]),fl=(0,U.useMemo)(()=>dl.find(e=>e.id===rl)??dl[0],[dl,rl]);zi.current=dl;let pl=fl!==void 0,ml=bo===`world`&&pl,vl=(0,U.useCallback)(e=>{e&&il(e),cl(!1),xo(`world`)},[xo]);Bi.current=vl;let yl=(0,U.useCallback)(()=>xo(Hr()),[xo]);(0,U.useEffect)(()=>fe(vl),[vl]),(0,U.useEffect)(()=>{bo===`world`&&!pl&&yl()},[bo,pl,yl]);let bl=ml?fl.id??null:null,Sl=ml&&fl.props.world===void 0,{generateWorld:Cl}=Y;(0,U.useEffect)(()=>{if(!bl||!Sl)return;let e=!0;return cl(!1),Cl(bl).then(t=>{e&&!t&&cl(!0)}),()=>{e=!1}},[bl,Sl,ll,Cl]);let{expandWorld:wl}=Y,Tl=(0,U.useCallback)((e,t)=>bl?wl(bl,e,t):Promise.resolve(null),[bl,wl]),Q={atlas:{available:tn>0,reason:`Fills in as you discuss things`,run:()=>en(!0),preload:mp.preload},"pdf-world":{available:M.some(At),reason:`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map`,run:()=>{let e=M.filter(At);if(e.length>0){vn(e);return}gi(e=>e+1),vi(e=>e+1),L(`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map of claims.`)},preload:Np.preload},synthesis:{available:!0,run:()=>{let e=M.filter(At);e.length>=2?gn(e):window.location.hash=`#/synthesis`},preload:()=>M.filter(At).length>=2?Lp.preload():Jp(`#/synthesis`)},ripple:{available:!0,run:()=>xn(lr),preload:gp.preload},review:{available:!0,run:()=>Vt(!0),preload:Up.preload},flashcards:{available:!0,run:()=>{window.location.hash=`#/flashcards`},preload:()=>Jp(`#/flashcards`)},courses:{available:!0,run:()=>{window.location.hash=`#/courses`},preload:()=>Jp(`#/courses`)},dashboards:{available:!0,run:()=>{window.location.hash=`#/dashboards`},preload:()=>Jp(`#/dashboards`)},gallery:{available:!0,run:()=>{window.location.hash=`#/gallery`},preload:()=>Jp(`#/gallery`)},recap:{available:!!Jc,reason:`Once we've covered something`,run:()=>Jt(!0),preload:xp.preload},present:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Dn(!0),preload:zp.preload},track:{available:!!Y.spec,reason:`Once there is a conversation to track`,run:()=>Ke(!0),preload:Ap.preload},share:{available:Y.frames.length>0,reason:`Once there is something to share`,run:()=>Be(!0),preload:Ep.preload},export:{available:Y.frames.length>0,reason:`Once there is an answer to export`,run:()=>He(!0),preload:Op.preload},focus:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>xo(`focus`)},board:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>xo(`canvas`)},"living-answer":{available:pl,reason:`Once an answer has causes to trace`,run:()=>vl(),preload:Fp.preload},ink:{available:!!Y.spec,reason:`Once there is an answer to mark`,run:()=>pe(!0)},blanks:{available:!0,run:()=>Ne(`When a number in an answer is truly yours to give, Mavéa leaves a glowing hole for it — type, say, or drop a card in, and it finishes the answer around your value.`)},"watch-me-think":{available:Z,reason:Z?void 0:If,run:()=>$c(`think`)},"just-listen":{available:Z,reason:Z?void 0:If,run:()=>$c(`listen`)},whisper:{available:!0,run:()=>{si(`you`),li(!0),ai(!0)},preload:sp.preload},ghost:{available:Z&&e.quality!==`fast`,reason:Z?e.quality===`fast`?`Needs Balanced quality or higher — you're on Fast`:void 0:If,run:()=>$c(`listen`)},delegate:{available:!0,run:()=>Qt(!0),preload:Vp.preload},memory:{available:!0,run:()=>{si(`you`),ai(!0)},preload:sp.preload},library:{available:Ho.length>0,reason:`Fills in as you save conversations`,run:()=>ti(!0),preload:Cp.preload},deepzoom:{available:!0,run:()=>{let e=Ee??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},preload:()=>Jp(`#/deepzoom`)},"zoom-deck":{available:!!Jc,reason:`Opens once there are a few answers to pull back from`,run:()=>Ln(`chapters`),preload:fp.preload},"morning-brief":{available:!0,run:()=>{si(`you`),li(!0),ai(!0)},preload:sp.preload},settings:{available:!0,run:()=>{si(void 0),ai(!0)},preload:sp.preload},how:{available:!0,run:()=>zo(!0),preload:np.preload}};Oo.current=Q;let Dl=mt.filter(e=>e.surface!==`demo`).map(e=>{let t=Q[e.id]??{available:!0,run:()=>void 0},n=e.id===`how`?Ki:e.tourChapter?()=>Qc(e.tourChapter):void 0;return{feature:e,available:t.available,reason:t.reason,run:t.run,preload:t.preload,watch:n}}),Ol=[{label:`New`,blurb:`Start a fresh session`,onClick:()=>{Y.reset(),Us.reset(),Vo(!1),te(!1),xt()},show:!!Y.spec},{label:`Dashboard`,blurb:`Open your living dashboards`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!!Y.spec}],kl=[{label:`Rehearse`,blurb:`Practice a hard conversation — take the seat, or send your Mavéa`,onClick:Q.delegate.run,preload:Q.delegate.preload,show:!0},{label:`Study`,blurb:Yc>0?`${Yc} card${Yc===1?``:`s`} ready`:Xc===`spaced`?`Go through what you have saved`:`Flip through your cards`,onClick:Q.review.run,preload:Q.review.preload,show:!0},{label:`Manage flashcards`,blurb:`See, organize, and edit your study deck`,onClick:Q.flashcards.run,preload:Q.flashcards.preload,show:!0},{label:`Courses`,blurb:`Turn a topic into a structured syllabus — a lesson at a time, at your pace`,onClick:Q.courses.run,preload:Q.courses.preload,show:!0},{label:`Recap`,blurb:`What we covered — the session so far`,onClick:Q.recap.run,preload:Q.recap.preload,show:!!Jc}],Al=[{label:`Present`,blurb:`Fill the room — the chrome falls away, the mic stays live`,onClick:Q.present.run,preload:Q.present.preload,show:!!Y.spec},{label:`Export`,blurb:`Choose a template and export a polished PDF`,onClick:Q.export.run,preload:Q.export.preload,show:Y.frames.length>0},{label:`Video`,blurb:`Share a moment, a topic, or the whole conversation`,onClick:Q.share.run,preload:Q.share.preload,show:Y.frames.length>0}],jl=[{label:`Search all features`,blurb:`Browse Mavéa’s feature index · ${v}`,onClick:di,preload:ip.preload,show:!0},{label:`Atlas`,blurb:`Kept conversations and topics, as a place`,onClick:Q.atlas.run,preload:Q.atlas.preload,show:tn>0},{label:`Watch me think`,blurb:`A live map of your thinking`,onClick:Q[`watch-me-think`].run,show:Q[`watch-me-think`].available},{label:`Prism`,blurb:Q[`pdf-world`].available?`Split your document into a map of its claims`:`Attach a PDF, Office doc, or data file — then split it into claims`,onClick:Q[`pdf-world`].run,preload:Q[`pdf-world`].preload,show:!0},{label:`Ripple`,blurb:`Model a code change’s impact, risks, and a proposed ship order`,onClick:Q.ripple.run,preload:Q.ripple.preload,show:!0},{label:`Dashboards`,blurb:rn>0?`${rn} dashboard${rn===1?``:`s`} set to refresh while Mavéa is open`:`Create a dashboard that refreshes on schedule while Mavéa is open`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!0},{label:`Deep Zoom`,blurb:Ee?`Zoom from field to mechanism — "${Ee.slice(0,50)}${Ee.length>50?`…`:``}"`:`Telescope any topic from big picture to finest detail`,onClick:()=>{let e=Ee??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},show:!0}],Ml=(0,U.useCallback)(e=>{e===`out`&&Jc&&Ln(`chapters`)},[Jc]);ar(ra,Ml),(0,U.useEffect)(()=>(Pe(uu),()=>Pe(null)),[]);let Nl=(0,U.useRef)(!0);(0,U.useEffect)(()=>{Y.busy&&(ou(),Nl.current=!1,zn(null),Jn())},[Y.busy,Y.turn,Jn]),(0,U.useEffect)(()=>(cu(Xo!==null),()=>cu(!1)),[Xo]),(0,U.useEffect)(()=>Jn(),[Y.viewIndex,Jn]);let Pl=Y.spec?.blocks.length??0;(0,U.useEffect)(()=>{Pl>0&&lu(Pl)},[Pl]),(0,U.useEffect)(()=>{if(Y.busy)return;if(Y.spec){let e=du();if(e){zn(e);let t=Y.frames.length-1,n=Y.frames[t];n&&Xn.set(Ge(n),e)}}if(Rc||Nl.current)return;let e=window.setTimeout(()=>{Nl.current=!0,su()},ep);return()=>window.clearTimeout(e)},[Rc,Y.busy,Y.spec,Bc,Y.frames,Xn]);let Fl=(0,U.useMemo)(()=>yc?Rn:Y.viewIndex!=null&&Y.frames[Y.viewIndex]?Xn.get(Ge(Y.frames[Y.viewIndex])):null,[yc,Rn,Y.viewIndex,Y.frames,Xn]),Ll=(0,U.useMemo)(()=>{if(!Wn||Bn===null||!Fl)return null;let e=yc?Y.spec:Y.viewSpec;if(!e)return null;let t=yc?Y.tour:Y.viewIndex==null?[]:Y.frames[Y.viewIndex]?.tour??[],n=hu(Fl,Bn,t,e.blocks.length);return{...e,blocks:e.blocks.slice(0,n)}},[Wn,Bn,Fl,yc,Y.spec,Y.viewSpec,Y.tour,Y.viewIndex,Y.frames]),Rl=Y.error?(0,W.jsxs)(`div`,{className:`live-error`,role:`alert`,children:[(0,W.jsxs)(`div`,{className:`live-error-head`,children:[(0,W.jsx)(z.alert,{}),(0,W.jsx)(`span`,{children:`Couldn’t answer`})]}),(0,W.jsx)(`p`,{className:`live-error-msg`,children:Y.error.message}),(0,W.jsxs)(`div`,{className:`live-error-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`live-error-btn primary`,onClick:()=>{let e=Y.error;e&&Y.run(e.retry,e.attachments,e.selectedBlocks,void 0,e.inkIntents,e.question)},disabled:Y.busy,children:`Retry`}),(0,W.jsx)(`button`,{type:`button`,className:`live-error-btn`,onClick:()=>ai(!0),children:`Open settings`})]})]}):null,zl=G,[Vl,Hl]=(0,U.useState)(160);(0,U.useEffect)(()=>{if(!zl)return;let e=document.querySelector(`.live-dock`);if(!e)return;let t=()=>Hl(Math.round(e.getBoundingClientRect().height)+8);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[zl]);let Ul=zl?(0,W.jsxs)(`div`,{className:`ms-stage-fill`,"data-phase":K.phase,style:{"--ms-bottom-reserve":`${Vl}px`},children:[(0,W.jsxs)(`button`,{type:`button`,className:`ms-exit`,onClick:Ns,title:`Back to the conversation (Esc)`,children:[(0,W.jsx)(z.chevL,{}),`Back to conversation`]}),(0,W.jsx)(Rd,{mindShape:K,onSettled:()=>{Vi(`I think this is the shape of it.`)},onConfirmUnsaid:()=>K.confirmUnsaid(),onDismissUnsaid:()=>K.dismissUnsaid(),onAction:(e,t)=>{if(e===`add-more`)Te(null),K.resume(),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:J&&!Ci});else if(e===`not-quite`)Br.current=[],K.resume(!1),Te(null),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:J&&!Ci});else if(e===`share`)Be(!0);else if(e===`present`)Dn(!0);else if(e===`answer`||e===`plan`||e===`commit-plan`||e===`tell-apart`){let n=K.spec,r=e===`commit-plan`||e===`plan`?`plan`:`answer`,i=n?Hd(n,r):Se??``;e===`tell-apart`&&t?.tension&&(i=`I keep coming back to “${t.tension.a}” but I also said “${t.tension.b}.” Help me tell these two reasons apart — are they the same thing or not?\n\n`+i);let a=Y.restored;if(H&&!J&&X.stop(),Te(null),K.reset(),Rr(!1),i){let t=e===`tell-apart`?`Telling them apart`:n?.center||(r===`plan`?`A plan`:`An answer`);Oe(t),Y.run(i,void 0,void 0,void 0,void 0,t,n??void 0,a?{freshStart:!0}:void 0)}}},liveTranscript:Se||void 0,thoughtCount:td([Br.current.join(` `),Se??``].join(` `))})]}):null,Gl=G?K.phase===`settled`||K.phase===`pausing`?`Add thought`:`Done thinking`:`Watch me think`;return(0,W.jsxs)(`div`,{className:`mavea-app with-rail live-voice canvas-flat`+(Zs?` face-homed`:``)+(tc?` in-wizard`:``)+(En?` presenting`:``)+(Qr?` rail-collapsed`:``)+(zl?` watch-thinking`:``),"data-title":Y.spec?.title??``,...En?{"data-preso":An}:{},ref:da,children:[s.current&&(0,W.jsx)(ji,{driver:ko}),s.current&&ko.done&&(0,W.jsx)(Pi,{onStart:Gi,onReplay:Ki,onPlayExtra:ko.playExtra,hasStoredSession:Ui}),O.current&&(()=>{let e=F(O.current);return e?(0,W.jsx)($i,{driver:Ao,member:e,onExit:Gi}):null})(),En&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`preso-style-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||Nn(!1)},children:[(0,W.jsxs)(`button`,{type:`button`,className:`preso-style-btn`+(Mn?` is-open`:``),onClick:()=>Nn(e=>!e),"aria-expanded":Mn,"aria-haspopup":`listbox`,children:[(0,W.jsx)(`span`,{className:`preso-swatch-sm`,style:{background:$d.find(e=>e.id===An)?.accent??`var(--presence)`}}),`Style`]}),Mn&&(0,W.jsx)(`div`,{className:`preso-menu`,role:`listbox`,"aria-label":`Presentation style`,children:$d.map(e=>(0,W.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":An===e.id,className:`preso-row`+(An===e.id?` is-active`:``),onClick:()=>{jn(e.id),rf(e.id),Nn(!1)},children:[(0,W.jsx)(`span`,{className:`preso-swatch`,style:{background:e.accent}}),(0,W.jsx)(`span`,{className:`preso-name`,children:e.label}),(0,W.jsx)(`span`,{className:`preso-desc`,children:e.description})]},e.id))})]}),(0,W.jsx)(`button`,{type:`button`,className:`present-exit`,onClick:()=>Dn(!1),title:`End the presentation (Esc)`,children:`End show · Esc`}),(0,W.jsx)($,{children:(0,W.jsx)(Bp,{spec:Y.viewSpec??Y.spec,question:Pc?.question??null,narration:Pc?.narration??Y.narration,skinId:An,autoAdvanceMs:s.current||O.current?2600:void 0,onExit:()=>Dn(!1)})})]}),(0,W.jsx)(`div`,{className:`presence-layer`+(Zs?` corner`:ec?``:` idlehome`)+(rc?` has-caption`:``)+(ni?` is-mem-save`:``),ref:pa,children:(0,W.jsxs)(`div`,{className:`presence-positioner`,children:[Bo&&(0,W.jsx)(`div`,{className:`presence-seed`,"aria-hidden":`true`},Y.turn),(0,W.jsx)(ue,{state:qs.state,emotion:qs.emotion,gaze:qs.gaze,muted:Le})]})}),(0,W.jsx)(`div`,{className:`presence-scrim`+(cc?` show`:``)}),rc&&(0,W.jsx)(`div`,{className:`center-caption`,role:`status`,"aria-live":`polite`,children:nc}),(0,W.jsx)(mf,{activity:Y.activity,sources:Y.busy?Y.liveSources:[]}),(0,W.jsxs)(`div`,{className:`topbar`,children:[(0,W.jsxs)(`button`,{className:`brand brand-link`,type:`button`,onClick:qp,title:`Back to the demo`,"aria-label":`Back to the demo`,children:[(0,W.jsx)(`span`,{className:`brand-dot jelly-mark`,ref:fa}),(0,W.jsx)(`span`,{className:`brand-name`,children:`Mavéa`}),Y.spec&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`brand-sep`}),(0,W.jsx)(`span`,{className:`workspace-name`,children:Y.error?`Couldn’t answer`:Y.spec.title})]})]}),(0,W.jsxs)(`span`,{className:`live-badge`,title:`Live · ${t.label}`,"aria-label":`Live mode`,children:[(0,W.jsx)(`span`,{className:`live-dot`}),`Live`]}),(0,W.jsx)(`div`,{className:`topbar-spacer`}),(0,W.jsx)(ln,{label:`Create`,items:Ol}),(0,W.jsx)(ln,{label:`Practice`,items:kl,badge:Yc}),(0,W.jsx)(ln,{label:`Share`,items:Al}),(0,W.jsx)(ln,{label:`Explore`,items:jl}),(0,W.jsx)(_,{onOpen:di,preload:ip.preload}),(0,W.jsx)(`span`,{className:`topbar-divider`,"aria-hidden":`true`}),(0,W.jsx)(Gn,{})]}),(0,W.jsx)(ic,{chapters:mc,frames:Y.frames,currentIndex:_c,onJump:Y.jumpTo,onReplay:Y.frames.length>0?()=>Zo(Y.frames.length-1):void 0,onOverview:Y.frames.length>0?()=>qc(!0):void 0,resumed:Y.restored,chatOpen:Xr,onToggleChat:()=>Zr(e=>!e),collapsed:Qr,onToggleCollapse:()=>$r(e=>!e),onOpenPast:Ho.length>0?()=>ti(!0):void 0,onStudy:()=>Vt(!0),roomIndices:Pn,bookmarks:$a,onToggleBookmark:eo,onViewMindMap:e=>{let t=Y.frames[e];t?.mind&&Tn({open:!0,spec:t.mind})},onSeeTogether:jc}),(0,W.jsxs)($s,{holdEnabled:Z&&Oi===`hold`,showHint:!1,pttKey:e.pttKey,pttSide:e.pttSide,onHoldStart:()=>{Wo(),X.start({inCanvas:!!Y.spec})},onHoldEnd:()=>X.forceStop(),onChangePttKey:e=>qt({pttKey:e}),onChangePttSide:e=>qt({pttSide:e}),children:[(Yr||J&&Z)&&(0,W.jsxs)(`div`,{className:`dock-modes`,role:`group`,"aria-label":`Listening modes`,children:[Yr&&(0,W.jsx)(`span`,{className:`whisper-badge`,children:`won't wake anyone`}),J&&Z&&(0,W.jsx)(`button`,{type:`button`,className:`listen-mode-chip`+(mr?` on`:``),"aria-pressed":mr,onClick:()=>{gr(e=>!e),G&&(zr.current=!1,Rr(!1))},title:Lr,"aria-label":Lr,children:mr?`Just listening · ${Ar} banked`:`Just listen`}),mr&&Ar>0&&(0,W.jsx)(`button`,{type:`button`,className:`listen-mode-chip`,onClick:()=>{gr(!1);let e=kr.current;if(kr.current=[],Pr(0),e.length){let t=Math.round((Date.now()-Fr.current)/6e4);Oe(`Your thinking, sorted`),Y.run(Kd(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}},children:`Thoughts?`})]}),Z&&(0,W.jsx)(Ue,{kind:`voice-data`,from:`live`}),Ae&&(0,W.jsxs)(`div`,{className:`voice-notice`,role:`status`,children:[Ae===Qf?(0,W.jsx)(z.spark,{}):(0,W.jsx)(z.micOff,{}),(0,W.jsx)(`span`,{children:Ae}),(0,W.jsx)(`button`,{type:`button`,className:`voice-notice-x`,"aria-label":`Dismiss voice notice`,onClick:()=>Ne(null),children:(0,W.jsx)(z.x,{})})]}),(M.length>0||I)&&(0,W.jsxs)(`div`,{className:`attach-strip`,role:`list`,"aria-label":`Attached files`,children:[M.map((e,t)=>(0,W.jsxs)(`span`,{className:`attach-chip`,role:`listitem`,children:[kt(e)?(0,W.jsx)(`img`,{className:`attach-thumb`,src:`data:${e.mime};base64,${e.data}`,alt:``}):(0,W.jsx)(z.paperclip,{}),(0,W.jsx)(`span`,{className:`attach-name`,children:jt(e)}),(Et(e)&&ks||Dt(e)||Nt(e))&&(0,W.jsx)(`button`,{type:`button`,className:`attach-explode`,"aria-label":`Explode ${e.name} into a map of its claims`,title:`Explode into a map of grounded claims`,onClick:()=>on([e]),children:`⊹ Explode`}),(0,W.jsx)(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove ${e.name}`,onClick:()=>oe(t),children:(0,W.jsx)(z.x,{})})]},t)),(()=>{let e=M.filter(e=>Dt(e)||Nt(e)||Et(e)&&ks);if(e.length<=1)return null;let t=(0,W.jsxs)(`button`,{type:`button`,className:`attach-explode attach-compare`,"aria-label":`Compare ${e.length} documents — map their claims and find where they agree and contradict`,title:`Explode all documents together and compare them`,onClick:()=>on(e),children:[`⊹ Compare `,e.length,` documents`]},`compare`),n=(0,W.jsxs)(`button`,{type:`button`,className:`attach-explode attach-compare`,"aria-label":`Synthesize ${e.length} sources — fuse them into one map of themes, contradictions, and gaps`,title:`Fuse all sources into one navigable Synthesis World`,onClick:()=>gn(e),children:[`⊹ Synthesize `,e.length,` sources`]},`synth`);return e.length>=4?n:e.length>=3?(0,W.jsxs)(W.Fragment,{children:[t,n]}):t})(),I&&(0,W.jsx)(`span`,{className:`attach-error`,role:`status`,children:I})]}),M.length>0&&(0,W.jsx)(Ue,{kind:`upload`,from:`live`}),Y.spec&&(0,W.jsx)(ol,{armed:de,pins:rs.pins,miss:rs.miss,onUndo:rs.undo,onSend:rs.send}),V.length>0&&(0,W.jsxs)(`div`,{className:`pin-dock`,children:[(0,W.jsx)(`div`,{className:`pin-strip`,role:`list`,"aria-label":`Elements you're asking about`,children:V.map(e=>(0,W.jsxs)(`span`,{className:`pin-chip`,role:`listitem`,children:[(0,W.jsx)(z.chat,{}),(0,W.jsx)(`span`,{className:`pin-name`,children:ie(e)}),(0,W.jsx)(`button`,{type:`button`,className:`pin-remove`,"aria-label":`Unpin ${ie(e)}`,onClick:()=>Ts(e),children:(0,W.jsx)(z.x,{})})]},e.id))}),(0,W.jsxs)(`div`,{className:`pin-suggests`,role:`list`,"aria-label":`Quick follow-ups`,children:[V.length>=2&&(0,W.jsxs)(`button`,{type:`button`,className:`live-chip pin-fuse-chip`,disabled:Y.busy,title:`Combine these ${V.length} cards into a single new answer — useful when you want Mavéa to find the pattern, trade-off, or story that runs across all of them at once`,onClick:()=>ws(V),children:[`Fuse `,V.length,` into one`]}),Ds.map(e=>(0,W.jsx)(`button`,{type:`button`,className:`live-chip`,onClick:()=>as(e),disabled:Y.busy,children:e},e))]})]}),(0,W.jsxs)(`div`,{className:Qs?`voice-capsule`:`composer-passthrough`,children:[Qs&&(0,W.jsxs)(`div`,{className:`voice-strip`,children:[Wc&&!zc?(0,W.jsxs)(`button`,{type:`button`,className:`vc-status`,onClick:Wo,title:`Tap to stop and show the whole answer at once`,"aria-label":`Stop speaking and show the whole answer`,children:[(0,W.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]}),(0,W.jsx)(`span`,{className:`vc-status-label`,children:`Speaking`})]}):Ta&&!Le?(0,W.jsxs)(`div`,{className:`vc-status vc-preparing`,role:`status`,"aria-busy":`true`,children:[(0,W.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]}),(0,W.jsx)(`span`,{className:`vc-status-label`,children:`Preparing voice…`})]}):zc&&!Le?(0,W.jsx)(`div`,{className:`vc-status vc-preparing vc-quiet`,role:`status`,"aria-busy":`true`,"aria-label":`Preparing voice`,children:(0,W.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]})}):null,(0,W.jsx)(`div`,{className:`vc-transcript`,"aria-hidden":`true`,children:Vc??Y.narration??``}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>Re(e=>!e),title:Le?`Unmute Mavéa's voice — your microphone is unaffected`:`Mute Mavéa's voice — muted answers land written out at once, with notes and pen marks standing in for the walk. Your microphone is unaffected.`,"aria-pressed":!Le,className:`voice-switch`+(Le?` is-muted`:``),children:[Le?(0,W.jsx)(z.speakerOff,{}):(0,W.jsx)(z.speaker,{}),(0,W.jsx)(`span`,{className:`voice-switch-label`,children:`Mavéa's voice`}),(0,W.jsx)(`span`,{className:`voice-switch-track`,"aria-hidden":`true`,children:(0,W.jsx)(`span`,{className:`voice-switch-thumb`})})]}),(0,W.jsx)(Au,{}),(0,W.jsx)(Nu,{}),(0,W.jsxs)(`button`,{className:`live-model-chip`,onClick:()=>ai(e=>!e),title:O.current?`The model that generated this curated prerecorded example`:Ic?`Model settings · last reply ${Ic}`:`Model settings`,children:[(0,W.jsx)(`span`,{className:`chip-dot`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`chip-model`,children:O.current?Ao.model??`—`:n}),(0,W.jsx)(`span`,{className:`chip-caret`,"aria-hidden":`true`})]})]}),(0,W.jsx)(Gr,{value:A,onChange:e=>{j(e)},onSend:as,listening:H,heard:Se,onMic:Is,micMode:Oi,micArmed:J&&!Ci,micPaused:J&&Ci,micProcessing:ye===`transcribing`,placeholder:G?`Talk, or type a thought — it lands on the map…`:V.length?V.length>1?`Ask about the selected elements…`:`Ask about the selected element…`:`Talk, or type — anything.`,focusSignal:hi,disabled:Y.busy,onFiles:ne,attachPulse:_i,attachTitle:ks?`Attach an image or PDF`:`Attach a doc or data file to explode — ${n} can't read images/PDFs directly`,onMicDown:()=>{Z&&(Wo(),X.start({inCanvas:!!Y.spec}))},onForceStop:()=>X.forceStop(),onMicCancel:()=>X.stop(),tools:(0,W.jsxs)(W.Fragment,{children:[Y.spec&&(0,W.jsx)(sl,{armed:de,onToggle:pe}),(0,W.jsxs)(`button`,{type:`button`,className:`composer-watch`+(G?` on`:``),"aria-pressed":G,"aria-label":Gl,onClick:()=>{G?K.phase===`settled`||K.phase===`pausing`?(Te(null),K.resume(),!H&&Z&&X.start({inCanvas:!!Y.spec,continuous:!0})):Ms():$c(`think`)},title:G?K.phase===`settled`||K.phase===`pausing`?`Add another thought`:`Finish now without waiting for silence`:`Build a live map while you think aloud`,children:[(0,W.jsx)(z.spark,{}),(0,W.jsx)(`span`,{children:Gl})]})]}),micExtra:Z?(0,W.jsx)(bs,{mode:Oi,pttKey:e.pttKey,pttSide:e.pttSide,onChange:e=>{Ti.current=null,wi(!1),Si(e===`always`),ki(e===`always`),Di(e===`hold`),e===`always`&&J&&!H&&!A.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):e!==`always`&&H&&X.stop()}}):void 0})]})]}),H&&!G&&(0,W.jsx)(cf,{transcript:Se,mode:Oi,note:mr?`Just listening · ${Math.max(1,Math.round((Date.now()-Fr.current)/6e4))}m — say "thoughts?" when you want me`:void 0}),H&&!G&&(0,W.jsx)(od,{ghosts:Wi}),Y.spec?(0,W.jsxs)(`div`,{className:`canvas-stage stage`,"data-active":`1`,ref:ia,children:[Dc!=null&&(0,W.jsx)(Ws,{tint:wc?.color,onDone:()=>Oc(null)},Dc),(0,W.jsx)(`div`,{className:`canvas-scroll`,ref:ra,onClick:Y.spot?e=>{e.target.closest(`.spotlit`)||Uo()}:void 0,children:(0,W.jsxs)(`div`,{className:`topic-wrap`,children:[(0,W.jsx)(Ac,{armed:de,rootRef:ia,onStroke:rs.onStroke,onTap:rs.onTap,strokes:rs.strokes,highlights:rs.highlights}),Rl,!yc&&(0,W.jsxs)(`div`,{className:`viewing-past`,role:`status`,children:[vc?(0,W.jsx)(z.table,{}):(0,W.jsx)(z.clock,{}),(0,W.jsx)(`span`,{children:vc?`Viewing this thread together`:`Viewing an earlier moment`}),(0,W.jsx)(`button`,{type:`button`,className:`viewing-past-back`,onClick:()=>vc?Y.previewSpec(null):Y.jumpTo(gc),children:`Return to live`})]}),!me&&V.length===0&&(0,W.jsxs)(`div`,{className:`ask-hint`,role:`note`,children:[(0,W.jsx)(z.chat,{}),(0,W.jsxs)(`span`,{children:[`Tap `,(0,W.jsx)(`strong`,{children:`Ask`}),` on any element to ask Mavéa about it.`]}),(0,W.jsx)(`button`,{type:`button`,className:`ask-hint-x`,"aria-label":`Dismiss tip`,onClick:he,children:(0,W.jsx)(z.x,{})})]}),os&&(0,W.jsx)($,{children:(0,W.jsx)(yp,{course:os,lessonIdx:cs,progress:us??_r(os.id),onPrev:()=>ps(os,cs-1),onNext:()=>ps(os,cs+1),onCheckpoint:ms,busy:Y.busy},`${os.id}:${cs}`)}),Pc&&!os&&(0,W.jsx)(Hs,{question:Pc.question,narration:Pc.narration,sources:Nc?.sources,inferred:Fc,tint:Sc}),qo&&(0,W.jsx)(c,{label:`Opening saved answer…`,overlay:!0}),(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(`div`,{className:`canvas-loading`,role:`status`,"aria-busy":`true`,"aria-label":`Loading canvas`,children:(0,W.jsx)(`div`,{className:`skel-grid`,children:(0,W.jsx)(le,{blocks:qf})})}),children:(0,W.jsx)(Kf,{data:Ll??Y.viewSpec??Y.spec,spot:yc?Y.spot:null,built:{},onProve:()=>mi(!0),onAskBlock:Ts,onAddToDashboard:e=>dt({block:e,question:Pc?.question??void 0}),selectedBlockIds:vs,onNarrate:Fo,narratingId:Io,muted:Le,viewMode:bo,onViewMode:xo,presenting:En,noteGutter:yc&&e.annotationsEnabled&&Xa&&xa,walkNotes:yc?Qa:void 0,blankFill:yc?{values:Y.filled,activeKey:Y.activeBlank,fill:Y.fill,unfill:Y.unfill,activate:Y.setActiveBlank,complete:Y.complete,busy:Y.busy}:void 0,bend:yc&&Bn===null?Y.spec?.bend:void 0,onAddToFlashcard:ta,flashedIds:_t,belowHeaderSlot:Pc&&Fl?(0,W.jsx)(ku,{audio:Fl,t:Bn,onSeek:qn}):void 0,viewSlot:pl?(0,W.jsxs)(`button`,{type:`button`,className:`canvas-open world-open`,title:Xf,"aria-label":Yf,onClick:()=>vl(),children:[(0,W.jsx)(z.globe,{className:`ic`,"aria-hidden":!0}),Yf]}):void 0,headerSlot:yc?(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`pen-anchor`,ref:to,children:[(0,W.jsx)(pc,{enabled:e.annotationsEnabled,open:Wa,inkCount:Fa.length,onClick:()=>Ka(e=>!e)}),Wa&&(0,W.jsx)(`div`,{className:`pen-popover`,children:(0,W.jsx)(fc,{entries:Fa,turnStartMs:Ra.current,annotationsEnabled:e.annotationsEnabled,hiddenSpots:qa,onToggle:mo,onKeep:()=>Ka(!1),onClear:()=>{ja([]),Na(new Set),Ja(new Set),Ka(!1)},onClip:()=>Be(!0),onJumpTo:go,onToggleSpot:yo})})]})}):void 0},vc?`thread-`+(Y.viewOverride?.id??``):yc?`live-`+Y.replaceEpoch:`view-`+Y.viewIndex)}),yc&&!zl&&!Go&&(0,W.jsx)(st,{spots:qa.size>0?Aa.filter(e=>!qa.has(e.spot)):Aa,revision:So,onPlaced:Pa}),Y.busy&&yc&&(0,W.jsxs)(`div`,{className:`working-col`,children:[(0,W.jsx)(uf,{cards:Lc}),(0,W.jsx)(pf,{thinking:Y.reasoning})]}),yc&&!Y.busy&&(0,W.jsx)($,{children:(0,W.jsx)(dp,{chips:Y.understood,onFix:Cs})}),(0,W.jsx)(Js,{spec:Y.viewSpec??Y.spec,followups:Mc,question:Ee??void 0,onAsk:as,onTrack:()=>Ke(!0),onDeepZoom:Ee?()=>{window.location.hash=`#/deepzoom?seed=${encodeURIComponent(Ee)}`}:void 0,onCanvas:()=>xo(`canvas`),onSeeAll:!vc&&xc&&xc.moments.length>=2?()=>jc(xc):void 0,threadCount:xc?.moments.length,busy:Y.busy})]})})]}):tc?(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(ys,{seed:r.current||void 0,speak:Vi,goDemo:qp,onStart:e=>{Vo(!0),as(e)},onStartTalking:()=>{if(Vo(!0),!Z){Ne(If),gi(e=>e+1);return}X.start({inCanvas:!1})},onSeeHow:()=>zo(!0),studySlot:(0,W.jsx)(xl,{onStudy:()=>Vt(!0)}),librarySlot:Ho.length>0?(0,W.jsx)($,{children:(0,W.jsx)(op,{entries:Ho,onResume:e=>{Vo(!0),te(!1),Oe(e.question??null),ts(e.id),Yo(e.spec,e.question)},onRemove:un,heading:`Pick up where you left off`,sub:`Your conversations stay on this device — tap one to step back in.`})}):void 0})}):(0,W.jsxs)(`div`,{className:`presence-stage stage`,"data-active":`1`,children:[Rl&&(0,W.jsx)(`div`,{className:`live-error-stage`,children:Rl}),Y.busy&&(0,W.jsx)(`div`,{className:`skel-stage`,children:(0,W.jsx)(uf,{cards:Lc})})]}),Ul,ml&&(0,W.jsx)($,{label:`Living answer`,children:(0,W.jsx)(Ip,{spec:fl.props.world??null,question:fl.props.title,failed:al,onRetry:()=>ul(e=>e+1),onClose:yl,view:fl.props.view,onExpandNode:Tl,autoWalk:Li&&fl.id===`tour-world`,speakLine:Vi})}),yi&&(0,W.jsxs)(`div`,{className:`drop-hint`,role:`status`,"aria-live":`polite`,children:[(0,W.jsx)(z.paperclip,{}),(0,W.jsx)(`span`,{children:`Drop to attach — Mavéa reads PDFs, Office docs, and data files`})]}),Ro&&(0,W.jsx)($,{children:(0,W.jsx)(rp,{onClose:()=>zo(!1),speak:Vi,onFullTour:Ki})}),ui&&(0,W.jsx)($,{children:(0,W.jsx)(ap,{items:Dl,surface:`live`,onClose:fi,pinned:s.current&&ko.chapter?.id===`palette`})}),ii&&(0,W.jsx)(`div`,{role:`presentation`,onClick:e=>e.target===e.currentTarget&&ai(!1),style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.45)`,display:`flex`,alignItems:`flex-start`,justifyContent:`center`,paddingTop:80,zIndex:50},children:(0,W.jsx)($,{children:(0,W.jsx)(cp,{onClose:()=>ai(!1),initialTab:oi,initialAdvancedYouOpen:ci})})}),Xo!==null&&(0,W.jsx)($,{children:(0,W.jsx)(Tp,{frames:Y.frames,initialIndex:Xo,speak:Vi,cancelSpeak:Fe,onClose:()=>Zo(null)})}),ze&&(0,W.jsx)($,{children:(0,W.jsx)(Dp,{frames:Y.frames,retainedAudio:e=>Xn.get(Ge(e)),onClose:()=>Be(!1),onShared:()=>Us.enqueue(`clipShared`)})}),Ve&&Zi.length>0&&(0,W.jsx)($,{children:(0,W.jsx)(kp,{answers:Zi,defaultIndex:bc?bc.moments[bc.moments.length-1].frameIndex:Zi.length-1,defaultIndices:bc?.moments.map(e=>e.frameIndex),onClose:()=>He(!1),guided:s.current&&ko.chapter?.action.kind===`export`})}),We&&(0,W.jsx)($,{children:(0,W.jsx)(jp,{onClose:()=>Ke(!1),initialSourceId:Qo?`lib-`+Qo:void 0})}),Ye&&(0,W.jsxs)(`div`,{className:`cv-takeover`,role:`dialog`,"aria-modal":`true`,"aria-label":`Living dashboard`,children:[(0,W.jsxs)(`header`,{className:`cv-takeover-head`,children:[(0,W.jsxs)(`div`,{className:`cv-takeover-id`,children:[(0,W.jsx)(`span`,{className:`cv-takeover-glyph`,"aria-hidden":`true`,children:`◎`}),(0,W.jsxs)(`div`,{className:`cv-takeover-titles`,children:[(0,W.jsx)(`span`,{className:`cv-takeover-eyebrow`,children:`Living dashboard`}),(0,W.jsx)(`span`,{className:`cv-takeover-title`,children:`Investment growth · $10k at 7%`})]})]}),(0,W.jsxs)(`button`,{type:`button`,className:`cv-takeover-close`,onClick:()=>ot(null),children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` Back to answer`]})]}),(0,W.jsx)(`div`,{className:`tour-dash-body`,children:(0,W.jsx)($,{children:ct?(0,W.jsx)(up,{id:Ye}):(0,W.jsx)(lp,{id:Ye})})})]}),ut&&(0,W.jsx)($,{children:(0,W.jsx)(Mp,{block:ut.block,question:ut.question,conversationTitle:Y.spec?.title,onClose:()=>dt(null),onAdded:(e,t)=>gt({id:e,title:t})})}),ft&&(0,W.jsx)(Os,{dashboardId:ft.id,dashboardTitle:ft.title,onDismiss:()=>gt(null)}),Y.spec&&(0,W.jsx)(Ls,{open:pi,onClose:()=>mi(!1),claim:Y.spec.title,conf:ns,sources:Y.spec.sources??[],hadFiles:ee,blocks:Y.spec.blocks}),Sn.open&&(0,W.jsx)($,{children:(0,W.jsx)(bp,{open:!0,spec:Sn.spec,onClose:()=>Tn(e=>({...e,open:!1}))})}),ei&&(0,W.jsx)($,{children:(0,W.jsx)(wp,{entries:Ho,onResume:e=>{Vo(!0),te(!1),Oe(e.question??null),ts(e.id),Yo(e.spec,e.question),ti(!1)},onRemove:un,onClose:()=>ti(!1)})}),Kc&&(0,W.jsx)(La,{chapters:mc,currentIndex:_c,onJump:vo,onClose:()=>qc(!1)}),In&&Jc&&(0,W.jsx)($,{children:(0,W.jsx)(pp,{model:Jc,level:In,onLevel:Ln,onJump:e=>{Y.jumpTo(e),Ln(null)},onClose:()=>Ln(null)})}),Yt&&(0,W.jsx)($,{children:(0,W.jsx)(Hp,{cfg:Gt(e),memoryNodes:wn(),speak:Vi,onDebrief:e=>{Qt(!1),j(e)},onClose:()=>Qt(!1),onPrepTurn:(e,t)=>{Qt(!1),Oe(t),Y.run(e,void 0,void 0,void 0,void 0,t)}})}),Ut&&Jc&&(0,W.jsx)($,{children:(0,W.jsx)(Sp,{model:Jc,onJump:e=>{Y.jumpTo(e),Jt(!1)},onShare:Y.frames.length>0?()=>{Jt(!1),Be(!0)}:void 0,onClose:()=>Jt(!1)})}),$t&&(0,W.jsx)($,{children:(0,W.jsx)(hp,{records:cr(),chapters:mc,onLand:e=>{en(!1);let t=or(e,Ho);Vo(!0),te(!1),t?(Oe(t.question??null),ts(t.id),Yo(t.spec,t.question)):(Oe(e.question),Y.run(e.question))},onGoDeeper:e=>{en(!1),Vo(!0),te(!1),Oe(e),Y.run(e)},autoTour:s.current,onClose:()=>en(!1)})}),an&&(0,W.jsx)($,{children:(0,W.jsx)(Pp,{pdf:an,cfg:Gt(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>on(null)})}),pn&&(0,W.jsx)($,{children:(0,W.jsx)(Kp,{doc:pn,cfg:Gt(e),onClose:()=>mn(null)},pn.id)}),hn&&(0,W.jsx)($,{children:(0,W.jsx)(Rp,{sources:hn,cfg:Gt(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>gn(null)})}),bn&&(0,W.jsx)($,{children:(0,W.jsx)(_p,{model:bn,cfg:Gt(e),speak:Vi,showcase:s.current,onClose:()=>xn(null)})}),Bt&&(0,W.jsx)($,{children:(0,W.jsx)(Wp,{onClose:()=>Vt(!1)})}),Ct&&(0,W.jsx)($,{children:(0,W.jsx)(vp,{mode:`add`,initial:Ct.initial,deck:Ct.deck,origin:`block`,source:Ct.source,heading:`Flashcards from ${ie(Ct.block)}`,enrich:Ct.enrich,decks:tr(),onSaved:e=>{if(e.length&&Ct.block.id){let e=Ct.block.id;yt(t=>new Set(t).add(e))}Qi(e)},onClose:()=>wt(null)})}),hs&&(0,W.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,W.jsx)(z.layers,{}),(0,W.jsxs)(`span`,{className:`cards-pill-text`,children:[hs.missedCards.length,` card`,hs.missedCards.length===1?``:`s`,` from this checkpoint`]}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>gs(null),children:`Dismiss`}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>_s(hs),children:`Add`})]}),!hs&&Ft&&(0,W.jsxs)(`div`,{className:`cards-pill is-ask`,role:`status`,"aria-live":`polite`,children:[(0,W.jsxs)(`div`,{className:`cards-pill-head`,children:[(0,W.jsx)(z.layers,{}),(0,W.jsxs)(`span`,{className:`cards-pill-text`,children:[Ft.count,` card`,Ft.count===1?``:`s`,` saved to “`,Ft.deck,`”`]})]}),(0,W.jsxs)(`div`,{className:`cards-pill-ask`,children:[(0,W.jsx)(`span`,{className:`cards-pill-q`,children:`Want Mavéa to help you remember these?`}),(0,W.jsx)(`span`,{className:`cards-pill-sub`,children:`They’ll come back for a quick practice every so often.`}),(0,W.jsxs)(`div`,{className:`cards-pill-choices`,children:[(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>ea(`collection`),children:`No thanks`}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>ea(`spaced`),children:`Yes`})]})]})]}),!hs&&!Ft&&Ot&&(0,W.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,W.jsx)(z.layers,{}),(0,W.jsxs)(`span`,{className:`cards-pill-text`,children:[Ot.count,` card`,Ot.count===1?``:`s`,` added`]}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>{rr(Ot.ids),Mt(null)},children:`Undo`}),(0,W.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>{window.location.hash=`#/flashcards`,Mt(null)},children:`View`})]})]})}export{Xp as LiveApp};