@mavea/mavea 1.0.7 → 1.0.9
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.
- package/README.md +5 -3
- package/bin/mavea.mjs +42 -17
- package/dist/.vite/manifest.json +675 -670
- package/dist/assets/{AppCommandPalette-DUMSp3rd.js → AppCommandPalette-D5E8xhEf.js} +1 -1
- package/dist/assets/{AtlasView-Dl2fssaG.js → AtlasView-Q4dqhS4v.js} +1 -1
- package/dist/assets/{BlockEmpty-CLtVQf6c.js → BlockEmpty-JoKwTRb0.js} +1 -1
- package/dist/assets/{BriefingPlayer-DO205Qkh.js → BriefingPlayer-BaC5XjsP.js} +1 -1
- package/dist/assets/{CanvasSkeleton-BZZPCuRZ.js → CanvasSkeleton-DgF1b-bW.js} +2 -2
- package/dist/assets/{CheckLogRail-wUfby67Z.js → CheckLogRail-DldWYeVr.js} +1 -1
- package/dist/assets/{CodeOutput-Kh6ldxQz.js → CodeOutput-B9_a0vjD.js} +1 -1
- package/dist/assets/{CommandPalette-Kl00mMZm.js → CommandPalette-C1eiRrMP.js} +1 -1
- package/dist/assets/{CourseLessonReader-MBHoknUz.js → CourseLessonReader-DA3t9SUe.js} +2 -2
- package/dist/assets/{CourseRail-q6x5cCpW.js → CourseRail-BaP1uB0B.js} +1 -1
- package/dist/assets/{CoursesApp-v89OVJvg.js → CoursesApp-MSK1JzqU.js} +2 -2
- package/dist/assets/{CrossExamPanel-DH04p6VS.js → CrossExamPanel-jJu-Mqvs.js} +1 -1
- package/dist/assets/{DashPresent-BYXbPuGj.js → DashPresent-Coj1b9Bp.js} +1 -1
- package/dist/assets/{DashboardDetail-B50ZkeVK.js → DashboardDetail-CHw4HfHp.js} +2 -2
- package/dist/assets/DashboardLoopRuntime-bSH-LDQM.js +1 -0
- package/dist/assets/{DashboardOverview-C-FdGWM5.js → DashboardOverview-CfsSZAgN.js} +1 -1
- package/dist/assets/{DashboardSettings-Dmw6JTbI.js → DashboardSettings-BkSQvDt6.js} +1 -1
- package/dist/assets/{DashboardsApp-JSY_bVfi.js → DashboardsApp-BmcjQZqP.js} +2 -2
- package/dist/assets/{DeepZoomApp-BFNwli7l.js → DeepZoomApp-BKhVz2w1.js} +1 -1
- package/dist/assets/{DelegatePanel-BK7rEhIc.js → DelegatePanel-BFKvKzB-.js} +1 -1
- package/dist/assets/{DemoGallery-BPtVG7_y.js → DemoGallery-0cgMcGir.js} +1 -1
- package/dist/assets/{DropSelect-DUhdQSta.js → DropSelect-CJnpoHtR.js} +1 -1
- package/dist/assets/{ExportModal-D65cGyj_.js → ExportModal-DbWt9b6v.js} +2 -2
- package/dist/assets/{ExtractionPreview-Iwfg2Ogl.js → ExtractionPreview-DTAyeKIx.js} +1 -1
- package/dist/assets/{FeatureUseNotice-DPtQ0OGb.js → FeatureUseNotice-CoK5HkbR.js} +1 -1
- package/dist/assets/FeatureUseNotice-CsCxxfOl.css +1 -0
- package/dist/assets/{FlagshipCTA-BXntKhxb.js → FlagshipCTA-EfqXfhO2.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-BDJfasI-.js → FlagshipCommandPalette-CUgzggi1.js} +1 -1
- package/dist/assets/{FlagshipShowcase-DJ8Gxk_G.js → FlagshipShowcase-BHe-31yE.js} +1 -1
- package/dist/assets/{FlashcardsApp-CLNo4WX7.js → FlashcardsApp-Cs7PORkH.js} +1 -1
- package/dist/assets/{ForecastPanel-PBO2-dgS.js → ForecastPanel-BrfHS_Dm.js} +1 -1
- package/dist/assets/{GalleryApp-DM03CMRy.js → GalleryApp-VEc5loz4.js} +1 -1
- package/dist/assets/{HonestByDesign-Dqyth6nW.js → HonestByDesign-DsAzveYU.js} +1 -1
- package/dist/assets/{HowItWorks-C0zosIvq.js → HowItWorks-_ek4B7ia.js} +1 -1
- package/dist/assets/{LegalApp-DZBdExTy.js → LegalApp-jexr9Ljt.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-CSZhRG5r.js → LegalMarkdownDocument-01Tz7Pp4.js} +1 -1
- package/dist/assets/{LegalPageShell-DTeXqWyc.js → LegalPageShell-DsgBihfP.js} +1 -1
- package/dist/assets/{LeverPanel-aZfhtVJX.js → LeverPanel-IONjaat2.js} +1 -1
- package/dist/assets/{Library-D2XGNXz7.js → Library-gY4a_JKb.js} +1 -1
- package/dist/assets/{LibraryOverlay-B2WQSgwr.js → LibraryOverlay-DdOW7ypW.js} +1 -1
- package/dist/assets/LiveApp-CvgisDd0.js +61 -0
- package/dist/assets/{LiveApp-BVZGpJ1S.css → LiveApp-D2QFBykD.css} +1 -1
- package/dist/assets/LiveSettings-sWIu-zl5.js +6 -0
- package/dist/assets/{MindMapViewerDrawer-YYyZqmAd.js → MindMapViewerDrawer--AOShADD.js} +1 -1
- package/dist/assets/{MindShape-mTlN5mPZ.js → MindShape-DDL4X-e5.js} +1 -1
- package/dist/assets/{PinToDashboard-_kIOHs0k.js → PinToDashboard-DBZjKpiA.js} +1 -1
- package/dist/assets/{PlanReview-33V8GTNB.js → PlanReview-D0KjJqji.js} +1 -1
- package/dist/assets/{Presence-CzLJIeSD.js → Presence-DZC81_y4.js} +1 -1
- package/dist/assets/{PresentationDeck-BDoGecxr.js → PresentationDeck-DHtbOg0G.js} +1 -1
- package/dist/assets/{PrismApp-PfBTFhMF.js → PrismApp-DQ5p9pDb.js} +2 -2
- package/dist/assets/{PrismAskController-DbQDrlU9.js → PrismAskController-KVoYxV_d.js} +1 -1
- package/dist/assets/{PrismBriefingPlayer-1fvlfLR8.js → PrismBriefingPlayer-X4nTg2tZ.js} +2 -2
- package/dist/assets/{PrismOverlay-B7lEspdu.js → PrismOverlay-DJ-JBI6j.js} +4 -4
- package/dist/assets/{PrivacyApp-CR4lRs0L.js → PrivacyApp-Df8FcjKa.js} +1 -1
- package/dist/assets/{Recap-H5fhj5Tc.js → Recap-D3nAqmLK.js} +1 -1
- package/dist/assets/{ReelJelly-3jSVsJsy.js → ReelJelly-BCMS6a1u.js} +1 -1
- package/dist/assets/{RehearsalPanel-BVgjrOPg.js → RehearsalPanel-CThmKYOO.js} +1 -1
- package/dist/assets/ReplayCard-B5njgafT.js +2 -0
- package/dist/assets/{ReplayOverlay-DXmVdeIr.js → ReplayOverlay-CKTMSGuA.js} +1 -1
- package/dist/assets/{RewindOverlay-BusfWeFq.js → RewindOverlay-D6TQvplO.js} +1 -1
- package/dist/assets/{RippleApp-9KrJPYgN.js → RippleApp-DCAveryn.js} +2 -2
- package/dist/assets/{RippleAskController-CO9wE7hU.js → RippleAskController-DQVRFV30.js} +1 -1
- package/dist/assets/{RippleOverlay-DMHLbfh8.js → RippleOverlay-DmC4C72P.js} +2 -2
- package/dist/assets/{SeeDontRead-C389viue.js → SeeDontRead-CzIEW_Y7.js} +1 -1
- package/dist/assets/ShareModal-DtXKAwWu.js +32 -0
- package/dist/assets/{ShipCascade-BUtwvQoW.js → ShipCascade-B71VnE85.js} +1 -1
- package/dist/assets/{ShipCourse-B7lG6DYW.js → ShipCourse-BS4lT6xe.js} +1 -1
- package/dist/assets/{ShipHotspots-Bj2CovtT.js → ShipHotspots-CGQN_uoM.js} +1 -1
- package/dist/assets/{ShipIncident-DcmindmE.js → ShipIncident-C--FrQ1N.js} +1 -1
- package/dist/assets/{ShipMigration-s0hVjDQl.js → ShipMigration-C4fE3pL7.js} +1 -1
- package/dist/assets/{ShipOnboarding-ekbHL7OH.js → ShipOnboarding-BR3iwj8v.js} +1 -1
- package/dist/assets/{ShipRead-BVNgQT6L.js → ShipRead-DYHgvWuI.js} +1 -1
- package/dist/assets/{ShipRollout-BdUQzMyP.js → ShipRollout-D-vQsNmF.js} +1 -1
- package/dist/assets/{ShipSuggestions-B6fKYh8L.js → ShipSuggestions-BICGN1lD.js} +1 -1
- package/dist/assets/{ShipWorkspace-3D3Rrs1p.js → ShipWorkspace-CVkhvrlm.js} +1 -1
- package/dist/assets/{SignatureLoop-C60r8Wm5.js → SignatureLoop-BwCgKOcz.js} +1 -1
- package/dist/assets/{SynthesisApp-vJ2Jq0Qe.js → SynthesisApp-DHKlVoSg.js} +2 -2
- package/dist/assets/{SynthesisOverlay-CkERphvG.js → SynthesisOverlay-ezT4gd3q.js} +1 -1
- package/dist/assets/{TermsApp-C70tW6m6.js → TermsApp-uGgQFz8d.js} +1 -1
- package/dist/assets/{TopicCanvas-CT0eSj2M.js → TopicCanvas-CTTBp5sg.js} +2 -2
- package/dist/assets/{TourPrism-BvucSkcs.js → TourPrism-dXsE-USz.js} +1 -1
- package/dist/assets/{TrackerTile-CasZNmt4.js → TrackerTile-bEni07HA.js} +2 -2
- package/dist/assets/{TwoSurfaces-C90X7Aj5.js → TwoSurfaces-CjFg-pUQ.js} +1 -1
- package/dist/assets/{UnderstoodPanel-CHPD2Ttj.js → UnderstoodPanel-DFKf9Y3r.js} +1 -1
- package/dist/assets/{WhyMachineOverlay-CB0_n6Sy.js → WhyMachineOverlay-DYG-WIjA.js} +1 -1
- package/dist/assets/{WowFeatures-Ci_H5QYX.js → WowFeatures-lLtU2gPc.js} +1 -1
- package/dist/assets/{ZoomDeck-BQHO79ZU.js → ZoomDeck-D_PnwGAY.js} +1 -1
- package/dist/assets/{alternateFinishes-DZ-rkpkX.js → alternateFinishes-CPbjDTTL.js} +1 -1
- package/dist/assets/{annotationAuto-B0nihA4F.js → annotationAuto-Dq2Ae6Co.js} +1 -1
- package/dist/assets/{annotationReel-BcU9Q0Sw.js → annotationReel-5OHglRgk.js} +1 -1
- package/dist/assets/backup-DnPfX6cD.js +1 -0
- package/dist/assets/canvas-DBaJcTKZ.js +1 -0
- package/dist/assets/{catalog-Dqaq2YFd.js → catalog-C_g3qPPQ.js} +1 -1
- package/dist/assets/chapters-BX_F_H3C.js +1 -0
- package/dist/assets/{dashboardEvents-DR9d_c74.js → dashboardEvents-DCQLIdy6.js} +2 -2
- package/dist/assets/{dist-BFx3nZg4.js → dist-DrPlQeYR.js} +1 -1
- package/dist/assets/{fit-0HxU-rtB.js → fit-DqcemO7k.js} +1 -1
- package/dist/assets/{generateLive-D4B30fnF.js → generateLive-CflgZ7Wt.js} +18 -18
- package/dist/assets/homeTarget-BcZYH3DY.js +1 -0
- package/dist/assets/{index-y8GL67bB.js → index-BlCH2LG4.js} +3 -3
- package/dist/assets/{jspdf.es.min-C-Pf79px.js → jspdf.es.min-C9encxHf.js} +1 -1
- package/dist/assets/kokoro-BCXTWbLb.js +1 -0
- package/dist/assets/{lib-VFqp6Y3w.js → lib-3J_9keOc.js} +1 -1
- package/dist/assets/{liveSchema-CJ49PX5R.js → liveSchema-DNg9x7Wk.js} +3 -2
- package/dist/assets/{mastery-BPjxP0fN.js → mastery-D7xYf5D7.js} +1 -1
- package/dist/assets/{motion-S0NRruNj.js → motion-BYK1NIl0.js} +1 -1
- package/dist/assets/{neighborhoods-C-1Tjr1r.js → neighborhoods-B0woY8Ah.js} +1 -1
- package/dist/assets/{notes-lROPCorS.js → notes-0ZgJ597y.js} +1 -1
- package/dist/assets/{pdf-Df7PCH7q.js → pdf-DuD2LFXS.js} +1 -1
- package/dist/assets/{perfProbe-COAp9PAa.js → perfProbe-CTSVS7u0.js} +1 -1
- package/dist/assets/{pin-CXSuPJYL.js → pin-zUYIWzGr.js} +1 -1
- package/dist/assets/{portal-DMw7C32j.js → portal-deBu1VaC.js} +1 -1
- package/dist/assets/{pptxgen.es-CvTILmV9.js → pptxgen.es-JvVtQi0_.js} +1 -1
- package/dist/assets/{prewarm--whjQhWJ.js → prewarm-DSFwU9lQ.js} +1 -1
- package/dist/assets/{quietHours-BvcsBKKK.js → quietHours-BJAGhffA.js} +1 -1
- package/dist/assets/{registry-BPvIPLke.js → registry-45IskpHI.js} +1 -1
- package/dist/assets/{registry-2v0jlh5Q.js → registry-BGptAE_J.js} +2 -2
- package/dist/assets/{registry-D_URPoL4.js → registry-BJ_F0mH5.js} +1 -1
- package/dist/assets/{registry-B8DStMJk.js → registry-BSewKzG5.js} +1 -1
- package/dist/assets/{registry-DUvXX_d0.js → registry-Bo9A1rtO.js} +1 -1
- package/dist/assets/{registry-CKjKq6ct.js → registry-BpXS6B5V.js} +1 -1
- package/dist/assets/{registry-aazwkBJp.js → registry-BvJYizNq.js} +1 -1
- package/dist/assets/{registry-DCI_BeFJ.js → registry-C1y9zCwl.js} +1 -1
- package/dist/assets/{registry-Buq5uuCv.js → registry-CS0QdcT2.js} +1 -1
- package/dist/assets/{registry-B940W2j5.js → registry-Caz06xkK.js} +1 -1
- package/dist/assets/{registry-Cg7qUZPS.js → registry-CmEE2X59.js} +1 -1
- package/dist/assets/{registry-DujBAgn_.js → registry-D5sMUiCn.js} +1 -1
- package/dist/assets/{registry-Cix-yqch.js → registry-DLnp7IOd.js} +1 -1
- package/dist/assets/{registry-DDLSYDVA.js → registry-DOsi_pfu.js} +1 -1
- package/dist/assets/{registry-BgGeRiDA.js → registry-DWpOzObR.js} +1 -1
- package/dist/assets/{registry-Dpb8EXHn.js → registry-DilxWEq7.js} +1 -1
- package/dist/assets/{registry-DJinB5ye.js → registry-Dn10bL9p.js} +1 -1
- package/dist/assets/{registry-zRPjWNl5.js → registry-DtJTiMeL.js} +1 -1
- package/dist/assets/{registry-CEVrY72Z.js → registry-FPqHPyMt.js} +1 -1
- package/dist/assets/{registry-DI1wSG1Y.js → registry-PAcF90vq.js} +1 -1
- package/dist/assets/{registry-CAusoyBh.js → registry-eoPQWB7M.js} +1 -1
- package/dist/assets/{registry-1GuPBfQK.js → registry-k5Lqb0OP.js} +1 -1
- package/dist/assets/{registry-QcULZpdE.js → registry-yQqBxBwc.js} +2 -2
- package/dist/assets/{relate-A9ZeaaAI.js → relate-B23jli7z.js} +1 -1
- package/dist/assets/{run-C_0B_41W.js → run-Dc2ZJz6n.js} +1 -1
- package/dist/assets/search-Be63DJkp.js +1 -0
- package/dist/assets/shapes-Cw7tCHIp.js +1 -0
- package/dist/assets/{shikiHighlight-DUCYbsJ2.js → shikiHighlight-ZFDUBGQi.js} +1 -1
- package/dist/assets/{store-DgG0C1Qx.js → store-BMRQiV1z.js} +1 -1
- package/dist/assets/{store-BFC7DZcg.js → store-Dn23_Ymr.js} +1 -1
- package/dist/assets/{store-BFrJaSxJ.js → store-DoJn3lBF.js} +1 -1
- package/dist/assets/{store-4JNNn732.js → store-DrBDvqXF.js} +1 -1
- package/dist/assets/threads-DxSb3F0U.js +1 -0
- package/dist/assets/{useDashboardLoop-B6ByHWoE.js → useDashboardLoop-8emjL6b-.js} +3 -3
- package/dist/assets/useLiveConfig-BhFHwoy3.js +1 -0
- package/dist/assets/{useSpatialCanvas-DogK9457.js → useSpatialCanvas-DZhSpnC6.js} +1 -1
- package/dist/assets/{useSpotlightWalk-rMbmNBKK.js → useSpotlightWalk-sP3ePKv0.js} +1 -1
- package/dist/assets/{useSrsCards-CagZefwX.js → useSrsCards-BHQHQ7hm.js} +1 -1
- package/dist/assets/{useStudy-Bflreq2a.js → useStudy-Dh598Dw8.js} +1 -1
- package/dist/assets/{useZoomGesture-CYc3tf2z.js → useZoomGesture-CQdTOGD2.js} +1 -1
- package/dist/index.html +1 -1
- package/docs/media/mascot-dark.svg +53 -0
- package/docs/media/mascot-light.svg +53 -0
- package/package.json +2 -1
- package/dist/assets/DashboardLoopRuntime-CFXPx3v_.js +0 -1
- package/dist/assets/FeatureUseNotice-CWt7gOwS.css +0 -1
- package/dist/assets/LiveApp-B9zwXlGC.js +0 -61
- package/dist/assets/LiveSettings-D9OcWlm6.js +0 -6
- package/dist/assets/ReplayCard-BpYO5vX-.js +0 -2
- package/dist/assets/ShareModal-ClnEkudw.js +0 -32
- package/dist/assets/backup-c-Btapzp.js +0 -1
- package/dist/assets/canvas-QTEIiK23.js +0 -1
- package/dist/assets/chapters-BiUsDClQ.js +0 -1
- package/dist/assets/homeTarget-BgWKI_E1.js +0 -1
- package/dist/assets/kokoro-D4GKpSL0.js +0 -1
- package/dist/assets/search-DnjHupRf.js +0 -1
- package/dist/assets/shapes-RqjqC0ay.js +0 -1
- package/dist/assets/useLiveConfig-X9Wxh90k.js +0 -1
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/backup-c-Btapzp.js","assets/useStudy-Bflreq2a.js","assets/index-y8GL67bB.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/contentVault-DzTYWcbD.js","assets/keyVault-DEsNh9FR.js","assets/store-4JNNn732.js","assets/queue-J4h7E3uc.js","assets/store-DXmC_fP2.js","assets/queue-DHeyJ32F.css","assets/useLiveConfig-X9Wxh90k.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/store-BFC7DZcg.js","assets/store-DgG0C1Qx.js","assets/shapes-RqjqC0ay.js","assets/store-BFrJaSxJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{J as n,a as r,ft as i,g as a,ht as o,p as s,q as c,v as l,y as u}from"./index-y8GL67bB.js";import{n as d}from"./icons-CHVz6kv_.js";import{t as f}from"./useFocusTrap-DbfG6zbM.js";import{a as p,c as m,l as h,o as g,p as _,s as v,u as y,v as b}from"./kokoro-D4GKpSL0.js";import{t as x}from"./FeatureUseNotice-DPtQ0OGb.js";import{t as S}from"./providers-wzm7E8Pa.js";import{i as C,r as w}from"./info-CiqHR5cs.js";import{C as T,b as E,v as D,y as O}from"./shapes-RqjqC0ay.js";import{t as k}from"./time-BHTmJR1s.js";import{n as ee,t as te,u as ne}from"./useStudy-Bflreq2a.js";import{i as re,l as ie,n as ae,o as A,s as oe,t as se,u as ce}from"./useLiveConfig-X9Wxh90k.js";import{n as le}from"./store-BFrJaSxJ.js";import{a as ue,d as de,f as fe,l as pe,n as me,p as he,r as ge,s as _e,u as ve}from"./quietHours-BvcsBKKK.js";import{t as ye}from"./DropSelect-DUhdQSta.js";import{g as be}from"./store-DXmC_fP2.js";var j=o(),M=e(),N=t(),P={display:`flex`,flexDirection:`column`,gap:4,fontSize:13,background:`var(--surface-default)`,border:`1px solid var(--line)`,borderRadius:8,padding:`7px 10px`},F={flex:`0 0 auto`,background:`transparent`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,lineHeight:1,padding:0};function xe(e){let t=(0,j.c)(40),{node:n,ago:r}=e,[i,a]=(0,M.useState)(!1),[o,s]=(0,M.useState)(n.body),c=(0,M.useRef)(null),l,u;t[0]===i?(l=t[1],u=t[2]):(l=()=>{i&&c.current?.focus()},u=[i],t[0]=i,t[1]=l,t[2]=u),(0,M.useEffect)(l,u);let d;t[3]!==o||t[4]!==n.body||t[5]!==n.id?(d=()=>{let e=o.trim();e&&e!==n.body&&O(n.id,e),a(!1)},t[3]=o,t[4]=n.body,t[5]=n.id,t[6]=d):d=t[6];let f=d,p;t[7]===n.body?p=t[8]:(p=()=>{s(n.body),a(!1)},t[7]=n.body,t[8]=p);let m=p,h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h={display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},g={fontFamily:`var(--font-data, inherit)`,fontSize:10.5,fontWeight:600,color:`var(--presence)`,letterSpacing:`0.02em`},t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;t[11]===n.concept?_=t[12]:(_=(0,N.jsx)(`span`,{style:g,children:n.concept}),t[11]=n.concept,t[12]=_);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v={fontSize:10.5,color:`var(--text-muted)`,whiteSpace:`nowrap`},t[13]=v):v=t[13];let y;t[14]===r?y=t[15]:(y=(0,N.jsx)(`span`,{style:v,children:r}),t[14]=r,t[15]=y);let b;t[16]!==i||t[17]!==n.concept?(b=!i&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>a(!0),title:`Edit this fact`,"aria-label":`Edit: ${n.concept}`,style:{...F,fontSize:12},children:`Edit`}),t[16]=i,t[17]=n.concept,t[18]=b):b=t[18];let x;t[19]===n.id?x=t[20]:(x=()=>D(n.id),t[19]=n.id,t[20]=x);let S=`Forget: ${n.concept}`,C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C={...F,fontSize:16},t[21]=C):C=t[21];let w;t[22]!==x||t[23]!==S?(w=(0,N.jsx)(`button`,{type:`button`,onClick:x,title:`Forget this concept`,"aria-label":S,style:C,children:`×`}),t[22]=x,t[23]=S,t[24]=w):w=t[24];let T;t[25]!==b||t[26]!==w||t[27]!==_||t[28]!==y?(T=(0,N.jsxs)(`div`,{style:h,children:[_,y,b,w]}),t[25]=b,t[26]=w,t[27]=_,t[28]=y,t[29]=T):T=t[29];let E;t[30]!==m||t[31]!==o||t[32]!==i||t[33]!==n.body||t[34]!==n.concept||t[35]!==f?(E=i?(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`textarea`,{ref:c,value:o,onChange:e=>s(e.target.value),rows:3,"aria-label":`Edit memory: ${n.concept}`,style:{font:`inherit`,fontSize:13,lineHeight:1.4,color:`var(--text-primary)`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:6,padding:`6px 8px`,resize:`vertical`,width:`100%`,boxSizing:`border-box`}}),(0,N.jsxs)(`div`,{style:{display:`flex`,gap:8,justifyContent:`flex-end`},children:[(0,N.jsx)(`button`,{type:`button`,onClick:m,style:{...F,fontSize:12},children:`Cancel`}),(0,N.jsx)(`button`,{type:`button`,onClick:f,disabled:!o.trim(),style:{...F,fontSize:12,color:`var(--presence)`,fontWeight:600},children:`Save`})]})]}):(0,N.jsx)(`span`,{style:{color:`var(--text-primary)`,lineHeight:1.4},children:n.body}),t[30]=m,t[31]=o,t[32]=i,t[33]=n.body,t[34]=n.concept,t[35]=f,t[36]=E):E=t[36];let k;return t[37]!==T||t[38]!==E?(k=(0,N.jsxs)(`li`,{style:P,children:[T,E]}),t[37]=T,t[38]=E,t[39]=k):k=t[39],k}function I(e){let t=e.concept.indexOf(`.`);return t<0?e.concept:e.concept.slice(0,t)}function Se(e){return{profile:`About you`,preferences:`Preferences`,topics:`Topics`,threads:`Open threads`,projects:`Projects`,work:`Work`,life:`Life`}[e]??e.slice(0,1).toUpperCase()+e.slice(1)}function Ce(e){let t=new Map;for(let n of e){let e=I(n),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.keys()].sort((e,t)=>e===`profile`?-1:t===`profile`?1:e.localeCompare(t)).map(e=>({namespace:e,nodes:t.get(e).slice().sort((e,t)=>t.updatedAt-e.updatedAt)}))}function L(e){if(!e)return``;try{return new Date(e).toISOString().split(`T`)[0]}catch{return``}}function R(e){let t=L(e.updatedAt);return`${t?`---\nconcept: ${e.concept}\nupdated: ${t}\n---`:`---\nconcept: ${e.concept}\n---`}\n\n${e.body}`}function z(e){return e.length?[...e].sort((e,t)=>e.concept===`profile`?-1:t.concept===`profile`?1:e.concept.localeCompare(t.concept)).map(R).join(`
|
|
3
|
-
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
`):``}function we(e){let t=z(e);if(t)try{let e=new Blob([t],{type:`text/markdown;charset=utf-8`}),n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=`mavea-memory.md`,r.click(),URL.revokeObjectURL(n)}catch{}}var B=420,V=300,H=6,U=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-soft)`,`var(--insight-soft)`,`var(--warning-soft)`],W={profile:U[0],preferences:U[3],topics:U[1],threads:U[4],projects:U[2]};function Te(e){return W[e]??U[Ee(e)%U.length]}function Ee(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(31,t)+e.charCodeAt(n)|0;return Math.abs(t)}function De(e){let t=[],n=new Set,r=(e,t)=>[e,t].sort().join(`\0`),i=e.filter(e=>e.updatedAt>0).sort((e,t)=>e.updatedAt-t.updatedAt);for(let e=0;e<i.length;e++)for(let a=e+1;a<i.length&&i[a].updatedAt-i[e].updatedAt<200;a++){let o=r(i[e].concept,i[a].concept);n.has(o)||(n.add(o),t.push({a:i[e].concept,b:i[a].concept,cooccurred:!0}))}let a=new Set(e.map(e=>e.concept));for(let i of e){let e=i.concept.split(`.`)[0];if(e!==i.concept&&a.has(e)){let a=r(i.concept,e);n.has(a)||(n.add(a),t.push({a:i.concept,b:e,cooccurred:!1}))}}return t}function G(e,t){let n=[...e].sort((e,t)=>e.concept.localeCompare(t.concept)),r=new Map;n.forEach((e,t)=>{let i=t/Math.max(1,n.length)*Math.PI*2,a=Math.min(B,V)*.3;r.set(e.concept,{x:B/2+Math.cos(i)*a,y:V/2+Math.sin(i)*a,vx:0,vy:0})});let i=[...r.values()],a=.82;for(let e=0;e<80;e++){let o=1-e/80,s=.08*Math.sqrt(B*V/Math.max(1,n.length));for(let e=0;e<i.length;e++){let t=i[e];for(let n=e+1;n<i.length;n++){let e=i[n],r=e.x-t.x||.01,a=e.y-t.y||.01,c=Math.hypot(r,a)||.01,l=s*s/c*1.5;t.vx-=r/c*l*o,t.vy-=a/c*l*o,e.vx+=r/c*l*o,e.vy+=a/c*l*o}}for(let e of t){let t=r.get(e.a),n=r.get(e.b);if(!t||!n)continue;let i=n.x-t.x,a=n.y-t.y,s=Math.hypot(i,a)||.01,c=(s-(e.cooccurred?85:120))*.05*o;t.vx+=i/s*c,t.vy+=a/s*c,n.vx-=i/s*c,n.vy-=a/s*c}for(let e of r.values())e.vx+=(B/2-e.x)*.006*o,e.vy+=(V/2-e.y)*.006*o;let c=0;for(let e of i){let t=Math.abs(e.vx)+Math.abs(e.vy);t>c&&(c=t),e.x=Math.max(20,Math.min(B-20,e.x+e.vx)),e.y=Math.max(20,Math.min(V-20,e.y+e.vy)),e.vx*=a,e.vy*=a}if(c<.4)break}let o=new Map;for(let[e,t]of r)o.set(e,{x:t.x,y:t.y});return o}function Oe(e){let t=(0,j.c)(39),{nodes:n}=e,[r,i]=(0,M.useState)(null),[a,o]=(0,M.useState)(null),s;t[0]===n?s=t[1]:(s=De(n),t[0]=n,t[1]=s);let c=s,l;t[2]!==c||t[3]!==n?(l=G(n,c),t[2]=c,t[3]=n,t[4]=l):l=t[4];let u=l,d;t[5]===c?d=t[6]:(d=c.filter(ke),t[5]=c,t[6]=d);let f=d.length,p;t[7]!==a||t[8]!==n?(p=a?n.find(e=>e.concept===a):null,t[7]=a,t[8]=n,t[9]=p):p=t[9];let m=p;if(n.length===0){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,N.jsx)(`div`,{className:`mg-empty`,children:`Your knowledge graph appears here as you talk — start a conversation to add concepts.`}),t[10]=e):e=t[10],e}let h;if(t[11]!==c||t[12]!==r||t[13]!==u){let e;t[15]!==r||t[16]!==u?(e=(e,t)=>{let n=u.get(e.a),i=u.get(e.b);if(!n||!i)return null;let a=r===e.a||r===e.b,o=e.cooccurred?.55:.2;return(0,N.jsx)(`line`,{x1:n.x,y1:n.y,x2:i.x,y2:i.y,className:`mg-edge`+(e.cooccurred?` mg-edge--strong`:``),style:{opacity:r?a?o+.3:.05:o}},t)},t[15]=r,t[16]=u,t[17]=e):e=t[17],h=c.map(e),t[11]=c,t[12]=r,t[13]=u,t[14]=h}else h=t[14];let g;if(t[18]!==a||t[19]!==r||t[20]!==n||t[21]!==u){let e;t[23]!==a||t[24]!==r||t[25]!==u?(e=e=>{let t=u.get(e.concept);if(!t)return null;let n=Te(I(e)),s=Math.max(7,Math.min(18,7+e.body.length/400*11)),c=r===e.concept,l=a===e.concept,d=e.concept.split(`.`).pop()??e.concept,f=T(e.source),p=e.kind===`procedural`,m=l?1:f?.82:.42,h=p||l||!f?n:`none`,g=p?2:l?1.5:+!f;return(0,N.jsxs)(`g`,{className:`mg-node`,transform:`translate(${t.x},${t.y})`,onMouseEnter:()=>i(e.concept),onMouseLeave:()=>i(null),onClick:()=>o(l?null:e.concept),style:{opacity:r&&!c?.3:1},children:[(0,N.jsx)(`title`,{children:`${e.concept} · ${f?`confirmed`:`unconfirmed`}${p?` · lesson`:``}`}),c&&(0,N.jsx)(`circle`,{r:s+5,fill:n,style:{opacity:.15},"aria-hidden":`true`}),(0,N.jsx)(`circle`,{r:s,fill:n,style:{opacity:m},stroke:h,strokeWidth:g,strokeDasharray:f?void 0:`3 2`,strokeOpacity:.5}),(0,N.jsx)(`text`,{className:`mg-label`,y:s+13,textAnchor:`middle`,style:{fill:n,opacity:c||l?1:.65},children:d})]},e.concept)},t[23]=a,t[24]=r,t[25]=u,t[26]=e):e=t[26],g=n.map(e),t[18]=a,t[19]=r,t[20]=n,t[21]=u,t[22]=g}else g=t[22];let _;t[27]!==h||t[28]!==g?(_=(0,N.jsxs)(`svg`,{className:`mg-svg`,viewBox:`0 0 ${B} ${V}`,width:`100%`,height:`auto`,"aria-label":`Memory concept graph`,children:[h,g]}),t[27]=h,t[28]=g,t[29]=_):_=t[29];let v;t[30]===m?v=t[31]:(v=m&&(0,N.jsxs)(`div`,{className:`mg-detail`,onClick:()=>o(null),title:`Click to close`,role:`button`,tabIndex:0,onKeyDown:e=>e.key===`Enter`&&o(null),children:[(0,N.jsx)(`span`,{className:`mg-detail-concept`,children:m.concept}),(0,N.jsx)(`p`,{className:`mg-detail-body`,children:m.body})]}),t[30]=m,t[31]=v);let y;t[32]!==n.length||t[33]!==f?(y=n.length<H?(0,N.jsxs)(`div`,{className:`mg-warmup`,children:[(0,N.jsx)(`div`,{className:`mg-warmup-track`,children:(0,N.jsx)(`div`,{className:`mg-warmup-fill`,style:{width:`${n.length/H*100}%`}})}),(0,N.jsxs)(`span`,{className:`mg-warmup-label`,children:[H-n.length,` more`,` `,H-n.length===1?`concept`:`concepts`,` until your map fills in`]})]}):(0,N.jsxs)(`p`,{className:`mg-foot`,children:[f,` connection`,f===1?``:`s`,` across `,n.length,` `,`concepts`]}),t[32]=n.length,t[33]=f,t[34]=y):y=t[34];let b;return t[35]!==_||t[36]!==v||t[37]!==y?(b=(0,N.jsxs)(`div`,{className:`mg-wrap`,children:[_,v,y]}),t[35]=_,t[36]=v,t[37]=y,t[38]=b):b=t[38],b}function ke(e){return e.cooccurred}n();function Ae({children:e,label:t=`More options`,defaultOpen:n=!1}){let[r,i]=(0,M.useState)(n);return(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,N.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,style:{display:`flex`,alignItems:`center`,gap:6,alignSelf:`flex-start`,padding:`4px 2px`,border:`none`,background:`transparent`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12,fontWeight:600,letterSpacing:`0.02em`},children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,transition:`transform 150ms ease`,transform:r?`rotate(90deg)`:`none`,fontSize:10},children:`▶`}),t]}),r&&(0,N.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12,paddingLeft:10,borderLeft:`2px solid var(--line)`},children:e})]})}function je(e){return{padding:`5px 14px`,borderRadius:8,border:`1px solid ${e?`var(--presence)`:`var(--line)`}`,background:e?`color-mix(in oklab, var(--presence) 12%, var(--surface-elevated))`:`var(--surface-default)`,color:e?`var(--presence)`:`var(--text-secondary)`,cursor:`pointer`,font:`inherit`,fontSize:12,fontWeight:e?600:400}}var Me={background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:16,padding:16,display:`flex`,flexDirection:`column`,gap:12,width:`min(460px, calc(100vw - 32px))`,boxShadow:`var(--shadow-modal)`},K={fontSize:12,color:`var(--text-muted)`,textTransform:`uppercase`,letterSpacing:`0.06em`},q={background:`var(--surface-default)`,border:`1px solid var(--line)`,borderRadius:10,padding:`9px 11px`,color:`var(--text-primary)`,font:`inherit`,width:`100%`};function Ne(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Pe(e){let t=h(e);if(t){p(`mavea`,t.kokoro);try{localStorage.setItem(v,e)}catch{}}}function J(e){let t=(0,j.c)(25),{label:n,on:r,onToggle:i,note:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={display:`flex`,alignItems:`flex-start`,gap:10},t[0]=o):o=t[0];let s=r?`var(--presence)`:`var(--track)`,c;t[1]===s?c=t[2]:(c={flex:`0 0 auto`,width:38,height:22,borderRadius:999,border:`1px solid var(--line-strong)`,background:s,position:`relative`,cursor:`pointer`,transition:`background 140ms ease`,marginTop:1},t[1]=s,t[2]=c);let l=r?18:2,u=r?`#fff`:`var(--text-muted)`,d;t[3]!==l||t[4]!==u?(d=(0,N.jsx)(`span`,{style:{position:`absolute`,top:2,left:l,width:16,height:16,borderRadius:`50%`,background:u,transition:`left 140ms ease, background 140ms ease`}}),t[3]=l,t[4]=u,t[5]=d):d=t[5];let f;t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==c||t[10]!==d?(f=(0,N.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":n,onClick:i,style:c,children:d}),t[6]=n,t[7]=r,t[8]=i,t[9]=c,t[10]=d,t[11]=f):f=t[11];let p,m;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(p={display:`flex`,flexDirection:`column`,gap:2},m={fontSize:13},t[12]=p,t[13]=m):(p=t[12],m=t[13]);let h;t[14]===n?h=t[15]:(h=(0,N.jsx)(`span`,{style:m,children:n}),t[14]=n,t[15]=h);let g;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(g={fontSize:12,color:`var(--text-muted)`},t[16]=g):g=t[16];let _;t[17]===a?_=t[18]:(_=(0,N.jsx)(`span`,{style:g,children:a}),t[17]=a,t[18]=_);let v;t[19]!==h||t[20]!==_?(v=(0,N.jsxs)(`div`,{style:p,children:[h,_]}),t[19]=h,t[20]=_,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==f?(y=(0,N.jsxs)(`div`,{style:o,children:[f,v]}),t[22]=v,t[23]=f,t[24]=y):y=t[24],y}function Y(e){let t=(0,j.c)(11),{value:n,options:r,onPick:i,label:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={display:`flex`,gap:4,padding:3,borderRadius:10,background:`var(--track)`,border:`1px solid var(--line)`},t[0]=o):o=t[0];let s;if(t[1]!==i||t[2]!==r||t[3]!==n){let e;t[5]!==i||t[6]!==n?(e=e=>{let t=e.value===n;return(0,N.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>i(e.value),style:{flex:1,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:1,padding:`6px 8px`,borderRadius:8,border:`none`,cursor:`pointer`,background:t?`var(--surface-elevated)`:`transparent`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.12)`:`none`,color:`inherit`,font:`inherit`},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:t?600:400},children:e.label}),e.badge&&(0,N.jsx)(`span`,{style:{fontSize:10.5,color:`var(--text-muted)`},children:e.badge})]},e.value)},t[5]=i,t[6]=n,t[7]=e):e=t[7],s=r.map(e),t[1]=i,t[2]=r,t[3]=n,t[4]=s}else s=t[4];let c;return t[8]!==a||t[9]!==s?(c=(0,N.jsx)(`div`,{role:`radiogroup`,"aria-label":a,style:o,children:s}),t[8]=a,t[9]=s,t[10]=c):c=t[10],c}function X({onClose:e,initialTab:t,initialAdvancedYouOpen:n}){let[o]=ce(),{style:p,newPerDay:T}=ee(),D=te(),O=C(o.provider),j=o.models[o.provider]??``,P=j||O.defaultModel,F=o.keys[o.provider]??``,I=S(o.provider).capabilities,L=ve(),R=(0,M.useMemo)(()=>Math.max(1,Math.round(JSON.stringify(L).length/1024)),[L]),z=he(),[B,V]=(0,M.useState)(me),[H,U]=(0,M.useState)(`list`),[W,Te]=(0,M.useState)(t??`model`),[Ee,De]=(0,M.useState)(!1),[G,ke]=(0,M.useState)(null),[X,Fe]=(0,M.useState)(!1),Ie=(0,M.useRef)(0),Le=(0,M.useRef)(null),[Re,ze]=(0,M.useState)(null),Be=(0,M.useRef)(null),[Ve,Z]=(0,M.useState)(null),[He,Q]=(0,M.useState)(null),Ue=(0,M.useRef)(null);f(Ue,{onEscape:e});function We(){let e=se(),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`mavea-live-v2.json`,r.click(),URL.revokeObjectURL(n)}function Ge(e){let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{try{re(n.result),ze(null)}catch(e){ze(e instanceof Error?e.message:`Import failed.`)}},n.readAsText(t),e.target.value=``}async function Ke(){Q(null),Z(null);try{let{downloadBackup:e}=await c(async()=>{let{downloadBackup:e}=await import(`./backup-c-Btapzp.js`);return{downloadBackup:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]));e(),Z(`Backup downloaded.`)}catch{Q(`Couldn’t build the backup — please try again.`)}}function qe(e){let t=e.target.files?.[0];if(!t)return;if(Q(null),Z(null),t.size>25e6){Q(`That file is too large to be a Mavéa backup.`),e.target.value=``;return}let n=new FileReader;n.onload=()=>{(async()=>{try{let{importBackup:e}=await c(async()=>{let{importBackup:e}=await import(`./backup-c-Btapzp.js`);return{importBackup:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),t=e(n.result),r=[[t.dashboards,`dashboard`],[t.memory,`memory`],[t.flashcards,`card`],[t.library,`saved canvas`,`saved canvases`],[t.atlas,`map record`],[t.courses,`course`]].filter(([e])=>e>0).map(([e,t,n])=>`${e} ${e===1?t:n??`${t}s`}`);Z(r.length?`Merged ${r.join(`, `)}.`:`Nothing new to merge from that file.`)}catch(e){Q(e instanceof Error?e.message:`Import failed.`)}})()},n.readAsText(t),e.target.value=``}let[Je,Ye]=(0,M.useState)(()=>Ne(v,g)),[Xe,Ze]=(0,M.useState)(()=>b()),Qe=(0,M.useCallback)(e=>{Ze(e),_(e),y()},[]),[$e,et]=(0,M.useState)(()=>a()),tt=(0,M.useCallback)(e=>{et(e),u(e),s(l())},[]),$=(0,M.useCallback)(async()=>{let e=++Ie.current;Fe(!0);let{checkLiveReady:t}=await c(async()=>{let{checkLiveReady:e}=await import(`./shapes-RqjqC0ay.js`).then(e=>e.s);return{checkLiveReady:e}},__vite__mapDeps([20,3,15,16,17,8,9])),n=await t(ie(ae()),{tts:!1});e===Ie.current&&(ke({llm:n.llm,model:n.model,statusCode:n.statusCode}),Fe(!1))},[]);(0,M.useEffect)(()=>{let e=setTimeout(()=>void $(),400);return()=>clearTimeout(e)},[o.provider,P,F,$]);let nt=X?`var(--text-muted)`:G?.llm&&G?.model?`var(--insight)`:`var(--warning)`,rt=X?`Checking…`:G?.llm&&G?.model?`Ready`:G?.llm?`Reachable — model not found`:O.needsKey&&!F?`Add your API key`:G?.statusCode===401?`Invalid API key`:G?.statusCode===403?`Key lacks permission`:G?.statusCode===404?`Model not found`:G?.statusCode===void 0?`Not reachable`:`Error ${G.statusCode}`;return(0,N.jsxs)(`div`,{ref:Ue,style:Me,role:`dialog`,"aria-modal":`true`,"aria-label":`Mavéa settings`,children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,N.jsxs)(`span`,{style:{fontWeight:700,fontSize:15,display:`flex`,alignItems:`center`,gap:8},children:[(0,N.jsx)(d.sparkle,{style:{width:16,height:16,flex:`0 0 auto`,color:`var(--presence)`}}),`Settings`]}),e&&(0,N.jsx)(`button`,{onClick:e,title:`Close`,"aria-label":`Close settings`,style:{display:`inline-grid`,placeItems:`center`,width:28,height:28,padding:0,border:`none`,borderRadius:6,background:`transparent`,color:`var(--text-secondary)`,cursor:`pointer`,flexShrink:0},children:(0,N.jsx)(d.x,{style:{width:16,height:16}})})]}),(0,N.jsx)(`div`,{className:`ls-tabs`,role:`tablist`,"aria-label":`Settings sections`,children:[`model`,`settings`,`you`,`data`].map(e=>(0,N.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":W===e,className:`ls-tab${W===e?` active`:``}`,onClick:()=>Te(e),children:e===`model`?`Model`:e===`settings`?`Settings`:e===`you`?`You`:`Your data`},e))}),(0,N.jsxs)(`div`,{className:`ls-body`,children:[W===`model`&&(0,N.jsxs)(`div`,{className:`settings-model-connect`,children:[(0,N.jsx)(`div`,{className:`settings-provider-picker`,style:{display:`flex`,flexWrap:`wrap`,gap:8},"aria-label":`Model providers`,children:w.map(e=>{let t=e.id===o.provider;return(0,N.jsx)(`button`,{onClick:()=>A({provider:e.id}),style:{...q,width:`auto`,cursor:`pointer`,borderColor:t?`var(--presence)`:`var(--line)`,boxShadow:t?`0 0 0 1px var(--presence)`:`none`,opacity:t?1:.7},"aria-pressed":t,children:e.label},e.id)})}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:K,children:`Model`}),(0,N.jsx)(fe,{provider:o.provider,value:j,onChange:e=>oe(o.provider,`model`,e)},o.provider)]}),O.needsKey&&(0,N.jsxs)(`label`,{className:`settings-api-key-field`,style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,N.jsx)(`span`,{style:K,children:`API key`}),!o.rememberKey&&(0,N.jsx)(`span`,{className:`settings-session-only`,"aria-label":`Key is not saved to disk`,children:`session only`})]}),(0,N.jsx)(`input`,{style:q,type:`password`,value:F,onChange:e=>oe(o.provider,`key`,e.target.value),placeholder:o.provider===`anthropic`?`sk-ant-…`:`paste your key`,spellCheck:!1,autoComplete:`off`}),(0,N.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:[`Kept in memory unless Remember is on — sent through this deployment to`,` `,O.label.split(` · `)[1]??O.label,` when used.`]})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13},children:[(0,N.jsx)(`span`,{style:{width:8,height:8,borderRadius:8,background:nt,flex:`0 0 auto`},"aria-hidden":!0}),(0,N.jsx)(`span`,{children:rt}),(0,N.jsx)(`span`,{style:{color:`var(--text-muted)`},children:`·`}),(0,N.jsx)(`span`,{style:{color:`var(--text-muted)`},children:O.hint}),(0,N.jsx)(`button`,{onClick:()=>void $(),style:{marginLeft:`auto`,background:`transparent`,border:`1px solid var(--line)`,borderRadius:8,padding:`4px 10px`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12},title:`Re-check readiness`,children:`Recheck`})]}),O.needsKey&&(0,N.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13},children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:o.rememberKey,onChange:e=>A({rememberKey:e.target.checked})}),(0,N.jsx)(`span`,{children:`Remember key on this device`}),(0,N.jsx)(`span`,{style:{color:`var(--text-muted)`,fontSize:12},children:o.rememberKey?`encrypted in this browser — trusted devices only`:`kept in memory only — cleared on reload`})]}),(0,N.jsx)(de,{}),(0,N.jsxs)(`div`,{className:`settings-transfer-row`,children:[(0,N.jsx)(`button`,{type:`button`,className:`settings-transfer-btn`,onClick:We,children:`Export settings`}),(0,N.jsx)(`button`,{type:`button`,className:`settings-transfer-btn`,onClick:()=>Le.current?.click(),children:`Import settings`}),(0,N.jsx)(`input`,{ref:Le,type:`file`,accept:`application/json,.json`,style:{display:`none`},"aria-hidden":`true`,onChange:Ge}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`API and search keys are never included.`}),Re&&(0,N.jsx)(`span`,{className:`settings-import-error`,role:`alert`,children:Re})]})]}),W===`settings`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ne,{}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Web search`}),(0,N.jsx)(Y,{value:o.searchMode,options:[{value:`off`,label:`Off`},{value:`realtime`,label:`Real-time`}],onPick:e=>A({searchMode:e})}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:o.searchMode===`off`?`Answers from the model's own knowledge — no web calls.`:I.nativeWebSearch?`Grounds fresh asks in live results with citations when a question needs it.`:`This model has no built-in search, so Real-time won't ground anything right now. The four direct providers support it; on OpenRouter it depends on the selected model. Pick a search-capable model or leave this off.`})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Explanation level`}),(0,N.jsx)(Y,{value:o.explainLevel,options:[{value:`standard`,label:`Standard`,badge:`default`},{value:`simple`,label:`Simple`,badge:`like I'm 5`}],onPick:e=>A({explainLevel:e})}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`Simple uses shorter sentences, everyday analogies, and fewer, more-labelled visuals. You can also just say "explain it simpler" or "go deeper".`})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Answer quality`}),(0,N.jsx)(Y,{value:o.quality,options:[{value:`fast`,label:`Fast`,badge:`quickest`},{value:`balanced`,label:`Balanced`,badge:`default`},{value:`thorough`,label:`Thorough`}],onPick:e=>A({quality:e})}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`Fast keeps replies snappy; Thorough lets the model think more on hard questions.`})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Visual richness`}),(0,N.jsx)(Y,{value:$e,options:[{value:`auto`,label:`Auto`,badge:`recommended`},{value:`full`,label:`Full`},{value:`lite`,label:`Lite`,badge:`older machines`}],onPick:e=>tt(e)}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`Auto matches the effects to your machine. Lite calms the animated face and drops the glass blur so Mavéa stays smooth on older or lower-powered computers.`})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Voice`}),(0,N.jsx)(Y,{value:Xe,options:[{value:`auto`,label:`Auto`,badge:`recommended`},{value:`kokoro`,label:`Natural`,badge:`needs Docker`},{value:`browser`,label:`System`,badge:`older machines`}],onPick:e=>Qe(e)}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`Natural is Kokoro, the voice Mavéa is built around — it needs the Docker container and a machine that can keep up with it. System is your computer’s own voice: plainer, but it costs nothing and stays in step on older hardware. Without either, lines appear as captions.`})]}),(0,N.jsxs)(Ae,{children:[(0,N.jsx)(J,{label:`Pen mode`,on:o.annotationsEnabled,onToggle:()=>{let e=!o.annotationsEnabled;A({annotationsEnabled:e,teachMode:e})},note:`Mavéa draws on the canvas as it speaks — circling numbers, striking out misconceptions, annotating every walkthrough stop. Muted walks also write margin notes beside the cards, so you keep the marked-up answer. Off: the pen stays quiet entirely.`}),o.searchMode!==`off`&&(0,N.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-muted)`,display:`flex`,gap:6},children:[(0,N.jsx)(d.globe,{style:{width:14,height:14,flex:`0 0 auto`,marginTop:1}}),`You'll see "Searching…" whenever a search actually runs.`]}),(0,N.jsx)(J,{label:`Keep a library`,on:o.libraryEnabled,onToggle:()=>A({libraryEnabled:!o.libraryEnabled}),note:`Saves the canvases you generate on this device so you can pick any one back up from the welcome screen. On by default; turn it off or clear the library any time.`}),o.libraryEnabled&&z.length>0&&(0,N.jsx)(`div`,{style:{marginLeft:48},children:(0,N.jsxs)(`button`,{type:`button`,onClick:()=>le(),style:{background:`transparent`,border:`1px solid var(--line)`,borderRadius:8,padding:`3px 9px`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12},children:[`Clear library (`,z.length,`)`]})})]})]}),W===`you`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(x,{kind:`stored-data`,from:`live`}),(0,N.jsx)(J,{label:`Remember me`,on:o.memoryEnabled,onToggle:()=>A({memoryEnabled:!o.memoryEnabled}),note:`Stored facts stay on this device. While Memory is enabled, relevant facts are included in future requests to your selected model provider. You can inspect, edit, export, or forget each stored fact below.`}),o.memoryEnabled&&(0,N.jsxs)(`div`,{style:{marginLeft:48,display:`flex`,flexDirection:`column`,gap:8},children:[L.length===0?(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:`Nothing remembered yet — Mavéa will build a concept wiki as you talk.`}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,N.jsx)(`div`,{style:{display:`flex`,gap:2,padding:2,borderRadius:8,background:`var(--track)`,border:`1px solid var(--line)`,alignSelf:`flex-start`},children:[`list`,`graph`].map(e=>(0,N.jsx)(`button`,{type:`button`,onClick:()=>U(e),style:{padding:`4px 12px`,borderRadius:6,border:`none`,background:H===e?`var(--surface-elevated)`:`transparent`,boxShadow:H===e?`0 1px 2px rgba(0,0,0,0.1)`:`none`,color:H===e?`var(--text-primary)`:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12,fontWeight:H===e?600:400},children:e===`list`?`Concepts`:`Graph`},e))}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>E(),style:{background:`transparent`,border:`1px solid var(--line)`,borderRadius:8,padding:`3px 9px`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12},children:`Forget all`})]}),H===`graph`?(0,N.jsx)(Oe,{nodes:L}):(0,N.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,maxHeight:280,overflowY:`auto`},children:Ce(L).map(({namespace:e,nodes:t})=>(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontFamily:`var(--font-data, inherit)`,fontSize:10,letterSpacing:`0.14em`,textTransform:`uppercase`,color:`var(--text-muted)`,margin:`2px 2px 0`},children:Se(e)}),(0,N.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:6},children:t.map(e=>(0,N.jsx)(xe,{node:e,ago:k(e.updatedAt)},e.id))})]},e))}),(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:[(0,N.jsxs)(`span`,{style:{fontSize:11.5,color:`var(--text-muted)`},children:[L.length,` `,L.length===1?`concept`:`concepts`,` · `,R,` KB on this device`]}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>we(L),style:{background:`transparent`,border:`1px solid var(--line)`,borderRadius:8,padding:`3px 9px`,color:`var(--text-muted)`,cursor:`pointer`,font:`inherit`,fontSize:12},children:`Export memory`})]})]}),(0,N.jsxs)(`span`,{style:{fontSize:12,color:`var(--text-muted)`,display:`flex`,gap:6},children:[(0,N.jsx)(d.sparkle,{style:{width:14,height:14,flex:`0 0 auto`,marginTop:1}}),`Stored on this device, and sent to ${O.label.split(` · `)[1]??O.label} inside each prompt to personalize answers — the same path as your questions.`]})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:[(0,N.jsx)(`span`,{style:K,children:`Voice`}),(0,N.jsx)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4,flex:1},children:[(0,N.jsx)(`span`,{style:{fontSize:11,color:`var(--text-muted)`},children:`Mavéa`}),(0,N.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[(0,N.jsx)(`div`,{style:{flex:1},children:(0,N.jsx)(ye,{ariaLabel:`Mavéa's voice`,value:Je,onChange:e=>{Ye(e),Pe(e);let t=h(e);t&&pe(t)},options:m.map(e=>({value:e.id,label:e.label,note:e.tone}))})}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>{let e=h(Je);e&&pe(e)},style:{...q,width:`auto`,padding:`6px 10px`,cursor:`pointer`,fontSize:11},title:`Preview voice`,"aria-label":`Preview Mavéa's voice`,children:`▶`})]})]})}),(0,N.jsx)(_e,{})]}),D.total>0&&(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Flashcards`}),(0,N.jsx)(Y,{label:`Flashcards`,value:p,options:[{value:`collection`,label:`Just save them`},{value:`spaced`,label:`Help me remember`}],onPick:e=>be(e)}),(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},children:p===`collection`?`A plain pile you flip through when you feel like it. No dates, no counts, nothing waiting for you.`:`Each card comes back just before you'd forget it. New ones join ${T} a day, so a big pile never lands at once.`})]}),(0,N.jsxs)(Ae,{defaultOpen:n,children:[(0,N.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[(0,N.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-muted)`},children:[`Hold to talk key `,(0,N.jsx)(`span`,{style:{opacity:.6},children:`(tap mode only)`})]}),(0,N.jsx)(`div`,{style:{display:`flex`,gap:6},children:[{key:`Alt`,label:`Alt`},{key:`Control`,label:`Ctrl`},{key:`Shift`,label:`Shift`}].map(({key:e,label:t})=>{let n=(o.pttKey||`Alt`)===e;return(0,N.jsx)(`button`,{type:`button`,onClick:()=>A({pttKey:e}),style:je(n),"aria-pressed":n,title:`Hold ${t} to talk (shows as ${ue(e,o.pttSide)} in the hint)`,children:t},e)})}),(0,N.jsx)(`div`,{style:{display:`flex`,gap:6},children:[{side:`any`,label:`Either side`},{side:`left`,label:`Left`},{side:`right`,label:`Right`}].map(({side:e,label:t})=>{let n=(o.pttSide||`any`)===e;return(0,N.jsx)(`button`,{type:`button`,onClick:()=>A({pttSide:e}),style:je(n),"aria-pressed":n,title:e===`any`?`Either side of the key talks`:`Only the ${t.toLowerCase()} key talks`,children:t},e)})})]}),(0,N.jsx)(J,{label:`Morning brief`,on:o.morningBrief,onToggle:()=>A({morningBrief:!o.morningBrief}),note:`On the first open of the day, Mavéa opens with a quick read on the things you track.`}),(0,N.jsx)(J,{label:`Save flashcards automatically`,on:o.autoSaveFlashcards,onToggle:()=>A({autoSaveFlashcards:!o.autoSaveFlashcards}),note:`When an answer already contains flashcards, keep them without asking. Off by default — the usual way is tapping “Cards” on the answer you want. Every save shows a pill with Undo, so it's never silent.`}),(0,N.jsx)(J,{label:`Quiet hours`,on:B,onToggle:()=>{ge(!B),V(!B)},note:`10 PM – 6 AM: the screen dims and the voice drops to a murmur — won't wake anyone.`})]})]}),W===`data`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(x,{kind:`stored-data`,from:`live`}),(0,N.jsxs)(`p`,{style:{fontSize:13,lineHeight:1.5,color:`var(--text-secondary)`,margin:0},children:[`Export a backup, or import one you saved.`,` `,(0,N.jsx)(`strong`,{children:`Stored only in this browser.`}),` Because your data is encrypted to this exact browser, copying it to incognito, another port, or another computer won’t work — export a backup here and import it there.`]}),(0,N.jsxs)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12,lineHeight:1.6,color:`var(--text-muted)`},children:[(0,N.jsx)(`li`,{children:`Includes your dashboards, memory, flashcards, saved canvases, map, and courses.`}),(0,N.jsxs)(`li`,{children:[`Your API keys are `,(0,N.jsx)(`strong`,{children:`never included`}),` — you’ll re-enter them on a new device.`]}),(0,N.jsxs)(`li`,{children:[`Importing `,(0,N.jsx)(`strong`,{children:`merges`}),` — it adds and updates, and never erases what’s already here.`]}),(0,N.jsx)(`li`,{children:`The file is plain, unencrypted JSON: keep it somewhere safe, import only files you trust.`})]}),(0,N.jsxs)(`div`,{className:`settings-transfer-row`,children:[(0,N.jsx)(`button`,{type:`button`,className:`settings-transfer-btn`,onClick:()=>void Ke(),children:`Export all my data`}),(0,N.jsx)(`button`,{type:`button`,className:`settings-transfer-btn`,onClick:()=>Be.current?.click(),children:`Import a backup`}),(0,N.jsx)(`input`,{ref:Be,type:`file`,accept:`application/json,.json`,style:{display:`none`},"aria-hidden":`true`,onChange:qe}),Ve&&(0,N.jsx)(`span`,{style:{fontSize:12,color:`var(--text-muted)`},role:`status`,children:Ve}),He&&(0,N.jsx)(`span`,{className:`settings-import-error`,role:`alert`,children:He})]})]}),(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:`6px 12px`,paddingTop:14,borderTop:`1px solid var(--line-soft)`,color:`var(--text-muted)`,fontSize:10.5},children:[(0,N.jsx)(`a`,{href:`#/terms?from=live`,style:{color:`inherit`},children:`Terms`}),(0,N.jsx)(`a`,{href:`#/privacy?from=live`,style:{color:`inherit`},children:`Privacy`}),(0,N.jsx)(`a`,{href:`#/legal?from=live`,style:{color:`inherit`},children:`Important information`}),(0,N.jsx)(`a`,{href:i(`LICENSE.txt`),target:`_blank`,rel:`noreferrer noopener`,style:{color:`inherit`},children:`License`}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>{r(),De(!0)},style:{marginLeft:`auto`,padding:0,border:0,color:`inherit`,background:`transparent`,font:`inherit`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`},children:Ee?`Review will appear next visit`:`Review acknowledgement again`})]})]})]})}export{X as LiveSettings};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-ClnEkudw.js","assets/chunk-BVpWp9h4.js","assets/index-y8GL67bB.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ReelJelly-3jSVsJsy.js","assets/geometry-DXAbnb0J.js","assets/registry-2v0jlh5Q.js","assets/fit-0HxU-rtB.js","assets/share-QHGHNDhQ.js","assets/icons-CHVz6kv_.js","assets/FeatureUseNotice-DPtQ0OGb.js","assets/FeatureUseNotice-CWt7gOwS.css","assets/spokenText-D4zPX9JY.js","assets/toast-BBNs2h3L.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-D4GKpSL0.js","assets/ShareModal-C8S7ySls.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{I as r,J as i,L as a,ht as o,k as s,mt as c,q as l}from"./index-y8GL67bB.js";import{n as u}from"./icons-CHVz6kv_.js";import"./ShareModal-ClnEkudw.js";import"./annotationReel-BcU9Q0Sw.js";var d=t(),f=o(),p=c();function m(e){if(!e||!e.blocks?.length)return[];let t=e.blocks.map((e,t)=>({index:t}));return[{question:e.opener||e.title||``,narration:e.found||e.sub||e.opener||e.title||``,mode:`replace`,tour:t,spec:e,at:0}]}var h=n();i();var g=r(()=>l(()=>import(`./ShareModal-ClnEkudw.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),_=g.Component;function v(e){let t=(0,f.c)(9),{frames:n,spec:r}=e,[i,o]=(0,d.useState)(!1),c;t[0]!==n||t[1]!==r?(c=n??(r?m(r):[]),t[0]=n,t[1]=r,t[2]=c):c=t[2];let l=c;if(!l.length)return null;let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,h.jsx)(`button`,{type:`button`,style:y,onClick:()=>o(!0),...a(g.preload),children:`✨ Share as a story`}),t[3]=u):u=t[3];let v;t[4]!==i||t[5]!==l?(v=i&&(0,p.createPortal)((0,h.jsx)(s,{label:`Share story`,overlay:!0,children:(0,h.jsx)(_,{frames:l,onClose:()=>o(!1)})}),document.body),t[4]=i,t[5]=l,t[6]=v):v=t[6];let b;return t[7]===v?b=t[8]:(b=(0,h.jsxs)(h.Fragment,{children:[u,v]}),t[7]=v,t[8]=b),b}var y={display:`inline-flex`,alignItems:`center`,gap:8,padding:`10px 18px`,borderRadius:`var(--r-full)`,border:`none`,background:`var(--presence)`,color:`#fff`,font:`650 14px/1 var(--font)`,cursor:`pointer`,alignSelf:`flex-start`},b=e({ReplayCard:()=>x});function x(e){let t=(0,f.c)(12),{delay:n,line:r,spec:i}=e,a=(n||0)+`ms`,o;t[0]===a?o=t[1]:(o={"--delay":a},t[0]=a,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,h.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,h.jsx)(u.play,{className:`ic`,style:{color:`var(--presence-soft)`}}),` Mavéa Replay`]}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={fontSize:17,marginBottom:14},t[3]=l):l=t[3];let d=r||`“I dropped in 3 statements. Mavéa showed me where my money went in 20 seconds.”`,p;t[4]===d?p=t[5]:(p=(0,h.jsx)(`div`,{className:`insight-title`,style:l,children:d}),t[4]=d,t[5]=p);let m;t[6]===i?m=t[7]:(m=i&&(0,h.jsx)(v,{spec:i}),t[6]=i,t[7]=m);let g;return t[8]!==s||t[9]!==p||t[10]!==m?(g=(0,h.jsxs)(`div`,{className:`card replay-card reveal`,style:s,children:[c,p,m]}),t[8]=s,t[9]=p,t[10]=m,t[11]=g):g=t[11],g}export{b as t};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/src-DbgF7cRH.js","assets/chunk-BVpWp9h4.js","assets/__vite-browser-external-BufR4LQa.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{J as r,L as i,c as a,ht as o,q as s}from"./index-y8GL67bB.js";import{n as c}from"./icons-CHVz6kv_.js";import{t as l}from"./useFocusTrap-DbfG6zbM.js";import{n as u,t as d}from"./share-QHGHNDhQ.js";import{t as f}from"./toast-BBNs2h3L.js";import{C as p,D as m,E as h,T as g,a as _,i as v,n as y,o as b,r as x,s as ee,t as S,w as C}from"./registry-2v0jlh5Q.js";import{t as w}from"./ReelJelly-3jSVsJsy.js";import{n as T,r as E}from"./spokenText-D4zPX9JY.js";import{r as D,x as O,y as k}from"./kokoro-D4GKpSL0.js";import{t as te}from"./FeatureUseNotice-DPtQ0OGb.js";var A=t();r();var j={balanced:{fps:30,bitrate:6e6},high:{fps:30,bitrate:1e7},ultra:{fps:60,bitrate:16e6}};function ne(e){let{fps:t,bitrate:n}=j[e];return`up to ${t} fps · ${Math.round(n/1e6)} Mbps`}async function M(){try{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}=await s(async()=>{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}=await import(`./src-DbgF7cRH.js`);return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}},__vite__mapDeps([0,1,2]));return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}}catch{return null}}async function N(){try{return await s(()=>import(`./dist-xRGLOZwv.js`),[])}catch{return null}}var P={"9:16":{w:1080,h:1920},"1:1":{w:1080,h:1080},"16:9":{w:1920,h:1080}};function re(){if(typeof document>`u`)return!1;let e=typeof MediaRecorder<`u`,t=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0;return e||t}async function F(e){let t=j[e.quality??`high`],n=e.fps??t.fps,{w:r,h:i}=P[e.aspect],a=e.audioStream?.getAudioTracks()[0]??null,o=await N();if(!o)throw Error(`rasterizer-unavailable`);let s=e.el.clientWidth||r,c=Math.min(3,Math.max(1,r/s)),l=0,u=0,d=document.createElement(`canvas`);d.width=r,d.height=i;let f=d.getContext(`2d`,{alpha:!1});f.fillStyle=`#05070c`,f.fillRect(0,0,r,i);let p=document.createElement(`canvas`);p.width=Math.round(r/2),p.height=Math.round(i/2);let m=p.getContext(`2d`),h=!1,g=()=>{m&&(m.drawImage(d,0,0,p.width,p.height),h=!0)},_=()=>new Blob([],{type:`image/png`}),v=async()=>(!h&&l>0&&g(),h?await new Promise(e=>p.toBlob(e,`image/png`))??_():_()),y=async()=>{let t;try{t=await o.domToCanvas(e.el,{scale:c,backgroundColor:`#05070c`})}catch{u++;return}if(!t.width||!t.height){u++;return}u=0,l++;let n=Math.max(r/t.width,i/t.height),a=t.width*n,s=t.height*n;f.fillStyle=`#05070c`,f.fillRect(0,0,r,i),f.drawImage(t,(r-a)/2,(i-s)/2,a,s)},b=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0?await M():null;if(b&&await b.canEncodeVideo(`avc`).catch(()=>!1)&&b){let r=new b.Output({format:new b.Mp4OutputFormat,target:new b.BufferTarget}),i=new b.CanvasSource(d,{codec:`avc`,bitrate:t.bitrate});if(r.addVideoTrack(i),a){let e=new b.MediaStreamAudioTrackSource(a,{codec:`aac`,bitrate:192e3});e.errorPromise.catch(()=>{}),r.addAudioTrack(e)}await r.start();let o=!0,s=!0,c=performance.now(),f=0,m=1e3/n,_=e.maxDurationMs??1/0;(async()=>{for(;o;){let e=performance.now();if(await y(),!o)break;let t=s?0:(performance.now()-c)/1e3;s=!1;try{await i.add(t,Math.max(1/n,t-f))}catch{break}if(f=t,t*1e3>=_)break;!h&&t>1.2&&l>2&&u===0&&g();let r=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,m-r)))}})();let x=()=>{o=!1,a?.stop(),d.width=d.height=0,p.width=p.height=0};return{async stop(){o=!1;let e=await v();await r.finalize();let t=r.target.buffer;return x(),{blob:new Blob([t??new ArrayBuffer(0)],{type:`video/mp4`}),type:`video/mp4`,poster:e,hasAudio:!!a,durationMs:Math.round(performance.now()-c)}},cancel(){o=!1,r.cancel?.(),x()}}}let x=d.captureStream(n),ee=new MediaStream(x.getVideoTracks());a&&ee.addTrack(a);let S=MediaRecorder.isTypeSupported(`video/webm;codecs=vp9,opus`)?`video/webm;codecs=vp9,opus`:`video/webm`,C=new MediaRecorder(ee,{mimeType:S,videoBitsPerSecond:t.bitrate}),w=[];C.ondataavailable=e=>e.data.size&&w.push(e.data);let T=new Promise(e=>{C.addEventListener(`stop`,()=>e(),{once:!0})}),E=()=>{try{C.state!==`inactive`&&C.stop()}catch{}};C.start();let D=!0,O=performance.now(),k=e.maxDurationMs??1/0,te=1e3/n;(async()=>{for(;D;){let e=performance.now();await y();let t=performance.now()-O;if(t>=k){E();break}!h&&t>1200&&l>2&&u===0&&g();let n=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,te-n)))}})();let A=()=>{D=!1;for(let e of ee.getTracks())e.stop();a?.stop(),d.width=d.height=0,p.width=p.height=0};return{async stop(){D=!1;let e=await v();E(),await T;let t=new Blob(w,{type:S}),n=Math.round(performance.now()-O);return A(),{blob:t,type:S,poster:e,hasAudio:!!a,durationMs:n}},cancel(){D=!1,E(),A()}}}var I=n();function ie({slide:e}){"use no memo";let t=b(e);return(0,I.jsx)(t.Slide,{slots:t.slots})}var ae=o(),oe=(0,A.createContext)(0),L=new Set([`hidden`,`clip`,`auto`,`scroll`]);function R(e){let t=(0,ae.c)(11),{children:n}=e,r=(0,A.useRef)(null),i=(0,A.useRef)(null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={k:1,x:0,y:0},t[0]=a):a=t[0];let[o,s]=(0,A.useState)(a),c=(0,A.useContext)(oe),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=r.current,t=i.current;if(!e||!t)return;let n=()=>{let n=e.clientHeight,r=e.clientWidth;if(!n||!r)return;let i=t.style.transform;t.style.transform=`none`,t.style.left=`0`,t.style.top=`0`;let a=[],o=[...t.querySelectorAll(`*`)],c=new Set;for(let e of t.querySelectorAll(`[data-reel-marquee]`)){for(let n=e;n&&n!==t;n=n.parentElement)c.add(n);for(let t of e.querySelectorAll(`*`))c.add(t)}let l=new Set,u=[];for(let e of o){if(c.has(e))continue;let t=getComputedStyle(e);if(t.webkitLineClamp!==`none`){l.add(e);continue}!L.has(t.overflowX)&&!L.has(t.overflowY)||u.push(e)}for(let e of u)a.push({el:e,o:e.style.overflow,m:e.style.maxHeight}),e.style.overflow=`visible`,e.style.maxHeight=`none`;let d=e=>{for(let n=e;n&&n!==t;n=n.parentElement)if(l.has(n))return!0;return!1},f=e=>{let n=0,r=0;for(let i=e;i&&i!==t&&t.contains(i);i=i.offsetParent)n+=i.offsetLeft,r+=i.offsetTop;return{x:n,y:r}},p=t.scrollWidth,m=t.scrollHeight;for(let e of o)if(!c.has(e)&&!d(e)){if(e.scrollWidth>p&&(p=e.scrollWidth),e.scrollHeight>m&&(m=e.scrollHeight),e.scrollWidth>e.clientWidth+1){let t=f(e);t.x+e.scrollWidth>p&&(p=t.x+e.scrollWidth)}if(e.scrollHeight>e.clientHeight+1){let t=f(e);t.y+e.scrollHeight>m&&(m=t.y+e.scrollHeight)}}for(let e of l){let t=f(e);t.x+e.clientWidth>p&&(p=t.x+e.clientWidth),t.y+e.clientHeight>m&&(m=t.y+e.clientHeight)}for(let e of a)e.el.style.overflow=e.o,e.el.style.maxHeight=e.m;if(t.style.transform=i,!m||!p)return;let h=Math.min(1,n*.95/m,r*.92/p),g=Number.isFinite(h)&&h>0?Math.floor(h*1e3)/1e3:1,_=t.firstElementChild,v=_?.offsetWidth||p,y=_?f(_).x:0,b=Math.max(0,(r-v*g)/2-y*g),x=Math.max(0,(n-m*g)/2);s(e=>Math.abs(e.k-g)>.002||Math.abs(e.x-b)>.5||Math.abs(e.y-x)>.5?{k:g,x:b,y:x}:e)};n();let a=!1,o=0;typeof document<`u`&&document.fonts?.ready&&document.fonts.ready.then(()=>{a||(o=requestAnimationFrame(n))});let c=requestAnimationFrame(n),l=0,u=new ResizeObserver(()=>{cancelAnimationFrame(l),l=requestAnimationFrame(n)});return u.observe(e),u.observe(t),()=>{a=!0,u.disconnect(),cancelAnimationFrame(l),cancelAnimationFrame(c),cancelAnimationFrame(o)}},t[1]=l):l=t[1];let u;t[2]!==n||t[3]!==c?(u=[n,c],t[2]=n,t[3]=c,t[4]=u):u=t[4],(0,A.useLayoutEffect)(l,u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={position:`absolute`,inset:0,overflow:`hidden`},t[5]=d):d=t[5];let f=`translate(${o.x}px, ${o.y}px) scale(${o.k})`,p;t[6]===f?p=t[7]:(p={position:`absolute`,left:0,top:0,transformOrigin:`top left`,transform:f},t[6]=f,t[7]=p);let m;return t[8]!==n||t[9]!==p?(m=(0,I.jsx)(`div`,{ref:r,style:d,children:(0,I.jsx)(`div`,{ref:i,style:p,children:n})}),t[8]=n,t[9]=p,t[10]=m):m=t[10],m}var z=[`up`,`left`,`zoom`,`wipe`,`fade`];function B(e,t){let n=e/t;return n<.8?`9:16`:n<1.3?`1:1`:`16:9`}function V(e){let t=e.clientWidth,n=e.clientHeight;if(!t||!n)return!1;let r=Math.min(t,n)/100,i=r*16/9,a=B(t,n),o=`${r}px`,s=e.style.getPropertyValue(`--rw`)!==o||e.dataset.aspect!==a;return e.style.setProperty(`--ru`,`${i}px`),e.style.setProperty(`--rw`,o),e.dataset.aspect=a,s}var H=e=>e.template!==`title`&&e.template!==`outro`,se=e=>e.template===`outro`,U=e=>e.template===`title`;function W(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)H(e[r])&&n++;return n}function ce(e,t){let n=e[t];return n&&H(n)?W(e,t):-1}function le({script:e,timings:t,loop:n=!1,onDone:r,frameRef:i,playKey:a=0,playing:o=!0,initialIndex:s=0,onCycle:c,interactive:l=!1,paused:u,onPausedChange:d}){let f=e.slides,p=f.map((e,n)=>Math.max(800,Math.round(t?.[n]??e.durationMs))),m=Math.max(0,Math.min(s,f.length-1)),[h,g]=(0,A.useState)(m),[_,y]=(0,A.useState)(0),b=u!==void 0,[ee,S]=(0,A.useState)(!1),C=b?u:ee,T=(0,A.useCallback)(()=>{b?d?.(!C):S(e=>!e)},[b,C,d]),[E,D]=(0,A.useState)(0),O=(0,A.useRef)(!1),k=(0,A.useRef)(null),te=(0,A.useRef)(null),j=(0,A.useRef)(i);j.current=i;let ne=(0,A.useCallback)(e=>{te.current=e,j.current?.(e)},[]);(0,A.useEffect)(()=>{l&&te.current?.focus({preventScroll:!0})},[l]);let M=(0,A.useRef)(!1);M.current=C;let N=(0,A.useRef)(null),P=(0,A.useRef)(0),re=(0,A.useCallback)(e=>{k.current=e,e&&V(e)&&D(e=>e+1)},[]);if((0,A.useLayoutEffect)(()=>{let e=k.current;if(!e)return;let t=new ResizeObserver(()=>{V(e)&&D(e=>e+1)});return t.observe(e),()=>t.disconnect()},[]),(0,A.useEffect)(()=>{o&&(O.current=!1,g(m),y(e=>e+1))},[a,o]),(0,A.useEffect)(()=>{if(!o||C||h>=f.length)return;let e=N.current??p[h];N.current=null,P.current=Date.now();let t=window.setTimeout(()=>{h+1<f.length?g(h+1):n?(g(0),y(e=>e+1),c?.()):O.current||(O.current=!0,r?.())},e);return()=>{window.clearTimeout(t),M.current&&(N.current=Math.max(0,e-(Date.now()-P.current)))}},[h,f.length,n,r,a,o,C]),(0,A.useEffect)(()=>{N.current=null},[h]),!f.length)return null;let F=f[Math.min(h,f.length-1)],ae=W(f,h),L=ce(f,h),B=f.filter(H).length,le=e=>{let t=-1;for(let n=0;n<f.length;n++)if(H(f[n])&&t++,t===e){g(n),y(e=>e+1);return}},ue=e=>{if(!B)return;let t=H(F)?L+e:e>0?ae:ae-1;le(Math.max(0,Math.min(B-1,t)))},G=f.reduce((e,t,n)=>(U(t)&&e.push(n),e),[]),K=e=>{if(G.length<=1)return;let t=G.filter(e=>e<=h).length-1;g(G[Math.max(0,Math.min(G.length-1,t+e))]),y(e=>e+1)},de=e=>{switch(e.key){case`ArrowRight`:e.preventDefault(),ue(1);break;case`ArrowLeft`:e.preventDefault(),ue(-1);break;case`ArrowDown`:e.preventDefault(),K(1);break;case`ArrowUp`:e.preventDefault(),K(-1);break;case` `:case`Spacebar`:e.preventDefault(),T();break;default:break}},q=v(F.template)===`dark`,J=x(F.template),Y=h===0?`fade`:z[(h+e.seed)%z.length];return(0,I.jsx)(`div`,{className:`reel`,"data-palette":e.palette,"data-vibe":e.vibe,ref:ne,role:l?`application`:void 0,tabIndex:l?0:void 0,onKeyDown:l?de:void 0,"aria-label":l?`Reel preview. Left and right arrows step between beats, up and down jump sections, space bar pauses.`:void 0,children:(0,I.jsxs)(`div`,{className:`reel-board`,ref:re,"data-surface":q?`dark`:`light`,"data-bleed":J?`true`:`false`,children:[q&&(0,I.jsx)(`div`,{className:`reel-darkwash`,"aria-hidden":`true`}),(0,I.jsx)(`div`,{className:`reel-progress`,"data-interactive":l,"aria-hidden":!l,children:Array.from({length:B},(e,t)=>{let n=t===L,r=t<ae||se(F),i=(0,I.jsx)(`span`,{className:`reel-seg`,children:(0,I.jsx)(`i`,{style:n?{width:0,animation:`reel-seg-fill ${p[h]}ms linear forwards`,animationPlayState:C?`paused`:`running`}:{width:r?`100%`:`0%`}})},`seg`);return l?(0,I.jsx)(`button`,{type:`button`,className:`reel-seg-hit`,onClick:()=>le(t),"aria-label":`Jump to beat ${t+1}`,children:i},t):(0,I.jsx)(`span`,{className:`reel-seg-hit`,children:i},t)})}),(0,I.jsxs)(`div`,{className:`reel-top`,children:[(0,I.jsxs)(`span`,{className:`reel-wordmark`,children:[(0,I.jsx)(`span`,{className:`reel-dot`,"aria-hidden":`true`}),`Mavéa`]}),(0,I.jsx)(`span`,{className:`reel-palettename`,children:e.palette})]}),!J&&(0,I.jsx)(`div`,{className:`reel-jelly-pos`,"aria-hidden":`true`,children:(0,I.jsx)(w,{})}),(0,I.jsx)(`div`,{className:`reel-stage`,children:(0,I.jsx)(`div`,{className:`reel-trans`,"data-trans":Y,children:(0,I.jsx)(oe.Provider,{value:E,children:(0,I.jsx)(R,{children:(0,I.jsx)(ie,{slide:F})})})},`${_}-${h}`)}),(0,I.jsx)(`div`,{className:`reel-pause-badge`,"data-show":l&&C,"aria-hidden":`true`,children:(0,I.jsxs)(`div`,{className:`reel-pause-glyph`,children:[(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{})]})})]})})}function ue(e){let t=[];for(let n of e)t.length===0||n.mode===`replace`?t.push([n]):t[t.length-1].push(n);return t}var G=/^(how|what|why|should|can|could|would|will|plan|show|make|build|tell|give|explain|who|when|where|which|is|are|do|does|did|help|me)\b[\s,]*/i,K=/\s*[,;:]\s+|\s+—\s+|\s+–\s+|\s+\band\b\s+|\s+\bbut\b\s+|\s+\bso\b\s+/i;function de(e){let t=e[0];if(!t)return``;let n=t.spec?.title?.trim();if(n)return m(n,h.heading);let r=(t.question||``).trim();if(!r)return``;let i=r.replace(G,``).replace(/[?!.]+$/,``).trim(),a=(i.split(K)[0]||``).trim()||i;return a?m(a.charAt(0).toUpperCase()+a.slice(1),h.heading):``}r();var q={palette:`aurora`,vibe:`clean`,maxSlides:6};function J(e){return m(e[0]?.question||e[0]?.spec?.title||`Mavéa`,h.title)}function Y(e){return e[0]?.spec?.topic||e[0]?.spec?.title||J(e)}function fe(e){return(e||``).replace(/\s+/g,` `).split(/(?<=[.!?])\s+/).map(e=>e.trim()).filter(e=>e.length>1)}function pe(e){return(e.narration||e.spec?.found||e.spec?.sub||``).trim()}function X(e){return(e.spoken||e.narration||e.spec?.found||e.spec?.sub||``).trim()}var me=0;function he(e,t,n,r,i){let a=m(E(r.voiceover),h.voiceover);return{id:`s${me++}`,content:e,template:t,slots:y(e,n,i),voiceover:a,durationMs:Math.max(r.ms,a?Math.round(a.length/13*1e3)+500:0),sourceBlockId:r.sourceBlockId}}function ge(e,t,n,r,i,a){return he(e,S(e,i,a,_(e,t)),t,n,r)}function _e(e,t){return Math.max(1,Math.min(t,Math.floor((e-1)/2)))}function Z(e,t,n=0){let r=Math.max(t,e-1-t);return Math.max(1,Math.floor(r/t)+ +(n<r%t))}function ve(e,t,n,r){let i=J(e.frames);return he(`title`,`title`,{question:i,kicker:e.heading||de(e.frames)||void 0,part:n>1?{index:t+1,count:n}:void 0},{voiceover:i,ms:g.intro},r)}function ye(e,t,n){let r=e.flatMap(e=>e.frames),i=J(r),a=Y(r),o=[];e.forEach((t,n)=>{let r={topic:Y(t.frames),question:J(t.frames)};o.push(ve(t,n,e.length,r)),o.push(...t.content)});let s={topic:a,question:i};return o.push(he(`outro`,`outro`,{wordmark:`Mavéa`,tagline:`Talk to AI. See what it means.`},{voiceover:`Made with Mavéa.`,ms:g.outro},s)),{topic:a,question:i,palette:t.palette,vibe:t.vibe,seed:n,slides:o,durationMs:o.reduce((e,t)=>e+t.durationMs,0)}}function be(e,t){return{...e,seed:t,slides:e.slides.map((e,n)=>e.content===`title`||e.content===`outro`?e:{...e,template:S(e.content,t,n,_(e.content,e.slots),e.template)})}}function xe(e,t,n){let r=e.flatMap(e=>e.spec?.blocks??[]).map(e=>({shown:T((e.note||``).trim()),spoken:E((e.noteSpoken||e.note||``).trim())})).filter(e=>e.shown.length>8),i=r.map(e=>e.shown),a=r.map(e=>e.spoken||e.shown),o=[];if(e.forEach((e,t)=>{let n=pe(e),r=fe(X(e)),s=fe(T(n));s.length&&o.push({speaksFor:t,covers:!0,content:`quote`,raw:{quote:s[0]},voiceover:r.slice(0,2).join(` `)}),t===0&&i.length>=2&&o.push({speaksFor:t,covers:!1,content:`list`,raw:{items:i.slice(0,4)},voiceover:a.slice(0,3).join(`. `)})}),!o.length){let e=t.question;o.push({speaksFor:0,covers:!0,content:`quote`,raw:{quote:e},voiceover:e})}let s=new Set;for(let e of[!0,!1])for(let t of o){if(s.size>=n)break;t.covers===e&&!s.has(t)&&s.add(t)}return o.filter(e=>s.has(e)).map((e,n)=>ge(e.content,e.raw,{voiceover:e.voiceover,ms:g.default},t,0,n+1))}function Q(e,t){let n=ue(e);return n.slice(-_e(t,n.length))}function Se(e,t={}){let n={...q,...t},r=Q(e,n.maxSlides);return ye(r.map((e,t)=>({frames:e,content:xe(e,{topic:Y(e),question:J(e)},Z(n.maxSlides,r.length,t))})),n,0)}var $=p,Ce=`You are Mavéa's reel director. You recut a finished conversation into a short, vertical (9:16) social video — a sequence of card "beats" for TikTok/Reels/Shorts. Each beat is ONE card with very little room.
|
|
3
|
-
|
|
4
|
-
Return ONLY JSON: {"heading": <string>, "slides":[{ "type": <content-type>, "slots": {…}, "voiceover": <string> }]}. Give 3 to 5 content beats (the intro question and the outro are added for you — do NOT include them).
|
|
5
|
-
|
|
6
|
-
"heading" is a short, punchy title for this reel — a headline that sums up what it's about, at most 32 characters. It sits ABOVE the literal question (which is quoted verbatim elsewhere), so it must NOT just restate the question — it's the sharper, sub-editor's version of it.
|
|
7
|
-
|
|
8
|
-
Choose a "type" per beat — the kind of thing it says — and fill its slots:
|
|
9
|
-
- stat {value,label,unit?,prior?} — one headline number.
|
|
10
|
-
- metrics {items:[{label,pct}],next?} — a few labelled percentages.
|
|
11
|
-
- ranked {title?,items:[{label,score,pct}]} — a ranked comparison.
|
|
12
|
-
- quote {quote,highlight?,attribution?} — one strong sentence.
|
|
13
|
-
- list {items:[string],title?} — up to 4 short points.
|
|
14
|
-
- concept {title,subtitle?,tag?} — a concept/term and a one-line gloss.
|
|
15
|
-
- conceptmap {center,nodes:[{label}]} — a concept and what connects to it.
|
|
16
|
-
- qa {question,answer} — a question and its answer.
|
|
17
|
-
- chat {messages:[{role:"user"|"mavea",text}]} — a short exchange.
|
|
18
|
-
- diagram {label,equation?,vectors?:[{label}],note?} — a formula / diagram idea.
|
|
19
|
-
- steps {stops:[{label,state:"done"|"active"|"todo"}]} — a path or milestones.
|
|
20
|
-
- recap {topic,metrics:[{label,value}]} — a tidy summary of figures.
|
|
21
|
-
|
|
22
|
-
Rules:
|
|
23
|
-
- REAL DATA ONLY. Use only facts, numbers and wording present in the conversation. Never invent a number, label or statistic. If a type needs data the conversation doesn't have, choose a different type.
|
|
24
|
-
- IT MUST FIT THE CARD — write to these MAX CHARACTER limits so every value fits its slide with nothing cut. A beat may be re-styled into any look for its type, so write to the tightest. Counts are characters incl. spaces:
|
|
25
|
-
${[`stat — value ≤${$.stat.value}, label ≤${$.stat.label}, unit ≤${$.stat.unit}, prior ≤${$.stat.prior}.`,`metrics — ≤${$.metrics.items} items, each label ≤${$.metrics.label}; next ≤${$.metrics.next}.`,`ranked — ≤${$.ranked.items} items, label ≤${$.ranked.label}, score ≤${$.ranked.score}; title ≤${$.ranked.title}.`,`quote — quote ≤${$.quote.quote}, highlight ≤${$.quote.highlight}, attribution ≤${$.quote.attribution}.`,`list — ≤${$.list.items} items, each ≤${$.list.item}.`,`concept — title ≤${$.concept.title} (1–2 words), subtitle ≤${$.concept.subtitle}, tag ≤${$.concept.tag}.`,`conceptmap — center ≤${$.conceptmap.center}, ≤${$.conceptmap.nodes} nodes, each label ≤${$.conceptmap.node}.`,`qa — question ≤${$.qa.question}, answer ≤${$.qa.answer}.`,`chat — ≤${$.chat.messages} messages, each ≤${$.chat.message}.`,`diagram — label ≤${$.diagram.label}, equation ≤${$.diagram.equation}, note ≤${$.diagram.note}.`,`steps — ≤${$.steps.stops} stops, each label ≤${$.steps.label}.`,`recap — topic ≤${$.recap.topic}, ≤${$.recap.metrics} metrics, label ≤${$.recap.label}, value ≤${$.recap.value}.`].map(e=>` · ${e}`).join(`
|
|
26
|
-
`)}
|
|
27
|
-
- Match each beat to the type that fits it best; vary the types across the reel.
|
|
28
|
-
- "voiceover" is what's spoken over the slide — one natural, conversational sentence. Condense hard — trim filler, keep the punchy core.
|
|
29
|
-
- In every voiceover, preserve normal spelling on the left and provide native/source-language pronunciation for every name, place, brand, or non-English term a voice might misread as [[shown|said]], for example "[[Omakase|oh-mah-kah-seh]]". The said side must be lowercase voice-safe phonetic syllables, never IPA or an Anglicized guess. This is required and does not change the visible slot text.`,we={type:`object`,properties:{heading:{type:`string`},slides:{type:`array`,items:{type:`object`,properties:{type:{type:`string`,enum:C},slots:{type:`object`},voiceover:{type:`string`}},required:[`type`,`slots`,`voiceover`]}}},required:[`slides`]};function Te(e){let t=(e.note||``).trim(),n=``;try{let t=JSON.stringify(e.props);t&&t!==`{}`&&(n=` data=${m(t,220)}`)}catch{}return`- [${e.type}]${t?` ${m(t,120)}`:``}${n}`}function Ee(e){return e.slice(0,4).map(e=>{let t=(e.spec?.blocks??[]).slice(0,8).map(Te).join(`
|
|
30
|
-
`);return`Q: ${e.question}\nMavea: ${m(pe(e),400)}\nCards:\n${t}`}).join(`
|
|
31
|
-
|
|
32
|
-
`)}function De(e){let t=e;if(typeof e==`string`){let n=e.indexOf(`{`),r=e.lastIndexOf(`}`);if(n<0||r<0)return{slides:[],heading:``};try{t=JSON.parse(e.slice(n,r+1))}catch{return{slides:[],heading:``}}}let n=t;return{slides:Array.isArray(n?.slides)?n.slides:[],heading:typeof n?.heading==`string`?n.heading:``}}async function Oe(e,t,n,r){let i=new AbortController,a=setTimeout(()=>i.abort(),18e3);try{let{getAdapter:a}=await s(async()=>{let{getAdapter:e}=await import(`./providers-wzm7E8Pa.js`).then(e=>e.n);return{getAdapter:e}},__vite__mapDeps([3,1,4,5])),{slides:o,heading:c}=De((await a(t.provider).generate({system:Ce,history:[],user:`Recut this conversation into ${r} or fewer content beats.\n\n${Ee(e)}`,maxTokens:Math.min(2200,350+r*260),temperature:.6,format:we,signal:i.signal},t)).raw),l=new Set(C),u=[];for(let e of o){let t=e,i=t.type;if(!i||!l.has(i))continue;let a=t.slots&&typeof t.slots==`object`?t.slots:{};if(u.push(ge(i,a,{voiceover:t.voiceover||t.caption||``,ms:g.default},n,0,u.length+1)),u.length>=r)break}return u.length?{frames:e,content:u,heading:c?m(c,h.heading):void 0}:null}catch{return null}finally{clearTimeout(a)}}var ke=3;async function Ae(e,t,n={}){let r={...q,...n},i=Q(e,r.maxSlides),a=e=>Z(r.maxSlides,i.length,e);try{let o=[];for(let[r,s]of i.entries()){let i={topic:Y(s),question:J(s)};if(r<ke){let c=await Oe(s,t,i,a(r));if(!c)return Se(e,n);o.push(c)}else o.push({frames:s,content:xe(s,i,a(r))})}return ye(o,r,0)}catch{return Se(e,n)}}var je=24e3,Me=.15,Ne=.18,Pe=240,Fe=.008,Ie=.89,Le=6;async function Re(e,t,n){let r=k(e).trim().slice(0,Pe);if(!r)return new Float32Array;for(let e=0;e<2;e++)try{let e=await fetch(`/tts/v1/audio/speech`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:`kokoro`,input:r,voice:t,response_format:`pcm`,speed:1}),signal:n});if(e.ok)return O(new Uint8Array(await e.arrayBuffer()),null).samples}catch{if(n?.aborted)return new Float32Array}return new Float32Array}async function ze(e,t){let n=e.slides,r=n.map(e=>Math.max(800,Math.round(e.durationMs))),i=a();if(!i||typeof OfflineAudioContext>`u`)return{buffer:null,timings:r,missing:0};let o=D(`mavea`),s=await Promise.all(n.map(e=>Re(e.voiceover,o,t))),c=n.filter(e=>e.voiceover.trim()).length,l=s.filter(e=>e.length>0).length,u=Math.max(0,c-l);if(l===0)return{buffer:null,timings:r,missing:u};let d=n.map((e,t)=>{let n=s[t].length/je*1e3;return Math.round(n>0?Math.max(r[t],n+Ne*1e3):r[t])}),f=0;for(let e of s)for(let t=0;t<e.length;t++)f=Math.max(f,Math.abs(e[t]));let p=f>0?Math.min(Le,Ie/f):1,m=i.sampleRate,h=.65+d.reduce((e,t)=>e+t/1e3,0),g=new OfflineAudioContext(1,Math.ceil(h*m),m),_=g.createGain();_.gain.value=p,_.connect(g.destination);let v=Me;return d.forEach((e,t)=>{let n=s[t];if(n.length){let e=g.createBuffer(1,n.length,je);e.getChannelData(0).set(n);let t=g.createBufferSource();t.buffer=e;let r=g.createGain(),i=n.length/je,a=Math.min(Fe,i/2);r.gain.setValueAtTime(0,v),r.gain.linearRampToValueAtTime(1,v+a),r.gain.setValueAtTime(1,v+i-a),r.gain.linearRampToValueAtTime(0,v+i),t.connect(r).connect(_),t.start(v)}v+=e/1e3}),{buffer:await g.startRendering(),timings:d,missing:u}}function Be(e){let t=a();if(!t||typeof t.createMediaStreamDestination!=`function`)return null;let n=t.createMediaStreamDestination(),r=t.createBufferSource();r.buffer=e,r.connect(n);let i=!1;return{stream:n.stream,start(){i||(i=!0,t.state!==`running`&&t.resume().catch(()=>{}),r.start())},stop(){try{r.stop()}catch{}try{r.disconnect()}catch{}}}}function Ve(e,t,n){return t+Math.max(0,n-e)}function He(e,t){return!Number.isFinite(t)||t<=0||e>=t?null:Math.max(0,e)}function Ue(e){let t=a();if(!t)return null;let n=t.createGain();n.connect(t.destination);let r=null,i=0,o=0,s=!1,c=()=>{try{r?.stop(),r?.disconnect()}catch{}r=null},l=a=>{c(),r=t.createBufferSource(),r.buffer=e,r.connect(n),r.start(0,a),i=a,o=t.currentTime,s=!1};return{play(){t.state!==`running`&&t.resume().catch(()=>{}),l(0)},setMuted(e){n.gain.value=+!e},pause(){s||!r||(i=Math.min(e.duration,Ve(o,i,t.currentTime)),c(),s=!0)},resume(){if(!s)return;s=!1;let n=He(i,e.duration);n!==null&&(t.state!==`running`&&t.resume().catch(()=>{}),l(n))},stop(){c();try{n.disconnect()}catch{}}}}var We=[{id:`aurora`,label:`Aurora`,dot:`linear-gradient(135deg,#6d6dff,#a78bfa)`,blurb:`Indigo`},{id:`ember`,label:`Ember`,dot:`linear-gradient(135deg,#f4923c,#e0603a)`,blurb:`Warm amber`},{id:`ocean`,label:`Ocean`,dot:`linear-gradient(135deg,#2ad0e6,#0f9bad)`,blurb:`Deep teal`},{id:`chalk`,label:`Chalk`,dot:`linear-gradient(135deg,#c3c8d6,#7d8398)`,blurb:`Editorial`}],Ge=e({ShareModal:()=>Qe}),Ke=[{id:`9:16`,label:`Story`,w:12,h:20},{id:`1:1`,label:`Square`,w:16,h:16},{id:`16:9`,label:`Landscape`,w:20,h:12}],qe=[{id:`balanced`,label:`Balanced`},{id:`high`,label:`High`},{id:`ultra`,label:`Ultra`}],Je={idle:``,voicing:`Synthesizing narration…`,recording:`Recording the reel…`,saving:`Finishing the file…`,error:`Something went wrong`},Ye=new Map;function Xe(e,t,n){let r=Ye.get(e);if(r)return r;let i=Ae(t,n);if(Ye.set(e,i),Ye.size>8){let e=Ye.keys().next().value;e&&Ye.delete(e)}return i}function Ze(e){return e.slides.map(e=>e.voiceover).join(`\0`)}function Qe({frames:e,script:t,cfg:n,onClose:r,onShared:a}){let[o,s]=(0,A.useState)(`9:16`),[p,m]=(0,A.useState)(`aurora`),[h,g]=(0,A.useState)(`high`),[_,v]=(0,A.useState)(()=>t??(e?.length?Se(e):null)),[y,b]=(0,A.useState)(!1),[x,S]=(0,A.useState)(!1),[C,w]=(0,A.useState)(!1),[T,E]=(0,A.useState)(`idle`),[D,O]=(0,A.useState)(!1),[k,j]=(0,A.useState)(!1),[M,N]=(0,A.useState)(!1),[P,ie]=(0,A.useState)(!1),[ae,oe]=(0,A.useState)(0),L=T===`voicing`||T===`recording`||T===`saving`,R=(0,A.useRef)(null),z=(0,A.useRef)(null),B=(0,A.useRef)(null),V=(0,A.useRef)(void 0),H=(0,A.useRef)(`share`),se=(0,A.useRef)(`high`);se.current=h;let U=(0,A.useRef)(null),W=(0,A.useRef)(null),[ce,ue]=(0,A.useState)(null),G=(0,A.useRef)(!1),K=(0,A.useCallback)(()=>{G.current=!0},[]),de=(0,A.useMemo)(()=>i(()=>ee().then(()=>void 0)),[]),q=(0,A.useRef)(null),[J,Y]=(0,A.useState)(!1);(0,A.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(max-width: 760px)`),t=()=>Y(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),l(q,{onEscape:(0,A.useCallback)(()=>{L||r()},[L,r]),initialFocus:R});let fe=(e??[]).map(e=>`${e.at}:${e.question}`).join(`|`),pe=n?`${n.provider}:${n.model}:${n.baseUrl??``}`:``;(0,A.useEffect)(()=>{let r=!0;if(G.current=!1,b(!1),U.current?.stop(),U.current=null,W.current=null,ue(null),j(!1),ie(!1),oe(0),t)return v(t),()=>{r=!1};let i=e??[];return v(Se(i)),n&&Xe(`${fe}\u0001${pe}`,i,n).then(e=>{!r||G.current||(v(e),b(!0))}),()=>{r=!1}},[fe,pe,t]);let X=(0,A.useMemo)(()=>_?{..._,palette:p}:null,[_,p]),me=_?Math.max(6,Math.round(_.durationMs/1e3)):0,he=ce?Math.max(6,Math.round(ce.reduce((e,t)=>e+t,0)/1e3)):null,ge=he??me,_e=X?`${o}-${x?`rec`:`preview-${X.seed}-${ce?`synced`:`rough`}`}`:null,Z=(0,A.useRef)(!1);Z.current=k;let ve=(0,A.useCallback)(async()=>{if(K(),k){U.current?.setMuted(!0),j(!1);return}if(!X)return;let e=Ze(X),t=W.current;if(!t||t.sig!==e){N(!0);try{t={sig:e,...await ze(X)},W.current=t}finally{N(!1)}}t.buffer&&(U.current||=Ue(t.buffer),U.current?.setMuted(!1),U.current?.play(),P&&U.current?.pause(),ue(t.timings),j(!0))},[k,X,P,K]);(0,A.useEffect)(()=>()=>{U.current?.stop(),U.current=null},[]);let ye=(0,A.useCallback)(e=>{K(),ie(e),Z.current&&(e?U.current?.pause():U.current?.resume())},[K]),xe=(0,A.useCallback)(()=>{K(),ie(!1),oe(e=>e+1),Z.current&&U.current?.play()},[K]),Q=(0,A.useCallback)((e=`idle`)=>{z.current?.cancel(),z.current=null,B.current?.stop(),B.current=null,V.current=void 0,S(!1),w(!1),E(e)},[]);(0,A.useEffect)(()=>()=>Q(),[Q]),(0,A.useEffect)(()=>{if(!x||!D||z.current||!R.current)return;let e=!1,t=(V.current??[]).reduce((e,t)=>e+t,0);return F({el:R.current,audioStream:B.current?.stream??null,aspect:o,quality:se.current,maxDurationMs:t?t+900:void 0}).then(t=>{if(e){t.cancel();return}z.current=t,B.current?.start(),w(!0)}).catch(()=>{f(`Couldn't render the clip in this browser`,`warn`),Q(`error`)}),()=>{e=!0}},[x,D,o,Q]);let $=(0,A.useCallback)(e=>{if(L||!X)return;if(K(),!re()){f(`This browser can't render a video clip`,`warn`);return}H.current=e,E(`voicing`);let t=Ze(X),n=W.current;(n&&n.sig===t?Promise.resolve(n):ze(X)).then(e=>{W.current={sig:t,...e};let{buffer:n,timings:r,missing:i}=e;V.current=r,B.current=n?Be(n):null,i>0&&f(`${i} narration line${i===1?``:`s`} couldn’t be voiced — exporting the rest.`,`warn`),w(!1),O(!1),E(`recording`),S(!0)}).catch(()=>{f(`Could not prepare the narration`,`warn`),Q(`error`)})},[L,X,Q,K]),Ce=(0,A.useCallback)(async()=>{let e=z.current;if(!e){Q();return}z.current=null,E(`saving`);try{let t=await e.stop();H.current===`download`?(d(t.blob),f(`Saved to your downloads`,`good`)):await u(t,{title:`My Mavéa reel`,text:`Made with Mavéa`})===`downloaded`&&f(`Saved to your downloads`,`good`),a?.(),Q()}catch{f(`Could not finish the clip`,`warn`),Q(`error`)}},[Q,a]);if(!t&&!e?.length)return null;let we=()=>{K(),ie(!1),v(e=>e&&be(e,e.seed+1))};return(0,I.jsx)(`div`,{className:`shm-scrim`,role:`presentation`,onClick:L?void 0:e=>e.target===e.currentTarget&&r(),children:(0,I.jsxs)(`div`,{ref:q,className:`shm-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`Share your Mavéa session as a clip`,style:J?{flexDirection:`column`}:void 0,children:[(0,I.jsxs)(`div`,{className:`shm-panel`,children:[(0,I.jsx)(`div`,{className:`shm-eyebrow`,children:`▷ MAVÉA REPLAY`}),(0,I.jsxs)(`div`,{className:`shm-headline`,children:[`Your session, as`,he?``:` about`,` a`,` `,(0,I.jsx)(`span`,{style:{color:`var(--presence-soft)`},children:ge?`${ge}-second`:``}),` `,`clip.`]}),(0,I.jsx)(`div`,{className:`shm-sub`,children:`Auto-cut from the conversation and rendered in this browser. Model direction and narration may use your selected providers; sharing sends the finished file to the destination you choose.`}),(0,I.jsx)(te,{kind:`publishing`,from:`live`}),X&&!x&&(0,I.jsxs)(`div`,{className:`shm-kbd-hint`,"aria-hidden":`true`,children:[(0,I.jsx)(`kbd`,{children:`←`}),(0,I.jsx)(`kbd`,{children:`→`}),` beats · `,(0,I.jsx)(`kbd`,{children:`↑`}),(0,I.jsx)(`kbd`,{children:`↓`}),` sections · `,(0,I.jsx)(`kbd`,{children:`space`}),` pause`]}),(0,I.jsxs)(`div`,{className:`shm-group`,children:[(0,I.jsx)(`div`,{className:`shm-label`,children:`Palette`}),(0,I.jsx)(`div`,{className:`shm-chips`,children:We.map(e=>(0,I.jsxs)(`button`,{type:`button`,className:`shm-chip`,"data-active":p===e.id,disabled:L,onClick:()=>{K(),m(e.id)},title:e.blurb,children:[(0,I.jsx)(`span`,{className:`shm-dot`,style:{background:e.dot},"aria-hidden":`true`}),e.label]},e.id))})]}),(0,I.jsxs)(`div`,{className:`shm-group`,children:[(0,I.jsx)(`div`,{className:`shm-label`,children:`Format`}),(0,I.jsx)(`div`,{className:`shm-chips`,children:Ke.map(e=>(0,I.jsxs)(`button`,{type:`button`,className:`shm-chip`,"data-active":o===e.id,disabled:L,onClick:()=>{K(),s(e.id)},children:[(0,I.jsx)(`span`,{className:`shm-shape`,style:{width:e.w,height:e.h},"aria-hidden":`true`}),e.label]},e.id))})]}),(0,I.jsxs)(`div`,{className:`shm-group`,children:[(0,I.jsx)(`div`,{className:`shm-label`,children:`Quality`}),(0,I.jsx)(`div`,{className:`shm-chips`,children:qe.map(e=>(0,I.jsx)(`button`,{type:`button`,className:`shm-chip`,"data-active":h===e.id,disabled:L,onClick:()=>{K(),g(e.id)},title:ne(e.id),children:e.label},e.id))})]}),(0,I.jsxs)(`div`,{className:`shm-actions`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`shm-btn shm-btn-primary`,disabled:L||!X,onClick:()=>$(`share`),children:[L?(0,I.jsx)(`span`,{className:`shm-spin`,"aria-hidden":`true`}):`⤴`,L?Je[T]:`Share`]}),(0,I.jsx)(`button`,{type:`button`,className:`shm-btn`,disabled:L||!X,onClick:()=>$(`download`),children:`↓ Download`}),(0,I.jsx)(`button`,{type:`button`,className:`shm-remix`,...de,disabled:L||!_||!!t,onClick:we,title:`Re-roll the look (same content, free)`,children:`↻ Remix`})]}),(0,I.jsxs)(`div`,{className:`shm-progress`,"data-on":L,"aria-hidden":!L,children:[(0,I.jsx)(`div`,{className:`shm-progress-bar`,children:(0,I.jsx)(`i`,{})}),(0,I.jsx)(`span`,{className:`shm-progress-text`,children:Je[T]||` `})]})]}),(0,I.jsx)(`div`,{className:`shm-stage`,children:(0,I.jsxs)(`div`,{className:`shm-frame`,"data-aspect":o,"data-directed":y,children:[X?(0,I.jsx)(le,{script:X,timings:x?V.current:ce??void 0,loop:!x,playing:x?C:!0,playKey:x?0:ae,paused:x?void 0:P,onPausedChange:x?void 0:ye,initialIndex:!x&&X.seed>0?Math.max(0,X.slides.findIndex(e=>e.content!==`title`&&e.content!==`outro`)):0,interactive:!x,onCycle:()=>{Z.current&&U.current?.play()},frameRef:e=>{R.current=e,e&&O(!0)},onDone:x?Ce:void 0},_e):(0,I.jsxs)(`div`,{className:`shm-composing`,children:[(0,I.jsx)(`span`,{className:`shm-composing-dot`}),`Composing your reel…`]}),X&&!x&&(0,I.jsxs)(`div`,{className:`shm-controls`,children:[(0,I.jsx)(`button`,{type:`button`,className:`shm-sound`,"data-on":k,onClick:ve,disabled:M,"aria-pressed":k,title:k?`Mute preview`:`Play sound`,children:M?(0,I.jsx)(`span`,{className:`shm-spin`,"aria-hidden":`true`}):k?(0,I.jsx)(c.speaker,{style:{width:18,height:18}}):(0,I.jsx)(c.speakerOff,{style:{width:18,height:18}})}),(0,I.jsx)(`button`,{type:`button`,className:`shm-sound`,"data-on":P,onClick:()=>ye(!P),"aria-pressed":P,title:P?`Play`:`Pause`,children:P?(0,I.jsx)(c.play,{style:{width:17,height:17}}):(0,I.jsx)(c.pause,{style:{width:17,height:17}})}),(0,I.jsx)(`button`,{type:`button`,className:`shm-sound`,onClick:xe,title:`Replay from the start`,children:(0,I.jsx)(c.refresh,{style:{width:17,height:17}})})]})]})}),(0,I.jsx)(`button`,{type:`button`,className:`shm-close`,onClick:L?void 0:r,"aria-label":`Close`,children:`✕`})]})})}export{Ge as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,x as t}from"./shapes-RqjqC0ay.js";import{E as n,S as r}from"./useStudy-Bflreq2a.js";import{i,t as a}from"./useLiveConfig-X9Wxh90k.js";import{i as o,r as s}from"./store-BFrJaSxJ.js";import{a as c,c as l,r as u,s as d}from"./store-DXmC_fP2.js";import{r as f,t as p}from"./store-BFC7DZcg.js";import{c as m,l as h,u as g}from"./store-DgG0C1Qx.js";function _(){let e=m();return{app:`mavea`,kind:`backup`,version:1,exportedAt:Date.now(),data:{dashboards:r(),memory:t(),flashcards:u(),study:c(),library:s(),atlas:p(),courses:{courses:e,progress:Object.fromEntries(e.map(e=>[e.id,h(e.id)]))},settings:JSON.parse(a())}}}function v(){let e=JSON.stringify(_()),t=new Blob([e],{type:`application/json`}),n=URL.createObjectURL(t);try{let e=document.createElement(`a`);e.href=n,e.download=`mavea-backup-${new Date().toISOString().slice(0,10)}.json`,e.click()}finally{URL.revokeObjectURL(n)}}var y=e=>Array.isArray(e)?e:[];function b(t){if(t.length>25e6)throw Error(`That file is too large to be a Mavéa backup.`);let r;try{r=JSON.parse(t)}catch{throw Error(`This file isn’t valid JSON — it may be corrupted or not a Mavéa backup.`)}if(!r||typeof r!=`object`)throw Error(`This file isn’t a Mavéa backup.`);let a=r;if(a.app!==`mavea`||a.kind!==`backup`||typeof a.version!=`number`||!a.data)throw Error(`This file isn’t a Mavéa backup.`);let s=a.data,c={dashboards:n(y(s.dashboards)),memory:e(y(s.memory)),flashcards:d(y(s.flashcards)),studyStyle:l(s.study),library:o(y(s.library)),atlas:f(y(s.atlas)),courses:s.courses&&typeof s.courses==`object`?g(s.courses.courses,s.courses.progress):0,settingsApplied:!1,versionAhead:a.version>1};if(s.settings&&typeof s.settings==`object`){let e={...s.settings,keys:{},searchKeys:{},rememberKey:!1};i(JSON.stringify(e)),c.settingsApplied=!0}return c}export{v as downloadBackup,b as importBackup};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./ReplayCard-BpYO5vX-.js";import"./TopicCanvas-CT0eSj2M.js";import"./CanvasSkeleton-BZZPCuRZ.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./blockLabel-DAqaHKy3.js";import{A as t}from"./shapes-RqjqC0ay.js";var n=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`,`var(--presence-soft)`,`var(--warning-soft)`],r=/^(how|what|why|should|can|could|would|will|plan|show|make|build|tell|give|explain|who|when|where|which|is|are|do|does|did|help|me)\b[\s,]*/i;function i(e,t=36){let n=e.trim().replace(/\s+/g,` `);if(n.length<=t)return n;let r=n.slice(0,t),i=r.lastIndexOf(` `);return(i>t*.5?r.slice(0,i):r).replace(/[\s,.;:–-]+$/,``)+`…`}function a(e){let t=e.spec?.title?.trim();if(t)return i(t);let n=e.question?.replace(r,``).trim();return n?i(n.charAt(0).toUpperCase()+n.slice(1)):`Moment`}function o(e){let t=e.toLowerCase();return/\b(build|model|schema|architecture|data model|pipeline|system|wire up)\b/.test(t)?`layers`:/\b(prove|verify|evidence|sources?|cite|citation|try|test|double-check|check)\b/.test(t)?`check`:/\b(card|dashboard|one-?pager|slide|widget|panel)\b/.test(t)?`screen`:/\b(show me|show|generate|draw|chart|graph|diagram|render|visuali[sz]e|design|map)\b/.test(t)?`sparkle`:`mic`}var s={compare:`table`,standings:`table`,scoreboard:`table`,table:`table`,kpi:`table`,chart:`chart`,bars:`chart`,stack:`chart`,scatter:`chart`,heat:`chart`,donut:`chart`,gauge:`chart`,ring:`chart`,map:`globe`,geomap:`globe`,gallery:`image`,timeline:`clock`,quotes:`quote`,pullquote:`quote`,checklist:`check`,checks:`check`,insight:`spark`,codemap:`layers`,schema:`layers`,diff:`layers`,flow:`layers`,pipeline:`layers`},c=new Set([`divider`]),l=8;function u(t){let n=[],r=new Set;for(let i of t){let t=i.id;if(!(!t||r.has(t)||c.has(i.type))&&(r.add(t),n.push({id:t,label:e(i),icon:s[i.type]??`spark`}),n.length>=l))break}return n}function d(e,r){let i=[],s=t(e,r??null);return e.forEach((e,t)=>{let r={frameIndex:t,question:e.question||``,icon:o(e.question||``),mode:e.mode,elements:u(e.spec?.blocks??[])};if(s[t]){let o=i.length;i.push({id:`ch-`+t,title:a(e),color:e.spec?.tint||n[o%n.length],moments:[r]})}else i[i.length-1].moments.push(r)}),i}function f(e){return e.reduce((e,t)=>e+t.moments.length,0)}export{f as n,d as r,n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./store-4JNNn732.js";function t(){let t=!1;try{t=!!localStorage.getItem(e)}catch{}return t?{href:`#/live`,label:`Live`}:{href:`#/`,label:`Mavéa`}}export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-BVpWp9h4.js";import{c as t,d as n,f as r,l as i,s as a}from"./index-y8GL67bB.js";import{r as o,t as s}from"./spokenText-D4zPX9JY.js";var c=24e3,l=.08,ee=.2,te=2,u=0;function ne(){u+=1}function d(){return u}function re(e,t){if(e.length===0)return{samples:new Float32Array,carry:t};let n=t!==null,r=+!!n+e.length,i=r>>1,a=new Float32Array(i),o=0,s=0;if(n&&i>0){let n=t|e[0]<<8;n>=32768&&(n-=65536),a[o++]=n/32768,s=1}for(;o<i;o++,s+=2){let t=e[s]|e[s+1]<<8;t>=32768&&(t-=65536),a[o]=t/32768}return{samples:a,carry:(r&1)==1?e[e.length-1]:null}}var ie=null;function f(e){ie=e}var p=1,m=!1,h=()=>m?0:p;function g(e){p=Math.min(1,Math.max(.05,e)),b&&(b.gain.gain.value=h())}var _=1;function ae(e){_=Math.min(2,Math.max(.75,e))}function v(){return _}function y(e){m=e,b&&(b.gain.gain.value=h())}var b=null,x=0,S=null;function C(e){for(let t of e.sources){try{t.stop()}catch{}try{t.disconnect()}catch{}}e.sources.clear();try{e.releaseTap()}catch{}try{e.gain.disconnect()}catch{}try{e.abort.abort()}catch{}b===e&&(b=null)}function w(){x++,S?.abort(),S=null;let e=b;e&&(e.cancelled=!0,e.finishEarly?.(),C(e))}var oe=e=>new Promise(t=>setTimeout(t,e));async function T(e,n,r){let a=t();if(!a)return!1;if(a.state!==`running`)try{await a.resume()}catch{}if(a.state!==`running`)return!1;let o=new AbortController,s=x;S=o;let u;try{u=await fetch(`/tts/v1/audio/speech`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:`kokoro`,input:e,voice:n,response_format:`pcm`,speed:_}),signal:o.signal})}catch{return S===o&&(S=null),s!==x}if(S===o&&(S=null),s!==x){try{o.abort()}catch{}return!0}if(!u.ok||!u.body)return!1;let d=a.createGain();d.gain.value=h();let f={sources:new Set,releaseTap:i(d),gain:d,abort:o,cancelled:!1};b&&(b.cancelled=!0,C(b)),b=f;let p=a.currentTime+l,m=!1,g=ie;try{g?.begin(e)}catch{}let ae=e=>{if(!e.length)return;let t=a.createBuffer(1,e.length,c);t.getChannelData(0).set(e);let n=a.createBufferSource();if(n.buffer=t,n.connect(d),p<a.currentTime&&(p=a.currentTime+.02,ne()),n.start(p),p+=t.duration,!m)try{r?.()}catch{}m=!0,f.sources.add(n),n.onended=()=>{f.sources.delete(n);try{n.disconnect()}catch{}}},v=[],y=0,w=Math.round(ee*c),T=()=>{if(y===0)return;let e;if(v.length===1)e=v[0];else{e=new Float32Array(y);let t=0;for(let n of v)e.set(n,t),t+=n.length}v=[],y=0,ae(e)};try{let e=u.body.getReader(),t=null;for(;;){for(;!f.cancelled&&p-a.currentTime>te;)await oe(60);if(f.cancelled)break;let{done:n,value:r}=await e.read();if(f.cancelled||n)break;if(!r||r.length===0)continue;let i=re(r,t);if(t=i.carry,i.samples.length){v.push(i.samples),y+=i.samples.length;try{g?.push(i.samples)}catch{}}(m?y>=w:y>0)&&T()}f.cancelled||T()}catch(e){f.cancelled||console.warn(`[streamTts] stream read failed mid-line — audio may be truncated`,e)}!f.cancelled&&m&&await new Promise(e=>{let t=Math.max(0,(p-a.currentTime)*1e3)+40,n=setTimeout(e,t);f.finishEarly=()=>{clearTimeout(n),e()}});let E=f.cancelled;C(f);try{g?.end(m)}catch{}return E||m}var E={Omakase:`oh-mah-kah-seh`,omakase:`oh-mah-kah-seh`,OMAKASE:`oh-mah-kah-seh`,CUDA:`kooda`,cuDNN:`koo dee en en`,JSON:`jason`,YAML:`yammel`,GUI:`gooey`,SaaS:`sass`,ASCII:`askee`,WYSIWYG:`wizzywig`,NASA:`nassa`,NASDAQ:`nazdack`,JPEG:`jaypeg`,OAuth:`oh-auth`,nginx:`engine x`,PyTorch:`pie torch`,Qwen:`kwen`,SQLite:`sequel lite`,MySQL:`my sequel`,PostgreSQL:`postgres`};function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var ce=RegExp(`(?<![A-Za-z0-9])(${Object.keys(E).sort((e,t)=>t.length-e.length).map(se).join(`|`)})(s)?(?![A-Za-z0-9])`,`g`);function le(e){return e.replace(ce,(e,t,n)=>{let r=E[t];return n?`${r}${n}`:r})}var ue={Jan:`January`,Feb:`February`,Mar:`March`,Apr:`April`,Jun:`June`,Jul:`July`,Aug:`August`,Sep:`September`,Sept:`September`,Oct:`October`,Nov:`November`,Dec:`December`},de=RegExp(`(?<![A-Za-z])(${Object.keys(ue).join(`|`)})\\.?(?=,?\\s+\\d)`,`g`);function fe(e){return e.replace(de,(e,t)=>ue[t])}function D(e){return fe(le(s(o(e))))}var pe=140,me=.15,he=.9,O=[],k=!1,A=null,j=!1,M=new Set;function N(){return typeof window>`u`?null:window.speechSynthesis??null}function ge(){let e=N();if(!e)return!1;try{return e.getVoices().length>0}catch{return!1}}function _e(){let e=N();if(!e)return{mavea:null,user:null};let t;try{t=e.getVoices()}catch{return{mavea:null,user:null}}let n=e=>e.lang?.toLowerCase().startsWith(`en`)??!1,r=t.filter(e=>e.localService&&n(e)),i=t.filter(n),a=r.length?r:i.length?i:t;return{mavea:a[0]??null,user:a[1]??a[0]??null}}var P=null;function ve(e){return P?.mavea||(P=_e()),e===`user`?P.user:P.mavea}function F(){for(let e of M)e()}function ye(){let e=0;return{onWord:()=>{e=performance.now()},release:n(()=>{if(!e)return me;let t=performance.now()-e;return Math.max(me,he*Math.exp(-t/pe))})}}function be(e){let t=N();return t?new Promise(n=>{let r=!1,i=e=>{r||(r=!0,s.release(),A=null,n(e))},a=new SpeechSynthesisUtterance(e.text),o=ve(e.who);o&&(a.voice=o),a.pitch=e.who===`user`?.9:1.05,a.rate=e.who===`user`?.98:1.02;let s=ye();a.onstart=()=>{s.onWord(),e.start(!0)},a.onboundary=()=>s.onWord(),a.onend=()=>i(!0),a.onerror=()=>{e.start(!1),i(!1)},A=a;try{t.speak(a)}catch{e.start(!1),i(!1)}}):Promise.resolve(!1)}async function xe(){if(!k){k=!0,F();try{for(;O.length;){let e=O.shift();if(j){e.start(!1),e.done(!1);continue}let t=await be(e);e.start(t),e.done(t)}}finally{k=!1,j=!1,F()}}}function I(e,t){let n=D(z(e));if(!n||!ge())return{started:Promise.resolve(!1),finished:Promise.resolve(!1)};let r,i=new Promise(e=>{r=e}),a=!1,o=e=>{a||(a=!0,r(e))};return{started:i,finished:new Promise(e=>{O.push({text:n,who:t,start:o,done:e}),F(),xe()})}}function Se(){j=!0,O.length=0;let e=N();try{e?.cancel()}catch{}A=null,F()}function Ce(){return k||O.length>0||A!==null}function we(e){return M.add(e),()=>M.delete(e)}var Te=e({cancelSpeech:()=>Ne,isSpeaking:()=>Pe,sayable:()=>z,setVoiceMode:()=>Ee,speak:()=>ke,speakLine:()=>B,subscribeSpeaking:()=>Fe,voiceMode:()=>R}),L=`mavea-voice-mode`;function R(){try{let e=localStorage.getItem(L);return e===`kokoro`||e===`browser`?e:`auto`}catch{return`auto`}}function Ee(e){try{e===`auto`?localStorage.removeItem(L):localStorage.setItem(L,e)}catch{}}var De=/[\u{1F300}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}\u{2300}-\u{23FF}]/gu,Oe=/[\uFE0F\u200D]/g;function z(e){return o(String(e)).replace(/<[^>]*>/g,` `).replace(/&[a-z]+;/gi,` `).replace(/```[\s\S]*?```/g,` `).replace(/`([^`]+)`/g,`$1`).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/^\s*[-*+]\s+/gm,``).replace(/^\s*\d{1,2}[.)]\s+/gm,``).replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/\*([^*]+)\*/g,`$1`).replace(/\bMav[eé]a['’]s\s*/gi,``).replace(/\s*\bMav[eé]a\b\s*/gi,` `).replace(/\s+([.,!?;:])/g,`$1`).replace(De,``).replace(Oe,``).replace(/[“”"]/g,``).replace(/[•★→·|]/g,` `).replace(/[—–]/g,`, `).replace(/\s+/g,` `).trim()}function ke(e,t){B(e,t).finished}var Ae=2;function je(){return d()>=Ae}function B(e,t){let n=R();return n===`browser`?I(e,t):n===`kokoro`?X(e,t):Ze()===!1||je()?I(e,t):Me(e,t)}function Me(e,t){let n=X(e,t),r;return{started:new Promise(e=>{r=e}),finished:(async()=>{if(await n.started)return r(!0),n.finished;if(await n.finished,!ge())return r(!1),!1;let i=I(e,t);return i.started.then(r),i.finished})()}}function Ne(){Je(),Se()}function Pe(){return Z()||Ce()}function Fe(e){let t=Ye(e),n=we(e);return()=>{t(),n()}}var Ie=[{id:`heart`,label:`Heart`,kokoro:`af_heart`,tone:`warm`},{id:`emma`,label:`Emma`,kokoro:`bf_emma`,tone:`calm`},{id:`bella`,label:`Bella`,kokoro:`af_bella`,tone:`bright`},{id:`michael`,label:`Michael`,kokoro:`am_michael`,tone:`clear`},{id:`george`,label:`George`,kokoro:`bm_george`,tone:`steady`}],Le=`heart`,Re=`mavea-voice-mavea`;function V(e){return Ie.find(t=>t.id===e)}var ze=e({cancelKokoro:()=>Je,kokoroAvailable:()=>Xe,kokoroKnownAvailable:()=>Ze,kokoroSpeaking:()=>Z,kokoroVoice:()=>Ve,resetKokoroProbe:()=>Qe,setKokoroVoice:()=>Be,speakKokoroLine:()=>X,speakKokoroResult:()=>qe,subscribeKokoroSpeaking:()=>Ye}),H={mavea:V(`heart`)?.kokoro??`af_heart`,user:V(`george`)?.kokoro??`bm_george`};function Be(e,t){t&&(H[e]=t)}function Ve(e){return H[e]}var U=[],W=!1,G=null,K=null,q=null,J=new Set,He=!1;function Y(){let e=Z();if(e!==He){He=e;for(let e of J)e()}}function Ue(){if(K){try{URL.revokeObjectURL(K)}catch{}K=null}}async function We(e){try{if(await T(e.text,e.voice,()=>e.start(!0)))return!0}catch{}return Ge(e)}async function Ge(e){let t=!1,n=new AbortController;q=n;try{let i=await fetch(`/tts/v1/audio/speech`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:`kokoro`,input:e.text,voice:e.voice,response_format:`mp3`,speed:v()}),signal:n.signal});if(!i.ok)return!1;let a=await i.blob();if(!a.size)return!1;let o=URL.createObjectURL(a);K=o,await new Promise(n=>{let i=new Audio(o);G=i;let a=r(i),s=!1,c=e=>{s||(s=!0,a(),t=e,n())};i.onended=()=>c(!0),i.onerror=()=>c(!1);let l=i.play();l&&typeof l.then==`function`?l.then(()=>e.start(!0),()=>c(!1)):e.start(!0)})}catch{}finally{q===n&&(q=null),Ue(),G=null}return t}async function Ke(){if(!W){W=!0;try{for(;U.length;){let e=U.shift(),t=await Xe()&&await We(e);e.start(t),e.done(t)}}finally{W=!1,Y()}}}function X(e,t){let n=D(z(e));if(!n)return{started:Promise.resolve(!1),finished:Promise.resolve(!1)};let r,i=new Promise(e=>{r=e}),a=!1,o=e=>{a||(a=!0,r(e))};return{started:i,finished:new Promise(e=>{U.push({text:n,voice:H[t]??H.mavea,start:o,done:e}),Y(),Ke()})}}function qe(e,t){return X(e,t).finished}function Je(){w(),q&&=(q.abort(),null);let e=U.splice(0,U.length);for(let t of e)try{t.start(!1),t.done(!1)}catch{}if(G)try{G.pause(),G.src=``}catch{}Ue(),G=null,a(),Y()}function Z(){return W||U.length>0||G!==null}function Ye(e){return J.add(e),()=>J.delete(e)}var Q=null,$=null;function Xe(){return Q||(Q=(async()=>{try{let e=await fetch(`/tts/health`,{method:`GET`});return e.ok||console.debug(`[kokoro] TTS health check returned`,e.status,`— voice off, captions only`),e.ok}catch(e){return console.debug(`[kokoro] TTS health check unreachable — voice off, captions only`,e),!1}})(),Q.then(e=>{$=e})),Q}function Ze(){return $}function Qe(){Q=null,$=null}export{y as C,T as D,ae as E,v as S,g as T,Te as _,Be as a,w as b,Ie as c,Pe as d,z as f,Fe as g,B as h,ze as i,V as l,ke as m,Ze as n,Le as o,Ee as p,Ve as r,Re as s,Xe as t,Ne as u,R as v,f as w,re as x,D as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return!e||!Number.isFinite(e)?5:Math.min(20,Math.max(1,Math.floor(e)))}var t=`https://en.wikipedia.org/w/api.php`,n=6e3;function r(e,n=5){return`${t}?${new URLSearchParams({action:`query`,list:`search`,srsearch:e,srlimit:String(n),srprop:`snippet`,format:`json`,origin:`*`}).toString()}`}function i(e){return e.replace(/<[^>]*>/g,``).replace(/ /g,` `).replace(/"/g,`"`).replace(/&/g,`&`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`).replace(/\s+/g,` `).trim()}function a(e){let t=e?.query,n=Array.isArray(t?.search)?t.search:[],r=[];for(let e of n){let t=typeof e.title==`string`?e.title:``;t&&r.push({title:t,url:`https://en.wikipedia.org/wiki/${encodeURIComponent(t.replace(/ /g,`_`))}`,snippet:typeof e.snippet==`string`?i(e.snippet):``})}return r}var o={id:`wikipedia`,needsKey:!1,async search(t,i={}){let o=t.trim();if(!o)return[];let{signal:s}=i,c=new AbortController,l=setTimeout(()=>c.abort(),n),u=()=>c.abort();s?.addEventListener(`abort`,u,{once:!0});try{let t=await fetch(r(o,e(i.limit)),{signal:c.signal});return t.ok?a(await t.json()):[]}catch{return[]}finally{clearTimeout(l),s?.removeEventListener(`abort`,u)}}};async function s(e,t,n,r){let i=new AbortController,a=setTimeout(()=>i.abort(),n),o=()=>i.abort();r?.addEventListener(`abort`,o,{once:!0});try{return await fetch(e,{...t,signal:i.signal})}catch{return null}finally{clearTimeout(a),r?.removeEventListener(`abort`,o)}}var c=`/search/brave`,l=`/res/v1/web/search`,u=6e3;function d(e,t=5){return`${c}${l}?${new URLSearchParams({q:e,count:String(t)}).toString()}`}function f(e){let t=e?.web,n=Array.isArray(t?.results)?t.results:[],r=[];for(let e of n){let t=typeof e.url==`string`?e.url:``,n=typeof e.title==`string`?e.title:``;!t||!n||r.push({title:i(n),url:t,snippet:i(String(e.description??``))})}return r}var p={id:`brave`,needsKey:!0,async search(t,n={}){let r=t.trim();if(!r||!n.apiKey)return[];let i=await s(d(r,e(n.limit)),{method:`GET`,headers:{Accept:`application/json`,"X-Subscription-Token":n.apiKey}},u,n.signal);if(!i?.ok)return[];try{return f(await i.json())}catch{return[]}}},m=`/search/tavily`,h=`/search`,g=8e3;function _(e){let t=Array.isArray(e?.results)?e.results:[],n=[];for(let e of t){let t=typeof e.url==`string`?e.url:``,r=typeof e.title==`string`?e.title:``;!t||!r||n.push({title:i(r),url:t,snippet:i(String(e.content??``))})}return n}var v={wikipedia:o,brave:p,tavily:{id:`tavily`,needsKey:!0,async search(t,n={}){let r=t.trim();if(!r||!n.apiKey)return[];let i=await s(`${m}${h}`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n.apiKey}`},body:JSON.stringify({query:r,max_results:e(n.limit),search_depth:`basic`})},g,n.signal);if(!i?.ok)return[];try{return _(await i.json())}catch{return[]}}}};function y(e){return e&&v[e]||o}var b=/\b(latest|current|currently|today|tonight|tomorrow|now|recent|recently|this (week|weekend|month|year)|upcoming|next (?:week(?:end)?|month|game|match|season)|fixtures?|schedule[ds]?|line[- ]?ups?|kick[- ]?off|who(?:'s| is| are)? (?:playing|plays)|202\d|news|update|price|cost|stock|score|weather|forecast|release[ds]?|version|who(?:'s| is| are| was)|what(?:'s| is| are| was)|when (is|was|did)|where (is|was)|how (much|many)|population|capital|ceo|founded|net worth|statistics?|stats)\b/i,x=`(?:jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|jun(?:e)?|jul(?:y)?|aug(?:ust)?|sep(?:t(?:ember)?)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)\\.?\\s+\\d{1,2}(?:st|nd|rd|th)?\\b`,S=RegExp(`\\b(?:trip|visit(?:ing)?|travel(?:l?ing)?|vacation|itinerary|going to|flying to|heading to)\\b[\\s\\S]{0,40}${x}`,`i`),C=`(?:this |next )?(?:mon|tue(?:s)?|wed(?:nes)?|thu(?:rs)?|fri|sat(?:ur)?|sun)(?:day)?`,w=`(?:games?|match(?:es)?|fixtures?|kick[- ]?off|final|semi[- ]?finals?|playoffs?|tournament|concert|gig|screening|premiere|festival|match[- ]?up)`,T=`(?:${x}|\\b${C}\\b|\\bthe \\d{1,2}(?:st|nd|rd|th)\\b)`,E=RegExp(`\\b${w}\\b[\\s\\S]{0,40}${T}|${T}[\\s\\S]{0,40}\\b${w}\\b`,`i`);function D(e){let t=e.trim();return t.length<3?!1:b.test(t)||S.test(t)||E.test(t)}var O=new RegExp([`live score|final score|half[- ]?time|who'?s winning`,`who won (?:the )?(?:game|match|race|fight|bout|series|final)`,`\\bscores?\\b(?=.*\\b(?:today|tonight|last night|now|live|game|match)\\b)`,`\\bstandings?\\b|league table`,`\\b(?:games?|matches|match|fixtures?|schedule|kick[- ]?off|line[- ]?ups?|who plays)\\b(?=.*\\b(?:this weekend|tonight|today|tomorrow|this week|upcoming|right now)\\b)`,`\\b(?:stock|share|crypto|bitcoin|ethereum|btc|eth)\\b.{0,15}\\b(?:price|value|worth|quote|trading|rate)\\b`,`stock market|market cap|exchange rate|gas prices?`,`\\bweather\\b|\\bforecast\\b|temperature (?:right now|today|outside)`,`breaking news|latest (?:news|headlines?)|today'?s (?:news|headlines?)|news (?:right now|today)`,`right now|at the moment|as we speak`].join(`|`),`i`),k=/\b(?:1\d{3}|20[0-2]\d|in \d{4}|back in|years? ago|all[-\s]?time)\b/i;function A(e){let t=e.trim();return t.length<3||k.test(t)?!1:O.test(t)||E.test(t)}var j=/^(?:what(?:'s| is| are| was| were)?|who(?:'s| is| are| was| were)?|when (?:is|was|did|will)|where (?:is|are|was)|how (?:much|many|do|does|did|has|have)|tell me about|give me|show me|can you (?:tell me|show me)?|could you|please|i want to know|do you know)\s+/i,M=/[,;]?\s*(?:and how (?:has|have|did|does) .+|right now|at the moment|currently|today|recently|these days|this (?:week|month|year)|so far)\s*$/i;function N(e){let t=e.trim().replace(/[?!.]+$/,``).replace(j,``).replace(M,``).replace(/\s+/g,` `).trim(),n=t.length>=3?t:e.trim();return n.length>96?n.slice(0,96).trim():n}var P=/\b(\d{1,3})\s+(?:results?|sources?|articles?|links?|headlines?|items?|examples?|options?|ideas?|entries?|citations?|references?)\b/i,F=/\btop\s+(\d{1,3})\b/i;function I(e){let t=e.match(P)??e.match(F);if(!t)return;let n=Number(t[1]);return Number.isFinite(n)&&n>=1?n:void 0}export{N as a,I as i,D as n,e as o,A as r,y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-BVpWp9h4.js";import{n as t}from"./http-CJCtjYpA.js";import{t as n}from"./providers-wzm7E8Pa.js";import{n as r,t as i}from"./contentVault-DzTYWcbD.js";function a(e,t){let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}function o(e){return e!=null&&a(e,e)>1e-6}function s(e,t){let n=[],r=null;for(let i=0;i<e.length;i++){let s=t?.[i]??null,c=o(s),l;if(i===0)l=!0;else if(!c||r===null)l=e[i].mode===`replace`;else{let t=Math.sqrt(a(r,r)),n=t>0?a(s,r)/t:0;l=n<.16?!0:n<.4?e[i].mode===`replace`:!1}if(n.push(l),l)r=c?Float32Array.from(s):null;else if(c)if(r===null)r=Float32Array.from(s);else for(let e=0;e<s.length;e++)r[e]+=s[e]}return n}var c=null,l=!1,u=!1,d=0,f=new Map;function p(){if(!(c||u)){if(typeof Worker>`u`){u=!0;return}try{c=new Worker(new URL(`/assets/worker-BbLKfGzm.js`,``+import.meta.url),{type:`module`}),c.onmessage=e=>{let t=e.data;if(t.type===`ready`)l=!0;else if(t.type===`error`)u=!0,m();else if(t.type===`result`){let e=f.get(t.id);f.delete(t.id),e?.kind===`fit`&&e.resolve(t.fits)}else if(t.type===`embedded`){let e=f.get(t.id);f.delete(t.id),e?.kind===`embed`&&e.resolve(t.vec.length?t.vec:null)}},c.onerror=()=>{u=!0,m()},c.postMessage({type:`init`,base:g,modelId:te})}catch{u=!0}}}function m(){for(let e of f.values())e.resolve(null);f.clear();try{c?.terminate()}catch{}c=null,l=!1}function h(e,t=80){if(p(),!l||!c)return Promise.resolve(null);let n=++d;return new Promise(r=>{let i=setTimeout(()=>{f.delete(n),r(null)},t);f.set(n,{kind:`fit`,resolve:e=>{clearTimeout(i),r(e?new Map(e):null)}}),c.postMessage({type:`fit`,id:n,query:e})})}function ee(e,t=80){if(p(),!l||!c)return Promise.resolve(null);let n=++d;return new Promise(r=>{let i=setTimeout(()=>{f.delete(n),r(null)},t);f.set(n,{kind:`embed`,resolve:e=>{clearTimeout(i),r(e)}}),c.postMessage({type:`embed`,id:n,text:e})})}var te=`minishlab/potion-base-8M`,g=`/semantic/`,ne=new Set(`the.a.an.and.or.but.of.to.in.on.for.is.are.was.were.be.been.am.as.at.by.it.its.this.that.these.those.with.your.you.my.mine.me.we.us.our.they.them.their.he.she.his.her.do.does.did.has.have.had.will.would.can.could.should.about.from.into.if.then.so.than.too.very.just.also.what.when.where.who.why.how.which.not.no.yes.up.out.over`.split(`.`));function re(e){return(e.toLowerCase().match(/[a-z0-9]+/g)??[]).filter(e=>e.length>=2&&!ne.has(e))}function _(e){return new Set(re(e))}function ie(e,t){if(!e.size||!t.size)return 0;let n=0;for(let r of e)t.has(r)&&(n+=1);return n/(e.size+t.size-n)}function v(e,t){if(!e.size)return 0;let n=0;for(let r of e)t.has(r)&&(n+=1);return n/e.size}var y=`mavea-live-memory-v3`,ae=`mavea-live-memory-v2`,oe=`mavea-live-memory-v1`,b=`mavea-live-memory`,x=50,S=20,C=400,w=200,T=/^[a-z][a-z0-9]*(\.[a-z][a-z0-9]*)*$/,se=.5,E={"model-inferred":0,"web-grounded":1,"ink-correction":2,"user-stated":3,"user-edit":3},ce=new Set([`user-stated`,`user-edit`,`ink-correction`,`web-grounded`]);function le(e){return ce.has(e??`model-inferred`)}function ue(e,t){return E[t]>E[e]?t:e}var D={nodes:[],updatedAt:0},O=null,k=0;function A(){try{let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID()}catch{}return k+=1,`mn-${k.toString(36)}-${Math.floor(Math.random()*1e9).toString(36)}`}function j(e){return e.replace(/\s+/g,` `).trim().slice(0,C)}function M(e){return e.toLowerCase().trim().replace(/\s+/g,`.`)}var de=new Set(Object.keys(E));function N(e){return typeof e==`string`&&de.has(e)}function P(e){if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&e.length>0).slice(0,12);return t.length?t:void 0}function fe(e){return e===`tight`||e===`standard`||e===`deep`}function F(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):void 0}function I(e){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.concept==`string`?M(t.concept):``;if(!n||!T.test(n))return null;let r=typeof t.body==`string`?j(t.body):``;return r?{id:typeof t.id==`string`&&t.id?t.id:A(),concept:n,body:r,updatedAt:typeof t.updatedAt==`number`&&Number.isFinite(t.updatedAt)?t.updatedAt:0,kind:t.kind===`procedural`?`procedural`:`semantic`,source:N(t.source)?t.source:`model-inferred`,state:t.state===`archived`?`archived`:`active`,prevBody:typeof t.prevBody==`string`?j(t.prevBody):void 0,turnId:typeof t.turnId==`string`?t.turnId:void 0,quote:typeof t.quote==`string`?t.quote.replace(/\s+/g,` `).trim().slice(0,w):void 0,uses:F(t.uses)??0,prefer:P(t.prefer),avoid:P(t.avoid),depth:fe(t.depth)?t.depth:void 0,verify:typeof t.verify==`boolean`?t.verify:void 0,wins:F(t.wins),losses:F(t.losses)}:null}function L(){try{if(typeof localStorage>`u`)return null;let e=localStorage.getItem(oe);if(!e)return null;let t=JSON.parse(e),n=Array.isArray(t.facts)?t.facts.map(e=>{if(e&&typeof e==`object`){let t=e;return typeof t.text==`string`?t.text.trim():``}return``}).filter(e=>e.length>0):[];if(!n.length)return null;let r=I({concept:`profile`,body:n.join(`. `),source:`model-inferred`});return r?{nodes:[r],updatedAt:0}:null}catch{return null}}function R(){try{if(typeof localStorage>`u`)return null;let e=localStorage.getItem(ae);if(!e)return null;let t=JSON.parse(e),n=Array.isArray(t.nodes)?t.nodes.map(I).filter(e=>e!==null):[];return n.length?{nodes:n.slice(-50),updatedAt:typeof t.updatedAt==`number`?t.updatedAt:0}:null}catch{return null}}var z=!1,B=0;function V(e){let t=e??{};return{nodes:(Array.isArray(t.nodes)?t.nodes.map(I).filter(e=>e!==null):[]).slice(-50),updatedAt:typeof t.updatedAt==`number`?t.updatedAt:0}}async function H(e){let t=++B;try{if(typeof localStorage>`u`)return;let n=await r(e);if(t!==B)return;localStorage.setItem(y,n)}catch{}}function pe(){try{if(typeof localStorage>`u`)return{...D};let e=localStorage.getItem(y);if(!e)return R()??L()??{...D};let t=V(JSON.parse(e));return t.nodes.length&&H(t),t}catch{return{...D}}}async function me(){try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(y);if(!e)return;try{JSON.parse(e);return}catch{}let t=V(await i(e));if(z)return;O=t,z=!0,typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(b,{detail:{nodes:t.nodes,changed:[]}}))}catch{}}me();function U(){return O||(O=pe(),O)}function W(e,t){O=e,z=!0,H(e);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(b,{detail:{nodes:e.nodes,changed:t}}))}catch{}}function G(e){if(e.length<=x)return e;let t=(e,t)=>t.updatedAt-e.updatedAt,n=e.filter(e=>e.kind===`procedural`).sort(t),r=e.filter(e=>e.kind!==`procedural`).sort(t),i=n.slice(0,S),a=r.slice(0,x-i.length),o=Math.max(0,x-i.length-a.length),s=n.slice(S,S+o);return[...i,...s,...a]}function he(){return[...U().nodes].sort((e,t)=>t.updatedAt-e.updatedAt)}function ge(e){let t=e.map(I).filter(e=>e!==null);if(!t.length)return 0;let n=new Map(U().nodes.map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);(!t||e.updatedAt>=t.updatedAt)&&n.set(e.id,e)}return W({nodes:G([...n.values()]),updatedAt:Date.now()},t),t.length}function _e(e,t={}){let n=U(),r=t.now??Date.now(),i=[],a=!1,o=[...n.nodes];for(let t of e){let e=M(t.concept);if(!e||!T.test(e))continue;let n=j(t.body),s=N(t.source)?t.source:`model-inferred`,c=t.kind===`procedural`?`procedural`:`semantic`,l=t.quote?t.quote.replace(/\s+/g,` `).trim().slice(0,w):void 0,u=o.findIndex(t=>t.concept===e&&t.state!==`archived`);if(u<0){if(!n)continue;let u={id:A(),concept:e,body:n,updatedAt:r,kind:c,source:s,state:`active`,turnId:t.turnId,quote:l,uses:0,prefer:t.prefer,avoid:t.avoid,depth:t.depth,verify:t.verify,wins:t.outcome===`win`?1:void 0,losses:t.outcome===`loss`?1:void 0};o.push(u),i.push(u),a=!0;continue}let d=o[u],f={...d},p=!1,m=!1;c===`procedural`&&f.kind!==`procedural`&&(f.kind=`procedural`,m=!0),t.prefer&&(f.prefer=Array.from(new Set([...d.prefer??[],...t.prefer])).slice(0,12),m=!0),t.avoid&&(f.avoid=Array.from(new Set([...d.avoid??[],...t.avoid])).slice(0,12),m=!0),t.depth&&t.depth!==d.depth&&(f.depth=t.depth,m=!0),typeof t.verify==`boolean`&&t.verify!==d.verify&&(f.verify=t.verify,m=!0),t.outcome===`win`?(f.wins=(d.wins??0)+1,m=!0):t.outcome===`loss`&&(f.losses=(d.losses??0)+1,m=!0),n&&n!==d.body&&(ie(_(d.body),_(n))>=se?f.uses=(d.uses??0)+1:(f.prevBody=d.body,f.uses=0),f.body=n,l&&(f.quote=l),t.turnId&&(f.turnId=t.turnId),p=!0,m=!0);let h=ue(d.source??`model-inferred`,s);h!==(d.source??`model-inferred`)&&(f.source=h,m=!0),m&&(f.updatedAt=r,o[u]=f,a=!0,p&&i.push(f))}return a?(o=G(o),W({nodes:o,updatedAt:r},i),i):[]}function ve(e,t){let n=U(),r=j(t);if(!r)return;let i=!1,a=n.nodes.map(t=>t.id===e?(i=!0,{...t,prevBody:t.body===r?t.prevBody:t.body,body:r,source:`user-edit`,updatedAt:Date.now()}):t);i&&W({nodes:a,updatedAt:Date.now()},[])}function ye(e){let t=U(),n=t.nodes.filter(t=>t.id!==e);n.length!==t.nodes.length&&W({nodes:n,updatedAt:Date.now()},[])}function be(){W({nodes:[],updatedAt:Date.now()},[])}var xe=/\b(poems?|haikus?|limericks?|sonnets?|ballads?|rhymes?|riddles?|puns?|jokes?|knock[- ]?knock|tongue[- ]?twisters?|lullab(?:y|ies)|raps?)\b/i,Se=/\b(write|compose|make(?:\s+me|\s+up)?|tell(?:\s+me)?\s+(?:a|an)|sing|invent|create|generate|come up with)\b[^.?!]{0,40}\b(story|stories|song|lyrics?|tale|fable|fiction|script|screenplay|verse|jingle)\b/i;function Ce(e){let t=e.toLowerCase();return xe.test(t)||Se.test(t)}var we=e=>!Ce(e),Te=/\b(just (?:tell me|give me|the answer)|in one line|one[- ]liner|in a (?:sentence|word|line)|in a few words|brief(?:ly)?|tl;?dr|short (?:version|answer)|keep it (?:short|brief)|quick (?:answer|version|recap|rundown|summary)|in short|the short version|bottom line|in a nutshell|the gist)\b/,Ee=/\b(tell me about|explain|overview|how (?:do|does|to|can|is|are|did|would|should)|why|guide|walk\s?(?:me\s)?through|break\s?down|breakdown|deep\s?dive|everything|compare|comparison|versus|vs\.?|pros and cons|plan|itinerary|roadmap|review|analy[sz]e|dashboard|trends?|history of|all about|summary of)\b/,K=/\b(teach (?:me|us)|help me (?:understand|learn|grasp|wrap my head around)|walk me through|crash course|get (?:me |us )?up to speed|bring me up to speed|from scratch|(?:the )?(?:basics|fundamentals|essentials|core concepts|key concepts) of|study (?:for|guide|plan)|prep(?:are)? (?:me |us )?for (?:my |an? |the |our )?(?:\w+ )?(?:interview|exam|test|quiz|midterm|final|cert\w*)|(?:interview|exam) prep|tutorial|lesson on|learn (?:about |how )?[a-z]+)\b/,De=[/^[\s\d().,+\-*/^%×÷=]+\??$/,/\bwhat(?:'s| is| are| was)?\s*[\d().,\s+\-*/^%×÷]+\s*\??$/,/\b(calculate|compute|solve)\b/,/\b\d+(?:\.\d+)?\s*%\s*of\s+\d/,/\bconvert\b/,/\bhow many\s+\w+\s+(?:in|are in|per)\b/,/\b\d+\s*[a-z]+\s+(?:in|to)\s+[a-z]+\b/,/\b(define|definition of)\b/,/\bwhat does\s+.+\s+mean\b/,/\bcapital of\b/];function Oe(e){let t=e.toLowerCase().trim();if(!t)return`rich`;let n=Te.test(t);return K.test(t)||Ee.test(t)?n?`brief`:`rich`:De.some(e=>e.test(t))?`lean`:n?`brief`:`rich`}function ke(e){return K.test(e.toLowerCase())}var Ae=/\b(deriv\w*|prove|proof|theorem|integral|derivative|equation|algebra|calculus|optimi[sz]e|trade-?offs?|step[-\s]?by[-\s]?step|reason\w* through|figure out|work out|why (?:does|is|are|do)|analy[sz]e|compare\b.*\bvs\b|root cause|debug|diagnose|strategy|plan\b.*\b(?:budget|trip|itinerary|migration))\b/;function q(e){return Ae.test(e.toLowerCase())}function je(e,t){return e===`lean`?`minimal`:t?`low`:`minimal`}var J=[`minimal`,`low`,`medium`,`high`];function Me(e,t){let n=J.indexOf(e);return J[Math.min(J.length-1,Math.max(0,n+t))]}function Ne(e,t,n=`fast`){let r=q(t);return e===`lean`&&!r?`minimal`:Me(je(e,r),n===`thorough`?2:+(n===`balanced`))}var Pe=.1,Fe=.3,Ie=.75;function Le(e,t,n){return t.creative?Ie:e===`lean`||q(n)||t.troubleshoot?Pe:Fe}var Y=140,X=320;function Re(e,t){if(e.length<=t)return e;let n=e.slice(0,t-1),r=[...n.matchAll(/[.!?](?=\s|$)/g)].at(-1);if(r&&r.index!==void 0&&r.index>t*.3)return n.slice(0,r.index+1);let i=n.lastIndexOf(` `);return(i>t*.6?n.slice(0,i):n).trimEnd()+`…`}function ze(e,t){let n=t===`lean`||t===`brief`?Y:X;return Re(e.trim(),n)}function Z(e){return e===`lean`||e===`brief`?Y:X}var Be=`OUTPUT ORDER — emit the "narration" field FIRST in the JSON, before "title", "sub", and "blocks", and write it as complete sentences. It is spoken aloud the moment it streams, so it must lead.`;function Ve(e){return e===`lean`||e===`brief`?`SPOKEN LINE ("narration") — keep it to ONE short sentence (≈${Z(e)} characters). Right to the point.`:`SPOKEN LINE ("narration") — at most two or three short sentences (≈${Z(`rich`)} characters), like a person talking. The visuals carry the detail; never narrate the whole canvas.`}var He=e({checkLiveReady:()=>Q}),Ue=2500;async function Q(e,r={}){let i=n(e.provider).probe(e).catch(()=>({ok:!1,model:!1})),a=r.tts===!1?Promise.resolve(!1):(async()=>{try{return(await t(`/tts/health`,{method:`GET`},Ue)).ok}catch{return!1}})(),[{ok:o,model:s,statusCode:c},l]=await Promise.all([i,a]);return{llm:o,tts:l,model:s,statusCode:c}}var We=[{key:`decision`,test:/\b(should i|should we|worth it|is it worth|which (?:one|should|is better)|do i (?:need|have to)|ought i|better to|or should i)\b/},{key:`comparison`,test:/\b(vs\.?|versus|compare\w*|comparison|pros and cons|trade-?offs?|better than|which is better)\b/},{key:`risk`,test:/\b(risk\w*|danger\w*|downside|what could go wrong|threat\w*|is it safe|safe to|consequenc\w*|backfire|red flags?|pitfalls?)\b/},{key:`planning`,test:/\b(roadmap|schedule|timeline|milestone\w*|strateg\w*|prepare for|get ready|launch|plan (?:to|for|a|my|out)|over the next \d+|in \d+ (?:weeks?|months?|days?))\b/},{key:`troubleshoot`,test:/\b(troubleshoot|debug|not working|isn'?t working|won'?t \w+|broken|\berror\b|\bbug\b|fix\b|stopped working|fail(?:s|ing|ed)?|why (?:is|does|won'?t|isn'?t|can'?t))\b/},{key:`learning`,test:/\b(explain|how does|how do .* work|what is|what are|teach me|help me understand|learn\b|tell me about|why does|the difference between|concept of|crash course|walk me through|for (?:my|an?|the|our) (?:\w+ )?(?:interview|exam|test|midterm|final)|study for)\b/},{key:`creative`,test:/\b(brainstorm|ideas? for|come up with|imagine|invent|design a|creative|name (?:my|a|some|ideas)|suggest (?:some )?\w+ (?:names|ideas))\b/},{key:`whatIf`,test:/\b(what (?:if|happens if|would happen)|if i (?:do|don'?t|take|stay|leave|wait)|either way|both (?:paths|options|ways)|play(?:ed)? out|scenario\w*|down the road|in (?:each|both) cases?|stay or (?:go|leave|take)|futures?\b)\b/},{key:`reflection`,test:/\b(my (?:friend|partner|relationship|boyfriend|girlfriend|marriage|spouse|boss|family|mom|dad|kid)|feel(?:ing)?\b|emotionally|am i (?:wrong|right|overreacting|the problem)|should i feel|drain(?:s|ing|ed)?|toxic|healthy (?:relationship|friendship)|cope\b|burn(?:t|ed)?\s?out|overwhelm\w*|anxious|lonely)\b/},{key:`highStakes`,test:/\b(quit (?:my|the|this) (?:job|career)|get married|getting married|divorce|buy a (?:house|home)|mortgage|life savings|career change|drop out|move (?:abroad|across|countr|to another)|surgery|diagnos\w*|lawsuit|\bsue\b|custody|life-?changing)\b/},{key:`serious`,test:/\b(grief|grieving|death|dying|depress\w*|suicid\w*|self-?harm|abuse|trauma|addiction|crisis|terminal|miscarriage)\b/}],Ge=[{domain:`health`,test:/\b(health\w*|symptom\w*|doctor|medic\w*|diagnos\w*|disease|surgery|mental health|therap\w*|depress\w*|anxiety)\b/},{domain:`legal`,test:/\b(legal|lawyer|attorney|lawsuit|\bsue\b|court|custody|rights\b|contract\b)\b/},{domain:`money`,test:/\b(money|budget|invest\w*|savings|\bdebt\b|loan|mortgage|finance\w*|retire\w*|taxe?s?\b|salary)\b/},{domain:`career`,test:/\b(job\b|career|\bwork\b|boss|promotion|freelanc\w*|resume|interview|fired|laid off|quit)\b/},{domain:`relationship`,test:/\b(relationship|friend\w*|partner|boyfriend|girlfriend|marriage|spouse|dating|breakup|family)\b/},{domain:`travel`,test:/\b(travel|trip|vacation|flight|hotel|itinerary|destination|visit\b)\b/},{domain:`tech`,test:/\b(code|coding|software|\bapp\b|\bapi\b|database|server|deploy|programming|website|algorithm)\b/},{domain:`learning`,test:/\b(study|course|exam|tutorial|homework|\bclass\b|lesson|curriculum)\b/}];function Ke(e){if(!e)return``;for(let t=e.length-1;t>=0;t--)if(e[t].role===`user`)return e[t].content;return``}function qe(e,t){let n=e.toLowerCase(),r=Ke(t).toLowerCase(),i=r?`${n} ${r}`:n,a={decision:!1,comparison:!1,risk:!1,planning:!1,troubleshoot:!1,learning:!1,creative:!1,whatIf:!1,reflection:!1,highStakes:!1,serious:!1};for(let e of We)e.test.test(i)&&(a[e.key]=!0);(a.highStakes||a.reflection)&&(a.serious=!0);for(let e of Ge)if(e.test.test(i)){a.domain=e.domain;break}return a}function Je(e){let t=new Set;return e.decision&&t.add(`decide`),e.comparison&&(t.add(`compare`),t.add(`decide`)),e.risk&&t.add(`decide`),e.planning&&(t.add(`plan`),t.add(`howto`)),e.troubleshoot&&(t.add(`howto`),t.add(`explain`)),e.learning&&(t.add(`explain`),t.add(`reference`)),e.creative&&t.add(`draft`),e.whatIf&&t.add(`decide`),e.reflection&&(t.add(`reflect`),t.add(`comfort`)),[...t]}var $=[{shape:`composition`,weight:1,test:/\b(budget|allocat\w*|split|breakdown|where\s+(?:\w+\s+)?(?:my\s+|the\s+)?(?:money|time|spend\w*|budget)|(?:money|time|spend\w*)\s+goes?|portion|share|mix|composition|makeup|made up of|percent\w*|proportion|divid\w*)\b/},{shape:`series`,weight:1,test:/\b(trend\w*|over time|growth|history|historical|month\w*|week\w*|dai\w*|quarter\w*|year\w*|forecast|projection|trajectory|since|past \d+)\b/},{shape:`comparison`,weight:1,test:/\b(vs\.?|versus|compare\w*|comparison|better|which (?:one|should|is)|either|or should|pros and cons|trade-?offs?|options?|best|top \d+|worth it|should i (?:buy|get|pick|choose|use)|recommend\w*)\b/},{shape:`ranking`,weight:1,test:/\b(rank\w*|leaderboard|top \d+|best|worst|most|least|highest|lowest|fastest|biggest|smallest|standings)\b/},{shape:`status`,weight:1,test:/\b(progress|on track|readiness|ready|status|health\w*|complete\w*|how (?:far|close)|goal|target|score|rating|grade)\b/},{shape:`sequence`,weight:1,test:/\b(steps?|how (?:do|to)|process|guide|walk\s?through|plan|schedule|roadmap|sequence|order|first.*then|itinerary|timeline)\b/},{shape:`flow`,weight:.8,test:/\b(funnel|pipeline|workflow|conversion|stages?|flow|drop-?off|state\s?machine|feedback\s?loops?|decision\s?tree|control\s?flow)\b/},{shape:`geo`,weight:1,test:/\b(map|where is|near\w*|location|route|directions?|cities|country|countries|region|travel|trip|drive)\b/},{shape:`list`,weight:.8,test:/\b(list|tips?|checklist|things to|ways to|ideas|reasons|items|bullet\w*)\b/},{shape:`distribution`,weight:1,test:/\b(distribution|spread|histogram|range|variance|outliers?|percentile|frequency|how (?:often|spread))\b/},{shape:`relationship`,weight:1,test:/\b(correlat\w*|relationship between|scatter|vs.*axis|impact of|affect\w*|driver\w*)\b/},{shape:`structure`,weight:1,test:/\b(molecul\w*|chemical structure|molecular structure|skeletal (?:formula|structure)|lewis structure|smiles|functional group|benzene)\b/},{shape:`tabular`,weight:.9,test:/\b(table|rows?|columns?|spreadsheet|records|dataset|grid of|matrix)\b/},{shape:`media`,weight:1,test:/\b(image\w*|photos?|gallery|pictures?|visual\w*|video|watch|before and after|screenshot)\b/},{shape:`text`,weight:.8,test:/\b(quote\w*|testimonial\w*|said|opinions?|reviews?|feedback|explain|defin\w*|definition|what is|tell me about|meaning of|translate\w*|vocabulary)\b/},{shape:`code`,weight:1.1,test:/\b(code|coding|programming|software|function|algorithm\w*|recursi\w*|data structures?|linked lists?|binary (?:tree|search)|hash\s?(?:map|table)|big-?o|time complexity|syntax|compil\w*|debug\w*|refactor\w*|regex|sql|snippet|pseudo\s?code|api)\b/},{shape:`scalar`,weight:.7,test:/\b(how (?:many|much)|number of|total|count|metric|stat\w*|kpi|figure)\b/},{shape:`keyvalue`,weight:.7,test:/\b(stats|metrics|numbers|key figures|at a glance|summary of|overview)\b/},{shape:`selection`,weight:.9,test:/\b(choose|pick|select|decide|configure|settings|sign\s?up|form|filter|adjust|set up)\b/},{shape:`hierarchy`,weight:.9,test:/\b(hierarch\w*|tree|nested|org\s?chart|structure of|breakdown of .* into|parent|sub-?categor\w*)\b/}],Ye=[{test:/\b(pdf|white\s?paper|the paper|the document|the report|the contract|the article|the spec|the manual|the filing|the brief|full text|read (?:it|the\b))\b/,types:[`pdfreader`,`docview`]},{test:/\b(images?|photos?|pictures?|gallery|pics?|snapshots?)\b/,types:[`gallery`]},{test:/\b(maps?|where is|located|directions?|on a map|near (?:the|downtown|campus)|walking distance|walkable|nearby|neighborhood|what'?s around|close to (?:downtown|the))\b/,types:[`geomap`]},{test:/\b(code|snippet|implementation|source code|pseudo\s?code)\b/,types:[`codeblock`]},{test:/\b(dialogue\w*|a scene\b|conversation between|exchange between|speakers?|write a (?:script|scene|transcript))\b/,types:[`dialogue`]},{test:/\b(defin\w*|etymology\b|what does .{1,30} mean|look up\b|vocabulary\b|word for\b)\b/,types:[`dictionary`]},{test:/\b(variant\w*|alternativ\w*|\d+ (?:version\w*|option\w*|draft\w*)|rewrit\w*|different (?:tone\w*|style\w*|version\w*))\b/,types:[`variants`]},{test:/\b(translat\w+|in (?:french|spanish|japanese|german|chinese|portuguese|italian|korean|arabic|russian|hindi|dutch|swedish|polish|turkish|vietnamese|thai|hebrew|greek|latin)|from (?:english|spanish|french|japanese|german|chinese) (?:to|into))\b/,types:[`translation`]},{test:/\b(rank (?:the )?top \d+|top \d+ (?:ranked|ranking)|leaderboard\b|ranked list\b|best \d+ .{1,30} rank\w*)\b/,types:[`bracketbar`]},{test:/\b(?:as|in|into) (?:a |an )?(?:data )?table\b|\b(?:make|build|draw|create|show|give|put|render|format)\b(?:[\w\s]{0,12})?\btable\b|\btabular\b|\bspreadsheet\b/,types:[`datatable`]},{test:/\b(?:draw|make|show|give|create|build)\b(?:[\w\s]{0,12})?\b(?:flow\s?chart|flow\s?diagram|diagram)\b|\bdiagram (?:this|it|of|the)\b|\bflow\s?chart\b|\bas an? [\w\s]{0,20}?diagram\b|\bstate\s?machine\b/,types:[`diagramflow`]},{test:/\b(?:as|make|draw|show|give|build|on)\b(?:[\w\s]{0,12})?\btime\s?line\b|\btime\s?line of\b/,types:[`timeline`]},{test:/\bcheck\s?list\b/,types:[`checklist`]},{test:/\bstep[-\s]?by[-\s]?step\b|\b(?:numbered|ordered) steps\b|\bwalk me through (?:the )?steps\b/,types:[`howtosteps`,`checklist`]},{test:/\bcompare\b|\bcomparison\b|\b\w+ (?:vs\.?|versus) \w+\b|\bdifference between\b|\bside[-\s]?by[-\s]?side\b/,types:[`compare`]},{test:/\bquiz\b|\btest me on\b|\bpractice questions\b/,types:[`quiz`]},{test:/\bflash\s?cards?\b/,types:[`flashcard`]},{test:/\b(recipe\b|how to (?:make|cook|bake) |step\w*-?by\w*-?step .{0,20}(?:recipe|cook)|(?:dinner|lunch|breakfast|dessert|cookie|pasta|chicken|beef|vegan|gluten.free) recipe\b)\b/,types:[`recipecard`]},{test:/\b(workout plan|training plan|exercise plan|gym (?:program|plan|routine)|fitness (?:plan|program|routine)|sets? and reps?|push.?pull.?legs?|strength (?:program|plan)|build muscle (?:plan|program)|weekly (?:workout|training|gym) (?:plan|program|schedule))\b/,types:[`workoutplan`]},{test:/\b(macro(?:nutrient)?s?\b|(?:calorie|nutrition(?:al)?) (?:breakdown|facts?|info|content)|grams? of (?:protein|carbs?|fat)|protein.*carb\w*.*fat|caloric breakdown)\b/,types:[`macrobreakdown`]},{test:/\b(medication (?:schedule|reminder|timing)|dosing schedule|pill (?:schedule|reminder)|when (?:to|should i|do i) take .{0,30}(?:pill\w*|drug|medication|meds?|tablet\w*|dose\w*)|what time .{0,20}(?:take|dose) .{0,20}(?:pill\w*|medication|meds?)|drug dosage (?:schedule|timing))\b/,types:[`medicationschedule`]},{test:/\b(chord diagram|guitar chord\b|(?:how to (?:play|finger)|fingering for) .{0,20}chord|barre chord|power chord|open chord|chord shape\w*)\b/,types:[`chorddiagram`]},{test:/\b((?:baby|child|toddler|infant) (?:milestone\w*|developmental? milestone\w*)|developmental? milestone\w*|\d+[- ]month[- ]old milestone\w*|\d+[- ]year[- ]old milestone\w*|when (?:should|do) (?:babies|kids|toddlers|infants)\b)\b/,types:[`developmentmilestone`]},{test:/\b(argument map\b|arguments? (?:for and against\b|supporting and opposing)|philosophical argument\b|claim(?:s?) (?:and|with) (?:evidence|support\w*|objection\w*)|debate the (?:claim|motion|topic)\b|case for and against\b)\b/,types:[`argumentmap`]},{test:/\b((?:soccer|football|basketball|baseball|tennis) (?:formation\b|lineup\b|position\w*|play diagram|tactic\w*)|4-3-3\b|4-4-2\b|3-5-2\b|4-2-3-1\b|3-4-3\b|defensive (?:shift\b|formation\b)|starting (?:eleven\b|xi\b|lineup\b))\b/,types:[`sportspitch`]},{test:/\b(floor\s?plan\b|room layout\b|apartment layout\b|(?:house|home|office) (?:layout\b|floor plan)|room arrangement\b|furniture layout\b)\b/,types:[`floorplan`]},{test:/\b(medical (?:history|timeline|chronolog\w*)|clinical (?:history|course|timeline)|patient (?:history|chronolog\w*)|diagnosis timeline\b|treatment (?:history|timeline)|symptom (?:progression|history|chronolog\w*))\b/,types:[`clinicaltimeline`]},{test:/\b(research (?:finding\w*|result\w*|summary|paper summary)|what (?:does|did) (?:the research|studies|the study|the science) (?:say|show|find|reveal)\b|scientific (?:consensus|evidence|finding\w*)|meta-?analysis\b|randomized (?:controlled )?trial\b|clinical (?:evidence|finding\w*|trial\w*))\b/,types:[`researchsummary`]},{test:/\b(hourly itinerary|hour.?by.?hour|itinerary (?:for|of)\b|trip itinerary|travel itinerary|daily itinerary|day.?by.?day (?:plan|schedule|itinerary)|morning (?:to|through) (?:evening|night)|full day (?:plan|schedule|itinerary)|schedule (?:for|of) (?:my |a |the )?(?:trip|day|visit))\b/,types:[`agenda`]}];function Xe(e){let t=e.toLowerCase(),n=[];for(let e of Ye)e.test.test(t)&&n.push(...e.types);return[...new Set(n)]}var Ze={datatable:`a data table`,diagramflow:`a flow diagram`,timeline:`a timeline`,codeblock:`a code block`,geomap:`a map`,gallery:`an image gallery`,pdfreader:`the document`,docview:`the document`,checklist:`a checklist`,howtosteps:`a step-by-step`,compare:`a side-by-side comparison`,quiz:`a quiz`,flashcard:`flashcards`,dictionary:`a definition`,recipecard:`a recipe`,dialogue:`a scripted dialogue`,variants:`variations`,translation:`a translation`,bracketbar:`a ranking`};function Qe(e){return Ze[e]??`a ${e}`}function $e(e){return e.length?`FORMAT REQUEST — the user explicitly asked for their answer in a specific FORM: ${[...new Set(e.map(Qe))].join(`, `)}. Make that the LEAD block (position 0 or 1), built fully and completely; the rest of the canvas supports it. Never answer in a different shape than the one they named.`:``}function et(e){if(!e)return``;for(let t=e.length-1;t>=0;t--)if(e[t].role===`user`)return e[t].content;return``}function tt(e,t){let n=e.toLowerCase(),r=et(t).toLowerCase(),i={};for(let e of $){let t=0;e.test.test(n)&&(t+=e.weight),r&&e.test.test(r)&&(t+=e.weight*.4),t>0&&(i[e.shape]=(i[e.shape]??0)+t)}return i}export{s as A,le as C,ee as D,_ as E,h as O,ge as S,v as T,b as _,Je as a,be as b,Be as c,Ve as d,Le as f,we as g,ke as h,qe as i,p as k,ze as l,Oe as m,tt as n,Q as o,Ne as p,$e as r,He as s,Xe as t,Z as u,ye as v,_e as w,he as x,ve as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{ht as n}from"./index-y8GL67bB.js";import"./providers-wzm7E8Pa.js";import{i as r,n as i}from"./info-CiqHR5cs.js";import{r as a,t as o}from"./keyVault-DEsNh9FR.js";var s=e({LIVE_V2_EVENT:()=>f,exportConfig:()=>B,getLiveConfigV2:()=>D,hasModelConfigured:()=>z,importConfig:()=>V,resetLiveConfig:()=>I,setLiveConfigV2:()=>P,setProviderField:()=>L,toCaps:()=>H,toModelConfig:()=>R,useLiveConfig:()=>U}),c=n(),l=t(),u=`mavea-live-v2`,d=`mavea-live-v2:secrets`,f=u,p={provider:`gemini`,models:{},keys:{},rememberKey:!1,webSearch:!1,searchMode:`off`,quality:`balanced`,searchProvider:`wikipedia`,searchKeys:{},memoryEnabled:!1,autoSaveFlashcards:!1,generativeBlocks:!0,libraryEnabled:!0,teachMode:!1,annotationsEnabled:!0,morningBrief:!1,explainLevel:`standard`,fontScale:`normal`,pttKey:`Alt`,pttSide:`any`,voiceSpeed:1};function m(e){return e===`left`||e===`right`?e:`any`}var h=null;function g(e){return i.some(t=>t.id===e)?e:p.provider}function _(e){let t={};if(e&&typeof e==`object`)for(let n of i){let r=e[n.id];typeof r==`string`&&(t[n.id]=r)}return t}function v(e,t){return typeof e==`boolean`?e:t}function y(e){return typeof e==`number`&&Number.isFinite(e)?Math.min(2,Math.max(.75,e)):p.voiceSpeed}function b(e){return e===`wikipedia`||e===`brave`||e===`tavily`?e:p.searchProvider}function x(e){return e===`off`||e===`realtime`?e:void 0}function S(e){return e===`fast`||e===`balanced`||e===`thorough`?e:p.quality}function C(e){return e===`simple`?`simple`:p.explainLevel}function w(e){return e===`smaller`||e===`larger`?e:p.fontScale}function T(e){let t={};if(e&&typeof e==`object`)for(let n of[`brave`,`tavily`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}function E(){try{if(typeof localStorage>`u`)return{...p};let e=localStorage.getItem(u);if(!e)return{...p};let t=JSON.parse(e),n=v(t.webSearch,p.webSearch),r=x(t.searchMode)??(t.searchMode===void 0&&n?`realtime`:`off`);return{provider:g(t.provider),models:_(t.models),keys:_(t.keys),rememberKey:v(t.rememberKey,p.rememberKey),webSearch:n,searchMode:r,quality:S(t.quality),searchProvider:b(t.searchProvider),searchKeys:T(t.searchKeys),memoryEnabled:v(t.memoryEnabled,p.memoryEnabled),autoSaveFlashcards:v(t.autoSaveFlashcards,p.autoSaveFlashcards),generativeBlocks:v(t.generativeBlocks,p.generativeBlocks),libraryEnabled:v(t.libraryEnabled,p.libraryEnabled),teachMode:v(t.teachMode,p.teachMode),annotationsEnabled:v(t.annotationsEnabled,p.annotationsEnabled),morningBrief:v(t.morningBrief,p.morningBrief),explainLevel:C(t.explainLevel),fontScale:w(t.fontScale),pttKey:typeof t.pttKey==`string`&&t.pttKey?t.pttKey:p.pttKey,pttSide:m(t.pttSide),voiceSpeed:y(t.voiceSpeed)}}catch{return{...p}}}function D(){return h||(h=E(),h)}function O(e){try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(u,{detail:e}))}catch{}}function k(e){return Object.keys(e.keys).length>0||Object.keys(e.searchKeys).length>0}var A=0,j=!1;async function M(e){let t=++A;if(!(typeof localStorage>`u`)){if(!e.rememberKey||!k(e)){if(e.rememberKey&&!j)return;try{localStorage.removeItem(d)}catch{}return}try{let n=await a(JSON.stringify({keys:e.keys,searchKeys:e.searchKeys}));if(t!==A)return;localStorage.setItem(d,n)}catch{if(t!==A)return;try{localStorage.removeItem(d)}catch{}}}}async function N(){if(typeof localStorage>`u`)return;let e;try{e=localStorage.getItem(d)}catch{j=!0;return}if(!e){j=!0;return}let t=A;try{let n=JSON.parse(await o(e));if(t===A){let e=D();h={...e,keys:{...e.keys,..._(n.keys)},searchKeys:{...e.searchKeys,...T(n.searchKeys)}},O(h)}}catch{}finally{j=!0}}function P(e){let t={...D(),...e};h=t;try{if(typeof localStorage<`u`){let e={...t,keys:{},searchKeys:{}};localStorage.setItem(u,JSON.stringify(e)),M(t)}}catch{}return O(t),t}function F(){typeof localStorage>`u`||(k(D())?(j=!0,P({})):N())}F();function I(){return P(p)}function L(e,t,n){let r=D(),i=t===`model`?`models`:`keys`;return P({[i]:{...r[i],[e]:n}})}function R(e){return{provider:e.provider,model:e.models[e.provider]||r(e.provider).defaultModel,apiKey:e.keys[e.provider]}}function z(e){let t=r(e.provider);return!!(e.models[e.provider]||t.defaultModel)&&(!t.needsKey||!!e.keys[e.provider])}function B(){let e={...D(),keys:{},searchKeys:{},rememberKey:!1};return JSON.stringify(e,null,2)}function V(e){try{let t=JSON.parse(e),n=v(t.webSearch,p.webSearch),r=x(t.searchMode)??(t.searchMode===void 0&&n?`realtime`:`off`);return P({provider:g(t.provider),models:_(t.models),keys:_(t.keys),rememberKey:!1,webSearch:n,searchMode:r,quality:S(t.quality),searchProvider:b(t.searchProvider),searchKeys:T(t.searchKeys),memoryEnabled:v(t.memoryEnabled,p.memoryEnabled),autoSaveFlashcards:v(t.autoSaveFlashcards,p.autoSaveFlashcards),generativeBlocks:v(t.generativeBlocks,p.generativeBlocks),libraryEnabled:v(t.libraryEnabled,p.libraryEnabled),teachMode:v(t.teachMode,p.teachMode),annotationsEnabled:v(t.annotationsEnabled,p.annotationsEnabled),morningBrief:v(t.morningBrief,p.morningBrief),explainLevel:C(t.explainLevel),fontScale:w(t.fontScale),pttKey:typeof t.pttKey==`string`&&t.pttKey?t.pttKey:p.pttKey,pttSide:m(t.pttSide),voiceSpeed:y(t.voiceSpeed)})}catch{throw Error(`Invalid config file — could not parse JSON.`)}}function H(e){return{webSearch:e.searchMode!==`off`,searchMode:e.searchMode,quality:e.quality,memoryEnabled:e.memoryEnabled,generativeBlocks:e.generativeBlocks,explainLevel:e.explainLevel}}function U(){let e=(0,c.c)(4),[t,n]=(0,l.useState)(W),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`)return;let e=()=>n(D());return window.addEventListener(f,e),e(),()=>window.removeEventListener(f,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,l.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a=[t,P],e[2]=t,e[3]=a),a}function W(){return D()}export{I as a,H as c,s as d,V as i,R as l,D as n,P as o,z as r,L as s,B as t,U as u};
|