@mavea/mavea 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/DISCLAIMER.md +2 -1
- package/PRIVACY.md +5 -4
- package/README.md +20 -15
- package/TERMS.md +3 -1
- package/dist/.vite/manifest.json +638 -569
- package/dist/assets/AnnotationLayer-qV6CIUZv.js +0 -0
- package/dist/assets/{AppCommandPalette-Dm3SedPO.js → AppCommandPalette-BHaYBZ5e.js} +1 -1
- package/dist/assets/AreaChart-DZGCSEwt.js +1 -0
- package/dist/assets/CadenceCard-P4teI7Se.js +1 -0
- package/dist/assets/CanvasSkeleton-CRGWlafo.js +1 -0
- package/dist/assets/{CheckLogRail-BU_rmAFH.js → CheckLogRail-DkHIHL0E.js} +1 -1
- package/dist/assets/{CommandPalette-E3reEqYR.js → CommandPalette-Bs6tpdZl.js} +1 -1
- package/dist/assets/{ConversationVideoStudio-DEZBpJUz.js → ConversationVideoStudio-C1sd4k53.js} +1 -1
- package/dist/assets/CourseLessonReader-YCcNKEW7.js +2 -0
- package/dist/assets/{CourseRail-C8MJG-zf.js → CourseRail-DXt3bzjU.js} +1 -1
- package/dist/assets/{CoursesApp-DFVkhP2f.js → CoursesApp-Dz6xjf4V.js} +2 -2
- package/dist/assets/{DashPresent-DwWDtjrU.js → DashPresent-5SRScC2i.js} +1 -1
- package/dist/assets/DashboardDetail-8J8TsdQg.css +1 -0
- package/dist/assets/DashboardDetail-DOfm8UCQ.js +2 -0
- package/dist/assets/DashboardLoopGate-Cf0y_HQ7.js +2 -0
- package/dist/assets/DashboardLoopRuntime-CnN5VayH.js +1 -0
- package/dist/assets/DashboardSettings-CE0B2y2y.js +1 -0
- package/dist/assets/DashboardsApp-_gbfdbX6.js +2 -0
- package/dist/assets/{DeepZoomApp-CxdcUeFJ.js → DeepZoomApp-BOLEl-kQ.js} +1 -1
- package/dist/assets/{DelegatePanel-B0kIu8Et.js → DelegatePanel-CHEB-OZl.js} +1 -1
- package/dist/assets/{DemoGallery-B__X0_H3.js → DemoGallery-DBqnu8TR.js} +1 -1
- package/dist/assets/{DropSelect-C3uYlej-.js → DropSelect-DjbdVfIR.js} +1 -1
- package/dist/assets/{ExportModal-CDGlhpdH.js → ExportModal-CLobMv1F.js} +1 -1
- package/dist/assets/{ExtractionPreview-CloJnrQi.js → ExtractionPreview-QZ2VHmsb.js} +2 -2
- package/dist/assets/{FeatureUseNotice-CwHstxBh.js → FeatureUseNotice-Dc8joBGM.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-CHsD5BSH.js → FlagshipCommandPalette-DnWuBjYI.js} +1 -1
- package/dist/assets/{FlagshipShowcase-D53Q_4m0.js → FlagshipShowcase-3qQDOK6g.js} +1 -1
- package/dist/assets/{FlashcardsApp-CnLfEnDH.js → FlashcardsApp-BQGM-Tr1.js} +1 -1
- package/dist/assets/{GalleryApp-2Ffc6CY6.js → GalleryApp-BWQ-J450.js} +1 -1
- package/dist/assets/{HonestByDesign-5jIu2ZC8.js → HonestByDesign-57LDf-gm.js} +1 -1
- package/dist/assets/{HowItWorks-BiJF84EM.js → HowItWorks-DMfPX3GK.js} +1 -1
- package/dist/assets/{LegalApp-zC-rvTww.js → LegalApp-CcO5Qq6R.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-CJ-gRHdX.js → LegalMarkdownDocument-Be_fQbZ_.js} +1 -1
- package/dist/assets/{LegalPageShell-Dyd4Uh3r.js → LegalPageShell-B-HY1WG7.js} +1 -1
- package/dist/assets/{LibraryOverlay-_xpWdhLN.js → LibraryOverlay-BilW6q_z.js} +1 -1
- package/dist/assets/LiveApp-C-OPBybd.css +1 -0
- package/dist/assets/LiveApp-DH3OxJFV.js +79 -0
- package/dist/assets/{LiveSettings-BceODlOb.js → LiveSettings-CuVMy7rZ.js} +3 -3
- package/dist/assets/{MindMapViewerDrawer-BuDodC0s.js → MindMapViewerDrawer-DI_S7fRZ.js} +1 -1
- package/dist/assets/{MindShape-CBcCC7hP.js → MindShape-C_Bo9hW9.js} +1 -1
- package/dist/assets/{PinToDashboard-DBIXvhlF.js → PinToDashboard-Cz5UJCmq.js} +1 -1
- package/dist/assets/PlanReview-CmUxzNqL.js +1 -0
- package/dist/assets/{Presence-CKSoyuhE.js → Presence-UqXfH4Y-.js} +1 -1
- package/dist/assets/{PresentationDeck-C518t9pP.js → PresentationDeck-B_EI33Pp.js} +1 -1
- package/dist/assets/{PrismApp-DRLl8841.js → PrismApp-DtLsPiQF.js} +2 -2
- package/dist/assets/{PrismAskController-QRwxRP8D.js → PrismAskController-Bt0k9hAA.js} +1 -1
- package/dist/assets/{PrismBriefingPlayer-Kyb8Vs_w.js → PrismBriefingPlayer-DzdtnFj4.js} +2 -2
- package/dist/assets/{PrismOverlay-Bj7tCu5Q.js → PrismOverlay-D1cDZamt.js} +3 -3
- package/dist/assets/{PrismWorkbench-BCnhkp-S.js → PrismWorkbench-BEIp4MiL.js} +1 -1
- package/dist/assets/{PrivacyApp-DHSRr8wq.js → PrivacyApp-B4DT2RUz.js} +6 -5
- package/dist/assets/{ReplayCard-CKo5reXy.js → ReplayCard-Dx46HCBT.js} +2 -2
- package/dist/assets/{ReplayOverlay-DqAwLshS.js → ReplayOverlay-CnJAxf0u.js} +1 -1
- package/dist/assets/{RewindOverlay-CkJIETE0.js → RewindOverlay-CousnxXo.js} +1 -1
- package/dist/assets/{RippleApp-C76VTaZK.js → RippleApp-D5j2VCt2.js} +2 -2
- package/dist/assets/{RippleAskController-CdlMlRH8.js → RippleAskController-9SxpZnHX.js} +1 -1
- package/dist/assets/{RippleOverlay-Mvz3CXhD.js → RippleOverlay-zcXAHPuJ.js} +2 -2
- package/dist/assets/{SeeDontRead-BkySmnP3.js → SeeDontRead-Dqfzha0V.js} +1 -1
- package/dist/assets/{ShareModal-Cl3ryjgK.js → ShareModal-DWxlrJSz.js} +2 -2
- package/dist/assets/{ShipCourse-Cy5ldKLE.js → ShipCourse-BavQppkt.js} +1 -1
- package/dist/assets/{SignatureLoop-Cdkifjb8.js → SignatureLoop-L8W2h62w.js} +1 -1
- package/dist/assets/{SynthesisApp-C5udWwng.js → SynthesisApp-C2O6pFeM.js} +2 -2
- package/dist/assets/{SynthesisOverlay-1o-CJsyX.js → SynthesisOverlay-DLvwiSMv.js} +1 -1
- package/dist/assets/{TermsApp-DIAESAZs.js → TermsApp-CxY1yorm.js} +4 -2
- package/dist/assets/TopicCanvas-LMI0zC7R.js +2 -0
- package/dist/assets/{TourPrism-Bxp--s0i.js → TourPrism-CI-iJZil.js} +1 -1
- package/dist/assets/TrackerTile-oz6IoG8m.js +2 -0
- package/dist/assets/{TwoSurfaces-C_0XBpwA.js → TwoSurfaces-Rnf-_WgY.js} +1 -1
- package/dist/assets/{WhyMachineOverlay-QDSZx5Y7.js → WhyMachineOverlay-ks9-rRiL.js} +1 -1
- package/dist/assets/WorldOverlay-BaQNNClA.js +2 -0
- package/dist/assets/{WorldOverlay-DRdBQMnb.css → WorldOverlay-D7ay5y4D.css} +1 -1
- package/dist/assets/{WowFeatures-DNEeO2pr.js → WowFeatures-C4efSbNV.js} +1 -1
- package/dist/assets/{ZoomDeck-qdlPe_yl.js → ZoomDeck-CBrr0yfy.js} +1 -1
- package/dist/assets/{annotationAuto-BmKrZ3hU.js → annotationAuto-CDv6Es44.js} +1 -1
- package/dist/assets/{backup-PaRBwjJy.js → backup-ZrlVatXc.js} +1 -1
- package/dist/assets/canvas-Bsx3eSaS.js +1 -0
- package/dist/assets/{capture-CL9ENM-c.js → capture-D8uPIcfj.js} +1 -1
- package/dist/assets/confirmAdd-DzMO9jKV.js +1 -0
- package/dist/assets/{coreIcons-BzqW7Qiz.js → coreIcons-DDTChE1H.js} +1 -1
- package/dist/assets/{dashboardEvents-D-wLCp1A.js → dashboardEvents-DKl5rrTD.js} +1 -1
- package/dist/assets/{dashboards-CdzGklae.css → dashboards-C1u2ks-d.css} +1 -1
- package/dist/assets/dataPending-DGdCvY5Y.js +1 -0
- package/dist/assets/display-CAb_PiGv.js +1 -0
- package/dist/assets/{engine-2U7mvPIl.js → engine-BiM6INsW.js} +1 -1
- package/dist/assets/{engine-BF8FqSbi.css → engine-CTvOaA86.css} +1 -1
- package/dist/assets/{explode-qQ7Fzt6V.js → explode-BgZIWY9m.js} +1 -1
- package/dist/assets/format-g3dP8OI3.js +1 -0
- package/dist/assets/{generate-C9vOL1C2.js → generate-Dl2EJ_SR.js} +1 -1
- package/dist/assets/{generateBeats-DpDpBcgV.js → generateBeats-DZHkvFvh.js} +1 -1
- package/dist/assets/{generateCourse-DU281tDE.js → generateCourse-C9qvaJRo.js} +1 -1
- package/dist/assets/{generateLive-_x2tWkBH.js → generateLive-B6purd69.js} +13 -13
- package/dist/assets/index-Dk0QapqQ.js +22 -0
- package/dist/assets/{index-D4FIsool.css → index-DmKgC_TJ.css} +1 -1
- package/dist/assets/{kokoro-CdL8Kl48.js → kokoro-P_fkcX-A.js} +1 -1
- package/dist/assets/lens-ChFJD9il.js +1 -0
- package/dist/assets/loader-DKJEcbPm.js +2 -0
- package/dist/assets/{model-DxwoIVpo.js → model-BFRTN9Eh.js} +1 -1
- package/dist/assets/{notes-CUeZ1cYu.js → notes-B0-EE0FK.js} +1 -1
- package/dist/assets/{number-Bmf7DqLj.js → number-zqlPMliA.js} +1 -1
- package/dist/assets/{pen-BAEq0JnM.js → pen-DNMslo3e.js} +1 -1
- package/dist/assets/{perfProbe-3Ip5n0yx.js → perfProbe-B9zJpjo9.js} +1 -1
- package/dist/assets/{pin-BwWjjqmt.js → pin-CZAIlpXt.js} +1 -1
- package/dist/assets/{planTracker-BI9z_0gW.js → planTracker-KKAtTBWs.js} +1 -1
- package/dist/assets/{portal-BJzn-Tgn.js → portal-Dogggsub.js} +1 -1
- package/dist/assets/{prewarm-CheeUP2L.js → prewarm-B4ELBOxf.js} +1 -1
- package/dist/assets/{providers-B2OCzEo1.js → providers-BovElgRL.js} +1 -1
- package/dist/assets/{quietHours-DCMczU9R.js → quietHours-CeBje_uU.js} +1 -1
- package/dist/assets/{ready-DZY1bETr.js → ready-jtAUOb62.js} +1 -1
- package/dist/assets/receipts-D7zveV-I.js +1 -0
- package/dist/assets/registry-6DGRAB1m.js +1 -0
- package/dist/assets/{registry-BRbEINOV.js → registry-6MOD-I7p.js} +1 -1
- package/dist/assets/registry-BFrgx1tE.js +1 -0
- package/dist/assets/{registry-BM9FDQxO.js → registry-CD1s3eQ-.js} +1 -1
- package/dist/assets/{registry-ChQGee7C.js → registry-CqhpLHM7.js} +1 -1
- package/dist/assets/registry-Cse2wF7x.css +1 -0
- package/dist/assets/registry-DGNSqTxE.js +1 -0
- package/dist/assets/{registry-D_4_HlMg.js → registry-GeAC3ZD7.js} +1 -1
- package/dist/assets/{relate-BXcg3Ioz.js → relate-BYdM5eiV.js} +1 -1
- package/dist/assets/{replay-rSsGKjEc.js → replay-TYXO0Brm.js} +1 -1
- package/dist/assets/{run-ndUTOxjM.js → run-Df10YPyB.js} +1 -1
- package/dist/assets/{run-CkaYNX89.js → run-DlvA3l28.js} +1 -1
- package/dist/assets/{run-aj7robML.js → run-gmqUaxcL.js} +1 -1
- package/dist/assets/seed-D_P5jyog.js +1 -0
- package/dist/assets/shapes-Cx5SCKgj.js +39 -0
- package/dist/assets/store-CsjDEADX.js +1 -0
- package/dist/assets/tiles-D-s6v-mA.js +1 -0
- package/dist/assets/types-DuEbJpIA.js +1 -0
- package/dist/assets/useDashboardLoop-DDqCFJKY.js +5 -0
- package/dist/assets/{useDashboards-GafZIADI.js → useDashboards-SRk8LqHe.js} +1 -1
- package/dist/assets/{useLiveConfig-DWz7BRdk.js → useLiveConfig-Cpy0_E_-.js} +1 -1
- package/dist/assets/{useStudy-CFIuakaM.js → useStudy-GwNcQWtv.js} +1 -1
- package/dist/assets/validate-sGUCmPAs.js +4 -0
- package/dist/assets/value-Dx7DZob4.js +1 -0
- package/dist/assets/{walkSync-AAocUygp.js → walkSync-CPsd-xu7.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/legal/DISCLAIMER.md +2 -1
- package/dist/legal/PRIVACY.md +5 -4
- package/dist/legal/TERMS.md +3 -1
- package/docs/media/course-lesson.jpg +0 -0
- package/docs/media/living-answer.jpg +0 -0
- package/package.json +3 -1
- package/dist/assets/AnnotationLayer-IiuYsoSa.js +0 -0
- package/dist/assets/CanvasSkeleton-CcHXJqdq.js +0 -2
- package/dist/assets/CourseLessonReader-Bpt-DkJo.js +0 -2
- package/dist/assets/DashboardDetail-D4wkiTux.js +0 -2
- package/dist/assets/DashboardLoopGate-B5UBPsvU.js +0 -2
- package/dist/assets/DashboardLoopRuntime-CAnZX234.js +0 -1
- package/dist/assets/DashboardSettings-eMhHliVh.js +0 -1
- package/dist/assets/DashboardsApp-BwFtTdWa.js +0 -2
- package/dist/assets/LiveApp-BNae3fDZ.css +0 -1
- package/dist/assets/LiveApp-DjcJQURO.js +0 -78
- package/dist/assets/PlanReview-DUQ7OMvV.js +0 -1
- package/dist/assets/TopicCanvas-DkzJORfl.js +0 -2
- package/dist/assets/TrackerTile-CyPD0A6b.js +0 -2
- package/dist/assets/WorldOverlay-DorHCLzw.js +0 -1
- package/dist/assets/canvas-BlkTFnVo.js +0 -1
- package/dist/assets/confirmAdd-CZPBG1xe.js +0 -1
- package/dist/assets/dataPending-lZUzUEo6.js +0 -1
- package/dist/assets/display-BrieMea1.js +0 -1
- package/dist/assets/format-rPI6ZwwH.js +0 -1
- package/dist/assets/index-CfcUMOBf.js +0 -22
- package/dist/assets/receipts-ClyzFFGD.js +0 -1
- package/dist/assets/registry-9QjeHgKs.js +0 -1
- package/dist/assets/registry-D4Xdd7dO.js +0 -1
- package/dist/assets/registry-DScSjt8p.css +0 -1
- package/dist/assets/registry-DuP_q42N.js +0 -1
- package/dist/assets/seed-DN4mRJp-.js +0 -1
- package/dist/assets/shapes-C5fjibEc.js +0 -42
- package/dist/assets/store-B39HvB_l.js +0 -1
- package/dist/assets/tiles-pdNi6MGe.js +0 -1
- package/dist/assets/useDashboardLoop-B_YA5jLs.js +0 -5
- package/dist/assets/validate-CnG23_8J.js +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{s as e}from"./spokenText-C88IQJ0M.js";import{d as t,h as n,v as r,y as i}from"./attachments-BW-vki-E.js";import{t as a}from"./providers-BovElgRL.js";import{n as o}from"./speed-K5_Ebj-8.js";import{i as s,n as c,r as l,t as u}from"./cache-CvbSI-pr.js";import{a as d,d as f,i as p,l as m,o as h,r as g,u as _}from"./validate-sGUCmPAs.js";import{n as v}from"./number-zqlPMliA.js";import{a as ee,c as y,i as b,l as x,n as te,o as ne,r as re,s as S}from"./officeDoc-GU6Cssjf.js";import{n as ie,r as ae,t as oe}from"./csv-DAqzYXUs.js";import"./search-ZN7v_P5B.js";var C=null,w=!1,T=!1,E=0,D=new Map;function O(){if(!(C||T)){if(typeof Worker>`u`){T=!0;return}try{C=new Worker(new URL(`/assets/worker-D7eK-Ya8.js`,``+import.meta.url),{type:`module`}),C.onmessage=e=>{let t=e.data;if(t.type===`ready`)w=!0;else if(t.type===`error`)T=!0,k();else if(t.type===`result`){let e=D.get(t.id);D.delete(t.id),e?.kind===`fit`&&e.resolve(t.fits)}else if(t.type===`embedded`){let e=D.get(t.id);D.delete(t.id),e?.kind===`embed`&&e.resolve(t.vec.length?t.vec:null)}},C.onerror=()=>{T=!0,k()},C.postMessage({type:`init`,base:ue,modelId:le})}catch{T=!0}}}function k(){for(let e of D.values())e.resolve(null);D.clear();try{C?.terminate()}catch{}C=null,w=!1}function se(e,t=80){if(O(),!w||!C)return Promise.resolve(null);let n=++E;return new Promise(r=>{let i=setTimeout(()=>{D.delete(n),r(null)},t);D.set(n,{kind:`fit`,resolve:e=>{clearTimeout(i),r(e?new Map(e):null)}}),C.postMessage({type:`fit`,id:n,query:e})})}function ce(e,t=80){if(O(),!w||!C)return Promise.resolve(null);let n=++E;return new Promise(r=>{let i=setTimeout(()=>{D.delete(n),r(null)},t);D.set(n,{kind:`embed`,resolve:e=>{clearTimeout(i),r(e)}}),C.postMessage({type:`embed`,id:n,text:e})})}var le=`minishlab/potion-base-8M`,ue=`/semantic/`,de=/\b(poems?|haikus?|limericks?|sonnets?|ballads?|rhymes?|riddles?|puns?|jokes?|knock[- ]?knock|tongue[- ]?twisters?|lullab(?:y|ies)|raps?)\b/i,fe=/\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 pe(e){let t=e.toLowerCase();return de.test(t)||fe.test(t)}var me=e=>!pe(e),A=`HARD HONESTY RULES:
|
|
2
|
+
- A node "value", a series point, or an edge "weight" (a 0..1 share of the outcome it explains) may ONLY be given when you can quote it VERBATIM from SOURCES — put that exact sentence in "quote" and set "tier":"T2" (or "T1" if it came from the user's own attached data). The weights of the edges INTO the outcome should sum to ≤ 1.
|
|
3
|
+
- If a cause, link, or figure comes from general knowledge with NO source sentence, set "tier":"T0" and OMIT value/weight/series/quote. Never invent a number, a percentage, or a citation.
|
|
4
|
+
- If SOURCES is empty, EVERY node and edge is "T0" with no numbers — a qualitative structure only.
|
|
5
|
+
- Every point of a "series" needs its OWN verbatim quote containing that point's digits. A series you cannot quote point-by-point must be omitted entirely, never smoothed or estimated.
|
|
6
|
+
- "sign" is 1 (reinforces) or -1 (dampens). "role" is "root" | "mechanism" | "outcome". "depth" grows from roots (0) to the outcome. Edges may only join TOP-LEVEL nodes — "children" are a breakdown of one node, never causal actors.
|
|
7
|
+
- Node "id" is a short stable slug of the label (lowercase, hyphens: "cheap-credit"), because a later turn has to be able to name the same node again.
|
|
8
|
+
- "date" is WHEN a cause happened, as a plain string: a year ("1986"), an ISO date ("1986-01-28"), or an ISO timestamp. Give one for every node you can place in time, even in an all-T0 world with no numbers anywhere, because it is what lets the reader lay the same causes out on a timeline. Omit it only when you would be guessing at the year. Where a source sentence states the date, make that the node's "quote" — a date the sources back is shown as established, and one only you know is shown as your own.
|
|
9
|
+
- "domain" is the sphere a node belongs to, one of: economy | policy | technology | science | environment | society | health | conflict. It is a description, not a claim, so it needs no source — but OMIT it when no single sphere fits, and never stretch one to cover a node.`,j=`Shape: {"title":"the question, verbatim","outcomeId":"<id of the outcome node>","nodes":[{"id":"","label":"","role":"","depth":0,"domain":"","date":"1986-01-28","tier":"T0","value":0,"unit":"","quote":"","detail":"","series":{"tier":"T0","unit":"","points":[{"t":"2008","value":0,"quote":""}]},"children":[{"id":"","label":"","tier":"T0"}]}],"edges":[{"from":"","to":"","verb":"","weight":0,"sign":1,"tier":"T0","quote":"","relation":""}],"provenance":{"illustrative":false}}`,M=`You are Mavéa's causal world-builder. Given a causal question and SOURCES, build the web that explains it: root causes → mechanisms → the outcome, each node carrying whatever the sources actually prove about it. Return ONLY compact JSON, no prose.
|
|
10
|
+
|
|
11
|
+
${A}
|
|
12
|
+
${j}`,N=`You are Mavéa's causal world-builder, EXTENDING a world that already exists. The user asked a follow-up about the SAME web. Return ONLY compact JSON, no prose.
|
|
13
|
+
|
|
14
|
+
ECHO THE IDS: every node you re-describe MUST reuse its EXISTING id, verbatim, from the roster you are given — that is the only way your answer lands on the world the user is looking at. Only a genuinely new cause gets a new slug id. Re-state "title" exactly as given.
|
|
15
|
+
A DELTA, NOT A WORLD: return ONLY the nodes the follow-up actually touches, and only the edges you are adding — every node you leave out keeps exactly what it already has. Re-listing the unchanged web wastes the reader's money and risks overwriting facts that are already proven.
|
|
16
|
+
Answer the follow-up by ENRICHING the nodes it is about (add a "series", a "children" breakdown, a "detail" sentence, a missing edge) — do not rebuild the web from scratch and do not rename anything.
|
|
17
|
+
|
|
18
|
+
${A}
|
|
19
|
+
${j}`,P={type:`object`,properties:{quote:{type:`string`},url:{type:`string`},host:{type:`string`},date:{type:`string`}},required:[`quote`]},F={type:`object`,properties:{tier:{type:`string`,enum:[`T0`,`T1`,`T2`,`T3`]},unit:{type:`string`},quote:{type:`string`},points:{type:`array`,items:{type:`object`,properties:{t:{type:`string`},value:{type:`number`},quote:{type:`string`}},required:[`t`,`value`]}}},required:[`tier`,`points`]},I={type:`object`,properties:{id:{type:`string`},label:{type:`string`},domain:{type:`string`,enum:[...h]},tier:{type:`string`,enum:[`T0`,`T1`,`T2`,`T3`]},value:{type:`number`},unit:{type:`string`},quote:{type:`string`}},required:[`id`,`label`]},L={type:`object`,properties:{title:{type:`string`},outcomeId:{type:`string`},nodes:{type:`array`,minItems:2,items:{type:`object`,properties:{id:{type:`string`},label:{type:`string`},role:{type:`string`,enum:[`root`,`mechanism`,`outcome`]},depth:{type:`number`},domain:{type:`string`,enum:[...h]},date:{type:`string`},tier:{type:`string`,enum:[`T0`,`T1`,`T2`,`T3`]},value:{type:`number`},unit:{type:`string`},quote:{type:`string`},detail:{type:`string`},series:F,children:{type:`array`,items:I}},required:[`id`,`label`,`role`]}},edges:{type:`array`,items:{type:`object`,properties:{from:{type:`string`},to:{type:`string`},verb:{type:`string`},weight:{type:`number`},sign:{type:`number`},tier:{type:`string`,enum:[`T0`,`T1`,`T2`,`T3`]},quote:{type:`string`},relation:{type:`string`},receipts:{type:`array`,items:P},counter:P},required:[`from`,`to`,`sign`]}},provenance:{type:`object`,properties:{illustrative:{type:`boolean`}}}},required:[`title`,`nodes`,`edges`]};function R(e){let t={slow:5,standard:8}[o(e)]??12;return{maxTokens:400+t*300,nodeCap:t}}var z=`(none — use only general knowledge; mark EVERY node and edge "T0" with no numbers and no series)`;function B(e){return e.text.trim()?e.text.trim().slice(0,6e3):z}function he(e,t,n){return`QUESTION: ${e.trim()}
|
|
20
|
+
|
|
21
|
+
SOURCES:
|
|
22
|
+
${B(t)}
|
|
23
|
+
|
|
24
|
+
Build the causal world (${n} nodes max). Quote SOURCES verbatim for any number, series point or weight; otherwise T0 with no numbers. DATE every cause you can place in time — a year is enough, and this is not a number needing a source. Reply as compact JSON on one line.`}function ge(e){return e.nodes.map(e=>`${e.id} = ${e.label}`).join(`
|
|
25
|
+
`)}function _e(e,t,n,r){return`TITLE (re-state verbatim): ${e.title}
|
|
26
|
+
|
|
27
|
+
EXISTING NODES — reuse these ids exactly:
|
|
28
|
+
${ge(e)}
|
|
29
|
+
|
|
30
|
+
FOLLOW-UP: ${t.trim()}
|
|
31
|
+
|
|
32
|
+
SOURCES:
|
|
33
|
+
${B(n)}
|
|
34
|
+
|
|
35
|
+
Answer the follow-up on THIS world with a DELTA — only the nodes it changes (${r} nodes max, existing ids echoed), never the whole web again. Quote SOURCES verbatim for any number, series point or weight; otherwise T0 with no numbers. DATE every cause you can place in time — a year is enough, and this is not a number needing a source. Reply as compact JSON on one line.`}async function V(e,t,n,r,i,o){let s;try{s=(await a(n.provider).generate({system:e,history:[],user:t,maxTokens:r,thinkingLevel:`minimal`,format:L,...o?{signal:o}:{}},n)).raw}catch{return null}return o?.aborted?null:g(s,i)}var H=new Map;function ve(e,t,n){return s(`world:${e}\0${t.text}`,n.provider)}function ye(e,t,n,r){let i=ve(e,t,n),a=H.get(i);if(a)return a;let o=be(i,e,t,n,r);for(H.set(i,o);H.size>16;){let e=H.keys().next().value;if(e===void 0||e===i)break;H.delete(e)}return o.then(e=>{e||H.delete(i)},()=>H.delete(i)),o}async function be(e,t,n,r,i){try{let t=await u(e);if(t)return t}catch{}let{maxTokens:a,nodeCap:o}=R(r.model??r.provider),s=await V(M,he(t,n,o),r,a,n,i);if(s)try{await c(e,s)}catch{}return s}var xe=.5;async function Se(e,t,n,r,i){let{maxTokens:a,nodeCap:o}=R(r.model??r.provider),s=await V(N,_e(e,t,n,o),r,a,n,i);return!s||d(e,s)<xe?null:p(e,s)}function Ce(e,t){let n=[],r=/<c\b([^>]*?)(?:\/>|>([\s\S]*?)<\/c>)/g,i;for(;(i=r.exec(e))!==null;){let e=i[1],r=/\br="([A-Z]+\d+)"/.exec(e)?.[1];if(!r)continue;let a=re(r);if(!a)continue;let o=ne(e,i[2]??``,t);o!==``&&n.push({col:a.col,row:a.row,addr:r,text:o})}return n}async function we(e){let t;try{t=await x(S(e))}catch{return null}if(!t)return null;let n=t.get(`xl/sharedStrings.xml`),r=n?ee(y(n)):[],i=[...t.keys()].filter(e=>/^xl\/worksheets\/sheet\d+\.xml$/.test(e)).sort((e,t)=>Number(e.match(/(\d+)\.xml$/)[1])-Number(t.match(/(\d+)\.xml$/)[1]));if(i.length===0)return null;let a=t.get(`xl/workbook.xml`),o=a?/<sheet[^>]*name="([^"]+)"/.exec(y(a))?.[1]??`Sheet1`:`Sheet1`,s=Ce(y(t.get(i[0])),r);if(s.length===0)return null;let c=[...new Set(s.map(e=>e.row))].sort((e,t)=>e-t),l=c[0],u=s.filter(e=>e.row===l).sort((e,t)=>e.col-t.col),d=u.map(e=>e.col),f=u.map((e,t)=>e.text||`col${t+1}`),p=new Map(s.map(e=>[`${e.col}:${e.row}`,e.text])),m=c.filter(e=>e>l),h=m.length,g=m.slice(0,ie),_=[],v=[];for(let e of g)_.push(d.map(t=>p.get(`${t}:${e}`)??``)),v.push(d.map(t=>`${b(t)}${e}`));return{headers:f,rows:_,addrs:v,sheet:o,sourceRowCount:h,truncated:h>_.length}}var U=/^\d{4}-\d{2}-\d{2}([ T]\d{2}:\d{2}(:\d{2})?)?$|^\d{1,2}[/-]\d{1,2}[/-]\d{2,4}$/,W=/^(true|false|yes|no)$/i;function G(e){let t=e.trim();if(!t)return null;let n=v(t);if(!n)return null;let r=n.kind===`pct`?`%`:/^[$€£]/.test(t)?t[0]:void 0;return{value:n.value,...r?{unit:r}:{}}}function Te(e){let t=e.trim();return t?G(t)?`number`:U.test(t)?`date`:W.test(t)?`boolean`:`text`:`empty`}function Ee(e,t,n){let r=n.filter(e=>e.trim()!==``);if(r.length===0)return{key:e,label:t,type:`empty`,values:n.map(()=>null),raw:n,parsedFraction:0};let i=r.slice(0,ae),a={number:0,date:0,boolean:0,text:0,empty:0};for(let e of i)a[Te(e)]+=1;let o=i.length,s=`text`;a.number/o>=.7?s=`number`:a.date/o>=.7?s=`date`:a.boolean/o>=.7&&(s=`boolean`);let c=0,l,u=n.map(e=>{let t=e.trim();if(!t)return null;if(s===`number`){let e=G(t);return e?(c+=1,e.unit&&!l&&(l=e.unit),e.value):null}return s===`boolean`?W.test(t)?(c+=1,/^(true|yes)$/i.test(t)):null:s===`date`?U.test(t)?(c+=1,t):null:(c+=1,t)});return{key:e,label:t,type:s,values:u,raw:n,parsedFraction:r.length?c/r.length:0,...l?{unit:l}:{}}}function De(e,t,n){let r=e.toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``)||`col${t+1}`,i=r,a=2;for(;n.has(i);)i=`${r}_${a++}`;return n.add(i),i}function Oe(e){let t=new Set;return e.headers.map((n,r)=>{let i=e.rows.map(e=>e[r]??``),a=Ee(De(n,r,t),n,i);return e.addrs&&(a.addrs=e.rows.map((t,n)=>e.addrs[n]?.[r]??``)),a})}async function ke(e,n){let r,a;if(i(e))a=`xlsx`,r=await we(e.data);else if(t(e)){a=`csv`;try{r=oe(new TextDecoder(`utf-8`).decode(S(e.data)))}catch{r=null}}else return{reason:`Not a CSV or Excel file.`};if(!r||r.headers.length===0)return{reason:`Could not read a table from ${e.name}.`};let o=Oe(r);return{dataset:{id:l(`${e.name}:${e.data.slice(0,2e5)}`),file:e.name,...r.sheet?{sheet:r.sheet}:{},columns:o,rowCount:r.rows.length,sourceRowCount:r.sourceRowCount,truncated:r.truncated,origin:a,parsedAt:n}}}var Ae=200;function je(e){let t=[`${e.file}: ${e.columns.map(e=>e.label).join(`, `)}`],n=Math.min(e.rowCount,Ae);for(let r=0;r<n;r+=1)t.push(e.columns.map(e=>`${e.label} ${e.raw[r]??``}`.trim()).join(` | `));return t.join(`
|
|
36
|
+
`)}async function Me(e){let a=[];for(let o of e)try{if(t(o)||i(o)){let{dataset:e}=await ke(o,0);e&&a.push(je(e))}else if(r(o))a.push(new TextDecoder(`utf-8`).decode(S(o.data)));else if(n(o)){let e=await te(o);e&&a.push(e.join(`
|
|
37
|
+
`))}}catch{}return a.join(`
|
|
38
|
+
|
|
39
|
+
`)}var Ne=8e3,K=new Map;function Pe(e,t){for(K.delete(e),K.set(e,t);K.size>2;){let e=K.keys().next().value;if(e===void 0)break;K.delete(e)}}async function Fe(e){let t=K.get(e);if(!t)return m;let n=await Promise.all(t.attachments.map(async e=>({source:{kind:`file`,title:e.name},text:await Me([e])})));return _([...n,...t.sources.map(f)],Ne)}var Ie=/\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/,Le=/\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/,q=/\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/,Re=[/^[\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 ze(e){let t=e.toLowerCase().trim();if(!t)return`rich`;let n=Ie.test(t);return q.test(t)||Le.test(t)?n?`brief`:`rich`:Re.some(e=>e.test(t))?`lean`:n?`brief`:`rich`}function Be(e){return q.test(e.toLowerCase())}var Ve=/\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 J(e){return Ve.test(e.toLowerCase())}function He(e,t){return e===`lean`?`minimal`:t?`low`:`minimal`}var Y=[`minimal`,`low`,`medium`,`high`];function Ue(e,t){let n=Y.indexOf(e);return Y[Math.min(Y.length-1,Math.max(0,n+t))]}function We(e,t,n=`fast`){let r=J(t);return e===`lean`&&!r?`minimal`:Ue(He(e,r),n===`thorough`?2:+(n===`balanced`))}var Ge=.1,Ke=.3,qe=.75;function Je(e,t,n){return t.creative?qe:e===`lean`||J(n)||t.troubleshoot?Ge:Ke}var X=140,Z=320;function Ye(t,n){let r=n===`lean`||n===`brief`?X:Z;return e(t.trim(),r)}function Q(e){return e===`lean`||e===`brief`?X:Z}var Xe=`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 Ze(e){return e===`lean`||e===`brief`?`SPOKEN LINE ("narration") — keep it to ONE short sentence (≈${Q(e)} characters). Right to the point.`:`SPOKEN LINE ("narration") — at most two or three short sentences (≈${Q(`rich`)} characters), like a person talking. The visuals carry the detail; never narrate the whole canvas.`}var $=[{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/}],Qe=[{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 $e(e){if(!e)return``;for(let t=e.length-1;t>=0;t--)if(e[t].role===`user`)return e[t].content;return``}function et(e,t){let n=e.toLowerCase(),r=$e(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 $)e.test.test(i)&&(a[e.key]=!0);(a.highStakes||a.reflection)&&(a.serious=!0);for(let e of Qe)if(e.test.test(i)){a.domain=e.domain;break}return a}function tt(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 nt=[{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/}],rt=[{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(?:make|say|write|phrase|word|put) (?:it|this|that|the \w{2,14}) (?:more |a bit |a little |much |way )?(?:firm|soft|warm|blunt|gentl|harsh|kind|stern|polit|casual|formal|direct|punchi|short|long|terse|friendl)\w*\b|\b(?:firmer|softer|warmer|blunter|gentler|harsher|sterner|punchier|shorter|longer|friendlier) (?:version|tone|wording|take|draft|phrasing)\b|\bexplain (?:it|this|that) (?:for|to) (?:an? )?(?:exec|executive|engineer|beginner|expert|layperson)\b|\b(?:at|in) (?:different|two|three|several) (?:levels?|tones?|registers?|reading levels?)\b|\bfor (?:different|two|three|several) audiences\b/,types:[`variantswitch`]},{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:/\bdifferences? between (?:an? |the )?\w+ and (?:an? |the )?\w+\b|\bhow (?:is|are|does|do) (?:an? |the )?\w+ (?:and (?:an? |the )?\w+ )?differ\w*\b|\bconfus\w+ (?:with|between|for)\b|\b(?:commonly|easily|often) confused\b|\bmix\w* (?:them|these two|those two|the two) up\b|\b(?:them|these two|those two|the two) (?:mixed|confused)\b|\btell\b[^.?!]{0,30}\bapart\b|\bwhich (?:one )?is which\b|\bare\b[^.?!]{1,40}\bthe same thing\b|\bwhen (?:to|do i|should i) use\b[^.?!]{1,30}\b(?:vs\.?|versus|instead of)\b/,types:[`distinctioncard`]},{test:/\bquiz\b|\btest me on\b|\bpractice questions\b/,types:[`quiz`]},{test:/\b(?:quiz|test|grill|drill) me\b|\btest my knowledge\b|\b(?:mock|practice|sample) (?:exam|test)\b|\b\d+[-\s]question\b|\b\d+ (?:practice|review|exam|multiple[-\s]choice|short[-\s]answer) questions?\b|\b(?:ask|give|write|make|generate) me \d+ questions\b|\bexam prep\b/,types:[`quizsession`]},{test:/\bflash\s?cards?\b/,types:[`flashcard`]},{test:/\b(?:100\s?%\s?)?stacked\s+(?:bar|column)s?(?:\s+(?:chart|graph))?\b|\bstacked\s+(?:chart|graph)\b|\b100\s?%\s?stacked\b/,types:[`stackedbars`]},{test:/\b(?:write|draft|compose|give me|make me) (?:me )?(?:an? |the )?(?:\w+[- ]){0,2}(?:essays?|articles?|blog posts?|op-?eds?)\b|\b(?:essays?|blog posts?) (?:about|on|arguing)\b|\b(?:cover letter|personal statement|statement of purpose|college essay)\b|\bin prose\b|\blong[-\s]?form\b|\b(?:wedding|best man'?s?|maid of honou?r|retirement|graduation|farewell) (?:toast|speech)\b|\b(?:few|couple(?: of)?|several|\d+) paragraphs\b|\bwrite (?:it|this) out in full\b/,types:[`longread`]},{test:/\bbrainstorm\w*\b|\b(?:ideas|suggestions) (?:for|on|about)\b|\b(?:some|any|other|more|fresh|a few) (?:ideas|suggestions|names)\b|\b(?:give|list|need|want) (?:me |us )?\d+ (?:ideas|suggestions|names)\b|\bgive me ideas\b|\bideas on how\b|\bwhat (?:should|could) (?:i|we) (?:call|name) (?:it|this|my|our|the)\b|\bname (?:ideas|suggestions)\b|\bwhat could (?:i|we) do about\b|\bpossible (?:approaches|angles|directions)\b|\bcome up with (?:some |a few |\d+ )?(?:ideas|names|concepts|angles|titles)\b/,types:[`ideaboard`]},{test:/\bdo(?:'|’)?s and don(?:'|’)?ts\b|\bwhat not to (?:say|do|wear|bring|ask|write|post)\b|\bwhat (?:should|do) i (?:say|do)\b[^.?!]{0,4}\b(?:when|if|at|during)\b|\bwhat (?:should|do) i avoid\b|\b(?:screw|mess|blow|botch) (?:this|it|that) up\b|\betiquette\b|\b(?:common|rookie|beginner|classic|typical) mistakes?\b|\bthings to avoid\b/,types:[`dosdonts`]},{test:/\banalog(?:y|ies) for\b|\bmetaphors? for\b|\b(?:an?|another|any|the) (?:\w+ ){0,2}analog(?:y|ies)\b|\bby analogy\b|\beli ?5\b|\blike i(?:'|’)?m (?:five|5)\b|\bfor a (?:five|5)[-\s]?year[-\s]?old\b|\b(?:explain|describe)\b[^.?!]{0,40}\blike\s+an?\b/,types:[`analogymap`]},{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 it(e){let t=e.toLowerCase(),n=[];for(let e of rt)e.test.test(t)&&n.push(...e.types);return[...new Set(n)]}var at={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`,stackedbars:`a stacked bar chart`,distinctioncard:`a distinction between the terms`,longread:`a long-form written piece`,ideaboard:`a board of ideas`,dosdonts:`a do's-and-don'ts list`,variantswitch:`the same content at several settings`,quizsession:`a graded quiz run`,analogymap:`an analogy`};function ot(e){return at[e]??`a ${e}`}function st(e){return e.length?`FORMAT REQUEST — the user explicitly asked for their answer in a specific FORM: ${[...new Set(e.map(ot))].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 ct(e){if(!e)return``;for(let t=e.length-1;t>=0;t--)if(e[t].role===`user`)return e[t].content;return``}function lt(e,t){let n=e.toLowerCase(),r=ct(t).toLowerCase(),i={};for(let e of nt){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{ye as _,tt as a,se as b,Q as c,We as d,ze as f,Se as g,Fe as h,et as i,Ze as l,Pe as m,lt as n,Xe as o,Be as p,st as r,Ye as s,it as t,Je as u,me as v,O as x,ce as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./friendlyAsk-BBdRZIar.js";import{n,t as r}from"./contentVault-xfUwSJ3i.js";var i={"15min":15,hourly:60,"6h":360,daily:1440,manual:1/0},a={daily:1440,weekly:10080,"on-change":1/0,manual:1/0};function o(e,t){return Number.isFinite(t)?e+t*6e4:2**53-1}function s(e){return e===`manual`?0:Math.round(43200/i[e])}function c(e,t){let n=e.window;if(n){if(t<n.startAt)return n.startAt;if(t>n.endAt)return 2**53-1}return o(t,i[e.data])}var l=`mavea-dash-opens-v1`,u=2592e6;function d(e){return!!e&&typeof e==`object`}function f(e,t){if(!d(e))return{};let n=t-u,r={};for(let[t,i]of Object.entries(e)){if(!t||!Array.isArray(i))continue;let e=i.filter(e=>typeof e==`number`&&Number.isFinite(e)&&e>=n).slice(-30);e.length&&(r[t]=e)}return r}var p;function ee(e){try{if(typeof localStorage>`u`)return{};let t=localStorage.getItem(l);return t?f(JSON.parse(t),e):{}}catch{return{}}}function m(e=Date.now()){return p??=ee(e),p}function h(e){p=e;try{typeof localStorage<`u`&&localStorage.setItem(l,JSON.stringify(e))}catch{}}function te(e,t=Date.now()){if(!e)return;let n=m(t),r=[...n[e]??[],t].filter(e=>e>=t-u).slice(-30);h({...n,[e]:r})}function ne(e,t,n=Date.now()){return(m(n)[e]??[]).filter(e=>e>=t).length}function g(e){let t=m(),n={};for(let[r,i]of Object.entries(t))e.has(r)&&(n[r]=i);h(n)}var re=12,_=new Map,ie=0,v=new Set;function y(){for(let e of v)e()}function ae(e){return v.add(e),()=>v.delete(e)}function oe(e,t=Date.now()){ie+=1;let n={id:`run-${ie}`,dashboardId:e,startedAt:t,steps:[{name:`scheduled`,ok:!0,at:t}]},r=_.get(e)??[];return _.set(e,[n,...r].slice(0,re)),y(),n}function se(e,t,n,r={}){e&&(e.steps.push({name:t,ok:n,at:r.at??Date.now(),...r.count===void 0?{}:{count:r.count},...r.detail?{detail:r.detail}:{}}),y())}function ce(e,t){e&&(e.endedAt=t.at??Date.now(),t.outcome&&(e.outcome=t.outcome),t.failure&&(e.failure=t.failure),t.attempts!==void 0&&(e.attempts=t.attempts),y())}var le=[];function ue(e){return _.get(e)??le}function de(e){e===void 0?_.clear():_.delete(e),y()}var fe=`mavea-dashboards`,b=`observations`,pe=1,me=200;function x(){return typeof indexedDB<`u`}var S=null;function C(){return S||(S=new Promise((e,t)=>{let n=indexedDB.open(fe,pe);n.onupgradeneeded=()=>{let e=n.result;if(!e.objectStoreNames.contains(b)){let t=e.createObjectStore(b,{keyPath:`id`});t.createIndex(`byTarget`,[`dashboardId`,`targetId`,`observedAt`]),t.createIndex(`byDashboard`,`dashboardId`)}},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error??Error(`indexedDB open failed`))}),S.catch(()=>{S=null}),S)}function w(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onerror=()=>n(e.error??Error(`indexedDB transaction failed`)),e.onabort=()=>n(e.error??Error(`indexedDB transaction aborted`))})}async function he(e,t,r,i=Date.now(),a){if(x())try{let o=await n({data:r,...a?.length?{receipts:a}:{}}),s=(await C()).transaction(b,`readwrite`),c=s.objectStore(b),l={id:`${e}:${t}:${i}`,dashboardId:e,targetId:t,observedAt:i,payload:o};c.put(l),await w(s),await ge(e,t)}catch{}}async function ge(e,t){try{let n=(await C()).transaction(b,`readwrite`),r=n.objectStore(b).index(`byTarget`),i=IDBKeyRange.bound([e,t,0],[e,t,1/0]),a=[];await new Promise((e,t)=>{let n=r.openKeyCursor(i,`next`);n.onsuccess=()=>{let t=n.result;if(!t)return e();a.push(t.primaryKey),t.continue()},n.onerror=()=>t(n.error??Error(`cursor failed`))});let o=a.length-me;if(o>0){let e=n.objectStore(b);for(let t of a.slice(0,o))e.delete(t)}await w(n)}catch{}}async function _e(e){if(x())try{let t=(await C()).transaction(b,`readwrite`),n=t.objectStore(b).index(`byDashboard`),r=t.objectStore(b);await new Promise((t,i)=>{let a=n.openKeyCursor(IDBKeyRange.only(e));a.onsuccess=()=>{let e=a.result;if(!e)return t();r.delete(e.primaryKey),e.continue()},a.onerror=()=>i(a.error??Error(`cursor failed`))}),await w(t)}catch{}}function T(e){return e.state?e.state:e.lastRefreshedAt===null?{status:`pending`}:e.lastDataOutcome===`unverified`?{status:`degraded`,lastSuccessAt:e.lastRefreshedAt,failure:{kind:`ungrounded`},lastAttemptAt:e.lastRefreshedAt}:{status:`active`,lastSuccessAt:e.lastRefreshedAt}}function E(e){return{status:`active`,lastSuccessAt:e}}function D(e,t,n){let r=e.status===`active`||e.status===`degraded`?e.lastSuccessAt:void 0;return r===void 0?{status:`pending`,failure:t,lastAttemptAt:n}:{status:`degraded`,lastSuccessAt:r,failure:t,lastAttemptAt:n}}function ve(e){switch(e.kind){case`auth`:return`Your model rejected the key — reconnect it in Live, then check again.`;case`rate-limit`:return`Your model provider is rate-limiting right now. This retries itself shortly.`;case`network`:return`Couldn't reach your model. This retries itself once the connection is back.`;case`no-model`:return`No model is connected yet — connect one in Live and this starts checking.`;case`ungrounded`:return`No live source backed this up — the model may not have searched. Try a stronger model in Settings, or reword what to track.`;case`provider-unavailable`:return`Your model provider is unavailable right now. This retries itself shortly.`}}function ye(e){switch(e){case`no-model`:return{kind:`no-model`};case`unverified`:return{kind:`ungrounded`};case`failed`:return{kind:`network`};default:return null}}var be=e({DASHBOARDS_EVENT:()=>k,DASHBOARDS_QUOTA_EVENT:()=>A,MAX_METRICS:()=>12,MAX_WIDGETS:()=>12,addDashboard:()=>He,addWidget:()=>$e,appendSource:()=>rt,applyRefreshResult:()=>yt,blockToWidget:()=>Ge,clearDashboards:()=>Ye,clearOneShot:()=>_t,createBlankDashboard:()=>We,ensureFirstCheck:()=>pt,foldInto:()=>$,getDashboard:()=>Ve,getDashboards:()=>Be,hasDroppedWrite:()=>Ee,invalidate:()=>J,markAiRefreshed:()=>mt,markDataRefreshed:()=>ut,markDataRetry:()=>ft,markTrackerFailure:()=>dt,markVerdictFailed:()=>lt,mergeDashboards:()=>Ue,newDashboardId:()=>N,removeDashboard:()=>Je,removeWidget:()=>Qe,reorderWidgets:()=>Xe,setCadenceWindow:()=>ht,setOneShot:()=>gt,setVerdict:()=>ct,setWidgetOrder:()=>tt,setWidgetRefreshQuery:()=>et,setWidgetSpan:()=>Ze,updateCadence:()=>qe,updateDashboard:()=>Ke,updateMetricValue:()=>ot,updateTripwireStates:()=>st,whenDashboardsHydrated:()=>K}),O=`mavea-dashboards-v1`,k=O,A=`${O}:quota`,j=24,xe=12,Se=4096,Ce=60,M=null,we=0,Te=!1;function Ee(){return Te}function N(){try{let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID()}catch{}return we+=1,`dash-${we.toString(36)}-${Math.floor(Math.random()*1e9).toString(36)}`}function De(e){let t=JSON.stringify(e,(e,t)=>typeof t==`string`&&t.length>Se&&t.startsWith(`data:`)?``:t);return JSON.parse(t)}function P(e){return!!e&&typeof e==`object`}function F(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function I(e,t=``){return typeof e==`string`?e:t}function Oe(e){return e===`5min`?`15min`:I(e,`manual`)}function ke(e){if(!P(e))return null;let t=e.at,n=e.value;return typeof t!=`number`||!Number.isFinite(t)||typeof n!=`number`||!Number.isFinite(n)?null:{at:t,value:n}}var Ae=new Set([`auth`,`rate-limit`,`network`,`no-model`,`ungrounded`,`provider-unavailable`]);function L(e){if(!P(e))return;let t=P(e.failure)&&Ae.has(I(e.failure.kind))?{kind:I(e.failure.kind),...typeof e.failure.retryAt==`number`&&Number.isFinite(e.failure.retryAt)?{retryAt:e.failure.retryAt}:{}}:void 0,n=typeof e.lastAttemptAt==`number`&&Number.isFinite(e.lastAttemptAt)?e.lastAttemptAt:void 0,r=typeof e.lastSuccessAt==`number`&&Number.isFinite(e.lastSuccessAt)?e.lastSuccessAt:void 0;if(e.status===`pending`)return{status:`pending`,...t?{failure:t}:{},...n===void 0?{}:{lastAttemptAt:n}};if(e.status===`active`&&r!==void 0)return{status:`active`,lastSuccessAt:r};if(e.status===`degraded`&&t&&n!==void 0)return{status:`degraded`,failure:t,lastAttemptAt:n,...r===void 0?{}:{lastSuccessAt:r}}}function je(e){if(!P(e))return null;let t=(Array.isArray(e.history)?e.history:[]).map(ke).filter(e=>e!==null).slice(-60);return{...e,history:t.length?t:void 0}}function Me(e){if(!P(e))return;let t=e.startAt,n=e.endAt;if(!(typeof t!=`number`||!Number.isFinite(t))&&!(typeof n!=`number`||!Number.isFinite(n)||n<=t))return{label:I(e.label),startAt:t,endAt:n,origin:e.origin===`search`?`search`:`user`}}function Ne(e){if(!(!P(e)||typeof e.text!=`string`||!e.text))return{text:e.text,at:F(e.at,0)}}function Pe(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!P(n)||typeof n.expected!=`string`||!n.expected)continue;let e=n.result;(e===`hit`||e===`miss`||e===`unclear`)&&t.push({at:F(n.at,0),expected:n.expected,result:e,...typeof n.note==`string`&&n.note?{note:n.note}:{}})}return t.slice(-20)}function R(e,t){if(!e.window||t<=e.window.endAt)return e;let{window:n,...r}=e;return r}var z=new Set([`thesis`,`alignmentgauge`,`standingalerts`,`sourceslineage`]);function Fe(e,t,n){let r=n||t;return r?e.map(e=>{if(e.refreshQuery?.trim()||e.metricId||z.has(e.block.type))return e;let t=e.block.props?.title,n=typeof t==`string`&&t.trim()?`${r} — ${t.trim()}`:r;return{...e,refreshQuery:n}}):e}function Ie(e){if(!P(e))return null;let n=I(e.id);if(!n)return null;let r=P(e.thesis)?e.thesis:null,i=Array.isArray(e.widgets)?e.widgets.filter(e=>P(e)&&P(e.block)):[],a=P(e.cadence)?e.cadence:{},o=P(e.alerts)?e.alerts:{},s=Le(e.lastVerdict),c=I(e.title,`Untitled`),l=t(I(e.question)),u=Me(a.window),d=Ne(e.prediction),f=Pe(e.predictionHistory);return{id:n,title:c,question:l,thesis:{text:I(r?.text),saidAt:F(r?.saidAt,0)},tripwires:Array.isArray(e.tripwires)?e.tripwires:[],metrics:Array.isArray(e.metrics)?e.metrics.map(je).filter(e=>e!==null):[],sources:Array.isArray(e.sources)?e.sources:[],widgets:Fe(i.slice(0,12),c,l),cadence:{data:Oe(a.data),ai:I(a.ai,`manual`),...u?{window:u}:{}},smartTrigger:typeof e.smartTrigger!=`boolean`||e.smartTrigger,alerts:{inApp:o.inApp!==!1,push:o.push===!0},...typeof e.topic==`string`&&e.topic?{topic:e.topic}:{},createdAt:F(e.createdAt,0),updatedAt:F(e.updatedAt,0),...typeof e.lastTouchedByUserAt==`number`&&Number.isFinite(e.lastTouchedByUserAt)?{lastTouchedByUserAt:e.lastTouchedByUserAt}:{},nextDataAt:F(e.nextDataAt,0),nextAiAt:F(e.nextAiAt,2**53-1),...typeof e.oneShotAt==`number`&&Number.isFinite(e.oneShotAt)?{oneShotAt:e.oneShotAt,oneShotLabel:I(e.oneShotLabel)}:{},...d?{prediction:d}:{},...f.length?{predictionHistory:f}:{},lastRefreshedAt:typeof e.lastRefreshedAt==`number`&&Number.isFinite(e.lastRefreshedAt)?e.lastRefreshedAt:null,...e.lastDataOutcome===`updated`||e.lastDataOutcome===`no-change`||e.lastDataOutcome===`unverified`?{lastDataOutcome:e.lastDataOutcome}:{},...L(e.state)?{state:L(e.state)}:{},...s?{lastVerdict:s}:{},...typeof e.lastVerdictAttemptAt==`number`&&Number.isFinite(e.lastVerdictAttemptAt)?{lastVerdictAttemptAt:e.lastVerdictAttemptAt}:{},...typeof e.lastVerdictError==`string`&&e.lastVerdictError?{lastVerdictError:e.lastVerdictError}:{}}}function Le(e){return!P(e)||typeof e.text!=`string`||!e.text?null:{text:e.text,at:F(e.at,0),grounded:e.grounded===!0,...Array.isArray(e.sources)?{sources:e.sources}:{},...typeof e.tripwireId==`string`?{tripwireId:e.tripwireId}:{}}}var B=!1,V=0;function H(e){return Array.isArray(e)?e.map(Ie).filter(e=>e!==null):[]}async function U(e){let t=++V;try{if(typeof localStorage>`u`)return;let r=await n(e);if(t!==V)return;localStorage.setItem(O,r)}catch(e){let t=e;if(t&&(t.name===`QuotaExceededError`||t.name===`NS_ERROR_DOM_QUOTA_REACHED`||t.code===22||t.code===1014)){Te=!0;try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(A))}catch{}}}}function Re(){try{if(typeof localStorage>`u`)return[];let e=localStorage.getItem(O);if(!e)return[];let t=H(JSON.parse(e));return t.length&&U(t),t}catch{return[]}}async function W(){try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(O);if(!e)return;try{JSON.parse(e);return}catch{}let t=H(await r(e));if(B)return;M=t,B=!0,typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(k,{detail:t}))}catch{}}var G=W();function K(){return G}function q(){return M??=Re(),M}function J(){let e=M;M=null,B=!1,G=W();try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(O);if(!e)return;JSON.parse(e)}catch{M=e}}function Y(e){return e.length<=j?e:[...e].sort((e,t)=>(t.lastTouchedByUserAt??t.updatedAt)-(e.lastTouchedByUserAt??e.updatedAt)).slice(0,j)}function X(e){let t=H(e);M=t,B=!0,U(t);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(k,{detail:t}))}catch{}}function Z(e,t,n=Date.now(),r={}){let i=!1,a=q().map(a=>a.id===e?(i=!0,{...t(a),updatedAt:n,...r.userTouch?{lastTouchedByUserAt:n}:{}}):a);i&&X(a)}var Q=null,ze=null;function Be(){let e=q();return(ze!==e||Q===null)&&(Q=[...e].sort((e,t)=>(t.lastTouchedByUserAt??t.createdAt)-(e.lastTouchedByUserAt??e.createdAt)),ze=e),Q}function Ve(e){return q().find(t=>t.id===e)??null}function He(e){X(Y([De({...e,lastTouchedByUserAt:e.lastTouchedByUserAt??e.updatedAt}),...q().filter(t=>t.id!==e.id)]))}function Ue(e){let t=H(e);if(!t.length)return 0;let n=new Map(q().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 X(Y([...n.values()])),t.length}function We(e){let t=e.now??Date.now();return{id:N(),title:e.title||`Untitled dashboard`,question:e.question??``,thesis:{text:``,saidAt:t},tripwires:[],metrics:[],sources:[{kind:`ORIGIN`,conversationId:`pin`,title:e.title||`Pinned cards`,contributed:`Started by pinning a card.`,at:t}],widgets:[],cadence:{data:`manual`,ai:`manual`},smartTrigger:!1,alerts:{inApp:!0,push:!1},...e.topic?{topic:e.topic}:{},createdAt:t,updatedAt:t,nextDataAt:2**53-1,nextAiAt:2**53-1,lastRefreshedAt:null}}function Ge(e,t=`pin`,n){let r=new Set([`chart`,`plot`,`dualaxis`,`bars`,`timeline`,`breakdown`,`table`]);return{id:`w-pin-`+Math.random().toString(36).slice(2,9),block:e,span:r.has(e.type)?2:1,fromSource:t,...n?.trim()?{refreshQuery:n.trim()}:{}}}function Ke(e,t){Z(e,e=>({...e,...t}),void 0,{userTouch:!0})}function qe(e,t,n=Date.now()){Z(e,e=>{let r={...e.cadence,...t};return{...e,cadence:r,...t.data===void 0?{}:{nextDataAt:c(r,n)},...t.ai===void 0?{}:{nextAiAt:o(n,a[r.ai])}}},n,{userTouch:!0})}function Je(e){let t=q().filter(t=>t.id!==e);t.length!==q().length&&(X(t),g(new Set(t.map(e=>e.id))),de(e),_e(e))}function Ye(){q().length!==0&&(X([]),g(new Set))}function Xe(e,t,n){Z(e,e=>{let r=[...e.widgets];if(t<0||t>=r.length||n<0||n>=r.length)return e;let[i]=r.splice(t,1);return r.splice(n,0,i),{...e,widgets:r}},void 0,{userTouch:!0})}function Ze(e,t,n){Z(e,e=>({...e,widgets:e.widgets.map(e=>e.id===t?{...e,span:n}:e)}),void 0,{userTouch:!0})}function Qe(e,t){Z(e,e=>({...e,widgets:e.widgets.filter(e=>e.id!==t)}),void 0,{userTouch:!0})}function $e(e,t,n={}){let r=Array.isArray(t)?t:[t];r.length!==0&&Z(e,e=>{let t=Math.max(0,Math.min(n.at??e.widgets.length,e.widgets.length)),i=[...e.widgets.slice(0,t),...r,...e.widgets.slice(t)],a=i;if(i.length>12){let e=i.filter(e=>!z.has(e.block.type)),t=i.length-12;if(e.length>=t){let n=new Set(e.slice(-t).map(e=>e.id));a=i.filter(e=>!n.has(e.id))}else a=i.slice(0,12)}return{...e,widgets:a,...n.source?{sources:[...e.sources,n.source].slice(-nt)}:{}}},void 0,{userTouch:!0})}function et(e,t,n){let r=n.trim();if(!r||t.length===0)return;let i=new Set(t);Z(e,e=>({...e,widgets:e.widgets.map(e=>i.has(e.id)?{...e,refreshQuery:r}:e)}))}function tt(e,t){Z(e,e=>{let n=new Map(e.widgets.map(e=>[e.id,e])),r=t.map(e=>n.get(e)).filter(e=>!!e),i=new Set(r.map(e=>e.id)),a=e.widgets.filter(e=>!i.has(e.id));return{...e,widgets:[...r,...a]}},void 0,{userTouch:!0})}var nt=24;function rt(e,t){Z(e,e=>({...e,sources:[...e.sources,t].slice(-24)}),void 0,{userTouch:!0})}var it=12;function $(e,t){Z(e,e=>({...e,metrics:[...e.metrics,...t.metrics].slice(0,12),tripwires:[...e.tripwires,...t.tripwires].slice(0,12),widgets:[...e.widgets,...t.widgets].slice(0,12),sources:[...e.sources,t.source].slice(-24)}),void 0,{userTouch:!0})}function at(e,t,n){if(n===null)return e;let r=[...e??[],{at:t,value:n}];return r.length>Ce?r.slice(-60):r}function ot(e,t,n,r,i,a=Date.now()){Z(e,e=>({...e,metrics:e.metrics.map(e=>e.id===t?{...e,lastValue:n,lastRaw:r,origin:i,asOf:a,history:at(e.history,a,n)}:e)}),a,{userTouch:i===`user`})}function st(e,t,n=Date.now()){Z(e,e=>({...e,tripwires:t}),n)}function ct(e,t,n=Date.now()){Z(e,e=>({...e,lastVerdict:t,lastVerdictAttemptAt:n,lastVerdictError:void 0}),n)}function lt(e,t,n){Z(e,e=>({...e,lastVerdictAttemptAt:t,lastVerdictError:n}),t)}function ut(e,t=Date.now(),n=`updated`){Z(e,e=>{let r=R(e.cadence,t);return{...e,cadence:r,nextDataAt:c(r,t),lastRefreshedAt:t,lastDataOutcome:n,state:E(t)}})}function dt(e,t,n=Date.now()){Z(e,e=>({...e,state:D(T(e),t,n)}))}function ft(e,t){Z(e,e=>({...e,nextDataAt:t,...e.oneShotAt!==void 0&&e.oneShotAt<t?{oneShotAt:t}:{}}))}function pt(e,t=Date.now()){Z(e,e=>e.oneShotAt===void 0?{...e,oneShotAt:t,oneShotLabel:`first check`}:e)}function mt(e,t=Date.now()){Z(e,e=>({...e,nextAiAt:o(t,a[e.cadence.ai])}))}function ht(e,t,n=Date.now()){Z(e,e=>{let r=t?{...e.cadence,window:t}:{...e.cadence,window:void 0};return{...e,cadence:r,nextDataAt:c(r,n)}},n,{userTouch:t?.origin===`user`})}function gt(e,t,n,r=Date.now()){Z(e,e=>({...e,oneShotAt:t,oneShotLabel:n}),r,{userTouch:!0})}function _t(e,t=Date.now()){Z(e,e=>({...e,oneShotAt:void 0,oneShotLabel:void 0}),t)}var vt=3e5;function yt(e,t,n=Date.now()){Z(e,e=>{let r=new Map((t.values??[]).map(e=>[e.metricId,e])),i=new Map((t.blocks??[]).map(e=>[e.widgetId,e.block])),a=e.prediction,o=e.predictionHistory;if(t.grade&&a){let e={at:n,expected:a.text,result:t.grade.result,...t.grade.note?{note:t.grade.note}:{}};o=[...o??[],e].slice(-20),a=void 0}t.expects?.trim()&&(a={text:t.expects.trim(),at:n});let s=R(e.cadence,n),l=c(s,n),u=t.outcome===`unverified`&&e.lastDataOutcome!==`unverified`&&l!==2**53-1&&(!s.window||n>=s.window.startAt)?Math.min(l,n+vt):l;return{...e,cadence:s,metrics:e.metrics.map(e=>{let t=r.get(e.id);return t?{...e,lastValue:t.value,lastRaw:t.raw,origin:t.origin,asOf:n,history:at(e.history,n,t.value)}:e}),widgets:e.widgets.map(e=>{let t=i.get(e.id);return t?{...e,block:t}:e}),...t.tripwires?{tripwires:t.tripwires}:{},...t.consumedOneShot?{oneShotAt:void 0,oneShotLabel:void 0}:{},nextDataAt:u,lastRefreshedAt:n,lastDataOutcome:t.outcome,state:t.outcome===`unverified`?D(T(e),{kind:`ungrounded`},n):E(n),prediction:a,predictionHistory:o}},n)}export{be as A,ue as B,Je as C,tt as D,ct as E,K as F,ne as G,se as H,ye as I,i as J,te as K,ve as L,Ke as M,ot as N,et as O,st as P,T as R,N as S,ht as T,oe as U,ce as V,ae as W,c as X,s as Y,o as Z,mt as _,He as a,lt as b,Ge as c,pt as d,$ as f,J as g,Ee as h,xe as i,qe as j,Ze as k,_t as l,Be as m,A as n,$e as o,Ve as p,a as q,it as r,yt as s,k as t,We as u,ft as v,Qe as w,Ue as x,dt as y,he as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";var n=e(),r=t();function i(e){if(e<=0)return`due now`;let t=Math.round(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;if(n<24)return r?`${n}h ${r}m`:`${n}h`;let i=Math.floor(n/24),a=n%24;return a?`${i}d ${a}h`:`${i}d`}function a(e){let t=(0,n.c)(9),{targetAt:a,now:o,label:s}=e,c=a-o,l;t[0]===c?l=t[1]:(l=i(c),t[0]=c,t[1]=l);let u;t[2]===l?u=t[3]:(u=(0,r.jsx)(`span`,{className:`tile-countdown-value`,children:l}),t[2]=l,t[3]=u);let d;t[4]===s?d=t[5]:(d=s&&(0,r.jsx)(`span`,{className:`tile-countdown-label`,children:s}),t[4]=s,t[5]=d);let f;return t[6]!==u||t[7]!==d?(f=(0,r.jsxs)(`div`,{className:`tile-countdown`,children:[u,d]}),t[6]=u,t[7]=d,t[8]=f):f=t[8],f}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){return e.entities.filter(e=>e.parentId===t)}function t(e,t){return e.facts.filter(e=>e.entityId===t)}export{t as n,e as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/liveSchema-B4bQtO88.js","assets/icons-gLFQTv74.js","assets/jsx-runtime-DeHZSEgm.js","assets/rolldown-runtime-DkW27tQK.js","assets/spokenText-C88IQJ0M.js","assets/safeImageUrl-BINWXOTz.js","assets/catalog-BHjl-1uH.js","assets/sourceHost-BV3t2XDb.js","assets/annotations-CftUUB13.js","assets/catalog-Db9GWM6N.js","assets/preload-helper-CiWYd9n-.js","assets/facts-BUGuVUIc.js","assets/blockTypes-DUDdP3pB.js","assets/streamParse-B-Gjwa9T.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{t as n}from"./compiler-runtime-qQQXpJgv.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{i as a,t as o}from"./http-Lar_UMKb.js";import{E as s,G as c,H as l,L as u,P as d,U as f,V as p,_ as m,b as h,m as g,p as _,s as v,v as y,y as b,z as ee}from"./store-CsjDEADX.js";import{t as te}from"./providers-BovElgRL.js";import{l as x,n as S}from"./useLiveConfig-Cpy0_E_-.js";import{t as ne}from"./json-B0N3XRZU.js";import{i as C}from"./number-zqlPMliA.js";import{i as w,n as T,r as E}from"./ledger-Cv0LBflx.js";import{d as re,i as D,l as O,o as ie,u as k}from"./format-g3dP8OI3.js";import{t as A}from"./dataPending-DGdCvY5Y.js";import{t as j}from"./now-C9-UAzTC.js";import{n as ae,t as oe}from"./predictions-CkVKHq-5.js";import{t as se}from"./notify-Bz4wuE4T.js";import{a as M,i as ce,r as le,t as ue,u as de}from"./dashboardEvents-DKl5rrTD.js";var N=t(),fe=n(),pe=`mavea-dashboard-scheduler`;function me(){if(typeof navigator>`u`)return null;let e=navigator.locks;return typeof e?.request==`function`?e:null}async function he(e){let t=me();if(!t){await e();return}try{await t.request(pe,{ifAvailable:!0},async t=>{t&&await e()})}catch{await e()}}function ge(e){return new Set(e.toLowerCase().replace(/[^a-z0-9 ]/g,` `).replace(/\s+/g,` `).trim().split(` `).filter(e=>e.length>3))}function P(e){return e.replace(/\s+/g,` `).trim().toLowerCase()}var _e={WATCHING:`watching`,CLEAR:`clear`,TRIGGERED:`triggered`,AWAITING:`awaiting`},ve={ORIGIN:`origin`,ADDED:`added`,LINKED:`linked`},ye={CLEAR:1,WATCHING:.75,TRIGGERED:0,AWAITING:0};function be(e){let t=e.tripwires.filter(e=>e.state!==`AWAITING`);if(t.length===0)return null;let n=t.reduce((e,t)=>e+ye[t.state],0);return Math.round(100*n/t.length)}function xe(e){return e===null?``:e>=80?`Tracking well`:e>=55?`Holding, with risks`:e>=30?`Slipping`:`Lines are breaking`}var Se=new Set([`thesis`,`alignmentgauge`,`standingalerts`,`sourceslineage`]);function Ce(e){let t=e.block.type;return Se.has(t)?!0:!!e.metricId&&t===`insight`}function we(e,t){let n=t.block.type;if(!Se.has(n)){if(t.metricId&&n===`insight`){let n=e.metrics.find(e=>e.id===t.metricId);if(n){let e=n.lastValue===null?`—`:n.lastRaw??O(String(n.lastValue),n.unit),r=n.lastValue===null?`inferred`:`strong`,i=t.block.props;return{...t.block,props:{...i,stat:e,conf:r}}}}return t.block}let r=e.sources.find(e=>e.kind===`ORIGIN`);if(n===`thesis`){let n=e.tripwires[0],i={reasoning:e.thesis.text,...r?{asOf:r.title}:{},...n?{reconsiderIf:n.label,tripwireState:_e[n.state]}:{}};return{...t.block,props:i}}if(n===`alignmentgauge`){let n=be(e),r={pct:n,band:xe(n)};return{...t.block,props:r}}if(n===`standingalerts`){let n={alerts:e.tripwires.map(e=>({label:e.label,state:_e[e.state]}))};return{...t.block,props:n}}let i={rows:e.sources.map(e=>({kind:ve[e.kind],label:e.title,...e.contributed?{contributed:e.contributed}:{}}))};return{...t.block,props:i}}var Te={metric:`{"kind":"metric","value":number,"raw"?:string}`,series:`{"kind":"series","points":[{"label":string,"value":number}]}`,list:`{"kind":"list","items":[string]}`,table:`{"kind":"table","columns":[string],"rows":[[string]]}`,event:`{"kind":"event","events":[{"when":string,"title":string,"detail"?:string}]}`};function F(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function I(e){return Array.isArray(e)?e:[]}function L(e){return typeof e==`string`?e.trim():typeof e==`number`&&Number.isFinite(e)?String(e):typeof e==`boolean`?e?`yes`:`no`:``}function R(e,...t){for(let n of t){let t=L(e[n]);if(t)return t}return``}function Ee(e){if(!F(e))return L(e);let t=R(e,`text`,`label`,`title`,`name`,`item`);if(t){let n=Object.entries(e).filter(([e])=>![`text`,`label`,`title`,`name`,`item`].includes(e)).map(([,e])=>L(e)).filter(Boolean);return n.length?`${t} — ${n.join(` — `)}`:t}return Object.values(e).map(L).filter(Boolean).join(` — `)}function De(e,t){let n=F(t)?t:{};switch(e){case`metric`:{let e=C(n.value??n.number??n.amount??t);if(e===null)return null;let r=R(n,`raw`,`display`,`formatted`);return{kind:`metric`,value:e,...r?{raw:r}:{}}}case`series`:{let e=I(n.points??n.data??n.series).map(e=>{let t=F(e)?e:{},n=R(t,`label`,`name`,`x`,`when`,`date`),r=C(t.value??t.y??t.amount);return n&&r!==null?{label:n,value:r}:null}).filter(e=>e!==null);return e.length?{kind:`series`,points:e}:null}case`list`:{let e=I(n.items??n.list??n.entries??t).map(Ee).filter(Boolean);return e.length?{kind:`list`,items:e}:null}case`table`:{let e=I(n.rows??n.data??t),r=I(n.columns??n.headers??n.cols).map(L).filter(Boolean);!r.length&&F(e[0])&&(r=Object.keys(e[0]).map(L));let i=e.map(e=>Array.isArray(e)?e.map(L):F(e)?r.map(t=>L(e[t])):[]).filter(e=>e.some(Boolean));return r.length&&i.length?{kind:`table`,columns:r,rows:i}:null}case`event`:{let e=I(n.events??n.items??t).map(e=>{let t=F(e)?e:{},n=R(t,`title`,`name`,`event`,`label`);if(!n)return null;let r=R(t,`when`,`date`,`time`,`at`,`start`),i=R(t,`detail`,`description`,`note`,`status`);return{when:r,title:n,...i?{detail:i}:{}}}).filter(e=>e!==null);return e.length?{kind:`event`,events:e}:null}}}var Oe={list:`list`,checklist:`list`,timeline:`event`,datatable:`table`,standings:`table`,chart:`series`,bars:`series`};function z(e){return Oe[e]??null}function B(e,t){return e.raw??O(String(e.value),t)}function ke(e,t,n={},r){let i=typeof n.title==`string`?n.title:``,a={...i?{title:i}:{},...n.icon?{icon:n.icon}:{}};switch(e){case`insight`:return t.kind===`metric`?{...n,...a,stat:B(t,r),conf:`strong`}:null;case`kpi`:return t.kind===`metric`?{...a,items:[{label:i||`Now`,value:B(t,r)}]}:t.kind===`series`?{...a,items:t.points.slice(-4).map(e=>({label:e.label,value:String(e.value)}))}:null;case`list`:case`checklist`:{let n=t.kind===`list`?t.items:t.kind===`event`?t.events.map(e=>[e.when,e.title,e.detail].filter(Boolean).join(` — `)):t.kind===`series`?t.points.map(e=>`${e.label} — ${e.value}`):t.kind===`table`?t.rows.map(e=>e.filter(Boolean).join(` — `)):null;return n?.length?e===`checklist`?{...a,rows:n.map(e=>({t:e,st:`todo`}))}:{...a,items:n}:null}case`timeline`:return t.kind===`event`?{...a,events:t.events.map(e=>({time:e.when,title:e.title,...e.detail?{detail:e.detail}:{}}))}:null;case`datatable`:{if(t.kind!==`table`)return null;let e=t.columns.map((e,t)=>({key:`c${t}`,label:e}));return{...a,columns:e,rows:t.rows.map(e=>Object.fromEntries(e.map((e,t)=>[`c${t}`,e])))}}case`standings`:{if(t.kind!==`table`)return null;let e=t.rows.map(e=>({team:e[0]??``,rec:e[1]??``,gb:e[2]??``})).filter(e=>e.team);return e.length?{...a,rows:e}:null}case`chart`:return t.kind===`series`?{...a,labels:t.points.map(e=>e.label),series:[{name:i||`Value`,color:`var(--insight)`,data:t.points.map(e=>e.value)}],conf:`strong`}:null;case`bars`:return t.kind===`series`?{...a,bars:t.points.map(e=>({label:e.label,value:e.value})),conf:`strong`}:null;default:return null}}r();function Ae(e){let t=e instanceof Error?e.message:String(e);if(/\b429\b|rate.?limit/i.test(t)){let e=Number(/(?:in|after)\s+([\d.]+)\s*s/i.exec(t)?.[1]);return Number.isFinite(e)&&e>0?{kind:`rate-limit`,retryAt:Date.now()+Math.min(e*1e3,12e4)}:{kind:`rate-limit`}}return/\b401\b|\b403\b|api key|unauthor/i.test(t)?{kind:`auth`}:/\b5\d\d\b|overloaded|unavailable|capacity/i.test(t)?{kind:`provider-unavailable`}:{kind:`network`}}function je(e,t,n,r){switch(e){case`gt`:return t>r;case`gte`:return t>=r;case`lt`:return t<r;case`lte`:return t<=r;case`crosses_up`:return n!==null&&n<r&&t>=r;case`crosses_down`:return n!==null&&n>r&&t<=r;case`pct_rise`:return n!==null&&n!==0&&(t-n)/Math.abs(n)*100>=r;case`pct_drop`:return n!==null&&n!==0&&(n-t)/Math.abs(n)*100>=r;default:return!1}}function Me(e,t,n){if(n===0)return!0;let r=t/n;switch(e){case`gt`:case`gte`:return r>=.9;case`lt`:case`lte`:return r<=1.1;default:return!0}}function Ne(e,t,n){return t===null?`AWAITING`:je(e.comparator,t,n,e.threshold)?`TRIGGERED`:Me(e.comparator,t,e.threshold)?`WATCHING`:`CLEAR`}function V(e,t={}){let n=new Map(e.metrics.map(e=>[e.id,e])),r=[];return{tripwires:e.tripwires.map(e=>{let i=n.get(e.metricId),a=i?i.lastValue:null,o=Ne(e,a,e.metricId in t?t[e.metricId]:a),s=o===`TRIGGERED`&&e.state!==`TRIGGERED`?{...e,state:o,brokenValue:a??void 0,brokenAt:i?.asOf}:{...e,state:o};return o===`TRIGGERED`&&e.state!==`TRIGGERED`&&r.push(s),s}),newlyTriggered:r}}function Pe(e,t){return e.nextDataAt<=t||e.oneShotAt!==void 0&&e.oneShotAt<=t}function H(e){return e.oneShotAt===void 0?e.nextDataAt:Math.min(e.nextDataAt,e.oneShotAt)}function Fe(e,t=Date.now(),n=4){return e.filter(e=>Pe(e,t)).sort((e,t)=>H(e)-H(t)).slice(0,n)}function Ie(e,t=Date.now()){return e.filter(e=>e.nextAiAt<=t).sort((e,t)=>e.nextAiAt-t.nextAiAt)[0]??null}function U(e,t,n=Date.now()){return e.smartTrigger&&t.length>0?{fire:!0,trigger:t[0]}:(e.cadence.ai===`daily`||e.cadence.ai===`weekly`)&&n>=e.nextAiAt?{fire:!0,trigger:`scheduled`}:{fire:!1,trigger:null}}function W(e){let t=[];for(let n of o(e.sources)){let e=a(n);typeof e.title==`string`&&typeof e.url==`string`&&t.push({title:e.title,url:e.url})}return t}function G(e,t){return(e.sources?.length??0)>0||W(t).length>0}function Le(e){return`- VALUE "${e.label}" — ${e.query}`}function Re(e,t,n){let r=z(e.block.type);return r?`- DATA #${t} [${r}] ${e.refreshQuery}\n return EXACTLY: ${Te[r]}`:`- BLOCK #${t} [${e.block.type}] ${e.refreshQuery}\n`+(n?` expected props (use EXACTLY these field names): ${n}\n`:``)+` current content: ${JSON.stringify(e.block.props??{}).slice(0,600)}`}function ze(){return{values:{},widgets:{}}}function Be(e){return{metrics:e.metrics.filter(e=>e.query.trim()!==``&&!e.blankKey),targets:e.widgets.filter(e=>!!e.refreshQuery?.trim()&&!Ce(e))}}function Ve(e){let t=[e.block.type];if(e.block.type===`composite`){let n=e.block.props.regions;for(let e of n??[]){let n=e?.block?.type;typeof n==`string`&&n&&t.push(n)}}return t}function He(e,t,n){let r=n.reduce((e,t)=>e+(z(t.block.type)?300:1200),0);return 400+t.length*120+r+(e.prediction?150:0)}var Ue=12e3;function K(e){let t=[],n=1200;for(let r of e){let{metrics:e,targets:i}=Be(r);if(e.length===0&&i.length===0)continue;let a=He(r,e,i);if(t.length>0&&n+a>Ue)break;n+=a,t.push({d:r,metrics:e,targets:i})}return t}function We(e,t){let n=Math.max(0,Math.round((t-e)/6e4));if(n<60)return`${n}m ago`;let r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Ge(e,t,n){let r=[...e.metrics.map(Le),...e.targets.map((e,t)=>Re(e,t,n(e.block.type))),...e.d.prediction?[`- PREVIOUS EXPECTATION (made ${We(e.d.prediction.at,t)}): "${e.d.prediction.text}" — grade it.`]:[]];return`DASHBOARD ${e.d.id} "${e.d.title}"\n${r.join(`
|
|
3
|
+
`)}`}function Ke(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function qe(e,t){let n=e.dashboards;if(n===void 0&&t.length===1)return{[t[0].d.id]:e};let r=new Map,i=[];if(Array.isArray(n))for(let e of n){let t=a(e);i.push(t),typeof t.id==`string`&&t.id&&r.set(t.id,t)}else if(Ke(n))for(let[e,t]of Object.entries(n))r.set(e,a(t));let o={};return t.forEach((e,t)=>{o[e.d.id]=r.get(e.d.id)??i[t]??{}}),o}function Je(e){let t=a(e);if(typeof t.metricLabel!=`string`||!t.metricLabel.trim())return;let n=o(t.readings).filter(e=>typeof e==`string`&&!!e.trim());if(!(n.length<2))return{metricLabel:t.metricLabel.trim(),readings:n,note:typeof t.note==`string`?t.note.trim().slice(0,200):``}}function Ye(e){let t=a(e),n=typeof t.start==`string`?Date.parse(t.start):NaN,r=typeof t.end==`string`?Date.parse(t.end):NaN;if(!(!Number.isFinite(n)||!Number.isFinite(r)||r<=n)&&!(r-n>6048e5))return{startAt:n,endAt:r,label:typeof t.label==`string`?t.label.trim().slice(0,60):``}}var Xe=` YOUR PREVIOUS ATTEMPT DID NOT ACTUALLY SEARCH (no citations came back). Before answering this time, you MUST run a real web search for every DASHBOARD section above and report only what those searches returned, listing the real URLs relied on in "sources" — this is not optional. If search is genuinely unavailable or turns up nothing, return null values and omit "sources" entirely; never invent a value or a source just to satisfy this instruction.`;async function Ze(e,t,n={}){let r=Date.now(),s={ok:!0,grounded:!1,perDashboard:{},sources:[],attempts:0};if(e.length===0&&!n.briefingContext)return s;try{let s=te(t.provider),c=e.flatMap(e=>e.targets.filter(e=>!z(e.block.type))),l=new Set(c.flatMap(Ve)),u=l.size>0,d=u?await i(()=>import(`./liveSchema-B4bQtO88.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])):null,f=e.map(e=>Ge(e,r,d?d.blockShapeHint:()=>null)).join(`
|
|
4
|
+
|
|
5
|
+
`),p={type:`object`,properties:{dashboards:{type:`array`,description:`One object per DASHBOARD section above, in the same order, each echoing its id.`,items:{type:`object`,properties:{id:{type:`string`},values:{type:`object`,description:`Map of VALUE label -> current numeric value, or null.`},observations:{type:`array`,description:`Exactly one object per DATA item for this dashboard, in the same order, each in the exact shape that DATA line specifies.`,items:{type:`object`}},blocks:{type:`array`,description:`Exactly one block per BLOCK item for this dashboard, in order.`,items:{type:`object`,properties:{type:{type:`string`},props:{type:`object`}},required:[`type`,`props`]}},expects:{type:`string`,description:`A short "by next check" expectation — omit if nothing here is genuinely predictable.`},grade:{type:`object`,description:`ONLY when this dashboard has a PREVIOUS EXPECTATION line.`,properties:{result:{type:`string`},note:{type:`string`}}},disagreement:{type:`object`,description:`ONLY when two real sources genuinely disagreed on a value.`,properties:{metricLabel:{type:`string`},readings:{type:`array`,items:{type:`string`}},note:{type:`string`}}},liveWindow:{type:`object`,description:`ONLY when search revealed a real, bounded live-event window.`,properties:{start:{type:`string`},end:{type:`string`},label:{type:`string`}}}},required:[`id`]}},...n.briefingContext?{briefing:{type:`string`,description:`2-4 sentences summarizing ALL dashboards (this batch + the given CONTEXT), real values only; use [[shown|said]] pronunciation twins for speech-risky terms.`}}:{},sources:{type:`array`,description:`OMIT unless this call used web search. Real source URLs actually relied on — never invented.`,items:{type:`object`,properties:{title:{type:`string`},url:{type:`string`}},required:[`title`,`url`]}}},required:[`dashboards`]},m=u===!1,h=Math.min(m?4e3:14e3,Math.max(m?1500:3e3,1200+e.reduce((e,t)=>e+He(t.d,t.metrics,t.targets),0)+(n.briefingContext?700:0))),g=j()+` You are checking several standing trackers at once. Return ONLY JSON: {"dashboards": [{"id": string, "values": {...}, "observations": [...], "blocks": [...], "expects"?: string, "grade"?: {...}, "disagreement"?: {...}, "liveWindow"?: {...}}, ...], `+(n.briefingContext?`"briefing": string, `:``)+`"sources": [...]}. Use web search for every DASHBOARD section below — never invent a value or detail. ECHO each dashboard's exact "id" so results map back correctly. For a VALUE item, give its CURRENT real number (no units) or null if unverifiable. For a BLOCK For a DATA item, return ONE object in "observations" (same order as the DATA lines) in the exact shape that line prints — plain data, no component or prop names, and omit the entry entirely rather than inventing a value you did not find. For a BLOCK item, produce exactly one block whose "type" is the EXACT bracketed type given — never substitute a different one — matching its current content for detail level (real names, numbers, dates). Where a BLOCK lists "expected props", copy that shape EXACTLY: the same field names, and an array shown as string[] takes plain strings, never objects. CRITICAL — a "current content" showing something live, in progress, or upcoming is NOT necessarily still true right now: explicitly check whether it has SINCE concluded and report the concluding outcome if so, reasoning from the date/time above which of upcoming/live/finished applies at this exact moment. If a dashboard has a PREVIOUS EXPECTATION line, grade it honestly ("hit" it came true, "miss" it did not, "unclear" if genuinely unknowable yet) — grade ONLY dashboards that have this line, never invent a grade otherwise. Offer a fresh "expects" only when something is genuinely predictable by the next check; most checks have nothing worth predicting, so omit it far more often than not. If two real sources genuinely disagree on a value, report it in "disagreement" instead of silently picking one. If search reveals a real bounded live-event window (a match's actual start/end time) for a dashboard, report it in "liveWindow" with ISO start/end — never invent a time. `+(n.briefingContext?`Also compose "briefing": 2-4 warm, concrete sentences summarizing ALL dashboards — this batch PLUS the CONTEXT lines below (already-known values — do NOT search for those, use them as given) — real values only, never memory. The briefing is displayed and spoken: preserve normal spelling on the left, but wrap every name, place, brand, or non-English term a voice might mispronounce as [[shown|said]] (for example [[Omakase|oh-mah-kah-seh]]). The said side must be lowercase voice-safe syllables matching a native/source-language pronunciation, never IPA or an Anglicized guess. `:``)+`If search genuinely turns up nothing more specific than what is already shown, say so honestly rather than inventing new specifics or repeating the old ones as if just confirmed. CITE SOURCES — every real URL actually relied on, in "sources"; omit it entirely if you used no search.`,_=`Use web search.\n\n${f}`+(n.briefingContext?`\n\nCONTEXT (already known — do not search these):\n${n.briefingContext}`:``),v=e=>s.generate({system:e?g+Xe:g,history:[],user:_,maxTokens:h,temperature:.15,thinkingLevel:e?`high`:`low`,tools:{webSearch:!0,requireSearch:!0},format:p,...u?{blockTypes:[...l],complexity:`brief`}:{}},t).then(e=>({rr:e,grounded:G(e,a(ne(e.raw)))})),y=await v(!1),b=1;!y.grounded&&e.length>0&&(y=await v(!0),b=2);let{rr:x}=y,S=a(ne(x.raw)),w=G(x,S),T=qe(S,e),E=x.sources&&x.sources.length?x.sources:W(S),re=[...new Set(E.map(e=>ie(e.url)).filter(Boolean))],D=d?d.validateLiveResponse:null,k={};for(let t of e){let e=T[t.d.id]??{},n=ze();if(w&&t.metrics.length>0){let r=a(e.values),i=new Map(Object.entries(r).map(([e,t])=>[P(e),t]));for(let e of t.metrics){let t=C(r[e.label]??i.get(P(e.label)));t!==null&&(n.values[e.id]={value:t,raw:O(String(t),e.unit)})}}if(t.targets.length>0&&w){let i=o(e.observations??e.data);t.targets.forEach((e,a)=>{let o=z(e.block.type);if(!o)return;let s=De(o,i[a]);if(!s)return;let c=e.block.props??{},l=e.metricId?t.d.metrics.find(t=>t.id===e.metricId):void 0,u=ke(e.block.type,s,c,l?.unit);u&&(n.widgets[e.id]={...e.block,props:u},ee(t.d.id,e.id,s,r,re))})}if(t.targets.length>0&&D){let r=o(e.blocks);t.targets.forEach((e,t)=>{if(z(e.block.type))return;let i=r[t];if(!i)return;let a=D({narration:``,title:`x`,sub:``,blocks:[i]},new Set(Ve(e)),1,w,!0)?.blocks[0];a&&a.type===e.block.type&&(n.widgets[e.id]=a)})}if(w){let r=oe(e.expects);if(r&&(n.expects=r),t.d.prediction){let t=ae(e.grade);t&&(n.grade=t)}let i=Je(e.disagreement);i&&(n.disagreement=i);let a=Ye(e.liveWindow);a&&(n.liveWindow=a)}k[t.d.id]=n}Object.values(k).every(e=>Object.keys(e.values).length===0&&Object.keys(e.widgets).length===0&&!e.expects)&&console.warn(`[dashboards] refreshDashboards got a response but nothing parsed out of it for any dashboard (${w?`empty/unparseable`:`ungrounded after ${b} attempt${b>1?`s`:``}, discarded`})`,{dashboardIds:e.map(e=>e.d.id),raw:x.raw});let A=n.briefingContext&&w&&typeof S.briefing==`string`&&S.briefing.trim()?S.briefing.trim():void 0;return{ok:!0,grounded:w,perDashboard:k,sources:E,attempts:b,...A?{briefing:A}:{}}}catch(t){console.error(`[dashboards] refreshDashboards failed`,t);let n={};for(let t of e)n[t.d.id]=ze();return{ok:!1,grounded:!1,perDashboard:n,sources:[],attempts:0,failure:Ae(t)}}}function Qe(e){let t=Array.isArray(e?.sources)?e.sources:[],n=[];for(let e of t){let t=e&&typeof e==`object`?e:{};typeof t.title==`string`&&typeof t.url==`string`&&n.push({title:t.title,url:t.url})}return n}function $e(e){try{let t=typeof e==`string`?JSON.parse(et(e)):e,n=t?.verdict;return{text:typeof n==`string`&&n.trim()?n.trim():null,sources:Qe(t)}}catch{return{text:typeof e==`string`&&e.trim()?e.trim():null,sources:[]}}}function et(e){let t=e.indexOf(`{`),n=e.lastIndexOf(`}`);return t>=0&&n>t?e.slice(t,n+1):e}async function q(e,t,n,r=Date.now()){try{let i=te(n.provider),a=t===`scheduled`?null:t,o=a?e.metrics.find(e=>e.id===a.metricId):void 0,s=e.metrics.map(e=>`${e.label}=${e.lastRaw??`—`}`).join(`, `),c=a?`A line the user set just crossed: "${a.label}" — ${o?.label??a.label} is now ${o?.lastRaw??a.brokenValue??`past the threshold`}. Currently tracked: ${s}. Using web search, say briefly and honestly what the latest numbers show and whether this reads as a real move or just noise.`:`Currently tracked: ${s}. Using web search, give a brief, honest read: what the latest numbers show and what has materially changed since the last check.`,l=await i.generate({system:j()+` You give a brief, honest read on the latest numbers a user is tracking: what they show now, what has materially changed since the last check, and — if a specific line was crossed — whether that looks like a real move or noise. One or two plain sentences. Never invent data. CITE YOUR SOURCES — whenever you used web search, include the exact source URLs you actually relied on as a top-level "sources": [{"title": string, "url": string}] array; only real URLs from the search results — never invent one, and omit "sources" entirely if you didn’t search. Return ONLY JSON: {"verdict":"…","sources":[...]}.`,history:[],user:c,maxTokens:700,temperature:.3,thinkingLevel:`low`,tools:{webSearch:!0}},n),{text:u,sources:d}=$e(l.raw);return u?{text:u,at:r,grounded:(l.sources?.length??0)>0||d.length>0,...l.sources&&l.sources.length?{sources:l.sources}:{},...a?{tripwireId:a.id}:{}}:null}catch(e){return console.error(`[dashboards] analyzeMove failed`,e),null}}function tt(e){let t=(e??[]).slice(-3);if(t.length<3)return 0;let[n,r,i]=t;return n.value<r.value&&r.value<i.value?1:n.value>r.value&&r.value>i.value?-1:0}function nt(e){let t=e.metrics.filter(e=>(e.history?.length??0)>=3);for(let n=0;n<t.length;n++)for(let r=n+1;r<t.length;r++){let i=t[n],a=t[r],o=tt(i.history);if(o!==0&&o===tt(a.history))return{text:`${i.label} and ${a.label} have moved together over the last three checks.`,dashboardIds:[e.id]}}return null}function rt(e,t){let n=e.filter(e=>{let n=e.cadence.window;return!!n&&t>=n.startAt&&t<=n.endAt});if(n.length<2)return null;let[r,i]=n;return{text:`${r.title} and ${i.title} overlap right now — their checks are batched into shared searches while both are live.`,dashboardIds:[r.id,i.id]}}var it=5;function at(e){if(e.cadence.data!==`15min`&&e.cadence.data!==`hourly`)return null;let t=e.metrics.find(e=>(e.history?.length??0)>=it);if(!t?.history)return null;let n=t.history.slice(-5);return n.every(e=>e.value===n[0].value)?{text:`${t.label} hasn't moved across ${e.title}'s last ${it} checks.`,dashboardIds:[e.id]}:null}function ot(e,t){let n=t.note?` ${t.note}`:``;return{text:`Sources disagreed on ${t.metricLabel}: ${t.readings.join(` vs `)}.${n}`,dashboardIds:[e.id]}}var st=432e5;function ct(e,t,n){let r=n-st;return e.some(e=>e.kind===`insight`&&e.at>=r&&e.text===t.text)}function lt(e,t,n,r=2){let i=[],a=rt(e,n);a&&i.push(a);for(let t of e){let e=nt(t);e&&i.push(e);let n=at(t);n&&i.push(n)}return i.filter(e=>!ct(t,e,n)).slice(0,r)}var ut=e({checkAllDashboardsNow:()=>Ct,readDashboardNow:()=>wt,refreshDashboardNow:()=>St,runRefreshBatch:()=>$,selectTickTargets:()=>Tt,useDashboardLoop:()=>Et,useVerdictPending:()=>ht}),dt=15e3,ft=3e5;function pt(e,t){switch(e?.kind){case`rate-limit`:return e.retryAt?Math.max(15e3,e.retryAt-t):6e4;case`provider-unavailable`:return 12e4;case`auth`:return 216e5;default:return ft}}var J=new Set,Y=new Set,X=`mavea-dashboard-verdict-pending`;function Z(e,t){t?Y.add(e):Y.delete(e);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(X,{detail:e}))}catch{}}function mt(e){return window.addEventListener(X,e),()=>window.removeEventListener(X,e)}function ht(e){let t=(0,fe.c)(2),n;return t[0]===e?n=t[1]:(n=()=>Y.has(e),t[0]=e,t[1]=n),(0,N.useSyncExternalStore)(mt,n,gt)}function gt(){return!1}function _t(e,t){return e.map(e=>{let n=t.perDashboard[e.d.id]??{values:{},widgets:{}},r=e.metrics.find(e=>n.values[e.id]);return r?`${e.d.title} at ${n.values[r.id].raw}`:e.targets.some(e=>n.widgets[e.id])?`${e.d.title} updated`:t.grounded?`${e.d.title} checked`:`${e.d.title} — couldn't verify`}).join(` · `)}var Q=`Daily search budget reached — auto-checks paused until midnight. Manual checks still work.`;function vt(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function yt(e){let t=vt(e);w().some(e=>e.kind===`savings`&&e.at>=t&&e.text===Q)||T({kind:`savings`,text:Q,dashboardIds:[],searches:0})}async function bt(e,t,n,r,i,a,o=!1){let{d:c}=e,l=Object.keys(t.values).length>0||Object.keys(t.widgets).length>0?`updated`:o?`unverified`:`no-change`,u=c.metrics.map(e=>{let n=t.values[e.id];return n?{...e,lastValue:n.value}:e}),d={...c,metrics:u},{tripwires:f,newlyTriggered:p}=V(d,n),g=c.oneShotAt!==void 0&&c.oneShotAt<=a;v(c.id,{values:Object.entries(t.values).map(([e,t])=>({metricId:e,value:t.value,raw:t.raw,origin:`search`})),blocks:Object.entries(t.widgets).map(([e,t])=>({widgetId:e,block:t})),tripwires:f,outcome:l,...t.expects?{expects:t.expects}:{},...t.grade?{grade:t.grade}:{},...g?{consumedOneShot:!0}:{}},a),p.length&&(se(d,p),T({kind:`alert`,text:`${p.map(e=>e.label).join(`, `)} crossed the line you set.`,dashboardIds:[c.id],searches:0}),d.alerts.inApp&&ue({dashboardId:c.id,dashboardTitle:c.title,tripwireLabel:p[0].label})),t.disagreement&&T({kind:`insight`,text:ot(c,t.disagreement).text,dashboardIds:[c.id],searches:0});let _={...c,tripwires:f},y=U(_,p,a);if(y.fire&&y.trigger&&i){Z(c.id,!0);let e=await q(_,y.trigger,r,a);Z(c.id,!1),e?s(c.id,e,a):h(c.id,a,`Mavéa couldn't get a fresh read — will try again.`),m(c.id,a),T({kind:y.trigger===`scheduled`?`check`:`alert`,text:e?e.text.slice(0,200):`Couldn't get a fresh read on ${c.title}.`,dashboardIds:[c.id],searches:1,...e?.sources?.length?{sourceCount:e.sources.length}:{}})}else y.fire&&y.trigger&&m(c.id,a);return l}async function $(e,t,n,r={}){let i=Date.now(),a={},o=K(e),s=e.filter(e=>!o.some(t=>t.d.id===e.id)),c={};for(let t of e)c[t.id]=Object.fromEntries(t.metrics.map(e=>[e.id,e.lastValue]));for(let e of s)a[e.id]=await bt({d:e,metrics:[],targets:[]},{values:{},widgets:{}},c[e.id],t,n,i);if(o.length===0)return a;let d=new Map(o.map(e=>[e.d.id,f(e.d.id,i)])),m=e=>{for(let t of d.values())e(t)};if(!n)return a;let h=o.map(e=>e.d.id);A(h,!0);try{let e=await Ze(o,t,r.briefing?{briefingContext:r.briefing.context}:{});if(!e.ok){let t=e.failure??{kind:`network`},n=pt(e.failure,i);m(n=>{l(n,`search`,!1,{detail:u(t)}),p(n,{outcome:`failed`,failure:t,attempts:e.attempts})});for(let e of o)y(e.d.id,i+n),b(e.d.id,t,i),a[e.d.id]=`failed`;return a}for(let r of o){let o=e.perDashboard[r.d.id]??{values:{},widgets:{}},s=d.get(r.d.id)??null;l(s,`search`,!0,{count:e.attempts}),l(s,`sources`,e.sources.length>0,{count:e.sources.length,...e.sources.length===0?{detail:`The model answered without citing a live source.`}:{}});let u=Object.keys(o.values).length+Object.keys(o.widgets).length;l(s,`extraction`,u>0,{count:u,...u===0?{detail:`Nothing in the reply matched this tracker’s metrics or cards.`}:{}}),l(s,`grounding`,e.grounded,{...e.grounded?{}:{detail:`Ungrounded — every value from it was discarded.`}}),a[r.d.id]=await bt(r,o,c[r.d.id],t,n,i,!e.grounded);let f=a[r.d.id];l(s,`saved`,f===`updated`||f===`no-change`),l(s,`tripwires`,!0),p(s,{outcome:f===`failed`?`failed`:f,attempts:e.attempts,...f===`unverified`?{failure:{kind:`ungrounded`}}:{}})}r.briefing&&e.briefing&&(M(e.briefing,r.briefing.allDashboards,i),T({kind:`briefing`,text:`Morning briefing compiled — folded into this batched search.`,dashboardIds:o.map(e=>e.d.id),searches:0}));let s=[...new Set(e.sources.map(e=>ie(e.url)))].filter(Boolean);return T({kind:`check`,text:_t(o,e),dashboardIds:o.map(e=>e.d.id),...s.length?{domains:s}:{},searches:1,...e.sources.length?{sourceCount:e.sources.length}:{},...r.manual?{manual:!0}:{}}),a}finally{A(h,!1)}}async function xt(e,t,n,r){let{tripwires:i,newlyTriggered:a}=V(e);d(e.id,i,r),a.length&&(se(e,a),e.alerts.inApp&&ue({dashboardId:e.id,dashboardTitle:e.title,tripwireLabel:a[0].label}));let o={...e,tripwires:i},c=U(o,a,r);if(!c.fire||!c.trigger||!n)return;Z(e.id,!0);let l=await q(o,c.trigger,t,r);Z(e.id,!1),l?s(e.id,l,r):h(e.id,r,`Mavéa couldn't get a fresh read — will try again.`),m(e.id,r),T({kind:c.trigger===`scheduled`?`check`:`alert`,text:l?l.text.slice(0,200):`Couldn't get a fresh read on ${e.title}.`,dashboardIds:[e.id],searches:1,...l?.sources?.length?{sourceCount:l.sources.length}:{}})}async function St(e){if(J.has(e))return`busy`;let t=_(e);if(!t)return`busy`;let n=x(S());if(!n.apiKey)return`no-model`;J.add(e);try{let r=await $([t],n,!0,{manual:!0});return r[e]===`failed`?`failed`:r[e]===`unverified`?`unverified`:`done`}finally{J.delete(e)}}async function Ct(){let e=x(S());if(!e.apiKey)return`no-model`;let t=g().filter(D),n=t.filter(e=>!J.has(e.id));if(n.length===0)return t.length>0?`busy`:`done`;for(;n.length>0;){let t=K(n);if(t.length===0)break;let r=t.map(e=>e.d.id);r.forEach(e=>J.add(e));let i={};try{i=await $(t.map(e=>e.d),e,!0,{manual:!0})}finally{r.forEach(e=>J.delete(e))}if(r.length>0&&r.every(e=>i[e]===`failed`))return`failed`;n=n.filter(e=>!r.includes(e.id))}return`done`}async function wt(e){if(Y.has(e))return`busy`;let t=_(e);if(!t)return`failed`;let n=x(S());if(!n.apiKey)return`no-model`;let r=Date.now(),i=t.tripwires.find(e=>e.state===`TRIGGERED`),a=i??`scheduled`;Z(e,!0);let o;try{o=await q(t,a,n,r)}finally{Z(e,!1)}return o?s(e,o,r):h(e,r,`Mavéa couldn’t get a fresh read — try again in a moment.`),m(e,r),T({kind:i?`alert`:`check`,text:o?o.text.slice(0,200):`Couldn’t get a fresh read on ${t.title}.`,dashboardIds:[e],searches:1,manual:!0,...o?.sources?.length?{sourceCount:o.sources.length}:{}}),o?`done`:`failed`}function Tt(e,t,n,r,i){let a=Fe(e,r).filter(e=>!i.has(e.id)),o=Ie(e,r);o&&i.has(o.id)&&(o=null);let s=k(t,n,r),c=!1;s.paused&&(c=a.some(D)||!!o,a=a.filter(e=>!D(e)),o=null);let l=K(a);return o&&l.some(e=>e.d.id===o.id)&&(o=null),{dueData:a,dueAi:o,pausedAndBlocked:c}}function Et(){let e=(0,N.useRef)(!1);(0,N.useEffect)(()=>{let t=!0,n=async()=>{if(e.current||!t||typeof document<`u`&&document.visibilityState!==`visible`)return;let n=x(S()),r=!!n.apiKey,i=Date.now(),a=g(),o=re(),s=w();de(a,s,e=>E(s,e,i),e=>c(e,i-6048e5,i),i);for(let e of lt(a,s,i))T({kind:`insight`,text:e.text,dashboardIds:e.dashboardIds,searches:0});let{dueData:l,dueAi:u,pausedAndBlocked:d}=Tt(a,s,o.dailySearchBudget,i,J);d&&yt(i);let f=r&&o.briefingEnabled&&le(i);if(l.length===0&&!u){if(f&&!a.some(D)){let e=ce(a,new Set);if(e){let t=await Ze([],n,{briefingContext:e});t.briefing&&(M(t.briefing,a,i),T({kind:`briefing`,text:`Morning briefing compiled.`,dashboardIds:[],searches:1}))}}return}e.current=!0,l.forEach(e=>J.add(e.id)),u&&J.add(u.id);try{if(l.length>0){let e=f?{context:ce(a,new Set(K(l).map(e=>e.d.id))),allDashboards:a}:void 0;await $(l,n,r,e?{briefing:e}:{})}u&&await xt(u,n,r,i)}finally{l.forEach(e=>J.delete(e.id)),u&&J.delete(u.id),e.current=!1}},r=()=>{he(n).catch(e=>{console.error(`[dashboards] scheduled tick failed`,e)})},i=window.setInterval(r,dt),a=()=>{document.visibilityState===`visible`&&r()};return document.addEventListener(`visibilitychange`,a),r(),()=>{t=!1,window.clearInterval(i),document.removeEventListener(`visibilitychange`,a)}},[])}export{ht as a,ge as c,ut as i,P as l,St as n,V as o,Et as r,we as s,wt as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{g as t,h as n,m as r,n as i,t as a}from"./store-
|
|
1
|
+
import{t as e}from"./react-BZJXY1be.js";import{g as t,h as n,m as r,n as i,t as a}from"./store-CsjDEADX.js";var o=e();function s(e){let n=n=>{(n.key===null||n.key===`mavea-dashboards-v1`)&&(t(),e())};return window.addEventListener(a,e),window.addEventListener(`storage`,n),()=>{window.removeEventListener(a,e),window.removeEventListener(`storage`,n)}}function c(){return(0,o.useSyncExternalStore)(s,r)}function l(e){return window.addEventListener(i,e),()=>window.removeEventListener(i,e)}function u(){return(0,o.useSyncExternalStore)(l,n,d)}function d(){return!1}export{u as n,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{t as n}from"./compiler-runtime-qQQXpJgv.js";import{i as r,n as i}from"./info-CiqHR5cs.js";import{r as a,t as o}from"./keyVault-Aw5Y2PjT.js";import"./providers-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{t as n}from"./compiler-runtime-qQQXpJgv.js";import{i as r,n as i}from"./info-CiqHR5cs.js";import{r as a,t as o}from"./keyVault-Aw5Y2PjT.js";import"./providers-BovElgRL.js";var s=e({LIVE_V2_EVENT:()=>f,SECRET_PERSISTENCE_EVENT:()=>p,exportConfig:()=>J,getLiveConfigV2:()=>A,getSecretPersistenceStatus:()=>R,hasModelConfigured:()=>q,importConfig:()=>te,importConfigWithSummary:()=>Z,resetLiveConfig:()=>W,setLiveConfigV2:()=>H,setProviderField:()=>G,toCaps:()=>Q,toModelConfig:()=>K,useLiveConfig:()=>$,whenSecretPersistenceSettled:()=>z}),c=n(),l=t(),u=`mavea-live-v2`,d=`mavea-live-v2:secrets`,f=u,p=`${u}:secret-persistence`,m=25e4,h=512,g={provider:`gemini`,models:{},keys:{},rememberKey:!1,webSearch:!1,searchMode:`off`,quality:`balanced`,searchProvider:`wikipedia`,searchKeys:{},memoryEnabled:!1,autoSaveFlashcards:!1,generativeBlocks:!0,worldEnabled:!0,libraryEnabled:!0,teachMode:!1,annotationsEnabled:!0,morningBrief:!1,explainLevel:`standard`,fontScale:`normal`,pttKey:`Alt`,pttSide:`any`,voiceSpeed:1};function _(e){return e===`left`||e===`right`?e:`any`}var v=null;function y(e){return i.some(t=>t.id===e)?e:g.provider}function b(e){let t={};if(e&&typeof e==`object`)for(let n of i){let r=e[n.id];typeof r==`string`&&r.length<=h&&(t[n.id]=r)}return t}function x(e,t){return typeof e==`boolean`?e:t}function S(e){return typeof e==`number`&&Number.isFinite(e)?Math.min(2,Math.max(.75,e)):g.voiceSpeed}function C(e){return e===`wikipedia`||e===`brave`||e===`tavily`?e:g.searchProvider}function w(e){return e===`off`||e===`realtime`?e:void 0}function T(e){return e===`fast`||e===`balanced`||e===`thorough`?e:g.quality}function E(e){return e===`simple`||e===`deep`?e:g.explainLevel}function D(e){return e===`smaller`||e===`larger`?e:g.fontScale}function O(e){let t={};if(e&&typeof e==`object`)for(let n of[`brave`,`tavily`]){let r=e[n];typeof r==`string`&&r.length<=h&&(t[n]=r)}return t}function k(){try{if(typeof localStorage>`u`)return{...g};let e=localStorage.getItem(u);if(!e)return{...g};let t=JSON.parse(e),n=x(t.webSearch,g.webSearch),r=w(t.searchMode)??(t.searchMode===void 0&&n?`realtime`:`off`);return{provider:y(t.provider),models:b(t.models),keys:b(t.keys),rememberKey:x(t.rememberKey,g.rememberKey),webSearch:n,searchMode:r,quality:T(t.quality),searchProvider:C(t.searchProvider),searchKeys:O(t.searchKeys),memoryEnabled:x(t.memoryEnabled,g.memoryEnabled),autoSaveFlashcards:x(t.autoSaveFlashcards,g.autoSaveFlashcards),generativeBlocks:x(t.generativeBlocks,g.generativeBlocks),worldEnabled:x(t.worldEnabled,g.worldEnabled),libraryEnabled:x(t.libraryEnabled,g.libraryEnabled),teachMode:x(t.teachMode,g.teachMode),annotationsEnabled:x(t.annotationsEnabled,g.annotationsEnabled),morningBrief:x(t.morningBrief,g.morningBrief),explainLevel:E(t.explainLevel),fontScale:D(t.fontScale),pttKey:typeof t.pttKey==`string`&&t.pttKey?t.pttKey:g.pttKey,pttSide:_(t.pttSide),voiceSpeed:S(t.voiceSpeed)}}catch{return{...g}}}function A(){return v||(v=k(),v)}function j(e){try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(u,{detail:e}))}catch{}}function M(e){return Object.keys(e.keys).length>0||Object.keys(e.searchKeys).length>0}var N=0,P=!1,F=`not-requested`,I=Promise.resolve();function L(e){F=e;try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(p,{detail:e}))}catch{}}function R(){return F}async function z(){return await I,F}async function B(e){let t=++N;if(typeof localStorage>`u`){L(e.rememberKey&&M(e)?`session-only`:`not-requested`);return}if(!e.rememberKey||!M(e)){if(e.rememberKey&&!P){L(`pending`);return}try{localStorage.removeItem(d)}catch{}t===N&&L(`not-requested`);return}L(`pending`);try{let n=await a(JSON.stringify({keys:e.keys,searchKeys:e.searchKeys}));if(t!==N)return;localStorage.setItem(d,n),L(`persisted`)}catch{if(t!==N)return;try{localStorage.removeItem(d)}catch{}L(`session-only`)}}async function V(){if(typeof localStorage>`u`){L(`unavailable`);return}let e;try{e=localStorage.getItem(d)}catch{P=!0,L(`unavailable`);return}if(!e){P=!0,L(`not-requested`);return}let t=N;try{let n=JSON.parse(await o(e));if(t===N){let e=A();v={...e,keys:{...e.keys,...b(n.keys)},searchKeys:{...e.searchKeys,...O(n.searchKeys)}},j(v),L(`persisted`)}}catch{t===N&&L(`unavailable`)}finally{P=!0}}function H(e){let t={...A(),...e};v=t;try{if(typeof localStorage<`u`){let e={...t,keys:{},searchKeys:{}};localStorage.setItem(u,JSON.stringify(e)),I=B(t)}else L(t.rememberKey?M(t)?`session-only`:`unavailable`:`not-requested`)}catch{L(t.rememberKey?M(t)?`session-only`:`unavailable`:`not-requested`)}return j(t),t}function U(){typeof localStorage>`u`||(M(A())?(P=!0,H({})):I=V())}U();function W(){return H(g)}function G(e,t,n){let r=A(),i=t===`model`?`models`:`keys`;return H({[i]:{...r[i],[e]:n}})}function K(e){return{provider:e.provider,model:e.models[e.provider]||r(e.provider).defaultModel,apiKey:e.keys[e.provider]}}function q(e){let t=r(e.provider);return!!(e.models[e.provider]||t.defaultModel)&&(!t.needsKey||!!e.keys[e.provider])}function J(){let e={...A(),keys:{},searchKeys:{},rememberKey:!1};return JSON.stringify(e,null,2)}var ee=[`provider`,`models`,`webSearch`,`searchMode`,`quality`,`searchProvider`,`memoryEnabled`,`autoSaveFlashcards`,`generativeBlocks`,`worldEnabled`,`libraryEnabled`,`teachMode`,`annotationsEnabled`,`morningBrief`,`explainLevel`,`fontScale`,`pttKey`,`pttSide`,`voiceSpeed`];function Y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function X(e){return typeof e==`string`||Array.isArray(e)?e.length>0:e&&typeof e==`object`?Object.keys(e).length>0:e!=null}function Z(e,t={}){if((typeof TextEncoder==`function`?new TextEncoder().encode(e).byteLength:e.length*2)>m)throw Error(`Invalid config file — the settings object is too large.`);let n;try{n=JSON.parse(e)}catch{throw Error(`Invalid config file — could not parse JSON.`)}if(!n||typeof n!=`object`||Array.isArray(n))throw Error(`Invalid config file — expected a settings object.`);let r=n;if(Object.keys(r).length>64)throw Error(`Invalid config file — the settings object has too many fields.`);let i=A(),a=t.mode===`merge`?{...i,...r}:r,o=x(a.webSearch,g.webSearch),s=w(a.searchMode)??(a.searchMode===void 0&&o?`realtime`:`off`),c={provider:y(a.provider),models:b(a.models),keys:i.keys,rememberKey:t.preserveSecretState!==!1&&i.rememberKey,webSearch:o,searchMode:s,quality:T(a.quality),searchProvider:C(a.searchProvider),searchKeys:i.searchKeys,memoryEnabled:x(a.memoryEnabled,g.memoryEnabled),autoSaveFlashcards:x(a.autoSaveFlashcards,g.autoSaveFlashcards),generativeBlocks:x(a.generativeBlocks,g.generativeBlocks),worldEnabled:x(a.worldEnabled,g.worldEnabled),libraryEnabled:x(a.libraryEnabled,g.libraryEnabled),teachMode:x(a.teachMode,g.teachMode),annotationsEnabled:x(a.annotationsEnabled,g.annotationsEnabled),morningBrief:x(a.morningBrief,g.morningBrief),explainLevel:E(a.explainLevel),fontScale:D(a.fontScale),pttKey:typeof a.pttKey==`string`&&a.pttKey.length>0&&a.pttKey.length<=32?a.pttKey:g.pttKey,pttSide:_(a.pttSide),voiceSpeed:S(a.voiceSpeed)},l=[];return Y(r,`keys`)&&X(r.keys)&&l.push(`provider-api-keys`),Y(r,`searchKeys`)&&X(r.searchKeys)&&l.push(`search-api-keys`),[`githubToken`,`github_token`,`ghToken`].some(e=>Y(r,e)&&X(r[e]))&&l.push(`github-token`),{config:H(c),credentialsIgnored:l,appliedFields:ee.filter(e=>Y(r,e))}}function te(e,t){return Z(e,t).config}function Q(e){return{webSearch:e.searchMode!==`off`,searchMode:e.searchMode,quality:e.quality,memoryEnabled:e.memoryEnabled,generativeBlocks:e.generativeBlocks,worldEnabled:e.worldEnabled,explainLevel:e.explainLevel}}function $(){let e=(0,c.c)(4),[t,n]=(0,l.useState)(ne),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`)return;let e=()=>n(A());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,H],e[2]=t,e[3]=a),a}function ne(){return A()}export{W as a,Q as c,s as d,Z as i,K as l,A as n,H as o,q as r,G as s,J as t,$ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,r as i,t as a}from"./theme-7IrMJ70_.js";import{C as o,D as s,E as c,O as l,T as u,w as d}from"./index-
|
|
1
|
+
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,r as i,t as a}from"./theme-7IrMJ70_.js";import{C as o,D as s,E as c,O as l,T as u,w as d}from"./index-Dk0QapqQ.js";import{u as f}from"./useLiveConfig-Cpy0_E_-.js";import{a as p,i as m,o as h,t as g}from"./store-D2IJF4SA.js";import{r as _,t as v}from"./queue-Adae4IzW.js";var y=t(),b=e(),x=n(),S=[`smaller`,`normal`,`larger`],C={smaller:`Smaller`,normal:`Normal`,larger:`Larger`},w=`mavea:appearancechange`;function T(e){window.dispatchEvent(new CustomEvent(w,{detail:e}))}function E(){let e=(0,y.c)(11),[t,n]=(0,b.useState)(O),[o,u]=(0,b.useState)(D),[p,m]=f(),h,g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{let e=e=>{let t=e.detail;t&&(n(t.template),u(t.theme))};return window.addEventListener(w,e),()=>window.removeEventListener(w,e)},g=[],e[0]=h,e[1]=g):(h=e[0],g=e[1]),(0,b.useEffect)(h,g);let _;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{s(document,e),d(document,e),c(e);let t={template:e,theme:r()};n(e),u(t.theme),T(t)},e[2]=_):_=e[2];let v=_,x;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{a(e),i(e);let t={template:l(),theme:e};n(t.template),u(e),T(t)},e[3]=x):x=e[3];let S=x,C;e[4]===m?C=e[5]:(C=e=>m({fontScale:e}),e[4]=m,e[5]=C);let E=C,k;return e[6]!==t||e[7]!==p.fontScale||e[8]!==E||e[9]!==o?(k={active:t,theme:o,fontScale:p.fontScale,pickTemplate:v,pickTheme:S,pickFontScale:E},e[6]=t,e[7]=p.fontScale,e[8]=E,e[9]=o,e[10]=k):k=e[10],k}function D(){return r()}function O(){return l()}function k(e){let t=(0,y.c)(13),{templateId:n}=e,r;t[0]===n?r=t[1]:(r=o.find(e=>e.id===n)??o[0],t[0]=n,t[1]=r);let i=r,a;t[2]!==i.preview.accent||t[3]!==i.preview.background||t[4]!==i.preview.ink||t[5]!==i.preview.surface?(a={"--preview-bg":i.preview.background,"--preview-surface":i.preview.surface,"--preview-ink":i.preview.ink,"--preview-accent":i.preview.accent},t[2]=i.preview.accent,t[3]=i.preview.background,t[4]=i.preview.ink,t[5]=i.preview.surface,t[6]=a):a=t[6];let s=a,c=`appearance-preview appearance-preview--${i.preview.geometry}`,l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,x.jsx)(`span`,{className:`appearance-preview-aa`,children:`Aa`}),t[7]=l):l=t[7];let u,d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,x.jsxs)(`span`,{className:`appearance-preview-copy`,children:[(0,x.jsx)(`i`,{}),(0,x.jsx)(`i`,{})]}),d=(0,x.jsx)(`span`,{className:`appearance-preview-data`,children:`08`}),t[8]=u,t[9]=d):(u=t[8],d=t[9]);let f;return t[10]!==s||t[11]!==c?(f=(0,x.jsxs)(`span`,{className:c,style:s,"aria-hidden":`true`,children:[l,u,d]}),t[10]=s,t[11]=c,t[12]=f):f=t[12],f}function A({active:e,theme:t,fontScale:n,embedded:r=!1,onPickTemplate:i,onPickTheme:a,onPickFontScale:s,onClose:c,optionRefs:l}){let u=(0,b.useId)(),d=(e,t)=>{let n;if(e.key===`ArrowRight`||e.key===`ArrowDown`)n=(t+1)%o.length;else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)n=(t-1+o.length)%o.length;else if(e.key===`Home`)n=0;else if(e.key===`End`)n=o.length-1;else return;e.preventDefault(),l?.current[n]?.focus()};return(0,x.jsxs)(`div`,{className:`appearance-panel${r?` is-embedded`:``}`,role:r?void 0:`dialog`,"aria-modal":!r||void 0,"aria-labelledby":u,children:[(0,x.jsxs)(`div`,{className:`appearance-head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{id:u,children:r?`Appearance`:`Choose your workspace`}),(0,x.jsx)(`p`,{children:`A visual identity for how you think.`})]}),c&&(0,x.jsx)(`button`,{type:`button`,className:`appearance-close`,onClick:c,"aria-label":`Close appearance`,children:`×`})]}),(0,x.jsxs)(`div`,{className:`appearance-mode`,"aria-label":`Color mode`,children:[(0,x.jsx)(`span`,{children:`Color mode`}),(0,x.jsx)(`div`,{className:`appearance-segmented`,children:[`light`,`dark`].map(e=>(0,x.jsxs)(`button`,{type:`button`,"aria-pressed":t===e,className:t===e?`is-active`:``,onClick:()=>a(e),children:[(0,x.jsx)(`span`,{className:`appearance-mode-icon is-${e}`,"aria-hidden":`true`}),e===`light`?`Light`:`Dark`]},e))})]}),(0,x.jsxs)(`div`,{className:`appearance-mode`,"aria-label":`Text size`,children:[(0,x.jsx)(`span`,{children:`Text size`}),(0,x.jsx)(`div`,{className:`appearance-segmented is-triple`,children:S.map(e=>(0,x.jsx)(`button`,{type:`button`,"aria-pressed":n===e,className:n===e?`is-active`:``,onClick:()=>s(e),children:C[e]},e))})]}),(0,x.jsx)(`div`,{className:`appearance-grid`,role:`radiogroup`,"aria-label":`Workspace themes`,children:o.map((t,n)=>(0,x.jsxs)(`button`,{ref:e=>{l&&(l.current[n]=e)},type:`button`,role:`radio`,"aria-label":`${t.label}, ${t.persona}. ${t.tagline} Best for ${t.bestFor}.`,"aria-checked":t.id===e,tabIndex:t.id===e?0:-1,className:`appearance-option${t.id===e?` is-active`:``}`,onClick:()=>i(t.id),onKeyDown:e=>d(e,n),children:[(0,x.jsx)(k,{templateId:t.id}),(0,x.jsxs)(`span`,{className:`appearance-option-copy`,children:[(0,x.jsxs)(`span`,{className:`appearance-option-title`,children:[(0,x.jsx)(`strong`,{children:t.label}),(0,x.jsx)(`em`,{children:t.persona})]}),(0,x.jsx)(`span`,{className:`appearance-option-tagline`,children:t.tagline}),(0,x.jsxs)(`span`,{className:`appearance-option-best`,children:[`Best for `,t.bestFor.toLowerCase()]}),(0,x.jsx)(`span`,{className:`appearance-option-font`,children:t.preview.fontRole})]}),(0,x.jsx)(`span`,{className:`appearance-check`,"aria-hidden":`true`,children:`✓`})]},t.id))})]})}function j({triggerClassName:e=`topbar-icon-btn`}={}){let{active:t,theme:n,fontScale:r,pickTemplate:i,pickTheme:a,pickFontScale:c}=E(),[l,d]=(0,b.useState)(!1),f=(0,b.useRef)(null),p=(0,b.useRef)(null),m=(0,b.useRef)([]);(0,b.useEffect)(()=>u(document),[]);let h=(0,b.useCallback)(()=>{d(!1),requestAnimationFrame(()=>p.current?.focus())},[]);(0,b.useEffect)(()=>{if(!l)return;s(document);let e=o.findIndex(e=>e.id===t);requestAnimationFrame(()=>{if(window.matchMedia?.(`(max-width: 720px)`).matches??!1){f.current?.querySelector(`.appearance-close`)?.focus({preventScroll:!0});return}m.current[Math.max(0,e)]?.focus({preventScroll:!0})});let n=e=>{f.current&&!f.current.contains(e.target)&&h()},r=e=>{if(e.key===`Escape`){e.preventDefault(),h();return}if(e.key!==`Tab`||!f.current)return;let t=Array.from(f.current.querySelectorAll(`button:not([disabled])`));if(!t.length)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`pointerdown`,n),window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`pointerdown`,n),window.removeEventListener(`keydown`,r)}},[t,h,l]);let g=o.find(e=>e.id===t)??o[0];return(0,x.jsxs)(`div`,{className:`tpl-picker appearance-picker`,ref:f,children:[(0,x.jsx)(`button`,{ref:p,type:`button`,className:`${e} tpl-btn appearance-trigger`,onClick:()=>d(e=>!e),title:`Appearance: ${g.label} · ${g.persona} · ${n===`light`?`Light`:`Dark`}`,"aria-label":`Choose appearance (current: ${g.label}, ${g.persona}, ${n} mode)`,"aria-expanded":l,"aria-haspopup":`dialog`,children:(0,x.jsxs)(`span`,{className:`appearance-mark`,"aria-hidden":`true`,children:[(0,x.jsx)(`i`,{style:{background:g.preview.accent}}),(0,x.jsx)(`i`,{style:{background:g.preview.surface}})]})}),l&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{className:`appearance-backdrop`,type:`button`,onClick:h,"aria-label":`Close appearance`}),(0,x.jsx)(A,{active:t,theme:n,fontScale:r,onPickTemplate:i,onPickTheme:a,onPickFontScale:c,onClose:h,optionRefs:m})]})]})}function M(){let e=(0,y.c)(7),{active:t,theme:n,fontScale:r,pickTemplate:i,pickTheme:a,pickFontScale:o}=E(),s;return e[0]!==t||e[1]!==r||e[2]!==o||e[3]!==i||e[4]!==a||e[5]!==n?(s=(0,x.jsx)(A,{embedded:!0,active:t,theme:n,fontScale:r,onPickTemplate:i,onPickTheme:a,onPickFontScale:o}),e[0]=t,e[1]=r,e[2]=o,e[3]=i,e[4]=a,e[5]=n,e[6]=s):s=e[6],s}function N(e){let[t,n]=(0,b.useState)(e);return(0,b.useEffect)(()=>{if(typeof window>`u`)return;let t=()=>n(e());return t(),window.addEventListener(g,t),window.addEventListener(`focus`,t),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(g,t),window.removeEventListener(`focus`,t),document.removeEventListener(`visibilitychange`,t)}},[]),t}function P(){return N(v)}function F(){return N(h)}function I(){return N(p)}function L(){return N(R)}function R(){return m()}function z(){return N(B)}function B(){return _()}export{P as a,F as i,I as n,M as o,z as r,j as s,L as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{t as e}from"./types-C42I77wh.js";import{t}from"./json-B0N3XRZU.js";import{i as n,r}from"./verbatim-DBTj9sPD.js";import{n as i}from"./citation-BsSvaaer.js";import{a,r as o}from"./number-zqlPMliA.js";import{i as s,n as c,r as l,s as u,t as d}from"./receipts-D7zveV-I.js";var f={text:``,chunks:[]},p=e=>({text:e,chunks:[]});function m(e){let{source:t,text:n}=e;return[t.url?`${t.title??t.url}\n${t.url}`:t.title??``,n].filter(e=>e.trim()).join(`
|
|
2
|
+
`)}function h(e,t){let n=[],r=[],i=0;for(let a of e){let e=m(a);if(!e.trim())continue;let o=e.length+(r.length?2:0);i+o>t||(i+=o,r.push(e),n.push({source:a.source,text:e}))}return{text:r.join(`
|
|
3
|
+
|
|
4
|
+
`),chunks:n}}function g(e){return{source:{kind:`web`,title:e.title,...e.url?{url:e.url,host:i(e.url)}:{}},text:e.snippet??``}}function _(e){let t=e.chunks.map(e=>({source:e.source,text:n(e.text)}));return e=>{let r=n(e);if(!r)return null;let i=t.filter(e=>e.text.includes(r));return i.length===1?i[0].source:null}}function v(e,t=`an unnamed cause`){let n=e??``;return n.replace(/[\p{Cf}\p{Cc}]/gu,``).trim().length>0?n.trim():t}function y(e){let t=e.replace(/[-_]+/g,` `).trim();return t.length===0?e:t[0].toUpperCase()+t.slice(1)}var b=/^\d{4}$/,x=/^(\d{4})[-/](\d{1,2})$/;function S(e){let t=e.trim();if(b.test(t))return Date.UTC(Number(t),0,1);let n=x.exec(t);if(n){let e=Number(n[2]);return e>=1&&e<=12?Date.UTC(Number(n[1]),e-1,1):null}let r=Date.parse(t);return Number.isFinite(r)?r:null}var C=[`economy`,`policy`,`technology`,`science`,`environment`,`society`,`health`,`conflict`];function w(e){return typeof e==`string`&&C.includes(e)?e:void 0}var T=new Set([`root`,`mechanism`,`outcome`]),E=[`T0`,`T1`,`T2`,`T3`],D=140,O=40,k=120,A=240,j=240,ee=24,M=12,N=6,P=16,F=4,I=48,te=40,L=24,ne=24;function R(e,t){if(typeof e!=`string`)return null;let n=e.trim();return n?n.length>t?n.slice(0,t):n:null}var re=e=>e<0?0:e>1?1:e;function z(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,ne).replace(/-+$/,``)}function B(e){if(typeof e!=`string`)return null;let t=e.trim();if(!t||t.length>L)return null;let n=S(t);return n===null?null:{label:t,at:n}}function ie(t,n,r){let i=typeof t==`string`?{t}:t;if(!i||typeof i!=`object`||Array.isArray(i))return;let a=i,o=B(a.t);if(!o)return;let s=B(a.until),c=E.includes(a.tier)?a.tier:`T0`,u=R(a.quote,A),d=e(c)&&u?{quote:u,tier:c,receipt:a.receipt}:r?{...r,receipt:void 0}:null,f=d&&d.quote.includes(o.label)&&n.holds(d.quote)?{tier:d.tier,receipt:l(d.receipt,d.quote,n.sourceOf(d.quote))}:{tier:`T0`};return{t:o.label,...s&&s.at>o.at?{until:s.label}:{},...f}}function V(t,n,r,i){let o=T.has(t.role)?t.role:`mechanism`,c=typeof t.depth==`number`&&Number.isFinite(t.depth)?Math.max(0,Math.round(t.depth)):o===`root`?0:o===`outcome`?2:1,u=E.includes(t.tier)?t.tier:`T0`,d=typeof t.value==`number`&&Number.isFinite(t.value)?t.value:void 0,f=R(t.unit,M)??void 0,p=R(t.detail,j)??void 0,m=w(t.domain),h=s(t),g;e(u)?h&&r.holds(h)?(g=l(t.receipt,h,r.sourceOf(h)),d!==void 0&&!a(d,h)&&(d=void 0)):(u=`T0`,d=void 0):u===`T3`?(!i||d===void 0)&&(u=`T0`,d=void 0):d=void 0;let _=ie(t.date,r,g&&e(u)?{quote:g.quote,tier:u}:null);return{label:n,role:o,depth:c,tier:u,...d===void 0?{}:{value:d},...f?{unit:f}:{},...g?{receipt:g}:{},...p?{detail:p}:{},..._?{date:_}:{},...m?{domain:m}:{}}}function H(t,n,r){if(!t||typeof t!=`object`||Array.isArray(t))return;let i=t,o=E.includes(i.tier)?i.tier:`T0`;if(o===`T0`||o===`T3`&&!r)return;let c=R(i.unit,M)??void 0,u=s(i),d=e(o)&&u&&n.holds(u)?l(i.receipt,u):void 0,f=[];for(let t of Array.isArray(i.points)?i.points:[]){if(f.length>=te)break;if(!t||typeof t!=`object`)continue;let r=t,i=R(r.t,L),c=typeof r.value==`number`&&Number.isFinite(r.value)?r.value:void 0;if(!(!i||c===void 0)){if(e(o)){let e=s(r);if(!e||!n.holds(e)||!a(c,e))continue;f.push({t:i,value:c,receipt:l(r.receipt,e,n.sourceOf(e))})}else f.push({t:i,value:c})}}if(f.length!==0)return{points:f,tier:o,...c?{unit:c}:{},...d?{receipt:d}:{}}}function U(e,t,n,r){let i=[],a=new Set;for(let o of Array.isArray(e)?e:[]){if(i.length>=F)break;if(!o||typeof o!=`object`)continue;let e=o,s=R(e.id,O)??R(e.label,k);if(!s)continue;let c=s.startsWith(`${t}.`)?s.slice(t.length+1):s,l=z(c);if(!l)continue;let u=`${t}.${l}`;if(a.has(u))continue;a.add(u);let d=R(e.label,k)??y(c),f=H(e.series,n,r);i.push({id:u,...V(e,d,n,r),...f?{series:f}:{}})}return i}function ae(e,t){let n=new Map(e.map(e=>[e,0])),r=new Map(e.map(e=>[e,[]]));for(let e of t){let t=r.get(e.from);!t||!n.has(e.to)||(n.set(e.to,n.get(e.to)+1),t.push(e.to))}let i=[...r.keys()].filter(e=>n.get(e)===0),a=0;for(let e=0;e<i.length;e+=1){a+=1;for(let t of r.get(i[e])){let e=n.get(t)-1;n.set(t,e),e===0&&i.push(t)}}return a===r.size}function oe(e,t){let n=new Map(e.map(e=>[e,[]]));t.forEach((e,t)=>{let r=n.get(e.from);r&&n.has(e.to)&&r.push(t)});let r=new Map,i=new Set;for(let a of e){if(r.has(a))continue;r.set(a,1);let e=[{id:a,next:0}];for(;e.length>0;){let a=e[e.length-1],o=n.get(a.id);if(a.next>=o.length){r.set(a.id,2),e.pop();continue}let s=o[a.next];a.next+=1;let{to:c}=t[s],l=r.get(c);l===1?i.add(s):l===void 0&&(r.set(c,1),e.push({id:c,next:0}))}}return i}var W=e=>{let t=e.slice(0,3).map(e=>`${e.from} → ${e.to}`);return e.length>t.length?`${t.join(`, `)}, +${e.length-t.length} more`:t.join(`, `)};function G(e,t){if(ae(e,t))return{edges:[...t],notes:[]};let n=oe(e,t),r=t.filter((e,t)=>n.has(t));return{edges:t.filter((e,t)=>!n.has(t)),notes:[`Dropped ${r.length} link${r.length===1?``:`s`} that closed a causal loop (${W(r)}) — a causal web cannot come back round to its own cause.`]}}var K=e=>e.length===0?[]:[`Dropped ${e.length} self-link${e.length===1?``:`s`} (${W(e)}) — nothing causes itself.`];function q(e,t){let n=Math.max(0,N-t.length),r=[...(e??[]).slice(0,n),...t];return r.length>0?r.slice(0,N):void 0}function se(n,i){let a=typeof n==`string`?t(n):n;if(!a||typeof a!=`object`||Array.isArray(a))return null;let s=a,m=R(s.title,D);if(!m)return null;let h=s.provenance&&typeof s.provenance==`object`?s.provenance:{},g=h.illustrative===!0,v=typeof i==`string`?p(i):i??f,y={holds:r(v.text),sourceOf:_(v)},b=[],x=new Set;for(let e of Array.isArray(s.nodes)?s.nodes:[]){if(b.length>=P)break;if(!e||typeof e!=`object`)continue;let t=e,n=R(t.id,O),r=R(t.label,k);if(!n||!r||x.has(n))continue;x.add(n);let i=H(t.series,y,g),a=U(t.children,n,y,g);b.push({id:n,...V(t,r,y,g),...i?{series:i}:{},...a.length?{children:a}:{}})}if(b.length<2)return null;let S=new Set(b.map(e=>e.id)),C=[],w=[];for(let t of Array.isArray(s.edges)?s.edges:[]){if(C.length>=I)break;if(!t||typeof t!=`object`)continue;let n=t,r=R(n.from,O),i=R(n.to,O);if(!r||!i||!S.has(r)||!S.has(i))continue;if(r===i){w.push({from:r,to:i});continue}let a=n.sign===-1?-1:1,s=R(n.verb,ee)??void 0,f=n.relation==null?void 0:u(n.relation),p=E.includes(n.tier)?n.tier:`T0`,m=typeof n.weight==`number`&&Number.isFinite(n.weight)?re(n.weight):void 0,h=d(n,y.holds,y.sourceOf),g=!1,_=m;_!==void 0&&!h.some(e=>o(_,e.quote))&&(m=void 0),e(p)&&m!==void 0&&h.length>0||(p=`T0`,m=void 0,g=!0);let v=n.counter&&typeof n.counter==`object`?n.counter:null,b=v?R(v.quote,A):null,x=b&&y.holds(b)?l(v,b,y.sourceOf(b)):void 0;C.push({from:r,to:i,sign:a,tier:p,...s?{verb:s}:{},...m===void 0?{}:{weight:m},...h.length?{receipt:h[0],receipts:h}:{},...g?{provisional:!0}:{},...f?{relation:f}:{},...x?{counter:x}:{},status:c({tier:p,weight:m,receipt:h[0],receipts:h,counter:x})})}let T=G([...S],C),j=R(s.outcomeId,O);(!j||!S.has(j))&&(j=(b.find(e=>e.role===`outcome`)??b.reduce((e,t)=>t.depth>e.depth?t:e)).id);let M=q(Array.isArray(h.notes)?h.notes.map(e=>String(e)):void 0,[...K(w),...T.notes]);return{title:m,outcomeId:j,nodes:b,edges:T.edges,provenance:{...g?{illustrative:!0}:{},...M?{notes:M}:{}}}}var J=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,``);function Y(e,t){let n=new Set(e.nodes.map(e=>e.id)),r=new Map;for(let t of e.nodes){let e=J(t.label),n=r.get(e);n?n.push(t.id):r.set(e,[t.id])}let i=new Map,a=new Set,o=new Set,s=[],c=new Set(n);for(let t of e.nodes)for(let e of t.children??[])c.add(e.id);for(let l of t.nodes){if(i.has(l.id))continue;let t=n.has(l.id)?l.id:null;if(!t){let e=r.get(J(l.label));e&&e.length===1&&(t=e[0])}if(t){if(o.has(t))continue;o.add(t),i.set(l.id,t),a.add(l.id);continue}if(e.nodes.length+s.length>=P)continue;let u=l.id;for(let e=2;c.has(u);e+=1)u=`${l.id}-${e}`;c.add(u),i.set(l.id,u),s.push({node:l,id:u})}return{idMap:i,matched:a,fresh:s}}function ce(e,t){return t.nodes.length===0?0:Y(e,t).matched.size/t.nodes.length}var le=t=>e(t.tier)&&!!t.receipt;function ue(t,n){return n?t?e(n.tier)||!e(t.tier)?n:t:n:t}function X(e,t){let n=le(t)?t:e,r=ue(e.series,t.series),i=t.detail??e.detail,a=t.date??e.date,o=t.domain??e.domain;return{id:e.id,label:e.label,role:e.role,depth:e.depth,tier:n.tier,...n.value===void 0?{}:{value:n.value},...n.unit?{unit:n.unit}:{},...n.receipt?{receipt:n.receipt}:{},...a?{date:a}:{},...r?{series:r}:{},...i?{detail:i}:{},...o?{domain:o}:{}}}function Z(e,t,n,r){let i=e?[...e]:[],a=new Map(i.map((e,t)=>[e.id,t]));for(let e of t??[]){let t=z(e.id.startsWith(`${n}.`)?e.id.slice(n.length+1):e.id.split(`.`).pop()??``);if(!t)continue;let o=`${r}.${t}`,{children:s,...c}=e,l={...c,id:o},u=a.get(o);u===void 0?i.length<F&&(a.set(o,i.length),i.push(l)):i[u]=X(i[u],l)}return i.length?i:void 0}function de(e,t){let n=Z(e.children,t.children,t.id,e.id);return{...X(e,t),...n?{children:n}:{}}}var Q=e=>e.receipts??(e.receipt?[e.receipt]:[]);function fe(e,t){let n=Q(e),r=Q(t).length>0&&n.length===0?t:e,i=r===t?e:t,a=[],o=new Set;for(let e of[...Q(r),...Q(i)])a.length>=3||o.has(e.quote)||(o.add(e.quote),a.push(e));let s=r.relation??i.relation,l=r.counter??i.counter;return{from:e.from,to:e.to,sign:r.sign,tier:r.tier,...r.verb?{verb:r.verb}:{},...r.weight===void 0?{}:{weight:r.weight},...a.length?{receipt:a[0],receipts:a}:{},...r.provisional?{provisional:!0}:{},...s?{relation:s}:{},...l?{counter:l}:{},status:c({tier:r.tier,...r.weight===void 0?{}:{weight:r.weight},...a.length?{receipt:a[0],receipts:a}:{},...l?{counter:l}:{}})}}function pe(e,t){let{idMap:n,fresh:r}=Y(e,t),i=new Map(t.nodes.map(e=>[e.id,e])),a=[...e.nodes],o=new Map(e.nodes.map((e,t)=>[e.id,t]));for(let[e,t]of n){let n=o.get(t);if(n===void 0)continue;let r=i.get(e);r&&(a[n]=de(a[n],r))}for(let{node:e,id:t}of r){let{children:n,...r}=e,i=Z(void 0,e.children,e.id,t);a.push({...r,id:t,...i?{children:i}:{}})}let s=[...e.edges],c=new Map(e.edges.map((e,t)=>[`${e.from}\0${e.to}`,t])),l=e=>n.get(e)??(o.has(e)?e:void 0);for(let e of t.edges){let t=l(e.from),n=l(e.to);if(!t||!n||t===n)continue;let r=`${t}\0${n}`,i=c.get(r);i===void 0?s.length<I&&(c.set(r,s.length),s.push({...e,from:t,to:n})):s[i]=fe(s[i],{...e,from:t,to:n})}let u=G(a.map(e=>e.id),s),d=q(e.provenance.notes,u.notes);return{title:e.title,outcomeId:e.outcomeId,nodes:a,edges:u.edges,provenance:{...e.provenance.illustrative?{illustrative:!0}:{},...d?{notes:d}:{}}}}function me(e,n,i,a){let o=typeof e==`string`?t(e):e;if(!o||typeof o!=`object`)return[];let s=o.children,c=typeof i==`string`?p(i):i??f;return U(s,n,{holds:r(c.text),sourceOf:_(c)},a)}function he(e,t,n){if(n.length===0)return e;let r=$(e.nodes,t,n);return r===e.nodes?e:{...e,nodes:[...r]}}function $(e,t,n){let r=!1,i=e.map(e=>{if(e.id===t)return(e.children?.length??0)>0?e:(r=!0,{...e,children:[...n]});if(e.children===void 0)return e;let i=$(e.children,t,n);return i===e.children?e:(r=!0,{...e,children:[...i]})});return r?i:e}export{ce as a,v as c,g as d,pe as i,f as l,me as n,C as o,se as r,S as s,he as t,h as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./format-q0LwBjID.js";import{t}from"./types-C42I77wh.js";function n(e,t){let n=new Map,r=(t,r)=>{if(!e.has(t))return;let i=n.get(t);i?i.push(Object.freeze(r)):n.set(t,[Object.freeze(r)])};for(let e of t)r(e.valueId,{surface:e.surface,id:e.id,label:e.label});for(let t of e.values())if(t.kind===`calculated`)for(let e of t.calc.inputs)r(e,{surface:`calc`,id:t.id,label:`input to ${t.label}`});for(let e of n.values())Object.freeze(e);return Object.freeze({values:e,usedIn:n})}var r=`Shows the shape, not your numbers.`;function i(n,r,i,a,o,s,c,l){if(!Number.isFinite(i))return null;let u=e(i,o),d={...o?{unit:o}:{},...l?{period:l}:{}},f={id:n,label:r,...o||l?{scope:d}:{}};return c||a===`T3`?{...f,kind:`illustrative`,resolution:{ok:!0,tier:`T3`,value:i,raw:u,illustrative:s?.quote??`Shows the shape, not your numbers.`,surface:`model`}}:!s||!t(a)?null:a===`T1`?{...f,kind:`grounded`,resolution:{ok:!0,tier:`T1`,value:i,raw:u,receipt:s,surface:`user`}}:{...f,kind:`grounded`,resolution:{ok:!0,tier:`T2`,value:i,raw:u,receipt:s,surface:`web`}}}export{i as n,n as r,r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as e,j as t}from"./kokoro-
|
|
1
|
+
import{T as e,j as t}from"./kokoro-P_fkcX-A.js";import{n,t as r}from"./nextFrame-12y0UrAd.js";var i=1100,a=15e3,o=1e4,s=12e3,c=8e3,l=3500,u=2500,d=3e3;function f(e){return e*2+12e3}function p(e,t=1700){let n=e.trim();return n?Math.min(7e3,Math.max(1500,Math.round(n.split(/\s+/).length*385+500))):t}function m(e){return new Promise(t=>setTimeout(t,e))}async function h(e,t=a){return await n(e.started,t)??!1}async function g(e,t,r=i){await Promise.all([n(e.finished,f(t)),m(r)])}function _(n){let r=n.speaking??e,i=n.subscribe??t;return new Promise(e=>{let t=!1,a=!1,o=()=>{a||(a=!0,c(),clearTimeout(l),e())},s=()=>{t&&!r()&&o()},c=i(s);setTimeout(()=>{t=!0,s()},n.floorMs);let l=setTimeout(o,n.capMs)})}async function v(e){try{await n((async()=>{await r(),await r(),await n(e.loadFams(),c),e.settle&&await e.settle(),e.wantVoice&&e.firstLine&&await n(e.firstLine.started,o)})(),s)}catch{}}export{v as a,p as c,_ as d,d as i,g as l,u as n,m as o,l as r,f as s,i as t,h as u};
|
package/dist/index.html
CHANGED
|
@@ -102,19 +102,19 @@
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
</style>
|
|
105
|
-
<script type="module" crossorigin src="/assets/index-
|
|
105
|
+
<script type="module" crossorigin src="/assets/index-Dk0QapqQ.js"></script>
|
|
106
106
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-DkW27tQK.js">
|
|
107
107
|
<link rel="modulepreload" crossorigin href="/assets/react-BZJXY1be.js">
|
|
108
108
|
<link rel="modulepreload" crossorigin href="/assets/compiler-runtime-qQQXpJgv.js">
|
|
109
109
|
<link rel="modulepreload" crossorigin href="/assets/useInView-CXTOAEV3.js">
|
|
110
110
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DeHZSEgm.js">
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/coreIcons-
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/coreIcons-DDTChE1H.js">
|
|
112
112
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-CiWYd9n-.js">
|
|
113
113
|
<link rel="modulepreload" crossorigin href="/assets/cachedImport-DW0gP14h.js">
|
|
114
114
|
<link rel="modulepreload" crossorigin href="/assets/lazyRetry-D50B1UMY.js">
|
|
115
115
|
<link rel="modulepreload" crossorigin href="/assets/preloadableLazy-MIX1ApBW.js">
|
|
116
116
|
<link rel="modulepreload" crossorigin href="/assets/theme-7IrMJ70_.js">
|
|
117
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
117
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DmKgC_TJ.css">
|
|
118
118
|
</head>
|
|
119
119
|
<body>
|
|
120
120
|
<div id="boot" role="status" aria-busy="true" aria-label="Loading Mavéa">
|
package/dist/legal/DISCLAIMER.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# Mavéa Disclaimer
|
|
2
2
|
|
|
3
|
-
Effective: August
|
|
3
|
+
Effective: August 17, 2026
|
|
4
4
|
|
|
5
5
|
Mavéa uses probabilistic AI systems and can be wrong.
|
|
6
6
|
|
|
7
7
|
- AI-generated text, citations, calculations, classifications, transcriptions, translations, and visualizations may be inaccurate, incomplete, misleading, offensive, or outdated.
|
|
8
8
|
- A citation, confidence label, validation step, or polished visualization does not guarantee that a claim is correct.
|
|
9
9
|
- Verify important information with authoritative sources and qualified professionals before relying on it.
|
|
10
|
+
- Results depend heavily on the model and provider you choose. Models differ in whether they search the live web at all, whether they can be required to, how reliably they cite what they used, and how current their training data is. A smaller or cheaper model may answer from memory instead of searching, and may not say that it did. Live, tracked, and refreshed values can therefore be stale, incomplete, or wrong, and a shown source does not prove that the figure beside it came from that source or is correct. Even a completed search can surface figures that were already out of date at the source. Scheduled checks may be delayed, skipped, or missed entirely, and alert and notification features are best-effort — a check that does not run, a closed app, or blocked browser notifications means no alert, so never depend on one arriving. Every check runs on the API key you supply, so the refresh cadence you configure is a spending decision with the provider you pay. Do not rely on tracked dashboards or alerts for anything time-critical or consequential.
|
|
10
11
|
- Mavéa does not provide medical, legal, financial, tax, accounting, safety, engineering, mental-health, or other professional advice. Do not use it for emergencies or as the sole basis for high-impact decisions.
|
|
11
12
|
- You are responsible for the prompts, files, audio, accounts, credentials, and actions you provide or authorize.
|
|
12
13
|
- Model, search, speech, hosting, OAuth, media, and connected-action providers are independent third parties. Their terms, privacy practices, availability, and charges apply. All costs are your responsibility.
|
package/dist/legal/PRIVACY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Mavéa Privacy Notice
|
|
2
2
|
|
|
3
|
-
Effective: August
|
|
3
|
+
Effective: August 17, 2026
|
|
4
4
|
|
|
5
5
|
This notice describes the current, unmodified local and self-hosted Mavéa software. It does not describe a future hosted service. Local-first does not mean every feature stays on your device: connected features send data through the deployment to third parties you choose. If a person or organization deploys Mavéa for others, that operator must provide any additional privacy notices and controls required for its deployment.
|
|
6
6
|
|
|
@@ -20,6 +20,7 @@ Depending on the features you use, browser storage may contain:
|
|
|
20
20
|
|
|
21
21
|
- conversations, saved canvases, bookmarks, memory items, and session history;
|
|
22
22
|
- courses, lessons, flashcards, quiz progress, Ripple analyses, and dashboards;
|
|
23
|
+
- the readings a dashboard has fetched over time, kept per tracked item as its own record so a value's history and the sites it came from survive between checks;
|
|
23
24
|
- preferences such as theme, performance, visual richness, voice, and setup state;
|
|
24
25
|
- drafts, tracked items, presentation settings, and recent feature state;
|
|
25
26
|
- provider and model configuration;
|
|
@@ -27,9 +28,9 @@ Depending on the features you use, browser storage may contain:
|
|
|
27
28
|
- temporary in-progress and finished video-export files in origin-private browser storage until the export is consumed or discarded; and
|
|
28
29
|
- short-lived demo, tour, route, and in-progress session data.
|
|
29
30
|
|
|
30
|
-
Saved content is encrypted in browser storage only where the relevant feature and browser support it. Course data, mastery and progress, some Ripple data and analysis caches, preferences, metadata, and fallback content can be stored in ordinary local storage or IndexedDB. Anyone who can use your unlocked device or browser profile, and malicious extensions or same-origin code, may be able to access browser data.
|
|
31
|
+
Saved content is encrypted in browser storage only where the relevant feature and browser support it. Dashboards and the readings they fetch are encrypted with the same device key, the readings in IndexedDB with only their routing details — which tracked item, and when — left readable so they can be looked up. Course data, mastery and progress, some Ripple data and analysis caches, preferences, metadata, and fallback content can be stored in ordinary local storage or IndexedDB. Anyone who can use your unlocked device or browser profile, and malicious extensions or same-origin code, may be able to access browser data.
|
|
31
32
|
|
|
32
|
-
Because this browser data is encrypted to this specific browser, it does not carry over to a different browser, an incognito window, or another device. You can export a backup file of your dashboards, memory, flashcards, saved canvases, map, and courses, and import it elsewhere to move that data. The backup is plain, unencrypted JSON under your control, so store and share it carefully; it deliberately excludes your provider and search keys. Importing a backup merges into existing data and never deletes it, and importing a file you did not create can add content from that file — import only backups you trust.
|
|
33
|
+
Because this browser data is encrypted to this specific browser, it does not carry over to a different browser, an incognito window, or another device. You can export a backup file of your dashboards, memory, flashcards, saved canvases, map, and courses, and import it elsewhere to move that data. A backup carries a dashboard's definition and its latest values, not its fetched reading history, so moving to another browser starts that history fresh. The backup is plain, unencrypted JSON under your control, so store and share it carefully; it deliberately excludes your provider and search keys. Importing a backup merges into existing data and never deletes it, and importing a file you did not create can add content from that file — import only backups you trust.
|
|
33
34
|
|
|
34
35
|
Browser and operating-system caches may retain application assets and optional voice models. The actions gateway may store connected-service credentials and configuration on the deployment operator's machine.
|
|
35
36
|
|
|
@@ -88,7 +89,7 @@ The unmodified project does not sell personal information or use it for cross-co
|
|
|
88
89
|
|
|
89
90
|
## 8. Retention and deletion
|
|
90
91
|
|
|
91
|
-
Memory-only values disappear on reload. Session storage generally remains until the tab or browser session ends. Local storage and IndexedDB remain until a feature removes the item, you use an available clear, forget, or reset control, you clear site data, or the browser evicts it. Some session history is capped and expires, but many course, progress, dashboard, memory, and Ripple records have no automatic expiration. Clearing all browser site data is the broadest local deletion control. Removing browser data does not delete copies already sent elsewhere.
|
|
92
|
+
Memory-only values disappear on reload. Session storage generally remains until the tab or browser session ends. Local storage and IndexedDB remain until a feature removes the item, you use an available clear, forget, or reset control, you clear site data, or the browser evicts it. Some session history is capped and expires, but many course, progress, dashboard, memory, and Ripple records have no automatic expiration. A dashboard's fetched reading history is capped per tracked item, and deleting a dashboard deletes its readings and its record of recent checks with it. Clearing all browser site data is the broadest local deletion control. Removing browser data does not delete copies already sent elsewhere.
|
|
92
93
|
|
|
93
94
|
Gateway tokens remain until disconnected or removed by the gateway operator. Server, proxy, infrastructure, and provider retention depends on the relevant operator, logs, backups, account settings, and third-party policy. Contact those parties for deletion of data they control and revoke credentials at the issuing service.
|
|
94
95
|
|
package/dist/legal/TERMS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Mavéa Terms of Use
|
|
2
2
|
|
|
3
|
-
Effective: August
|
|
3
|
+
Effective: August 17, 2026
|
|
4
4
|
|
|
5
5
|
These Terms of Use (the **Terms**) govern your use of the Mavéa application, command-line package, demos, documentation, and related materials (collectively, the **Service**). **Licensor** means each applicable copyright holder offering software under the PolyForm license. **Maintainers** means the people who publish or contribute to Mavéa; a Maintainer is not necessarily a Licensor. **Deployment operator** means the person or organization hosting the copy you use. **Responsible Party** means the applicable Licensor, Maintainer, or deployment operator responsible for a statement, obligation, service, or claim. In these Terms, **we**, **us**, or **our** means the relevant Responsible Party or Parties in context. A separately operated deployment remains independent from the Licensors and Maintainers unless the same person or organization serves both roles.
|
|
6
6
|
|
|
@@ -30,6 +30,8 @@ You are responsible for selecting, configuring, operating, and securing your dev
|
|
|
30
30
|
|
|
31
31
|
The Service uses probabilistic artificial-intelligence systems. Outputs, citations, calculations, classifications, summaries, transcriptions, translations, confidence labels, and visualizations may be false, fabricated, inaccurate, incomplete, misleading, biased, offensive, unsafe, or outdated. A polished presentation, citation, calculation, validation check, or natural voice does not guarantee accuracy, originality, legality, quality, or fitness for a particular purpose.
|
|
32
32
|
|
|
33
|
+
Output quality depends on the model, provider, and settings you select, and those are your choices. Models differ in whether they retrieve live information at all, whether the Service can compel them to, whether they disclose what they used, and how current their training data is; a smaller or cheaper model may answer from memory rather than searching, and may not say so. Features that display tracked, refreshed, or "live" values are therefore best-effort only: a value may be stale, incomplete, absent, or wrong, a check may be delayed, skipped, or silently unsuccessful, a figure obtained from a genuine live search may already be out of date at its source, and a source shown beside a figure does not establish that the figure came from that source or is accurate. Alert and notification features are likewise best-effort; no alert is guaranteed to fire or to be delivered. Scheduled checks run on credentials you supply and can incur third-party charges at whatever cadence you configure. Do not treat any displayed value as real-time, authoritative, monitored, or verified, and do not rely on tracking or alerts as your means of watching anything consequential.
|
|
34
|
+
|
|
33
35
|
You must independently review and verify important output against qualified professionals and original sources before relying on, publishing, sharing, or acting on it. The Service is not a substitute for qualified professional judgment and does not provide medical, legal, financial, tax, accounting, safety, engineering, mental-health, or other professional advice. Do not use it for emergencies or as the sole basis for decisions that may affect a person's rights, health, safety, finances, employment, education, housing, insurance, or access to essential services. You remain responsible for deciding whether and how to use every output.
|
|
34
36
|
|
|
35
37
|
## 5. Third-party services, credentials, and costs
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mavea/mavea",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Mavéa — an AI Presence interface. Talk to AI. See what it means.",
|
|
6
6
|
"keywords": [
|
|
@@ -111,6 +111,8 @@
|
|
|
111
111
|
"audit:browsers": "node --import tsx scripts/browser-matrix.mts",
|
|
112
112
|
"audit:interactions": "node --import tsx scripts/interaction-matrix.mts",
|
|
113
113
|
"perf:world": "node --import tsx scripts/world-perf.mts",
|
|
114
|
+
"audit:world": "node --import tsx scripts/world-audit.mts",
|
|
115
|
+
"world:smoke": "node --import tsx scripts/world-perf.mts --viewport=1280x720 --throttle=4",
|
|
114
116
|
"perf": "node --import tsx scripts/perf-probe.mts",
|
|
115
117
|
"perf:memory": "node --import tsx scripts/memory-probe.mts",
|
|
116
118
|
"audit:tap": "node --import tsx scripts/tap-audit.mts",
|
|
Binary file
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-CPImC7mO.js","assets/rolldown-runtime-DkW27tQK.js","assets/react-BZJXY1be.js","assets/jsx-runtime-DeHZSEgm.js","assets/icons-gLFQTv74.js","assets/richText-BkxJhl9N.js","assets/format-q0LwBjID.js","assets/scale-Bcgfo6Hp.js","assets/BlockEmpty-B82uCse8.js","assets/compiler-runtime-qQQXpJgv.js","assets/empty-BO1NC9qY.js","assets/registry-types-D3q_LrlV.js","assets/registry-B1KQ1VPZ.css","assets/registry-B0GIHERt.js","assets/motion-DxHSlPN6.js","assets/fitText-DQ2omSN0.js","assets/spreadLabels-CQ8hufvK.js","assets/registry-CuVk7MAI.css","assets/registry-WHd1PwU3.js","assets/registry-DpMI23iE.css","assets/registry-Xl8mAnKq.js","assets/lib-B7OE1ZQQ.js","assets/lib-DMAxsZKm.css","assets/annotations-CftUUB13.js","assets/registry-Dru0JcTa.css","assets/registry-Ci65uThi.js","assets/useSpotlightWalk-DxlxBezO.js","assets/motion-BY_Egaxm.js","assets/registry-BAoRB8rd.css","assets/registry-C28gYnVq.js","assets/sourceHost-BV3t2XDb.js","assets/registry-CRisz4Ca.css","assets/registry-CcOO8UZr.js","assets/registry-2GJZ46M8.css","assets/registry-w4R6c89s.js","assets/preload-helper-CiWYd9n-.js","assets/safeImageUrl-BINWXOTz.js","assets/useValidatedImage-BQi2c66o.js","assets/useTimeout-Cm4yzted.js","assets/safeCssColor-di93BXgG.js","assets/registry-4mMEt1Xy.css","assets/registry-9QjeHgKs.js","assets/registry-DScSjt8p.css","assets/registry-Daypk4uR.js","assets/registry-GeSy4i7R.css","assets/registry-ChQGee7C.js","assets/useFocusTrap-DBtkeyRy.js","assets/portal-BJzn-Tgn.js","assets/index-CfcUMOBf.js","assets/useInView-CXTOAEV3.js","assets/coreIcons-BzqW7Qiz.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-7IrMJ70_.js","assets/index-D4FIsool.css","assets/registry-Dye5m3qt.css","assets/registry-D_4_HlMg.js","assets/registry-T3i2Q9SI.css","assets/registry-BSX3aFUw.js","assets/registry-C3ezxLR3.css","assets/registry-DO4hGO5e.js","assets/registry-CRM7y8QT.css","assets/registry-7poQfBaM.js","assets/CodeOutput-DF892aIR.js","assets/registry-ZOWzhOHk.css","assets/registry-D4Xdd7dO.js","assets/MindShape-CBcCC7hP.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/Presence-CKSoyuhE.js","assets/geometry-DXAbnb0J.js","assets/MindShape-CaPeUo-a.css","assets/openWorld-BHTJM39n.js","assets/display-BrieMea1.js","assets/types-C42I77wh.js","assets/registry-BZuT2Epw.css","assets/registry-BM9FDQxO.js","assets/quizResult-DB8yeqDr.js","assets/stepDriver-DwjFet6U.js","assets/kokoro-CdL8Kl48.js","assets/spokenText-C88IQJ0M.js","assets/registry-B5S3brjM.css","assets/registry-Vp8VuMV0.js","assets/registry-twSIyxJQ.css","assets/registry-Bv1f5UU4.js","assets/registry-CvylL2BN.css","assets/registry-BRbEINOV.js","assets/registry-tkd3UhWn.css","assets/registry-D8O0apUT.js","assets/registry-BzNLfje1.css","assets/registry-BFbfXK-W.js","assets/registry-UFIuwh3i.css","assets/registry-CPiwQhAm.js","assets/registry-CNgybLQv.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{n,t as r}from"./preload-helper-CiWYd9n-.js";import{t as i}from"./lazyRetry-D50B1UMY.js";import{n as a}from"./icons-gLFQTv74.js";var o={treemap:`charts1`,sunburst:`charts1`,sankey:`charts1`,network:`charts1`,radar:`charts1`,waterfall:`charts1`,funnel:`charts1`,histogram:`charts1`,boxplot:`charts1`,streamgraph:`charts1`,venn:`charts1`,piedonut:`charts1`,distributioncurve:`charts1`,quadrant:`charts1`,latencydist:`charts1`,captable:`charts1`,lifewheel:`charts1`,violinplot:`charts1`,stemleafplot:`charts1`,tamsam:`charts1`,correlationheatmap:`charts1`,bcgmatrix:`charts1`,flowchord:`charts1`,slopegraph:`charts2`,plot:`charts2`,calheat:`charts2`,bump:`charts2`,marimekko:`charts2`,dumbbell:`charts2`,lollipop:`charts2`,bulletchart:`charts2`,candlestick:`charts2`,gantt:`charts2`,bubble:`charts2`,arearange:`charts2`,waffle:`charts2`,groupedbars:`charts2`,dualaxis:`charts2`,scatterregression:`charts2`,dotplot:`charts2`,controlchart:`charts2`,bridge:`charts2`,areaplot:`charts2`,supplydemand:`charts2`,breakeven:`charts2`,bigo:`charts2`,errorbars:`charts2`,eratimeline:`charts2`,indifferencecurve:`charts2`,payoffdiagram:`charts2`,phasediagram:`charts2`,loaddiagram:`charts2`,ecgstrip:`charts2`,vitalstrip:`charts2`,growthcurve:`charts2`,sleepcycle:`charts2`,seasonband:`charts2`,burnrunway:`charts2`,qqplot:`charts2`,samplingdistribution:`charts2`,hrdiagram:`charts2`,ternaryplot:`charts2`,parliamentseats:`charts2`,surfaceplot:`charts2`,roccurve:`charts2`,gradientdescent:`charts2`,biasvariance:`charts2`,timeseriesdecomposition:`charts2`,precisionrecallcurve:`charts2`,chromatogram:`charts2`,stressstraincurve:`charts2`,gatingplot:`charts2`,gellane:`charts2`,flightchart:`charts2`,paybandchart:`charts2`,linebalance:`charts2`,epicurve:`charts2`,pareto:`charts2`,populationpyramid:`charts2`,parallelcoordinates:`charts2`,scatterplotmatrix:`charts2`,pictogramchart:`charts2`,stackedbars:`charts2`,sparkstat:`stats`,counter:`stats`,herostat:`stats`,trendtile:`stats`,scorebadge:`stats`,percentilebar:`stats`,statpair:`stats`,scorecard:`stats`,deltacascade:`stats`,bulletkpi:`stats`,confusionmatrix:`stats`,kpidashboard:`stats`,abtestresult:`stats`,powersample:`stats`,inventoryreorder:`stats`,boardgamescore:`stats`,cvssscorecard:`stats`,ridgeplot:`stats`,ecdf:`stats`,forestplot:`stats`,matrix:`tables`,datatable:`tables`,pivot:`tables`,leaderboard:`tables`,treetable:`tables`,swimlane:`tables`,footnotetable:`tables`,sparktable:`tables`,smallmultiples:`tables`,comparebars:`tables`,comparematrix:`tables`,matrixgrid:`tables`,sensitivitytable:`tables`,labpanel:`tables`,ingredientmatrix:`tables`,conjugation:`tables`,clearancematrix:`tables`,financialstatement:`tables`,cohortgrid:`tables`,riskmatrix:`tables`,careplan:`tables`,doseladder:`tables`,sizechart:`tables`,pricingtable:`tables`,raci:`tables`,rubric:`tables`,interviewscorecard:`tables`,gradebook:`tables`,datadictionary:`tables`,ablationtable:`tables`,spectrumtable:`tables`,fmeatable:`tables`,billofmaterials:`tables`,complexitysummary:`tables`,expressionheatmap:`tables`,discoverytracker:`tables`,dentaltreatmentplan:`tables`,rollcall:`tables`,collectiontracker:`tables`,cma:`tables`,taxreturnsummary:`tables`,depreciationschedule:`tables`,vendortracker:`tables`,sponsorshiptracker:`tables`,caseload:`tables`,kanban:`flows`,wizard:`flows`,decisiontree:`flows`,goaltree:`flows`,plandag:`flows`,milestones:`flows`,processflow:`flows`,journeymap:`flows`,orgchart:`flows`,roadmap:`flows`,chronologicaltimeline:`flows`,trustmap:`flows`,skilltree:`flows`,businesscanvas:`flows`,headcountplan:`flows`,issuetree:`flows`,logicmodel:`flows`,contentcalendar:`flows`,hypothesiscard:`docs`,docview:`docs`,pdfreader:`docs`,annotateddoc:`docs`,redline:`docs`,citationchain:`docs`,factcheck:`docs`,confidencemeter:`docs`,highlightsnippet:`docs`,annotcallouts:`docs`,sourcelist:`docs`,claimgrid:`docs`,docoutline:`docs`,diffviewer:`docs`,paralleltext:`docs`,clinicaltimeline:`docs`,researchsummary:`docs`,eligibilitycheck:`docs`,evidencetrace:`docs`,reviewsynth:`docs`,resume:`docs`,changelog:`docs`,lessonplan:`docs`,casebrief:`docs`,patentclaimchart:`docs`,storystructure:`docs`,vetpatientchart:`docs`,scoutingreport:`docs`,reasoning:`ai`,toolcalls:`ai`,agenttrace:`ai`,modelcompare:`ai`,tokenstream:`ai`,retrieval:`ai`,whatchanged:`ai`,routing:`ai`,embedmap:`ai`,calibration:`ai`,httpexchange:`ai`,trainingcurve:`ai`,gameboard:`media`,patternpiece:`media`,photo:`media`,diagram:`media`,wireframe:`media`,anatomyfigure:`media`,exposuretriangle:`media`,colorwheel:`media`,artanalysis:`media`,mixerboard:`media`,beforeafter:`media`,carousel:`media`,imagecallouts:`media`,waveform:`media`,videoembed:`media`,geomap:`media`,lightbox:`media`,moodboard:`media`,palette:`media`,svgblock:`media`,sportspitch:`media`,floorplan:`media`,mediacard:`media`,dimensiondrawing:`media`,explodedview:`media`,weldsymbol:`media`,cutlist:`media`,spacefit:`media`,maproute:`media`,moonphase:`media`,skychart:`media`,orbitdiagram:`media`,emotionwheel:`media`,creativetest:`media`,brandguide:`media`,siteplan:`media`,zoningmap:`media`,wordsearch:`media`,playingcards:`media`,stitchchart:`media`,pianoroll:`media`,callout:`layout`,verdictcard:`layout`,scenarioset:`layout`,accordion:`layout`,proscons:`layout`,takeaways:`layout`,faq:`layout`,tabs:`layout`,divider:`layout`,pullquote:`layout`,storystrip:`layout`,casestudy:`layout`,deflist:`layout`,worthit:`layout`,companionnote:`layout`,positioncard:`layout`,differential:`layout`,reframecard:`layout`,breathpacer:`layout`,copingmenu:`layout`,subtextdecode:`layout`,rehearsal:`layout`,messagescriptset:`layout`,talktrack:`layout`,lifeline:`layout`,scansionmark:`layout`,typespec:`layout`,shotlist:`layout`,beatsheet:`layout`,promptset:`layout`,zoneladder:`layout`,picturesequence:`layout`,storyarc:`layout`,devicemark:`layout`,thoughtrecord:`layout`,dosdonts:`layout`,variantswitch:`layout`,progressbar:`status`,stepindicator:`status`,statustimeline:`status`,healthgrid:`status`,emptystate:`status`,skeleton:`status`,sliderinput:`status`,segmented:`status`,rangefilter:`status`,ratinginput:`status`,a11yaudit:`status`,painscale:`status`,habittracker:`status`,streakgrid:`status`,litigationtimeline:`status`,billtracker:`status`,triageboard:`status`,mentalhealthscreen:`status`,usabilityfindings:`status`,roomblockdashboard:`status`,immigrationcase:`status`,modal:`overlays`,confirmdialog:`overlays`,drawer:`overlays`,sheet:`overlays`,popover:`overlays`,hovercard:`overlays`,tooltip:`overlays`,menu:`overlays`,contextmenu:`overlays`,commandk:`overlays`,blanks:`forms`,buttonbar:`forms`,textfield:`forms`,textarea:`forms`,select:`forms`,combobox:`forms`,checkboxgroup:`forms`,radiogroup:`forms`,switchset:`forms`,togglegroup:`forms`,otp:`forms`,actionchecklist:`forms`,preflightchecklist:`forms`,estateplanchecklist:`forms`,visachecklist:`forms`,datepicker:`pickers`,calendarpick:`pickers`,daterange:`pickers`,timepicker:`pickers`,colorpicker:`pickers`,fileupload:`pickers`,tagsinput:`pickers`,numberstepper:`pickers`,searchselect:`pickers`,formpanel:`pickers`,navbar:`nav`,sidenav:`nav`,breadcrumb:`nav`,pagination:`nav`,menubar:`nav`,megamenu:`nav`,toolbar:`nav`,commandbar:`nav`,treeview:`nav`,bottomnav:`nav`,avatar:`display`,avatargroup:`display`,badgeset:`display`,chipset:`display`,kbd:`display`,codeblock:`display`,banner:`display`,toaststack:`display`,spinner:`display`,notification:`display`,algorithmtrace:`diagrams`,argumentmap:`diagrams`,binarytree:`diagrams`,castmap:`diagrams`,causationchain:`diagrams`,circuitdiagram:`diagrams`,controlblockdiagram:`diagrams`,cyclewheel:`diagrams`,datapipeline:`diagrams`,datastructure:`diagrams`,diagramflow:`diagrams`,dptable:`diagrams`,erdiagram:`diagrams`,fiveforces:`diagrams`,fivewhychain:`diagrams`,foodweb:`diagrams`,graphtrace:`diagrams`,hashtable:`diagrams`,logicgates:`diagrams`,mindshape:`diagrams`,nnarchitecture:`diagrams`,pipingschematic:`diagrams`,plasmidmap:`diagrams`,primefactortree:`diagrams`,probabilitytree:`diagrams`,protocolstack:`diagrams`,recursiontree:`diagrams`,sequencediagram:`diagrams`,sortingviz:`diagrams`,gridtrace:`diagrams`,statemachine:`diagrams`,synthesisroute:`diagrams`,sysarchdiagram:`diagrams`,threatmodel:`diagrams`,toulmin:`diagrams`,tournamentbracket:`diagrams`,prooftree:`diagrams`,fishbone:`diagrams`,classdiagram:`diagrams`,trie:`diagrams`,wiringdiagram:`diagrams`,world:`diagrams`,analogymap:`diagrams`,equationblock:`learn`,numberline:`learn`,workedexample:`learn`,quiz:`learn`,flashcard:`learn`,molecularstructure:`learn`,periodictable:`learn`,bodymap:`learn`,geometrycanvas:`learn`,freebodydiagram:`learn`,musicstaff:`learn`,vectorspace:`learn`,reactionmechanism:`learn`,chorddiagram:`learn`,developmentmilestone:`learn`,teachdiagram:`learn`,gridmatrix:`learn`,fractionbar:`learn`,wave:`learn`,energydiagram:`learn`,phylotree:`learn`,parsetree:`learn`,celldiagram:`learn`,raydiagram:`learn`,vectorfield:`learn`,pedigree:`learn`,bohrmodel:`learn`,equationbalancer:`learn`,yieldcalc:`learn`,vseprmolecule:`learn`,unitcircle:`learn`,solidfigure:`learn`,crosssection:`learn`,pianokeys:`learn`,fretboardmap:`learn`,circleoffifths:`learn`,odontogram:`learn`,clockface:`learn`,moneytray:`learn`,placevaluechart:`learn`,shapecard:`learn`,letterform:`learn`,toolscale:`learn`,craftchart:`learn`,dnahelix:`learn`,linespectrum:`learn`,pyramidtiers:`learn`,twocolumnproof:`learn`,gridtransform:`learn`,areamodel:`learn`,polarplot:`learn`,taylorseries:`learn`,phaseportrait:`learn`,sightwordlist:`learn`,alphabetchart:`learn`,columnarithmetic:`learn`,titrationcurve:`learn`,interferencepattern:`learn`,orbitaldiagram:`learn`,pictograph:`learn`,particlemodel:`learn`,morphemebreakdown:`learn`,practicelog:`learn`,taxonrank:`learn`,numbersequence:`learn`,constantcard:`learn`,elementcard:`learn`,energybarchart:`learn`,guitartab:`learn`,karyotype:`learn`,frayermodel:`learn`,numberbond:`learn`,quizsession:`learn`,messagedraft:`compose`,chatthread:`compose`,dialogue:`compose`,variants:`compose`,verse:`compose`,slidedeck:`compose`,voicestyle:`compose`,screenplay:`compose`,socialpost:`compose`,longread:`compose`,ideaboard:`compose`,forecast:`everyday`,weathernow:`everyday`,tierlist:`everyday`,paystub:`everyday`,taxbracket:`everyday`,menucard:`everyday`,familytree:`everyday`,seatingchart:`everyday`,relationshipmap:`everyday`,meetingnotes:`everyday`,stickerchart:`everyday`,statblock:`everyday`,agenda:`everyday`,picks:`everyday`,timezones:`everyday`,transitroute:`everyday`,amortization:`everyday`,receipt:`everyday`,settleup:`everyday`,bracketbar:`everyday`,recipecard:`everyday`,workoutplan:`everyday`,medicationschedule:`everyday`,macrobreakdown:`everyday`,plangrid:`everyday`,budgetallocator:`everyday`,howtosteps:`everyday`,livecompute:`everyday`,countdown:`everyday`,livescore:`everyday`,allocatepeople:`everyday`,nutritionlabel:`everyday`,unitconvert:`everyday`,packlist:`everyday`,pregnancyweek:`everyday`,cycletrack:`everyday`,contractiontimer:`everyday`,prayertimes:`everyday`,labprotocol:`everyday`,caregivercoord:`everyday`,readinglist:`everyday`,cocktailcard:`everyday`,runninglog:`everyday`,userpersona:`everyday`,runofshow:`everyday`,podcastplanner:`everyday`,vaxschedule:`everyday`,claimagecompare:`everyday`,factsheet:`reference`,newsdigest:`reference`,dictionary:`reference`,translation:`reference`,pronunciation:`reference`,gloss:`reference`,scalefelt:`reference`,hearit:`reference`,ipachart:`reference`,scriptstroke:`reference`,phonicsword:`reference`,speciescard:`reference`,etymtree:`reference`,hazardcard:`reference`,termbase:`reference`,sizecompare:`reference`,baseconversion:`reference`,historicalperson:`reference`,onthisday:`reference`,countrycard:`reference`,worldgrid:`reference`,warconflict:`reference`,posbreakdown:`reference`,distinctioncard:`reference`,stacktrace:`code`,syntaxbreakdown:`code`,codewalk:`code`,componentapi:`code`,terminal:`code`,logstream:`code`,gitgraph:`code`,queryplan:`code`,flamegraph:`code`,regexscope:`code`,sequencealign:`code`,thesis:`dashboard`,alignmentgauge:`dashboard`,standingalerts:`dashboard`,sourceslineage:`dashboard`,vestingschedule:`finance`,termsheet:`finance`,fundraisingrounds:`finance`,saferterms:`finance`,dilutionwaterfall:`finance`,threestatementlink:`finance`,yieldcurve:`finance`,efficientfrontier:`finance`,bondladder:`finance`,cashflowtimeline:`finance`};n();var s={charts1:i(()=>r(()=>import(`./registry-CPImC7mO.js`).then(e=>e.n).then(e=>e.charts1Registry),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),charts2:i(()=>r(()=>import(`./registry-B0GIHERt.js`).then(e=>e.n).then(e=>e.charts2Registry),__vite__mapDeps([13,1,2,9,3,4,5,6,7,8,10,14,11,15,16,17]))),stats:i(()=>r(()=>import(`./registry-WHd1PwU3.js`).then(e=>e.t).then(e=>e.statsRegistry),__vite__mapDeps([18,1,2,9,3,4,5,6,7,14,11,15,19]))),tables:i(()=>r(()=>import(`./registry-Xl8mAnKq.js`).then(e=>e.t).then(e=>e.tablesRegistry),__vite__mapDeps([20,1,2,9,3,4,5,6,7,8,21,14,22,11,23,24]))),flows:i(()=>r(()=>import(`./registry-Ci65uThi.js`).then(e=>e.n).then(e=>e.flowsRegistry),__vite__mapDeps([25,1,2,3,4,5,6,11,26,27,28]))),docs:i(()=>r(()=>import(`./registry-C28gYnVq.js`).then(e=>e.n).then(e=>e.docsRegistry),__vite__mapDeps([29,1,2,9,3,4,5,8,21,14,22,11,30,31]))),ai:i(()=>r(()=>import(`./registry-CcOO8UZr.js`).then(e=>e.n).then(e=>e.aiRegistry),__vite__mapDeps([32,1,2,9,3,4,5,6,7,21,8,14,22,11,33]))),media:i(()=>r(()=>import(`./registry-w4R6c89s.js`).then(e=>e.n).then(e=>e.mediaRegistry),__vite__mapDeps([34,1,2,9,3,35,4,5,6,36,37,7,8,21,14,22,11,15,38,39,40]))),layout:i(()=>r(()=>import(`./registry-9QjeHgKs.js`).then(e=>e.n).then(e=>e.layoutRegistry),__vite__mapDeps([41,1,2,3,4,5,7,21,8,9,14,22,11,30,42]))),status:i(()=>r(()=>import(`./registry-Daypk4uR.js`).then(e=>e.t).then(e=>e.statusRegistry),__vite__mapDeps([43,1,2,9,3,4,5,11,26,27,44]))),overlays:i(()=>r(()=>import(`./registry-ChQGee7C.js`).then(e=>e.n).then(e=>e.overlaysRegistry),__vite__mapDeps([45,1,2,3,4,46,5,11,47,48,9,49,50,35,51,52,53,54,55,56]))),forms:i(()=>r(()=>import(`./registry-D_4_HlMg.js`).then(e=>e.n).then(e=>e.formsRegistry),__vite__mapDeps([57,1,2,3,48,9,49,50,35,51,52,53,54,55,4,5,21,8,14,22,11,38,58]))),pickers:i(()=>r(()=>import(`./registry-BSX3aFUw.js`).then(e=>e.n).then(e=>e.pickersRegistry),__vite__mapDeps([59,1,2,3,4,5,11,60]))),nav:i(()=>r(()=>import(`./registry-DO4hGO5e.js`).then(e=>e.n).then(e=>e.navRegistry),__vite__mapDeps([61,1,2,3,4,5,11,62]))),display:i(()=>r(()=>import(`./registry-7poQfBaM.js`).then(e=>e.n).then(e=>e.displayRegistry),__vite__mapDeps([63,1,2,3,35,4,5,36,11,64,9,38,65]))),diagrams:i(()=>r(()=>import(`./registry-D4Xdd7dO.js`).then(e=>e.n).then(e=>e.diagramsRegistry),__vite__mapDeps([66,1,2,9,3,4,5,7,8,21,14,22,11,15,67,68,69,50,70,71,72,73,74,75]))),learn:i(()=>r(()=>import(`./registry-BM9FDQxO.js`).then(e=>e.n).then(e=>e.learnRegistry),__vite__mapDeps([76,1,2,9,3,35,52,4,27,5,6,7,8,21,14,22,11,15,16,77,78,79,48,49,50,51,53,54,55,80,81]))),compose:i(()=>r(()=>import(`./registry-Vp8VuMV0.js`).then(e=>e.n).then(e=>e.composeRegistry),__vite__mapDeps([82,1,9,2,3,4,5,8,21,14,22,11,83]))),everyday:i(()=>r(()=>import(`./registry-Bv1f5UU4.js`).then(e=>e.n).then(e=>e.everydayRegistry),__vite__mapDeps([84,1,2,9,3,4,5,6,7,21,8,14,22,11,85]))),reference:i(()=>r(()=>import(`./registry-BRbEINOV.js`).then(e=>e.n).then(e=>e.referenceRegistry),__vite__mapDeps([86,1,2,9,3,4,5,36,21,8,14,22,11,79,48,49,50,35,51,52,53,54,55,80,39,87]))),code:i(()=>r(()=>import(`./registry-D8O0apUT.js`).then(e=>e.n).then(e=>e.codeRegistry),__vite__mapDeps([88,1,2,9,3,4,5,21,8,14,22,11,64,38,89]))),dashboard:i(()=>r(()=>import(`./registry-BFbfXK-W.js`).then(e=>e.n).then(e=>e.dashboardRegistry),__vite__mapDeps([90,1,2,9,3,4,21,8,14,22,11,91]))),finance:i(()=>r(()=>import(`./registry-CPiwQhAm.js`).then(e=>e.n).then(e=>e.financeRegistry),__vite__mapDeps([92,1,2,3,4,5,6,7,8,9,21,14,22,11,15,93])))},c=new Map,l=new Map,u=new Set,d=2;function f(e,t,n){for(let r of e){let e=o[r.type];if(e&&t.add(e),n>=d)continue;let i=r.props?.regions;if(Array.isArray(i)){let e=i.map(e=>e&&typeof e==`object`?e.block:null).filter(e=>!!e&&typeof e.type==`string`);e.length&&f(e,t,n+1)}}}function p(e){let t=new Set;return f(e,t,0),t}function m(e){for(let t of e)if(!c.has(t)&&!u.has(t))return!1;return!0}function h(e){let t=[];for(let n of e){if(c.has(n)||u.has(n))continue;let e=l.get(n);e||(e=s[n]().then(e=>{c.set(n,e)}).catch(()=>{u.add(n)}).finally(()=>{l.delete(n)}),l.set(n,e)),t.push(e)}return t.length?Promise.all(t).then(()=>void 0):Promise.resolve()}function g(e){h(p(e))}function _(e){let t=o[e];return t?c.get(t)?.[e]??null:null}function v(e){let t=(e?.blocks??[]).filter(e=>!!e.id);return t.length>=4&&new Set(t.map(e=>e.type)).size>=3}var y=e(),b=t();function x({file:e,loc:t,color:n=`var(--presence-soft)`,onClick:r}){return(0,b.jsxs)(`button`,{className:`source-chip`,onClick:r,style:{color:n},children:[(0,b.jsx)(a.doc,{style:{width:12,height:12}}),(0,b.jsx)(`span`,{children:e}),t&&(0,b.jsxs)(`span`,{className:`mono`,children:[`· `,t]})]})}var S={strong:`Strong evidence`,partial:`Partial evidence`,inferred:`Inferred`,unverified:`Unverified`},C=`Best estimate from the model's knowledge — not verified`;function w({level:e=`strong`,title:t=`How sure Mavéa is, based on your files`}){return(0,b.jsxs)(`span`,{className:`conf `+e,title:t,children:[(0,b.jsxs)(`span`,{className:`bars`,children:[(0,b.jsx)(`i`,{style:{height:5}}),(0,b.jsx)(`i`,{style:{height:8}}),(0,b.jsx)(`i`,{style:{height:11}})]}),S[e]]})}function T(e){let t=(0,y.c)(8),{name:n,color:r,verb:i}=e,a;t[0]===r?a=t[1]:(a=(0,b.jsx)(`span`,{className:`fdot`,style:{background:r}}),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=i&&(0,b.jsx)(`span`,{className:`using`,children:i}),t[2]=i,t[3]=o);let s;return t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,b.jsxs)(`span`,{className:`context-pill`,children:[a,o,` `,n]}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var E=8,D=[[86,62],[74,91,55],[68,80],[90,58,76]];function O(e){let t=(0,y.c)(7),{blocks:n,budget:r}=e,i;if(t[0]!==n||t[1]!==r){let e;t[3]===r?e=t[4]:(e=(e,t)=>{let n=Math.min(12,Math.max(1,e.col??6));return(0,b.jsx)(`div`,{className:`col-`+(r!=null&&r<9?12:n),"aria-hidden":`true`,children:(0,b.jsxs)(`div`,{className:`card skel-card skel-fade`,children:[(0,b.jsx)(`span`,{className:`skel-eyebrow`}),D[t%D.length].map(k)]})},t)},t[3]=r,t[4]=e),i=n.slice(0,E).map(e),t[0]=n,t[1]=r,t[2]=i}else i=t[2];let a;return t[5]===i?a=t[6]:(a=(0,b.jsx)(b.Fragment,{children:i}),t[5]=i,t[6]=a),a}function k(e,t){return(0,b.jsx)(`span`,{className:`skel-line`,style:{width:`${e}%`}},t)}export{x as a,p as c,g as d,T as i,m as l,C as n,v as o,w as r,_ as s,O as t,h as u};
|