@mavea/mavea 1.2.0 → 2.0.0

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 (389) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/PRIVACY.md +1 -0
  3. package/README.md +8 -4
  4. package/TERMS.md +1 -1
  5. package/THIRD-PARTY.txt +13 -5
  6. package/bin/mavea.mjs +143 -2
  7. package/dist/.vite/manifest.json +1473 -861
  8. package/dist/assets/AnnotationLayer-Cccb12ps.js +0 -0
  9. package/dist/assets/{AppCommandPalette-BHaYBZ5e.js → AppCommandPalette-DdOPNZ0e.js} +1 -1
  10. package/dist/assets/AtlasView-B7yObdf8.css +1 -0
  11. package/dist/assets/{AtlasView-B82UfrEX.js → AtlasView-DO_p0TdZ.js} +1 -1
  12. package/dist/assets/BriefingPlayer-DHV4vMga.css +1 -0
  13. package/dist/assets/{CadenceCard-P4teI7Se.js → CadenceCard-DxceyiPA.js} +1 -1
  14. package/dist/assets/{CanvasSkeleton-CRGWlafo.js → CanvasSkeleton-BmGjJHUQ.js} +1 -1
  15. package/dist/assets/CanvasSkeleton-DYASkTjW.css +1 -0
  16. package/dist/assets/CardEditor-CiAfT78z.css +1 -0
  17. package/dist/assets/{CardEditor-DABIhGdQ.js → CardEditor-D4slxmIM.js} +1 -1
  18. package/dist/assets/{CheckLogRail-DkHIHL0E.js → CheckLogRail-BibJTid0.js} +1 -1
  19. package/dist/assets/ConversationVideoStudio-CSO3jHXD.css +1 -0
  20. package/dist/assets/ConversationVideoStudio-DMIPUCcq.js +1 -0
  21. package/dist/assets/CourseLessonReader-D29Kix4f.js +2 -0
  22. package/dist/assets/{CourseRail-DXt3bzjU.js → CourseRail-BQmUsG6v.js} +1 -1
  23. package/dist/assets/CoursesApp-DcDsS_ZS.js +2 -0
  24. package/dist/assets/CrossExamPanel-BafTqkbf.css +1 -0
  25. package/dist/assets/{DashPresent-5SRScC2i.js → DashPresent-BDWgO9am.js} +1 -1
  26. package/dist/assets/DashboardDetail-BrnAdWfy.js +2 -0
  27. package/dist/assets/DashboardLoopGate-NxMcQ4rD.js +2 -0
  28. package/dist/assets/DashboardLoopRuntime-Dsy9u1wa.js +1 -0
  29. package/dist/assets/{DashboardSettings-CE0B2y2y.js → DashboardSettings-DJon1Q4o.js} +1 -1
  30. package/dist/assets/DashboardsApp-DxyMn3x_.js +2 -0
  31. package/dist/assets/DeepZoomApp-CVwmnRGN.css +1 -0
  32. package/dist/assets/{DeepZoomApp-BOLEl-kQ.js → DeepZoomApp-nNjqoyYE.js} +1 -1
  33. package/dist/assets/DelegatePanel-D17XvWYd.css +1 -0
  34. package/dist/assets/DelegatePanel-DN_ZL0j7.js +33 -0
  35. package/dist/assets/DemoGallery-DrSlMsnu.js +1 -0
  36. package/dist/assets/{DropSelect-DilESAgA.css → DropSelect-B4lqCEjw.css} +1 -1
  37. package/dist/assets/{DropSelect-DjbdVfIR.js → DropSelect-GwIXHA5o.js} +1 -1
  38. package/dist/assets/{ExportModal-CLobMv1F.js → ExportModal-DBUjC71U.js} +1 -1
  39. package/dist/assets/{ExtractionPreview-QZ2VHmsb.js → ExtractionPreview-D4M6eXqb.js} +1 -1
  40. package/dist/assets/{FeatureUseNotice-Dc8joBGM.js → FeatureUseNotice-Bda9jr3W.js} +1 -1
  41. package/dist/assets/{FlagshipCommandPalette-DnWuBjYI.js → FlagshipCommandPalette-DAO849RC.js} +1 -1
  42. package/dist/assets/FlagshipShowcase-g2x-1c70.js +1 -0
  43. package/dist/assets/{FlashcardsApp-BQGM-Tr1.js → FlashcardsApp-BUKzCr65.js} +1 -1
  44. package/dist/assets/ForecastPanel-Cq_yDhNQ.css +1 -0
  45. package/dist/assets/GalleryApp-ot_A7ZF-.js +1 -0
  46. package/dist/assets/{HonestByDesign-57LDf-gm.js → HonestByDesign-DgZFEpEx.js} +1 -1
  47. package/dist/assets/{HowItWorks-DMfPX3GK.js → HowItWorks-DPFpdeGE.js} +1 -1
  48. package/dist/assets/{LegalApp-CcO5Qq6R.js → LegalApp-C56kWdmK.js} +1 -1
  49. package/dist/assets/{LegalMarkdownDocument-Be_fQbZ_.js → LegalMarkdownDocument-BBTHuW_M.js} +1 -1
  50. package/dist/assets/{LegalPageShell-B-HY1WG7.js → LegalPageShell-hMA-7JLf.js} +1 -1
  51. package/dist/assets/LeverPanel-HOEwIr8k.css +1 -0
  52. package/dist/assets/{Library-DmdzY2se.js → Library-CVj7R6F4.js} +1 -1
  53. package/dist/assets/LibraryOverlay-BkPYm0Bs.css +1 -0
  54. package/dist/assets/{LibraryOverlay-BilW6q_z.js → LibraryOverlay-DSUWcUe4.js} +1 -1
  55. package/dist/assets/LiveApp-B62EMybC.js +79 -0
  56. package/dist/assets/LiveApp-CziqEsOb.css +1 -0
  57. package/dist/assets/LiveSettings-BITIaMoT.js +6 -0
  58. package/dist/assets/LiveSettings-Dho0OxlM.css +1 -0
  59. package/dist/assets/{MindMapViewerDrawer-DI_S7fRZ.js → MindMapViewerDrawer-CKdJtHno.js} +1 -1
  60. package/dist/assets/MindShape-B3lg_z4X.js +1 -0
  61. package/dist/assets/MindShape-CozR9W8M.css +1 -0
  62. package/dist/assets/{PinToDashboard-Cz5UJCmq.js → PinToDashboard-DpQjBLPa.js} +1 -1
  63. package/dist/assets/{PlanReview-CmUxzNqL.js → PlanReview-CrTbmMAd.js} +1 -1
  64. package/dist/assets/PresentationDeck-CfYadu9V.js +1 -0
  65. package/dist/assets/PrismApp-bRKK_3JA.js +2 -0
  66. package/dist/assets/PrismAskController-68gbUO5u.css +1 -0
  67. package/dist/assets/{PrismAskController-Bt0k9hAA.js → PrismAskController-C4MuB8om.js} +1 -1
  68. package/dist/assets/{PrismBriefingPlayer-DzdtnFj4.js → PrismBriefingPlayer-ChJj6hSS.js} +2 -2
  69. package/dist/assets/PrismOverlay-BwnF4BEn.css +1 -0
  70. package/dist/assets/{PrismOverlay-D1cDZamt.js → PrismOverlay-Pp6ZKmTc.js} +4 -4
  71. package/dist/assets/{PrismWorkbench-BEIp4MiL.js → PrismWorkbench-BCV7r4Oa.js} +1 -1
  72. package/dist/assets/{PrivacyApp-B4DT2RUz.js → PrivacyApp-A2Bu6LVd.js} +2 -1
  73. package/dist/assets/{Recap-T9DtFaEk.js → Recap-BOl3SUh0.js} +1 -1
  74. package/dist/assets/Recap-D3NlzM1p.css +1 -0
  75. package/dist/assets/{ReplayCard-Dx46HCBT.js → ReplayCard-B6NYiYzQ.js} +2 -2
  76. package/dist/assets/{ReplayOverlay-CnJAxf0u.js → ReplayOverlay-BJKtJ-vc.js} +1 -1
  77. package/dist/assets/{RewindOverlay-CousnxXo.js → RewindOverlay-BO7YgDsW.js} +1 -1
  78. package/dist/assets/RippleApp-BXt7tenS.js +2 -0
  79. package/dist/assets/{RippleAskController-9SxpZnHX.js → RippleAskController-BzdwYcYY.js} +1 -1
  80. package/dist/assets/RippleOverlay-B3hg2KMN.css +1 -0
  81. package/dist/assets/RippleOverlay-BSxubBwj.js +6 -0
  82. package/dist/assets/SeeDontRead-0He5hS2C.js +1 -0
  83. package/dist/assets/ShareModal-I_sxHKLv.css +1 -0
  84. package/dist/assets/ShareModal-xYdZWJxy.js +2 -0
  85. package/dist/assets/{ShipCourse-BavQppkt.js → ShipCourse-Dg6kCWyH.js} +1 -1
  86. package/dist/assets/{SignatureLoop-L8W2h62w.js → SignatureLoop-QPwB2oNN.js} +1 -1
  87. package/dist/assets/SrsReview-DmBcJCMa.css +1 -0
  88. package/dist/assets/{SrsReview-DhWNYYv7.js → SrsReview-Gr6Y0QTQ.js} +1 -1
  89. package/dist/assets/{SynthesisApp-C2O6pFeM.js → SynthesisApp-DrCq6NDa.js} +2 -2
  90. package/dist/assets/{SynthesisOverlay-DLvwiSMv.js → SynthesisOverlay-DCa-2Pz_.js} +1 -1
  91. package/dist/assets/{TermsApp-CxY1yorm.js → TermsApp-zcPDYfuh.js} +2 -2
  92. package/dist/assets/TopicCanvas-Bw4bMFpe.js +2 -0
  93. package/dist/assets/TopicCanvas-DWTm611H.css +1 -0
  94. package/dist/assets/{TourPrism-CI-iJZil.js → TourPrism-DbinDupp.js} +1 -1
  95. package/dist/assets/{TrackerTile-oz6IoG8m.js → TrackerTile-CrT9u1I4.js} +2 -2
  96. package/dist/assets/{TwoSurfaces-Rnf-_WgY.js → TwoSurfaces-L0CDuyOZ.js} +1 -1
  97. package/dist/assets/WhyMachineOverlay-Rav-cuMm.css +1 -0
  98. package/dist/assets/WorldOverlay-BcjqG1BR.js +2 -0
  99. package/dist/assets/{WowFeatures-C4efSbNV.js → WowFeatures-CwBk4ZMO.js} +1 -1
  100. package/dist/assets/ZoomDeck-DdLNsrHV.css +1 -0
  101. package/dist/assets/{ZoomDeck-CBrr0yfy.js → ZoomDeck-DlnesweX.js} +1 -1
  102. package/dist/assets/{annotationAuto-CDv6Es44.js → annotationAuto-B2UdfJNj.js} +1 -1
  103. package/dist/assets/{backup-ZrlVatXc.js → backup-685QrAjt.js} +1 -1
  104. package/dist/assets/canvas-C3O7MEA3.js +1 -0
  105. package/dist/assets/capture-DgJLQ_0-.js +2 -0
  106. package/dist/assets/{chapters-Dqm4iLDa.js → chapters-CIvdCeBC.js} +1 -1
  107. package/dist/assets/{confirmAdd-DzMO9jKV.js → confirmAdd-CZ829Mbx.js} +1 -1
  108. package/dist/assets/{dashboardEvents-DKl5rrTD.js → dashboardEvents-CiayRLrH.js} +1 -1
  109. package/dist/assets/dashboards-Cvs28p3Z.css +1 -0
  110. package/dist/assets/deepen-DAeHHFiI.js +11 -0
  111. package/dist/assets/deepenStore-BWLLzLCY.js +1 -0
  112. package/dist/assets/effort-jJe4iMIq.js +39 -0
  113. package/dist/assets/{explode-BgZIWY9m.js → explode-CPnvJiTg.js} +1 -1
  114. package/dist/assets/{fitText-DQ2omSN0.js → fitText-DHbmSS-q.js} +1 -1
  115. package/dist/assets/{generate-Dl2EJ_SR.js → generate-COfYQFmT.js} +4 -4
  116. package/dist/assets/{generateBeats-DZHkvFvh.js → generateBeats-COflu5Zi.js} +1 -1
  117. package/dist/assets/{generateCourse-C9qvaJRo.js → generateCourse-BldPpgdh.js} +1 -1
  118. package/dist/assets/generateLive-DGwnpIip.js +24 -0
  119. package/dist/assets/homeTarget-CwFsJYwb.js +1 -0
  120. package/dist/assets/index-BIUYTk1W.css +1 -0
  121. package/dist/assets/index-LiHcEJt_.js +22 -0
  122. package/dist/assets/kokoro-DXRj0KQX.js +1 -0
  123. package/dist/assets/ledger-BssK9Pv2.js +1 -0
  124. package/dist/assets/{lib-DMAxsZKm.css → lib-DP9Kuxqk.css} +1 -1
  125. package/dist/assets/{liveSchema-B4bQtO88.js → liveSchema-DyfND6P2.js} +2 -2
  126. package/dist/assets/{loader-DKJEcbPm.js → loader-DgMLGfAC.js} +2 -2
  127. package/dist/assets/localBudget-CxLP6bjE.js +1 -0
  128. package/dist/assets/{mastery-CUfDeuqO.js → mastery-DB5qpRAy.js} +1 -1
  129. package/dist/assets/{media-BvwzACIX.js → media-VLRh6CX2.js} +2 -2
  130. package/dist/assets/{model-BFRTN9Eh.js → model-CAewjw45.js} +1 -1
  131. package/dist/assets/{neighborhoods-D7QjURnE.js → neighborhoods-CqECCmo8.js} +1 -1
  132. package/dist/assets/{notes-B0-EE0FK.js → notes-DzIAEESd.js} +1 -1
  133. package/dist/assets/pen-DtEW1xf4.js +24 -0
  134. package/dist/assets/{perfProbe-B9zJpjo9.js → perfProbe-ezVn1mOu.js} +1 -1
  135. package/dist/assets/{pin-CZAIlpXt.js → pin-BPGVDgnq.js} +1 -1
  136. package/dist/assets/pin-BXyyKnci.css +1 -0
  137. package/dist/assets/{planTracker-KKAtTBWs.js → planTracker-BwoKEftp.js} +1 -1
  138. package/dist/assets/portal-B9DmFo6J.js +1 -0
  139. package/dist/assets/{prewarm-B4ELBOxf.js → prewarm-BgUqAJbF.js} +1 -1
  140. package/dist/assets/providers-0DthJW_I.js +1 -0
  141. package/dist/assets/quietHours-DyynzDyC.js +1 -0
  142. package/dist/assets/{ready-jtAUOb62.js → ready-yBSGJubb.js} +1 -1
  143. package/dist/assets/{registry-CqhpLHM7.js → registry-7tKTrzeZ.js} +1 -1
  144. package/dist/assets/{registry-BFrgx1tE.js → registry-B53EEn8S.js} +1 -1
  145. package/dist/assets/{registry-CPiwQhAm.js → registry-BDXwUn3i.js} +1 -1
  146. package/dist/assets/{registry-CD1s3eQ-.js → registry-BJEvFgoL.js} +1 -1
  147. package/dist/assets/{registry-B0GIHERt.js → registry-BQzvA61G.js} +1 -1
  148. package/dist/assets/{registry-6DGRAB1m.js → registry-BT6ydF33.js} +1 -1
  149. package/dist/assets/{registry-D8O0apUT.js → registry-BdHj_oIs.js} +1 -1
  150. package/dist/assets/{registry-Dru0JcTa.css → registry-BgWzEkxc.css} +1 -1
  151. package/dist/assets/{registry-Vp8VuMV0.js → registry-Bl2qfp5V.js} +1 -1
  152. package/dist/assets/registry-Bl7zAWKt.js +2 -0
  153. package/dist/assets/{registry-6MOD-I7p.js → registry-BlujNlQJ.js} +1 -1
  154. package/dist/assets/{registry-C28gYnVq.js → registry-CE1T0z9x.js} +1 -1
  155. package/dist/assets/{registry-4mMEt1Xy.css → registry-CEV5h2cu.css} +1 -1
  156. package/dist/assets/{registry-ZOWzhOHk.css → registry-CGB0jkFI.css} +1 -1
  157. package/dist/assets/{registry-BFbfXK-W.js → registry-Cgo4C0ux.js} +1 -1
  158. package/dist/assets/registry-CwRTUk0R.js +1 -0
  159. package/dist/assets/{registry-GeAC3ZD7.js → registry-D06LKiUk.js} +1 -1
  160. package/dist/assets/registry-Dbe9TQPw.css +1 -0
  161. package/dist/assets/registry-Diyud3DF.js +1 -0
  162. package/dist/assets/registry-DjvftnY2.css +1 -0
  163. package/dist/assets/{registry-w4R6c89s.js → registry-KRYoVMCh.js} +1 -1
  164. package/dist/assets/registry-QbArAJKB.js +1 -0
  165. package/dist/assets/registry-dmR14XnY.css +1 -0
  166. package/dist/assets/registry-g2sBcIrf.css +1 -0
  167. package/dist/assets/{registry-CcOO8UZr.js → registry-qRfnKTt4.js} +1 -1
  168. package/dist/assets/{relate-BYdM5eiV.js → relate-aQFFr11O.js} +1 -1
  169. package/dist/assets/{replay-TYXO0Brm.js → replay-CalqEgdW.js} +1 -1
  170. package/dist/assets/route-CMdTFx0P.js +1 -0
  171. package/dist/assets/{run-Df10YPyB.js → run-CuHaB8wF.js} +1 -1
  172. package/dist/assets/{run-gmqUaxcL.js → run-CwMSPOps.js} +1 -1
  173. package/dist/assets/{run-DlvA3l28.js → run-DCQrxgHA.js} +1 -1
  174. package/dist/assets/select-wEtBn9U6.js +3 -0
  175. package/dist/assets/shapes-BwoDrn09.js +1 -0
  176. package/dist/assets/shard000-Bx6Nmt0m.js +1 -0
  177. package/dist/assets/shard001-CL6O9SLr.js +1 -0
  178. package/dist/assets/shard002-vLQ0Ss-O.js +1 -0
  179. package/dist/assets/shard003-kKZdpzuh.js +1 -0
  180. package/dist/assets/shard004-CdVohAu1.js +1 -0
  181. package/dist/assets/shard005-CMzF_uJB.js +1 -0
  182. package/dist/assets/shard006-DQoDWuoN.js +1 -0
  183. package/dist/assets/shard007-Ck0N0IUk.js +1 -0
  184. package/dist/assets/shard008-Dt395x0Q.js +1 -0
  185. package/dist/assets/shard009-D_z8Lhqh.js +1 -0
  186. package/dist/assets/shard010-CQfR6lnk.js +1 -0
  187. package/dist/assets/shard011-l-w2t2Ie.js +1 -0
  188. package/dist/assets/shard012-BTw_UO1C.js +1 -0
  189. package/dist/assets/shard013-D8ZjKKYb.js +1 -0
  190. package/dist/assets/shard014-Cth_76It.js +1 -0
  191. package/dist/assets/shard015-DdYJVsHx.js +1 -0
  192. package/dist/assets/shard016-BdlBf9uZ.js +1 -0
  193. package/dist/assets/shard017-C3HTxh6t.js +1 -0
  194. package/dist/assets/shard018-Mf4wvqVk.js +1 -0
  195. package/dist/assets/shard019-Dpcy1Arx.js +1 -0
  196. package/dist/assets/shard020-BNvKfQld.js +1 -0
  197. package/dist/assets/shard021-D0kpI_PQ.js +1 -0
  198. package/dist/assets/shard022-Cjms7kAe.js +1 -0
  199. package/dist/assets/shard023-Bdwci7fy.js +1 -0
  200. package/dist/assets/shard024-BBoyPtpP.js +1 -0
  201. package/dist/assets/shard025-lMGpgN_0.js +3 -0
  202. package/dist/assets/shard026-Bp3UVI4_.js +1 -0
  203. package/dist/assets/shard027-C4HTpdeT.js +1 -0
  204. package/dist/assets/shard028-BsFTH3Sf.js +1 -0
  205. package/dist/assets/shard029-B3dEcXPy.js +1 -0
  206. package/dist/assets/shard030-DWwA-fNs.js +5 -0
  207. package/dist/assets/shard031-RhqA_0nH.js +1 -0
  208. package/dist/assets/shard032-BlZdG1Yi.js +1 -0
  209. package/dist/assets/shard033-Dmx2lOjI.js +1 -0
  210. package/dist/assets/shard034-BLOFKJT4.js +1 -0
  211. package/dist/assets/shard035-DMXdH733.js +1 -0
  212. package/dist/assets/shard036-DzOiEn23.js +1 -0
  213. package/dist/assets/shard037-BcHfVaYM.js +1 -0
  214. package/dist/assets/shard038-KozOx-Jh.js +1 -0
  215. package/dist/assets/shard039-apdILQwC.js +1 -0
  216. package/dist/assets/shard040-BrNXGaBi.js +1 -0
  217. package/dist/assets/shard041-D6eq9h1u.js +4 -0
  218. package/dist/assets/shard042-M-L34DbY.js +1 -0
  219. package/dist/assets/shard043-Ct6_C2pN.js +1 -0
  220. package/dist/assets/shard044-Bo0iaVHx.js +1 -0
  221. package/dist/assets/shard045-9ccZ4Y_N.js +1 -0
  222. package/dist/assets/shard046-eXoP478L.js +1 -0
  223. package/dist/assets/shard047-N56r6Lsz.js +1 -0
  224. package/dist/assets/shard048-BeKX7cI8.js +1 -0
  225. package/dist/assets/shard049-hPaNN2sL.js +1 -0
  226. package/dist/assets/shard050-B-YpP0B6.js +1 -0
  227. package/dist/assets/shard051-Bww5_KB2.js +1 -0
  228. package/dist/assets/shard052-DErwF8Df.js +1 -0
  229. package/dist/assets/shard053-C-qGH4jz.js +1 -0
  230. package/dist/assets/shard054-kcSxZrSj.js +1 -0
  231. package/dist/assets/shard055-CsETBTqa.js +1 -0
  232. package/dist/assets/shard056-CdBR4qTC.js +1 -0
  233. package/dist/assets/shard057-yRUG8B9e.js +1 -0
  234. package/dist/assets/shard058-DeDAnECG.js +1 -0
  235. package/dist/assets/shard059-Dh6jbDnW.js +1 -0
  236. package/dist/assets/shard060-B5kpWrhW.js +1 -0
  237. package/dist/assets/shard061-BTnj5LZA.js +1 -0
  238. package/dist/assets/shard062-DC7LTaNc.js +1 -0
  239. package/dist/assets/shard063-C8SIGCfd.js +1 -0
  240. package/dist/assets/shard064-DLyASocW.js +1 -0
  241. package/dist/assets/shard065-Cy_yV4ry.js +1 -0
  242. package/dist/assets/shard066-BmjVQqFX.js +1 -0
  243. package/dist/assets/shard067-uZUJsqtF.js +1 -0
  244. package/dist/assets/shard068-CXVjyJU4.js +1 -0
  245. package/dist/assets/shard069-CyfmjAm-.js +4 -0
  246. package/dist/assets/shard070-CxN3xiuY.js +12 -0
  247. package/dist/assets/shard071-CP1WrYC-.js +1 -0
  248. package/dist/assets/shard072-D6L5Yr05.js +1 -0
  249. package/dist/assets/shard073-DFEzkwg2.js +1 -0
  250. package/dist/assets/shard074-BSv3rvRL.js +1 -0
  251. package/dist/assets/shard075-Bt0OjGVd.js +1 -0
  252. package/dist/assets/shard076-DZHs0uzd.js +1 -0
  253. package/dist/assets/{share-kW3pZ027.js → share--tpc1nLE.js} +1 -1
  254. package/dist/assets/speed-BOytg6bC.js +1 -0
  255. package/dist/assets/store-B2Rpbqgg.js +1 -0
  256. package/dist/assets/store-Ba9vzL4H.js +1 -0
  257. package/dist/assets/store-BwyOArJl.js +1 -0
  258. package/dist/assets/store-ruEsXJjU.js +1 -0
  259. package/dist/assets/streamParse-BX0bAppQ.js +2 -0
  260. package/dist/assets/{templates-DHeyJ32F.css → templates-BIkAr4YH.css} +1 -1
  261. package/dist/assets/{theme-7IrMJ70_.js → theme-D5D55hZi.js} +1 -1
  262. package/dist/assets/{threads-Cu2t3070.js → threads-DNfxMTwx.js} +1 -1
  263. package/dist/assets/{useDashboardLoop-DDqCFJKY.js → useDashboardLoop-ifcuVRo-.js} +3 -3
  264. package/dist/assets/{useDashboards-SRk8LqHe.js → useDashboards-lgQnk2Al.js} +1 -1
  265. package/dist/assets/useFocusTrap-CJmpNZv2.js +1 -0
  266. package/dist/assets/useInView-DsTvv7L_.js +1 -0
  267. package/dist/assets/useInterval-DDgFrel2.js +1 -0
  268. package/dist/assets/{useLiveConfig-Cpy0_E_-.js → useLiveConfig-B4CmBiAK.js} +1 -1
  269. package/dist/assets/useStudy-CySgE3Cx.js +1 -0
  270. package/dist/assets/{walkSync-CPsd-xu7.js → walkSync-DBne70gg.js} +1 -1
  271. package/dist/demo-assets/CREDITS.md +94 -50
  272. package/dist/demo-assets/images/arnel-lighthouse.avif +0 -0
  273. package/dist/demo-assets/images/cliff-fields.avif +0 -0
  274. package/dist/demo-assets/images/crater-panorama.avif +0 -0
  275. package/dist/demo-assets/images/furnas-lake.avif +0 -0
  276. package/dist/demo-assets/images/green-coast-raw.avif +0 -0
  277. package/dist/demo-assets/images/green-coast.avif +0 -0
  278. package/dist/demo-assets/images/island-coast-poster.avif +0 -0
  279. package/dist/demo-assets/images/nordeste-town.avif +0 -0
  280. package/dist/demo-assets/images/sea-cliffs.avif +0 -0
  281. package/dist/demo-assets/images/sete-cidades.avif +0 -0
  282. package/dist/demo-assets/images/tea-terraces.avif +0 -0
  283. package/dist/demo-assets/pdf/cfd-primer.pdf +0 -0
  284. package/dist/demo-assets/video/island-coast.webm +0 -0
  285. package/dist/fonts/fonts.css +18 -0
  286. package/dist/index.html +38 -10
  287. package/dist/legal/PRIVACY.md +1 -0
  288. package/dist/legal/TERMS.md +1 -1
  289. package/dist/legal/THIRD-PARTY.txt +13 -5
  290. package/package.json +3 -2
  291. package/dist/assets/AnnotationLayer-qV6CIUZv.js +0 -0
  292. package/dist/assets/AtlasView-B5fkQhO6.css +0 -1
  293. package/dist/assets/BriefingPlayer-TpFZB77N.css +0 -1
  294. package/dist/assets/CanvasSkeleton-iy6DBvde.css +0 -1
  295. package/dist/assets/CardEditor-BY1bZiV6.css +0 -1
  296. package/dist/assets/ConversationVideoStudio-C1sd4k53.js +0 -1
  297. package/dist/assets/ConversationVideoStudio-CIAMxElj.css +0 -1
  298. package/dist/assets/CourseLessonReader-YCcNKEW7.js +0 -2
  299. package/dist/assets/CoursesApp-Dz6xjf4V.js +0 -2
  300. package/dist/assets/CrossExamPanel-CZ0ShGma.css +0 -1
  301. package/dist/assets/DashboardDetail-DOfm8UCQ.js +0 -2
  302. package/dist/assets/DashboardLoopGate-Cf0y_HQ7.js +0 -2
  303. package/dist/assets/DashboardLoopRuntime-CnN5VayH.js +0 -1
  304. package/dist/assets/DashboardsApp-_gbfdbX6.js +0 -2
  305. package/dist/assets/DeepZoomApp-fRXCJHHZ.css +0 -1
  306. package/dist/assets/DelegatePanel-CHEB-OZl.js +0 -33
  307. package/dist/assets/DelegatePanel-Cf85-0qE.css +0 -1
  308. package/dist/assets/DemoGallery-DBqnu8TR.js +0 -1
  309. package/dist/assets/FlagshipShowcase-3qQDOK6g.js +0 -1
  310. package/dist/assets/ForecastPanel-Da2ZBUrE.css +0 -1
  311. package/dist/assets/GalleryApp-BWQ-J450.js +0 -1
  312. package/dist/assets/LeverPanel-DhpJY76O.css +0 -1
  313. package/dist/assets/LibraryOverlay-CnKWDMG_.css +0 -1
  314. package/dist/assets/LiveApp-C-OPBybd.css +0 -1
  315. package/dist/assets/LiveApp-DH3OxJFV.js +0 -79
  316. package/dist/assets/LiveSettings-CmgrMqvK.css +0 -1
  317. package/dist/assets/LiveSettings-CuVMy7rZ.js +0 -6
  318. package/dist/assets/MindShape-C_Bo9hW9.js +0 -1
  319. package/dist/assets/MindShape-CaPeUo-a.css +0 -1
  320. package/dist/assets/PresentationDeck-B_EI33Pp.js +0 -1
  321. package/dist/assets/PrismApp-DtLsPiQF.js +0 -2
  322. package/dist/assets/PrismAskController-DBoxQSJR.css +0 -1
  323. package/dist/assets/PrismOverlay-BTfAicBt.css +0 -1
  324. package/dist/assets/Recap-DCiiWNiV.css +0 -1
  325. package/dist/assets/RippleApp-D5j2VCt2.js +0 -2
  326. package/dist/assets/RippleOverlay-_iiZsQVZ.css +0 -1
  327. package/dist/assets/RippleOverlay-zcXAHPuJ.js +0 -6
  328. package/dist/assets/SeeDontRead-Dqfzha0V.js +0 -1
  329. package/dist/assets/ShareModal-D1QuQEko.css +0 -1
  330. package/dist/assets/ShareModal-DWxlrJSz.js +0 -2
  331. package/dist/assets/SrsReview-B1B2VekR.css +0 -1
  332. package/dist/assets/TopicCanvas-LMI0zC7R.js +0 -2
  333. package/dist/assets/TopicCanvas-uRuHi99s.css +0 -1
  334. package/dist/assets/WhyMachineOverlay-BZk3PVTl.css +0 -1
  335. package/dist/assets/WorldOverlay-BaQNNClA.js +0 -2
  336. package/dist/assets/ZoomDeck-B2SjNwY7.css +0 -1
  337. package/dist/assets/canvas-Bsx3eSaS.js +0 -1
  338. package/dist/assets/capture-D8uPIcfj.js +0 -2
  339. package/dist/assets/dashboards-C1u2ks-d.css +0 -1
  340. package/dist/assets/generateLive-B6purd69.js +0 -51
  341. package/dist/assets/homeTarget-CsO8nY7z.js +0 -1
  342. package/dist/assets/index-Dk0QapqQ.js +0 -22
  343. package/dist/assets/index-DmKgC_TJ.css +0 -1
  344. package/dist/assets/kokoro-P_fkcX-A.js +0 -1
  345. package/dist/assets/layout-CEoNLr-w.js +0 -1
  346. package/dist/assets/pageVisibility-BxUVsw7Z.js +0 -1
  347. package/dist/assets/pen-DNMslo3e.js +0 -24
  348. package/dist/assets/pin-D-4Zjiik.css +0 -1
  349. package/dist/assets/portal-Dogggsub.js +0 -1
  350. package/dist/assets/providers-BovElgRL.js +0 -1
  351. package/dist/assets/quietHours-CeBje_uU.js +0 -1
  352. package/dist/assets/registry-BSX3aFUw.js +0 -1
  353. package/dist/assets/registry-Bv1f5UU4.js +0 -2
  354. package/dist/assets/registry-Cse2wF7x.css +0 -1
  355. package/dist/assets/registry-Dye5m3qt.css +0 -1
  356. package/dist/assets/registry-GeSy4i7R.css +0 -1
  357. package/dist/assets/registry-WHd1PwU3.js +0 -1
  358. package/dist/assets/registry-Xl8mAnKq.js +0 -1
  359. package/dist/assets/registry-tkd3UhWn.css +0 -1
  360. package/dist/assets/shapes-Cx5SCKgj.js +0 -39
  361. package/dist/assets/speed-K5_Ebj-8.js +0 -1
  362. package/dist/assets/store-BfHRbVKz.js +0 -1
  363. package/dist/assets/store-CsjDEADX.js +0 -1
  364. package/dist/assets/store-DpObYU1u.js +0 -1
  365. package/dist/assets/store-gohr8YVT.js +0 -1
  366. package/dist/assets/streamParse-B-Gjwa9T.js +0 -2
  367. package/dist/assets/useFocusTrap-DBtkeyRy.js +0 -1
  368. package/dist/assets/useInView-CXTOAEV3.js +0 -1
  369. package/dist/assets/useStudy-GwNcQWtv.js +0 -1
  370. package/dist/demo-assets/images/basalt-cliffs.jpg +0 -0
  371. package/dist/demo-assets/images/capelinhos.jpg +0 -0
  372. package/dist/demo-assets/images/cliff-fields.jpg +0 -0
  373. package/dist/demo-assets/images/crater-panorama.jpg +0 -0
  374. package/dist/demo-assets/images/furnas-lake.jpg +0 -0
  375. package/dist/demo-assets/images/green-coast.jpg +0 -0
  376. package/dist/demo-assets/images/overcast-coast.jpg +0 -0
  377. package/dist/demo-assets/images/patchwork-fields.jpg +0 -0
  378. package/dist/demo-assets/images/ponta-delgada.jpg +0 -0
  379. package/dist/demo-assets/images/sete-cidades.jpg +0 -0
  380. package/dist/demo-assets/images/village-street.jpg +0 -0
  381. package/dist/demo-assets/video/azores-film.webm +0 -0
  382. /package/dist/assets/{BriefingPlayer-C0D_2ILa.js → BriefingPlayer-74mRKyjl.js} +0 -0
  383. /package/dist/assets/{CrossExamPanel-CdIYUu-B.js → CrossExamPanel-BfeGr5iw.js} +0 -0
  384. /package/dist/assets/{ForecastPanel-zPUh2ClQ.js → ForecastPanel-OfW39WGS.js} +0 -0
  385. /package/dist/assets/{LeverPanel-D1SNRGdm.js → LeverPanel-vco5UK2U.js} +0 -0
  386. /package/dist/assets/{WhyMachineOverlay-ks9-rRiL.js → WhyMachineOverlay-D2K7y8SA.js} +0 -0
  387. /package/dist/assets/{lib-B7OE1ZQQ.js → lib-u95BsX_B.js} +0 -0
  388. /package/dist/assets/{registry-7poQfBaM.js → registry-C4Yh05pk.js} +0 -0
  389. /package/dist/assets/{registry-Daypk4uR.js → registry-S3j4OpCH.js} +0 -0
@@ -0,0 +1,79 @@
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-DGwnpIip.js","assets/blockLabel-FogyzEQY.js","assets/deepenStore-BWLLzLCY.js","assets/catalog-BHjl-1uH.js","assets/history-D2EH2X6D.js","assets/catalog-Db9GWM6N.js","assets/facts-BUGuVUIc.js","assets/blockTypes-DUDdP3pB.js","assets/streamParse-BX0bAppQ.js","assets/liveSchema-DyfND6P2.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-0DthJW_I.js","assets/http-Lar_UMKb.js","assets/info-CiqHR5cs.js","assets/route-CMdTFx0P.js","assets/effort-jJe4iMIq.js","assets/index-LiHcEJt_.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-D5D55hZi.js","assets/index-BIUYTk1W.css","assets/speed-BOytg6bC.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-yBSGJubb.js","assets/shapes-BwoDrn09.js","assets/ledger-BssK9Pv2.js","assets/now-C9-UAzTC.js","assets/select-wEtBn9U6.js","assets/TopicCanvas-Bw4bMFpe.js","assets/loader-DgMLGfAC.js","assets/FallbackCard-ap_4wOfj.js","assets/FallbackCard-D_6ps1xA.css","assets/useFocusTrap-CJmpNZv2.js","assets/motion-BY_Egaxm.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/CanvasSkeleton-BmGjJHUQ.js","assets/CanvasSkeleton-DYASkTjW.css","assets/richText-BkxJhl9N.js","assets/toast-BBNs2h3L.js","assets/format-q0LwBjID.js","assets/useValidatedImage-BQi2c66o.js","assets/lib-u95BsX_B.js","assets/BlockEmpty-B82uCse8.js","assets/motion-DxHSlPN6.js","assets/lib-DP9Kuxqk.css","assets/TopicCanvas-DWTm611H.css","assets/HowItWorks-DPFpdeGE.js","assets/generateBeats-COflu5Zi.js","assets/walkSync-DBne70gg.js","assets/kokoro-DXRj0KQX.js","assets/nextFrame-12y0UrAd.js","assets/canvas-C3O7MEA3.js","assets/ReplayCard-B6NYiYzQ.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-CVj7R6F4.js","assets/neighborhoods-CqECCmo8.js","assets/chapters-CIvdCeBC.js","assets/threads-DNfxMTwx.js","assets/time-BHTmJR1s.js","assets/Library-DmrtHjUf.css","assets/LiveSettings-BITIaMoT.js","assets/FeatureUseNotice-Bda9jr3W.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/useLiveConfig-B4CmBiAK.js","assets/store-BwyOArJl.js","assets/friendlyAsk-BBdRZIar.js","assets/localBudget-CxLP6bjE.js","assets/quietHours-DyynzDyC.js","assets/DropSelect-GwIXHA5o.js","assets/DropSelect-B4lqCEjw.css","assets/useStudy-CySgE3Cx.js","assets/store-D2IJF4SA.js","assets/queue-Adae4IzW.js","assets/LiveSettings-Dho0OxlM.css","assets/DashboardDetail-BrnAdWfy.js","assets/store-Ba9vzL4H.js","assets/route-D4kd-D3B.js","assets/useDashboards-lgQnk2Al.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-ifcuVRo-.js","assets/predictions-CkVKHq-5.js","assets/notify-Bz4wuE4T.js","assets/dashboardEvents-CiayRLrH.js","assets/confirmAdd-CZ829Mbx.js","assets/planTracker-BwoKEftp.js","assets/pin-BPGVDgnq.js","assets/pin-BXyyKnci.css","assets/CadenceCard-DxceyiPA.js","assets/CheckLogRail-BibJTid0.js","assets/useLedger-1WVXef68.js","assets/checkLogModel-BMtruriG.js","assets/CheckLogRail-BOaXnqWK.css","assets/DashboardDetail-8J8TsdQg.css","assets/dashboards-Cvs28p3Z.css","assets/DashboardSettings-DJon1Q4o.js","assets/UnderstoodPanel-DmJph4el.js","assets/UnderstoodPanel-Q6GX1TFq.css","assets/ZoomDeck-DlnesweX.js","assets/portal-B9DmFo6J.js","assets/useZoomGesture-CN0p0lHL.js","assets/ZoomDeck-DdLNsrHV.css","assets/AtlasView-DO_p0TdZ.js","assets/store-D-f8ZuaK.js","assets/AtlasView-B7yObdf8.css","assets/RippleOverlay-BSxubBwj.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-B3hg2KMN.css","assets/CardEditor-D4slxmIM.js","assets/CardEditor-CiAfT78z.css","assets/CourseRail-BQmUsG6v.js","assets/store-B2Rpbqgg.js","assets/generateCourse-BldPpgdh.js","assets/useSrsCards-C27o39fF.js","assets/deckLine-NBd3MyGT.js","assets/CourseRail-CUa7uIGG.css","assets/MindMapViewerDrawer-CKdJtHno.js","assets/MindShape-B3lg_z4X.js","assets/Presence-UqXfH4Y-.js","assets/geometry-DXAbnb0J.js","assets/MindShape-CozR9W8M.css","assets/Recap-BOl3SUh0.js","assets/Recap-D3NlzM1p.css","assets/LibraryOverlay-DSUWcUe4.js","assets/LibraryOverlay-BkPYm0Bs.css","assets/ReplayOverlay-BJKtJ-vc.js","assets/replay-CalqEgdW.js","assets/AnnotationLayer-Cccb12ps.js","assets/gesture-Bouqjr3g.js","assets/emphasize-BqCIst-B.js","assets/AnnotationLayer-ClU-e6qL.css","assets/ReplayOverlay-DzkcTnCA.css","assets/ShareModal-xYdZWJxy.js","assets/capture-DgJLQ_0-.js","assets/share--tpc1nLE.js","assets/ReelJelly-D5e-jt-8.js","assets/ShareModal-I_sxHKLv.css","assets/ExportModal-DBUjC71U.js","assets/notes-DzIAEESd.js","assets/registry-BDXwUn3i.js","assets/scale-Bcgfo6Hp.js","assets/registry-types-D3q_LrlV.js","assets/fitText-DHbmSS-q.js","assets/registry-CNgybLQv.css","assets/registry-BT6ydF33.js","assets/openWorld-BHTJM39n.js","assets/display-CAb_PiGv.js","assets/registry-BZuT2Epw.css","assets/registry-qRfnKTt4.js","assets/registry-2GJZ46M8.css","assets/registry-CPImC7mO.js","assets/empty-BO1NC9qY.js","assets/registry-B1KQ1VPZ.css","assets/registry-BQzvA61G.js","assets/spreadLabels-CQ8hufvK.js","assets/registry-CuVk7MAI.css","assets/registry-BdHj_oIs.js","assets/CodeOutput-DF892aIR.js","assets/useTimeout-Cm4yzted.js","assets/registry-BzNLfje1.css","assets/registry-Bl2qfp5V.js","assets/registry-twSIyxJQ.css","assets/registry-Cgo4C0ux.js","assets/registry-UFIuwh3i.css","assets/registry-C4Yh05pk.js","assets/registry-CGB0jkFI.css","assets/registry-CE1T0z9x.js","assets/registry-CRisz4Ca.css","assets/registry-Bl7zAWKt.js","assets/useInterval-DDgFrel2.js","assets/registry-CvylL2BN.css","assets/registry-Ci65uThi.js","assets/useSpotlightWalk-DxlxBezO.js","assets/registry-BAoRB8rd.css","assets/registry-D06LKiUk.js","assets/registry-T3i2Q9SI.css","assets/registry-B53EEn8S.js","assets/registry-DjvftnY2.css","assets/registry-BJEvFgoL.js","assets/quizResult-DB8yeqDr.js","assets/stepDriver-DwjFet6U.js","assets/registry-B5S3brjM.css","assets/registry-KRYoVMCh.js","assets/safeCssColor-di93BXgG.js","assets/registry-CEV5h2cu.css","assets/registry-DO4hGO5e.js","assets/registry-CRM7y8QT.css","assets/registry-7tKTrzeZ.js","assets/registry-g2sBcIrf.css","assets/registry-CwRTUk0R.js","assets/registry-C3ezxLR3.css","assets/registry-BlujNlQJ.js","assets/registry-dmR14XnY.css","assets/registry-Diyud3DF.js","assets/registry-DpMI23iE.css","assets/registry-S3j4OpCH.js","assets/registry-Dbe9TQPw.css","assets/registry-QbArAJKB.js","assets/registry-BgWzEkxc.css","assets/registry-DLyrLfe-.js","assets/notes-A9t4jdfx.css","assets/ready-Ba6nk9O1.js","assets/ExportModal-D4WpAg2c.css","assets/ExtractionPreview-D4M6eXqb.js","assets/store-ruEsXJjU.js","assets/relate-aQFFr11O.js","assets/PinToDashboard-DpQjBLPa.js","assets/PrismOverlay-Pp6ZKmTc.js","assets/penStrokes-DlHnO9xE.js","assets/types-CaO6xOn5.js","assets/pen-DtEW1xf4.js","assets/PrismOverlay-BwnF4BEn.css","assets/WorldOverlay-BcjqG1BR.js","assets/value-Dx7DZob4.js","assets/types-DuEbJpIA.js","assets/engine-BiM6INsW.js","assets/engine-CTvOaA86.css","assets/WorldOverlay-D7ay5y4D.css","assets/SynthesisOverlay-DCa-2Pz_.js","assets/PresentationDeck-CfYadu9V.js","assets/DelegatePanel-DN_ZL0j7.js","assets/DelegatePanel-D17XvWYd.css","assets/SrsReview-Gr6Y0QTQ.js","assets/SrsReview-DmBcJCMa.css","assets/TourPrism-DbinDupp.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{$ as c,A as l,B as u,D as d,E as f,G as p,H as m,J as h,K as g,L as _,M as v,O as y,Q as b,R as x,S,U as C,V as w,W as T,X as E,Y as D,Z as O,a as k,at as A,et as j,j as M,k as N,lt as P,q as F,r as I,rt as L,t as R,z as ee}from"./index-LiHcEJt_.js";import{n as z}from"./icons-gLFQTv74.js";import{n as te,t as ne}from"./spokenText-C88IQJ0M.js";import{a as re,i as ie,n as ae}from"./loader-DgMLGfAC.js";import{n as oe,r as se}from"./blockLabel-FogyzEQY.js";import{t as B}from"./useFocusTrap-CJmpNZv2.js";import{t as ce}from"./motion-BY_Egaxm.js";import{r as le,s as ue,t as de}from"./CanvasSkeleton-BmGjJHUQ.js";import{t as fe}from"./Presence-UqXfH4Y-.js";import{t as pe}from"./MindShape-B3lg_z4X.js";import{n as me}from"./openWorld-BHTJM39n.js";import{i as he,r as ge,t as _e}from"./display-CAb_PiGv.js";import{r as V,t as ve}from"./sourceHost-BV3t2XDb.js";import{t as ye}from"./stepDriver-DwjFet6U.js";import{A as be,C as xe,D as Se,E as Ce,O as we,T as Te,_ as Ee,b as De,c as Oe,d as ke,h as Ae,j as je,l as Me,o as Ne,r as Pe,u as Fe,v as Ie,w as Le,y as Re}from"./kokoro-DXRj0KQX.js";import{t as ze}from"./portal-B9DmFo6J.js";import{a as Be,i as Ve,o as He,r as Ue,s as We}from"./threads-DNfxMTwx.js";import{t as Ge}from"./FeatureUseNotice-Bda9jr3W.js";import{n as Ke,r as qe}from"./history-D2EH2X6D.js";import{n as Je}from"./nextFrame-12y0UrAd.js";import{a as Ye,d as Xe,i as Ze,l as Qe,n as $e,o as et,r as tt,s as nt,t as rt,u as it}from"./walkSync-DBne70gg.js";import{n as at,t as ot}from"./generateBeats-COflu5Zi.js";import{n as st,r as ct,t as lt}from"./AnnotationLayer-Cccb12ps.js";import{n as ut}from"./emphasize-BqCIst-B.js";import{n as dt,o as ft}from"./streamParse-BX0bAppQ.js";import{n as pt,t as mt}from"./registry-DLyrLfe-.js";import{t as ht}from"./ready-Ba6nk9O1.js";import{t as gt}from"./registry-DGNSqTxE.js";import{i as _t,r as vt}from"./info-CiqHR5cs.js";import{t as yt}from"./friendlyAsk-BBdRZIar.js";import{a as bt,c as xt,i as St,n as Ct,r as wt,s as Tt}from"./store-ruEsXJjU.js";import{n as Et,r as Dt}from"./chapters-CIvdCeBC.js";/* empty css */import{g as Ot,h as kt,l as At,m as jt,p as Mt,s as Nt,t as Pt,v as Ft}from"./attachments-BW-vki-E.js";import{t as It}from"./types-CaO6xOn5.js";import{J as Lt,Z as Rt,a as zt,c as Bt,m as Vt,q as Ht,u as Ut}from"./store-Ba9vzL4H.js";import{t as Wt}from"./providers-0DthJW_I.js";import{a as Gt,c as Kt,l as qt,n as Jt,o as Yt,r as Xt,s as Zt,u as Qt}from"./useLiveConfig-B4CmBiAK.js";import{prewarmLive as $t}from"./prewarm-BgUqAJbF.js";import{c as en,f as tn,g as nn,m as rn,p as an,r as on,s as sn,u as cn}from"./effort-jJe4iMIq.js";import{t as ln}from"./TopbarMenu-DQXxqSWY.js";import{a as un,o as dn,r as fn}from"./store-BwyOArJl.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-DyynzDyC.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{r as jn}from"./speed-BOytg6bC.js";import{i as Mn,n as Nn,r as Pn,t as Fn}from"./cache-CvbSI-pr.js";import{r as In}from"./verbatim-DBTj9sPD.js";import{n as Ln}from"./citation-BsSvaaer.js";import{n as Rn,o as zn,t as Bn}from"./validate-sGUCmPAs.js";import{n as Vn,t as Hn}from"./number-zqlPMliA.js";import{a as Un,i as Wn,r as Gn,s as Kn}from"./useStudy-CySgE3Cx.js";import{t as qn}from"./ready-yBSGJubb.js";import{t as Jn}from"./DropSelect-GwIXHA5o.js";import{t as Yn}from"./route-D4kd-D3B.js";import{t as Xn}from"./useDashboards-lgQnk2Al.js";import{n as Zn,r as Qn}from"./value-Dx7DZob4.js";import{i as $n,n as er}from"./shapes-BwoDrn09.js";import{a as tr,d as nr,g as rr,l as ir,n as ar,p as or,r as sr}from"./store-D2IJF4SA.js";import{t as cr}from"./useZoomGesture-CN0p0lHL.js";import{a as lr,o as ur,t as dr}from"./store-D-f8ZuaK.js";import{SEED_SHIP as fr}from"./seed-b1xc0dj2.js";import{t as pr}from"./buildShip-BgFg98tH.js";import{n as mr}from"./parseDiff-D8uBQ9mQ.js";import{enrichShipModel as hr}from"./generate-COfYQFmT.js";import{a as gr,c as _r,g as vr,h as yr,l as br,o as xr,p as Sr,r as Cr,t as wr}from"./store-B2Rpbqgg.js";import{r as Tr}from"./courseSeed-CZdNBTTs.js";import{i as Er,n as Dr,r as Or,t as kr}from"./mastery-DB5qpRAy.js";var H=t(),Ar=P(),jr=/\?\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 Mr(e){return jr.test(e.trim())}function Nr(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 Pr(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=Nr(n,t),i=Mr(t);return r&&!i?(e.fill(r),!0):!r&&!i}function Fr(e){return e.alwaysOn&&e.sttOk&&!e.composerHasText}function Ir(e,t){let n=(0,H.useRef)({...e,...t});n.current={...e,...t};let r=e.listening||Fr(e);(0,H.useEffect)(()=>{if(!r)return;let e=()=>{document.hidden?n.current.listening&&n.current.stop():Fr(n.current)&&!n.current.listening&&n.current.start()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[r])}var U=r(),Lr=200;function Rr(e){let t=e.trim().split(/\s+/).filter(Boolean).length;return Math.min(8e3,700+t*360)}function zr(e,t){let n=(0,H.useRef)(e);n.current=e;let[r,i]=(0,H.useState)(null),a=(0,H.useRef)(null),o=(0,H.useCallback)(e=>{a.current=e,i(e)},[]),s=(0,H.useRef)(void 0),c=(0,H.useRef)(void 0),l=(0,H.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,H.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)},Rr(i))},Lr)},[l,o]);return(0,H.useEffect)(()=>()=>{l(),o(null)},[t,l,o]),{narrate:u,narratingId:r}}var Br=`mavea-view-mode`,Vr=Br,Hr=`everything`,W=new Set([`canvas`,`world`]);function Ur(e){return e===`focus`||e===`everything`||e===`canvas`||e===`world`}var Wr=null;function Gr(){try{if(typeof localStorage>`u`)return Hr;let e=localStorage.getItem(Br);return Ur(e)&&!W.has(e)?e:Hr}catch{return Hr}}function Kr(){return Gr()}function G(){return Wr||(Wr=Gr(),Wr)}function qr(e){if(Ur(e)){Wr=e;try{typeof localStorage<`u`&&!W.has(e)&&localStorage.setItem(Br,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(Vr))}catch{}}}function Jr(){let[e,t]=(0,H.useState)(()=>G());return(0,H.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(G());return window.addEventListener(Vr,e),()=>window.removeEventListener(Vr,e)},[]),[e,(0,H.useCallback)(qr,[])]}function Yr({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,H.useRef)(null),C=(0,H.useRef)(null),[w,T]=(0,H.useState)(!1);(0,H.useEffect)(()=>{if(!g)return;T(!0);let e=setTimeout(()=>T(!1),1100);return()=>clearTimeout(e)},[g]);let E=(0,H.useRef)(!1),D=(0,H.useRef)(null),O=(0,H.useRef)(!1),k=(0,H.useRef)(y);k.current=y,(0,H.useEffect)(()=>()=>{E.current&&k.current?.()},[]),(0,H.useEffect)(()=>{a!==`hold`&&(O.current=!1,E.current&&(E.current=!1,D.current=null,k.current?.()))},[a]),(0,H.useEffect)(()=>{!r&&S.current&&S.current.focus()},[r]),(0,H.useEffect)(()=>{p&&S.current&&S.current.focus()},[p]);let A=(0,H.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,H.useCallback)(()=>{E.current&&(E.current=!1,D.current=null,v?.())},[v]),M=(0,H.useCallback)(e=>{D.current===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),j())},[j]),N=(0,H.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,H.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,H.useCallback)(e=>{a!==`hold`||e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),j())},[j,a]),I=(0,H.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,U.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,U.jsx)(z.micOff,{}):(0,U.jsx)(z.mic,{})});return(0,U.jsxs)(`div`,{className:`composer`,children:[x?(0,U.jsxs)(`div`,{className:`mic-btn-wrap`,children:[R,x]}):R,f&&!e?(0,U.jsx)(`div`,{className:`live-listen heard`,children:(0,U.jsxs)(`span`,{style:{color:`var(--text-primary)`},children:[`"`,f,`"`]})}):r&&!e?(0,U.jsxs)(`div`,{className:`live-listen`,children:[(0,U.jsx)(`span`,{className:`wave`,children:[14,18,10,20,8,16,12].map((e,t)=>(0,U.jsx)(`i`,{style:{height:e}},t))}),`Listening…`]}):(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{ref:C,type:`file`,name:`mavea-attach`,accept:Pt,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,U.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,U.jsx)(z.paperclip,{})})]}),b,(0,U.jsx)(`button`,{className:`send-btn`,disabled:d||!e.trim(),onClick:()=>n(e),title:`Send`,"aria-label":`Send`,children:(0,U.jsx)(z.send,{})})]})}i();var K=null;async function Xr(){return K||(K=(await a(()=>import(`./corpus.generated-oX9uU93S.js`),[])).default,K)}function Zr(e){return K?.conversations.find(t=>t.id===e)}function Qr(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 $r(e){return{...e,question:Qr(e.question),narration:Qr(e.narration),spoken:e.spoken?Qr(e.spoken):e.spoken,tour:e.tour.map(e=>({...e,say:e.say?Qr(e.say):e.say,saySpoken:e.saySpoken?Qr(e.saySpoken):e.saySpoken}))}}var ei=[{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}],ti=[{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`}],ni=[...ei,...ti];function ri(e){return ni.find(t=>t.id===e)}var ii={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 ai(e,t){let n=Zr(e),r=n?.frames[0];if(!n||!r)return null;let i=Qr(t??ii[e]??n.question);return{frame:$r({...r,question:i}),question:i}}var oi=[{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`}],si=[{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:oi}}],ci=[{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 li(e,t){return{question:`Can I afford a 6-month career break?`,narration:t,mode:`replace`,tour:[],spec:e,at:0}}function ui(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:si,blanks:oi,awaiting:!0},r={...t,blocks:ci,blanks:void 0,awaiting:!1};return{holes:li(n,``),filled:li(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 di(){let e=!1,t=[];return{after(n,r){t.push(setTimeout(()=>!e&&r(),n))},cancel(){e=!0,t.forEach(clearTimeout)}}}function fi(e,t){if(_()){t();return}let n=Date.now(),r=()=>{if(_()||Date.now()-n>=8e3){t();return}e(200,r)};e(200,r)}function pi(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 mi(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 hi=450,gi=1600;function _i(e,t){if(e<=0)return[];let n=Math.max(gi,Math.floor((t-hi-400)/e));return Array.from({length:e},(e,t)=>hi+t*n)}var vi=1500,yi=900;function bi(e,t){let n=1850;if(e<=0)return{focusAt:vi,spotlightAt:[]};let r=Math.max(yi,Math.floor((t-n)/e));return{focusAt:vi,spotlightAt:Array.from({length:e},(e,t)=>n+t*r)}}var xi=[`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 Si(e){return!!e&&ti.some(t=>t.id===e)}function Ci(e){return!!e&&ei.some(t=>t.id===e)}function wi(e){let{active:t}=e,[n,r]=(0,H.useState)(()=>{let t=e.startChapter;return Si(t)||Ci(t)&&e.solo?t??null:null}),[i,a]=(0,H.useState)(()=>{let t=e.startChapter;if(Si(t)||Ci(t)&&e.solo)return 0;let n=t?ei.findIndex(e=>e.id===t):-1;return n>=0?n:0}),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),f=(0,H.useRef)(u);f.current=u;let[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(0),v=(0,H.useRef)(e.ops);v.current=e.ops;let y=n?ri(n):void 0,b=y?[y]:ei,x=(0,H.useRef)(b);x.current=b;let S=b.length,C=t?b[i]??null:null,[w,T]=(0,H.useState)(!1),[E,D]=(0,H.useState)(!1),[O,k]=(0,H.useState)(0);(0,H.useEffect)(()=>{if(!t)return;let e=!0;return(async()=>{for(let t=0;e&&t<2;t++)try{await Xr(),e&&T(!0);return}catch{}e&&D(!0)})(),()=>{e=!1}},[t,O]);let j=(0,H.useCallback)(()=>{D(!1),k(e=>e+1)},[]),M=(0,H.useCallback)(()=>{let e=v.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,H.useEffect)(()=>{if(!t||!o||p||!w)return;let e=x.current[i];if(!e)return;A(e.id,!!n);let r=v.current,a=di(),s=a.after,c=e=>fi(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=ai(`money`);e&&u(e)}r.setMuted(f.current||e.mode===`silent`);let d=e.action;if(d.kind===`answer`){let e=ai(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(pi(s,r.typeInto,t)+360,()=>c(()=>r.showFrame(n,e.question)))}}else if(d.kind===`chip`){let e=ai(`money`);e&&u(e),s(1400,()=>r.pressKeepGoing(d.label)),s(2e3,()=>{let e=ai(d.convoId,d.label);e&&r.showFrame(e.frame,e.question)})}else if(d.kind===`montage`){let t=d.convoIds.map(e=>ai(e)).filter(Boolean),n=_i(t.length,e.durationMs);t.forEach((e,t)=>s(n[t],()=>u(e)))}else if(d.kind===`ask`)s(1300,()=>r.pinFirstBlock()),pi(s,r.typeInto,`Why does it grow faster after year 20?`,1700);else if(d.kind===`askMulti`){let e=ai(`money`);e&&u(e),s(1300,()=>r.pinFirstBlocks(2)),pi(s,r.typeInto,`How do these two parts explain the final total?`,2600)}else if(d.kind===`bend`){if(d.convoId){let e=ai(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=ai(`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=ai(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=ai(d.convoId);t&&u(t);let n=(t?.frame.spec.blocks??[]).map(e=>e.id).filter(e=>!!e),{focusAt:i,spotlightAt:a}=bi(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 xi)e=pi(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=ai(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=ai(`money`)?.frame.spec;if(e){let{holes:t,filled:n}=ui(e);u({frame:t,question:t.question}),s(5200,()=>r.showFrame(n,n.question))}}return e.mode!==`silent`&&!f.current&&s(160,()=>l(Qr(e.coach))),a.cancel},[i,h,t,o,p,w,n,M]),(0,H.useEffect)(()=>{if(!t||!o||p||!c||!w)return;let e=x.current[i];if(!e)return;let n=v.current;return mi({minHoldMs:e.durationMs,isQuiet:()=>!n.isSpeaking()&&!n.isBusy(),advance:()=>{i+1>=S?(M(),m(!0)):a(i+1)}})},[i,h,t,o,p,c,w,S,n,M]),(0,H.useEffect)(()=>()=>M(),[M]);let N=(0,H.useCallback)(()=>{_(),s(!0),l(!0),m(!1)},[]),P=(0,H.useCallback)((e,t)=>{_(),m(!1),t?.keepPlaying||l(!1),a(Math.max(0,Math.min(x.current.length-1,e))),g(e=>e+1)},[]),F=(0,H.useCallback)(()=>{i+1>=S?(M(),m(!0)):P(i+1,{keepPlaying:!0})},[i,S,P,M]),I=(0,H.useCallback)(()=>P(i-1),[i,P]),L=(0,H.useCallback)(e=>P(e),[P]),R=(0,H.useCallback)(()=>{M(),r(null),s(!0),P(0),l(!0)},[P,M]),ee=(0,H.useCallback)(e=>{Si(e)&&(_(),r(e),s(!0),m(!1),l(!0),a(0),g(e=>e+1))},[]),z=(0,H.useCallback)(()=>{if(_(),!o){N();return}if(p){R();return}l(e=>!e)},[p,R,N,o]),te=(0,H.useCallback)(()=>{_();let e=!f.current;f.current=e,d(e);let t=x.current[i],n=t?.mode===`silent`,r=v.current;r.setMuted(e||n),e?r.cancelSpeech():o&&!p&&t&&!n&&r.speak(Qr(t.coach))},[p,i,o]),ne=(0,H.useCallback)(()=>{M(),m(!0)},[M]);return{active:t,started:o,index:i,total:S,chapter:C,coach:Qr(C?.coach??``),spotlight:C?.spotlight,playing:c,muted:u,done:p,corpusError:E,retryCorpus:j,solo:!!n,start:N,next:F,prev:I,jumpTo:L,toggle:z,toggleMute:te,replay:R,skip:ne,playExtra:ee}}var q=n();function Ti(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 J=/^(hidden|auto|scroll|clip)$/;function Ei(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=J.test(t.overflowY),s=J.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 Di(e,t){let n=(0,q.c)(4),[r,i]=(0,H.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(Mi).filter(Boolean),c=()=>{if(!n)return;let e=null,t=null;for(let n of s){let r=Array.from(document.querySelectorAll(n)).filter(ji).map(Ai).filter(ki),i=r.find(Oi)??r[0];if(i){e=i.hit,t=i.rect;break}}if(!e||!t){o(null);return}let i=t;if(!Ti(i)){let t=Date.now();t-r>1200&&(r=t,e.scrollIntoView({block:`center`,behavior:`smooth`})),o(null);return}o(i)};c();let l=0,u=()=>{l||=requestAnimationFrame(()=>{l=0,c()})},d=window.setInterval(c,750);return window.addEventListener(`resize`,u),window.addEventListener(`scroll`,u,{passive:!0,capture:!0}),()=>{n=!1,window.clearInterval(d),cancelAnimationFrame(l),window.removeEventListener(`resize`,u),window.removeEventListener(`scroll`,u,!0)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,H.useEffect)(a,o),r}function Oi(e){let{rect:t}=e;return Ti(t)}function ki(e){let{raw:t}=e;return t.width>0&&t.height>0}function Ai(e){let t=e.getBoundingClientRect();return{hit:e,raw:t,rect:Ei(t,e)}}function ji(e){return!e.checkVisibility||e.checkVisibility({checkOpacity:!0})}function Mi(e){return e.trim()}function Ni(e){let t=(0,q.c)(82),{driver:n}=e,r=Di(n.spotlight,n.active&&n.started&&!n.done),i=(0,H.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),B(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,Fi},l=[s],t[2]=s,t[3]=c,t[4]=l),(0,H.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,U.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,U.jsx)(`h2`,{children:`This walkthrough couldn’t load`}),i=(0,U.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,U.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,U.jsx)(`button`,{type:`button`,className:`tourx-welcome-skip`,onClick:Pi,children:`Back to home`}),t[10]=o):o=t[10];let s;return t[11]===a?s=t[12]:(s=(0,U.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,U.jsxs)(`div`,{className:`tourx-welcome`,role:`alert`,children:[e,r,i,(0,U.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,U.jsx)(`span`,{className:`tourx-welcome-kicker`,children:`Walkthrough`}),r=(0,U.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,U.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,U.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,U.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,U.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,U.jsx)(`div`,{className:`tourx tourx-intro`,"aria-live":`polite`,children:(0,U.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,U.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,U.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,U.jsx)(`span`,{className:`tourx-title`,children:_}),t[32]=_,t[33]=v);let y;t[34]!==g||t[35]!==v||t[36]!==m?(y=(0,U.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,U.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,U.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.prev,disabled:n.index===0,"aria-label":`Previous chapter`,children:(0,U.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,U.jsx)(z.pause,{className:`tourx-ic`}):(0,U.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,U.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,U.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,U.jsx)(z.speakerOff,{className:`tourx-ic`}):(0,U.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,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,className:`tourx-btn`,onClick:n.next,"aria-label":`Next chapter`,children:(0,U.jsx)(z.chevR,{className:`tourx-ic`})}),(0,U.jsx)(`div`,{className:`tourx-dots`,role:`tablist`,"aria-label":`Chapters`,children:Array.from({length:n.total},(e,t)=>(0,U.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,U.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,U.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,U.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,U.jsxs)(`div`,{className:`tourx`,"aria-live":`polite`,children:[d,I]}),t[79]=I,t[80]=d,t[81]=L):L=t[81],L}function Pi(){window.location.hash=`#/`}function Fi(){delete document.body.dataset.tourChapter}function Ii({onStart:e,onReplay:t,onPlayExtra:n,hasStoredSession:r=!1}){let i=(0,H.useRef)(null);B(i);let a=x();return(0,U.jsx)(`div`,{ref:i,className:`tour-end`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-end-title`,children:(0,U.jsxs)(`section`,{className:`tour-end-card`,children:[(0,U.jsxs)(`header`,{className:`tour-end-intro`,children:[(0,U.jsx)(`div`,{className:`tour-end-mascot`,"aria-hidden":`true`,ref:a,children:(0,U.jsx)(fe,{state:`idle`,emotion:`neutral`,gaze:`center`})}),(0,U.jsx)(`h2`,{id:`tour-end-title`,className:`tour-end-title tour-end-line`,children:`That's Mavéa.`}),(0,U.jsx)(`p`,{className:`tour-end-tagline tour-end-line`,children:`Talk to AI. See what it means.`}),(0,U.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,U.jsxs)(`div`,{className:`tour-end-actions tour-end-line`,children:[(0,U.jsx)(`button`,{type:`button`,className:`tour-end-start`,onClick:e,children:r?`Back to your session`:`Start Mavéa`}),(0,U.jsx)(`button`,{type:`button`,className:`tour-end-replay`,onClick:t,children:`Replay the tour`})]})]}),(0,U.jsxs)(`div`,{className:`tour-end-extras`,children:[(0,U.jsx)(`h3`,{children:`More to explore`}),(0,U.jsx)(`div`,{className:`tour-end-grid`,children:ti.map(e=>(0,U.jsxs)(`button`,{type:`button`,className:`tour-end-extra`,onClick:()=>n(e.id),"aria-label":`Play scripted mini-demo: ${e.title}`,children:[(0,U.jsx)(`span`,{className:`tour-end-glyph`,"aria-hidden":`true`,children:e.glyph}),(0,U.jsxs)(`span`,{className:`tour-end-extra-copy`,children:[(0,U.jsx)(`strong`,{children:e.title}),(0,U.jsx)(`small`,{children:e.hook})]})]},e.id))})]})]})})}var Li=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 Ri(e){return Li.get(e)}function zi(e){return e.steps.filter(e=>!!e.ask)}var Bi=1300,Vi=900;function Hi(e,t){return(e?.spec.blocks??[]).map(e=>e.id).filter(e=>!!e).slice(0,t)}function Ui(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&&Hi(n,4).forEach((n,i)=>r(e.atMs+Vi+i*Bi,()=>t.setSpot(n)));break;case`canvas`:{r(e.atMs,()=>t.setViewMode(`canvas`));let i=Hi(n,3);i.forEach((n,i)=>r(e.atMs+Vi+i*Bi,()=>t.setSpot(n))),r(e.atMs+Vi+i.length*Bi,()=>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 Wi(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 Gi(e){return e?.length?Math.max(...e.map(e=>e.atMs+Wi(e))):0}i();var Ki=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 qi(e){let t=Ki[`./${e}.generated.json`];if(!t)return null;try{return(await t()).default??null}catch{return null}}var Y=4500,Ji=1e3,Yi=6e4;function Xi(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 Zi(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 Qi(e){let{active:t,personaId:n}=e,r=n?Ri(n):void 0,i=r?.steps??[],a=i.length,[o,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(`loading`),[u,d]=(0,H.useState)(()=>Math.max(0,Math.min(a-1,e.startStep??0))),[f,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1),[v,y]=(0,H.useState)(!1),b=(0,H.useRef)(v);b.current=v;let[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(0),[T,E]=(0,H.useState)(null),D=(0,H.useRef)(e.ops);D.current=e.ops;let O=(0,H.useRef)(null),k=(0,H.useRef)(0),A=(0,H.useCallback)(()=>{if(!t||!n)return;l(`loading`);let e=++k.current;qi(n).then(t=>{if(e!==k.current)return;let n=r?zi(r).length:0,i=!!t&&!!r&&t.frames.length===n;s(i?t:null),l(i?`ready`:`error`)})},[t,n,r]);(0,H.useEffect)(A,[A]);let j=(0,H.useCallback)(()=>{let e=D.current;e.closeAllOverlays(),e.stopRevealWalk(),e.cancelSpeech()},[]);(0,H.useEffect)(()=>{if(!t||!f||x||c!==`ready`||!o||!r)return;let e=r.steps[u];if(!e)return;p(r.persona,u);let n=D.current,i=di(),a=i.after;E(null),O.current=null,j(),n.setMuted(b.current);let s=Xi(r.steps,u,o),l=s??Zi(r.steps,u,o),d=e.ask?Qr(e.ask):null,m=s?$r({...s,question:d??s.question}):null,h=l?$r(l):null,g=()=>{let t=e.beats??[];for(let e of t)Ui(e,n,h,a);if(e.note){let n=t.length?Math.min(...t.map(e=>e.atMs)):0;a(n,()=>E(Qr(e.note??``)))}O.current=Date.now()+Gi(t)+(e.holdMs??Y)},_=e=>{let t=Date.now(),r=0,i=()=>{if(Date.now()-t>=Yi){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,u+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=d??e.ask,l;s?(a(700,()=>n.pressKeepGoing(e.ask??c)),l=1600):l=pi(a,n.typeInto,c,400)+360,a(l,()=>fi(a,()=>n.showFrame(m,c))),_(l+Ji)}else!n.hasCanvas()&&h&&n.showFrame(h,h.question,{silent:!0}),a(300,g);return i.cancel},[u,C,t,f,x,c,o,r,j]),(0,H.useEffect)(()=>{if(!t||!f||x||!h||c!==`ready`)return;let e=D.current,n=window.setInterval(()=>{let t=O.current;!t||Date.now()<t||e.isSpeaking()||e.isBusy()||(window.clearInterval(n),u+1>=a?(j(),S(!0)):d(u+1))},250);return()=>window.clearInterval(n)},[u,C,t,f,x,h,a,c,j]),(0,H.useEffect)(()=>()=>j(),[j]);let M=(0,H.useCallback)(()=>{_(),m(!0),g(!0),S(!1)},[]),N=(0,H.useCallback)((e,t)=>{_(),S(!1),t?.keepPlaying||g(!1),d(Math.max(0,Math.min(a-1,e))),w(e=>e+1)},[a]),P=(0,H.useCallback)(()=>{u+1>=a?(j(),S(!0)):N(u+1,{keepPlaying:!0})},[u,a,N,j]),F=(0,H.useCallback)(()=>N(u-1),[u,N]),I=(0,H.useCallback)(e=>N(e),[N]),L=(0,H.useCallback)(()=>{j(),m(!0),N(0),g(!0)},[N,j]),R=(0,H.useCallback)(()=>{if(_(),!f){M();return}if(x){L();return}g(e=>!e)},[x,L,M,f]),ee=(0,H.useCallback)(()=>{_();let e=!b.current;b.current=e,y(e),D.current.setMuted(e),e&&D.current.cancelSpeech()},[]),z=(0,H.useCallback)(()=>{j(),S(!0)},[j]);return{active:t,started:f,loadState:c,model:o?.model??null,reload:A,index:u,total:a,step:t?i[u]??null:null,note:T,playing:h,muted:v,done:x,start:M,next:P,prev:F,jumpTo:I,toggle:R,toggleMute:ee,replay:L,skip:z}}function $i(e){return/\p{Extended_Pictographic}/u.test(e)}function ea(){window.location.hash=`#/`}function ta({driver:e,member:t,onExit:n}){let r=(0,H.useRef)(null),i=e.active&&e.loadState===`ready`&&(!e.started||e.done);if(B(r,{active:i}),!e.active)return null;let a={"--accent":t.accent};if(e.loadState===`loading`)return(0,U.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,U.jsxs)(`div`,{className:`demox-load`,style:a,children:[(0,U.jsx)(z.spinner,{className:`demox-spinner`}),`Loading curated replay…`]})});if(e.loadState===`error`)return(0,U.jsx)(`div`,{className:`demox`,"aria-live":`polite`,children:(0,U.jsxs)(`div`,{className:`demox-card`,style:a,role:`alert`,children:[(0,U.jsx)(`p`,{className:`demox-card-title`,children:`This demo couldn’t load`}),(0,U.jsx)(`p`,{className:`demox-card-body`,children:`The curated prerecorded example did not come through. Check your connection and try again.`}),(0,U.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.reload,children:`Retry`}),(0,U.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:ea,children:`Back to home`})]})]})});if(!e.started)return(0,U.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,U.jsxs)(`div`,{ref:r,className:`demox-card demox-start`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-start-title`,children:[(0,U.jsx)(`span`,{className:`demox-avatar`+($i(t.avatar)?` emoji`:``),children:t.avatar}),(0,U.jsx)(`span`,{className:`demox-card-kicker`,children:`Curated prerecorded example`}),(0,U.jsxs)(`p`,{id:`demox-start-title`,className:`demox-card-title`,children:[`Watch: `,t.useCase]}),(0,U.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,U.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:e.start,children:`Start demo`}),(0,U.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:ea,children:`Back to home`})]})]})});if(e.done){let i=R.filter(e=>e.id!==t.id);return(0,U.jsx)(`div`,{className:`demox demox-intro`,"aria-live":`polite`,children:(0,U.jsxs)(`div`,{ref:r,className:`demox-card demox-end`,style:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`demox-end-title`,children:[(0,U.jsx)(`span`,{className:`demox-avatar`+($i(t.avatar)?` emoji`:``),children:t.avatar}),(0,U.jsx)(`p`,{id:`demox-end-title`,className:`demox-card-title`,children:`End of curated replay`}),(0,U.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,U.jsxs)(`div`,{className:`demox-card-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`demox-primary`,onClick:n,children:`Try it yourself`}),(0,U.jsx)(`button`,{type:`button`,className:`demox-ghost`,onClick:e.replay,children:`Replay`})]}),(0,U.jsx)(`div`,{className:`demox-others`,role:`group`,"aria-label":`More curated replays`,children:i.map(e=>(0,U.jsxs)(`button`,{type:`button`,className:`demox-other`,style:{"--accent":e.accent},onClick:()=>m(e.id),title:`${e.name} · ${e.role}`,children:[(0,U.jsx)(`span`,{className:`demox-other-avatar`+($i(e.avatar)?` emoji`:``),children:e.avatar}),e.useCase]},e.id))})]})})}return(0,U.jsxs)(`div`,{className:`demox`,"aria-live":`polite`,children:[(0,U.jsxs)(`div`,{className:`demox-banner`,style:a,children:[(0,U.jsx)(`span`,{className:`demox-avatar`+($i(t.avatar)?` emoji`:``),children:t.avatar}),(0,U.jsxs)(`span`,{className:`demox-who`,children:[(0,U.jsx)(`span`,{className:`demox-name`,children:t.useCase}),(0,U.jsxs)(`span`,{className:`demox-role`,children:[t.name,` · `,t.role]})]}),(0,U.jsx)(`span`,{className:`demox-badge`,children:`Curated replay`})]}),e.note&&(0,U.jsx)(`div`,{className:`demox-note`,style:a,children:e.note},e.note),(0,U.jsxs)(`div`,{className:`demox-panel`,style:a,role:`group`,"aria-label":`Demo controls`,children:[(0,U.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.prev,disabled:e.index===0,"aria-label":`Previous step`,children:(0,U.jsx)(z.chevL,{className:`demox-ic`})}),(0,U.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,U.jsx)(z.pause,{className:`demox-ic`}):(0,U.jsx)(z.play,{className:`demox-ic`})}),(0,U.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,U.jsx)(z.speakerOff,{className:`demox-ic`}):(0,U.jsx)(z.speaker,{className:`demox-ic`})}),(0,U.jsx)(`button`,{type:`button`,className:`demox-btn`,onClick:e.next,"aria-label":`Next step`,children:(0,U.jsx)(z.chevR,{className:`demox-ic`})}),(0,U.jsx)(`div`,{className:`demox-dots`,role:`tablist`,"aria-label":`Steps`,children:Array.from({length:e.total},(t,n)=>(0,U.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,U.jsxs)(`button`,{type:`button`,className:`demox-skip`,onClick:n,"aria-label":`Exit demo, try it yourself`,children:[(0,U.jsx)(`span`,{className:`demox-skip-full`,children:`Exit, try it yourself`}),(0,U.jsx)(`span`,{className:`demox-skip-short`,"aria-hidden":`true`,children:`Exit`})]})]})]})}i();var na=[`nasa-cfd`,`fomc`,`weather`,`cars`,`react-readme`],ra=null;async function ia(){return ra||(ra=[...(await a(()=>import(`./prism.generated-BQkO5r6r.js`),[])).default.docs].sort((e,t)=>{let n=na.indexOf(e.id),r=na.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:It(e.kind)}))},proposed:e.proposed})),ra)}var aa=`How does $10,000 grow at 7% over 30 years?`;function oa(){let e=Zr(`money`)?.frames[0]?.spec.blocks??[],t=Zr(`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 sa(){let e=Vt().find(e=>e.question===aa);if(e)return e.id;let t=oa();if(t.length===0)return null;let n=Ut({title:`Investment growth · $10k at 7%`,question:aa,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=>Bt(e,`tour`)),n.cadence={data:`hourly`,ai:`daily`},n.nextDataAt=Rt(n.createdAt,Lt[n.cadence.data]),n.nextAiAt=Rt(n.createdAt,Ht[n.cadence.ai]),zt(n),n.id}var ca=44,la=2,ua=24e3;function da(e,t,n){let r=(t,n)=>{for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))};r(0,`RIFF`),e.setUint32(4,36+t*la,!0),r(8,`WAVE`),r(12,`fmt `),e.setUint32(16,16,!0),e.setUint16(20,1,!0),e.setUint16(22,1,!0),e.setUint32(24,n,!0),e.setUint32(28,n*la,!0),e.setUint16(32,la,!0),e.setUint16(34,16,!0),r(36,`data`),e.setUint32(40,t*la,!0)}function fa(e,t,n,r){let i=ca+n*la;for(let a=n;a<r;a++){let n=Math.max(-1,Math.min(1,t[a]));e.setInt16(i,n<0?n*32768:n*32767,!0),i+=la}}function pa(e,t){let n=new ArrayBuffer(ca+e*la),r=new DataView(n);return da(r,e,t),{buffer:n,view:r}}function ma(){let e=globalThis.scheduler;return typeof e?.yield==`function`?e.yield():typeof MessageChannel==`function`?new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),t.port2.close(),e()},t.port2.postMessage(null)}):new Promise(e=>setTimeout(e,0))}async function ha(e,t,n=ma){let{buffer:r,view:i}=pa(e.length,t);for(let t=0;t<e.length;t+=ua)t>0&&await n(),fa(i,e,t,Math.min(t+ua,e.length));return r}i();var ga=512,_a=16e3,va=ga/_a*1e3,ya=12,ba=Math.ceil(90*_a/ga),xa=3,Sa=2,Ca=.5,wa=.35,Ta=Math.round(300/va);function Ea(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 Oa(e){return e?45e3:25e3}var ka=class t{mode=`vad`;capabilities;vad=null;vadLoading=!1;vadFailed=!1;phase=`idle`;muted=!1;wantRunning=!1;continuous=!1;disposed=!1;sessionId=0;transcriptionAborts=new Set;transcriptionChain=Promise.resolve();queuedTranscriptions=0;activeTranscriptions=0;transcriptionSlotWaiters=[];preRollFrames=[];utteranceFrames=[];quietFrames=0;speechEnding=!1;captureCtx=null;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.abortTranscriptions(),this.pauseVad(),this.clearBargeInTimer(),this.clearSpeechEnding(),this.preRollFrames=[],this.utteranceFrames=[],this.phase!==`idle`&&this.emitState({phase:`idle`})}forceStop(){if(this.phase===`transcribing`){this.continuous=!1,this.wantRunning=!1,this.pauseVad(),this.emitState({phase:`transcribing`});return}let e=this.continuous;this.wantRunning=e,this.pauseVad(),this.clearBargeInTimer(),this.clearSpeechEnding();let t=Ea([...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.abortTranscriptions(),this.releaseWaitingTranscriptions(),this.clearBargeInTimer();let e=this.takeCaptureContextCloser();this.vad?(this.vad.destroy().catch(()=>{}).then(e),this.vad=null):e(),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])),n=this.ensureCaptureContext();if(this.vad=await t.new({model:`v5`,startOnLoad:!1,baseAssetPath:`/`,onnxWASMBasePath:`/`,...n?{audioContext:n}:{},positiveSpeechThreshold:Ca,negativeSpeechThreshold:wa,minSpeechMs:280,preSpeechPadMs:500,redemptionMs:1600,onFrameProcessed:(e,t)=>{this.captureFrame(t),this.trackSpeechTail(e.isSpeech)},onSpeechStart:()=>this.handleSpeechStart(),onSpeechRealStart:()=>this.handleSpeechRealStart(),onSpeechEnd:e=>void this.handleSpeechEnd(e),onVADMisfire:()=>this.handleMisfire()}),this.disposed){let e=this.takeCaptureContextCloser();this.vad.destroy().catch(()=>{}).then(e),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)}ensureCaptureContext(){if(this.captureCtx||this.disposed)return this.captureCtx;if(typeof AudioContext!=`function`)return null;try{this.captureCtx=new AudioContext}catch{this.captureCtx=null}return this.captureCtx}takeCaptureContextCloser(){let e=this.captureCtx;return this.captureCtx=null,()=>{e?.close().catch(()=>{})}}startVad(){this.vad&&(this.captureCtx?.state===`suspended`&&this.captureCtx.resume().catch(()=>{}),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(()=>{}).then(()=>this.suspendCaptureContext())}suspendCaptureContext(){this.wantRunning||this.disposed||this.captureCtx?.state===`running`&&this.captureCtx.suspend().catch(()=>{})}captureFrame(e){if(this.phase===`listening`&&!this.utteranceIsEcho){this.utteranceFrames.length<ba&&this.utteranceFrames.push(e);return}this.preRollFrames.push(e),this.preRollFrames.length>ya&&this.preRollFrames.shift()}trackSpeechTail(e){if(!(this.phase!==`listening`||this.utteranceIsEcho)){if(e>=Ca){this.quietFrames=0,this.speechEnding&&(this.speechEnding=!1,this.emitState({phase:`listening`,speechEnding:!1}));return}e>=wa||this.speechEnding||(this.quietFrames+=1,!(this.quietFrames<Ta)&&(this.speechEnding=!0,this.emitState({phase:`listening`,speechEnding:!0})))}}clearSpeechEnding(){this.quietFrames=0,this.speechEnding=!1}handleSpeechStart(){this.muted||(this.clearSpeechEnding(),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.clearSpeechEnding(),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.clearSpeechEnding(),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>=xa){this.emitState({phase:`idle`,error:`audio`}),n&&this.wantRunning&&this.startVad();return}this.queuedTranscriptions+=1;let r=this.runTranscription(e,t);this.transcriptionChain=this.transcriptionChain.catch(()=>{}).then(async()=>{try{this.deliverTranscription(await r,t,n)}finally{--this.queuedTranscriptions}})}async runTranscription(e,t){await this.acquireTranscriptionSlot();let n=new AbortController;this.transcriptionAborts.add(n);try{if(this.disposed||t!==this.sessionId)return null;let r=await this.transcribeWhisper(e,n.signal);return this.disposed||n.signal.aborted||t!==this.sessionId?null:r}catch{return null}finally{this.transcriptionAborts.delete(n),this.releaseTranscriptionSlot()}}deliverTranscription(e,t,n){if(!e||this.disposed||t!==this.sessionId)return;let r=e.text.trim();if(!r){this.emitState({phase:`idle`,error:e.error??`no-speech`}),n&&this.wantRunning&&this.startVad();return}let i=e.confidence!==void 0&&e.confidence<.7||(e.noSpeechProbability??0)>=.6;this.emitState({phase:`heard`,transcript:r}),this.emitResult({transcript:r,confidence:e.confidence,noSpeechProbability:e.noSpeechProbability,lowConfidence:i}),this.emitState({phase:`idle`}),n&&this.wantRunning&&this.startVad()}acquireTranscriptionSlot(){return this.activeTranscriptions<Sa?(this.activeTranscriptions+=1,Promise.resolve()):new Promise(e=>this.transcriptionSlotWaiters.push(e))}releaseTranscriptionSlot(){let e=this.transcriptionSlotWaiters.shift();e?e():--this.activeTranscriptions}releaseWaitingTranscriptions(){let e=this.transcriptionSlotWaiters.splice(0);this.activeTranscriptions+=e.length,e.forEach(e=>e())}abortTranscriptions(){for(let e of this.transcriptionAborts)e.abort();this.transcriptionAborts.clear()}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=await ha(e,_a),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=Oa(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 Aa(){return new ka}function ja(e={}){let t=(0,H.useRef)(e.onResult),n=(0,H.useRef)(e.onStateChange),r=(0,H.useRef)(e.onBargeIn);t.current=e.onResult,n.current=e.onStateChange,r.current=e.onBargeIn;let i=(0,H.useMemo)(()=>Aa(),[]);return(0,H.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,H.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 Ma=`mavea-always-on`;function Na(e,t,n=!1,r=`neutral`,i=!1,a=!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`};if(a)return{state:`loading`,emotion:`neutral`,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 Pa=new Set([`no`,`caution`,`avoid`,`risk`,`wait`]),Fa=new Set([`yes`,`go`,`recommended`,`good`]);function Ia(e,t){let n=e.props[t];return typeof n==`string`?n.toLowerCase():void 0}function La(e){let t=e?.blocks;if(!t?.length)return`neutral`;let n=!1,r=e?.awaiting===!0;for(let e of t){let t=Ia(e,`tone`);(t===`warn`||t===`neg`)&&(n=!0),t===`pos`&&(r=!0);let i=Ia(e,`stance`);i&&Pa.has(i)&&(n=!0),i&&Fa.has(i)&&(r=!0),e.type===`insight`&&e.props.conf===`unverified`&&(n=!0)}return n?`concerned`:r?`warm`:`neutral`}function Ra(e){switch(e){case`concerned`:return`concerned`;case`warm`:return`warm`;default:return`neutral`}}function za(e){return Ra(La(e))}function Ba(e){let t=e?.blocks;return!t?.length||La(e)!==`warm`?!1:t.some(e=>{let t=Ia(e,`stance`);return t!==void 0&&Fa.has(t)})}var Va={clipShared:[`Nice — that one's worth sharing.`,`Off it goes.`,`Clipped and ready to share.`]};Object.keys(Va);function Ha(e,t,n){let r=Va[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 Ua(){return{lastAt:0,lastTurn:-1/0}}function Wa(e,t){return!(e.lastAt!==0&&t.now-e.lastAt<9e4||t.turnCount-e.lastTurn<3)}function Ga(e,t){return{lastAt:t.now,lastTurn:t.turnCount}}var Ka=1100,qa=6e3,Ja=150,Ya=950,Xa=350,Za=8;function Qa(e){let{muted:t,turnCount:n,gates:r}=e,i=(0,H.useRef)(e.speak),a=(0,H.useRef)(e.cancelSpeak),o=(0,H.useRef)(e.isSpeaking);i.current=e.speak,a.current=e.cancelSpeak,o.current=e.isSpeaking;let[s,c]=(0,H.useState)([]),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(null),[p,m]=(0,H.useState)(0),h=(0,H.useRef)(Ua()),g=(0,H.useRef)(void 0),_=(0,H.useRef)(null),v=(0,H.useRef)(null),y=(0,H.useCallback)(()=>{_.current&&=(clearTimeout(_.current),null),v.current&&=(clearTimeout(v.current),null)},[]),b=(0,H.useCallback)(e=>{c(t=>t.length>=Za||t[t.length-1]===e?t:[...t,e])},[]),x=(0,H.useCallback)(()=>{y(),u(!1),v.current=setTimeout(()=>{v.current=null,f(null)},Ya)},[y]),S=(0,H.useCallback)(e=>{let t=()=>{let n=Date.now()-e;n>=Ka&&!o.current()||n>=qa?x():_.current=setTimeout(t,Ja)};_.current=setTimeout(t,Ka)},[x]),C=r.atRest&&!r.busy&&!r.listening&&!r.introHold&&r.hasCanvas&&!r.modalOpen;(0,H.useEffect)(()=>{if(l||d!==null||!C||s.length===0)return;if(o.current()){let e=setTimeout(()=>m(e=>e+1),Xa);return()=>clearTimeout(e)}let e=s[0],r=Date.now();if(!Wa(h.current,{type:e,now:r,turnCount:n})){c(e=>e.slice(1));return}h.current=Ga(h.current,{type:e,now:r,turnCount:n});let a=Ha(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,H.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,H.useCallback)(()=>{y(),c([]),u(!1),f(null),h.current=Ua(),g.current=void 0},[y]);return(0,H.useEffect)(()=>()=>y(),[y]),{interjecting:l,line:d,enqueue:b,reset:w}}function $a(e){let t=(0,q.c)(36),{chapters:n,currentIndex:r,onJump:i,onClose:a}=e,o=(0,H.useRef)(null),s;if(t[0]===a?s=t[1]:(s={onEscape:a},t[0]=a,t[1]=s),B(o,s),n.length===0)return null;let c;t[2]===n?c=t[3]:(c=Et(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,U.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,U.jsxs)(`header`,{className:`ovw-head`,children:[p,(0,U.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,U.jsxs)(`section`,{className:`ovw-card`,style:{"--card-c":e.color},children:[(0,U.jsxs)(`div`,{className:`ovw-card-head`,children:[(0,U.jsx)(`span`,{className:`ovw-card-dot`}),(0,U.jsx)(`h3`,{className:`ovw-card-title`,children:e.title}),(0,U.jsx)(`span`,{className:`ovw-card-count`,children:e.moments.length})]}),(0,U.jsx)(`ul`,{className:`ovw-moments`,children:e.moments.map(e=>{let t=e.frameIndex===r,n=z[e.icon]||z.mic;return(0,U.jsxs)(`li`,{children:[(0,U.jsxs)(`button`,{type:`button`,className:`ovw-moment`+(t?` is-current`:``),onClick:()=>{i(e.frameIndex),a()},"aria-current":t?`true`:void 0,children:[(0,U.jsx)(n,{}),(0,U.jsx)(`span`,{className:`ovw-moment-q`,children:e.question||`Moment`})]}),e.elements.length>0&&(0,U.jsx)(`ul`,{className:`ovw-els`,children:e.elements.map(t=>{let n=t.icon&&z[t.icon]||z.spark;return(0,U.jsx)(`li`,{children:(0,U.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,U.jsx)(n,{}),(0,U.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,U.jsx)(`div`,{className:`ovw-grid`,children:_}),t[24]=_,t[25]=v);let y;t[26]!==v||t[27]!==g?(y=(0,U.jsxs)(`div`,{className:`ovw-panel`,role:`dialog`,"aria-modal":`true`,"aria-label":`Conversation overview`,ref:o,onClick:eo,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,U.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,U.jsx)(ze,{accent:d,children:b}),t[33]=d,t[34]=b,t[35]=x):x=t[35],x}function eo(e){return e.stopPropagation()}function to(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 no(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)=>Be(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=to(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 ro=240;function io(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=ct(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*ro,badgeMs:r?st+(u.length-1)*ro:void 0,stepNumber:e?t+1:void 0}),c++}}else a&&(s.push({spot:n,line:l,generous:!0,delayMs:c*ro}),c++)}return s}var ao=1100,oo=1700;function so(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 it(n),c=s();if(c){o(c);return}r.setIndex(e),a?await Qe(n,oo,ao):await et(oo)}else r.setIndex(e),await et(oo)}let e=s();o(e??`complete`)})()}function co(e,t,n){if(e.length===0)return e;let r=new Map;n.forEach((e,t)=>{let n=Ue(e),i=r.get(n);i?i.push(t):r.set(n,[t])});let i=new Map;n.forEach((e,t)=>{let n=Ue(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(Ue(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(Ue(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 lo(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=He(e,a,r.continuity,r.tier),s=!e||o===`replace`&&We(e,a)<.15,c=i?.forceReplace?`replace`:o,l=Be(t,r.spec.blocks,c);c!==`replace`&&l.overflow&&(c=`replace`,l=Be(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=co(r.tour??[],r.spec.blocks,l.blocks),p=Date.now();return{frame:{id:Ke(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 uo={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`},fo=3,po=140;function mo(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function ho(e){let t=e.trim().replace(/\s+/g,` `);if(!t||t.length>po||t.includes(`?`))return``;let n=t.toLowerCase(),r;if(r=t.match(/^i(?:'m| am)\s+(an?\s+.+)/i))return go(`Is ${r[1]}`);if(r=t.match(/^i(?:'m| am)\s+(.+)/i))return go(r[1]);if(r=t.match(/^i(?:'ve| have)\s+(?:got\s+)?(.+)/i))return go(`Has ${r[1]}`);if(r=t.match(/^my\s+(.+?)\s+(is|are)\s+(.+)/i))return go(`${r[1]} ${r[2]} ${r[3]}`);if(r=n.match(/^i\s+(\w+)\s+(.+)/)){let e=uo[r[1]];if(e)return go(`${e} ${t.slice(t.toLowerCase().indexOf(r[2]))}`)}return``}function go(e){let t=mo(e.trim().replace(/\s+/g,` `));return t.length>=6&&t.length<=po?t:``}function _o(e){if(!e)return[];let t=e.split(/[.!?\n]+|,?\s+\band\b\s+/i),n=[];for(let e of t){let t=ho(e);if(t&&!n.includes(t)&&n.push(t),n.length>=fo)break}return n}var vo=.6,yo=.5;function bo(e){return(e.match(/\d[\d,.]*\d|\d/g)??[]).map(e=>e.replace(/,/g,``).replace(/\.+$/,``))}function xo(e,t){let n=bo(e);if(!n.length)return!1;let r=new Set(bo(t));return n.some(e=>!r.has(e))}function So(e,t,n={}){if(!xo(e,t)){let n=En(e),r=En(t);if(n.size>0&&An(n,r)>=vo)return`user-stated`}return n.webGrounded?`web-grounded`:`model-inferred`}function Co(e,t){let n=bo(e),r=new Set(bo(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))>=yo?`user-stated`:`model-inferred`}var wo=24;function To(e,t=`item`){let n=e.toLowerCase().match(/[a-z][a-z0-9]*/g);return(n&&n[0]?n[0]:t).slice(0,wo)}function Eo(e,t={}){return{concept:`corrections.${To(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 Do=4,Oo=1600,ko=24,Ao=`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
+
4
+ At most ${Do} children; fewer beats padding. Nothing honest to split? {"children":[]}.
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.
6
+ "id": short lowercase-hyphen slug. "detail": one plain sentence. "domain" (optional): ${zn.join(`|`)}.
7
+
8
+ {"children":[{"id":"","label":"","tier":"T0","value":0,"unit":"","quote":"","detail":"","domain":""}]}`,jo={type:`object`,properties:{children:{type:`array`,maxItems:Do,items:{type:`object`,properties:{id:{type:`string`},label:{type:`string`},tier:{type:`string`,enum:[`T0`,`T1`,`T2`,`T3`]},value:{type:`number`},unit:{type:`string`},quote:{type:`string`},detail:{type:`string`},domain:{type:`string`,enum:[...zn]}},required:[`id`,`label`]}}},required:[`children`]},Mo=`(none — use only general knowledge; mark EVERY child "T0" with no numbers)`;function No(e,t,n){let r=e.nodes.filter(e=>e.id!==t.id).map(e=>e.label).join(`; `);return`WORLD: ${e.title}
9
+
10
+ BREAK DOWN THIS CAUSE: ${t.label}${t.detail?`\n(context: ${t.detail})`:``}
11
+
12
+ ALREADY ON THE WEB as separate causes — never return these as children:
13
+ ${r||`(nothing else)`}
14
+
15
+ SOURCES:
16
+ ${n.text.trim()?n.text.trim().slice(0,6e3):Mo}
17
+
18
+ Give the parts "${t.label}" is made of (${Do} max). Quote SOURCES verbatim for any number; otherwise T0 with no numbers. Reply as compact JSON on one line.`}var Po=new Map;function Fo(e,t,n,r){return Mn(`world-expand:${e.title}\0${t}\0${n.text}`,r.provider)}async function Io(e,t,n,r,i,a){let o=await Fn(e);if(o)return o;if(a?.aborted)return null;let s;try{s=(await Wt(i.provider).generate({system:Ao,history:[],user:No(t,n,r),maxTokens:Oo,thinkingLevel:`minimal`,format:jo,...a?{signal:a}:{}},i)).raw}catch{return null}if(a?.aborted)return null;let c=Rn(s,n.id,r,!!t.provenance.illustrative);return c.length===0?null:(Nn(e,c),c)}function Lo(e,t){for(let n of e){if(n.id===t)return n;let e=n.children===void 0?void 0:Lo(n.children,t);if(e)return e}}function Ro(e,t,n,r,i){let a=Lo(e.nodes,t);if(!a||(a.children?.length??0)>0)return Promise.resolve(null);let o=Fo(e,t,n,r);return(Po.get(o)??(()=>{let t=Io(o,e,a,n,r,i);for(Po.set(o,t);Po.size>ko;){let e=Po.keys().next().value;if(e===void 0||e===o)break;Po.delete(e)}return t.then(e=>{e||Po.delete(o)},()=>Po.delete(o)),t})()).then(n=>n?Bn(e,t,n):null)}i();var zo=()=>a(()=>import(`./generateLive-DGwnpIip.js`),__vite__mapDeps([3,4,5,6,7,8,2,1,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55])),Bo=50,Vo=18e5,Ho=864e5,Uo=`live-answer:v1`,Wo=2;function Go(e,t){let n=t?.searchMode??(t?.webSearch?`free`:`off`),r=t?.quality??``,i=t?.explainLevel??`standard`,a=+!!t?.generativeBlocks,o=+!!t?.memoryEnabled,s=+!!t?.worldEnabled;return`${e.provider}::${e.model}::${n}::${r}::${i}::${a}::${o}::${s}`}function Ko(e,t,n){let r=e.slice(-40);if(r.length===0&&!t&&!n)return`cold`;let i=r.map(e=>`${e.role}:${e.content}`);return t&&i.push(`world:${t.title}`),n&&i.push(`lesson:${n.topic}\u0000${n.directive}`),Pn(i.join(`\0`))}function qo(e,t){let n=e.get(t);return!n||(e.delete(t),Date.now()-n.at>Vo)?null:(e.set(t,n),n.result)}function Jo(e,t,n){for(e.delete(t),e.set(t,{at:Date.now(),result:n});e.size>Bo;){let t=e.keys().next().value;if(t===void 0)break;e.delete(t)}}function Yo(e,t){return Mn(`${Uo}:${e}`,t.provider)}async function Xo(e){let t=await Fn(e);return typeof t?.at!=`number`||!t.result?.spec?.blocks?.length||Date.now()-t.at>Ho?null:t.result}function Zo(e,t){return!e.spec.sources?.length&&!t?.memoryEnabled}function Qo(e){let t=e?.blocks??[];for(let e=t.length-1;e>=0;--e){let n=t[e];if(n.type===`world`&&n.props.world)return n.props.world}}function $o(e,t,n,r){let i=e.blocks.findIndex(e=>e.id===t&&e.type===`world`);if(i<0)return e;let a=e.blocks[i];if(a.type!==`world`||a.props.world||a.props.title!==n)return e;let o=[...e.blocks];return o[i]={...a,props:{...a.props,world:r}},{...e,blocks:o}}function es(e,t){return!e||e.blocks.length>t.blocks.length?!1:e.blocks.every((e,n)=>{let r=t.blocks[n];return e.type===r.type&&JSON.stringify(e.props)===JSON.stringify(r.props)})}var ts={history:[],spec:null,status:`idle`,turn:0,narration:``,understood:[],busy:!1,activity:null,spot:null,mode:`replace`,replaceEpoch:0,prior:null,tour:[],past:[],frames:[],viewIndex:null,viewOverride:null,error:null,pendingShape:null,reasoning:!1,liveSources:[],restored:!1,phase:`normal`,filled:{},activeBlank:null};function ns(e,t){return e?.find(e=>!(e.key in t))?.key??null}function rs(e,t){switch(t.type){case`start`:return{...e,status:`thinking`,busy:!0,narration:``,understood:[],activity:null,spot:null,viewIndex:null,viewOverride:null,error:null,pendingShape:null,reasoning:!1,liveSources:[],restored:!1,...t.fresh?{spec:null,prior:null}:{},phase:`normal`,filled:{},activeBlank:null};case`speak`:return{...e,status:`speaking`,narration:t.narration};case`activity`:return{...e,activity:t.activity};case`stream`:return{...e,status:`showing`,spec:t.spec};case`show`:return{...e,status:`showing`,spec:t.spec,narration:t.narration||e.narration,understood:t.understood,history:t.history.slice(-40),turn:e.turn+1,busy:!1,mode:t.mode,prior:t.prior,tour:t.tour,past:t.freshTimeline?[]:t.mode===`replace`&&t.priorSpec?[...e.past,t.priorSpec].slice(-12):e.past,frames:t.freshTimeline?[t.frame]:[...e.frames,t.frame].slice(-40),activity:null,replaceEpoch:t.mode===`replace`&&!t.streamed?e.replaceEpoch+1:e.replaceEpoch,spot:t.spot,viewIndex:null,viewOverride:null,pendingShape:null,reasoning:!1,liveSources:[],phase:t.spec.awaiting&&t.spec.blanks?.length?`awaiting_input`:`normal`,filled:{},activeBlank:t.spec.awaiting&&t.spec.blanks?.length?ns(t.spec.blanks,{}):null};case`idle`:return{...e,status:`idle`,busy:!1,activity:null,reasoning:!1};case`error`:return{...e,status:`idle`,busy:!1,activity:null,error:t.error,pendingShape:null,reasoning:!1,liveSources:[]};case`spot`:return{...e,spot:t.spot};case`pending`:return{...e,pendingShape:t.pending};case`thinking`:return{...e,reasoning:t.on};case`sources`:return{...e,liveSources:t.sources};case`jump`:return e.frames[t.index]?{...e,viewIndex:t.index,viewOverride:null,spot:null}:e;case`preview`:return{...e,viewOverride:t.spec,viewIndex:null,spot:null};case`restore`:{let n=t.spec.blocks.find(e=>e.id)?.id??null,r={id:Ke(t.at),question:t.question,narration:``,mode:`replace`,tour:[],spec:t.spec,at:t.at};return{...e,restored:!0,spec:t.spec,status:`showing`,turn:e.turn+1,narration:``,understood:[],busy:!1,activity:null,spot:n,viewIndex:null,viewOverride:null,mode:`replace`,replaceEpoch:e.replaceEpoch+1,tour:[],error:null,frames:[...e.frames,r].slice(-40),prior:{question:t.question,narration:``,title:t.spec.title,blockTypes:t.spec.blocks.map(e=>e.type)},history:[...e.history,{role:`user`,content:t.question},{role:`assistant`,content:t.spec.title}].slice(-40)}}case`world`:{let n=e.spec?$o(e.spec,t.blockId,t.question,t.world):e.spec,r=e.frames.map(e=>{let n=$o(e.spec,t.blockId,t.question,t.world);return n===e.spec?e:{...e,spec:n}});return n===e.spec&&r.every((t,n)=>t===e.frames[n])?e:{...e,spec:n,frames:r}}case`fill`:{let n={...e.filled,[t.value.key]:t.value};return{...e,filled:n,activeBlank:ns(e.spec?.blanks,n)}}case`unfill`:{let n={...e.filled};return delete n[t.key],{...e,filled:n,activeBlank:t.key}}case`setActiveBlank`:return{...e,activeBlank:t.key};case`reset`:return{...ts};default:return e}}function is(e){let t=e.frames[e.frames.length-1];return{...ts,history:e.history,frames:e.frames,spec:t.spec,status:`idle`,mode:`replace`,restored:!0,prior:{question:t.question,narration:t.narration,title:t.spec.title,blockTypes:t.spec.blocks.map(e=>e.type)}}}function as(e){let{canRun:t,getConfig:n,getCaps:r,speak:i,cancelSpeak:a,getLibraryEnabled:o}=e,[s,c]=(0,H.useReducer)(rs,e.initial??ts),l=(0,H.useRef)(e);l.current=e;let u=(0,H.useRef)(!1);u.current=s.busy;let d=(0,H.useRef)(s.history);d.current=s.history;let f=(0,H.useRef)(null),p=(0,H.useRef)(null),m=(0,H.useRef)(s.spec);m.current=s.spec;let h=(0,H.useRef)(null),g=(0,H.useRef)([]);g.current=s.frames;let _=(0,H.useRef)(s.prior);_.current=s.prior;let v=(0,H.useRef)(s.filled);v.current=s.filled;let y=(0,H.useRef)(new Map),b=(0,H.useRef)(new Map),x=(0,H.useRef)([]),S=(0,H.useRef)(new Set),C=(0,H.useRef)(s.turn);C.current=s.turn;let w=(0,H.useCallback)(async(e,s,l,h,g,v,w,T)=>{if(t&&!t())return;let E=e.trim();if(!E&&!s?.length||u.current&&!T?.force)return;let D=E||`What can you tell me about the attached file?`,O=v?.trim()||D,k={question:O,retry:D,attachments:s,selectedBlocks:l,inkIntents:g};a?.();let A=T?.freshStart?null:m.current;f.current?.abort(),p.current?.(),p.current=null;let j=new AbortController;f.current=j;let M=T?.freshStart?[]:d.current,N=T?.freshStart?null:_.current,P=Qo(m.current),F=!!(s?.length||l?.length||h&&Object.keys(h).length||g?.length),I=n(),L=r?.(),R=Go(I,L),ee=`${D}::${Ko(M,P,T?.lesson)}::${R}`,z=Yo(ee,I),ie=F?null:b.current.get(ee)??null;for(let e of x.current)e.key===ee&&ie||(e.ctrl.abort(),b.current.delete(e.key));x.current=ie?x.current.filter(e=>e.key===ee):[];let ae=F?null:qo(y.current,ee);c({type:`start`,fresh:T?.freshStart});let se=!Ve(N,D),B,ce=!1,le=null,ue=ae;if(!ue&&ie){let e=await ie.catch(()=>null);if(j.signal.aborted)return;e&&!e.error&&e.spec.blocks.length>0&&(ue=e)}if(!ue&&!F&&(ue=await Xo(z),j.signal.aborted))return;if(ue){let e=ue;e.narration&&(c({type:`speak`,narration:e.narration}),i?.(e.spoken||e.narration)),B=e}else{let e=``,t=new dt(`narration`),n=0,r=!1,a=on(sn(D)),o=0,u;try{u=await zo()}catch{if(j.signal.aborted)return;c({type:`error`,error:{kind:`network`,message:`Mavéa couldn't finish loading. Check your connection and try again.`,...k}});return}let{generateLive:d}=u,f=null,p=0,m=()=>{if(p=0,!f||j.signal.aborted)return;let e=f;f=null,ce=!0,le=e,c({type:`stream`,spec:e})};if(j.signal.addEventListener(`abort`,()=>{f=null,p&&cancelAnimationFrame(p)},{once:!0}),B=await d(D,M,I,s=>{if(j.signal.aborted)return;e+=s,t.scan(e);let l=t.progress();if(!l)return;let{chunk:u,consumed:d}=ft(l.text,n,l.done);u&&(n=d,r=!0,c({type:`speak`,narration:ne(te(l.text.slice(0,d)))}),!(o>=a)&&(o+=u.length,i?.(u)))},{caps:L,signal:j.signal,onActivity:e=>{j.signal.aborted||c({type:`activity`,activity:e})},recentTypes:[...S.current],rotation:C.current,attachments:s,selectedBlocks:l,filledBlanks:h,inkIntents:g,priorTopic:N?.title||void 0,priorWorld:P,lesson:T?.lesson,onPartial:se?e=>{j.signal.aborted||(re(e.spec.blocks),f=e.spec,ce?p||=requestAnimationFrame(m):m())}:void 0,onSources:e=>{j.signal.aborted||c({type:`sources`,sources:e})},onPending:se?e=>{j.signal.aborted||c({type:`pending`,pending:e})}:void 0,onThinking:e=>{j.signal.aborted||c({type:`thinking`,on:e})}}),p&&cancelAnimationFrame(p),m(),j.signal.aborted)return;!r&&B.narration&&(c({type:`speak`,narration:B.narration}),i?.(B.spoken||B.narration)),!F&&!B.error&&B.spec.blocks.length>0&&(Jo(y.current,ee,B),Zo(B,L)&&Nn(z,{at:Date.now(),result:B}))}if(B.error){c({type:`error`,error:{...B.error,...k}});return}let de=l?.length?`${O} (about: ${l.map(oe).join(`, `)})`:O,fe=[...M,{role:`user`,content:de},{role:`assistant`,content:B.narration||B.spec.title}],pe,me,he;try{let e=lo(N,T?.freshStart?[]:m.current?.blocks??[],O,B,{forceReplace:se});pe=e.mode,me=e.frame.spec;let t=e.snap;he=w?{...e.frame,mind:w}:e.frame,re(me.blocks),c({type:`show`,spec:me,narration:B.narration,history:fe,mode:pe,spot:e.spot,prior:t,tour:he.tour,priorSpec:A,streamed:ce&&es(le,me),frame:he,understood:B.understood??[],freshTimeline:T?.freshStart});for(let e of t.blockTypes)S.current.add(e)}catch{c({type:`error`,error:{kind:`http`,message:`Something went wrong putting that answer together — let's try again.`,...k}});return}if(r?.().memoryEnabled&&an(D))try{let e=String(he.at),t=O.slice(0,200),n=(me.sources?.length??0)>0,r=B.memory??[];if(r.length)Tn(r.map(r=>({...r,source:So(r.body,O,{webGrounded:n}),turnId:e,quote:t})));else{let n=_o(O);n.length&&Tn([{concept:`profile`,body:n.join(`. `),source:`user-stated`,turnId:e,quote:t}])}if(B.corrects){let t=Co(B.corrects.now,O);Tn([Eo(B.corrects,{turnId:e,source:t})])}}catch{}pe===`replace`&&o?.()&&dn(me,O);let ge=n(),_e=r?.();if(_e?.quality===`thorough`){let e=me.suggests??[],t=[...S.current],n=Go(ge,_e),r=Ko(fe,Qo(me),void 0);e.slice(0,Wo).forEach((e,i)=>{let a=`${e.label}::${r}::${n}`;if(qo(y.current,a)||b.current.has(a))return;let o=new AbortController;x.current.push({key:a,ctrl:o});let s=zo().then(({generateLive:n})=>n(e.label,fe,ge,void 0,{caps:_e,signal:o.signal,repair:!1,recentTypes:t,rotation:C.current+1+i})).then(e=>(!o.signal.aborted&&!e.error&&e.spec.blocks.length>0&&Jo(y.current,a,e),e));b.current.set(a,s);let c=()=>{b.current.get(a)===s&&b.current.delete(a)};s.then(c,c)})}},[t,n,r,i,a,o]),T=(0,H.useCallback)(()=>{f.current?.abort(),f.current=null,p.current?.(),p.current=null;for(let e of x.current)e.ctrl.abort();x.current=[],b.current.clear(),y.current.clear(),S.current.clear(),c({type:`reset`})},[]),E=(0,H.useCallback)(e=>c({type:`spot`,spot:e}),[]),D=(0,H.useCallback)(e=>c({type:`jump`,index:e}),[]),O=(0,H.useCallback)(e=>{e&&re(e.blocks),c({type:`preview`,spec:e})},[]),k=(0,H.useCallback)(e=>{let t=h.current?.blocks.find(t=>t.id===e);if(t)return t;let n=m.current?.blocks.find(t=>t.id===e);if(n)return n;for(let t of g.current){let n=t.spec.blocks.find(t=>t.id===e);if(n)return n}},[]),A=(0,H.useCallback)(async e=>{let{canRun:t,getConfig:n}=l.current;if(t&&!t())return null;let r=k(e);if(r?.type!==`world`)return null;if(r.props.world)return r.props.world;let i=r.props.title;try{let t=await tn(i,await cn(i),n());return t&&c({type:`world`,blockId:e,question:i,world:t}),t}catch{return null}},[k]),j=(0,H.useCallback)(async(e,t,n)=>{let{canRun:r,getConfig:i}=l.current;if(r&&!r())return null;let a=k(e);if(a?.type!==`world`)return null;let o=n??a.props.world;if(!o)return null;try{return await Ro(o,t,await cn(o.title),i())}catch{return null}},[k]),M=(0,H.useCallback)(e=>c({type:`fill`,value:e}),[]),N=(0,H.useCallback)(e=>c({type:`unfill`,key:e}),[]),P=(0,H.useCallback)(e=>c({type:`setActiveBlank`,key:e}),[]),F=(0,H.useCallback)(()=>{let e=m.current,t=v.current;return!e||!Object.keys(t).length||u.current?!1:(w(`Complete the answer you started above using the values I just filled into the blanks — keep everything you already showed and fill in only the parts that depended on those values. Do not start over.`,void 0,e.blocks,t),!0)},[w]),I=(0,H.useCallback)((e,t)=>{a?.(),re(e.blocks),c({type:`restore`,spec:e,question:t,at:Date.now()})},[a]),L=(0,H.useCallback)((e,t,n)=>{let r=n?.silent===!0;re(e.spec.blocks),n?.interrupt!==!1&&a?.();let o=Te();c({type:`start`,fresh:!1}),r||c({type:`speak`,narration:e.narration});let s=r?void 0:i?.(e.spoken??e.narration),l=[...d.current,{role:`user`,content:t},{role:`assistant`,content:e.narration||e.spec.title}],u={question:t,narration:e.narration,title:e.spec.title,blockTypes:e.spec.blocks.map(e=>e.type)},f=m.current,h=e.spec.blocks.find(e=>e.id)?.id??null;p.current?.();let g=!1;p.current=()=>{g=!0};let _=()=>{g||(p.current=null,c({type:`show`,spec:e.spec,narration:e.narration,understood:[],history:l,mode:e.mode,prior:u,tour:r?[]:e.tour,spot:h,frame:e,priorSpec:f,streamed:!1,freshTimeline:!1}))};n?.revealNow||r?_():o?window.setTimeout(_,480):Je(s?s.started:Promise.resolve(!1),Ze).then(_)},[a,i]),R=s.viewOverride?s.viewOverride:s.viewIndex==null?s.spec:s.frames[s.viewIndex]?.spec??s.spec;return h.current=R,(0,H.useEffect)(()=>()=>{f.current?.abort(),p.current?.();for(let e of x.current)e.ctrl.abort()},[]),{...s,run:w,reset:T,setSpot:E,restore:I,jumpTo:D,previewSpec:O,fill:M,unfill:N,generateWorld:A,expandWorld:j,setActiveBlank:P,complete:F,showFrame:L,viewSpec:R}}function os(e){return e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`}function ss(e){return`${os(e)}. What can I help you explore?`}var cs=`mavea-live-setup-v1`;function ls(){try{return localStorage.getItem(cs)===`1`}catch{return!1}}function us(){try{localStorage.setItem(cs,`1`)}catch{}}function ds(){try{localStorage.removeItem(cs)}catch{}}var fs=[{id:`connect`,label:`Connect`,title:`Hi. Which mind should I think with?`,sub:`Your key, your model. Stored here only if you choose, then sent through this deployment.`},{id:`think`,label:`Think`,title:`How thorough should I be?`,sub:`All of this is optional, the defaults are good.`},{id:`remember`,label:`Remember`,title:`Should I remember you, and how should I sound?`,sub:`Memory lives on this device. You can hear me first.`},{id:`go`,label:`Go`,title:`What are we figuring out?`,sub:`Talk like you would to a friend, switch topics whenever you want.`}],ps=`I’m awake.`,ms=`Set and ready, start talking, or try one of these.`,hs=fs.map(e=>e.id);function gs(e){let t=hs.indexOf(e);return t>=0&&t<hs.length-1?hs[t+1]:null}function _s(e){return fs.find(t=>t.id===e)??fs[0]}function vs(e){let t=(0,q.c)(17),{current:n,done:r,onPick:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],t[0]=a):a=t[0];let o=(0,H.useRef)(a),s,c,l,u,d;if(t[1]!==n||t[2]!==r||t[3]!==i){let e=e=>t=>{if(t.key!==`ArrowRight`&&t.key!==`ArrowLeft`)return;t.preventDefault();let n=(e+(t.key===`ArrowRight`?1:-1)+fs.length)%fs.length;o.current[n]?.focus(),i(fs[n].id)};u=`constellation`,d=`Setup steps`,s=`const-track`,c=`tablist`,l=fs.map((t,a)=>{let s=t.id===n,c=r.has(t.id)&&!s;return(0,U.jsxs)(`li`,{className:`const-step `+(s?`is-current`:c?`is-done`:`is-future`),children:[(0,U.jsx)(`button`,{ref:e=>{o.current[a]=e},type:`button`,role:`tab`,"aria-selected":s,"aria-current":s?`step`:void 0,"aria-label":`${t.label}${c?`, done`:``}`,tabIndex:s?0:-1,className:`const-disc`,onClick:()=>i(t.id),onKeyDown:e(a),children:c?(0,U.jsx)(z.check,{}):s?null:(0,U.jsx)(`span`,{className:`const-num`,"aria-hidden":!0,children:a+1})}),(0,U.jsx)(`span`,{className:`const-label`,children:t.label})]},t.id)}),t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d}else s=t[4],c=t[5],l=t[6],u=t[7],d=t[8];let f;t[9]!==s||t[10]!==c||t[11]!==l?(f=(0,U.jsx)(`ol`,{className:s,role:c,children:l}),t[9]=s,t[10]=c,t[11]=l,t[12]=f):f=t[12];let p;return t[13]!==u||t[14]!==d||t[15]!==f?(p=(0,U.jsx)(`nav`,{className:u,"aria-label":d,children:f}),t[13]=u,t[14]=d,t[15]=f,t[16]=p):p=t[16],p}function ys(e){let t=(0,q.c)(16),{label:n,on:r,onToggle:i,note:a}=e,o;t[0]===n?o=t[1]:(o=(0,U.jsx)(`span`,{className:`toggle-label`,children:n}),t[0]=n,t[1]=o);let s;t[2]===a?s=t[3]:(s=(0,U.jsx)(`span`,{className:`toggle-note`,children:a}),t[2]=a,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,U.jsxs)(`div`,{className:`toggle-text`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l=`toggle-pill`+(r?` is-on`:``),u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,U.jsx)(`span`,{className:`toggle-knob`}),t[7]=u):u=t[7];let d;t[8]!==n||t[9]!==r||t[10]!==i||t[11]!==l?(d=(0,U.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":n,onClick:i,className:l,children:u}),t[8]=n,t[9]=r,t[10]=i,t[11]=l,t[12]=d):d=t[12];let f;return t[13]!==c||t[14]!==d?(f=(0,U.jsxs)(`div`,{className:`toggle-row`,children:[c,d]}),t[13]=c,t[14]=d,t[15]=f):f=t[15],f}function bs(e){let t=(0,q.c)(10),{value:n,options:r,onPick:i,ariaLabel:a}=e,o;if(t[0]!==i||t[1]!==r||t[2]!==n){let e;t[4]!==i||t[5]!==n?(e=e=>{let t=e.value===n;return(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>i(e.value),className:`seg-opt`+(t?` is-active`:``),children:[(0,U.jsx)(`span`,{className:`seg-title`,children:e.label}),e.sub&&(0,U.jsx)(`span`,{className:`seg-sub`,children:e.sub})]},e.value)},t[4]=i,t[5]=n,t[6]=e):e=t[6],o=r.map(e),t[0]=i,t[1]=r,t[2]=n,t[3]=o}else o=t[3];let s;return t[7]!==a||t[8]!==o?(s=(0,U.jsx)(`div`,{className:`seg`,role:`radiogroup`,"aria-label":a,children:o}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function xs(e){let t=(0,q.c)(20),{id:n,value:r,onChange:i,placeholder:a,ariaLabel:o}=e,[s,c]=(0,H.useState)(!1),l=(0,H.useId)(),u=n??l,d=s?`text`:`password`,f;t[0]===i?f=t[1]:(f=e=>i(e.target.value),t[0]=i,t[1]=f);let p;t[2]!==o||t[3]!==a||t[4]!==u||t[5]!==d||t[6]!==f||t[7]!==r?(p=(0,U.jsx)(`input`,{id:u,className:`setup-input`,type:d,value:r,onChange:f,placeholder:a,spellCheck:!1,autoComplete:`new-password`,"aria-label":o}),t[2]=o,t[3]=a,t[4]=u,t[5]=d,t[6]=f,t[7]=r,t[8]=p):p=t[8];let m;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>c(Ss),t[9]=m):m=t[9];let h=s?`Hide key`:`Show key`,g=s?`Hide key`:`Show key`,_;t[10]===s?_=t[11]:(_=s?(0,U.jsx)(z.eyeOff,{}):(0,U.jsx)(z.eye,{}),t[10]=s,t[11]=_);let v;t[12]!==s||t[13]!==h||t[14]!==g||t[15]!==_?(v=(0,U.jsx)(`button`,{type:`button`,className:`input-eye`,onClick:m,"aria-label":h,"aria-pressed":s,title:g,children:_}),t[12]=s,t[13]=h,t[14]=g,t[15]=_,t[16]=v):v=t[16];let y;return t[17]!==p||t[18]!==v?(y=(0,U.jsxs)(`div`,{className:`input-wrap`,children:[p,v]}),t[17]=p,t[18]=v,t[19]=y):y=t[19],y}function Ss(e){return!e}var Cs={gemini:{badge:`G`,name:`Gemini`,sub:`Google`},anthropic:{badge:`A`,name:`Claude`,sub:`Anthropic`},openai:{badge:`O`,name:`GPT`,sub:`OpenAI`},grok:{badge:`X`,name:`Grok`,sub:`xAI`},openrouter:{badge:`R`,name:`OpenRouter`,sub:`Many models`}},ws={native:`Real-time web search built in (grounds server-side when a question needs it).`,app:`Web grounding via Wikipedia, or your own Brave/Tavily search key.`,local:`Web grounding via Wikipedia when you ask for it.`},Ts={anthropic:`sk-ant-…`,openai:`sk-…`,gemini:`AIza…`,grok:`xai-…`,openrouter:`sk-or-…`};function Es(e){return e.split(` · `)[1]??e}function Ds(){let e=(0,q.c)(52),t=(0,H.useId)(),[n]=Qt(),r=_t(n.provider),i=n.models[n.provider]??``,a=i||r.defaultModel,o=n.keys[n.provider]??``,[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(!1),d=(0,H.useRef)(0),f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=async()=>{let e=d.current+=1;u(!0);let t=await qn(qt(Jt()),{tts:!1});e===d.current&&(c({llm:t.llm,model:t.model,statusCode:t.statusCode}),u(!1))},e[0]=f):f=e[0];let p=f;(0,H.useEffect)(()=>{if(r.needsKey&&!o){c(null);return}let e=setTimeout(()=>void p(),400);return()=>clearTimeout(e)},[n.provider,a,o,p,r.needsKey]);let m=!!s?.llm&&!!s?.model&&!!a,h=l?`checking`:m?`ok`:`warn`,g=l?`Checking…`:r.needsKey&&!o?`Add your API key.`:a?m?`Looks good.`:s?.llm?`Reachable, but the model was not found.`:s?.statusCode===401?`Invalid API key.`:s?.statusCode===403?`Key lacks permission.`:s?.statusCode===404?`Model not found.`:s?.statusCode===void 0?`Not reachable.`:`Error ${s.statusCode}.`:`Choose a model.`,_=m?`Kept in memory unless you choose Remember; sent through this deployment to ${Es(r.label)} when used.`:``,v;e[1]===n.provider?v=e[2]:(v=vt.map(e=>{let t=Cs[e.id],r=e.id===n.provider;return(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,className:`provider-tile`+(r?` is-selected`:``),onClick:()=>Yt({provider:e.id}),children:[(0,U.jsx)(`span`,{className:`provider-badge`,children:t.badge}),(0,U.jsx)(`span`,{className:`provider-name`,children:t.name}),(0,U.jsx)(`span`,{className:`provider-sub`,children:t.sub})]},e.id)}),e[1]=n.provider,e[2]=v);let y;e[3]===v?y=e[4]:(y=(0,U.jsx)(`div`,{className:`provider-tiles`,role:`radiogroup`,"aria-label":`Provider`,children:v}),e[3]=v,e[4]=y);let b;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,U.jsx)(`p`,{className:`field-helper`,children:`When a default model is offered, start there for faster, lower-cost use and move up only when a task needs it. Requests pass through this deployment to the provider, whose usage charges, privacy, and retention terms apply.`}),e[5]=b):b=e[5];let x;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,U.jsx)(`span`,{className:`field-head`,children:(0,U.jsx)(`span`,{className:`card-eyebrow`,children:`Model`})}),e[6]=x):x=e[6];let S;e[7]===n.provider?S=e[8]:(S=e=>Zt(n.provider,`model`,e),e[7]=n.provider,e[8]=S);let C;e[9]!==n.provider||e[10]!==i||e[11]!==S?(C=(0,U.jsx)(xn,{provider:n.provider,value:i,onChange:S},n.provider),e[9]=n.provider,e[10]=i,e[11]=S,e[12]=C):C=e[12];let w;e[13]!==r.modelNotes||e[14]!==a?(w=r.modelNotes?.[a]&&(0,U.jsx)(`span`,{className:`field-helper`,children:r.modelNotes[a]}),e[13]=r.modelNotes,e[14]=a,e[15]=w):w=e[15];let T=ws[r.search],E;e[16]===T?E=e[17]:(E=(0,U.jsx)(`span`,{className:`field-helper`,children:T}),e[16]=T,e[17]=E);let D;e[18]!==C||e[19]!==w||e[20]!==E?(D=(0,U.jsxs)(`div`,{className:`field-col`,children:[x,C,w,E]}),e[18]=C,e[19]=w,e[20]=E,e[21]=D):D=e[21];let O;e[22]!==n.provider||e[23]!==r.keyUrl||e[24]!==r.needsKey||e[25]!==o||e[26]!==t?(O=r.needsKey&&(0,U.jsxs)(`label`,{className:`field-col`,htmlFor:t,children:[(0,U.jsx)(`span`,{className:`field-head`,children:(0,U.jsx)(`span`,{className:`card-eyebrow`,children:`API key`})}),(0,U.jsx)(xs,{id:t,value:o,onChange:e=>Zt(n.provider,`key`,e),placeholder:Ts[n.provider]??`paste your key`,ariaLabel:`API key`}),r.keyUrl&&(0,U.jsx)(`a`,{className:`field-helper field-helper-link`,href:r.keyUrl,target:`_blank`,rel:`noreferrer noopener`,children:`Get a key↗`}),(0,U.jsx)(`span`,{className:`field-helper`,children:`Tip: use a restricted, spend-capped key — if it's ever exposed, the cost and access stay bounded.`})]}),e[22]=n.provider,e[23]=r.keyUrl,e[24]=r.needsKey,e[25]=o,e[26]=t,e[27]=O):O=e[27];let k;e[28]!==D||e[29]!==O?(k=(0,U.jsxs)(`div`,{className:`field-grid`,children:[D,O]}),e[28]=D,e[29]=O,e[30]=k):k=e[30];let A=`status-strip `+h,j;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,U.jsx)(`span`,{className:`status-strip-dot`,"aria-hidden":!0}),e[31]=j):j=e[31];let M;e[32]===g?M=e[33]:(M=(0,U.jsx)(`strong`,{children:g}),e[32]=g,e[33]=M);let N=_&&` `+_,P;e[34]!==M||e[35]!==N?(P=(0,U.jsxs)(`span`,{className:`status-strip-text`,children:[M,N]}),e[34]=M,e[35]=N,e[36]=P):P=e[36];let F;e[37]===p?F=e[38]:(F=(0,U.jsx)(`button`,{type:`button`,className:`status-strip-test`,onClick:()=>void p(),title:`Re-check the connection`,children:`Test`}),e[37]=p,e[38]=F);let I;e[39]!==A||e[40]!==P||e[41]!==F?(I=(0,U.jsxs)(`div`,{className:A,children:[j,P,F]}),e[39]=A,e[40]=P,e[41]=F,e[42]=I):I=e[42];let L;e[43]!==n.rememberKey||e[44]!==r.needsKey?(L=r.needsKey&&(0,U.jsx)(ys,{label:`Remember this key on this device`,on:n.rememberKey,onToggle:()=>Yt({rememberKey:!n.rememberKey}),note:n.rememberKey?`Saved encrypted in this browser; use only on a trusted device.`:`Kept in memory only, cleared when you reload.`}),e[43]=n.rememberKey,e[44]=r.needsKey,e[45]=L):L=e[45];let R;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,U.jsx)(gn,{}),e[46]=R):R=e[46];let ee;return e[47]!==k||e[48]!==I||e[49]!==y||e[50]!==L?(ee=(0,U.jsxs)(`div`,{className:`step-body`,children:[y,b,k,I,L,R]}),e[47]=k,e[48]=I,e[49]=y,e[50]=L,e[51]=ee):ee=e[51],ee}function X(){let e=(0,q.c)(19),[t]=Qt(),n=Wt(t.provider).capabilities,r=t.searchMode===`off`?`Answers from the model's own knowledge — no web calls.`:n.nativeWebSearch?`Grounds fresh asks in live web results with citations, only when a question needs it.`:`This model has no built-in search, so Real-time won't ground anything right now. Works only if your model supports it — pick one that does (Gemini or OpenRouter), or leave this off.`,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsx)(`span`,{className:`card-eyebrow`,children:`Web search`}),e[0]=i):i=e[0];let a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=[{value:`off`,label:`Off`,sub:`model knowledge`},{value:`realtime`,label:`Real-time`,sub:`live sources`}],e[1]=a):a=e[1];let o;e[2]===t.searchMode?o=e[3]:(o=(0,U.jsx)(bs,{ariaLabel:`Web search`,value:t.searchMode,onPick:Os,options:a}),e[2]=t.searchMode,e[3]=o);let s;e[4]===r?s=e[5]:(s=(0,U.jsx)(`p`,{className:`field-helper`,children:r}),e[4]=r,e[5]=s);let c;e[6]!==o||e[7]!==s?(c=(0,U.jsxs)(`div`,{className:`field-block`,children:[i,o,s]}),e[6]=o,e[7]=s,e[8]=c):c=e[8];let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,U.jsx)(`span`,{className:`card-eyebrow`,children:`Answer quality`}),e[9]=l):l=e[9];let u;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=[{value:`fast`,label:`Fast`,sub:`quickest`},{value:`balanced`,label:`Balanced`,sub:`default`},{value:`thorough`,label:`Thorough`,sub:`thinks more`}],e[10]=u):u=e[10];let d;e[11]===t.quality?d=e[12]:(d=(0,U.jsx)(bs,{ariaLabel:`Answer quality`,value:t.quality,onPick:Z,options:u}),e[11]=t.quality,e[12]=d);let f;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,U.jsx)(`p`,{className:`field-helper`,children:`Fast keeps replies snappy; Thorough lets the model think more on hard questions.`}),e[13]=f):f=e[13];let p;e[14]===d?p=e[15]:(p=(0,U.jsxs)(`div`,{className:`field-block`,children:[l,d,f]}),e[14]=d,e[15]=p);let m;return e[16]!==c||e[17]!==p?(m=(0,U.jsxs)(`div`,{className:`step-body`,children:[c,p]}),e[16]=c,e[17]=p,e[18]=m):m=e[18],m}function Z(e){return Yt({quality:e})}function Os(e){return Yt({searchMode:e})}function ks(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function As(e){let t=ke(e);if(t){Ne(`mavea`,t.kokoro);try{localStorage.setItem(Me,e)}catch{}}}function js(e){let t=(0,q.c)(20),{label:n,value:r,onChange:i}=e,a;t[0]===n?a=t[1]:(a=(0,U.jsx)(`span`,{className:`card-eyebrow`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=e=>{i(e),As(e);let t=ke(e);t&&vn(t)},t[2]=i,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=Fe.map(Ms),t[4]=s):s=t[4];let c;t[5]!==n||t[6]!==o||t[7]!==r?(c=(0,U.jsx)(Jn,{ariaLabel:n,value:r,onChange:o,options:s}),t[5]=n,t[6]=o,t[7]=r,t[8]=c):c=t[8];let l;t[9]===r?l=t[10]:(l=()=>{let e=ke(r);e&&vn(e)},t[9]=r,t[10]=l);let u;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,U.jsx)(z.play,{}),t[11]=u):u=t[11];let d;t[12]===l?d=t[13]:(d=(0,U.jsx)(`button`,{type:`button`,className:`voice-play`,onClick:l,"aria-label":`Preview Mavéa's voice`,title:`Preview voice`,children:u}),t[12]=l,t[13]=d);let f;t[14]!==c||t[15]!==d?(f=(0,U.jsxs)(`div`,{className:`voice-row`,children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16];let p;return t[17]!==a||t[18]!==f?(p=(0,U.jsxs)(`div`,{className:`voice-col`,children:[a,f]}),t[17]=a,t[18]=f,t[19]=p):p=t[19],p}function Ms(e){return{value:e.id,label:e.label,note:e.tone}}function Ns(){let e=(0,q.c)(16),[t]=Qt(),n=hn(),[r,i]=(0,H.useState)(Is),a;e[0]===t.memoryEnabled?a=e[1]:(a=()=>Yt({memoryEnabled:!t.memoryEnabled}),e[0]=t.memoryEnabled,e[1]=a);let o;e[2]!==t.memoryEnabled||e[3]!==a?(o=(0,U.jsx)(ys,{label:`Remember me`,on:t.memoryEnabled,onToggle:a,note:`Durable facts about you, kept on this device only, to personalize future chats.`}),e[2]=t.memoryEnabled,e[3]=a,e[4]=o):o=e[4];let s;e[5]!==t.memoryEnabled||e[6]!==n?(s=t.memoryEnabled&&(0,U.jsxs)(`div`,{className:`memory-panel`,children:[(0,U.jsxs)(`div`,{className:`memory-head`,children:[(0,U.jsxs)(`span`,{className:`card-eyebrow`,children:[`What Mavéa remembers (`,n.length,` `,n.length===1?`concept`:`concepts`,`)`]}),n.length>0&&(0,U.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:Fs,children:`Forget all`})]}),n.length===0?(0,U.jsx)(`p`,{className:`memory-empty`,children:`Nothing yet — Mavéa will note useful facts as you talk.`}):(0,U.jsx)(`ul`,{className:`memory-list`,children:n.map(Ps)})]}),e[5]=t.memoryEnabled,e[6]=n,e[7]=s):s=e[7];let c;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,U.jsx)(`hr`,{className:`setup-divider`}),e[8]=c):c=e[8];let l;e[9]===r?l=e[10]:(l=(0,U.jsx)(`div`,{className:`voice-grid`,children:(0,U.jsx)(js,{label:`Mavéa speaks as`,value:r,onChange:i})}),e[9]=r,e[10]=l);let u;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,U.jsx)(Sn,{}),e[11]=u):u=e[11];let d;return e[12]!==o||e[13]!==s||e[14]!==l?(d=(0,U.jsxs)(`div`,{className:`step-body`,children:[o,s,c,l,u]}),e[12]=o,e[13]=s,e[14]=l,e[15]=d):d=e[15],d}function Ps(e){return(0,U.jsxs)(`li`,{className:`memory-fact`,children:[(0,U.jsx)(`span`,{className:`memory-fact-concept`,children:e.concept}),(0,U.jsx)(`span`,{className:`memory-fact-text`,children:e.body}),(0,U.jsx)(`button`,{type:`button`,className:`memory-x`,onClick:()=>On(e.id),"aria-label":`Forget: ${e.concept}`,title:`Forget this`,children:(0,U.jsx)(z.x,{})})]},e.id)}function Fs(){return Dn()}function Is(){return ks(Me,Oe)}var Ls=[{kicker:`Build`,accent:`var(--presence)`,prompt:`Build me a budget for a $5,000 month`},{kicker:`Decide`,accent:`var(--insight)`,prompt:`Should I take the train or fly to Boston?`},{kicker:`Understand`,accent:`var(--warning)`,prompt:`How does refinancing actually work?`},{kicker:`Plan`,accent:`var(--danger)`,prompt:`Three days in Tokyo, food first`}];function Rs({onStart:e}){return(0,U.jsx)(`div`,{className:`starter-grid`,role:`list`,children:Ls.map(t=>(0,U.jsxs)(`button`,{type:`button`,className:`starter-chip`,style:{"--starter-accent":t.accent},onClick:()=>e(t.prompt),children:[(0,U.jsxs)(`span`,{className:`starter-kicker`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,children:`✦`}),` `,t.kicker]}),(0,U.jsx)(`span`,{className:`starter-copy`,children:t.prompt})]},t.kicker))})}function zs(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Bs(e,t){return ke(zs(e,t))?.label??`Voice`}var Vs={fast:`Fast — snappy & cheap`,balanced:`Balanced — the default`,thorough:`Thorough — deeper thinking`};function Hs(e){let t=(0,q.c)(54),{onJump:n,onStart:r,onStartTalking:i,onStartOver:a,onSeeHow:o,studySlot:s,librarySlot:c}=e,[l]=Qt(),u=hn(),d=mn(),f,p;if(t[0]!==l.models||t[1]!==l.provider){let e=_t(l.provider);f=l.models[l.provider]||e.defaultModel,p=e.label.split(` · `)[1]??(e.needsKey?e.label:`Local`),t[0]=l.models,t[1]=l.provider,t[2]=f,t[3]=p}else f=t[2],p=t[3];let m=p,h;t[4]===l?h=t[5]:(h=Xt(l),t[4]=l,t[5]=h);let g=h,_=l.searchMode===`off`?`Off`:`Real-time`,v=l.memoryEnabled?`${u.length} ${u.length===1?`concept`:`concepts`} · this device only`:`Off`,y=`${f} · ${m}`,b;t[6]===y?b=t[7]:(b={key:`model`,label:`Model`,value:y,step:`connect`},t[6]=y,t[7]=b);let x;t[8]===_?x=t[9]:(x={key:`search`,label:`Web search`,value:_,step:`think`},t[8]=_,t[9]=x);let S=Vs[l.quality]??l.quality,C;t[10]===S?C=t[11]:(C={key:`quality`,label:`Quality`,value:S,step:`think`},t[10]=S,t[11]=C);let w;t[12]===v?w=t[13]:(w={key:`memory`,label:`Memory`,value:v,step:`remember`},t[12]=v,t[13]=w);let T;t[14]===d?T=t[15]:(T=d===!1?`Off — captions only (voice needs the local TTS service)`:Bs(Me,Oe),t[14]=d,t[15]=T);let E;t[16]===T?E=t[17]:(E={key:`voice`,label:`Voice`,value:T,step:`remember`},t[16]=T,t[17]=E);let D;t[18]!==E||t[19]!==b||t[20]!==x||t[21]!==C||t[22]!==w?(D=[b,x,C,w,E],t[18]=E,t[19]=b,t[20]=x,t[21]=C,t[22]=w,t[23]=D):D=t[23];let O=D,k;t[24]!==n||t[25]!==O?(k=(0,U.jsx)(`ul`,{className:`checklist`,children:O.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,className:`check-row`,onClick:()=>n(e.step),children:[(0,U.jsx)(`span`,{className:`check-mark`,"aria-hidden":!0,children:(0,U.jsx)(z.check,{})}),(0,U.jsx)(`span`,{className:`check-label`,children:e.label}),(0,U.jsx)(`span`,{className:`check-value`,children:e.value})]})},e.key))}),t[24]=n,t[25]=O,t[26]=k):k=t[26];let A;t[27]!==g||t[28]!==n||t[29]!==i?(A=g?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ge,{kind:`voice-data`,from:`live`,className:`go-voice-notice`}),(0,U.jsxs)(`button`,{type:`button`,className:`go-start`,onClick:i,children:[(0,U.jsx)(z.mic,{}),` Start talking`]})]}):(0,U.jsxs)(`button`,{type:`button`,className:`go-start go-start--gated`,onClick:()=>n(`connect`),title:`Add a model and a key on the Connect step first`,children:[(0,U.jsx)(z.mic,{}),` Connect a model to start`]}),t[27]=g,t[28]=n,t[29]=i,t[30]=A):A=t[30];let j;t[31]===a?j=t[32]:(j=(0,U.jsx)(`div`,{className:`go-ghosts`,children:(0,U.jsx)(`button`,{type:`button`,className:`ghost-btn`,onClick:a,children:`Start over`})}),t[31]=a,t[32]=j);let M;t[33]!==k||t[34]!==A||t[35]!==j?(M=(0,U.jsxs)(`div`,{className:`go-left`,children:[k,A,j]}),t[33]=k,t[34]=A,t[35]=j,t[36]=M):M=t[36];let N;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,U.jsx)(`span`,{className:`card-eyebrow`,children:`Or start with one`}),t[37]=N):N=t[37];let P;t[38]===o?P=t[39]:(P=o&&(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:o,children:`See how it works`}),t[38]=o,t[39]=P);let F;t[40]===P?F=t[41]:(F=(0,U.jsxs)(`div`,{className:`try-head`,children:[N,P]}),t[40]=P,t[41]=F);let I;t[42]===r?I=t[43]:(I=(0,U.jsx)(Rs,{onStart:r}),t[42]=r,t[43]=I);let L;t[44]!==F||t[45]!==I?(L=(0,U.jsxs)(`div`,{className:`go-right`,children:[F,I]}),t[44]=F,t[45]=I,t[46]=L):L=t[46];let R;t[47]===c?R=t[48]:(R=c&&(0,U.jsx)(`div`,{className:`go-library`,children:c}),t[47]=c,t[48]=R);let ee;return t[49]!==s||t[50]!==M||t[51]!==L||t[52]!==R?(ee=(0,U.jsxs)(`div`,{className:`step-body go-grid`,children:[M,L,s,R]}),t[49]=s,t[50]=M,t[51]=L,t[52]=R,t[53]=ee):ee=t[53],ee}function Us({speak:e,goDemo:t,onStart:n,onStartTalking:r,onSeeHow:i,studySlot:a,librarySlot:o,seed:s}){let c=(0,H.useRef)(!ls()),l=(0,H.useRef)(!1),[u,d]=(0,H.useState)(c.current?`connect`:`go`),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(``),g=(0,H.useRef)(s??``),[_,v]=(0,H.useState)(!c.current),y=!c.current||_;(0,H.useEffect)(()=>{if(u!==`go`)return;v(!0),c.current&&us();let t=g.current;if(t){g.current=``,n(t);return}l.current||(l.current=!0,e(c.current?`I’m awake.`:ss(new Date().getHours())))},[u,e,n]),(0,H.useEffect)(()=>{let e=document.documentElement;return e.dataset.wizardStep=u,()=>{delete e.dataset.wizardStep}},[u]);let b=(0,H.useRef)(null);(0,H.useEffect)(()=>{let e=b.current;if(!e)return;let t=document.documentElement,n=0,r=()=>{n=0,t.style.setProperty(`--wiz-scroll`,String(Math.min(1,e.scrollTop/130)))},i=()=>{n||=requestAnimationFrame(r)};return e.addEventListener(`scroll`,i,{passive:!0}),r(),()=>{e.removeEventListener(`scroll`,i),n&&cancelAnimationFrame(n),t.style.removeProperty(`--wiz-scroll`)}},[u]);let x=e=>{p(y&&e!==`go`),d(e),e!==`go`&&h(``)},S=()=>{x(f?`go`:gs(u)??`go`)},C=()=>{(typeof window>`u`||window.confirm(`Start over? This clears your saved setup and replays the intro.`))&&(Gt(),ds(),Ct(),c.current=!0,l.current=!1,v(!1),p(!1),d(`connect`))},w=fs.findIndex(e=>e.id===u),T=new Set(fs.filter((e,t)=>y?e.id!==u:t<w).map(e=>e.id)),E=_s(u),D=u===`go`,O=D&&c.current?ps:E.title,k=D&&c.current?ms:E.sub;return(0,U.jsxs)(`div`,{className:`setup stage`,"data-active":`1`,children:[(0,U.jsxs)(`header`,{className:`setup-nav`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`setup-back`,onClick:t,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to the demo`]}),(0,U.jsx)(vs,{current:u,done:T,onPick:x}),(0,U.jsx)(Kn,{triggerClassName:`setup-icon-btn`})]}),(0,U.jsxs)(`div`,{className:`setup-stage`,ref:b,children:[(0,U.jsxs)(`div`,{className:`setup-head`,children:[(0,U.jsx)(`h1`,{className:`setup-q`,children:O}),(0,U.jsx)(`p`,{className:`setup-sub`,children:k})]}),(0,U.jsxs)(`section`,{className:`card reveal setup-card`+(D?` setup-card--wide`:``),"aria-label":E.label,children:[u===`connect`&&(0,U.jsx)(Ds,{}),u===`think`&&(0,U.jsx)(X,{}),u===`remember`&&(0,U.jsx)(Ns,{}),D&&(0,U.jsx)(Hs,{onJump:x,onStart:n,onStartTalking:r,onStartOver:C,onSeeHow:i,studySlot:a,librarySlot:o}),!D&&(0,U.jsxs)(`footer`,{className:`setup-foot`,children:[(0,U.jsx)(`span`,{className:`setup-foot-note`,children:`Changes save as you make them.`}),(0,U.jsxs)(`button`,{type:`button`,className:`setup-done`,onClick:S,children:[`Done `,(0,U.jsx)(z.check,{})]})]})]},u)]}),D&&(0,U.jsx)(`div`,{className:`go-composer`,children:(0,U.jsxs)(`div`,{className:`go-composer-inner`,children:[(0,U.jsx)(`input`,{className:`go-composer-input`,type:`text`,placeholder:`Say it or type it. Try ‘plan a trip’ or ‘compare two options’…`,value:m,autoComplete:`off`,spellCheck:!1,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m.trim()&&n(m.trim())}}),m.trim()?(0,U.jsx)(`button`,{type:`button`,className:`go-composer-send`,"aria-label":`Send`,onClick:()=>n(m.trim()),children:(0,U.jsx)(z.send,{})}):(0,U.jsx)(`button`,{type:`button`,className:`go-composer-mic`,"aria-label":`Use microphone`,onClick:r,children:(0,U.jsx)(z.mic,{})})]})})]})}function Ws({mode:e,onChange:t,pttKey:n,pttSide:r}){let[i,a]=(0,H.useState)(!1),o=(0,H.useRef)(null),s=(0,H.useRef)(null),c=(0,H.useCallback)(()=>{a(!1),s.current?.focus()},[]);(0,H.useEffect)(()=>{if(!i)return;let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)},t=e=>{e.key===`Escape`&&c()};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},[i,c]);let l=pn(n||`Alt`,r),u=e=>{t(e),c()},d=[{key:`tap`,title:`Tap`,blurb:`Tap once, then tap again to send`,checked:e===`tap`,onClick:()=>u(`tap`)},{key:`always`,title:`Always on`,blurb:`Hands-free — listens for any speech`,checked:e===`always`,onClick:()=>u(`always`)},{key:`hold`,title:`Hold ${l}`,blurb:`Hold the mic or ${l} to talk`,checked:e===`hold`,onClick:()=>u(`hold`)}];return(0,U.jsxs)(`div`,{className:`mic-mode-pop-root`,ref:o,children:[(0,U.jsx)(`button`,{type:`button`,className:`mic-mode-chevron`,ref:s,onClick:()=>a(e=>!e),"aria-expanded":i,"aria-haspopup":`menu`,"aria-label":`Mic mode`,title:`Mic mode`,children:(0,U.jsx)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M6 9l6 6 6-6`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),i&&(0,U.jsx)(`div`,{className:`mic-mode-pop`,role:`menu`,"aria-label":`Mic mode`,children:d.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.checked,className:`more-menu-row mic-mode-row`,onClick:e.onClick,children:[(0,U.jsx)(`span`,{className:`more-menu-name`,children:e.title}),(0,U.jsx)(`span`,{className:`more-menu-blurb`,children:e.blurb}),e.checked&&(0,U.jsx)(z.check,{className:`mic-mode-row-check`,"aria-hidden":`true`})]},e.key))})]})}function Gs(e,t){e.documentElement.dataset.presenceStyle=t}function Ks(e){delete e.documentElement.dataset.presenceStyle}var qs=/(photo|image|carousel|mood|palette|video|map|diagram|story|slide|verse)/,Js=/(chart|table|matrix|grid|stat|kpi|code|pipeline|timeline|kanban|roadmap|process|flow|tree|schema|heatmap|scatter|bars|donut|gauge|checks|network|sankey)/;function Ys(e,t){return!!(e?.blocks)?.some(e=>t.test(String(e.type).toLowerCase()))}function Xs({status:e,interjecting:t=!1,spec:n}){if(e===`thinking`)return`bead`;if(t)return`pip`;let r=La(n);return r===`warm`?`pip`:r===`concerned`?`hybrid`:Ys(n,qs)?`aura`:Ys(n,Js)?`bead`:`hybrid`}var Zs=6e3;function Qs({dashboardId:e,dashboardTitle:t,onDismiss:n}){let r=(0,H.useRef)(n);return r.current=n,(0,H.useEffect)(()=>{let e=setTimeout(()=>r.current(),Zs);return()=>clearTimeout(e)},[e]),(0,U.jsxs)(`div`,{className:`cards-pill dash-pill`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(z.check,{}),(0,U.jsxs)(`span`,{className:`cards-pill-text dash-pill-text`,children:[`Added to `,(0,U.jsx)(`strong`,{children:t})]}),(0,U.jsxs)(`a`,{className:`cards-pill-btn cards-pill-primary`,href:Yn.detail(e),onClick:n,children:[`Open `,(0,U.jsx)(z.chevR,{})]})]})}var $s={strong:`Strong evidence`,partial:`Partial evidence`,inferred:`Inferred`,unverified:`Unverified`},ec={strong:3,partial:2,inferred:1,unverified:1};function tc(e){let t=(0,q.c)(3),{count:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,U.jsx)(`i`,{className:`prov-dot`,"aria-hidden":`true`}),t[0]=r):r=t[0];let i=n==null?`Inferred`:`${n} ${n===1?`claim`:`claims`} inferred`,a;return t[1]===i?a=t[2]:(a=(0,U.jsxs)(`span`,{className:`prov-inferred`,children:[r,i]}),t[1]=i,t[2]=a),a}function nc(e){let t=(0,q.c)(8),{level:n,title:r}=e,i=ec[n],a=`prov-pill `+n,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[0,1,2],t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=(0,U.jsx)(`span`,{className:`prov-bars`,"aria-hidden":`true`,children:o.map(e=>(0,U.jsx)(`i`,{className:e<i?`on`:``},e))}),t[1]=i,t[2]=s);let c=$s[n],l;return t[3]!==a||t[4]!==s||t[5]!==c||t[6]!==r?(l=(0,U.jsxs)(`span`,{className:a,title:r,children:[s,c]}),t[3]=a,t[4]=s,t[5]=c,t[6]=r,t[7]=l):l=t[7],l}function rc({sources:e,hosts:t=!1,className:n}){return e.length?(0,U.jsxs)(`div`,{className:`grounded-in`+(n?` ${n}`:``),children:[(0,U.jsx)(`span`,{className:`grounded-in-label`,children:`Grounded in`}),(0,U.jsx)(`ul`,{children:e.map((e,n)=>{let r=V(e.url),i=t?ve(e.url):null;return(0,U.jsxs)(`li`,{children:[r?(0,U.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,children:e.title}):(0,U.jsx)(`span`,{className:`grounded-in-name`,children:e.title}),i&&(0,U.jsx)(`span`,{className:`grounded-in-host`,children:i})]},n)})})]}):null}var ic=(e,t,n)=>`block:${e}:${t}${n===void 0?``:`@${n}`}`,ac=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,40)||`value`;function oc(e){let t=[];switch(e.type){case`chart`:{let{labels:n,series:r,unit:i}=e.props;for(let e of r)e.data.forEach((r,a)=>{let o=n[a];o===void 0||!Number.isFinite(r)||t.push({key:`${ac(e.name)}-${ac(o)}`,label:`${e.name} · ${o}`,value:r,...i===void 0?{}:{unit:i},at:o})});return t}case`breakdown`:for(let n of e.props.rows)Number.isFinite(n.pct)&&t.push({key:ac(n.name),label:n.name,value:n.pct,unit:`%`});return t;case`kpi`:for(let n of e.props.kpis){let e=Vn(n.val);e&&t.push({key:ac(n.label),label:n.label,value:e.value,...e.kind===`pct`?{unit:`%`}:{}})}return t;case`ring`:for(let n of e.props.rings){let e=Vn(n.display);e&&t.push({key:ac(n.label),label:n.label,value:e.value,...n.unit===void 0?e.kind===`pct`?{unit:`%`}:{}:{unit:n.unit}})}return t;default:return t}}function sc(e,t){let n=e.props,r=n.title??n.eyebrow;return r===void 0?null:{id:`block:${t}`,label:r,role:`measure`}}function cc(e,t=``){let n=In(t),r=t.split(/(?<=[.!?])\s+|\n+/).map(e=>e.trim()).filter(Boolean),i=e.sources?.[0]?.url?Ln(e.sources[0].url):void 0,a=[],o=[],s=new Map,c=[];return e.blocks.forEach((e,t)=>{let l=oc(e);if(l.length===0)return;let u=sc(e,t);if(u){a.push(u);for(let e of l){let a=ic(t,e.key,e.at);if(s.has(a))continue;let l=r.find(t=>Hn(e.value,t)&&n(t)),d=l===void 0?void 0:{quote:l,...i===void 0?{}:{host:i}},f=Zn(a,e.label,e.value,d?`T2`:`T3`,e.unit,d,d===void 0,e.at);f&&(s.set(a,f),c.push({valueId:a,surface:`block`,id:u.id,label:u.label}),o.push({valueId:a,entityId:u.id,...e.at===void 0?{}:{at:e.at}}))}}}),{title:e.title,entities:a,relations:[],facts:o,trust:Qn(s,c)}}function lc({open:e,onClose:t,claim:n,conf:r,sources:i,hadFiles:a=!1,blocks:o}){(0,H.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]);let s=(0,H.useMemo)(()=>{if(!o?.length)return[];let e=i.map(e=>e.snippet??``).filter(Boolean).join(`
19
+ `),t=cc({title:n,blocks:[...o],sources:i},e);return t.facts.flatMap(e=>{let n=t.trust.values.get(e.valueId);return n===void 0||ge(n)===null?[]:[n]})},[o,n,i]),c=s.filter(e=>e.kind===`grounded`).length,l=i.length?`How sure Mavéa is, based on these sources`:a?`How sure Mavéa is, based on your files`:le;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`scrim`+(e?` show`:``),role:`presentation`,onClick:t,style:{pointerEvents:e?`auto`:`none`}}),(0,U.jsxs)(`aside`,{className:`drawer`+(e?` show`:``),"aria-hidden":!e,inert:!e,children:[(0,U.jsx)(`button`,{className:`drawer-x`,onClick:t,"aria-label":`Close evidence`,children:(0,U.jsx)(z.x,{})}),(0,U.jsxs)(`div`,{className:`drawer-head`,children:[(0,U.jsxs)(`div`,{className:`drawer-eyebrow`,children:[(0,U.jsx)(z.shield,{style:{width:14,height:14}}),` Where this came from`]}),(0,U.jsx)(`div`,{className:`drawer-claim`,children:n})]}),(0,U.jsxs)(`div`,{className:`drawer-body`,children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`var(--text-secondary)`},children:[(0,U.jsx)(nc,{level:r||`inferred`,title:l}),i.length>0?(0,U.jsxs)(`span`,{children:[`· grounded in `,i.length,` live source`,i.length===1?``:`s`]}):a?(0,U.jsx)(`span`,{children:`· based on your attached files`}):(0,U.jsx)(`span`,{children:`· from the model's own knowledge`})]}),i.length>0&&(0,U.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`grid`,gap:8},"aria-label":`Sources`,children:i.map((e,t)=>{let n=V(e.url);return n?(0,U.jsx)(`li`,{children:(0,U.jsxs)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`evidence-block evidence-src`,children:[(0,U.jsxs)(`div`,{className:`evidence-top`,children:[(0,U.jsxs)(`span`,{className:`evidence-file`,children:[(0,U.jsx)(z.globe,{style:{width:16,height:16}}),e.title]}),(0,U.jsx)(`span`,{className:`evidence-loc`,children:ve(e.url)??e.url}),(0,U.jsx)(z.external,{style:{width:14,height:14,flex:`0 0 auto`}})]}),e.snippet&&(0,U.jsx)(`div`,{className:`evidence-quote`,children:e.snippet})]})},t):null})}),s.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`drawer-eyebrow`,children:[(0,U.jsx)(z.chart,{style:{width:14,height:14}}),` The figures in this answer`]}),(0,U.jsx)(`p`,{className:`evidence-note`,children:c===0?`None of these is stated by a source — they are the model's own.`:`${c} of ${s.length} ${c===1?`is`:`are`} stated by a source you can read below.`}),(0,U.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`grid`,gap:8},"aria-label":`Figures in this answer`,children:s.map(e=>(0,U.jsxs)(`li`,{className:`evidence-block evidence-figure`,children:[(0,U.jsxs)(`div`,{className:`evidence-top`,children:[(0,U.jsx)(`span`,{className:`evidence-file`,children:e.label}),(0,U.jsx)(`span`,{className:`evidence-fig`,children:he(e)}),(0,U.jsx)(`span`,{className:`evidence-loc`,"data-status":e.kind,children:_e[e.kind]})]}),e.kind===`grounded`?(0,U.jsx)(`div`,{className:`evidence-quote`,children:e.resolution.receipt.quote}):e.kind===`illustrative`&&e.resolution.illustrative!==`Shows the shape, not your numbers.`?(0,U.jsx)(`div`,{className:`evidence-caveat`,children:e.resolution.illustrative}):null]},e.id))})]}),(0,U.jsxs)(`div`,{className:`assumption`,children:[(0,U.jsx)(z.alert,{}),i.length>0?(0,U.jsxs)(`div`,{children:[`Mavéa summarized these sources — open them to read the originals, and treat anything labeled `,(0,U.jsx)(`b`,{children:`inferred`}),` as a best estimate, not a verified fact.`]}):a?(0,U.jsxs)(`div`,{children:[`Mavéa answered from your attached files and its own knowledge — no live sources were checked. Treat anything labeled `,(0,U.jsx)(`b`,{children:`inferred`}),` as a best estimate, not a verified fact.`]}):(0,U.jsx)(`div`,{children:`This came from the model's own knowledge — nothing here was checked against live sources or your files. Treat it as a starting point, not verified fact.`})]})]})]})]})}var uc=new Set([`inferred`,`unverified`]);function dc(e){let{conf:t}=e.props;return t===`strong`||t===`partial`||t===`inferred`||t===`unverified`?t:void 0}function fc(e){if(!e)return 0;let t=0,n=e=>{for(let r of e){let e=dc(r);e&&uc.has(e)&&t++,r.type===`composite`&&n(r.props.regions.map(e=>e.block))}};return n(e.blocks),t}function pc(e,t=3){if(!e?.length)return[];let n=new Set,r=[];for(let i of e){let e=ve(i.url)??i.title,a=e.toLowerCase();if(!(!e||n.has(a))&&(n.add(a),r.push(e),r.length>=t))break}return r}function mc(e){let t=(0,q.c)(15),{question:n,narration:r,sources:i,inferred:a,tint:o}=e;if(!r)return null;let s;if(t[0]!==a||t[1]!==r||t[2]!==n||t[3]!==i||t[4]!==o){let e=pc(i),c;t[6]===o?c=t[7]:(c=o?{"--thread-tint":o}:void 0,t[6]=o,t[7]=c);let l;t[8]!==n||t[9]!==o?(l=n&&(0,U.jsxs)(`p`,{className:`hero-ask`,children:[o&&(0,U.jsx)(`span`,{className:`hero-thread-dot`,"aria-hidden":`true`}),`You asked, “`,n,`”`]}),t[8]=n,t[9]=o,t[10]=l):l=t[10];let u;t[11]===r?u=t[12]:(u=ut(r),t[11]=r,t[12]=u);let d;t[13]===u?d=t[14]:(d=(0,U.jsx)(`p`,{className:`hero-line voice-text`,children:u}),t[13]=u,t[14]=d),s=(0,U.jsxs)(`section`,{className:`answer-hero`,"aria-label":`Mavéa's answer`,style:c,children:[l,d,(e.length>0||a>0)&&(0,U.jsxs)(`p`,{className:`hero-meta`,children:[e.length>0&&(0,U.jsxs)(`span`,{className:`hero-sources`,children:[`Sources: `,e.join(` · `)]}),a>0&&(0,U.jsx)(tc,{count:a})]})]}),t[0]=a,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=s}else s=t[5];return s}var hc=1300;function gc(e){let t=(0,q.c)(9),{onDone:n,tint:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=()=>{let e=window.setTimeout(n,hc);return()=>window.clearTimeout(e)},a=[n],t[0]=n,t[1]=i,t[2]=a),(0,H.useEffect)(i,a);let o;t[3]===r?o=t[4]:(o=r?{"--topic-sweep-ink":r}:void 0,t[3]=r,t[4]=o);let s,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,U.jsx)(`span`,{className:`topic-sweep-line`}),c=(0,U.jsx)(`span`,{className:`topic-sweep-label`,children:`New topic`}),t[5]=s,t[6]=c):(s=t[5],c=t[6]);let l;return t[7]===o?l=t[8]:(l=(0,U.jsxs)(`aside`,{className:`topic-sweep`,"aria-hidden":`true`,style:o,children:[s,c]}),t[7]=o,t[8]=l),l}function _c(e){return e?.track!=null&&e.track.score>=95&&(e.sources?.length??0)>0}function vc(e,t){return en(e)&&t.blocks.length>=4}function yc(e,t){if(!ue(e))return!1;if(!t)return!0;let n=$n(t);return n.planning||n.comparison||n.whatIf||n.decision||n.troubleshoot}function bc(e){let t=(0,q.c)(58),{spec:n,followups:r,question:i,onAsk:a,onTrack:o,onDeepZoom:s,onCanvas:c,onSeeAll:l,threadCount:u,busy:d}=e,f;t[0]===n.sources?f=t[1]:(f=n.sources??[],t[0]=n.sources,t[1]=f);let p=f,m,h,g,_,v,y,b,x,S;if(t[2]!==d||t[3]!==r||t[4]!==a||t[5]!==c||t[6]!==s||t[7]!==l||t[8]!==o||t[9]!==i||t[10]!==p||t[11]!==n||t[12]!==u){let e=r.slice(0,12),f;t[22]!==o||t[23]!==n?(f=!!o&&_c(n),t[22]=o,t[23]=n,t[24]=f):f=t[24],v=f;let C;t[25]!==d||t[26]!==s||t[27]!==i||t[28]!==n?(C=!d&&!!s&&!!i&&vc(i,n),t[25]=d,t[26]=s,t[27]=i,t[28]=n,t[29]=C):C=t[29],g=C;let w;t[30]!==d||t[31]!==c||t[32]!==i||t[33]!==n?(w=!d&&!!c&&yc(n,i),t[30]=d,t[31]=c,t[32]=i,t[33]=n,t[34]=w):w=t[34],h=w,_=!!l&&(u??0)>=2,m=p.length>0||e.length>0||v||g||h||_,y=`answer-footer`+(p.length>0&&e.length>0?``:` single`),b=`Sources, follow-ups, and AI disclaimer`,t[35]===p?x=t[36]:(x=p.length>0&&(0,U.jsx)(rc,{sources:p,hosts:!0,className:`footer-grounded`}),t[35]=p,t[36]=x),S=e.length>0&&(0,U.jsxs)(`div`,{className:`footer-keepgoing`,children:[(0,U.jsx)(`span`,{className:`footer-label`,children:`Keep going`}),(0,U.jsx)(`ul`,{className:`footer-list`,children:e.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,className:`kg-row`,onClick:()=>a(e.route),disabled:d,children:[(0,U.jsx)(`span`,{className:`kg-q`,children:e.label}),(0,U.jsx)(`span`,{className:`kg-arrow`,"aria-hidden":`true`,children:`→`})]})},e.label))})]}),t[2]=d,t[3]=r,t[4]=a,t[5]=c,t[6]=s,t[7]=l,t[8]=o,t[9]=i,t[10]=p,t[11]=n,t[12]=u,t[13]=m,t[14]=h,t[15]=g,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=S}else m=t[13],h=t[14],g=t[15],_=t[16],v=t[17],y=t[18],b=t[19],x=t[20],S=t[21];let C;t[37]!==d||t[38]!==h||t[39]!==g||t[40]!==_||t[41]!==v||t[42]!==c||t[43]!==s||t[44]!==l||t[45]!==o||t[46]!==n.track?.reason||t[47]!==u?(C=(v||g||h||_)&&(0,U.jsxs)(`div`,{className:`footer-chips`,children:[_&&(0,U.jsxs)(`button`,{type:`button`,className:`footer-feature-chip is-thread`,onClick:l,title:`Bring all ${u} moments of this topic thread together onto one canvas`,children:[`See all ${u} moments`,(0,U.jsx)(`span`,{className:`footer-chip-arrow`,"aria-hidden":`true`,children:`→`})]}),h&&(0,U.jsxs)(`button`,{type:`button`,className:`footer-feature-chip`,onClick:c,title:`Spread this answer's cards on a board you can wander — the Mavéa threads them together`,children:[`See this answer as a canvas`,(0,U.jsx)(`span`,{className:`footer-chip-arrow`,"aria-hidden":`true`,children:`→`})]}),g&&(0,U.jsxs)(`button`,{type:`button`,className:`footer-feature-chip`,onClick:s,title:`Explore this topic level by level — from the broad field down to the mechanism`,children:[`Explore this step by step`,(0,U.jsx)(`span`,{className:`footer-chip-arrow`,"aria-hidden":`true`,children:`→`})]}),v&&(0,U.jsxs)(`button`,{type:`button`,className:`footer-track`,onClick:o,disabled:d,title:n.track?.reason,children:[`Track this live`,(0,U.jsx)(`span`,{className:`footer-track-arrow`,"aria-hidden":`true`,children:`→`})]})]}),t[37]=d,t[38]=h,t[39]=g,t[40]=_,t[41]=v,t[42]=c,t[43]=s,t[44]=l,t[45]=o,t[46]=n.track?.reason,t[47]=u,t[48]=C):C=t[48];let w=`footer-disclaimer`+(m?``:` only`),T;t[49]===w?T=t[50]:(T=(0,U.jsx)(`p`,{className:w,children:`AI-generated; may be inaccurate, incomplete, or outdated. Verify important information. Not medical, legal, financial, or other professional advice.`}),t[49]=w,t[50]=T);let E;return t[51]!==y||t[52]!==b||t[53]!==x||t[54]!==S||t[55]!==C||t[56]!==T?(E=(0,U.jsxs)(`section`,{className:y,"aria-label":b,children:[x,S,C,T]}),t[51]=y,t[52]=b,t[53]=x,t[54]=S,t[55]=C,t[56]=T,t[57]=E):E=t[57],E}var xc=[`Alt`,`Control`,`Shift`],Sc=[{side:`any`,label:`Either`},{side:`left`,label:`Left`},{side:`right`,label:`Right`}],Cc=typeof navigator<`u`&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),wc={Alt:Cc?`Option (⌥)`:`Alt`,Control:Cc?`Control (⌃)`:`Ctrl`,Shift:Cc?`Shift (⇧)`:`Shift`};function Tc({children:e,holdEnabled:t,showHint:n=!0,pttKey:r,pttSide:i=`any`,onHoldStart:a,onHoldEnd:o,onChangePttKey:s,onChangePttSide:c}){bn({enabled:t,pttKey:r,pttSide:i,onStart:a,onStop:o});let l=(0,H.useRef)(null),u=(0,H.useRef)(null),[d,f]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{let e=l.current,t=e?.closest(`.mavea-app`);if(!e||!t)return;let n=()=>t.style.setProperty(`--dock-h`,`${e.offsetHeight}px`);n();let r=typeof ResizeObserver>`u`?null:new ResizeObserver(n);return r?.observe(e),()=>{r?.disconnect(),t.style.removeProperty(`--dock-h`)}},[]),(0,H.useEffect)(()=>{if(!d)return;let e=e=>{u.current&&!u.current.contains(e.target)&&f(!1)},t=e=>{e.key===`Escape`&&(f(!1),u.current?.querySelector(`.dock-hint-btn`)?.focus())};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},[d]),(0,U.jsxs)(`div`,{className:`live-dock dock-bar`,ref:l,children:[(0,U.jsx)(`div`,{className:`dock-main`,children:e}),t&&n&&(0,U.jsxs)(`div`,{className:`dock-hint-wrap`,ref:u,children:[(0,U.jsxs)(`button`,{type:`button`,className:`dock-hint dock-hint-btn`,onClick:()=>f(e=>!e),title:`Click to change hold-to-talk key`,children:[`Hold `,pn(r||`Alt`,i),` to talk`]}),d&&(0,U.jsxs)(`div`,{className:`dock-hint-picker`,role:`menu`,"aria-label":`Choose hold-to-talk key`,children:[(0,U.jsx)(`div`,{className:`dock-hint-row`,children:xc.map(e=>(0,U.jsx)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":(r||`Alt`)===e,className:`dock-hint-key${(r||`Alt`)===e?` active`:``}`,title:wc[e],onClick:()=>s?.(e),children:pn(e)},e))}),(0,U.jsx)(`div`,{className:`dock-hint-row dock-hint-sides`,children:Sc.map(({side:e,label:t})=>(0,U.jsx)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":i===e,className:`dock-hint-key${i===e?` active`:``}`,title:e===`any`?`Either side of the key`:`Only the ${t.toLowerCase()} key`,onClick:()=>c?.(e),children:t},e))})]})]})]})}var Ec=e=>e.toLowerCase().replace(/\s+/g,` `).trim();function Dc(e){return Ec(`${e.question} ${e.spec.title??``} ${e.narration}`)}function Oc(e){let t=new Map;return e.forEach((n,r)=>{let i=n.corrects;if(!i)return;let a=Ec(i.what);if(a){for(let n=r-1;n>=0;n--)if(Dc(e[n]).includes(a)){t.set(n,{note:i,by:r});return}}}),t}function kc(e){if(!e)return``;try{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).formatToParts(new Date(e)).filter(e=>e.type===`hour`||e.type===`minute`||e.type===`literal`).map(e=>e.value).join(``).trim()}catch{return``}}function Ac({chapters:e,frames:t,currentIndex:n,onJump:r,onReplay:i,onOverview:a,resumed:o,chatOpen:s,onToggleChat:c,collapsed:l,onToggleCollapse:u,onOpenPast:d,onStudy:f,roomIndices:p,bookmarks:m,onToggleBookmark:h,onViewMindMap:g,onSeeTogether:_}){let v=Gn(),y=e.length===0,b=(0,H.useMemo)(()=>Oc(t),[t]);return(0,U.jsxs)(`aside`,{className:`side-rail`+(s?` chat-open`:``)+(l?` is-collapsed`:``),children:[(0,U.jsxs)(`button`,{type:`button`,className:`rail-mobile-toggle`,"aria-expanded":s,onClick:c,children:[(0,U.jsx)(z.chat,{}),s?`Hide session`:`This session`]}),(0,U.jsxs)(`div`,{className:`rail-head`,children:[u&&(0,U.jsx)(`button`,{type:`button`,className:`rail-collapse`,onClick:u,"aria-expanded":!l,"aria-label":l?`Expand the session panel`:`Collapse the session panel`,title:l?`Show this session`:`Hide this session`,children:(0,U.jsx)(z.panelLeft,{})}),(0,U.jsx)(`span`,{className:`rail-title sess-title`,children:`This session`}),(i||a)&&(0,U.jsxs)(`div`,{className:`rail-head-actions`,children:[i&&(0,U.jsx)(`button`,{type:`button`,className:`rail-history rail-icon`,onClick:i,title:`Replay earlier answers`,"aria-label":`Replay earlier answers`,children:(0,U.jsx)(z.play,{})}),a&&(0,U.jsx)(`button`,{type:`button`,className:`rail-history rail-icon`,onClick:a,title:`Zoom out to the whole conversation`,"aria-label":`Conversation overview`,children:(0,U.jsx)(z.layers,{})})]})]}),u&&(0,U.jsx)(`div`,{className:`rail-collapsed-label`,"aria-hidden":`true`,children:`This session`}),(0,U.jsxs)(`div`,{className:`rail-chat sess-list`,children:[o&&(0,U.jsx)(`div`,{className:`sess-note`,role:`note`,children:`Resumed — picking back up where you left off.`}),y?(0,U.jsx)(`div`,{className:`sess-note`,children:`Topics can wander — cooking, markets, your fantasy lineup. Mavéa keeps the thread.`}):e.map(e=>(0,U.jsxs)(`div`,{className:`sess-chapter`,style:{"--ch-c":e.color},children:[(0,U.jsxs)(`div`,{className:`sess-chapter-head`,children:[(0,U.jsx)(`div`,{className:`sess-chapter-label`,title:e.title,children:e.title}),_&&e.moments.length>=2&&(0,U.jsx)(`button`,{type:`button`,className:`sess-together`,onClick:()=>_(e),title:`See all ${e.moments.length} moments of this thread together on one canvas`,"aria-label":`See all ${e.moments.length} moments of this thread together`,children:(0,U.jsx)(z.table,{})})]}),e.moments.map(e=>{let i=b.get(e.frameIndex),a=t[e.frameIndex],o=a?String(a.at):null,s=o?m?.has(o)??!1:!1;return(0,U.jsxs)(`div`,{className:`sess-row-wrap`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`sess-row`+(e.frameIndex===n?` is-current`:``)+(i?` is-corrected`:``)+(s?` is-bookmarked`:``),onClick:()=>r(e.frameIndex),"aria-current":e.frameIndex===n?`true`:void 0,title:i?`${e.question} · Corrected later — ${i.note.what}: was ${i.note.was}, now ${i.note.now}`:e.question,children:[(0,U.jsx)(`span`,{className:`sess-time`,children:kc(a?.at)}),(0,U.jsx)(`span`,{className:`sess-q`,children:e.question}),i&&(0,U.jsx)(`span`,{className:`sess-corrected`,children:`corrected`}),p?.has(e.frameIndex)&&(0,U.jsx)(`span`,{className:`sess-room`,children:`from the room`})]}),g&&a?.mind&&(0,U.jsx)(`button`,{type:`button`,className:`sess-mapview`,onClick:t=>{t.stopPropagation(),g(e.frameIndex)},title:`See the thinking map this answer grew from`,"aria-label":`View the thinking map`,children:(0,U.jsx)(z.sparkle,{})}),h&&o&&(0,U.jsx)(`button`,{type:`button`,className:`sess-bookmark${s?` on`:``}`,onClick:e=>{e.stopPropagation(),h(o)},title:s?`Remove bookmark`:`Bookmark this moment`,"aria-pressed":s,"aria-label":s?`Remove bookmark`:`Bookmark this moment`,children:s?`★`:`☆`})]},e.frameIndex)})]},e.id))]}),(d||f&&v)&&(0,U.jsxs)(`div`,{className:`rail-foot`,children:[d&&(0,U.jsxs)(`button`,{type:`button`,className:`rail-past`,onClick:d,children:[(0,U.jsx)(z.clock,{}),(0,U.jsx)(`span`,{children:`Past conversations`})]}),f&&v&&(0,U.jsxs)(`button`,{type:`button`,className:`rail-past`,onClick:f,children:[(0,U.jsx)(z.layers,{}),(0,U.jsxs)(`span`,{children:[v.count,` card`,v.count===1?``:`s`,` ready`]})]})]})]})}function jc(e){let{spec:t,frames:n,viewIndex:r,narration:i,lastAsk:a}=e;if(!t)return null;let o=n.length-1;if(r!=null&&r!==o){let e=n[r];if(e)return{question:yt(e.question)||null,narration:e.narration||e.spec.title}}let s=o>=0?n[o]:void 0,c=i||s?.narration||t.title;if(!c)return null;let l=i?a??s?.question:s?.question??a;return{question:yt(l)||null,narration:c}}function Mc(e){let t=(0,q.c)(3),n=(0,H.useRef)(null),[r,i]=(0,H.useState)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`thinking`){n.current=performance.now();return}(e===`speaking`||e===`showing`)&&n.current!==null&&(i(Math.round(performance.now()-n.current)),n.current=null)},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,H.useEffect)(a,o),r}function Nc(e){return e===null||!Number.isFinite(e)||e<0?null:e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function Pc(e){return e===`circle`?`○`:e===`point`?`→`:e===`underline`?`—`:e===`highlight`?`▬`:e===`rising`?`↗`:e===`falling`?`↘`:e===`bracket`?`⊓`:e===`note`?`✎`:e===`connect`?`⤳`:e===`strike`?`✕`:e===`question`?`?`:e===`star`?`★`:e===`check`?`✓`:e===`frame`?`▢`:e===`brace`?`{`:`✦`}function Fc(e){return e===`circle`?`circles`:e===`point`?`arrow:`:e===`underline`?`underlines`:e===`highlight`?`highlights`:e===`rising`?`trend up:`:e===`falling`?`trend down:`:e===`bracket`?`brackets`:e===`note`?`notes`:e===`connect`?`connects:`:e===`strike`?`strikes out`:e===`question`?`questions`:e===`star`?`stars`:e===`check`?`checks off`:e===`frame`?`frames`:e===`brace`?`groups`:`drew on`}function Ic(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function Lc(e){if(e.kind===`connect`&&e.at&&e.to)return`${e.at} → ${e.to}`;if(e.at)return e.at;if(e.line){let t=e.line.split(/\s+/).slice(0,4).join(` `);return t.length<e.line.length?`${t}…`:t}return e.spot}function Rc(e){let t=(0,q.c)(42),{entries:n,turnStartMs:r,annotationsEnabled:i,hiddenSpots:a,onToggle:o,onKeep:s,onClear:c,onClip:l,onJumpTo:u,onToggleSpot:d}=e,f;t[0]===o?f=t[1]:(f=e=>{e.stopPropagation(),o()},t[0]=o,t[1]=f);let p=f,m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,U.jsx)(`span`,{className:`gesture-track-eyebrow`,children:`Gesture track`}),t[2]=m):m=t[2];let h=`gesture-track-toggle ${i?`on`:`off`}`,g=i?`Turn off drawing`:`Turn on drawing`,_=i?`Drawing on — tap to turn off`:`Drawing off — tap to turn on`,v;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,U.jsx)(`span`,{className:`gesture-track-toggle-icon`,children:`✦`}),t[3]=v):v=t[3];let y=i?`Pen on`:`Pen off`,b;t[4]===y?b=t[5]:(b=(0,U.jsx)(`span`,{children:y}),t[4]=y,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,U.jsx)(`span`,{className:`gesture-track-toggle-switch`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{className:`gesture-track-toggle-knob`})}),t[6]=x):x=t[6];let S;t[7]!==i||t[8]!==p||t[9]!==h||t[10]!==g||t[11]!==_||t[12]!==b?(S=(0,U.jsxs)(`div`,{className:`gesture-track-header`,children:[m,(0,U.jsxs)(`button`,{type:`button`,className:h,onClick:p,title:g,"aria-label":_,"aria-pressed":i,children:[v,b,x]})]}),t[7]=i,t[8]=p,t[9]=h,t[10]=g,t[11]=_,t[12]=b,t[13]=S):S=t[13];let C;if(t[14]!==n||t[15]!==a||t[16]!==u||t[17]!==d||t[18]!==r){let e;t[20]!==a||t[21]!==u||t[22]!==d||t[23]!==r?(e=e=>{let t=a?.has(e.spot)??!1;return(0,U.jsxs)(`li`,{className:`gesture-track-entry${t?` is-hidden`:``}`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`gesture-track-entry-btn`,onClick:()=>u?.(e.spot,e.toSpot),title:`Jump to this annotation`,children:[(0,U.jsx)(`span`,{className:`gesture-track-time`,children:Ic(e.inkedAt-r)}),(0,U.jsx)(`span`,{className:`gesture-track-icon`,"aria-hidden":`true`,children:Pc(e.kind)}),(0,U.jsxs)(`span`,{className:`gesture-track-desc`,children:[e.stepNumber&&(0,U.jsxs)(`span`,{className:`gesture-track-step`,children:[`Step `,e.stepNumber]}),(0,U.jsx)(`span`,{className:`gesture-track-verb`,children:Fc(e.kind)}),` `,(0,U.jsx)(`span`,{className:`gesture-track-target`,title:Lc(e),children:Lc(e)})]})]}),d&&(0,U.jsx)(`button`,{type:`button`,className:`gesture-track-eye`,onClick:t=>{t.stopPropagation(),d(e.spot)},title:t?`Show annotation`:`Hide annotation`,"aria-pressed":t,"aria-label":t?`Show annotation`:`Hide annotation`,children:t?(0,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M1.5 1.5L10.5 10.5M5 5.3C5 5.3 5.4 5 6 5c.9 0 1.5.7 1.5 1.5 0 .5-.2.9-.5 1.2`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`}),(0,U.jsx)(`path`,{d:`M2 3.5C1 4.4.5 5.2.5 6s1.5 3 5.5 3c.9 0 1.7-.1 2.4-.4M10 8.5c1-1 1.5-1.8 1.5-2.5s-1.5-3-5.5-3c-.5 0-1 0-1.4.1`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`})]}):(0,U.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:[(0,U.jsx)(`ellipse`,{cx:`6`,cy:`6`,rx:`5.5`,ry:`3`,stroke:`currentColor`,strokeWidth:`1.2`}),(0,U.jsx)(`circle`,{cx:`6`,cy:`6`,r:`1.5`,fill:`currentColor`})]})})]},`${e.spot}|${e.kind??``}|${e.at??``}`)},t[20]=a,t[21]=u,t[22]=d,t[23]=r,t[24]=e):e=t[24],C=n.map(e),t[14]=n,t[15]=a,t[16]=u,t[17]=d,t[18]=r,t[19]=C}else C=t[19];let w;t[25]===C?w=t[26]:(w=(0,U.jsx)(`ol`,{className:`gesture-track-list`,"aria-label":`Drawn gestures`,children:C}),t[25]=C,t[26]=w);let T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,U.jsx)(`p`,{className:`gesture-track-hint`,children:`Your blue ink, Mavéa's orange. Tap an entry to jump to it.`}),t[27]=T):T=t[27];let E;t[28]===s?E=t[29]:(E=(0,U.jsx)(`button`,{type:`button`,className:`gesture-track-btn primary`,onClick:s,children:`Keep annotations`}),t[28]=s,t[29]=E);let D;t[30]===l?D=t[31]:(D=l&&(0,U.jsx)(`button`,{type:`button`,className:`gesture-track-btn`,onClick:l,children:`Clip this moment`}),t[30]=l,t[31]=D);let O;t[32]===c?O=t[33]:(O=(0,U.jsx)(`button`,{type:`button`,className:`gesture-track-btn ghost`,onClick:c,children:`Clear`}),t[32]=c,t[33]=O);let k;t[34]!==E||t[35]!==D||t[36]!==O?(k=(0,U.jsxs)(`div`,{className:`gesture-track-actions`,children:[E,D,O]}),t[34]=E,t[35]=D,t[36]=O,t[37]=k):k=t[37];let A;return t[38]!==S||t[39]!==w||t[40]!==k?(A=(0,U.jsxs)(`div`,{className:`gesture-track`,role:`complementary`,"aria-label":`Gesture track`,children:[S,w,T,k]}),t[38]=S,t[39]=w,t[40]=k,t[41]=A):A=t[41],A}function zc(e){let t=(0,q.c)(13),{enabled:n,open:r,inkCount:i,onClick:a}=e,o=`pen-toggle-pill ${n?`on`:`off`}${r?` open`:``}`,s=r?`Close pen panel`:`Open pen panel`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`✦`}),t[0]=c):c=t[0];let l=n?`Pen on`:`Pen off`,u;t[1]===l?u=t[2]:(u=(0,U.jsx)(`span`,{children:l}),t[1]=l,t[2]=u);let d;t[3]!==i||t[4]!==r?(d=!r&&i>0&&(0,U.jsx)(`span`,{className:`pen-ink-count`,"aria-label":`${i} marks drawn`,children:i}),t[3]=i,t[4]=r,t[5]=d):d=t[5];let f;return t[6]!==a||t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==u||t[11]!==d?(f=(0,U.jsxs)(`button`,{type:`button`,className:o,onClick:a,title:s,"aria-expanded":r,"aria-haspopup":`true`,children:[c,u,d]}),t[6]=a,t[7]=r,t[8]=o,t[9]=s,t[10]=u,t[11]=d,t[12]=f):f=t[12],f}var Bc=/\b(teach me|walk me through|tutor( me)?|step[- ]by[- ]step|like i'?m (five|5|a beginner|new))\b/i;function Vc(e){return!!e&&Bc.test(e)}function Hc(e){if(e.length===0)return``;let t=`M ${e[0].x} ${e[0].y}`;for(let n=1;n<e.length;n++)t+=` L ${e[n].x} ${e[n].y}`;return t}var Uc=4,Wc=2e3;function Gc(e,t=Uc){if(e.length<=1)return e.slice();let n=0;for(let t=1;t<e.length;t++)n+=Math.hypot(e[t].x-e[t-1].x,e[t].y-e[t-1].y);let r=Math.max(t,n/Wc),i=[e[0]];for(let t=1;t<e.length;t++){let n=e[t-1],a=e[t],o=Math.hypot(a.x-n.x,a.y-n.y),s=Math.floor(o/r);for(let e=1;e<=s;e++){let t=e*r/o;i.push({x:n.x+(a.x-n.x)*t,y:n.y+(a.y-n.y)*t})}let c=i[i.length-1];(c.x!==a.x||c.y!==a.y)&&i.push(a)}return i}function Kc(e){let t=0;for(let n=1;n<e.length;n++)t+=Math.hypot(e[n].x-e[n-1].x,e[n].y-e[n-1].y);return t}function qc(e){if(e.length<3)return 0;let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];t+=r.x*i.y-i.x*r.y}return Math.abs(t)/2}function Jc(e){let t=e[0].x,n=e[0].x,r=e[0].y,i=e[0].y;for(let a of e)a.x<t&&(t=a.x),a.x>n&&(n=a.x),a.y<r&&(r=a.y),a.y>i&&(i=a.y);return{minX:t,minY:r,maxX:n,maxY:i}}function Yc(e){if(e.length<4)return!1;let{minX:t,minY:n,maxX:r,maxY:i}=Jc(e),a=Math.hypot(r-t,i-n),o=Kc(e);if(a<10||o<10)return!1;let s=e[0],c=e[e.length-1],l=Math.hypot(c.x-s.x,c.y-s.y)<=Math.max(16,a*.35),u=qc(e)>o*o*.02;return l||u}function Xc(e,t){let n=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let a=t[r].x,o=t[r].y,s=t[i].x,c=t[i].y;o>e.y!=c>e.y&&e.x<(s-a)*(e.y-o)/(c-o)+a&&(n=!n)}return n}var Zc=3e3;function Qc(e,t=Uc,n=Zc){let{minX:r,minY:i,maxX:a,maxY:o}=Jc(e),s=a-r,c=o-i;if(s<=0||c<=0)return[];let l=Math.max(1,Math.round(s/t))*Math.max(1,Math.round(c/t))>n?Math.sqrt(s*c/n):t,u=[];for(let t=i+l/2;t<o;t+=l)for(let i=r+l/2;i<a;i+=l){let r={x:i,y:t};if(Xc(r,e)&&(u.push(r),u.length>=n))return u}return u}var $c=4,el=4e3,tl=`input, textarea, select, button, a, summary, [contenteditable], [role="slider"], [role="tab"], [role="switch"], [draggable="true"], .block-ask, .geo-map, [data-interactive]`;function nl({armed:e,rootRef:t,onStroke:n,onTap:r,strokes:i,highlights:a}){let o=(0,H.useRef)(null),s=(0,H.useRef)(null),c=(0,H.useRef)(null),l=(0,H.useRef)([]),u=(0,H.useRef)(null),d=(0,H.useRef)(!1),f=(0,H.useRef)(!1),p=(0,H.useRef)(null),m=(0,H.useRef)(0),h=(0,H.useRef)(e);h.current=e;let g=(0,H.useRef)(n);g.current=n;let _=(0,H.useRef)(r);return _.current=r,(0,H.useEffect)(()=>{let n=t.current;if(n)return n.classList.toggle(`ink-armed`,e),()=>n.classList.remove(`ink-armed`)},[e,t]),(0,H.useEffect)(()=>{let e=t.current,n=o.current;if(!e||!n)return;let r=e=>{let t=n.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},i=()=>({stage:e,svgRect:n.getBoundingClientRect()}),a=()=>{let e=Hc(l.current);s.current?.setAttribute(`d`,e),c.current?.setAttribute(`d`,e)},v=()=>{s.current?.setAttribute(`d`,``),c.current?.setAttribute(`d`,``)},y=()=>{l.current=[],u.current=null,d.current=!1,f.current=!1,p.current=null},b=t=>{try{e.setPointerCapture(t)}catch{}},x=t=>{try{e.hasPointerCapture?.(t)&&e.releasePointerCapture(t)}catch{}},S=()=>{p.current!=null&&x(p.current),e.classList.remove(`ink-capturing`),y(),v()},C=()=>{document.hidden&&S()},w=e=>{if(d.current||f.current){if(performance.now()-m.current>el)S();else return}if(!(h.current||e.pointerType===`pen`)||e.target?.closest?.(tl))return;m.current=performance.now(),d.current=!0,p.current=e.pointerId;let t=r(e);u.current=t,l.current=[t]},T=t=>{if(p.current!==t.pointerId||!d.current&&!f.current)return;let n=r(t);if(!f.current){if(Math.hypot(n.x-(u.current?.x??n.x),n.y-(u.current?.y??n.y))<$c)return;f.current=!0,b(t.pointerId),e.classList.add(`ink-capturing`)}t.preventDefault(),l.current.push(n),a()},E=t=>{if(p.current!==t.pointerId)return;let n=f.current,r=d.current,a=l.current,o=u.current;x(t.pointerId),e.classList.remove(`ink-capturing`),y(),v(),n&&a.length>=2?g.current(a,i()):r&&!n&&o&&_.current?.(o,i())},D=e=>{p.current===e.pointerId&&S()};return e.addEventListener(`pointerdown`,w),window.addEventListener(`pointermove`,T),window.addEventListener(`pointerup`,E),window.addEventListener(`pointercancel`,D),window.addEventListener(`blur`,S),document.addEventListener(`visibilitychange`,C),()=>{e.removeEventListener(`pointerdown`,w),window.removeEventListener(`pointermove`,T),window.removeEventListener(`pointerup`,E),window.removeEventListener(`pointercancel`,D),window.removeEventListener(`blur`,S),document.removeEventListener(`visibilitychange`,C),p.current!=null&&x(p.current),e.classList.remove(`ink-capturing`,`ink-armed`)}},[t]),(0,U.jsxs)(`svg`,{ref:o,className:`ink-user-overlay`,"aria-hidden":`true`,children:[a?.map((e,t)=>e.w>0&&e.h>0?(0,U.jsx)(`rect`,{className:`ink-highlight`,x:e.x,y:e.y,width:e.w,height:e.h,rx:3,ry:3},`h`+t):null),i?.map((e,t)=>(0,U.jsx)(`path`,{className:`ink-user-stroke ink-user-settled`,d:e},t)),(0,U.jsx)(`path`,{ref:c,className:`ink-user-halo`,d:``}),(0,U.jsx)(`path`,{ref:s,className:`ink-user-stroke`,d:``})]})}var rl=80,il=`.ink-user-overlay, .ink-layer, .block-ask, .card-eyebrow`,al=e=>{let t=e.replace(/\s+/g,` `).trim();return t.length>rl?t.slice(0,79)+`…`:t};function ol(e){return!e.data||!e.data.trim()?!1:!e.parentElement?.closest(il)}function sl(e){if(e.min!==e.max)return[e.min,e.max];let t=e.node.data,n=e.min,r=e.min;for(;n>0&&!/\s/.test(t[n-1]);)n--;for(;r<t.length&&!/\s/.test(t[r]);)r++;return n<r?[n,r]:[e.min,e.min+1]}function cl(e,t){if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}function ll(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;for(;t;t=t.parentElement){let e=t.getAttribute?.(`data-spot-id`);if(e)return e}return``}function ul(e,t,n){try{let r=document.createRange(),i=e.length;r.setStart(e,Math.max(0,Math.min(t,i))),r.setEnd(e,Math.max(0,Math.min(n,i)));let a=r.getClientRects(),o=[];for(let e=0;e<a.length;e++){let t=a[e];t&&t.width>0&&t.height>0&&o.push(t)}return o}catch{return[]}}function dl(e){let t=[...e.values()],n=e=>{let[t,n]=sl(e);return e.node.data.slice(t,n)},r=t[0];for(let e of t)(e.samples>r.samples||e.samples===r.samples&&n(e).length>n(r).length)&&(r=e);let i=[...t].sort((e,t)=>cl(e.node,t.node)),a=al(i.map(n).filter(e=>e.trim()).join(` `));if(!a)return null;let o=[];for(let e of i){let[t,n]=sl(e);o.push(...ul(e.node,t,n))}return{text:a,blockId:ll(r.node),rects:o}}function fl(e){let t=e.matches?.(`text, tspan`)?e:e.closest?.(`text, tspan`),n=e.closest?.(`[aria-label]`),r=[t?.textContent,n?.getAttribute(`aria-label`),e.getAttribute?.(`alt`),e.getAttribute?.(`title`)];for(let e of r)if(e?.trim())return e;return``}function pl(e,t){if(e.length===0)return null;let n=e[Math.floor(e.length/2)];for(let e of t.elementsAt(n.x,n.y)){if(e.closest?.(il))continue;let t=fl(e);if(t)return{text:al(t),blockId:ll(e),rects:[e.getBoundingClientRect()]}}return null}function ml(e,t){let n=new Map,r=[];for(let i of e){let e=t.caretAt(i.x,i.y);if(e&&ol(e.node)){let t=n.get(e.node);t?(e.offset<t.min&&(t.min=e.offset),e.offset>t.max&&(t.max=e.offset),t.samples++):n.set(e.node,{node:e.node,min:e.offset,max:e.offset,samples:1})}else r.push(i)}return n.size>0?dl(n):pl(r,t)}function hl(e,t,n){if(e.length===0)return null;let r=e=>({x:e.x+t.left,y:e.y+t.top});if(Yc(e)){let t=Qc(e.map(r)),i=t.length>0?ml(t,n):null;if(i)return i}let i=Gc(e).map(r);return i.length===0?null:ml(i,n)}var Q=6,gl=14;function _l(e,t,n,r){try{if(e.length===0)return!1;let i=Math.min(t,e.length-1),a=document.createRange();a.setStart(e,i),a.setEnd(e,i+1);let o=a.getClientRects();if(o.length===0)return!0;for(let e=0;e<o.length;e++){let t=o[e];if(n>=t.left-Q&&n<=t.right+Q&&r>=t.top-gl&&r<=t.bottom+gl)return!0}return!1}catch{return!0}}function vl(e,t){let n=document,r=null,i=0;if(typeof n.caretRangeFromPoint==`function`){let a=n.caretRangeFromPoint(e,t);a&&a.startContainer.nodeType===Node.TEXT_NODE&&(r=a.startContainer,i=a.startOffset)}else if(typeof document.caretPositionFromPoint==`function`){let n=document.caretPositionFromPoint(e,t);n&&n.offsetNode.nodeType===Node.TEXT_NODE&&(r=n.offsetNode,i=n.offset)}return!r||!_l(r,i,e,t)?null:{node:r,offset:i}}var yl={caretAt:vl,elementsAt:(e,t)=>document.elementsFromPoint(e,t)};function bl(e,t,n=yl){let r=hl(e,t.svgRect,n);return!r||!r.text?null:{intent:{kind:`highlight`,blockIds:r.blockId?[r.blockId]:[],textAt:r.text},rects:r.rects}}function xl(e,t){return e.map(e=>({x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}))}function Sl(e){let{onCommit:t,resetKey:n,hitTester:r}=e,[i,a]=(0,H.useState)([]),[o,s]=(0,H.useState)(0),c=(0,H.useRef)(i);c.current=i;let l=(0,H.useRef)(t);l.current=t;let u=(0,H.useCallback)((e,t,n)=>{let i=bl(e,n,r);if(!i)return s(e=>e+1),!1;let o={intent:i.intent,stroke:t,rects:xl(i.rects,n.svgRect)};return a(e=>[...e,o]),!0},[r]),d=(0,H.useCallback)((e,t)=>{u(e,Hc(e),t)},[u]),f=(0,H.useCallback)((e,t)=>{u([e,{x:e.x+1,y:e.y+1}],``,t)},[u]),p=(0,H.useCallback)(e=>{a(t=>e==null?t.slice(0,-1):t.filter((t,n)=>n!==e))},[]),m=(0,H.useCallback)(()=>{let e=c.current;e.length&&l.current(e.map(e=>e.intent)),a([])},[]),h=(0,H.useCallback)(()=>a([]),[]);(0,H.useEffect)(()=>{a([])},[n]);let g=i.map(e=>e.intent),_=i.map(e=>e.stroke).filter(Boolean),v=i.flatMap(e=>e.rects);return{phase:i.length?`pinned`:`idle`,pins:i,intents:g,strokes:_,highlights:v,miss:o,onStroke:d,onTap:f,undo:p,send:m,clear:h}}var Cl=e=>e.length>22?e.slice(0,21)+`…`:e;function wl(e){return e.textAt?`Marked “${Cl(e.textAt)}”`:`Marked`}function Tl(e){if(e.length===0)return``;let t=e[0]?.textAt?.trim(),n=t?`Tell me about “${Cl(t)}”`:`Tell me about this`;return e.length===1?n:`${n} (and ${e.length-1} more)`}function El(e){let t=new Set,n=[];for(let r of e)!r.id||t.has(r.id)||(t.add(r.id),n.push(r));return n}function Dl(e,t){let n=new Map;for(let e of t)e.id&&n.set(e.id,e);let r=[],i=[],a=new Set;for(let t of e){let e=t.blockIds;if(!(e.length>0&&!e.every(e=>n.has(e)))){r.push(t);for(let t of e){if(a.has(t))continue;a.add(t);let e=n.get(t);e&&i.push(e)}}}return{intents:r,blocks:i}}function Ol(e){let t=(0,q.c)(15),{pins:n,onUndo:r,onSend:i}=e;if(n.length===0)return null;let a=n.length,o=a>1?`s`:``,s;t[0]!==a||t[1]!==o?(s=(0,U.jsxs)(`span`,{className:`ink-sr`,role:`status`,children:[`Highlighted `,a,` part`,o]}),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c;if(t[3]!==r||t[4]!==n){let e;t[6]===r?e=t[7]:(e=(e,t)=>(0,U.jsxs)(`span`,{className:`ink-chip`,children:[(0,U.jsx)(`span`,{className:`ink-chip-text`,children:wl(e.intent)}),(0,U.jsx)(`button`,{type:`button`,className:`ink-chip-x`,"aria-label":`Remove ${e.intent.textAt||`mark`}`,onClick:()=>r(t),children:(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`11`,height:`11`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`})})})]},t),t[6]=r,t[7]=e),c=n.map(e),t[3]=r,t[4]=n,t[5]=c}else c=t[5];let l=`Ask about the ${a} highlighted part${a>1?`s`:``}`,u;t[8]!==i||t[9]!==l?(u=(0,U.jsx)(`button`,{type:`button`,className:`ink-chip-act primary`,onClick:i,title:l,children:`Ask`}),t[8]=i,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==s||t[12]!==c||t[13]!==u?(d=(0,U.jsxs)(`div`,{className:`ink-dock`,role:`group`,"aria-label":`Highlighted parts to ask about`,children:[s,c,u]}),t[11]=s,t[12]=c,t[13]=u,t[14]=d):d=t[14],d}var kl=`mavea-ink-hint-seen`;function Al(){try{return localStorage.getItem(kl)===`1`}catch{return!0}}function jl({armed:e,pins:t,miss:n=0,onUndo:r,onSend:i}){let[a,o]=(0,H.useState)(Al),s=!a&&!e&&t.length===0,c=e&&t.length===0,[l,u]=(0,H.useState)(!1);(0,H.useEffect)(()=>{if(!n)return;u(!0);let e=setTimeout(()=>u(!1),2600);return()=>clearTimeout(e)},[n]),(0,H.useEffect)(()=>{if(!(a||!e&&t.length===0)){o(!0);try{localStorage.setItem(kl,`1`)}catch{}}},[e,t.length,a]);let d=()=>{o(!0);try{localStorage.setItem(kl,`1`)}catch{}},f=t.length>0;return!s&&!c&&!l&&!f?null:(0,U.jsxs)(`div`,{className:`ink-bar`+(s?` coaching`:``),children:[s&&(0,U.jsxs)(`div`,{className:`ink-coach`,role:`note`,children:[(0,U.jsx)(`span`,{className:`ink-coach-spark`,"aria-hidden":`true`,children:`✍️`}),(0,U.jsxs)(`span`,{className:`ink-coach-text`,children:[(0,U.jsx)(`strong`,{children:`Highlight to ask.`}),` Turn on `,(0,U.jsx)(`strong`,{children:`Highlight`}),`, then drag across any value, label, or card to grab it. Ask in your own words, and a pen draws straight away.`]}),(0,U.jsx)(`button`,{type:`button`,className:`ink-coach-x`,title:`Dismiss`,"aria-label":`Got it`,onClick:d,children:(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})})})]}),c&&!l&&(0,U.jsxs)(`span`,{className:`ink-howto`,role:`status`,children:[(0,U.jsx)(`span`,{className:`ink-howto-dot`,"aria-hidden":`true`}),`Drag across any value, label, or card on the answer to grab it. Then ask in your own words.`]}),l&&!s&&(0,U.jsx)(`span`,{className:`ink-miss`,role:`status`,children:`Nothing to grab there. Drag across a value, label, or card.`}),f&&(0,U.jsx)(Ol,{pins:t,onUndo:r,onSend:i})]})}function Ml(e){let t=(0,q.c)(10),{armed:n,onToggle:r}=e,i=`mark-toggle`+(n?` on`:``),a=n?`Highlighter on — drag across the answer to ask about it`:`Highlight the answer to ask about it`,o;t[0]!==n||t[1]!==r?(o=()=>r(!n),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M3 21l3.2-.9L18 8.3l-2.3-2.3L4 17.6 3 21z M14.7 7l2.3 2.3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinejoin:`round`,strokeLinecap:`round`})}),c=(0,U.jsx)(`span`,{className:`mark-toggle-label`,children:`Highlight`}),t[3]=s,t[4]=c):(s=t[3],c=t[4]);let l;return t[5]!==n||t[6]!==i||t[7]!==a||t[8]!==o?(l=(0,U.jsxs)(`button`,{type:`button`,className:i,"aria-pressed":n,"aria-label":a,title:`Highlight to ask`,onClick:o,children:[s,c]}),t[5]=n,t[6]=i,t[7]=a,t[8]=o,t[9]=l):l=t[9],l}var Nl=`mavea-brief-date`,Pl=Nl,Fl=void 0;function Il(){return new Date().toISOString().slice(0,10)}function Ll(){try{return typeof localStorage>`u`?null:localStorage.getItem(Nl)}catch{return null}}function Rl(){return Fl===void 0&&(Fl=Ll()),Fl}function zl(e){Fl=e;try{typeof localStorage<`u`&&localStorage.setItem(Nl,e)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(Pl,{detail:e}))}catch{}}function Bl(e){return e?Rl()!==Il():!1}function Vl(){zl(Il())}function Hl(e){let t=[];return t.push(`You are Mavéa, an AI presence. Generate a concise morning brief (max 3 items). Use real, grounded information only — no invented data, no placeholder numbers.`),e.length>0&&(t.push(``),t.push(`They recently discussed: ${e.join(`, `)}.`)),t.push(``),t.push(`Produce exactly 3 blocks in a warm, alive morning format using only insight, text, or list block types. Start your response with a single short narration sentence — natural and calm, like "Here's your morning." or "Good morning. Here's a brief look at your day." — then emit the blocks. Do not explain what you are doing; just deliver the brief.`),t.join(`
20
+ `)}var Ul=99;function Wl(e){return e>Ul?`${Ul}+`:String(e)}function Gl(){for(let e of _r()){let t=br(e.id),n=e.lessons.length;if(!n)continue;let r=e.lessons.filter(e=>t.lessons[e.id]?.status===`done`).length;if(!(r>=n)&&(r!==0||t.current!==0))return{title:e.title,sub:`Lesson ${Math.min(t.current+1,n)} of ${n}`}}return null}function Kl(e){let t=(0,q.c)(16),{onStudy:n}=e,r=Gn(),i;if(t[0]!==r||t[1]!==n){if(i=[],r){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(z.layers,{}),t[3]=e):e=t[3];let a;t[4]===r.count?a=t[5]:(a=Wl(r.count),t[4]=r.count,t[5]=a);let o=`${a} card${r.count===1?``:`s`}`,s;t[6]!==r.label||t[7]!==n||t[8]!==o?(s={key:`cards`,icon:e,title:o,sub:r.label,action:`Study`,onPick:n},t[6]=r.label,t[7]=n,t[8]=o,t[9]=s):s=t[9],i.push(s)}let e;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=Gl(),t[10]=e):e=t[10];let a=e;if(a){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(z.play,{}),t[11]=e):e=t[11];let n;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(n={key:`course`,icon:e,title:a.title,sub:a.sub,action:`Continue`,onPick:Jl},t[12]=n):n=t[12],i.push(n)}t[0]=r,t[1]=n,t[2]=i}else i=t[2];let a=i;if(!a.length)return null;let o;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,U.jsx)(`span`,{className:`card-eyebrow`,children:`Ready when you are`}),t[13]=o):o=t[13];let s;return t[14]===a?s=t[15]:(s=(0,U.jsxs)(`section`,{className:`ready-shelf go-study`,children:[o,(0,U.jsx)(`ul`,{className:`ready-list`,children:a.map(ql)})]}),t[14]=a,t[15]=s),s}function ql(e){return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,className:`ready-item`,onClick:e.onPick,children:[(0,U.jsx)(`span`,{className:`ready-icon`,"aria-hidden":!0,children:e.icon}),(0,U.jsxs)(`span`,{className:`ready-copy`,children:[(0,U.jsx)(`span`,{className:`ready-title`,children:e.title}),(0,U.jsx)(`span`,{className:`ready-sub`,children:e.sub})]}),(0,U.jsx)(`span`,{className:`ready-go`,children:e.action})]})},e.key)}function Jl(){window.location.hash=`#/courses`}function Yl(e){return e.type===`flashcard`&&Array.isArray(e.props?.cards)}function Xl(e){return e.replace(/<[^>]+>/g,``).trim()}function Zl(e){let t=[];for(let n of e){if(!Yl(n))continue;let e=n;for(let n of e.props.cards){let e=Xl(n.front??``),r=Xl(n.back??``);!e||!r||t.push({front:e,back:r,tag:n.tag?Xl(n.tag):void 0})}}return t}function Ql(e){return Xl(e??``).trim()}function $l(e){let t=[],n=(e,n,r)=>{let i=Ql(e),a=Ql(n);i&&a&&t.push({front:i,back:a,tag:Ql(r)||void 0})};switch(e.type){case`flashcard`:for(let t of e.props.cards??[])n(t.front,t.back,t.tag);break;case`faq`:for(let t of e.props.items??[])n(t.q,t.a,t.tag);break;case`deflist`:for(let t of e.props.items??[])n(t.term,t.def,t.tag);break;case`quiz`:{let t=(e.props.options??[]).filter(e=>e.correct).map(e=>Ql(e.text)).filter(Boolean);if(t.length){let r=Ql(e.props.explanation),i=r?`${t.join(`; `)} — ${r}`:t.join(`; `);n(e.props.question,i)}break}}return t}var eu=[`title`,`label`,`heading`,`name`,`question`,`caption`,`eyebrow`],tu=[`summary`,`narrative`,`detail`,`sub`,`body`,`text`,`prose`,`def`,`a`];function nu(e){return e.props??{}}function ru(e,t){for(let n of t){let t=e[n];if(typeof t==`string`){let e=Ql(t);if(e)return e}}return``}function iu(e){return ru(nu(e),eu).slice(0,140)||oe(e)}function au(e){return ru(nu(e),tu).slice(0,400)}function ou(e){return{front:iu(e),back:au(e)}}function su(e){let t=[],n=iu(e);n&&t.push(n);for(let[,r]of Object.entries(nu(e)))if(typeof r==`string`){let e=Ql(r);e&&e!==n&&t.push(e)}else if(Array.isArray(r)){for(let e of r.slice(0,12))if(typeof e==`string`){let n=Ql(e);n&&t.push(n)}else if(e&&typeof e==`object`)for(let n of[`label`,`text`,`term`,`def`,`q`,`a`,`name`,`value`,`title`]){let r=e[n];if(typeof r==`string`){let e=Ql(r);e&&t.push(e)}}}return[...new Set(t)].join(`
21
+ `).slice(0,1400)}function cu(e){let t=$l(e);return t.length?{cards:t,exact:!0}:{cards:[ou(e)],exact:!1}}var lu=`You write flashcards the way a strong student does: atomic (one idea per card), concise (no long prose), and focused on what is worth memorising — key facts, definitions and terms, formulas, cause→effect, and a single concrete example when it aids recall. The FRONT is a clear question or cue; the BACK is the shortest complete answer. Use ONLY information present in the source text — never add facts not stated there. Return 1–4 cards as JSON of the form {"cards":[{"front":"…","back":"…"}]}.`,uu={type:`object`,properties:{cards:{type:`array`,minItems:1,maxItems:4,items:{type:`object`,properties:{front:{type:`string`},back:{type:`string`}},required:[`front`,`back`]}}},required:[`cards`]};function du(e){let t=e;if(typeof e==`string`){let n=e.trim();try{t=JSON.parse(n)}catch{let e=n.match(/\{[\s\S]*\}/);if(!e)return[];try{t=JSON.parse(e[0])}catch{return[]}}}let n=t?.cards;if(!Array.isArray(n))return[];let r=[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=Ql(String(e.front??``)).slice(0,300),n=Ql(String(e.back??``)).slice(0,600);t&&n&&r.push({front:t,back:n})}return r.slice(0,4)}async function fu(e,t,n){let r=su(e);if(!r)return[];let i=jn(t.model)===`slow`?480:640;try{let e=await Wt(t.provider).generate({system:lu,systemBase:lu,history:[],user:`Source (from the answer the user is studying):\n"""\n${r}\n"""\n\nWrite the flashcards now.`,maxTokens:i,temperature:0,thinkingLevel:`minimal`,format:uu,...n?{signal:n}:{}},t);return n?.aborted?[]:du(e.raw)}catch{return[]}}var pu=`tour-neural-networks`,mu=`neural`,hu=[{id:`loop`,title:`The learning loop`,minutes:8,goal:`See the guess-measure-adjust cycle every network repeats to learn.`,objectives:[`Name the three steps a network learns by`,`Read what a training curve is telling you`,`Explain what a "weight" is in one sentence`],concepts:[`training loop`,`loss`,`weights`],checkpoint:[{question:`What are the three repeating steps a network learns by?`,answer:`Make a guess (forward pass), measure the error (loss), then nudge the weights to shrink it.`},{question:`When a training curve slopes downward, what is falling?`,answer:`The loss — the network is getting the answer wrong by less on each pass.`}]},{id:`neuron`,title:`Inside a single neuron`,minutes:7,goal:`Open up one neuron and watch it turn inputs into a decision.`,objectives:[`Compute a weighted sum of inputs plus a bias`,`Explain why an activation is needed at all`],concepts:[`weighted sum`,`activation function`,`bias`]},{id:`backprop`,title:`How it assigns blame`,minutes:10,goal:`Follow the error backward so the network knows which weights to change.`,objectives:[`State gradient descent in one line`,`Describe what backpropagation actually updates`],concepts:[`gradient descent`,`backpropagation`]},{id:`data`,title:`Why data and depth matter`,minutes:8,goal:`Understand what more layers and more examples buy you — and where they hurt.`,objectives:[`Relate depth to the abstractions a network can form`,`Explain overfitting in a single sentence`],concepts:[`depth`,`generalization`,`overfitting`]},{id:`tuning`,title:`Making it learn well`,minutes:9,goal:`Meet the handful of dials that decide whether training works at all.`,objectives:[`Explain what the learning rate controls`,`Say why training happens in batches`],concepts:[`learning rate`,`batch size`,`epochs`]}];function gu(){let e=xr(pu);if(e)return e;let t=Zr(mu)?.frames[0];if(!t)return null;let n={id:pu,topic:`how neural networks learn`,title:`How neural networks learn`,subtitle:`From one neuron to a trained model, in five short sittings.`,level:`beginner`,lessons:hu,createdAt:Date.now(),model:`tour`};return yr(n),Cr(pu,hu[0].id,t),n}var _u=24e3,vu=_u*180,yu=[],bu=null,xu=[],Su=0,Cu=!1,wu=!1,Tu=1,Eu=0,Du=new Set,Ou=null,ku=null;function Au(){Eu+=1,ku=null;for(let e of Du)e()}function ju(e){return Du.add(e),()=>Du.delete(e)}function Mu(){return Eu}function Nu(){return Su/_u}function Pu(){yu=[],bu=null,xu=[],Su=0,Tu=Ae(),Cu=!0,Ou=null,Au()}function Fu(){Cu=!1,bu=null,Au()}function Iu(e){wu=e}function Lu(e){if(!Cu||wu)return;let t=xu[xu.length-1];t&&t.blocks===e||(xu.push({t:Nu(),blocks:e}),ku=null)}var Ru={begin(e){!Cu||wu||(bu={text:e,chunks:[],samples:0})},push(e){if(!Cu||wu||!bu||Su+e.length>vu)return;let t=new Int16Array(e.length);for(let n=0;n<e.length;n++){let r=Math.round(e[n]*32768);t[n]=r>32767?32767:r<-32768?-32768:r}bu.chunks.push(t),bu.samples+=e.length,Su+=e.length},end(e){if(!(!Cu||!bu)){if(wu){Su-=bu.samples,bu=null;return}e&&bu.samples>0?(yu.push(bu),Ou=null):Su-=bu.samples,bu=null,Au()}}};function zu(){if(ku)return ku;if(!Ou){let e=yu.reduce((e,t)=>e+t.samples,0);if(e===0)return null;let t=new Int16Array(e),n=[],r=0;for(let e of yu){let i=r/_u;for(let n of e.chunks)t.set(n,r),r+=n.length;n.push({text:e.text,t0:i,t1:r/_u})}Ou={pcm:t,spans:n}}let e=Ou.pcm.length/_u,t=xu.map(t=>({t:Math.min(t.t,e),blocks:t.blocks}));return ku={pcm:Ou.pcm,sampleRate:_u,duration:e,spans:Ou.spans,marks:t,speed:Tu},ku}function Bu(e,t){let n=0;for(let r of e.marks){if(r.t>t)break;n=r.blocks}return n}var Vu=e=>e.saySpoken??e.say??``;function Hu(e){let t=new Map;for(let n of e){let e=xe(we(Vu(n)));e&&!t.has(e)&&t.set(e,n.index)}return t}function Uu(e,t,n,r){if(t>=e.duration-.05)return r;let i=Bu(e,t),a=Hu(n);for(let r of e.spans){if(r.t0>t)break;let e=a.get(r.text)??n.find(e=>e.say===r.text||e.saySpoken===r.text)?.index;e!==void 0&&(i=Math.max(i,e+1))}return Math.max(1,Math.min(i,r))}var Wu=72e5,Gu=class{budget;map=new Map;constructor(e=Wu){this.budget=e}set(e,t){this.map.delete(e),this.map.set(e,t),this.evict(e)}get(e){return this.map.get(e)??null}get size(){return this.map.size}total(){let e=0;for(let t of this.map.values())e+=t.pcm.length;return e}evict(e){let t=[...this.map.keys()],n=0;for(;this.total()>this.budget&&this.map.size>1&&n<t.length;){let r=t[n++];r!==e&&this.map.delete(r)}}},Ku=[1,1.25,1.5,2,.75];function qu(e){return`${Number.isInteger(e)?e:e.toFixed(2).replace(/0+$/,``).replace(/\.$/,``)}×`}function Ju(e){return Math.min(2,Math.max(.75,e))}function Yu(e){let t=Ku.indexOf(Ju(e));return Ku[(t<0?0:t+1)%Ku.length]}function Xu(e,t){let n=e.length*2,r=new ArrayBuffer(44+n),i=new DataView(r),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,!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,!0);for(let t=0;t<e.length;t++)i.setInt16(44+t*2,e[t],!0);return r}function Zu(e,t){let n=new Blob([Xu(e,t)],{type:`audio/wav`});return URL.createObjectURL(n)}var Qu=160;function $u(e){let t=Math.max(1,Math.floor(e.length/Qu)),n=[];for(let r=0;r<Qu;r++){let i=0,a=r*t,o=Math.min(e.length,a+t);for(let t=a;t<o;t++){let n=Math.abs(e[t]);n>i&&(i=n)}n.push(i/32768)}return n}var ed={recording:{title:`Preparing voice scrub`,hint:`It appears here as soon as Mavéa finishes speaking.`},muted:{title:`Voice was muted`,hint:`Unmute before the next answer to capture a scrub track.`},offline:{title:`Voice is off`,hint:`Start the local TTS service to hear and scrub future answers.`},past:{title:`Voice scrub lives on the latest answer`,hint:`Return to live to replay the current spoken track.`},missing:{title:`No voice track captured`,hint:`The answer is still here as captions, but there is no audio to scrub.`}};function td(e){let t=(0,q.c)(8),{reason:n}=e,r=ed[n],i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsx)(`span`,{className:`voice-scrub-empty-dot`,"aria-hidden":`true`}),t[0]=i):i=t[0];let a;t[1]===r.title?a=t[2]:(a=(0,U.jsx)(`span`,{className:`voice-scrub-empty-title`,children:r.title}),t[1]=r.title,t[2]=a);let o;t[3]===r.hint?o=t[4]:(o=(0,U.jsx)(`span`,{className:`voice-scrub-empty-hint`,children:r.hint}),t[3]=r.hint,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,U.jsxs)(`div`,{className:`voice-scrub voice-scrub--empty`,role:`status`,"aria-label":`Voice scrub unavailable`,children:[i,(0,U.jsxs)(`span`,{className:`voice-scrub-empty-copy`,children:[a,o]})]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function nd({audio:e,t,onSeek:n}){let r=(0,H.useRef)(null),i=(0,H.useRef)(null),a=(0,H.useMemo)(()=>$u(e.pcm),[e.pcm]),o=(0,H.useRef)(!1),s=(0,H.useRef)(null),c=(0,H.useRef)(null),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(null),p=d??t,m=(0,H.useRef)(p);m.current=p;let[h,g]=Qt(),_=Ju(h.voiceSpeed),y=_/(e.speed||1),b=(0,H.useRef)(y);b.current=y;let x=(0,H.useCallback)(()=>{c.current?.stop(),c.current=null,u(!1)},[]),S=(0,H.useRef)(null),C=(0,H.useCallback)(e=>{let t=window.devicePixelRatio||1,n=e.clientWidth,r=e.clientHeight;if(!n||!r)return null;e.width=n*t,e.height=r*t;let i=e.width,o=e.height,s=document.documentElement.dataset.theme??``,c=S.current;if(c&&c.peaks===a&&c.pw===i&&c.ph===o&&c.theme===s)return c;let l=getComputedStyle(e),u=l.getPropertyValue(`--scrub-played`).trim()||`#8a93f8`,d=l.getPropertyValue(`--scrub-rest`).trim()||`#5c647833`,f=n/Qu,p=e=>{let n=document.createElement(`canvas`);n.width=i,n.height=o;let s=n.getContext(`2d`);if(s){s.scale(t,t),s.fillStyle=e;for(let e=0;e<Qu;e++){let t=Math.max(.06,a[e])*(r-4);s.fillRect(e*f+f*.2,(r-t)/2,f*.6,t)}}return n},m={peaks:a,pw:i,ph:o,theme:s,played:p(u),rest:p(d)};return S.current=m,m},[a]),w=(0,H.useCallback)(t=>{let n=r.current;if(!n)return;let i=C(n);if(!i)return;let a=n.getContext(`2d`);if(!a)return;let{played:o,rest:s,pw:c,ph:l}=i;a.clearRect(0,0,c,l),a.drawImage(s,0,0);let u=t===null?1:Math.max(0,Math.min(1,t/e.duration)),d=Number.isFinite(u)?Math.min(Qu,Math.max(0,Math.floor(u*Qu)+1)):0;if(d>0){let e=Math.min(c,Math.round(d/Qu*c));a.drawImage(o,0,0,e,l,0,0,e,l)}},[e.duration,C]);(0,H.useEffect)(()=>{c.current||w(p)},[p,w]);let T=(0,H.useCallback)(t=>{if(x(),!v())return;n(t),f(t),s.current||=Zu(e.pcm,e.sampleRate);let r=new Audio(s.current);r.preservesPitch=!0,r.webkitPreservesPitch=!0,r.playbackRate=b.current,r.currentTime=t,t>0&&r.addEventListener(`loadedmetadata`,()=>{Math.abs(r.currentTime-t)>.05&&(r.currentTime=t)},{once:!0});let i=ee(r);r.play().catch(()=>{});let a=0,o=Math.round(t),l=()=>{if(r.ended||r.currentTime>=e.duration){d(),c.current=null,u(!1),f(null),n(null);return}w(r.currentTime);let t=Math.round(r.currentTime);t!==o&&(o=t,f(r.currentTime)),a=requestAnimationFrame(l)},d=()=>{cancelAnimationFrame(a);try{r.pause(),r.removeAttribute(`src`)}catch{}i()};c.current={stop:d,el:r},u(!0),a=requestAnimationFrame(l)},[e,n,x,w]),E=(0,H.useCallback)(()=>{if(c.current){let e=c.current.el.currentTime;x(),f(null),n(e)}else T(p??0)},[p,T,x,n]),D=(0,H.useCallback)(()=>{g({voiceSpeed:Yu(_)})},[g,_]);(0,H.useEffect)(()=>{c.current&&(c.current.el.playbackRate=y)},[y]),(0,H.useEffect)(()=>{let e=null;return typeof MutationObserver<`u`&&(e=new MutationObserver(()=>{c.current||w(m.current)}),e.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})),()=>{e?.disconnect(),x(),s.current&&=(URL.revokeObjectURL(s.current),null),S.current=null}},[e,x,w]),(0,H.useEffect)(()=>{f(null)},[e]);let O=t=>{let n=i.current.getBoundingClientRect();return n.width?Math.max(0,Math.min(1,(t-n.left)/n.width))*e.duration:0};return(0,U.jsxs)(`div`,{className:`voice-scrub`,children:[(0,U.jsx)(`button`,{type:`button`,className:`voice-scrub-play`,onPointerDown:e=>e.stopPropagation(),onClick:E,"aria-label":l?`Pause`:`Play the spoken answer`,title:l?`Pause`:`Play from here`,children:l?(0,U.jsxs)(`svg`,{viewBox:`0 0 12 12`,width:`13`,height:`13`,"aria-hidden":`true`,children:[(0,U.jsx)(`rect`,{x:`2.5`,y:`2`,width:`2.4`,height:`8`,rx:`0.6`,fill:`currentColor`}),(0,U.jsx)(`rect`,{x:`7.1`,y:`2`,width:`2.4`,height:`8`,rx:`0.6`,fill:`currentColor`})]}):(0,U.jsx)(`svg`,{viewBox:`0 0 12 12`,width:`13`,height:`13`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M3.2 2.2 L10 6 L3.2 9.8 Z`,fill:`currentColor`})})}),(0,U.jsx)(`button`,{type:`button`,className:`voice-scrub-rate`,onPointerDown:e=>e.stopPropagation(),onClick:D,"aria-label":`Speed, currently ${qu(_)}. Tap to change.`,title:`Voice speed`,children:qu(_)}),(0,U.jsxs)(`div`,{ref:i,className:`voice-scrub-body`,role:`slider`,"aria-label":`Scrub the spoken answer`,"aria-valuemin":0,"aria-valuemax":Math.round(e.duration),"aria-valuenow":Math.round(p??e.duration),tabIndex:0,onPointerDown:e=>{o.current=!0,x(),f(null);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}n(O(e.clientX),!0)},onPointerMove:e=>{o.current&&n(O(e.clientX),!0)},onPointerUp:e=>{o.current&&(o.current=!1,T(O(e.clientX)))},onKeyDown:t=>{let r=p??e.duration;t.key===`ArrowLeft`&&(x(),f(null),n(Math.max(0,r-2),!0)),t.key===`ArrowRight`&&(x(),f(null),n(Math.min(e.duration,r+2),!0)),(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),E()),t.key===`Escape`&&(x(),f(null),n(null))},children:[(0,U.jsx)(`canvas`,{ref:r,className:`voice-scrub-wave`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`voice-scrub-hint`,children:l?`playing — tap pause or drag to scrub`:p===null?`play, or drag to rewind the voice`:`the canvas is rebuilt to this moment`})]})]})}function rd({audio:e,t,onSeek:n,unavailable:r=`missing`}){return e?(0,U.jsx)(nd,{audio:e,t,onSeek:n}):(0,U.jsx)(td,{reason:r})}function id(){let e=(0,q.c)(16),[t,n]=Qt(),r;e[0]===t.voiceSpeed?r=e[1]:(r=Ju(t.voiceSpeed),e[0]=t.voiceSpeed,e[1]=r);let i=r,a,o;e[2]===i?(a=e[3],o=e[4]):(a=()=>{De(i)},o=[i],e[2]=i,e[3]=a,e[4]=o),(0,H.useEffect)(a,o);let s;e[5]!==n||e[6]!==i?(s=()=>n({voiceSpeed:Yu(i)}),e[5]=n,e[6]=i,e[7]=s):s=e[7];let c=s,l;e[8]===i?l=e[9]:(l=qu(i),e[8]=i,e[9]=l);let u=`Voice speed, currently ${l}. Tap to change.`,d;e[10]===i?d=e[11]:(d=qu(i),e[10]=i,e[11]=d);let f;return e[12]!==c||e[13]!==u||e[14]!==d?(f=(0,U.jsx)(`button`,{type:`button`,className:`voice-speed`,onClick:c,"aria-label":u,title:`How fast Mavéa speaks`,children:d}),e[12]=c,e[13]=u,e[14]=d,e[15]=f):f=e[15],f}var ad={standard:`deep`,deep:`simple`,simple:`standard`},od={simple:`Simple`,standard:`Standard`,deep:`In-depth`};function sd(){let e=(0,q.c)(9),[t,n]=Qt(),r=t.explainLevel,i;e[0]!==r||e[1]!==n?(i=()=>n({explainLevel:ad[r]}),e[0]=r,e[1]=n,e[2]=i):i=e[2];let a=i,o=`explain-chip`+(r===`simple`?` is-simple`:r===`deep`?` is-deep`:``),s=`Explanation level: ${od[r]}. Tap for ${od[ad[r]]}.`,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,U.jsx)(`span`,{className:`explain-chip-tag`,children:`Explain`}),e[3]=c):c=e[3];let l=od[r],u;return e[4]!==a||e[5]!==o||e[6]!==s||e[7]!==l?(u=(0,U.jsxs)(`button`,{type:`button`,className:o,onClick:a,"aria-label":s,title:`How plain or rigorous the words and visuals are — or just say 'explain it simpler' / 'go deeper'`,children:[c,l]}),e[4]=a,e[5]=o,e[6]=s,e[7]=l,e[8]=u):u=e[8],u}var cd=[`You catch a HALF-SPOKEN question, still being said. Reply ONLY with JSON:`,`{"ghosts":[{"kind":"forming"|"maybe","title":"..."}]}`,`2-3 entries: the visual cards you would build if the sentence ended right now.`,`"forming" = clearly needed for what was said so far; "maybe" = a plausible direction the sentence is heading.`,`Each title ≤ 6 words, concrete (e.g. "Bloom forecast", "Late-April flights"). No prose, no other keys.`].join(`
22
+ `),ld=150;function ud(e){try{let t=(typeof e==`string`?JSON.parse(e.match(/\{[\s\S]*\}/)?.[0]??`{}`):e).ghosts;return Array.isArray(t)?t.map(e=>{let t=e,n=typeof t.title==`string`?t.title.trim().slice(0,48):``;return n?{kind:t.kind===`maybe`?`maybe`:`forming`,title:n}:null}).filter(e=>e!==null).slice(0,3):[]}catch{return[]}}async function dd(e,t,n){try{let r=await Wt(t.provider).generate({system:cd,history:[],user:e,maxTokens:ld,thinkingLevel:`minimal`,signal:n},t);return n.aborted?[]:ud(r.raw)}catch{return[]}}var fd=80,pd=120;function md(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function hd(e){if(!e)return``;if(/[\s.!?,;:]$/.test(e))return e.trim();let t=e.trimEnd();return/\s/.test(t)?t.replace(/\S+$/,``).trim():``}function gd(e){return e.replace(/([.!?])\s+/g,`$1\0`).replace(/\s+(?=\b(?:but |and i |and she |and he |and they |and dad|and mom|and my |so i |so she |so he |honestly |actually |i keep |i also |i've |i just |the thing is |i mean |i don't know)\b)/gi,`\0`).split(`\0`).map(e=>e.trim()).filter(e=>e.length>=8)}function _d(e){return md(e.trim(),pd)}function vd(e){let t=e.replace(/^(?:okay|so|like|i mean|well|um|uh|you know|honestly|actually|look|i just|and|but|i think|i guess|i suppose|you see)\s+/gi,``);return md(t.charAt(0).toUpperCase()+t.slice(1),fd)}var yd=/\b(Dad|Mom|Mum|Papa|Mama|Grandpa|Grandma|Grandad|Nan|Nana|Uncle|Auntie)\b(?:'s)?/,bd=/\b(?:my|his|her|their|our)\s+(dad|father|mom|mother|sister|brother|son|daughter|wife|husband|partner|friend|boss|manager|co-?founder|colleague|mentor|coach|therapist|doctor|lawyer|ex)\b/i,xd=/\b([A-Z][a-z]{2,12})(?:'s)?\s+(?:just|started|always|keeps?|is|was|has|have|said|told|wants?|needs?|feels?|thinks?|loves?|hates?|came|went|left|got|has|moved|called|texted)\b/,Sd=new Set(`March.January.February.April.June.July.August.September.October.November.December.Monday.Tuesday.Wednesday.Thursday.Friday.Saturday.Sunday.Seattle.Austin.Portland.Chicago.Boston.Denver.Atlanta.New.York.Los.San.Las`.split(`.`)),Cd=/\b(?:should i|whether to|thinking about|considering|one option|maybe i should|alternatively|or i could|or i might|could (?:also )?(?:go|stay|take|move|leave|try|do|join|accept|turn)|(?:an?|this|that|the)\s+offer|an? (?:opportunity|position|role|deal)|option (?:is|would be))\b/i,wd=/\b(?:scared|afraid|fear|worried about|anxious|terrified|dreading|dread|what if|might fail|not (?:going to )?work|won'?t work|going wrong|could go wrong|nervous|i'?m (?:just |really )?scared|i'?m worried)\b/i,Td=/\b(?:can'?t|cannot|have to|has to|must|deadline|budget|mortgage|my lease|loan|runway|no choice|tied (?:to|down)|stuck|limited|only (?:have|got) (?:\w+ )?\d|only \d+ months?|no time|no money|not (?:enough|possible)|running out)\b/i,Ed=/(?:\?)|(?:\b(?:i don'?t know|not sure|can'?t decide|i keep going back and forth|i keep (?:asking|wondering|second.?guessing)|haven'?t decided|still figuring|up in the air|i wonder|no idea|is it even|is it the right|is this (?:the right|a|even)|what (?:do|should) i)\b)/i,Dd=/\b(?:i (?:really )?want|i wish|i hope|would (?:really )?love|i'?ve always wanted|would like|i dream|my goal|i aspire|i'?m looking for|i need (?:to )?(?:feel|be|have|find|do)|i want to (?:feel|be|have|find|do))\b/i;function Od(e){let t=gd(e),n=[],r=new Set,i=0,a=0,o=0,s=0,c=0,l=0;function u(e,t,i,a){let o=typeof i==`string`?md(i,fd):vd(a),s=`${t}:${o.toLowerCase().slice(0,20)}`;if(r.has(s))return;r.add(s);let c=_d(a);c&&n.push({id:e,kind:t,label:o,quote:c,status:`forming`,confidence:`said`,weight:1})}for(let e of t){let t=e.match(bd);if(t){let n=t[1],r=n.charAt(0).toUpperCase()+n.slice(1);u(`per_${i++}`,`person`,r,e)}let n=e.match(yd);n&&!t&&u(`per_${i++}`,`person`,n[1],e);let r=e.match(xd);if(r){let t=r[1];Sd.has(t)||u(`per_${i++}`,`person`,t,e)}Cd.test(e)&&u(`opt_${a++}`,`option`,vd(e),e),wd.test(e)&&u(`fea_${o++}`,`fear`,vd(e),e),Td.test(e)&&u(`con_${s++}`,`constraint`,vd(e),e),Ed.test(e)&&u(`loo_${c++}`,`open_loop`,vd(e),e),Dd.test(e)&&u(`wan_${l++}`,`want`,vd(e),e)}return n}function kd(e){let t=gd(e);return t.length>0?t.length:+!!e.trim()}var Ad=700,jd=4,Md=3;function Nd(e,t,n,r){let i=(0,q.c)(19),a=r!==void 0&&r,o;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[],i[0]=o):o=i[0];let[s,c]=(0,H.useState)(o),l=(0,H.useRef)(0),u=(0,H.useRef)(``),d=(0,H.useRef)(null),f,p;i[1]===e?(f=i[2],p=i[3]):(f=()=>{l.current=0,u.current=``,e||(d.current?.abort(),c([]))},p=[e],i[1]=e,i[2]=f,i[3]=p),(0,H.useEffect)(f,p);let m,h;i[4]===a?(m=i[5],h=i[6]):(m=()=>{a&&(d.current?.abort(),c([]))},h=[a],i[4]=a,i[5]=m,i[6]=h),(0,H.useEffect)(m,h);let g,_;i[7]!==n||i[8]!==e||i[9]!==t||i[10]!==a?(g=()=>{if(!e||!n||a)return;let r=hd((t??``).trim());if(r.split(/\s+/).filter(Boolean).length<jd||r===u.current||l.current>=Md)return;let i=window.setTimeout(()=>{u.current=r,l.current+=1,d.current?.abort();let e=new AbortController;d.current=e,dd(r,n,e.signal).then(t=>{!e.signal.aborted&&t.length&&c(t)})},Ad);return()=>window.clearTimeout(i)},_=[e,t,n,a],i[7]=n,i[8]=e,i[9]=t,i[10]=a,i[11]=g,i[12]=_):(g=i[11],_=i[12]),(0,H.useEffect)(g,_);let v,y;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>()=>d.current?.abort(),y=[],i[13]=v,i[14]=y):(v=i[13],y=i[14]),(0,H.useEffect)(v,y);let b;return i[15]!==s||i[16]!==e||i[17]!==a?(b=e&&!a?s:[],i[15]=s,i[16]=e,i[17]=a,i[18]=b):b=i[18],b}function Pd({ghosts:e}){return e.length===0?null:(0,U.jsx)(`div`,{className:`ghost-row`,"aria-hidden":`true`,children:e.map((e,t)=>(0,U.jsxs)(`div`,{className:`ghost-card is-`+e.kind,style:{"--gi":t},children:[(0,U.jsxs)(`span`,{className:`ghost-kind`,children:[`◌ `,e.kind===`forming`?`Forming`:`Maybe`]}),(0,U.jsx)(`span`,{className:`ghost-title`,children:e.title}),(0,U.jsxs)(`span`,{className:`ghost-bones`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]})]},e.title))})}var Fd=2e3,Id=350,Ld={type:`object`,properties:{id:{type:`string`},kind:{type:`string`,enum:[`person`,`option`,`want`,`fear`,`constraint`,`tradeoff`,`contradiction`,`open_loop`,`action`,`value`,`question`]},label:{type:`string`},quote:{type:`string`},status:{type:`string`},confidence:{type:`string`},weight:{type:`number`}},required:[`id`,`kind`,`label`,`quote`]},Rd={type:`object`,properties:{from:{type:`string`},to:{type:`string`},kind:{type:`string`,enum:[`supports`,`tensions`,`depends_on`,`same_thread`,`blocks`]},label:{type:`string`}},required:[`from`,`to`,`kind`]},zd={type:`object`,properties:{center:{type:`string`},title:{type:`string`},atoms:{type:`array`,minItems:1,items:Ld},links:{type:`array`,items:Rd},clusters:{type:`array`,items:{type:`object`,properties:{id:{type:`string`},label:{type:`string`},atomIds:{type:`array`,items:{type:`string`}},weight:{type:`number`}},required:[`id`,`label`,`atomIds`]}},unsaid:{type:`object`,properties:{label:{type:`string`},why:{type:`string`},confidence:{type:`string`}}}},required:[`center`,`atoms`]},Bd={type:`object`,properties:{add:{type:`array`,items:Ld},addLinks:{type:`array`,items:Rd}}},Vd=`You are Mavéa, a listening companion that mirrors the shape of thought. A person has been thinking aloud — sometimes weighing a personal decision (wants, fears, options), sometimes exploring a subject they're curious about (questions, threads, sub-topics). Extract the structure of their thinking into a "mindshape" — NOT to give advice, judge, or add ideas not present in their words.
23
+
24
+ Find WHAT IS ACTUALLY THERE and WHAT CONNECTS OR PULLS AGAINST WHAT. Choose the kind that genuinely fits each atom — never default everything to one kind.
25
+
26
+ ATOM KINDS:
27
+ - question: a subject, topic, or thing they are curious about or want to understand — the DEFAULT for exploratory/learning thinking ("how cars reshaped cities", "what came before the wheel")
28
+ - option: a concrete path, sub-area, or choice they are considering
29
+ - action: a concrete step they could take or are taking
30
+ - want: a genuine desire or goal, stated as wanting something — NOT a topic they are merely exploring
31
+ - fear: what worries or scares them
32
+ - constraint: a real limitation (time, money, geography, commitment, obligation)
33
+ - tradeoff: a genuine cost-benefit tension in a single choice
34
+ - open_loop: an unresolved question or loose thread they keep circling but haven't answered
35
+ - value: a principle that matters to them (only when explicitly stated)
36
+ - person: a real person mentioned by name or relationship — and what they want, said, or are affected by. A card reading only "Priya" tells the reader nothing; "Priya wants to batch the writes" is the thought. Never emit a bare name.
37
+
38
+ Pick deliberately: a subject of curiosity is a question, a sub-area or path is an option, an unknown they circle is an open_loop; reserve want for an actual stated desire. A map where every atom is the same kind is wrong — make the kinds reflect the real variety in what they said.
39
+
40
+ COVER EVERYTHING THEY SAID. Every distinct thought gets its own atom. Do not compress five spoken thoughts into two tidy ones, and do not drop the small concrete ones (a date, a budget, who wants what) because they seem minor — those are usually the constraints the whole decision turns on. If two sentences really are the same thought, merge them; otherwise keep both.
41
+
42
+ LINK KINDS:
43
+ - tensions: what genuinely conflicts or pulls against what — THE HERO LINK
44
+ - supports: one thing enables or justifies another
45
+ - depends_on: one thing requires another
46
+ - same_thread: two atoms about the same underlying issue
47
+
48
+ LABELS:
49
+ Each atom's label is a short, plain-language sentence that sums up the idea in the person's own framing — a reader skimming only the labels should grasp the whole shape of the thinking. Write "Cars gave us freedom but reshaped cities around them", NOT a bare noun ("cars") or a filler prefix ("information on cars") or a category. ≤80 chars.
50
+
51
+ CLUSTERS:
52
+ Group the atoms into 2–5 themes that EMERGED from what they actually said. Name each theme in THEIR words and specifics — "the move to Seattle", "Maya and her school", "Dad getting older", "is it the right time" — NEVER an abstract category like "People", "Options", "Worries", "Constraints", or "Trade-offs". A theme must contain at least one atom (list its atom ids). Do not invent a theme to fill a slot — only name what is genuinely there. The themes are how the map is organized, so they must read as this person's own thoughts, not a generic form.
53
+
54
+ HARD RULES:
55
+ 1. Every atom MUST have a real quote — verbatim words from the transcript. No quote → no atom.
56
+ 2. center = the inferred hidden question driving everything. Be SPECIFIC, not generic. ≤90 chars.
57
+ 3. unsaid = ONE thing they kept circling but never said directly. Write its label as one complete plain-language sentence; confidence MUST be "maybe". label ≤120 chars, why ≤120 chars.
58
+ 4. Find at least one tensions link if there is genuine conflict in the words.
59
+ 5. NEVER use clinical/diagnostic language: trauma, PTSD, depression, anxiety disorder, attachment style, narcissism, codependency, dissociation, hypervigilance, personality disorder.
60
+ 6. NEVER invent motives or interpretations beyond what the words contain.
61
+ 7. label ≤80 chars (a short summarizing sentence, per LABELS above), quote ≤120 chars (verbatim from the transcript). cluster label ≤32 chars, content-specific.
62
+
63
+ Reply with ONLY compact JSON — no prose, no markdown fences. The exact fields are given with each request.`;function Hd(e){return`TRANSCRIPT:
64
+ ${e.trim()}
65
+
66
+ Extract the full mindshape. Reply as compact JSON on ONE line (no whitespace, no markdown):
67
+ {"center":"...","title":"...","atoms":[{"id":"...","kind":"...","label":"...","quote":"...","status":"stable","confidence":"said","weight":1}],"links":[{"from":"...","to":"...","kind":"tensions","label":"..."}],"clusters":[{"id":"...","label":"...","atomIds":["..."],"weight":1}],"unsaid":{"label":"...","why":"...","confidence":"maybe"}}`}function Ud(e){return JSON.stringify({atoms:e.atoms.map(e=>({id:e.id,k:e.kind,l:e.label})),links:e.links.map(e=>[e.from,e.to,e.kind])})}function Wd(e,t){return`NEW SPEECH (since last update):
68
+ ${e.trim()}
69
+
70
+ ALREADY ON THE MAP — reuse these ids, do NOT renumber or restate them:
71
+ ${Ud(t)}
72
+
73
+ Return ONLY what the NEW speech ADDS, as compact JSON on ONE line (no whitespace, no markdown):
74
+ {"add":[{"id":"...","kind":"...","label":"...","quote":"...","status":"stable","confidence":"said","weight":1}],"addLinks":[{"from":"...","to":"...","kind":"tensions","label":"..."}]}
75
+ Only genuinely new atoms (each needs a verbatim quote from the NEW speech). Reuse an existing id only to update that exact atom. Omit "add" or "addLinks" when empty. Do NOT restate unchanged atoms, and do NOT include center, unsaid, clusters, or title — those come at settle.`}async function Gd(e,t,n,r,i){try{let a=await Wt(r.provider).generate({system:Vd,history:[],user:e,maxTokens:t,thinkingLevel:`minimal`,format:n,signal:i},r);return i?.aborted?null:a.raw}catch{return null}}async function Kd(e,t,n){let r=await Gd(Hd(e),Fd,zd,t,n);return r===null?null:Tt(r,e)}async function qd(e,t,n,r,i){let a=await Gd(Wd(e,t),Id,Bd,r,i);return a===null?null:xt(a,n)}function Jd(e){if(e.atoms.length===0)return`general`;let t=0,n=0,r=0,i=0,a=0,o=0,s=0;for(let c of e.atoms)c.kind===`option`?t++:c.kind===`open_loop`?n++:c.kind===`action`?r++:c.kind===`question`?i++:c.kind===`fear`?a++:c.kind===`want`?o++:c.kind===`person`&&s++;let c=e.atoms.length,l=e.links.some(e=>e.kind===`tensions`&&!e.provisional);return t>=2&&l?`decision`:n+r>=3?`planning`:i/c>=.4?`exploration`:(a+o+s)/c>=.5?`processing`:`general`}var Yd=6e3,Xd=8,Zd=1,Qd=8,$d=4;function ef(e){return e.trim()?e.trim().split(/\s+/).length:0}var tf=24;function nf(e,t){let n=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);t?(e.status===`stable`||t.status===`forming`)&&n.set(e.id,{...t,...e}):n.set(e.id,e)}return Array.from(n.values())}function rf(e){return e.toLowerCase().replace(/['’]/g,``).replace(/[^a-z0-9]+/g,` `).trim()}function af(e){return e.status===`stable`?2:+(e.status===`forming`)}function of(e,t){if(t.atoms.length>=e.length)return t;let n=new Set(t.atoms.map(e=>rf(e.quote))),r=e.filter(e=>{let t=rf(e.quote);return!t||n.has(t)?!1:(n.add(t),!0)});return r.length?{...t,atoms:[...t.atoms,...r].slice(0,tf)}:t}function sf(e,t){let n=new Map(e.atoms.map(e=>[e.id,e])),r=new Map(e.atoms.map(e=>[rf(e.quote),e.id]));for(let e of t.add){let t=n.get(e.id);if(t){n.set(e.id,{...t,...e});continue}let i=r.get(rf(e.quote));if(i&&n.has(i)){n.set(i,{...n.get(i),...e,id:i});continue}n.set(e.id,e),r.set(rf(e.quote),e.id)}let i=Array.from(n.values());i.length>tf&&(i=[...i].sort((e,t)=>(t.weight??1)-(e.weight??1)||af(t)-af(e)).slice(0,tf));let a=new Set(i.map(e=>e.id)),o=e=>`${e.from}|${e.to}|${e.kind}`,s=new Map(e.links.map(e=>[o(e),e]));for(let e of t.addLinks)s.set(o(e),e);let c=Array.from(s.values()).filter(e=>a.has(e.from)&&a.has(e.to));return{...e,atoms:i,links:c}}var cf={center:``,atoms:[],links:[]};function lf(e){let[t,n]=(0,H.useState)(`idle`),[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(null),s=(0,H.useRef)(`idle`),c=(0,H.useRef)(null),l=(0,H.useRef)(``),u=(0,H.useRef)(0),d=(0,H.useRef)(0),f=(0,H.useRef)(null),p=(0,H.useRef)(!1),m=(0,H.useRef)(new Set),h=(0,H.useRef)(e);(0,H.useEffect)(()=>{h.current=e},[e]);let g=e=>[`id:${e.id}`,`q:${rf(e.quote)}`];function _(e){return g(e).some(e=>m.current.has(e))}function v(e){if(m.current.size===0)return e;let t=e.atoms.filter(e=>!_(e));if(t.length===e.atoms.length)return e;let n=new Set(t.map(e=>e.id));return{...e,atoms:t,links:e.links.filter(e=>n.has(e.from)&&n.has(e.to)),clusters:e.clusters?.map(e=>({...e,atomIds:e.atomIds.filter(e=>n.has(e))})).filter(e=>e.atomIds.length>0)}}function y(e){s.current=e,n(e)}function b(e){c.current=e,o(e)}let x=(0,H.useCallback)(e=>{let t=e.filter(e=>!_(e));if(t.length===0)return;let n=c.current??cf,r=nf(n.atoms,t);b({...n,atoms:r})},[]),S=(0,H.useCallback)(async e=>{let t=h.current;if(!t)return;let n=c.current;if(!n||n.atoms.length===0)return;f.current?.abort();let r=new AbortController;f.current=r;let i=e.slice(l.current.length).trim();l.current=e,u.current=Date.now(),d.current+=1,p.current=!0;try{let a=await qd(i,n,e,t,r.signal);if(r.signal.aborted||!a)return;b(v(sf(c.current??n,a)))}finally{r.signal.aborted||(p.current=!1)}},[]),C=(0,H.useCallback)(async e=>{let t=h.current;if(!t)return;f.current?.abort();let n=new AbortController;f.current=n,l.current=e,u.current=Date.now(),d.current+=1,p.current=!0;try{let r=await Kd(e,t,n.signal);if(n.signal.aborted||!r)return;let i=sf(c.current??cf,{add:r.atoms,addLinks:r.links});b(v({...i,center:r.center||i.center,clusters:r.clusters,unsaid:r.unsaid,title:r.title??i.title}))}finally{n.signal.aborted||(p.current=!1)}},[]),w=(0,H.useCallback)(async e=>{let t=h.current;if(!t)return;f.current?.abort();let n=new AbortController;f.current=n,l.current=e,u.current=Date.now(),d.current+=1,p.current=!0;try{let r=await Kd(e,t,n.signal);if(n.signal.aborted)return;if(!r){i(!0);return}i(!1),b(of(c.current?.atoms??[],r))}finally{n.signal.aborted||(p.current=!1)}},[]),T=(0,H.useCallback)(e=>{s.current===`idle`&&y(`listening`);let t=Od(e);x(t);let n=ef(e),r=d.current>=Qd,i=Date.now()-u.current<Yd,a=!r&&!i&&!p.current;if((c.current?.atoms.length??0)===0){a&&n>=$d&&C(e);return}let o=n-ef(l.current),f=t.filter(e=>!c.current?.atoms.some(t=>t.id===e.id)).length;a&&!(n<$d||o<Xd&&f<Zd)&&S(e)},[x,C,S]),E=(0,H.useCallback)(()=>{f.current?.abort(),f.current=null,p.current=!1,m.current.clear(),l.current=``,u.current=0,d.current=0,y(`idle`),b(null)},[]),D=(0,H.useCallback)((e=!0)=>{f.current?.abort(),f.current=null,p.current=!1,l.current=``,u.current=0,d.current=0,e||(m.current.clear(),b(null)),y(`listening`)},[]),O=(0,H.useCallback)(e=>{let t=c.current;if(!t)return;let n=t.atoms.find(t=>t.id===e);if(!n)return;g(n).forEach(e=>m.current.add(e));let r=t.atoms.filter(t=>t.id!==e),i=t.links.filter(t=>t.from!==e&&t.to!==e),a=t.clusters?.map(t=>({...t,atomIds:t.atomIds.filter(t=>t!==e)})).filter(e=>e.atomIds.length>0);b({...t,atoms:r,links:i,clusters:a})},[]),k=(0,H.useCallback)(()=>{let e=c.current;if(!e?.unsaid)return;let{unsaid:t}=e,n={id:`unsaid-confirmed`,kind:`open_loop`,status:`stable`,confidence:`inferred`,label:t.label,quote:t.why,weight:2},r=nf(e.atoms,[n]);b({...e,atoms:r,unsaid:void 0})},[]),A=(0,H.useCallback)(()=>{let e=c.current;if(!e?.unsaid)return;let{unsaid:t}=e;m.current.add(`q:${rf(t.label)}`),b({...e,unsaid:void 0})},[]),j=(0,H.useCallback)(e=>{if(!e.trim()){E();return}y(`pausing`),w(e).then(()=>{s.current===`pausing`&&y(`settled`)})},[w,E]);return(0,H.useEffect)(()=>()=>{f.current?.abort()},[]),{phase:t,spec:a,intent:(0,H.useMemo)(()=>a?Jd(a):`general`,[a]),modelUnavailable:r,onTranscript:T,onSpeechEnd:j,removeAtom:O,confirmUnsaid:k,dismissUnsaid:A,reset:E,resume:D}}var uf=5e3,df=0;function ff(e,t){let[n,r]=(0,H.useState)([]),i=(0,H.useRef)(new Set),a=(0,H.useCallback)((e,t)=>{let n=`sig-${++df}`;r([{id:n,content:t,kind:e,expiresAt:Date.now()+uf}])},[]);return(0,H.useEffect)(()=>{let e=n[0];if(!e)return;let t=Math.max(0,e.expiresAt-Date.now()),i=window.setTimeout(()=>{r(e=>e.filter(e=>e.expiresAt>Date.now()))},t);return()=>window.clearTimeout(i)},[n]),(0,H.useEffect)(()=>{t===`idle`&&(i.current.clear(),r([]))},[t]),(0,H.useEffect)(()=>{if(!e||t===`settled`||t===`idle`)return;let n=e.atoms.length,r=i.current;n>=4&&!r.has(`pattern`)&&(r.add(`pattern`),a(`pattern`,`A shape is forming…`)),e.links.some(e=>e.kind===`tensions`&&!e.provisional)&&!r.has(`tension`)&&(r.add(`tension`),a(`tension`,`I see a pull here…`)),e.unsaid&&!r.has(`unsaid`)&&(r.add(`unsaid`),a(`unsaid`,`There's something unsaid circling…`)),n>=8&&!r.has(`depth`)&&(r.add(`depth`),a(`depth`,`This runs deeper than one answer…`))},[e,t,a]),{currentSignal:n[0]??null}}function pf(e){let t=(0,q.c)(30),{mindShape:n,onSettled:r,onAction:i,liveTranscript:a,thoughtCount:o,onConfirmUnsaid:s,onDismissUnsaid:c}=e,{phase:l,spec:u,intent:d}=n,f=(0,H.useRef)(!1),[p,m]=(0,H.useState)(!1),h=(0,H.useRef)(null),g,_;t[0]!==r||t[1]!==l?(g=()=>{l===`settled`&&!f.current&&(f.current=!0,r?.(),m(!0),h.current=setTimeout(()=>m(!1),1800))},_=[l,r],t[0]=r,t[1]=l,t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,H.useEffect)(g,_);let v,y;t[4]===l?(v=t[5],y=t[6]):(v=()=>{l===`idle`&&(f.current=!1,m(!1),h.current&&=(clearTimeout(h.current),null))},y=[l],t[4]=l,t[5]=v,t[6]=y),(0,H.useEffect)(v,y);let b,x;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>()=>{h.current&&clearTimeout(h.current)},x=[],t[7]=b,t[8]=x):(b=t[7],x=t[8]),(0,H.useEffect)(b,x);let{currentSignal:S}=ff(u,l),C=u?.center??``,w;t[9]===u?.atoms?w=t[10]:(w=u?.atoms??[],t[9]=u?.atoms,t[10]=w);let T;t[11]===u?.links?T=t[12]:(T=u?.links??[],t[11]=u?.links,t[12]=T);let E=u?.clusters,D=u?.unsaid,O=l===`settled`?void 0:a,k=l===`settled`?void 0:o,A;return t[13]!==S||t[14]!==d||t[15]!==p||t[16]!==n.modelUnavailable||t[17]!==n.removeAtom||t[18]!==i||t[19]!==s||t[20]!==c||t[21]!==l||t[22]!==E||t[23]!==D||t[24]!==O||t[25]!==k||t[26]!==C||t[27]!==w||t[28]!==T?(A=(0,U.jsx)(pe,{asBlock:!1,phase:l,center:C,atoms:w,links:T,modelUnavailable:n.modelUnavailable,clusters:E,unsaid:D,intent:d,isRevealing:p,currentSignal:S,onAction:i,onRemoveAtom:n.removeAtom,onConfirmUnsaid:s,onDismissUnsaid:c,liveTranscript:O,thoughtCount:k}),t[13]=S,t[14]=d,t[15]=p,t[16]=n.modelUnavailable,t[17]=n.removeAtom,t[18]=i,t[19]=s,t[20]=c,t[21]=l,t[22]=E,t[23]=D,t[24]=O,t[25]=k,t[26]=C,t[27]=w,t[28]=T,t[29]=A):A=t[29],A}var mf=[{heading:`Options on the table`,kinds:[`option`]},{heading:`What I want`,kinds:[`want`,`value`]},{heading:`What worries me`,kinds:[`fear`,`contradiction`]},{heading:`Trade-offs`,kinds:[`tradeoff`]},{heading:`Constraints`,kinds:[`constraint`]},{heading:`People involved`,kinds:[`person`]},{heading:`Still open`,kinds:[`open_loop`,`question`]},{heading:`Things I could do`,kinds:[`action`]}];function hf(e){let t=e.quote&&e.quote.trim()&&e.quote.trim()!==e.label?` ("${e.quote.trim()}")`:``;return`- ${e.label}${t}`}function gf(e){let t=[];if(e.clusters&&e.clusters.length){let n=new Map(e.atoms.map(e=>[e.id,e])),r=new Set;for(let i of e.clusters){let e=i.atomIds.map(e=>n.get(e)).filter(e=>!!e);if(e.length){t.push(`${i.label}:`);for(let n of e)t.push(hf(n)),r.add(n.id);t.push(``)}}let i=e.atoms.filter(e=>!r.has(e.id));if(i.length){t.push(`Also on my mind:`);for(let e of i)t.push(hf(e));t.push(``)}}else for(let n of mf){let r=e.atoms.filter(e=>n.kinds.includes(e.kind));if(r.length){t.push(`${n.heading}:`);for(let e of r)t.push(hf(e));t.push(``)}}let n=e.links.filter(e=>e.kind===`tensions`);if(n.length){t.push(`Tensions I feel:`);for(let r of n){let n=e.atoms.find(e=>e.id===r.from)?.label??``,i=e.atoms.find(e=>e.id===r.to)?.label??``;n&&i&&t.push(`- "${n}" ${r.label||`pulls against`} "${i}"`)}t.push(``)}return t.join(`
76
+ `).trim()}function _f(e,t){let n=e.center?.trim(),r=gf(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
+ `).trim()}function vf(e){return/^(ok(ay)?[,.\s]+)?(any |your |so[,.\s]+)?thoughts\s*[?.!]*$/i.test(e.trim())}function yf(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 bf(e){let t=e.trim();return t.length>0&&!vf(t)}function xf(e,t){let n=e.map((e,t)=>`(${t+1}) ${e.trim()}`).join(`
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 Sf=/https?:\/\/[^\s<>"')\]]+/i;function Cf(e){let t=e.match(Sf);return t?t[0].replace(/[.,;:!?]+$/,``):null}function wf(e){let t=Cf(e);return t?e.replace(t,``).trim().split(/\s+/).filter(Boolean).length<=12:!1}function Tf(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 Ef=`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 Df(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable:!1}var Of=pt.map(e=>{let t=mt[e];return{id:e,label:t.label,description:`${t.archetype} — ${t.blurb}`,accent:t.tokens.accent}}),kf=`mavea-preso-style`;function Af(e){return Of.some(t=>t.id===e)}function jf(){try{let e=localStorage.getItem(kf);return Af(e)?e:`folio`}catch{return`folio`}}function Mf(e){try{localStorage.setItem(kf,e)}catch{}}function Nf(e){return e<5?`Late night`:e<12?`This morning`:e<17?`This afternoon`:`Tonight`}function Pf(e){let t=Math.max(1,Math.round(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function Ff(e,t){if(e.length===0||t.length===0)return null;let n=e[0],r=e[e.length-1],i=`${Nf(new Date(n.at).getHours())}, so far.`,a=[`${kc(n.at)} – ${kc(r.at)}`,Pf(r.at-n.at),`${t.length} ${t.length===1?`topic`:`topics`}`,`${e.length} ${e.length===1?`moment`:`moments`}`].join(` · `),o=Oc(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:kc(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}var If=300;function Lf({transcript:e,mode:t,note:n,transcribing:r=!1}){let[i,a]=(0,H.useState)(!1);(0,H.useEffect)(()=>{if(!r){a(!1);return}let e=window.setTimeout(()=>a(!0),If);return()=>window.clearTimeout(e)},[r]);let o=r&&i;return(0,U.jsx)(`div`,{className:`listen-stage`,children:(0,U.jsxs)(`div`,{className:`listen-card`+(o?` is-transcribing`:``),children:[(0,U.jsxs)(`span`,{className:`listen-eq`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]}),(0,U.jsxs)(`div`,{className:`listen-body`,children:[(0,U.jsxs)(`div`,{className:`listen-line`,children:[e?`“${e}`:o?`Heard you`:`Listening`,(0,U.jsx)(`span`,{className:`listen-caret`,"aria-hidden":`true`}),e?`”`:``]}),(0,U.jsx)(`div`,{className:`listen-note`,role:`status`,"aria-live":`polite`,children:o?`Got that — one moment…`:n??(t===`always`?`Always on — Mavéa answers when you finish a thought.`:t===`hold`?`Release the mic or shortcut to send.`:`It sends when you pause — or tap the mic to send now.`)})]})]})})}var Rf=250;function zf(e){let t=(0,q.c)(6),{cards:n}=e,[r,i]=(0,H.useState)(!1),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.setTimeout(()=>i(!0),Rf);return()=>window.clearTimeout(e)},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,H.useEffect)(a,o),!r||n.length===0)return null;let s;t[2]===n?s=t[3]:(s=n.map(Bf),t[2]=n,t[3]=s);let c;return t[4]===s?c=t[5]:(c=(0,U.jsx)(`div`,{className:`skel-grid`,role:`status`,"aria-label":`Building the answer`,children:s}),t[4]=s,t[5]=c),c}function Bf(e,t){return(0,U.jsxs)(`div`,{className:`skel-card`,children:[(0,U.jsxs)(`span`,{className:`skel-eyebrow`,children:[`✦ `,e.label,`…`]}),e.lines.map(Vf)]},t)}function Vf(e,t){return(0,U.jsx)(`span`,{className:`skel-line`,style:{width:`${e}%`}},t)}function Hf({thinking:e=!1}){return(0,U.jsxs)(`div`,{className:`composing-status`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(`span`,{className:`composing-orb`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:e?`Thinking it through`:`Composing your answer`}),(0,U.jsxs)(`span`,{className:`composing-dots`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]})]})}function Uf(e){let t=(0,q.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,U.jsxs)(`span`,{className:`turn-chip`,children:[(0,U.jsx)(z.globe,{}),` Searching the web…`]}),c=e.map(Wf)}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,U.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 Wf(e,t){return(0,U.jsxs)(`span`,{className:`turn-chip src`,children:[(0,U.jsx)(`i`,{className:`turn-chip-dot`,"aria-hidden":`true`}),ve(e.url)??e.title]},t)}function Gf(){return(0,H.useSyncExternalStore)(je,Te,Kf)}function Kf(){return!1}var qf=600,Jf=!1,Yf=null,Xf=null,Zf=new Set;function Qf(){if(Ce()){Yf===null&&!Jf&&(Yf=window.setTimeout(()=>{Yf=null,Jf=!0;for(let e of Zf)e()},qf));return}if(Yf!==null&&(window.clearTimeout(Yf),Yf=null),Jf){Jf=!1;for(let e of Zf)e()}}function $f(e){return Zf.add(e),Xf??=je(Qf),()=>{Zf.delete(e),Zf.size===0&&(Xf?.(),Xf=null,Yf!==null&&(window.clearTimeout(Yf),Yf=null),Jf=!1)}}function ep(){return(0,H.useSyncExternalStore)($f,np,tp)}function tp(){return!1}function np(){return Jf}var rp=600,ip=!1,ap=null,op=null,sp=new Set;function cp(){if(Te()){if(ap!==null&&(window.clearTimeout(ap),ap=null),!ip){ip=!0;for(let e of sp)e()}return}ap!==null||!ip||(ap=window.setTimeout(()=>{ap=null,ip=!1;for(let e of sp)e()},rp))}function lp(e){return sp.add(e),op??=je(cp),()=>{sp.delete(e),sp.size===0&&(op?.(),op=null,ap!==null&&(window.clearTimeout(ap),ap=null),ip=!1)}}function up(){return(0,H.useSyncExternalStore)(lp,fp,dp)}function dp(){return!1}function fp(){return ip}var pp={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`},mp=/^(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 hp(e,t=4){let n=e.trim().replace(/\s+/g,` `);for(let e=0;e<8;e++){let e=n.replace(mp,``);if(e===n)break;n=e}return n.replace(/[?!.]+$/,``).split(` `).slice(0,t).join(` `).trim()}var gp=[[78,52],[64,88],[82,40]];function _p(e,t){let n=hp(e),r=er(e,t),i=Object.entries(r).filter(([e,t])=>t>0&&pp[e]).sort((e,t)=>t[1]-e[1]).map(([e])=>pp[e]),a=sn(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:gp[t%gp.length]}))}function vp(e){let t=e&&pp[e]||(e===`text`?`Finding`:null);return{label:t?`Building — ${t.toLowerCase()}`:`Building`,lines:gp[0]}}function yp(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 bp(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 xp=`Local voice input isn’t available here — check browser microphone support, or type instead.`,Sp=`Microphone access is blocked — allow mic access for this site to talk to Mavéa.`,Cp=`Couldn’t reach your microphone — check it’s connected and not in use by another app.`,wp=`Local transcription is still starting or unavailable — try again in a moment, or type instead.`;function Tp(){let e=(0,q.c)(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,H.useState)(t),[i,a]=(0,H.useState)(null),[o,s]=(0,H.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 At(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 Ep=`mavea-live-bookmarks`;function Dp(){let[e,t]=(0,H.useState)(()=>{try{let e=localStorage.getItem(Ep);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}});return{bookmarks:e,toggleBookmark:(0,H.useCallback)(e=>{t(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{localStorage.setItem(Ep,JSON.stringify([...n]))}catch{}return n})},[])}}var Op=`mavea-live-ask-hint`;function kp(){let e=(0,q.c)(3),[t,n]=(0,H.useState)(Ap),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{n(!0);try{localStorage.setItem(Op,`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 Ap(){try{return localStorage.getItem(Op)===`1`}catch{return!1}}i();var jp=(0,H.lazy)(()=>a(()=>import(`./TopicCanvas-Bw4bMFpe.js`).then(e=>e.n).then(e=>({default:e.TopicCanvas})),__vite__mapDeps([56,1,27,28,14,2,26,29,30,31,32,33,34,35,13,57,58,4,59,60,61,62,63,64,65,66,67,16,68,5,6,22,69,70,71,72,73]))),Mp=[{col:6},{col:6},{col:12}],Np=`mavea-live-rail-collapsed-v1`,Pp=`View as living answer`,Fp=`Why this answer is true — the causal web behind it, and its receipts`,Ip=`mavea-mic-hold-preferred`,Lp=`I may have misheard that. Review the draft, then send it.`,Rp=6400,zp=oo+rt;function Bp(e){return Df(e.target)?!0:(e.key===` `||e.key===`Spacebar`)&&e.target instanceof HTMLElement&&!!e.target.closest(`button`)}var Vp=s(()=>a(()=>import(`./HowItWorks-DPFpdeGE.js`).then(e=>({default:e.HowItWorks})),__vite__mapDeps([74,27,1,14,13,56,28,2,26,29,30,31,32,33,34,35,57,58,4,59,60,61,62,63,64,65,66,67,16,68,5,6,22,69,70,71,72,73,75,76,77,15,78,79,80,81,82,83,84,85,19]))),Hp=Vp.Component,Up=s(()=>a(()=>import(`./CommandPalette-Bs6tpdZl.js`).then(e=>({default:e.CommandPalette})),__vite__mapDeps([86,27,1,14,31,32,33,13,87,88]))),Wp=Up.Component,Gp=s(()=>a(()=>import(`./Library-CVj7R6F4.js`).then(e=>({default:e.Library})),__vite__mapDeps([89,27,1,28,14,13,4,90,91,92,93,94]))).Component,Kp=s(()=>a(()=>import(`./LiveSettings-BITIaMoT.js`).then(e=>({default:e.LiveSettings})),__vite__mapDeps([95,27,1,28,14,2,26,29,30,31,32,33,34,35,13,60,77,15,96,97,23,93,21,22,10,20,24,98,50,99,100,49,101,102,48,103,104,105,106,107,53,108]))),qp=Kp.Component,Jp=s(()=>a(()=>import(`./DashboardDetail-BrnAdWfy.js`).then(e=>({default:e.DashboardDetail})),__vite__mapDeps([109,27,1,28,14,2,13,56,26,29,30,31,32,33,34,35,57,58,4,59,60,61,62,63,64,65,66,67,16,68,5,6,22,69,70,71,72,73,17,79,80,81,82,83,84,15,85,110,100,49,50,101,98,23,21,10,20,24,111,112,113,114,115,116,117,118,119,40,43,54,120,121,122,77,123,124,125,126,127,128,129,130,131,132,133]))).Component,Yp=s(()=>a(()=>import(`./DashboardSettings-DJon1Q4o.js`).then(e=>({default:e.DashboardSettings})),__vite__mapDeps([134,27,1,28,14,110,100,49,50,101,111,112,113,114,121,127,117,118]))).Component,Xp=s(()=>a(()=>import(`./UnderstoodPanel-DmJph4el.js`).then(e=>({default:e.UnderstoodPanel})),__vite__mapDeps([135,27,1,28,14,136]))).Component,Zp=s(()=>a(()=>import(`./ZoomDeck-DlnesweX.js`).then(e=>({default:e.ZoomDeck})),__vite__mapDeps([137,27,1,28,14,13,60,138,26,29,30,2,31,32,33,34,35,139,140]))),Qp=Zp.Component,$p=s(()=>a(()=>import(`./AtlasView-DO_p0TdZ.js`).then(e=>({default:e.AtlasView})),__vite__mapDeps([141,27,1,14,90,91,4,92,93,142,100,49,50,143]))),em=$p.Component,tm=s(()=>a(()=>import(`./RippleOverlay-BSxubBwj.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([144,27,1,28,14,2,32,31,33,26,29,30,34,35,60,62,96,97,24,37,145,146,147,148,50,149,150,151]))),nm=tm.Component,rm=s(()=>a(()=>import(`./CardEditor-D4slxmIM.js`).then(e=>({default:e.CardEditor})),__vite__mapDeps([152,27,1,14,60,106,153]))).Component,im=s(()=>a(()=>import(`./CourseRail-BQmUsG6v.js`).then(e=>({default:e.CourseRail})),__vite__mapDeps([154,27,1,28,14,13,98,23,50,21,22,10,20,24,106,155,101,156,157,158,159]))).Component,am=s(()=>a(()=>import(`./MindMapViewerDrawer-CKdJtHno.js`).then(e=>({default:e.MindMapViewerDrawer})),__vite__mapDeps([160,28,1,27,14,13,161,26,29,30,2,31,32,33,34,35,62,162,163,164]))).Component,om=s(()=>a(()=>import(`./Recap-BOl3SUh0.js`).then(e=>({default:e.Recap})),__vite__mapDeps([165,27,1,28,14,60,166]))),sm=om.Component,cm=s(()=>a(()=>import(`./LibraryOverlay-DSUWcUe4.js`).then(e=>({default:e.LibraryOverlay})),__vite__mapDeps([167,27,1,28,14,13,60,138,26,29,30,2,31,32,33,34,35,89,4,90,91,92,93,94,168]))),lm=cm.Component,um=s(()=>a(()=>import(`./ReplayOverlay-BJKtJ-vc.js`).then(e=>({default:e.ReplayOverlay})),__vite__mapDeps([169,27,1,14,56,28,2,26,29,30,31,32,33,34,35,13,57,58,4,59,60,61,62,63,64,65,66,67,16,68,5,6,22,69,70,71,72,73,170,75,76,77,15,78,79,80,81,82,83,84,85,171,172,173,174,175]))).Component,dm=s(()=>a(()=>import(`./ShareModal-xYdZWJxy.js`).then(e=>({default:e.ShareModal})),__vite__mapDeps([176,27,1,28,14,2,31,32,33,13,82,83,84,15,60,66,177,26,29,30,34,35,77,178,179,163,92,96,97,180]))),fm=dm.Component,pm=s(()=>a(()=>import(`./ExportModal-DBUjC71U.js`).then(e=>({default:e.ExportModal})),__vite__mapDeps([181,27,1,28,14,2,26,29,30,31,32,33,34,35,84,4,60,17,178,96,97,78,182,58,13,59,16,183,65,67,184,70,69,71,72,185,186,187,188,161,62,162,163,164,189,190,39,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,61,217,218,219,220,221,222,223,224,77,15,225,226,68,227,228,229,230,231,138,232,233,234,235,236,237,238,239,240,241,18,242,9,243,244,245,246]))),mm=pm.Component,hm=s(()=>a(()=>import(`./ExtractionPreview-D4M6eXqb.js`).then(e=>({default:e.ExtractionPreview})),__vite__mapDeps([247,27,1,28,14,60,248,7,100,49,50,101,110,21,22,10,23,20,24,98,99,40,111,119,2,43,114,113,115,54,120,121,122,15,77,26,29,30,31,32,33,34,35,123,249,133]))),gm=hm.Component,_m=s(()=>a(()=>import(`./PinToDashboard-DpQjBLPa.js`).then(e=>({default:e.PinToDashboard})),__vite__mapDeps([250,27,1,28,14,13,4,60,110,100,49,50,101,98,23,21,22,10,20,24,113,114,125,119,2,40,43,115,54,120,121,122,15,77,26,29,30,31,32,33,34,35,126]))).Component,vm=s(()=>a(()=>import(`./PrismOverlay-Pp6ZKmTc.js`).then(e=>e.n).then(e=>({default:e.PrismOverlay})),__vite__mapDeps([251,1,27,28,14,2,32,31,33,26,29,30,34,35,60,66,17,252,172,20,253,21,22,10,23,24,41,45,46,254,11,42,47,255]))),ym=vm.Component,bm=s(()=>a(()=>import(`./WorldOverlay-BcjqG1BR.js`).then(e=>({default:e.WorldOverlay})),__vite__mapDeps([256,27,1,28,14,2,15,57,33,60,62,67,184,198,190,39,17,224,76,77,26,29,30,31,32,34,35,78,173,38,40,41,42,43,44,257,258,259,260,261]))),xm=bm.Component,Sm=s(()=>a(()=>import(`./SynthesisOverlay-DCa-2Pz_.js`).then(e=>({default:e.SynthesisOverlay})),__vite__mapDeps([262,27,1,28,14,20,21,22,10,23,24,41,251,2,32,31,33,26,29,30,34,35,60,66,17,252,172,253,45,46,254,11,42,47,255]))),Cm=Sm.Component,wm=s(()=>a(()=>import(`./PresentationDeck-CfYadu9V.js`).then(e=>({default:e.PresentationDeck})),__vite__mapDeps([263,27,1,28,14,26,29,30,2,31,32,33,34,35,182,84,58,13,4,59,16,183,65,67,184,70,69,71,72,185,186,187,188,161,62,162,163,164,189,190,39,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,17,211,212,213,214,215,216,61,217,218,219,220,221,222,223,224,77,15,225,226,68,227,228,229,230,231,60,138,232,233,234,235,236,237,238,239,240,241,18,242,9,243,244]))),Tm=wm.Component,Em=s(()=>a(()=>import(`./DelegatePanel-DN_ZL0j7.js`).then(e=>({default:e.DelegatePanel})),__vite__mapDeps([264,27,1,28,14,26,29,30,2,31,32,33,34,35,15,60,162,163,77,96,97,21,22,10,23,20,24,265]))),Dm=Em.Component,Om=s(()=>a(()=>import(`./SrsReview-Gr6Y0QTQ.js`).then(e=>({default:e.SrsReview})),__vite__mapDeps([266,27,1,14,60,106,107,267]))),km=Om.Component,Am=s(()=>a(()=>import(`./TourPrism-DbinDupp.js`).then(e=>({default:e.TourPrism})),__vite__mapDeps([268,27,1,28,14,251,2,32,31,33,26,29,30,34,35,60,66,17,252,172,20,253,21,22,10,23,24,41,45,46,254,11,42,47,255]))),jm=Am.Component;function $({children:e,label:t=`Feature`}){return(0,U.jsx)(f,{label:t,overlay:!0,children:e})}function Mm(){try{window.location.hash=``}catch{}}function Nm(e){return y(e)??Promise.resolve()}function Pm(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 Fm(){let[e]=Qt(),t=_t(e.provider),n=e.models[e.provider]||t.defaultModel;(0,H.useLayoutEffect)(()=>S(document),[]),(0,H.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,H.useRef)(u()),i=(0,H.useRef)(Tr()),s=(0,H.useRef)(c()),f=(0,H.useRef)(s.current?b():null),p=(0,H.useRef)(s.current?j():!1),m=(0,H.useRef)((()=>{if(s.current)return null;let e=C();return e&&I(e)?e:null})()),_=(0,H.useRef)(m.current?T():null);(0,H.useEffect)(()=>{s.current&&h(),f.current&&F(),p.current&&D(),m.current&&w()},[]);let[v,y]=(0,H.useState)(``),{attached:A,setAttached:P,attachError:R,setAttachError:ee,turnHadFiles:te,setTurnHadFiles:ne,onFiles:re,removeAttachment:B}=Tp(),[le,ue]=(0,H.useState)([]),[pe,he]=(0,H.useState)(!1),{askHintSeen:ge,dismissAskHint:_e}=kp(),[V,ve]=(0,H.useState)(!1),[xe,Ce]=(0,H.useState)(`idle`),[we,De]=(0,H.useState)(!1),Oe=xe===`transcribing`||we,[Ae,Me]=(0,H.useState)(null),[Fe,ze]=(0,H.useState)(null),[Be,Ve]=(0,H.useState)(null),[He,Ue]=(0,H.useState)(!1),[We,Ke]=(0,H.useState)(!1),[Je,Ze]=(0,H.useState)(!1),[ct,ut]=(0,H.useState)(!1),[dt,ft]=(0,H.useState)(null),[pt,mt]=(0,H.useState)(!1),[vt,yt]=(0,H.useState)(null),[xt,Tt]=(0,H.useState)(null),[Et,At]=(0,H.useState)(()=>new Set),[Pt,It]=(0,H.useState)(null),[Lt,Rt]=(0,H.useState)(null),zt=(0,H.useRef)(void 0),[Bt,Vt]=(0,H.useState)(null),Ht=(0,H.useRef)(void 0),[Ut,Gt]=(0,H.useState)(!1),[Xt,Zt]=(0,H.useState)(!1),[en,tn]=(0,H.useState)(!1),[an,on]=(0,H.useState)(!1),[sn,cn]=(0,H.useState)(!1),[pn,mn]=(0,H.useState)(()=>dr().length),hn=Xn().length;(0,H.useEffect)(()=>{let e=()=>{window.removeEventListener(`focusin`,t),window.removeEventListener(`pointerdown`,t)};function t(t){(t.target instanceof Element?t.target:null)?.closest(`.composer, .mic-btn`)&&(e(),nn())}return window.addEventListener(`focusin`,t),window.addEventListener(`pointerdown`,t,{passive:!0}),e},[]),(0,H.useEffect)(()=>Dr(),[]);let[gn,vn]=(0,H.useState)(null),[bn,xn]=(0,H.useState)(null),[Sn,Tn]=(0,H.useState)(null),En=(0,H.useCallback)(e=>{e.length>=4?Tn(e):e.length>0&&vn(e)},[]),[Dn,On]=(0,H.useState)(null);(0,H.useEffect)(()=>{O()&&(g(),On(fr))},[]);let[An,jn]=(0,H.useState)({open:!1,spec:null}),[Mn,Nn]=(0,H.useState)(!1),Pn=(0,H.useRef)(!1);Pn.current=Mn;let[Fn,In]=(0,H.useState)(()=>jf()),[Ln,Rn]=(0,H.useState)(!1),[zn,Bn]=(0,H.useState)(new Set),[Vn,Hn]=(0,H.useState)(null),[Gn,qn]=(0,H.useState)(null),[Jn,Yn]=(0,H.useState)(null),[Zn,Qn]=(0,H.useState)(!1),$n=(0,H.useCallback)((e,t=!1)=>{Yn(e),Qn(e!==null&&t)},[]),er=(0,H.useCallback)(()=>{Yn(null),Qn(!1)},[]),_r=(0,H.useRef)(new Gu).current,yr=(0,H.useMemo)(()=>e.quality===`fast`?null:qt(e),[e]),[jr,Mr]=(0,H.useState)(!1),Nr=(0,H.useRef)(!1);Nr.current=jr;let Lr=(0,H.useRef)([]),[Rr,Br]=(0,H.useState)(0),Vr=(0,H.useRef)(0),Hr=yf(jr,Rr),[W,Ur]=(0,H.useState)(!1),Wr=(0,H.useRef)(!1);Wr.current=W;let Gr=(0,H.useRef)([]),G=lf((0,H.useMemo)(()=>qt(e),[e])),qr=(0,H.useRef)(G);qr.current=G;let K=(0,H.useRef)(null),Xr=(0,H.useRef)(!1),Qr=(0,H.useRef)(`idle`),$r=(0,H.useCallback)(()=>{let e=Gr.current.join(` `).trim();e&&qr.current.phase===`listening`&&qr.current.onSpeechEnd(e)},[]),ei=_n(),[ti,ni]=(0,H.useState)(!1),[ri,ii]=(0,H.useState)(()=>{try{return localStorage.getItem(Np)===`true`}catch{return!1}});(0,H.useEffect)(()=>{try{localStorage.setItem(Np,String(ri))}catch{}},[ri]);let[ai,oi]=(0,H.useState)(!1),[si,ci]=(0,H.useState)(!1),[li,ui]=(0,H.useState)(!1),[di,fi]=(0,H.useState)(),[pi,mi]=(0,H.useState)(!1);(0,H.useEffect)(()=>{li||mi(!1)},[li]);let{open:hi,openPalette:gi,closePalette:_i}=M(),[vi,yi]=(0,H.useState)(!1),[bi,xi]=(0,H.useState)(0),[Si,Ci]=(0,H.useState)(0),[q,Ti]=(0,H.useState)(!1),[J,Ei]=(0,H.useState)(()=>{try{return localStorage.getItem(Ma)===`true`}catch{return!1}}),[Di,Oi]=(0,H.useState)(!1),ki=(0,H.useRef)(null),[Ai,ji]=(0,H.useState)(()=>{try{return localStorage.getItem(Ip)===`true`}catch{return!1}}),Mi=J?`always`:Ai?`hold`:`tap`;(0,H.useEffect)(()=>{try{let e=ke(localStorage.getItem(`mavea-voice-mavea`)||`heart`);e&&Ne(`mavea`,e.kokoro)}catch{}},[]),(0,H.useEffect)(()=>{if(typeof window>`u`)return;let e,t=t=>{let n=t.detail?.changed;Array.isArray(n)&&n.length>0&&(ci(!0),e&&clearTimeout(e),e=setTimeout(()=>ci(!1),2600))};return window.addEventListener(kn,t),()=>{window.removeEventListener(kn,t),e&&clearTimeout(e)}},[]);let Pi=(0,H.useCallback)(e=>{try{localStorage.setItem(Ma,String(e))}catch{}},[]);(0,H.useEffect)(()=>{let e=ki.current;Pi(e?e.enabled:J)},[J,Pi]),(0,H.useEffect)(()=>{try{localStorage.setItem(Ip,String(Ai))}catch{}},[Ai]);let Fi=(0,H.useRef)(null),Li=(0,H.useRef)(He);Li.current=He;let Ri=(0,H.useRef)(null),[zi,Bi]=(0,H.useState)(null),[Vi,Hi]=(0,H.useState)(!1),Ui=(0,H.useRef)([]),Wi=(0,H.useRef)(()=>{}),Gi=(0,H.useCallback)(e=>{Li.current||Fi.current?.setMaveaSpeaking(!0);let t=!Te(),n=be(e,`mavea`);return t&&(Ri.current=n),n},[]);(0,H.useEffect)(()=>{Ee(He),He?Fi.current?.setMaveaSpeaking(!1):Te()&&Fi.current?.setMaveaSpeaking(!0)},[He]);let[Ki]=(0,H.useState)(()=>r.current||i.current?(Ct(),null):s.current||m.current?null:St()),qi=(0,H.useRef)(wt()).current,Y=as({canRun:k,getConfig:()=>qt(Jt()),getCaps:()=>Kt(Jt()),speak:Gi,cancelSpeak:Le,getLibraryEnabled:()=>Jt().libraryEnabled,initial:Ki?is(Ki):void 0}),Ji=Nd(V,Ae,yr,Y.busy),Yi=(0,H.useCallback)(()=>{window.location.hash=`#/live`,window.location.reload()},[]),Xi=(0,H.useCallback)(()=>{L(),window.location.hash=`#/live`,window.location.reload()},[]),Zi=(0,H.useRef)(`normal`);Zi.current=Y.phase;let $i=(0,H.useRef)(null);$i.current=Y.activeBlank;let ea=(0,H.useRef)([]);ea.current=Y.spec?.blanks??[],(0,H.useEffect)(()=>{$t()},[]),(0,H.useEffect)(()=>{s.current||m.current||Y.frames.length>0&&bt(Y.history,Y.frames)},[Y.frames,Y.history]),(0,H.useEffect)(()=>{if(!(Y.frames.length===0||Y.busy))return o(dm.preload)},[Y.frames.length,Y.busy]),(0,H.useEffect)(()=>{if(!s.current)return;let e=p.current&&f.current===`prism`;if(!(p.current&&!e))return o(()=>Promise.all([Am.preload(),ia()]).then(()=>void 0),e?300:2500)},[]);let na=(0,H.useMemo)(()=>Y.frames.map((e,t)=>({index:t,label:e.question||`Answer ${t+1}`,spec:e.spec})),[Y.frames]),ra=(0,H.useCallback)(e=>{if(e.length){if(!tr().styleAsked&&sr().length===e.length){Vt({count:e.length,deck:e[0].deck}),Ht.current&&clearTimeout(Ht.current),Ht.current=setTimeout(()=>{nr(),Vt(null)},12e3);return}Rt({count:e.length,ids:e.map(e=>e.id)}),zt.current&&clearTimeout(zt.current),zt.current=setTimeout(()=>Rt(null),6e3)}},[]),aa=(0,H.useCallback)(e=>{Ht.current&&clearTimeout(Ht.current),e?rr(e):nr(),Vt(null)},[]);(0,H.useEffect)(()=>()=>{zt.current&&clearTimeout(zt.current),Ht.current&&clearTimeout(Ht.current)},[]),(0,H.useEffect)(()=>{if(!e.autoSaveFlashcards)return;let t=Y.frames[Y.frames.length-1];if(!t)return;let n=Zl(t.spec.blocks);if(n.length>0){let e=ar(n,{deck:t.spec.topic||t.spec.title||`General`,origin:`auto`});ra(e)}},[Y.frames,e.autoSaveFlashcards,ra]);let oa=(0,H.useCallback)(t=>{let n=Y.viewSpec??Y.spec,r=n?.topic||n?.title||`General`,{cards:i,exact:a}=cu(t),o={ts:Date.now(),...t.id?{blockId:t.id}:{},...Fe?{question:Fe}:{},...n?.topic?{topic:n.topic}:{}},s=qt(e),c=!!s.apiKey;It({block:t,initial:i,deck:r,source:o,enrich:!a&&c?()=>fu(t,s):void 0})},[Y.viewSpec,Y.spec,Fe,e]),ca=(0,H.useRef)(null),la=(0,H.useRef)(null),ua=(0,H.useRef)(()=>{}),da=(0,H.useRef)([]),fa=(0,H.useRef)(()=>{}),pa=(0,H.useRef)(()=>{});fa.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;da.current.forEach(e=>window.clearTimeout(e)),da.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++)da.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,H.useEffect)(()=>{let e=da.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]);let ma=(0,H.useRef)(()=>{}),ha=(0,H.useRef)(null),ga=(0,H.useRef)(null),_a=(0,H.useRef)(null),va=x(),ya=(0,H.useRef)(!1),ba=(0,H.useRef)(null),xa=(0,H.useRef)(!1),Sa=(0,H.useRef)(null),[Ca,wa]=(0,H.useState)(!1),[Ta,Ea]=(0,H.useState)(!1),Da=(0,H.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,H.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,H.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,Pa]=(0,H.useState)([]),[Fa,Ia]=(0,H.useState)(()=>new Set),La=(0,H.useCallback)(e=>{Ia(t=>t.has(e)?t:new Set(t).add(e))},[]),Ra=(0,H.useMemo)(()=>Aa.filter(e=>e.noteText!==void 0||Fa.has(e)),[Aa,Fa]),Va=(0,H.useRef)(Date.now());(0,H.useEffect)(()=>{Pa([]),Ia(new Set),Va.current=Date.now()},[Y.turn]);let[Ha,Ua]=(0,H.useState)(!1);(0,H.useEffect)(()=>Ua(!1),[Y.turn]);let[Wa,Ga]=(0,H.useState)(()=>new Set);(0,H.useEffect)(()=>Ga(new Set),[Y.turn]);let Ka=(0,H.useRef)(!1);(0,H.useEffect)(()=>{let e=!!Y.error;e&&!Ka.current&&ca.current?.scrollTo({top:0,behavior:`smooth`}),Ka.current=e},[Y.error]);let[qa,Ja]=(0,H.useState)(!1);(0,H.useEffect)(()=>{let e=ca.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>Ja(e.clientWidth>=1280),n=new ResizeObserver(t);return n.observe(e),t(),()=>n.disconnect()},[Y.turn]);let Ya=(0,H.useMemo)(()=>Aa.filter(e=>e.noteText&&!Wa.has(e.spot)).map(e=>({spot:e.spot,text:e.noteText})),[Aa,Wa]),{bookmarks:Xa,toggleBookmark:Za}=Dp(),eo=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!Ha)return;function e(e){eo.current&&!eo.current.contains(e.target)&&Ua(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[Ha]);let to=(0,H.useRef)(Y.spec);to.current=Y.spec;let ro=(0,H.useCallback)((e,t,n,r,i,a,o,s)=>{e&&Pa(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?to.current?.blocks.find(t=>t.id===e)??null:null,u=n?.kind===`connect`&&typeof n.onIndex==`number`?to.current?.blocks[n.onIndex]?.id:void 0,d={spot:e,line:t??(l?oe(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]})},[]),ao=e.teachMode||Vc(Fe),oo=(0,H.useRef)(e.annotationsEnabled);oo.current=e.annotationsEnabled;let co=(0,H.useRef)(J);co.current=J;let lo=(0,H.useRef)(null);lo.current=Y.narration??null;let uo=(0,H.useRef)(!1),fo=(0,H.useRef)(!1);fo.current=Y.busy;let po=(0,H.useRef)(null),mo=(0,H.useRef)(Y.frames);mo.current=Y.frames;let ho=(0,H.useRef)([]),go=(0,H.useCallback)(()=>{let e=!oo.current;po.current=null,Yt({annotationsEnabled:e,teachMode:e}),e?(Pa(ho.current),ho.current=[]):Pa(e=>(ho.current=e,[]))},[]),_o=(0,H.useRef)(null),vo=(0,H.useCallback)((e,t)=>{let n=la.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=ca.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`)),_o.current!=null&&window.clearTimeout(_o.current),_o.current=window.setTimeout(()=>{o.forEach(e=>e.classList.remove(`ink-jump-glow`)),_o.current=null},800)},[]);(0,H.useEffect)(()=>()=>{_o.current!=null&&window.clearTimeout(_o.current)},[]);let yo=(0,H.useRef)(null),bo=(0,H.useCallback)((e,t)=>{Y.jumpTo(e),t&&(yo.current!=null&&cancelAnimationFrame(yo.current),yo.current=requestAnimationFrame(()=>{yo.current=null,vo(t)}))},[Y,vo]);(0,H.useEffect)(()=>()=>{yo.current!=null&&cancelAnimationFrame(yo.current)},[]);let xo=(0,H.useCallback)(e=>{Ga(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[So,Co]=Jr(),[wo,To]=(0,H.useState)(0),Eo=(0,H.useRef)(So);Eo.current!==So&&(Eo.current=So,To(e=>e+1));let Do=(0,H.useCallback)(()=>{let e=po.current;e&&(po.current=null,oo.current=e.annotationsEnabled,Yt(e))},[]),Oo=(0,H.useCallback)(()=>{if(oo.current)return;let{annotationsEnabled:e,teachMode:t}=Jt();po.current??={annotationsEnabled:e,teachMode:t},oo.current=!0,Yt({annotationsEnabled:!0,teachMode:!0})},[]),ko={isBusy:()=>Y.busy||xa.current,isSpeaking:()=>Te(),hasCanvas:()=>!!Y.spec,showFrame:(e,t,n)=>{ze(t),y(``),Y.showFrame(e,t,{interrupt:!1,revealNow:Li.current,silent:n?.silent})},typeInto:y,speak:e=>(Uc(e),Gi(e)),cancelSpeech:Le,setMuted:Ue,setViewMode:Co,setInkArmed:he,setPresenting:Nn,setShareOpen:Ke,setPaletteOpen:e=>e?gi():_i(),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=to.current?.blocks.find(e=>!!e.id);e&&Cs(e)},pinFirstBlocks:e=>{let t=(to.current?.blocks??[]).filter(e=>!!e.id).slice(0,e);ue(t)},startWatchThinking:()=>{Ur(!0),Wr.current=!0},bankThought:e=>{Gr.current=[...Gr.current,e],G.onTranscript(Gr.current.join(` `))},openAtlas:()=>{if(dr().length<3){for(let e of[`money`,`space`,`travel`,`budget`]){let t=Zr(e),n=t?.frames[0]?.spec;t&&n&&dn(n,t.question)}mn(ur(fn()))}cn(!0)},openPrism:e=>{ia().then(t=>{No.current.chapter?.action.kind===`prism`&&xn(t[e]??null)})},showcaseFeature:e=>{if(e===`library`&&fn().length<3)for(let e of[`money`,`space`,`travel`]){let t=Zr(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`&&Ui.current.length===0){a(async()=>{let{WORLD_SEED:e}=await import(`./seed-D_P5jyog.js`);return{WORLD_SEED:e}},[]).then(({WORLD_SEED:e})=>{Bi({type:`world`,id:`tour-world`,col:12,props:{title:e.title,world:e}}),Hi(!0),Wi.current(`tour-world`)});return}Ao.current[e]?.run()},setSpot:e=>Y.setSpot(e),scriptedMark:()=>ua.current(),drawPenTourStep:e=>{Oo(),e===`result`?(ca.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&&(Oo(),ca.current?.scrollTo({top:0,behavior:`smooth`}),ro(e.id,e.note,void 0,!0,void 0,3200))},openDashboards:()=>{let e=sa();e?ft(e):ut(!0)},dashboardShowSettings:()=>mt(!0),openModelSettings:()=>{fi(`model`),ui(!0)},openExport:()=>Ze(!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:()=>ii(e=>!e),bendIt:()=>fa.current(),openFlashcards:()=>{let e=Y.spec?.blocks.find(e=>!!e.id);e&&oa(e)},openTourCourse:()=>pa.current(),fireMemoryGlow:()=>{ci(!0),window.setTimeout(()=>ci(!1),2600)},stopRevealWalk:()=>{ya.current=!0},closeAllOverlays:()=>{Y.setSpot(null),ue([]),y(``),Co(`everything`),he(!1),ma.current(),Pa([]),Ia(new Set),Ga(new Set),Ua(!1),Nn(!1),Ke(!1),_i(),On(null),cn(!1),vn(null),xn(null),Tn(null),It(null),on(!1),Ze(!1),ut(!1),ft(null),mt(!1),ii(!1),Zt(!1),tn(!1),ui(!1),Ur(!1),Mr(!1),cs(null),ds(0),ps(null)}},Ao=(0,H.useRef)({}),jo=wi({active:s.current,startChapter:f.current,solo:p.current,ops:ko}),Mo=Qi({active:!!m.current,personaId:m.current,startStep:_.current,ops:ko}),No=(0,H.useRef)(jo);No.current=jo,(0,H.useEffect)(()=>{if(!s.current)return;let e=e=>{let t=No.current;if(e.key===`Escape`)t.skip();else if(Bp(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,H.useRef)(Mo);Po.current=Mo,(0,H.useEffect)(()=>{if(!m.current)return;let e=e=>{let t=Po.current;if(e.key===`Escape`)t.skip();else if(Bp(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,H.useEffect)(()=>{(jo.done||Mo.done)&&Do()},[jo.done,Mo.done,Do]),(0,H.useEffect)(()=>()=>Do(),[Do]);let{narrate:Fo,narratingId:Io}=zr({takeWheel:()=>{ya.current=!0},hush:Le,moveSpot:e=>{Y.setSpot(e.id??null),oo.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:()=>!Li.current,lineFor:e=>e.noteSpoken??e.note??(e.id?Da.get(e.id):void 0)??se(e),speakLine:Gi},Y.turn),[Lo,Ro]=(0,H.useState)(!1),[zo,Bo]=(0,H.useState)(!!Ki||!!r.current&&ls()||!!i.current&&ls()||s.current||!!m.current),Vo=yn();(0,H.useEffect)(()=>{mn(ur(Vo))},[Vo]),(0,H.useEffect)(()=>{let e=Y.spec;if(!e||ba.current===Y.turn)return;if(ba.current=Y.turn,Ki&&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=ot(e.blocks,{opener:Y.narration,tour:t,maxStops:5}):at({blockCount:e.blocks.length,mode:Y.mode,hasModelTour:!1,teach:ao})&&(n=ot(e.blocks,{opener:Y.narration,maxStops:ao?e.blocks.length:3,startId:Y.spot??void 0})),!n.length){Y.spot&&Y.setSpot(null);return}let r=t.length>0,i=Li.current&&r&&oo.current;wa(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(Li.current){if(oo.current){let e=io({stops:a,spokenWalk:r,withNotes:i,teach:ao,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}ya.current=!1,xa.current=!0;let o=!1,c,l,u=0,d=null,f=()=>{d&&=(d(),null)},p=()=>{xa.current=!1,Sa.current=null,l&&clearTimeout(l),Ea(!1),Uc(null)},m=()=>o?!0:ya.current?(p(),Y.setSpot(null),!0):!1,h=(e,t)=>{if(e!==void 0&&Y.setSpot(e??null),r&&t&&Uc(t),e&&oo.current){let n=ka.get(e);if(n?.length){let r=st+(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],ao,o,s,i?a+1:void 0)}}else ao&&ro(e,t,void 0,ao)}},g=e=>{let t=e&&!Li.current&&!ce()?ye(e):null;if(!t){b();return}d=t.release,so(t,{speakLine:Gi,isCancelled:()=>o,isDismissed:()=>ya.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){Se(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 Xe({floorMs:rt,capMs:nt(a)}),m())return;g(n);return}let o=Gi(i),s=await it(o);m()||(h(n,r),v(t),s?await Qe(o,a):await et(a),!m()&&g(n))},b=()=>{if(o||u>=n.length){p();return}if(ya.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 Sa.current=()=>{if(o=!0,c&&clearTimeout(c),f(),Le(),oo.current){let e=io({stops:a,from:u,spokenWalk:r,withNotes:!1,teach:ao,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=ca.current;await Ye({loadFams:()=>ie(ae(e.blocks)),settle:t?()=>ht(t,{timeoutMs:tt,perImageMs:$e}):void 0,firstLine:Ri.current,wantVoice:!Li.current&&Pe()!==!1}),l&&clearTimeout(l),Ea(!1),!m()&&b()})(),()=>{o=!0,Sa.current=null,xa.current=!1,c&&clearTimeout(c),l&&clearTimeout(l),Ea(!1),f()}},[Y.turn]),(0,H.useEffect)(()=>{let e=Y.spot,t=Y.spec;if(!t||!e)return;let n=0,r=0,i=()=>{let a=ca.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 Ho=(0,H.useCallback)(()=>{Y.spot&&(ya.current=!0,Y.setSpot(null))},[Y]),Uo=(0,H.useCallback)(()=>{let e=Sa.current;e?e():(Le(),Ho())},[Ho]),[Wo,Go]=(0,H.useState)(!1),[Ko,qo]=(0,H.useState)(!1),Jo=(0,H.useCallback)(async(...e)=>{(0,Ar.flushSync)(()=>Go(!0)),qo(!0);try{await ie(ae(e[0].blocks))}catch{}finally{qo(!1)}Y.restore(...e)},[Y]);(0,H.useEffect)(()=>{Y.busy&&Go(!0)},[Y.busy]),(0,H.useEffect)(()=>{Go(!1)},[Y.turn]),(0,H.useEffect)(()=>{if(!Y.spot)return;let e=e=>{e.key===`Escape`&&Uo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Y.spot,Uo]);let[Yo,Xo]=(0,H.useState)(null);(0,H.useEffect)(()=>Xo(null),[Y.turn]),(0,H.useEffect)(()=>yi(!1),[Y.turn]),(0,H.useEffect)(()=>ue([]),[Y.turn]),(0,H.useEffect)(()=>ni(!1),[Y.turn]);let[Zo,Qo]=(0,H.useState)(null),$o=(0,H.useRef)(!1),es=(0,H.useCallback)(e=>{$o.current=!0,Qo(e)},[]);(0,H.useEffect)(()=>{if($o.current){$o.current=!1;return}Qo(null)},[Y.turn]);let ts=(()=>{let e=Y.spec?.blocks.find(e=>e.type===`insight`);return e&&e.type===`insight`?e.props.conf:void 0})(),ns=Sl({resetKey:Y.turn,onCommit:e=>{let{intents:t,blocks:n}=Dl(e,(Y.viewSpec??Y.spec)?.blocks??[]);if(!t.length)return;let r=El([...le,...n]);ue([]),Y.run(Tl(t),void 0,r.length?r:void 0,void 0,t)}});ua.current=()=>{let e=la.current,t=e?.querySelector(`[data-spot-id]`);!e||!t||(t.scrollIntoView({block:`center`,behavior:`smooth`}),window.setTimeout(()=>rs(e,t),560))};let rs=(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??``)).map(e=>({el:e,size:parseFloat(getComputedStyle(e).fontSize)})).sort((e,t)=>t.size-e.size)[0]?.el??t).getBoundingClientRect(),i=n.getBoundingClientRect(),a=bp(r,i);ns.onStroke(a,{stage:e,svgRect:i});let o=t.getAttribute(`data-spot-id`);o&&Y.setSpot(o)};ma.current=()=>ns.clear();let os=(0,H.useCallback)((t,n=!1)=>{let r=t.trim();if(Wr.current&&r){y(``),K.current!==null&&(window.clearTimeout(K.current),K.current=null),Gr.current=[...Gr.current,r],G.onTranscript(Gr.current.join(` `));return}if(r&&(/^diff --git /m.test(r)||/^@@ .* @@/m.test(r))){let t=pr(mr(r));if(t.changes.length>0){y(``),On(t);let n=qt(e);n&&hr(t,r,n).then(e=>On(t=>t&&e));return}}if(!r&&A.length===0&&ns.intents.length===0)return;Me(null),ze(r||null),y(``);let i=A;ne(i.length>0),P([]),ee(null);let a=Y.viewSpec??Y.spec,{intents:o,blocks:s}=Dl(ns.intents,a?.blocks??[]),c=El([...le,...s]);ue([]),ns.clear(),Y.run(r||Tl(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,A,le,ns,G,e,Me,P,ee,ne]);(0,H.useEffect)(()=>{if(r.current&&ls()){let e=r.current;r.current=``,os(e)}},[]);let[ss,cs]=(0,H.useState)(null),[us,ds]=(0,H.useState)(0),[fs,ps]=(0,H.useState)(null),ms=(0,H.useRef)(null),hs=(0,H.useCallback)((e,t)=>{let n=e.lessons[t];if(!n)return;let r=br(e.id);cs(e),ds(t),ps(r),vr(e.id,t),Bo(!0);let i=`Lesson ${t+1}: ${n.title}`,a=gr(e.id,n.id);if(a){ze(i),Y.showFrame(a,i);return}let o=Er(e,t,r,Or(e.topic));ms.current={courseId:e.id,lessonId:n.id,framesBefore:Y.frames.length},ze(i),Y.run(`Teach this lesson: "${n.title}" — ${n.goal}`,void 0,void 0,void 0,void 0,i,void 0,{lesson:o})},[Y]);pa.current=()=>{let e=gu();if(!e)return;let t=e.lessons[0];cs(e),ds(0),ps(br(e.id)),vr(e.id,0),Bo(!0);let n=gr(e.id,t.id);if(n){let e=`Lesson 1: ${t.title}`;ze(e),Y.showFrame({...n,narration:``,tour:[]},e,{interrupt:!1})}},(0,H.useEffect)(()=>{let e=i.current;if(!e||(i.current=void 0,!ls()))return;let t=xr(e.courseId);if(!t)return;let n=Math.min(Math.max(e.lessonIdx,0),t.lessons.length-1);hs(t,n)},[]),(0,H.useEffect)(()=>{let e=ms.current;!e||Y.busy||(ms.current=null,!(Y.frames.length<=e.framesBefore)&&Cr(e.courseId,e.lessonId,Y.frames[Y.frames.length-1]))},[Y.frames,Y.busy]);let gs=(0,H.useCallback)(e=>{if(!ss)return;let t=ss.lessons[us];t&&(Sr(ss.id,t.id,e),ps(br(ss.id)))},[ss,us]);(0,H.useEffect)(()=>{if(typeof window>`u`||!ss)return;let e=()=>ps(br(ss.id));return window.addEventListener(wr,e),()=>window.removeEventListener(wr,e)},[ss]);let[_s,vs]=(0,H.useState)(null);(0,H.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{let t=e.detail;t?.missedCards.length&&vs(t)};return window.addEventListener(kr,e),()=>window.removeEventListener(kr,e)},[]);let ys=(0,H.useCallback)(e=>{let t=e.missedCards.flatMap(t=>ar([t],{deck:e.courseTitle,tags:[e.lessonTitle,`checkpoint`],source:{question:t.front,topic:e.topic,ts:e.at},origin:`auto`}));vs(null),ra(t)},[ra]),bs=(0,H.useMemo)(()=>new Set(le.map(e=>e.id)),[le]),xs=(0,H.useCallback)((e,t)=>{ze(`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]),Ss=(0,H.useCallback)(e=>{let t=e.map(oe),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.`;ze(`Fuse: ${t.join(` × `)}`),ue([]),Y.run(n,void 0,e,void 0,void 0,`Fuse: ${t.join(` × `)}`)},[Y]),Cs=(0,H.useCallback)(e=>{e.id&&(ue(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e]),xi(e=>e+1),_e())},[_e]),ws=le.length>1?[`How do these relate?`,`Compare them`,`Summarize these`]:[`Explain this`,`Why it matters`,`Go deeper`],Ts=Wt(e.provider).capabilities.vision;(0,H.useEffect)(()=>{let e=e=>{if(Df(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(),re(n),y(Ef),xi(e=>e+1);return}let r=t.getData(`text/plain`);r&&wf(r)&&(e.preventDefault(),y(Tf(Cf(r))),xi(e=>e+1))},t=null,n=e=>{e.dataTransfer?.types.some(e=>e===`Files`||e===`text/uri-list`)&&(e.preventDefault(),Ti(!0),t&&clearTimeout(t),t=setTimeout(()=>Ti(!1),200))},r=e=>{Ti(!1);let t=e.dataTransfer;if(!t)return;if(Df(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:Cf(t.getData(`text/uri-list`)||t.getData(`text/plain`)||``);!n.length&&!a||(e.preventDefault(),r.length?(re(r),y(Ef)):i.length?re(i):a&&y(Tf(a)),xi(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)}},[re]);let Es=(0,H.useRef)(So);Es.current=So,(0,H.useEffect)(()=>{if(!Mn)return;let e=Es.current;Co(`focus`),document.documentElement.requestFullscreen?.().catch(()=>{});let t=e=>{e.key===`Escape`&&Nn(!1)};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t),Co(e),document.fullscreenElement&&document.exitFullscreen().catch(()=>{})}},[Mn,Co]);let Ds=(0,H.useRef)(0);(0,H.useEffect)(()=>{let e=Y.frames.length;if(e>Ds.current&&Pn.current){let t=e-1;Bn(e=>new Set(e).add(t))}Ds.current=e},[Y.frames.length]);let X=ja({mode:`vad`,onBargeIn:()=>{Uo(),uo.current=!0},onResult:e=>{let t=e.transcript.trim(),n=uo.current;if(e.lowConfidence&&t){uo.current=!1,Me(null),y(t),Ve(Lp),xi(e=>e+1),Xr.current&&Wr.current&&(Xr.current=!1,Fi.current?.stop(),Gr.current.length>0?$r():(Wr.current=!1,Ur(!1)));return}if(uo.current){uo.current=!1;let e=lo.current;if(!t||Pm(t)){e&&Gi(e);return}}if(t){if(Me(t),Wr.current){Gr.current=[...Gr.current,t],Me(null);let e=Gr.current.join(` `);G.onTranscript(e),Xr.current&&(Xr.current=!1,$r());return}if(Nr.current){if(Me(null),vf(t)){Mr(!1);let e=Lr.current;if(Lr.current=[],Br(0),e.length){let t=Math.round((Date.now()-Vr.current)/6e4);ze(`Your thinking, sorted`),Y.run(xf(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}}else bf(t)&&(Lr.current=[...Lr.current,t],Br(e=>e+1));return}if(Pr({phase:Zi.current,activeKey:$i.current,blanks:ea.current,fill:Y.fill},t)){Me(null);return}os(t,n||fo.current)}},onStateChange:e=>{if(Qr.current=e.phase,Ce(e.phase),ve(e.phase===`listening`),e.phase===`listening`?e.speechEnding!==void 0&&De(e.speechEnding):De(!1),e.phase===`idle`&&(uo.current=!1),e.phase===`listening`)Ve(null),K.current!==null&&(window.clearTimeout(K.current),K.current=null);else if(e.phase===`idle`&&Wr.current&&qr.current.phase===`listening`){if(Xr.current){Xr.current=!1,$r();return}K.current!==null&&window.clearTimeout(K.current),K.current=window.setTimeout(()=>{K.current=null,Fi.current?.stop(),$r()},Rp)}e.error===`not-allowed`?Ve(Sp):e.error===`unsupported`?Ve(xp):e.error===`audio`?Ve(Cp):e.error===`transcription`&&Ve(wp)}}),Z=X.capabilities.stt;Fi.current=X;let Os=(0,H.useCallback)(()=>{if(Wr.current){if(K.current!==null&&(window.clearTimeout(K.current),K.current=null),V||Qr.current===`transcribing`){Xr.current=!0,V&&X.start({inCanvas:!!Y.spec,continuous:!1}),X.forceStop();return}if(X.stop(),Gr.current.length===0){Wr.current=!1,Ur(!1);return}$r()}},[V,$r,X,Y.spec]),ks=(0,H.useCallback)(()=>{V&&X.stop(),K.current!==null&&(window.clearTimeout(K.current),K.current=null),Me(null),Xr.current=!1,Ur(!1)},[V,X]),As=Mn||yp({paletteOpen:hi,shareOpen:We,exportOpen:Je,dashOpen:ct,showSettings:li,proofOpen:vi,showHow:Lo,replayAt:Yo,recapOpen:en,atlasOpen:sn,delegateOpen:an,srsOpen:Xt,zoomLevel:Vn,mindViewOpen:An.open});(0,H.useEffect)(()=>{if(!W||G.phase===`idle`||As)return;let e=e=>{e.key===`Escape`&&ks()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[W,G.phase,As,ks]),(0,H.useEffect)(()=>{let e=document.documentElement;return ei?e.dataset.whisper=``:delete e.dataset.whisper,Re(ei?Cn:1),()=>{delete e.dataset.whisper,Re(1)}},[ei]),(0,H.useEffect)(()=>{jr?Vr.current=Date.now():(Lr.current=[],Br(0))},[jr]),(0,H.useEffect)(()=>{if(W&&V&&Ae){let e=hd(Ae),t=Gr.current.length>0?[...Gr.current,e].join(` `).trim():e;t&&G.onTranscript(t)}},[Ae,V,W]),(0,H.useEffect)(()=>{W||(Gr.current=[],G.reset(),K.current!==null&&(window.clearTimeout(K.current),K.current=null))},[W]),(0,H.useEffect)(()=>()=>{K.current!==null&&window.clearTimeout(K.current)},[]),(0,H.useEffect)(()=>{let e=()=>X.setMaveaSpeaking(Te()&&!Li.current);return e(),je(e)},[X]);let js=v.trim().length>0;(0,H.useEffect)(()=>{if(!Fr({alwaysOn:J&&!Di,sttOk:Z,composerHasText:js}))return;let e=!1,t=setTimeout(()=>{e||X.start({inCanvas:!!Y.spec,continuous:!0})},100);return()=>{e=!0,clearTimeout(t),X.stop()}},[J,Di,Z,X,js]),Ir({alwaysOn:J&&!Di,sttOk:Z,composerHasText:js,listening:V},{start:()=>X.start({inCanvas:!!Y.spec,continuous:!0}),stop:X.stop});let Ms=(0,H.useCallback)(()=>{if(!Z){Ve(xp),xi(e=>e+1);return}J?V?X.forceStop():Di?(Oi(!1),Uo(),X.start({inCanvas:!!Y.spec,continuous:!0})):Qr.current===`transcribing`?(Oi(!0),X.forceStop()):(Oi(!0),X.stop()):V?X.forceStop():(Uo(),X.start({inCanvas:!!Y.spec}))},[Z,J,Di,V,X,Y.spec,Uo]),[Ns,Ps]=(0,H.useState)(!1),Fs=(0,H.useRef)(null);(0,H.useEffect)(()=>{let e=()=>{Fs.current!==null&&(window.clearTimeout(Fs.current),Fs.current=null)};if(Y.status===`thinking`){Ps(!0),e();return}if(Y.status===`idle`){Ps(!1),e();return}if(Ns&&Y.spec){Ps(!1),e();return}Ns&&Fs.current===null&&(Fs.current=window.setTimeout(()=>{Ps(!1),Fs.current=null},1100))},[Y.status,Y.spec,Ns]),(0,H.useEffect)(()=>()=>{Fs.current!==null&&window.clearTimeout(Fs.current)},[]);let Is=Qa({speak:Gi,cancelSpeak:Le,isSpeaking:Te,muted:He,turnCount:Y.frames.length,gates:{atRest:Y.status===`showing`||Y.status===`idle`,busy:Y.busy,listening:V,introHold:Ns,hasCanvas:!!Y.spec,modalOpen:hi||We||Je||ct||li||vi||Lo||Yo!==null||en||an||Xt||sn||gn!==null||Sn!==null||An.open||Vn!==null}}),Ls=Is.interjecting,Rs=(0,H.useRef)(null),zs=(0,H.useMemo)(()=>{let e=za(Y.spec);return e===`warm`&&Ba(Y.spec)&&(Rs.current===null||Rs.current===Y.spec)&&(Rs.current=Y.spec,e=`celebrate`),Na(Y.status,V,Ls,e,He,Oe)},[Y.status,V,Ls,Y.spec,He,Oe]),Bs=(0,H.useMemo)(()=>Xs({status:Y.status,listening:V,interjecting:Ls,spec:Y.viewSpec??Y.spec}),[Y.status,V,Ls,Y.viewSpec,Y.spec]);(0,H.useEffect)(()=>(Gs(document,Bs),()=>Ks(document)),[Bs]);let Vs=(0,H.useCallback)(()=>{let e=ha.current,t=ga.current,n=_a.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,H.useLayoutEffect)(()=>(Vs(),window.addEventListener(`resize`,Vs),()=>window.removeEventListener(`resize`,Vs)),[Vs]),(0,H.useLayoutEffect)(()=>{Vs()},[ri,Vs]);let Hs=!!Y.spec&&!(Ns||Ls),qs=zo,Js=zo&&(!Y.spec||Ns||Ls),Ys=!Y.spec&&!zo;(0,H.useEffect)(()=>{if(!e.morningBrief||Ut||Ys||Y.busy||Y.restored||!Bl(wt()))return;Vl(),Gt(!0);let t=Y.frames.slice(-3).map(e=>e.question).filter(Boolean);Y.run(Hl(t),void 0,void 0,void 0,void 0,`Morning brief`)},[e.morningBrief,Ys,Ut,Y.busy,Y.restored]),(0,H.useEffect)(()=>{Hs&&ha.current&&(ha.current.style.setProperty(`--scroll-dock`,`0`),Vs())},[Hs,Vs]);let Zs=Ls?Is.line:Y.narration,$s=!Hs&&!!Zs&&(Ls||Y.status===`speaking`||Y.status===`showing`),ec=Js&&Y.status===`speaking`,tc=(0,H.useRef)(new Map),[nc,rc]=(0,H.useState)(0);(0,H.useEffect)(()=>{let e=tc.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 rn(`${t.question} ${t.narration} ${t.spec?.title??``}`.trim());if(i)return;r&&(e.set(t.at,r),n=!0)}n&&rc(e=>e+1)})(),()=>{i=!0}},[Y.frames]);let ic=(0,H.useMemo)(()=>Dt(Y.frames,Y.frames.map(e=>tc.current.get(e.at)??null)),[Y.frames,nc]),ac=Y.frames.length-1,oc=Y.viewIndex??ac,sc=Y.viewOverride!=null,cc=!sc&&(Y.viewIndex==null||Y.viewIndex===ac),uc=Y.viewOverride?ic.find(e=>Y.viewOverride?.id===`thread-`+e.id):void 0,dc=ic.find(e=>e.moments.some(e=>e.frameIndex===oc)),pc=ic.length>=2?dc?.color:void 0,hc=Y.frames[ac],_c=ic[ic.length-1],vc=ic.length>=2&&_c?.moments.length===1&&_c.moments[0].frameIndex===ac,yc=cc&&!Y.busy&&vc&&hc?.mode===`replace`&&!!hc&&tc.current.has(hc.at),[xc,Sc]=(0,H.useState)(null),Cc=(0,H.useRef)(-1);(0,H.useEffect)(()=>{yc&&Cc.current!==ac&&(Cc.current=ac,Sc(ac))},[yc,ac]);let wc=(0,H.useCallback)(e=>{let t=no(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),ca.current?.scrollTo({top:0}))},[Y]),Ec=cc&&le.length===0?(Y.viewSpec??Y.spec)?.suggests??[]:[],Dc=Y.viewSpec??Y.spec,Oc=sc?Dc?{question:null,narration:Dc.title||`This thread`}:null:jc({spec:Dc,frames:Y.frames,viewIndex:Y.viewIndex,narration:Y.narration,lastAsk:Fe}),kc=(0,H.useMemo)(()=>fc(Dc),[Dc]),Pc=Nc(Mc(Y.status)),Fc=(0,H.useMemo)(()=>Y.busy?Y.status===`showing`?[vp(Y.pendingShape)]:_p(Fe??``,Y.history):[],[Y.busy,Y.status,Y.pendingShape,Fe,Y.history]),Ic=Gf(),Lc=ep(),Bc=(0,H.useSyncExternalStore)(ju,Mu,Mu),[Hc,Uc]=(0,H.useState)(null);(0,H.useEffect)(()=>Uc(null),[Y.turn]),(0,H.useEffect)(()=>wa(!1),[Y.turn]);let Wc=up()&&!He;(0,H.useEffect)(()=>{He&&Sa.current?.()},[He]);let[Gc,Kc]=(0,H.useState)(!1);(0,H.useEffect)(()=>Kc(!1),[Y.turn]),(0,H.useEffect)(()=>tn(!1),[Y.turn]);let qc=(0,H.useMemo)(()=>Ff(Y.frames,ic),[Y.frames,ic]),Jc=Un(),Yc=Wn(),Xc=(0,H.useCallback)(e=>{if(s.current){No.current.playExtra(e);return}Y.busy||E(e)},[Y.busy]),Zc=(0,H.useCallback)(e=>{if(!Z){Ve(xp);return}Uo(),ki.current===null&&(ki.current={enabled:J,paused:Di}),Oi(!1),Ei(!0),e===`think`?(Mr(!1),Nr.current=!1,Ur(!0),Wr.current=!0):(Ur(!1),Wr.current=!1,Mr(!0),Nr.current=!0)},[Z,J,Di,Uo]);(0,H.useEffect)(()=>{if(W||jr)return;let e=ki.current;e!==null&&(ki.current=null,Oi(e.paused),Ei(e.enabled),e.enabled&&!e.paused&&Z&&!v.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):X.stop())},[W,jr,Z,v,X,Y.spec]);let[Qc,$c]=(0,H.useState)(null),[el,tl]=(0,H.useState)(!1),[rl,il]=(0,H.useState)(0),al=(0,H.useMemo)(()=>{let e=((Y.viewSpec??Y.spec)?.blocks??[]).filter(e=>e.type===`world`);return e.length>0?e:zi?[zi]:[]},[Y.viewSpec,Y.spec,zi]),ol=(0,H.useMemo)(()=>al.find(e=>e.id===Qc)??al[0],[al,Qc]);Ui.current=al;let sl=ol!==void 0,cl=So===`world`&&sl,ll=(0,H.useCallback)(e=>{e&&$c(e),tl(!1),Co(`world`)},[Co]);Wi.current=ll;let ul=(0,H.useCallback)(()=>Co(Kr()),[Co]);(0,H.useEffect)(()=>me(ll),[ll]),(0,H.useEffect)(()=>{So===`world`&&!sl&&ul()},[So,sl,ul]);let dl=cl?ol.id??null:null,fl=cl&&ol.props.world===void 0,{generateWorld:pl}=Y;(0,H.useEffect)(()=>{if(!dl||!fl)return;let e=!0;return tl(!1),pl(dl).then(t=>{e&&!t&&tl(!0)}),()=>{e=!1}},[dl,fl,rl,pl]);let{expandWorld:ml}=Y,hl=(0,H.useCallback)((e,t)=>dl?ml(dl,e,t):Promise.resolve(null),[dl,ml]),Q={atlas:{available:pn>0,reason:`Fills in as you discuss things`,run:()=>cn(!0),preload:$p.preload},"pdf-world":{available:A.some(Mt),reason:`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map`,run:()=>{let e=A.filter(Mt);if(e.length>0){En(e);return}xi(e=>e+1),Ci(e=>e+1),ee(`Attach a PDF, Office doc, or data file (CSV, text, JSON) to split it into a map of claims.`)},preload:vm.preload},synthesis:{available:!0,run:()=>{let e=A.filter(Mt);e.length>=2?Tn(e):window.location.hash=`#/synthesis`},preload:()=>A.filter(Mt).length>=2?Sm.preload():Nm(`#/synthesis`)},ripple:{available:!0,run:()=>On(fr),preload:tm.preload},review:{available:!0,run:()=>Zt(!0),preload:Om.preload},flashcards:{available:!0,run:()=>{window.location.hash=`#/flashcards`},preload:()=>Nm(`#/flashcards`)},courses:{available:!0,run:()=>{window.location.hash=`#/courses`},preload:()=>Nm(`#/courses`)},dashboards:{available:!0,run:()=>{window.location.hash=`#/dashboards`},preload:()=>Nm(`#/dashboards`)},gallery:{available:!0,run:()=>{window.location.hash=`#/gallery`},preload:()=>Nm(`#/gallery`)},recap:{available:!!qc,reason:`Once we've covered something`,run:()=>tn(!0),preload:om.preload},present:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Nn(!0),preload:wm.preload},track:{available:!!Y.spec,reason:`Once there is a conversation to track`,run:()=>ut(!0),preload:hm.preload},share:{available:Y.frames.length>0,reason:`Once there is something to share`,run:()=>Ke(!0),preload:dm.preload},export:{available:Y.frames.length>0,reason:`Once there is an answer to export`,run:()=>Ze(!0),preload:pm.preload},focus:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Co(`focus`)},board:{available:!!Y.spec,reason:`Once there is an answer`,run:()=>Co(`canvas`)},"living-answer":{available:sl,reason:`Once an answer has causes to trace`,run:()=>ll(),preload:bm.preload},ink:{available:!!Y.spec,reason:`Once there is an answer to mark`,run:()=>he(!0)},blanks:{available:!0,run:()=>Ve(`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:xp,run:()=>Zc(`think`)},"just-listen":{available:Z,reason:Z?void 0:xp,run:()=>Zc(`listen`)},whisper:{available:!0,run:()=>{fi(`you`),mi(!0),ui(!0)},preload:Kp.preload},ghost:{available:Z&&e.quality!==`fast`,reason:Z?e.quality===`fast`?`Needs Balanced quality or higher — you're on Fast`:void 0:xp,run:()=>Zc(`listen`)},delegate:{available:!0,run:()=>on(!0),preload:Em.preload},memory:{available:!0,run:()=>{fi(`you`),ui(!0)},preload:Kp.preload},library:{available:Vo.length>0,reason:`Fills in as you save conversations`,run:()=>oi(!0),preload:cm.preload},deepzoom:{available:!0,run:()=>{let e=Fe??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},preload:()=>Nm(`#/deepzoom`)},"zoom-deck":{available:!!qc,reason:`Opens once there are a few answers to pull back from`,run:()=>Hn(`chapters`),preload:Zp.preload},"morning-brief":{available:!0,run:()=>{fi(`you`),mi(!0),ui(!0)},preload:Kp.preload},settings:{available:!0,run:()=>{fi(void 0),ui(!0)},preload:Kp.preload},how:{available:!0,run:()=>Ro(!0),preload:Vp.preload}};Ao.current=Q;let gl=gt.filter(e=>e.surface!==`demo`).map(e=>{let t=Q[e.id]??{available:!0,run:()=>void 0},n=e.id===`how`?Xi:e.tourChapter?()=>Xc(e.tourChapter):void 0;return{feature:e,available:t.available,reason:t.reason,run:t.run,preload:t.preload,watch:n}}),_l=[{label:`New`,blurb:`Start a fresh session`,onClick:()=>{Y.reset(),Is.reset(),Bo(!1),ne(!1),Ct()},show:!!Y.spec},{label:`Dashboard`,blurb:`Open your living dashboards`,onClick:Q.dashboards.run,preload:Q.dashboards.preload,show:!!Y.spec}],vl=[{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:Jc>0?`${Jc} card${Jc===1?``:`s`} ready`:Yc===`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:!!qc}],yl=[{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}],bl=[{label:`Search all features`,blurb:`Browse Mavéa’s feature index · ${l}`,onClick:gi,preload:Up.preload,show:!0},{label:`Atlas`,blurb:`Kept conversations and topics, as a place`,onClick:Q.atlas.run,preload:Q.atlas.preload,show:pn>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:hn>0?`${hn} dashboard${hn===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:Fe?`Zoom from field to mechanism — "${Fe.slice(0,50)}${Fe.length>50?`…`:``}"`:`Telescope any topic from big picture to finest detail`,onClick:()=>{let e=Fe??``;window.location.hash=e?`#/deepzoom?seed=${encodeURIComponent(e)}`:`#/deepzoom`},show:!0}],xl=(0,H.useCallback)(e=>{e===`out`&&qc&&Hn(`chapters`)},[qc]);cr(ca,xl),(0,H.useEffect)(()=>(Ie(Ru),()=>Ie(null)),[]);let Cl=(0,H.useRef)(!0);(0,H.useEffect)(()=>{Y.busy&&(Pu(),Cl.current=!1,qn(null),er())},[Y.busy,Y.turn,er]),(0,H.useEffect)(()=>(Iu(Yo!==null),()=>Iu(!1)),[Yo]),(0,H.useEffect)(()=>er(),[Y.viewIndex,er]);let wl=Y.spec?.blocks.length??0;(0,H.useEffect)(()=>{wl>0&&Lu(wl)},[wl]),(0,H.useEffect)(()=>{if(Y.busy)return;if(Y.spec){let e=zu();if(e){qn(e);let t=Y.frames.length-1,n=Y.frames[t];n&&_r.set(qe(n),e)}}if(Ic||Cl.current)return;let e=window.setTimeout(()=>{Cl.current=!0,Fu()},zp);return()=>window.clearTimeout(e)},[Ic,Y.busy,Y.spec,Bc,Y.frames,_r]);let Ol=(0,H.useMemo)(()=>cc?Gn:Y.viewIndex!=null&&Y.frames[Y.viewIndex]?_r.get(qe(Y.frames[Y.viewIndex])):null,[cc,Gn,Y.viewIndex,Y.frames,_r]),kl=(0,H.useMemo)(()=>{if(!Zn||Jn===null||!Ol)return null;let e=cc?Y.spec:Y.viewSpec;if(!e)return null;let t=cc?Y.tour:Y.viewIndex==null?[]:Y.frames[Y.viewIndex]?.tour??[],n=Uu(Ol,Jn,t,e.blocks.length);return{...e,blocks:e.blocks.slice(0,n)}},[Zn,Jn,Ol,cc,Y.spec,Y.viewSpec,Y.tour,Y.viewIndex,Y.frames]),Al=Y.error?(0,U.jsxs)(`div`,{className:`live-error`,role:`alert`,children:[(0,U.jsxs)(`div`,{className:`live-error-head`,children:[(0,U.jsx)(z.alert,{}),(0,U.jsx)(`span`,{children:`Couldn’t answer`})]}),(0,U.jsx)(`p`,{className:`live-error-msg`,children:Y.error.message}),(0,U.jsxs)(`div`,{className:`live-error-actions`,children:[(0,U.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,U.jsx)(`button`,{type:`button`,className:`live-error-btn`,onClick:()=>ui(!0),children:`Open settings`})]})]}):null,Nl=W,[Pl,Fl]=(0,H.useState)(160);(0,H.useEffect)(()=>{if(!Nl)return;let e=document.querySelector(`.live-dock`);if(!e)return;let t=()=>Fl(Math.round(e.getBoundingClientRect().height)+8);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[Nl]);let Il=Nl?(0,U.jsxs)(`div`,{className:`ms-stage-fill`,"data-phase":G.phase,style:{"--ms-bottom-reserve":`${Pl}px`},children:[(0,U.jsxs)(`button`,{type:`button`,className:`ms-exit`,onClick:ks,title:`Back to the conversation (Esc)`,children:[(0,U.jsx)(z.chevL,{}),`Back to conversation`]}),(0,U.jsx)(pf,{mindShape:G,onSettled:()=>{Gi(`I think this is the shape of it.`)},onConfirmUnsaid:()=>G.confirmUnsaid(),onDismissUnsaid:()=>G.dismissUnsaid(),onAction:(e,t)=>{if(e===`add-more`)Me(null),G.resume(),!V&&Z&&X.start({inCanvas:!!Y.spec,continuous:J&&!Di});else if(e===`not-quite`)Gr.current=[],G.resume(!1),Me(null),!V&&Z&&X.start({inCanvas:!!Y.spec,continuous:J&&!Di});else if(e===`share`)Ke(!0);else if(e===`present`)Nn(!0);else if(e===`answer`||e===`plan`||e===`commit-plan`||e===`tell-apart`){let n=G.spec,r=e===`commit-plan`||e===`plan`?`plan`:`answer`,i=n?_f(n,r):Ae??``;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(V&&!J&&X.stop(),Me(null),G.reset(),Ur(!1),i){let t=e===`tell-apart`?`Telling them apart`:n?.center||(r===`plan`?`A plan`:`An answer`);ze(t),Y.run(i,void 0,void 0,void 0,void 0,t,n??void 0,a?{freshStart:!0}:void 0)}}},liveTranscript:Ae||void 0,thoughtCount:kd([Gr.current.join(` `),Ae??``].join(` `))})]}):null,Ll=W?G.phase===`settled`||G.phase===`pausing`?`Add thought`:`Done thinking`:`Watch me think`;return(0,U.jsxs)(`div`,{className:`mavea-app with-rail live-voice canvas-flat`+(Hs?` face-homed`:``)+(Ys?` in-wizard`:``)+(Mn?` presenting`:``)+(ri?` rail-collapsed`:``)+(Nl?` watch-thinking`:``),"data-title":Y.spec?.title??``,...Mn?{"data-preso":Fn}:{},ref:ha,children:[s.current&&(0,U.jsx)(Ni,{driver:jo}),s.current&&jo.done&&(0,U.jsx)(Ii,{onStart:Yi,onReplay:Xi,onPlayExtra:jo.playExtra,hasStoredSession:qi}),m.current&&(()=>{let e=I(m.current);return e?(0,U.jsx)(ta,{driver:Mo,member:e,onExit:Yi}):null})(),Mn&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`preso-style-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||Rn(!1)},children:[(0,U.jsxs)(`button`,{type:`button`,className:`preso-style-btn`+(Ln?` is-open`:``),onClick:()=>Rn(e=>!e),"aria-expanded":Ln,"aria-haspopup":`listbox`,children:[(0,U.jsx)(`span`,{className:`preso-swatch-sm`,style:{background:Of.find(e=>e.id===Fn)?.accent??`var(--presence)`}}),`Style`]}),Ln&&(0,U.jsx)(`div`,{className:`preso-menu`,role:`listbox`,"aria-label":`Presentation style`,children:Of.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":Fn===e.id,className:`preso-row`+(Fn===e.id?` is-active`:``),onClick:()=>{In(e.id),Mf(e.id),Rn(!1)},children:[(0,U.jsx)(`span`,{className:`preso-swatch`,style:{background:e.accent}}),(0,U.jsx)(`span`,{className:`preso-name`,children:e.label}),(0,U.jsx)(`span`,{className:`preso-desc`,children:e.description})]},e.id))})]}),(0,U.jsx)(`button`,{type:`button`,className:`present-exit`,onClick:()=>Nn(!1),title:`End the presentation (Esc)`,children:`End show · Esc`}),(0,U.jsx)($,{children:(0,U.jsx)(Tm,{spec:Y.viewSpec??Y.spec,question:Oc?.question??null,narration:Oc?.narration??Y.narration,skinId:Fn,autoAdvanceMs:s.current||m.current?2600:void 0,onExit:()=>Nn(!1)})})]}),(0,U.jsx)(`div`,{className:`presence-layer`+(Hs?` corner`:Js?``:` idlehome`)+($s?` has-caption`:``)+(si?` is-mem-save`:``),ref:_a,children:(0,U.jsxs)(`div`,{className:`presence-positioner`,ref:va,children:[zo&&(0,U.jsx)(`div`,{className:`presence-seed`,"aria-hidden":`true`},Y.turn),(0,U.jsx)(fe,{state:zs.state,emotion:zs.emotion,gaze:zs.gaze,muted:He})]})}),(0,U.jsx)(`div`,{className:`presence-scrim`+(ec?` show`:``)}),$s&&(0,U.jsx)(`div`,{className:`center-caption`,role:`status`,"aria-live":`polite`,children:Zs}),(0,U.jsx)(Uf,{activity:Y.activity,sources:Y.busy?Y.liveSources:[]}),(0,U.jsxs)(`div`,{className:`topbar`,children:[(0,U.jsxs)(`button`,{className:`brand brand-link`,type:`button`,onClick:Mm,title:`Back to the demo`,"aria-label":`Back to the demo`,children:[(0,U.jsx)(`span`,{className:`brand-dot jelly-mark`,ref:ga}),(0,U.jsx)(`span`,{className:`brand-name`,children:`Mavéa`}),Y.spec&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`brand-sep`}),(0,U.jsx)(`span`,{className:`workspace-name`,children:Y.error?`Couldn’t answer`:Y.spec.title})]})]}),(0,U.jsxs)(`span`,{className:`live-badge`,title:`Live · ${t.label}`,"aria-label":`Live mode`,children:[(0,U.jsx)(`span`,{className:`live-dot`}),`Live`]}),(0,U.jsx)(`div`,{className:`topbar-spacer`}),(0,U.jsx)(ln,{label:`Create`,items:_l}),(0,U.jsx)(ln,{label:`Practice`,items:vl,badge:Jc}),(0,U.jsx)(ln,{label:`Share`,items:yl}),(0,U.jsx)(ln,{label:`Explore`,items:bl}),(0,U.jsx)(N,{onOpen:gi,preload:Up.preload}),(0,U.jsx)(`span`,{className:`topbar-divider`,"aria-hidden":`true`}),(0,U.jsx)(Kn,{})]}),(0,U.jsx)(Ac,{chapters:ic,frames:Y.frames,currentIndex:oc,onJump:Y.jumpTo,onReplay:Y.frames.length>0?()=>Xo(Y.frames.length-1):void 0,onOverview:Y.frames.length>0?()=>Kc(!0):void 0,resumed:Y.restored,chatOpen:ti,onToggleChat:()=>ni(e=>!e),collapsed:ri,onToggleCollapse:()=>ii(e=>!e),onOpenPast:Vo.length>0?()=>oi(!0):void 0,onStudy:()=>Zt(!0),roomIndices:zn,bookmarks:Xa,onToggleBookmark:Za,onViewMindMap:e=>{let t=Y.frames[e];t?.mind&&jn({open:!0,spec:t.mind})},onSeeTogether:wc}),(0,U.jsxs)(Tc,{holdEnabled:Z&&Mi===`hold`,showHint:!1,pttKey:e.pttKey,pttSide:e.pttSide,onHoldStart:()=>{Uo(),X.start({inCanvas:!!Y.spec})},onHoldEnd:()=>X.forceStop(),onChangePttKey:e=>Yt({pttKey:e}),onChangePttSide:e=>Yt({pttSide:e}),children:[(ei||J&&Z)&&(0,U.jsxs)(`div`,{className:`dock-modes`,role:`group`,"aria-label":`Listening modes`,children:[ei&&(0,U.jsx)(`span`,{className:`whisper-badge`,children:`won't wake anyone`}),J&&Z&&(0,U.jsx)(`button`,{type:`button`,className:`listen-mode-chip`+(jr?` on`:``),"aria-pressed":jr,onClick:()=>{Mr(e=>!e),W&&(Wr.current=!1,Ur(!1))},title:Hr,"aria-label":Hr,children:jr?`Just listening · ${Rr} banked`:`Just listen`}),jr&&Rr>0&&(0,U.jsx)(`button`,{type:`button`,className:`listen-mode-chip`,onClick:()=>{Mr(!1);let e=Lr.current;if(Lr.current=[],Br(0),e.length){let t=Math.round((Date.now()-Vr.current)/6e4);ze(`Your thinking, sorted`),Y.run(xf(e,t),void 0,void 0,void 0,void 0,`Your thinking, sorted`)}},children:`Thoughts?`})]}),Z&&(0,U.jsx)(Ge,{kind:`voice-data`,from:`live`}),Be&&(0,U.jsxs)(`div`,{className:`voice-notice`,role:`status`,children:[Be===Lp?(0,U.jsx)(z.spark,{}):(0,U.jsx)(z.micOff,{}),(0,U.jsx)(`span`,{children:Be}),(0,U.jsx)(`button`,{type:`button`,className:`voice-notice-x`,"aria-label":`Dismiss voice notice`,onClick:()=>Ve(null),children:(0,U.jsx)(z.x,{})})]}),(A.length>0||R)&&(0,U.jsxs)(`div`,{className:`attach-strip`,role:`list`,"aria-label":`Attached files`,children:[A.map((e,t)=>(0,U.jsxs)(`span`,{className:`attach-chip`,role:`listitem`,children:[jt(e)?(0,U.jsx)(`img`,{className:`attach-thumb`,src:`data:${e.mime};base64,${e.data}`,alt:``}):(0,U.jsx)(z.paperclip,{}),(0,U.jsx)(`span`,{className:`attach-name`,children:Nt(e)}),(Ot(e)&&Ts||kt(e)||Ft(e))&&(0,U.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:()=>vn([e]),children:`⊹ Explode`}),(0,U.jsx)(`button`,{type:`button`,className:`attach-remove`,"aria-label":`Remove ${e.name}`,onClick:()=>B(t),children:(0,U.jsx)(z.x,{})})]},t)),(()=>{let e=A.filter(e=>kt(e)||Ft(e)||Ot(e)&&Ts);if(e.length<=1)return null;let t=(0,U.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:()=>vn(e),children:[`⊹ Compare `,e.length,` documents`]},`compare`),n=(0,U.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:()=>Tn(e),children:[`⊹ Synthesize `,e.length,` sources`]},`synth`);return e.length>=4?n:e.length>=3?(0,U.jsxs)(U.Fragment,{children:[t,n]}):t})(),R&&(0,U.jsx)(`span`,{className:`attach-error`,role:`status`,children:R})]}),A.length>0&&(0,U.jsx)(Ge,{kind:`upload`,from:`live`}),Y.spec&&(0,U.jsx)(jl,{armed:pe,pins:ns.pins,miss:ns.miss,onUndo:ns.undo,onSend:ns.send}),le.length>0&&(0,U.jsxs)(`div`,{className:`pin-dock`,children:[(0,U.jsx)(`div`,{className:`pin-strip`,role:`list`,"aria-label":`Elements you're asking about`,children:le.map(e=>(0,U.jsxs)(`span`,{className:`pin-chip`,role:`listitem`,children:[(0,U.jsx)(z.chat,{}),(0,U.jsx)(`span`,{className:`pin-name`,children:oe(e)}),(0,U.jsx)(`button`,{type:`button`,className:`pin-remove`,"aria-label":`Unpin ${oe(e)}`,onClick:()=>Cs(e),children:(0,U.jsx)(z.x,{})})]},e.id))}),(0,U.jsxs)(`div`,{className:`pin-suggests`,role:`list`,"aria-label":`Quick follow-ups`,children:[le.length>=2&&(0,U.jsxs)(`button`,{type:`button`,className:`live-chip pin-fuse-chip`,disabled:Y.busy,title:`Combine these ${le.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:()=>Ss(le),children:[`Fuse `,le.length,` into one`]}),ws.map(e=>(0,U.jsx)(`button`,{type:`button`,className:`live-chip`,onClick:()=>os(e),disabled:Y.busy,children:e},e))]})]}),(0,U.jsxs)(`div`,{className:qs?`voice-capsule`:`composer-passthrough`,children:[qs&&(0,U.jsxs)(`div`,{className:`voice-strip`,children:[Wc&&!Lc?(0,U.jsxs)(`button`,{type:`button`,className:`vc-status`,onClick:Uo,title:`Tap to stop and show the whole answer at once`,"aria-label":`Stop speaking and show the whole answer`,children:[(0,U.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]}),(0,U.jsx)(`span`,{className:`vc-status-label`,children:`Speaking`})]}):Ta&&!He?(0,U.jsxs)(`div`,{className:`vc-status vc-preparing`,role:`status`,"aria-busy":`true`,children:[(0,U.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]}),(0,U.jsx)(`span`,{className:`vc-status-label`,children:`Preparing voice…`})]}):Lc&&!He?(0,U.jsx)(`div`,{className:`vc-status vc-preparing vc-quiet`,role:`status`,"aria-busy":`true`,"aria-label":`Preparing voice`,children:(0,U.jsxs)(`span`,{className:`vc-orb`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]})}):null,(0,U.jsx)(`div`,{className:`vc-transcript`,"aria-hidden":`true`,children:Hc??Y.narration??``}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>Ue(e=>!e),title:He?`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":!He,className:`voice-switch`+(He?` is-muted`:``),children:[He?(0,U.jsx)(z.speakerOff,{}):(0,U.jsx)(z.speaker,{}),(0,U.jsx)(`span`,{className:`voice-switch-label`,children:`Mavéa's voice`}),(0,U.jsx)(`span`,{className:`voice-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{className:`voice-switch-thumb`})})]}),(0,U.jsx)(id,{}),(0,U.jsx)(sd,{}),(0,U.jsxs)(`button`,{className:`live-model-chip`,onClick:()=>ui(e=>!e),title:m.current?`The model that generated this curated prerecorded example`:Pc?`Model settings · last reply ${Pc}`:`Model settings`,children:[(0,U.jsx)(`span`,{className:`chip-dot`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`chip-model`,children:m.current?Mo.model??`—`:n}),(0,U.jsx)(`span`,{className:`chip-caret`,"aria-hidden":`true`})]})]}),(0,U.jsx)(Yr,{value:v,onChange:e=>{y(e)},onSend:os,listening:V,heard:Ae,onMic:Ms,micMode:Mi,micArmed:J&&!Di,micPaused:J&&Di,micProcessing:xe===`transcribing`,placeholder:W?`Talk, or type a thought — it lands on the map…`:le.length?le.length>1?`Ask about the selected elements…`:`Ask about the selected element…`:`Talk, or type — anything.`,focusSignal:bi,disabled:Y.busy,onFiles:re,attachPulse:Si,attachTitle:Ts?`Attach an image or PDF`:`Attach a doc or data file to explode — ${n} can't read images/PDFs directly`,onMicDown:()=>{Z&&(Uo(),X.start({inCanvas:!!Y.spec}))},onForceStop:()=>X.forceStop(),onMicCancel:()=>X.stop(),tools:(0,U.jsxs)(U.Fragment,{children:[Y.spec&&(0,U.jsx)(Ml,{armed:pe,onToggle:he}),(0,U.jsxs)(`button`,{type:`button`,className:`composer-watch`+(W?` on`:``),"aria-pressed":W,"aria-label":Ll,onClick:()=>{W?G.phase===`settled`||G.phase===`pausing`?(Me(null),G.resume(),!V&&Z&&X.start({inCanvas:!!Y.spec,continuous:!0})):Os():Zc(`think`)},title:W?G.phase===`settled`||G.phase===`pausing`?`Add another thought`:`Finish now without waiting for silence`:`Build a live map while you think aloud`,children:[(0,U.jsx)(z.spark,{}),(0,U.jsx)(`span`,{children:Ll})]})]}),micExtra:Z?(0,U.jsx)(Ws,{mode:Mi,pttKey:e.pttKey,pttSide:e.pttSide,onChange:e=>{ki.current=null,Oi(!1),Ei(e===`always`),Pi(e===`always`),ji(e===`hold`),e===`always`&&J&&!V&&!v.trim()?X.start({inCanvas:!!Y.spec,continuous:!0}):e!==`always`&&V&&X.stop()}}):void 0})]})]}),(V||Oe)&&!W&&(0,U.jsx)(Lf,{transcript:Ae,mode:Mi,transcribing:Oe,note:jr?`Just listening · ${Math.max(1,Math.round((Date.now()-Vr.current)/6e4))}m — say "thoughts?" when you want me`:void 0}),V&&!W&&(0,U.jsx)(Pd,{ghosts:Ji}),Y.spec?(0,U.jsxs)(`div`,{className:`canvas-stage stage`,"data-active":`1`,ref:la,children:[xc!=null&&(0,U.jsx)(gc,{tint:_c?.color,onDone:()=>Sc(null)},xc),(0,U.jsx)(`div`,{className:`canvas-scroll`,ref:ca,onClick:Y.spot?e=>{e.target.closest(`.spotlit`)||Ho()}:void 0,children:(0,U.jsxs)(`div`,{className:`topic-wrap`,children:[(0,U.jsx)(nl,{armed:pe,rootRef:la,onStroke:ns.onStroke,onTap:ns.onTap,strokes:ns.strokes,highlights:ns.highlights}),Al,!cc&&(0,U.jsxs)(`div`,{className:`viewing-past`,role:`status`,children:[sc?(0,U.jsx)(z.table,{}):(0,U.jsx)(z.clock,{}),(0,U.jsx)(`span`,{children:sc?`Viewing this thread together`:`Viewing an earlier moment`}),(0,U.jsx)(`button`,{type:`button`,className:`viewing-past-back`,onClick:()=>sc?Y.previewSpec(null):Y.jumpTo(ac),children:`Return to live`})]}),!ge&&le.length===0&&(0,U.jsxs)(`div`,{className:`ask-hint`,role:`note`,children:[(0,U.jsx)(z.chat,{}),(0,U.jsxs)(`span`,{children:[`Tap `,(0,U.jsx)(`strong`,{children:`Ask`}),` on any element to ask Mavéa about it.`]}),(0,U.jsx)(`button`,{type:`button`,className:`ask-hint-x`,"aria-label":`Dismiss tip`,onClick:_e,children:(0,U.jsx)(z.x,{})})]}),ss&&(0,U.jsx)($,{children:(0,U.jsx)(im,{course:ss,lessonIdx:us,progress:fs??br(ss.id),onPrev:()=>hs(ss,us-1),onNext:()=>hs(ss,us+1),onCheckpoint:gs,busy:Y.busy},`${ss.id}:${us}`)}),Oc&&!ss&&(0,U.jsx)(mc,{question:Oc.question,narration:Oc.narration,sources:Dc?.sources,inferred:kc,tint:pc}),Ko&&(0,U.jsx)(d,{label:`Opening saved answer…`,overlay:!0}),(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(`div`,{className:`canvas-loading`,role:`status`,"aria-busy":`true`,"aria-label":`Loading canvas`,children:(0,U.jsx)(`div`,{className:`skel-grid`,children:(0,U.jsx)(de,{blocks:Mp})})}),children:(0,U.jsx)(jp,{data:kl??Y.viewSpec??Y.spec,spot:cc?Y.spot:null,built:{},onProve:()=>yi(!0),onAskBlock:Cs,onAddToDashboard:e=>yt({block:e,question:Oc?.question??void 0}),selectedBlockIds:bs,onNarrate:Fo,narratingId:Io,muted:He,viewMode:So,onViewMode:Co,presenting:Mn,noteGutter:cc&&e.annotationsEnabled&&qa&&Ca,walkNotes:cc?Ya:void 0,blankFill:cc?{values:Y.filled,activeKey:Y.activeBlank,fill:Y.fill,unfill:Y.unfill,activate:Y.setActiveBlank,complete:Y.complete,busy:Y.busy}:void 0,bend:cc&&Jn===null?Y.spec?.bend:void 0,onAddToFlashcard:oa,flashedIds:Et,belowHeaderSlot:Oc&&Ol?(0,U.jsx)(rd,{audio:Ol,t:Jn,onSeek:$n}):void 0,viewSlot:sl?(0,U.jsxs)(`button`,{type:`button`,className:`canvas-open world-open`,title:Fp,"aria-label":Pp,onClick:()=>ll(),children:[(0,U.jsx)(z.globe,{className:`ic`,"aria-hidden":!0}),Pp]}):void 0,headerSlot:cc?(0,U.jsx)(U.Fragment,{children:(0,U.jsxs)(`div`,{className:`pen-anchor`,ref:eo,children:[(0,U.jsx)(zc,{enabled:e.annotationsEnabled,open:Ha,inkCount:Ra.length,onClick:()=>Ua(e=>!e)}),Ha&&(0,U.jsx)(`div`,{className:`pen-popover`,children:(0,U.jsx)(Rc,{entries:Ra,turnStartMs:Va.current,annotationsEnabled:e.annotationsEnabled,hiddenSpots:Wa,onToggle:go,onKeep:()=>Ua(!1),onClear:()=>{Pa([]),Ia(new Set),Ga(new Set),Ua(!1)},onClip:()=>Ke(!0),onJumpTo:vo,onToggleSpot:xo})})]})}):void 0},sc?`thread-`+(Y.viewOverride?.id??``):cc?`live-`+Y.replaceEpoch:`view-`+Y.viewIndex)}),cc&&!Nl&&!Wo&&(0,U.jsx)(lt,{spots:Wa.size>0?Aa.filter(e=>!Wa.has(e.spot)):Aa,revision:wo,onPlaced:La}),Y.busy&&cc&&(0,U.jsxs)(`div`,{className:`working-col`,children:[(0,U.jsx)(zf,{cards:Fc}),(0,U.jsx)(Hf,{thinking:Y.reasoning})]}),cc&&!Y.busy&&(0,U.jsx)($,{children:(0,U.jsx)(Xp,{chips:Y.understood,onFix:xs})}),(0,U.jsx)(bc,{spec:Y.viewSpec??Y.spec,followups:Ec,question:Fe??void 0,onAsk:os,onTrack:()=>ut(!0),onDeepZoom:Fe?()=>{window.location.hash=`#/deepzoom?seed=${encodeURIComponent(Fe)}`}:void 0,onCanvas:()=>Co(`canvas`),onSeeAll:!sc&&dc&&dc.moments.length>=2?()=>wc(dc):void 0,threadCount:dc?.moments.length,busy:Y.busy})]})})]}):Ys?(0,U.jsx)(U.Fragment,{children:(0,U.jsx)(Us,{seed:r.current||void 0,speak:Gi,goDemo:Mm,onStart:e=>{Bo(!0),os(e)},onStartTalking:()=>{if(Bo(!0),!Z){Ve(xp),xi(e=>e+1);return}X.start({inCanvas:!1})},onSeeHow:()=>Ro(!0),studySlot:(0,U.jsx)(Kl,{onStudy:()=>Zt(!0)}),librarySlot:Vo.length>0?(0,U.jsx)($,{children:(0,U.jsx)(Gp,{entries:Vo,onResume:e=>{Bo(!0),ne(!1),ze(e.question??null),es(e.id),Jo(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,U.jsxs)(`div`,{className:`presence-stage stage`,"data-active":`1`,children:[Al&&(0,U.jsx)(`div`,{className:`live-error-stage`,children:Al}),Y.busy&&(0,U.jsx)(`div`,{className:`skel-stage`,children:(0,U.jsx)(zf,{cards:Fc})})]}),Il,cl&&(0,U.jsx)($,{label:`Living answer`,children:(0,U.jsx)(xm,{spec:ol.props.world??null,question:ol.props.title,failed:el,onRetry:()=>il(e=>e+1),onClose:ul,view:ol.props.view,onExpandNode:hl,autoWalk:Vi&&ol.id===`tour-world`,speakLine:Gi})}),q&&(0,U.jsxs)(`div`,{className:`drop-hint`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(z.paperclip,{}),(0,U.jsx)(`span`,{children:`Drop to attach — Mavéa reads PDFs, Office docs, and data files`})]}),Lo&&(0,U.jsx)($,{children:(0,U.jsx)(Hp,{onClose:()=>Ro(!1),speak:Gi,onFullTour:Xi})}),hi&&(0,U.jsx)($,{children:(0,U.jsx)(Wp,{items:gl,surface:`live`,onClose:_i,pinned:s.current&&jo.chapter?.id===`palette`})}),li&&(0,U.jsx)(`div`,{role:`presentation`,onClick:e=>e.target===e.currentTarget&&ui(!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,U.jsx)($,{children:(0,U.jsx)(qp,{onClose:()=>ui(!1),initialTab:di,initialAdvancedYouOpen:pi})})}),Yo!==null&&(0,U.jsx)($,{children:(0,U.jsx)(um,{frames:Y.frames,initialIndex:Yo,speak:Gi,cancelSpeak:Le,onClose:()=>Xo(null)})}),We&&(0,U.jsx)($,{children:(0,U.jsx)(fm,{frames:Y.frames,retainedAudio:e=>_r.get(qe(e)),onClose:()=>Ke(!1),onShared:()=>Is.enqueue(`clipShared`)})}),Je&&na.length>0&&(0,U.jsx)($,{children:(0,U.jsx)(mm,{answers:na,defaultIndex:uc?uc.moments[uc.moments.length-1].frameIndex:na.length-1,defaultIndices:uc?.moments.map(e=>e.frameIndex),onClose:()=>Ze(!1),guided:s.current&&jo.chapter?.action.kind===`export`})}),ct&&(0,U.jsx)($,{children:(0,U.jsx)(gm,{onClose:()=>ut(!1),initialSourceId:Zo?`lib-`+Zo:void 0})}),dt&&(0,U.jsxs)(`div`,{className:`cv-takeover`,role:`dialog`,"aria-modal":`true`,"aria-label":`Living dashboard`,children:[(0,U.jsxs)(`header`,{className:`cv-takeover-head`,children:[(0,U.jsxs)(`div`,{className:`cv-takeover-id`,children:[(0,U.jsx)(`span`,{className:`cv-takeover-glyph`,"aria-hidden":`true`,children:`◎`}),(0,U.jsxs)(`div`,{className:`cv-takeover-titles`,children:[(0,U.jsx)(`span`,{className:`cv-takeover-eyebrow`,children:`Living dashboard`}),(0,U.jsx)(`span`,{className:`cv-takeover-title`,children:`Investment growth · $10k at 7%`})]})]}),(0,U.jsxs)(`button`,{type:`button`,className:`cv-takeover-close`,onClick:()=>ft(null),children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` Back to answer`]})]}),(0,U.jsx)(`div`,{className:`tour-dash-body`,children:(0,U.jsx)($,{children:pt?(0,U.jsx)(Yp,{id:dt}):(0,U.jsx)(Jp,{id:dt})})})]}),vt&&(0,U.jsx)($,{children:(0,U.jsx)(_m,{block:vt.block,question:vt.question,conversationTitle:Y.spec?.title,onClose:()=>yt(null),onAdded:(e,t)=>Tt({id:e,title:t})})}),xt&&(0,U.jsx)(Qs,{dashboardId:xt.id,dashboardTitle:xt.title,onDismiss:()=>Tt(null)}),Y.spec&&(0,U.jsx)(lc,{open:vi,onClose:()=>yi(!1),claim:Y.spec.title,conf:ts,sources:Y.spec.sources??[],hadFiles:te,blocks:Y.spec.blocks}),An.open&&(0,U.jsx)($,{children:(0,U.jsx)(am,{open:!0,spec:An.spec,onClose:()=>jn(e=>({...e,open:!1}))})}),ai&&(0,U.jsx)($,{children:(0,U.jsx)(lm,{entries:Vo,onResume:e=>{Bo(!0),ne(!1),ze(e.question??null),es(e.id),Jo(e.spec,e.question),oi(!1)},onRemove:un,onClose:()=>oi(!1)})}),Gc&&(0,U.jsx)($a,{chapters:ic,currentIndex:oc,onJump:bo,onClose:()=>Kc(!1)}),Vn&&qc&&(0,U.jsx)($,{children:(0,U.jsx)(Qp,{model:qc,level:Vn,onLevel:Hn,onJump:e=>{Y.jumpTo(e),Hn(null)},onClose:()=>Hn(null)})}),an&&(0,U.jsx)($,{children:(0,U.jsx)(Dm,{cfg:qt(e),memoryNodes:wn(),speak:Gi,onDebrief:e=>{on(!1),y(e)},onClose:()=>on(!1),onPrepTurn:(e,t)=>{on(!1),ze(t),Y.run(e,void 0,void 0,void 0,void 0,t)}})}),en&&qc&&(0,U.jsx)($,{children:(0,U.jsx)(sm,{model:qc,onJump:e=>{Y.jumpTo(e),tn(!1)},onShare:Y.frames.length>0?()=>{tn(!1),Ke(!0)}:void 0,onClose:()=>tn(!1)})}),sn&&(0,U.jsx)($,{children:(0,U.jsx)(em,{records:dr(),chapters:ic,onLand:e=>{cn(!1);let t=lr(e,Vo);Bo(!0),ne(!1),t?(ze(t.question??null),es(t.id),Jo(t.spec,t.question)):(ze(e.question),Y.run(e.question))},onGoDeeper:e=>{cn(!1),Bo(!0),ne(!1),ze(e),Y.run(e)},autoTour:s.current,onClose:()=>cn(!1)})}),gn&&(0,U.jsx)($,{children:(0,U.jsx)(ym,{pdf:gn,cfg:qt(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>vn(null)})}),bn&&(0,U.jsx)($,{children:(0,U.jsx)(jm,{doc:bn,cfg:qt(e),onClose:()=>xn(null)},bn.id)}),Sn&&(0,U.jsx)($,{children:(0,U.jsx)(Cm,{sources:Sn,cfg:qt(e),search:{enabled:e.searchMode!==`off`,providerId:e.searchProvider,apiKey:e.searchKeys[e.searchProvider]},onClose:()=>Tn(null)})}),Dn&&(0,U.jsx)($,{children:(0,U.jsx)(nm,{model:Dn,cfg:qt(e),speak:Gi,showcase:s.current,onClose:()=>On(null)})}),Xt&&(0,U.jsx)($,{children:(0,U.jsx)(km,{onClose:()=>Zt(!1)})}),Pt&&(0,U.jsx)($,{children:(0,U.jsx)(rm,{mode:`add`,initial:Pt.initial,deck:Pt.deck,origin:`block`,source:Pt.source,heading:`Flashcards from ${oe(Pt.block)}`,enrich:Pt.enrich,decks:ir(),onSaved:e=>{if(e.length&&Pt.block.id){let e=Pt.block.id;At(t=>new Set(t).add(e))}ra(e)},onClose:()=>It(null)})}),_s&&(0,U.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(z.layers,{}),(0,U.jsxs)(`span`,{className:`cards-pill-text`,children:[_s.missedCards.length,` card`,_s.missedCards.length===1?``:`s`,` from this checkpoint`]}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>vs(null),children:`Dismiss`}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>ys(_s),children:`Add`})]}),!_s&&Bt&&(0,U.jsxs)(`div`,{className:`cards-pill is-ask`,role:`status`,"aria-live":`polite`,children:[(0,U.jsxs)(`div`,{className:`cards-pill-head`,children:[(0,U.jsx)(z.layers,{}),(0,U.jsxs)(`span`,{className:`cards-pill-text`,children:[Bt.count,` card`,Bt.count===1?``:`s`,` saved to “`,Bt.deck,`”`]})]}),(0,U.jsxs)(`div`,{className:`cards-pill-ask`,children:[(0,U.jsx)(`span`,{className:`cards-pill-q`,children:`Want Mavéa to help you remember these?`}),(0,U.jsx)(`span`,{className:`cards-pill-sub`,children:`They’ll come back for a quick practice every so often.`}),(0,U.jsxs)(`div`,{className:`cards-pill-choices`,children:[(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>aa(`collection`),children:`No thanks`}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>aa(`spaced`),children:`Yes`})]})]})]}),!_s&&!Bt&&Lt&&(0,U.jsxs)(`div`,{className:`cards-pill`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(z.layers,{}),(0,U.jsxs)(`span`,{className:`cards-pill-text`,children:[Lt.count,` card`,Lt.count===1?``:`s`,` added`]}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn`,onClick:()=>{or(Lt.ids),Rt(null)},children:`Undo`}),(0,U.jsx)(`button`,{type:`button`,className:`cards-pill-btn cards-pill-primary`,onClick:()=>{window.location.hash=`#/flashcards`,Rt(null)},children:`View`})]})]})}export{Fm as LiveApp};