@mavea/mavea 1.0.18 → 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 +140 -1
- package/DISCLAIMER.md +2 -1
- package/PRIVACY.md +5 -4
- package/README.md +21 -11
- package/TERMS.md +3 -1
- package/dist/.vite/manifest.json +846 -611
- package/dist/assets/AnnotationLayer-qV6CIUZv.js +0 -0
- package/dist/assets/{AppCommandPalette-DKBglbNo.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-Btg7Linv.js → CheckLogRail-DkHIHL0E.js} +1 -1
- package/dist/assets/{CommandPalette-DagPdSGZ.js → CommandPalette-Bs6tpdZl.js} +1 -1
- package/dist/assets/{ConversationVideoStudio-EPw6H4lE.js → ConversationVideoStudio-C1sd4k53.js} +1 -1
- package/dist/assets/CourseLessonReader-YCcNKEW7.js +2 -0
- package/dist/assets/{CourseRail-Dx9IIbTZ.js → CourseRail-DXt3bzjU.js} +1 -1
- package/dist/assets/{CoursesApp-CzUGaYWZ.js → CoursesApp-Dz6xjf4V.js} +2 -2
- package/dist/assets/{DashPresent-DXwesMIr.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-CwqKpjo7.js → DeepZoomApp-BOLEl-kQ.js} +1 -1
- package/dist/assets/{DelegatePanel-Bi1qPgGG.js → DelegatePanel-CHEB-OZl.js} +1 -1
- package/dist/assets/DemoGallery-DBqnu8TR.js +1 -0
- package/dist/assets/{DropSelect-C3g0PjuN.js → DropSelect-DjbdVfIR.js} +1 -1
- package/dist/assets/ExportModal-CLobMv1F.js +2 -0
- package/dist/assets/ExtractionPreview-QZ2VHmsb.js +18 -0
- package/dist/assets/{FeatureUseNotice-BhljPjUv.js → FeatureUseNotice-Dc8joBGM.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-DyNsP8k3.js → FlagshipCommandPalette-DnWuBjYI.js} +1 -1
- package/dist/assets/{FlagshipShowcase-DHpGPlca.js → FlagshipShowcase-3qQDOK6g.js} +1 -1
- package/dist/assets/{FlashcardsApp-Cm50X3Hl.js → FlashcardsApp-BQGM-Tr1.js} +1 -1
- package/dist/assets/{GalleryApp-BFop9Eu7.js → GalleryApp-BWQ-J450.js} +1 -1
- package/dist/assets/{HonestByDesign-HeTTCiis.js → HonestByDesign-57LDf-gm.js} +1 -1
- package/dist/assets/{HowItWorks-gAuUl7VQ.js → HowItWorks-DMfPX3GK.js} +1 -1
- package/dist/assets/{LegalApp-jOlpLQSV.js → LegalApp-CcO5Qq6R.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-RSNiyAu0.js → LegalMarkdownDocument-Be_fQbZ_.js} +1 -1
- package/dist/assets/{LegalPageShell-Cr90l1I2.js → LegalPageShell-B-HY1WG7.js} +1 -1
- package/dist/assets/{LibraryOverlay-DEQ5GuIs.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-jn26sH4v.js → LiveSettings-CuVMy7rZ.js} +3 -3
- package/dist/assets/{MindMapViewerDrawer-CDDzzpFi.js → MindMapViewerDrawer-DI_S7fRZ.js} +1 -1
- package/dist/assets/{MindShape-BeZFay7O.js → MindShape-C_Bo9hW9.js} +1 -1
- package/dist/assets/PinToDashboard-Cz5UJCmq.js +1 -0
- package/dist/assets/PlanReview-CmUxzNqL.js +1 -0
- package/dist/assets/{Presence-CKSoyuhE.js → Presence-UqXfH4Y-.js} +1 -1
- package/dist/assets/PresentationDeck-B_EI33Pp.js +1 -0
- package/dist/assets/PrismApp-DtLsPiQF.js +2 -0
- package/dist/assets/PrismAskController-Bt0k9hAA.js +37 -0
- package/dist/assets/{PrismBriefingPlayer-BoB_PCTT.js → PrismBriefingPlayer-DzdtnFj4.js} +2 -2
- package/dist/assets/PrismOverlay-D1cDZamt.js +105 -0
- package/dist/assets/{PrismWorkbench-f0rLNBxb.js → PrismWorkbench-BEIp4MiL.js} +1 -1
- package/dist/assets/{PrivacyApp-CFs0PM5C.js → PrivacyApp-B4DT2RUz.js} +6 -5
- package/dist/assets/{ReplayCard-BkJbY0-I.js → ReplayCard-Dx46HCBT.js} +2 -2
- package/dist/assets/{ReplayOverlay-Dm_k7FBA.js → ReplayOverlay-CnJAxf0u.js} +1 -1
- package/dist/assets/{RewindOverlay-BSDbLgcN.js → RewindOverlay-CousnxXo.js} +1 -1
- package/dist/assets/RippleApp-D5j2VCt2.js +2 -0
- package/dist/assets/{RippleAskController-CywVzqUA.js → RippleAskController-9SxpZnHX.js} +2 -2
- package/dist/assets/{RippleOverlay-DVxfWEQ8.js → RippleOverlay-zcXAHPuJ.js} +2 -2
- package/dist/assets/{SeeDontRead-Ct4PY63d.js → SeeDontRead-Dqfzha0V.js} +1 -1
- package/dist/assets/{ShareModal-BILPvqjZ.js → ShareModal-DWxlrJSz.js} +2 -2
- package/dist/assets/{ShipCourse-DGj9BbRM.js → ShipCourse-BavQppkt.js} +1 -1
- package/dist/assets/{SignatureLoop-CfM-rTXb.js → SignatureLoop-L8W2h62w.js} +1 -1
- package/dist/assets/SynthesisApp-C2O6pFeM.js +2 -0
- package/dist/assets/{SynthesisOverlay-Dunk_JWD.js → SynthesisOverlay-DLvwiSMv.js} +1 -1
- package/dist/assets/{TermsApp-BUQa48cB.js → TermsApp-CxY1yorm.js} +4 -2
- package/dist/assets/TopicCanvas-LMI0zC7R.js +2 -0
- package/dist/assets/{TourPrism-zt1LIaLd.js → TourPrism-CI-iJZil.js} +1 -1
- package/dist/assets/TrackerTile-oz6IoG8m.js +2 -0
- package/dist/assets/{TwoSurfaces-CLOIlVvY.js → TwoSurfaces-Rnf-_WgY.js} +1 -1
- package/dist/assets/WhyMachineOverlay-ks9-rRiL.js +1 -0
- package/dist/assets/WorldOverlay-BaQNNClA.js +2 -0
- package/dist/assets/WorldOverlay-D7ay5y4D.css +1 -0
- package/dist/assets/{WowFeatures-CNVwRlf0.js → WowFeatures-C4efSbNV.js} +1 -1
- package/dist/assets/{ZoomDeck-DNgyW7Nm.js → ZoomDeck-CBrr0yfy.js} +1 -1
- package/dist/assets/{annotationAuto-C9weSF2k.js → annotationAuto-CDv6Es44.js} +1 -1
- package/dist/assets/{annotationReel-va1i-lKs.js → annotationReel-K2FYv-3B.js} +1 -1
- package/dist/assets/{backup-D--1WRte.js → backup-ZrlVatXc.js} +1 -1
- package/dist/assets/{blockTypes-CgNGx27_.js → blockTypes-DUDdP3pB.js} +1 -1
- package/dist/assets/canvas-Bsx3eSaS.js +1 -0
- package/dist/assets/{capture-BBxyt5SN.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/csv-DAqzYXUs.js +5 -0
- package/dist/assets/{dashboardEvents-BDKxoLch.js → dashboardEvents-DKl5rrTD.js} +1 -1
- package/dist/assets/dashboards-C1u2ks-d.css +1 -0
- package/dist/assets/dataPending-DGdCvY5Y.js +1 -0
- package/dist/assets/display-CAb_PiGv.js +1 -0
- package/dist/assets/emphasize-BqCIst-B.js +1 -0
- package/dist/assets/engine-BiM6INsW.js +1 -0
- package/dist/assets/engine-CTvOaA86.css +1 -0
- package/dist/assets/explode-BgZIWY9m.js +15 -0
- package/dist/assets/format-g3dP8OI3.js +1 -0
- package/dist/assets/{generate-CemSUZ8A.js → generate-Dl2EJ_SR.js} +3 -3
- package/dist/assets/generateBeats-DZHkvFvh.js +1 -0
- package/dist/assets/{generateCourse-BIBbw-ZJ.js → generateCourse-C9qvaJRo.js} +1 -1
- package/dist/assets/{generateLive-BsXn4Y_d.js → generateLive-B6purd69.js} +18 -18
- package/dist/assets/index-Dk0QapqQ.js +22 -0
- package/dist/assets/index-DmKgC_TJ.css +1 -0
- package/dist/assets/{kokoro-C6P0LV4L.js → kokoro-P_fkcX-A.js} +1 -1
- package/dist/assets/lens-ChFJD9il.js +1 -0
- package/dist/assets/{liveSchema-B8OByCPH.js → liveSchema-B4bQtO88.js} +22 -21
- package/dist/assets/loader-DKJEcbPm.js +2 -0
- package/dist/assets/{model-BsQ5ixwB.js → model-BFRTN9Eh.js} +1 -1
- package/dist/assets/nextFrame-12y0UrAd.js +1 -0
- package/dist/assets/notes-B0-EE0FK.js +1 -0
- package/dist/assets/number-zqlPMliA.js +1 -0
- package/dist/assets/officeDoc-GU6Cssjf.js +3 -0
- package/dist/assets/openWorld-BHTJM39n.js +1 -0
- package/dist/assets/{pen-D9UT-ioQ.js → pen-DNMslo3e.js} +1 -1
- package/dist/assets/{perfProbe-BxyiHsI2.js → perfProbe-B9zJpjo9.js} +1 -1
- package/dist/assets/{pin-qQrH_dBi.js → pin-CZAIlpXt.js} +1 -1
- package/dist/assets/{planTracker-CjnznF7v.js → planTracker-KKAtTBWs.js} +1 -1
- package/dist/assets/portal-Dogggsub.js +1 -0
- package/dist/assets/{prewarm-CAZcnT4x.js → prewarm-B4ELBOxf.js} +1 -1
- package/dist/assets/providers-BovElgRL.js +1 -0
- package/dist/assets/{quietHours-_i5Uqz7z.js → quietHours-CeBje_uU.js} +1 -1
- package/dist/assets/ready-Ba6nk9O1.js +1 -0
- package/dist/assets/{ready-4lPJes2S.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-BzH7mEl7.js → registry-6MOD-I7p.js} +1 -1
- package/dist/assets/registry-BFrgx1tE.js +1 -0
- package/dist/assets/{registry-COkvZrNA.css → registry-BZuT2Epw.css} +1 -1
- package/dist/assets/{registry-CtvKPLd7.js → registry-CD1s3eQ-.js} +1 -1
- package/dist/assets/{registry-NbNNn_ra.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-CkScyZGa.js → registry-GeAC3ZD7.js} +1 -1
- package/dist/assets/{relate-DHPSGB7a.js → relate-BYdM5eiV.js} +1 -1
- package/dist/assets/{replay-zh4xVk5G.js → replay-TYXO0Brm.js} +1 -1
- package/dist/assets/{run-DiPX83_J.js → run-Df10YPyB.js} +1 -1
- package/dist/assets/{run-ByCJN-29.js → run-DlvA3l28.js} +1 -1
- package/dist/assets/{run-BdDyp6Xv.js → run-gmqUaxcL.js} +2 -2
- package/dist/assets/seed-D_P5jyog.js +1 -0
- package/dist/assets/shapes-Cx5SCKgj.js +39 -0
- package/dist/assets/{spokenText-D3iS8fuI.js → spokenText-C88IQJ0M.js} +1 -1
- package/dist/assets/store-CsjDEADX.js +1 -0
- package/dist/assets/theme-7IrMJ70_.js +1 -0
- package/dist/assets/tiles-D-s6v-mA.js +1 -0
- package/dist/assets/types-C42I77wh.js +1 -0
- package/dist/assets/types-DuEbJpIA.js +1 -0
- package/dist/assets/useDashboardLoop-DDqCFJKY.js +5 -0
- package/dist/assets/useDashboards-SRk8LqHe.js +1 -0
- package/dist/assets/useLiveConfig-Cpy0_E_-.js +1 -0
- package/dist/assets/useSpatialCanvas-CfmZOXXP.js +1 -0
- package/dist/assets/{useStudy-B5874Bcg.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-CPsd-xu7.js +1 -0
- package/dist/index.html +14 -13
- 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 +4 -1
- package/dist/assets/AnnotationLayer-DHHGgh8x.js +0 -2
- package/dist/assets/CanvasSkeleton-Bx0s36b_.js +0 -2
- package/dist/assets/CourseLessonReader-DeAuL1tO.js +0 -2
- package/dist/assets/DashboardDetail-CJzB85NC.js +0 -2
- package/dist/assets/DashboardLoopRuntime-CEnUpS-I.js +0 -1
- package/dist/assets/DashboardSettings-CmZWG3US.js +0 -1
- package/dist/assets/DashboardsApp-wCgs98G0.js +0 -2
- package/dist/assets/DemoGallery-Cg0ykVpG.js +0 -1
- package/dist/assets/ExportModal-rxndDhoO.js +0 -2
- package/dist/assets/ExtractionPreview-ChRAimKr.js +0 -18
- package/dist/assets/LiveApp-Bl7WBgqJ.css +0 -1
- package/dist/assets/LiveApp-CUoQgVo1.js +0 -62
- package/dist/assets/PinToDashboard-CSqwDBLD.js +0 -1
- package/dist/assets/PlanReview-ChZeUHQO.js +0 -1
- package/dist/assets/PresentationDeck-Dj9MQVZC.js +0 -1
- package/dist/assets/PrismApp-Dfs6eAuR.js +0 -2
- package/dist/assets/PrismAskController-CSsCkRC8.js +0 -37
- package/dist/assets/PrismOverlay-CGtr7lBl.js +0 -109
- package/dist/assets/RippleApp-DW1rpKHe.js +0 -2
- package/dist/assets/SynthesisApp-C43ZO6Ew.js +0 -2
- package/dist/assets/TopicCanvas-DR26Swr_.js +0 -2
- package/dist/assets/TrackerTile-sYD2MM_4.js +0 -2
- package/dist/assets/WhyMachineOverlay-Nll4Wco-.js +0 -1
- package/dist/assets/canvas-DIs20T9l.js +0 -1
- package/dist/assets/confirmAdd-BDNV8RqF.js +0 -1
- package/dist/assets/dashboards-Dy4MTJQ5.css +0 -1
- package/dist/assets/dataPending-lZUzUEo6.js +0 -1
- package/dist/assets/explode-fgkkWz8o.js +0 -13
- package/dist/assets/format-rPI6ZwwH.js +0 -1
- package/dist/assets/generateBeats-aqKTlSN2.js +0 -1
- package/dist/assets/index-B69GkoTc.css +0 -1
- package/dist/assets/index-D1SPhBGd.js +0 -22
- package/dist/assets/notes-U6gRKVHk.js +0 -1
- package/dist/assets/number-DXgzss0v.js +0 -1
- package/dist/assets/officeDoc-Dn8jw1fG.js +0 -3
- package/dist/assets/portal-t0bsUEg2.js +0 -1
- package/dist/assets/providers-DdJWf_PE.js +0 -1
- package/dist/assets/ready-LSwk88I-.js +0 -1
- package/dist/assets/registry-9QjeHgKs.js +0 -1
- package/dist/assets/registry-CueC1vq1.js +0 -1
- package/dist/assets/registry-CxUmdwDk.js +0 -1
- package/dist/assets/registry-DScSjt8p.css +0 -1
- package/dist/assets/shapes-DI0LQC8n.js +0 -1
- package/dist/assets/store-DpmbKVs7.js +0 -1
- package/dist/assets/theme-f0mztBcq.js +0 -1
- package/dist/assets/tiles-pdNi6MGe.js +0 -1
- package/dist/assets/useDashboardLoop-DuckIfJX.js +0 -5
- package/dist/assets/useDashboards-BMcuCWoz.js +0 -1
- package/dist/assets/useLiveConfig-9eJ7EM3B.js +0 -1
- package/dist/assets/useSpatialCanvas-CtVsYmp8.js +0 -1
- /package/dist/assets/{registry-DLyrLfe-2.js → registry-DLyrLfe-.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=null,t=!1,n=!1,r=0,i=new Map;function a(){if(!(e||n)){if(typeof Worker>`u`){n=!0;return}try{e=new Worker(new URL(`/assets/worker-D7eK-Ya8.js`,``+import.meta.url),{type:`module`}),e.onmessage=e=>{let r=e.data;if(r.type===`ready`)t=!0;else if(r.type===`error`)n=!0,o();else if(r.type===`result`){let e=i.get(r.id);i.delete(r.id),e?.kind===`fit`&&e.resolve(r.fits)}else if(r.type===`embedded`){let e=i.get(r.id);i.delete(r.id),e?.kind===`embed`&&e.resolve(r.vec.length?r.vec:null)}},e.onerror=()=>{n=!0,o()},e.postMessage({type:`init`,base:u,modelId:l})}catch{n=!0}}}function o(){for(let e of i.values())e.resolve(null);i.clear();try{e?.terminate()}catch{}e=null,t=!1}function s(n,o=80){if(a(),!t||!e)return Promise.resolve(null);let s=++r;return new Promise(t=>{let r=setTimeout(()=>{i.delete(s),t(null)},o);i.set(s,{kind:`fit`,resolve:e=>{clearTimeout(r),t(e?new Map(e):null)}}),e.postMessage({type:`fit`,id:s,query:n})})}function c(n,o=80){if(a(),!t||!e)return Promise.resolve(null);let s=++r;return new Promise(t=>{let r=setTimeout(()=>{i.delete(s),t(null)},o);i.set(s,{kind:`embed`,resolve:e=>{clearTimeout(r),t(e)}}),e.postMessage({type:`embed`,id:s,text:n})})}var l=`minishlab/potion-base-8M`,u=`/semantic/`,d=/\b(poems?|haikus?|limericks?|sonnets?|ballads?|rhymes?|riddles?|puns?|jokes?|knock[- ]?knock|tongue[- ]?twisters?|lullab(?:y|ies)|raps?)\b/i,f=/\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 p(e){let t=e.toLowerCase();return d.test(t)||f.test(t)}var m=e=>!p(e),h=/\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/,g=/\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/,_=/\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/,v=[/^[\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 y(e){let t=e.toLowerCase().trim();if(!t)return`rich`;let n=h.test(t);return _.test(t)||g.test(t)?n?`brief`:`rich`:v.some(e=>e.test(t))?`lean`:n?`brief`:`rich`}function b(e){return _.test(e.toLowerCase())}var x=/\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 S(e){return x.test(e.toLowerCase())}function C(e,t){return e===`lean`?`minimal`:t?`low`:`minimal`}var w=[`minimal`,`low`,`medium`,`high`];function T(e,t){let n=w.indexOf(e);return w[Math.min(w.length-1,Math.max(0,n+t))]}function E(e,t,n=`fast`){let r=S(t);return e===`lean`&&!r?`minimal`:T(C(e,r),n===`thorough`?2:+(n===`balanced`))}var D=.1,O=.3,k=.75;function A(e,t,n){return t.creative?k:e===`lean`||S(n)||t.troubleshoot?D:O}var j=140,M=320;function N(e,t){if(e.length<=t)return e;let n=e.slice(0,t-1),r=[...n.matchAll(/[.!?](?=\s|$)/g)].at(-1);if(r&&r.index!==void 0&&r.index>t*.3)return n.slice(0,r.index+1);let i=n.lastIndexOf(` `);return(i>t*.6?n.slice(0,i):n).trimEnd()+`…`}function P(e,t){let n=t===`lean`||t===`brief`?j:M;return N(e.trim(),n)}function F(e){return e===`lean`||e===`brief`?j:M}var I=`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 L(e){return e===`lean`||e===`brief`?`SPOKEN LINE ("narration") — keep it to ONE short sentence (≈${F(e)} characters). Right to the point.`:`SPOKEN LINE ("narration") — at most two or three short sentences (≈${F(`rich`)} characters), like a person talking. The visuals carry the detail; never narrate the whole canvas.`}var R=[{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/}],z=[{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 B(e){if(!e)return``;for(let t=e.length-1;t>=0;t--)if(e[t].role===`user`)return e[t].content;return``}function V(e,t){let n=e.toLowerCase(),r=B(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 R)e.test.test(i)&&(a[e.key]=!0);(a.highStakes||a.reflection)&&(a.serious=!0);for(let e of z)if(e.test.test(i)){a.domain=e.domain;break}return a}function H(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 U=[{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/}],W=[{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 G(e){let t=e.toLowerCase(),n=[];for(let e of W)e.test.test(t)&&n.push(...e.types);return[...new Set(n)]}var K={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 q(e){return K[e]??`a ${e}`}function J(e){return e.length?`FORMAT REQUEST — the user explicitly asked for their answer in a specific FORM: ${[...new Set(e.map(q))].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 Y(e){if(!e)return``;for(let t=e.length-1;t>=0;t--)if(e[t].role===`user`)return e[t].content;return``}function X(e,t){let n=e.toLowerCase(),r=Y(t).toLowerCase(),i={};for(let e of U){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{a as _,H as a,F as c,E as d,y as f,s as g,c as h,V as i,L as l,m,X as n,I as o,b as p,J as r,P as s,G as t,A as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./friendlyAsk-BBdRZIar.js";import{n as t,t as n}from"./contentVault-xfUwSJ3i.js";var r={"15min":15,hourly:60,"6h":360,daily:1440,manual:1/0},i={daily:1440,weekly:10080,"on-change":1/0,manual:1/0};function a(e,t){return Number.isFinite(t)?e+t*6e4:2**53-1}function o(e){return e===`manual`?0:Math.round(43200/r[e])}function s(e,t){let n=e.window;if(n){if(t<n.startAt)return n.startAt;if(t>n.endAt)return 2**53-1}return a(t,r[e.data])}var c=`mavea-dashboards-v1`,l=c,u=`${c}:quota`,d=24,f=4096,p=60,m=null,h=0;function g(){try{let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID()}catch{}return h+=1,`dash-${h.toString(36)}-${Math.floor(Math.random()*1e9).toString(36)}`}function ee(e){let t=JSON.stringify(e,(e,t)=>typeof t==`string`&&t.length>f&&t.startsWith(`data:`)?``:t);return JSON.parse(t)}function _(e){return!!e&&typeof e==`object`}function v(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function y(e,t=``){return typeof e==`string`?e:t}function b(e){return e===`5min`?`15min`:y(e,`manual`)}function te(e){if(!_(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}}function x(e){if(!_(e))return null;let t=(Array.isArray(e.history)?e.history:[]).map(te).filter(e=>e!==null).slice(-60);return{...e,history:t.length?t:void 0}}function S(e){if(!_(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:y(e.label),startAt:t,endAt:n,origin:e.origin===`search`?`search`:`user`}}function C(e){if(!(!_(e)||typeof e.text!=`string`||!e.text))return{text:e.text,at:v(e.at,0)}}function w(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!_(n)||typeof n.expected!=`string`||!n.expected)continue;let e=n.result;(e===`hit`||e===`miss`||e===`unclear`)&&t.push({at:v(n.at,0),expected:n.expected,result:e,...typeof n.note==`string`&&n.note?{note:n.note}:{}})}return t.slice(-20)}function T(e,t){if(!e.window||t<=e.window.endAt)return e;let{window:n,...r}=e;return r}var E=new Set([`thesis`,`alignmentgauge`,`standingalerts`,`sourceslineage`]);function D(e,t,n){let r=n||t;return r?e.map(e=>{if(e.refreshQuery?.trim()||e.metricId||E.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 O(t){if(!_(t))return null;let n=y(t.id);if(!n)return null;let r=_(t.thesis)?t.thesis:null,i=Array.isArray(t.widgets)?t.widgets.filter(e=>_(e)&&_(e.block)):[],a=_(t.cadence)?t.cadence:{},o=_(t.alerts)?t.alerts:{},s=k(t.lastVerdict),c=y(t.title,`Untitled`),l=e(y(t.question)),u=S(a.window),d=C(t.prediction),f=w(t.predictionHistory);return{id:n,title:c,question:l,thesis:{text:y(r?.text),saidAt:v(r?.saidAt,0)},tripwires:Array.isArray(t.tripwires)?t.tripwires:[],metrics:Array.isArray(t.metrics)?t.metrics.map(x).filter(e=>e!==null):[],sources:Array.isArray(t.sources)?t.sources:[],widgets:D(i.slice(0,12),c,l),cadence:{data:b(a.data),ai:y(a.ai,`manual`),...u?{window:u}:{}},smartTrigger:typeof t.smartTrigger!=`boolean`||t.smartTrigger,alerts:{inApp:o.inApp!==!1,push:o.push===!0},...typeof t.topic==`string`&&t.topic?{topic:t.topic}:{},createdAt:v(t.createdAt,0),updatedAt:v(t.updatedAt,0),...typeof t.lastTouchedByUserAt==`number`&&Number.isFinite(t.lastTouchedByUserAt)?{lastTouchedByUserAt:t.lastTouchedByUserAt}:{},nextDataAt:v(t.nextDataAt,0),nextAiAt:v(t.nextAiAt,2**53-1),...typeof t.oneShotAt==`number`&&Number.isFinite(t.oneShotAt)?{oneShotAt:t.oneShotAt,oneShotLabel:y(t.oneShotLabel)}:{},...d?{prediction:d}:{},...f.length?{predictionHistory:f}:{},lastRefreshedAt:typeof t.lastRefreshedAt==`number`&&Number.isFinite(t.lastRefreshedAt)?t.lastRefreshedAt:null,...t.lastDataOutcome===`updated`||t.lastDataOutcome===`no-change`||t.lastDataOutcome===`unverified`?{lastDataOutcome:t.lastDataOutcome}:{},...s?{lastVerdict:s}:{},...typeof t.lastVerdictAttemptAt==`number`&&Number.isFinite(t.lastVerdictAttemptAt)?{lastVerdictAttemptAt:t.lastVerdictAttemptAt}:{},...typeof t.lastVerdictError==`string`&&t.lastVerdictError?{lastVerdictError:t.lastVerdictError}:{}}}function k(e){return!_(e)||typeof e.text!=`string`||!e.text?null:{text:e.text,at:v(e.at,0),grounded:e.grounded===!0,...Array.isArray(e.sources)?{sources:e.sources}:{},...typeof e.tripwireId==`string`?{tripwireId:e.tripwireId}:{}}}var A=!1,j=0;function M(e){return Array.isArray(e)?e.map(O).filter(e=>e!==null):[]}async function N(e){let n=++j;try{if(typeof localStorage>`u`)return;let r=await t(e);if(n!==j)return;localStorage.setItem(c,r)}catch(e){let t=e;if(t&&(t.name===`QuotaExceededError`||t.name===`NS_ERROR_DOM_QUOTA_REACHED`||t.code===22||t.code===1014))try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(u))}catch{}}}function P(){try{if(typeof localStorage>`u`)return[];let e=localStorage.getItem(c);if(!e)return[];let t=M(JSON.parse(e));return t.length&&N(t),t}catch{return[]}}async function F(){try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(c);if(!e)return;try{JSON.parse(e);return}catch{}let t=M(await n(e));if(A)return;m=t,A=!0,typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(l,{detail:t}))}catch{}}var I=F();function L(){return I}function R(){return m??=P(),m}function z(){m=null,A=!1,I=F()}function B(e){return e.length<=d?e:[...e].sort((e,t)=>(t.lastTouchedByUserAt??t.updatedAt)-(e.lastTouchedByUserAt??e.updatedAt)).slice(0,d)}function V(e){let t=M(e);m=t,A=!0,N(t);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(l,{detail:t}))}catch{}}function H(e,t,n=Date.now(),r={}){let i=!1,a=R().map(a=>a.id===e?(i=!0,{...t(a),updatedAt:n,...r.userTouch?{lastTouchedByUserAt:n}:{}}):a);i&&V(a)}var U=null,W=null;function G(){let e=R();return(W!==e||U===null)&&(U=[...e].sort((e,t)=>t.updatedAt-e.updatedAt),W=e),U}function K(e){return R().find(t=>t.id===e)??null}function q(e){V(B([ee({...e,lastTouchedByUserAt:e.lastTouchedByUserAt??e.updatedAt}),...R().filter(t=>t.id!==e.id)]))}function J(e){let t=M(e);if(!t.length)return 0;let n=new Map(R().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 V(B([...n.values()])),t.length}function Y(e){let t=e.now??Date.now();return{id:g(),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 X(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 Z(e,t){H(e,e=>({...e,...t}),void 0,{userTouch:!0})}function ne(e,t,n=Date.now()){H(e,e=>{let r={...e.cadence,...t};return{...e,cadence:r,...t.data===void 0?{}:{nextDataAt:s(r,n)},...t.ai===void 0?{}:{nextAiAt:a(n,i[r.ai])}}},n,{userTouch:!0})}function re(e){let t=R().filter(t=>t.id!==e);t.length!==R().length&&V(t)}function ie(e,t,n){H(e,e=>({...e,widgets:e.widgets.map(e=>e.id===t?{...e,span:n}:e)}),void 0,{userTouch:!0})}function ae(e,t){H(e,e=>({...e,widgets:e.widgets.filter(e=>e.id!==t)}),void 0,{userTouch:!0})}function oe(e,t,n={}){let r=Array.isArray(t)?t:[t];r.length!==0&&H(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=>!E.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(-le)}:{}}},void 0,{userTouch:!0})}function se(e,t,n){let r=n.trim();if(!r||t.length===0)return;let i=new Set(t);H(e,e=>({...e,widgets:e.widgets.map(e=>i.has(e.id)?{...e,refreshQuery:r}:e)}))}function ce(e,t){H(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 le=24;function ue(e,t){H(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 Q(e,t,n){if(n===null)return e;let r=[...e??[],{at:t,value:n}];return r.length>p?r.slice(-60):r}function de(e,t,n,r,i,a=Date.now()){H(e,e=>({...e,metrics:e.metrics.map(e=>e.id===t?{...e,lastValue:n,lastRaw:r,origin:i,asOf:a,history:Q(e.history,a,n)}:e)}),a,{userTouch:i===`user`})}function fe(e,t,n=Date.now()){H(e,e=>({...e,tripwires:t}),n)}function $(e,t,n=Date.now()){H(e,e=>({...e,lastVerdict:t,lastVerdictAttemptAt:n,lastVerdictError:void 0}),n)}function pe(e,t,n){H(e,e=>({...e,lastVerdictAttemptAt:t,lastVerdictError:n}),t)}function me(e,t){H(e,e=>({...e,nextDataAt:t,...e.oneShotAt!==void 0&&e.oneShotAt<t?{oneShotAt:t}:{}}))}function he(e,t=Date.now()){H(e,e=>e.oneShotAt===void 0?{...e,oneShotAt:t,oneShotLabel:`first check`}:e)}function ge(e,t=Date.now()){H(e,e=>({...e,nextAiAt:a(t,i[e.cadence.ai])}))}function _e(e,t,n=Date.now()){H(e,e=>{let r=t?{...e.cadence,window:t}:{...e.cadence,window:void 0};return{...e,cadence:r,nextDataAt:s(r,n)}},n,{userTouch:t?.origin===`user`})}function ve(e,t=Date.now()){H(e,e=>({...e,oneShotAt:void 0,oneShotLabel:void 0}),t)}var ye=3e5;function be(e,t,n=Date.now()){H(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 c=T(e.cadence,n),l=s(c,n),u=t.outcome===`unverified`&&e.lastDataOutcome!==`unverified`&&l!==2**53-1&&(!c.window||n>=c.window.startAt)?Math.min(l,n+ye):l;return{...e,cadence:c,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:Q(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,prediction:a,predictionHistory:o}},n)}export{i as A,se as C,de as D,Z as E,o as M,s as N,fe as O,a as P,ce as S,ne as T,g as _,X as a,_e as b,he as c,G as d,z as f,J as g,pe as h,be as i,r as j,L as k,ue as l,me as m,q as n,ve as o,ge as p,oe as r,Y as s,l as t,K as u,re as v,ie as w,$ as x,ae as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`dark`;function t(){if(typeof localStorage>`u`)return e;try{return localStorage.getItem(`mavea-theme`)===`light`?`light`:e}catch{return e}}function n(e){try{localStorage.setItem(`mavea-theme`,e)}catch{}}function r(e,t=document){t.documentElement.dataset.theme=e}export{t as n,n as r,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
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";var r=e(),i=n(),a=200,o=40,s=3;function c({points:e,tone:t=`flat`}){let n=(0,r.useId)();if(e.length<2)return null;let c=e.map(e=>e.value),l=Math.min(...c),u=Math.max(...c)-l||1,d=194/(e.length-1),f=e.map((e,t)=>({x:s+t*d,y:s+(1-(e.value-l)/u)*34})),p=f.map((e,t)=>`${t===0?`M`:`L`}${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(` `),m=f[0],h=`${p} L${f[f.length-1].x.toFixed(1)},37 L${m.x.toFixed(1)},37 Z`,g=t===`up`?`var(--insight)`:t===`down`?`var(--danger)`:`var(--text-secondary)`;return(0,i.jsxs)(`svg`,{className:`tile-viz-svg`,viewBox:`0 0 ${a} ${o}`,preserveAspectRatio:`none`,role:`presentation`,children:[(0,i.jsx)(`defs`,{children:(0,i.jsxs)(`linearGradient`,{id:n,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:g,stopOpacity:`0.35`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:g,stopOpacity:`0`})]})}),(0,i.jsx)(`path`,{d:h,fill:`url(#${n})`,stroke:`none`}),(0,i.jsx)(`path`,{d:p,fill:`none`,stroke:g,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})]})}var l=t();function u(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 d(e){let t=(0,l.c)(9),{targetAt:n,now:r,label:a}=e,o=n-r,s;t[0]===o?s=t[1]:(s=u(o),t[0]=o,t[1]=s);let c;t[2]===s?c=t[3]:(c=(0,i.jsx)(`span`,{className:`tile-countdown-value`,children:s}),t[2]=s,t[3]=c);let d;t[4]===a?d=t[5]:(d=a&&(0,i.jsx)(`span`,{className:`tile-countdown-label`,children:a}),t[4]=a,t[5]=d);let f;return t[6]!==c||t[7]!==d?(f=(0,i.jsxs)(`div`,{className:`tile-countdown`,children:[c,d]}),t[6]=c,t[7]=d,t[8]=f):f=t[8],f}export{c as n,d as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/liveSchema-B8OByCPH.js","assets/icons-gLFQTv74.js","assets/jsx-runtime-DeHZSEgm.js","assets/rolldown-runtime-DkW27tQK.js","assets/spokenText-D3iS8fuI.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-CgNGx27_.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{O as s,d as c,h as l,i as u,m as d,p as f,u as p,x as m}from"./store-DpmbKVs7.js";import{t as h}from"./providers-DdJWf_PE.js";import{l as g,n as _}from"./useLiveConfig-9eJ7EM3B.js";import{i as v,n as y,r as b}from"./ledger-Cv0LBflx.js";import{i as x,r as ee,t as S}from"./dataPending-lZUzUEo6.js";import{c as te,i as C}from"./format-rPI6ZwwH.js";import{n as ne}from"./number-DXgzss0v.js";import{t as w}from"./json-B0N3XRZU.js";import{t as T}from"./now-C9-UAzTC.js";import{n as re,t as ie}from"./predictions-CkVKHq-5.js";import{t as E}from"./notify-Bz4wuE4T.js";import{a as D,i as O,r as ae,t as oe,u as se}from"./dashboardEvents-BDKxoLch.js";var k=t(),ce=n();function le(e){return new Set(e.toLowerCase().replace(/[^a-z0-9 ]/g,` `).replace(/\s+/g,` `).trim().split(` `).filter(e=>e.length>3))}function A(e){return e.replace(/\s+/g,` `).trim().toLowerCase()}r();function ue(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 de(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 fe(e,t,n){return t===null?`AWAITING`:ue(e.comparator,t,n,e.threshold)?`TRIGGERED`:de(e.comparator,t,e.threshold)?`WATCHING`:`CLEAR`}function j(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=fe(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 M(e){return e.oneShotAt===void 0?e.nextDataAt:Math.min(e.nextDataAt,e.oneShotAt)}function me(e,t=Date.now(),n=4){return e.filter(e=>pe(e,t)).sort((e,t)=>M(e)-M(t)).slice(0,n)}function he(e,t=Date.now()){return e.filter(e=>e.nextAiAt<=t).sort((e,t)=>e.nextAiAt-t.nextAiAt)[0]??null}function N(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 P(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 F(e,t){return(e.sources?.length??0)>0||P(t).length>0}function ge(e){return`- VALUE "${e.label}" — ${e.query}`}function _e(e,t){return`- BLOCK #${t} [${e.block.type}] ${e.refreshQuery}\n current content: ${JSON.stringify(e.block.props??{}).slice(0,600)}`}function I(){return{values:{},widgets:{}}}function ve(e){return{metrics:e.metrics.filter(e=>e.query.trim()!==``&&!e.blankKey),targets:e.widgets.filter(e=>!!e.refreshQuery?.trim())}}function L(e,t,n){return 400+t.length*120+n.length*1200+(e.prediction?150:0)}var ye=12e3;function R(e){let t=[],n=1200;for(let r of e){let{metrics:e,targets:i}=ve(r);if(e.length===0&&i.length===0)continue;let a=L(r,e,i);if(t.length>0&&n+a>ye)break;n+=a,t.push({d:r,metrics:e,targets:i})}return t}function be(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 xe(e,t){let n=[...e.metrics.map(ge),...e.targets.map((e,t)=>_e(e,t)),...e.d.prediction?[`- PREVIOUS EXPECTATION (made ${be(e.d.prediction.at,t)}): "${e.d.prediction.text}" — grade it.`]:[]];return`DASHBOARD ${e.d.id} "${e.d.title}"\n${n.join(`
|
|
3
|
-
`)}`}function Se(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Ce(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(Se(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 we(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 Te(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 Ee=` 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 z(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=h(t.provider),c=new Set(e.flatMap(e=>e.targets.map(e=>e.block.type))),l=c.size>0,u=e.map(e=>xe(e,r)).join(`
|
|
4
|
-
|
|
5
|
-
`),d={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.`},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`]},f=Math.min(14e3,Math.max(3e3,1200+e.reduce((e,t)=>e+L(t.d,t.metrics,t.targets),0)+(n.briefingContext?700:0))),p=T()+` You are checking several standing trackers at once. Return ONLY JSON: {"dashboards": [{"id": string, "values": {...}, "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 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). 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.`,m=`Use web search.\n\n${u}`+(n.briefingContext?`\n\nCONTEXT (already known — do not search these):\n${n.briefingContext}`:``),g=e=>s.generate({system:e?p+Ee:p,history:[],user:m,maxTokens:f,temperature:.15,thinkingLevel:e?`high`:`low`,tools:{webSearch:!0},format:d,...l?{blockTypes:[...c],complexity:`brief`}:{}},t).then(e=>({rr:e,grounded:F(e,a(w(e.raw)))})),_=await g(!1),v=1;!_.grounded&&e.length>0&&(_=await g(!0),v=2);let{rr:y}=_,b=a(w(y.raw)),x=F(y,b),ee=Ce(b,e),S=l?(await i(async()=>{let{validateLiveResponse:e}=await import(`./liveSchema-B8OByCPH.js`);return{validateLiveResponse:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))).validateLiveResponse:null,C={};for(let t of e){let e=ee[t.d.id]??{},n=I();if(x&&t.metrics.length>0){let r=a(e.values),i=new Map(Object.entries(r).map(([e,t])=>[A(e),t]));for(let e of t.metrics){let t=ne(r[e.label]??i.get(A(e.label)));t!==null&&(n.values[e.id]={value:t,raw:te(String(t),e.unit)})}}if(t.targets.length>0&&S){let r=o(e.blocks);t.targets.forEach((e,t)=>{let i=r[t];if(!i)return;let a=S({narration:``,title:`x`,sub:``,blocks:[i]},new Set([e.block.type]),1,x)?.blocks[0];a&&a.type===e.block.type&&(n.widgets[e.id]=a)})}if(x){let r=ie(e.expects);if(r&&(n.expects=r),t.d.prediction){let t=re(e.grade);t&&(n.grade=t)}let i=we(e.disagreement);i&&(n.disagreement=i);let a=Te(e.liveWindow);a&&(n.liveWindow=a)}C[t.d.id]=n}Object.values(C).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 (${x?`empty/unparseable`:`ungrounded after ${v} attempt${v>1?`s`:``}, discarded`})`,{dashboardIds:e.map(e=>e.d.id),raw:y.raw});let E=n.briefingContext&&x&&typeof b.briefing==`string`&&b.briefing.trim()?b.briefing.trim():void 0;return{ok:!0,grounded:x,perDashboard:C,sources:y.sources&&y.sources.length?y.sources:P(b),attempts:v,...E?{briefing:E}:{}}}catch(t){console.error(`[dashboards] refreshDashboards failed`,t);let n={};for(let t of e)n[t.d.id]=I();return{ok:!1,grounded:!1,perDashboard:n,sources:[],attempts:0}}}function De(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 Oe(e){try{let t=typeof e==`string`?JSON.parse(ke(e)):e,n=t?.verdict;return{text:typeof n==`string`&&n.trim()?n.trim():null,sources:De(t)}}catch{return{text:typeof e==`string`&&e.trim()?e.trim():null,sources:[]}}}function ke(e){let t=e.indexOf(`{`),n=e.lastIndexOf(`}`);return t>=0&&n>t?e.slice(t,n+1):e}async function B(e,t,n,r=Date.now()){try{let i=h(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:T()+` 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}=Oe(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}}var V=`mavea-dash-opens-v1`,H=2592e6;function Ae(e){return!!e&&typeof e==`object`}function je(e,t){if(!Ae(e))return{};let n=t-H,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 U;function Me(e){try{if(typeof localStorage>`u`)return{};let t=localStorage.getItem(V);return t?je(JSON.parse(t),e):{}}catch{return{}}}function W(e=Date.now()){return U??=Me(e),U}function Ne(e){U=e;try{typeof localStorage<`u`&&localStorage.setItem(V,JSON.stringify(e))}catch{}}function Pe(e,t=Date.now()){if(!e)return;let n=W(t),r=[...n[e]??[],t].filter(e=>e>=t-H).slice(-30);Ne({...n,[e]:r})}function Fe(e,t,n=Date.now()){return(W(n)[e]??[]).filter(e=>e>=t).length}function G(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 Ie(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=G(i.history);if(o!==0&&o===G(a.history))return{text:`${i.label} and ${a.label} have moved together over the last three checks.`,dashboardIds:[e.id]}}return null}function Le(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 K=5;function Re(e){if(e.cadence.data!==`15min`&&e.cadence.data!==`hourly`)return null;let t=e.metrics.find(e=>(e.history?.length??0)>=K);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 ${K} checks.`,dashboardIds:[e.id]}:null}function ze(e,t){let n=t.note?` ${t.note}`:``;return{text:`Sources disagreed on ${t.metricLabel}: ${t.readings.join(` vs `)}.${n}`,dashboardIds:[e.id]}}var Be=432e5;function Ve(e,t,n){let r=n-Be;return e.some(e=>e.kind===`insight`&&e.at>=r&&e.text===t.text)}function He(e,t,n,r=2){let i=[],a=Le(e,n);a&&i.push(a);for(let t of e){let e=Ie(t);e&&i.push(e);let n=Re(t);n&&i.push(n)}return i.filter(e=>!Ve(t,e,n)).slice(0,r)}var Ue=e({checkAllDashboardsNow:()=>nt,readDashboardNow:()=>rt,refreshDashboardNow:()=>tt,runRefreshBatch:()=>Q,selectTickTargets:()=>it,useDashboardLoop:()=>$,useVerdictPending:()=>qe}),We=15e3,Ge=3e5,q=new Set,J=new Set,Y=`mavea-dashboard-verdict-pending`;function X(e,t){t?J.add(e):J.delete(e);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(Y,{detail:e}))}catch{}}function Ke(e){return window.addEventListener(Y,e),()=>window.removeEventListener(Y,e)}function qe(e){let t=(0,ce.c)(2),n;return t[0]===e?n=t[1]:(n=()=>J.has(e),t[0]=e,t[1]=n),(0,k.useSyncExternalStore)(Ke,n,Je)}function Je(){return!1}function Ye(e){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return``}}function Xe(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 Z=`Daily search budget reached — auto-checks paused until midnight. Manual checks still work.`;function Ze(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function Qe(e){let t=Ze(e);v().some(e=>e.kind===`savings`&&e.at>=t&&e.text===Z)||y({kind:`savings`,text:Z,dashboardIds:[],searches:0})}async function $e(e,t,n,r,i,a,o=!1){let{d:s}=e,c=Object.keys(t.values).length>0||Object.keys(t.widgets).length>0?`updated`:o?`unverified`:`no-change`,d=s.metrics.map(e=>{let n=t.values[e.id];return n?{...e,lastValue:n.value}:e}),p={...s,metrics:d},{tripwires:h,newlyTriggered:g}=j(p,n),_=s.oneShotAt!==void 0&&s.oneShotAt<=a;u(s.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:h,outcome:c,...t.expects?{expects:t.expects}:{},...t.grade?{grade:t.grade}:{},..._?{consumedOneShot:!0}:{}},a),g.length&&(E(p,g),y({kind:`alert`,text:`${g.map(e=>e.label).join(`, `)} crossed the line you set.`,dashboardIds:[s.id],searches:0}),p.alerts.inApp&&oe({dashboardId:s.id,dashboardTitle:s.title,tripwireLabel:g[0].label})),t.disagreement&&y({kind:`insight`,text:ze(s,t.disagreement).text,dashboardIds:[s.id],searches:0});let v={...s,tripwires:h},b=N(v,g,a);if(b.fire&&b.trigger&&i){X(s.id,!0);let e=await B(v,b.trigger,r,a);X(s.id,!1),e?m(s.id,e,a):l(s.id,a,`Mavéa couldn't get a fresh read — will try again.`),f(s.id,a),y({kind:b.trigger===`scheduled`?`check`:`alert`,text:e?e.text.slice(0,200):`Couldn't get a fresh read on ${s.title}.`,dashboardIds:[s.id],searches:1,...e?.sources?.length?{sourceCount:e.sources.length}:{}})}else b.fire&&b.trigger&&f(s.id,a);return c}async function Q(e,t,n,r={}){let i=Date.now(),a={},o=R(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 $e({d:e,metrics:[],targets:[]},{values:{},widgets:{}},c[e.id],t,n,i);if(o.length===0||!n)return a;let l=o.map(e=>e.d.id);S(l,!0);try{let e=await z(o,t,r.briefing?{briefingContext:r.briefing.context}:{});if(!e.ok){for(let e of o)d(e.d.id,i+Ge),a[e.d.id]=`failed`;return a}for(let r of o){let o=e.perDashboard[r.d.id]??{values:{},widgets:{}};a[r.d.id]=await $e(r,o,c[r.d.id],t,n,i,!e.grounded)}r.briefing&&e.briefing&&(D(e.briefing,r.briefing.allDashboards,i),y({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=>Ye(e.url)))].filter(Boolean);return y({kind:`check`,text:Xe(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{S(l,!1)}}async function et(e,t,n,r){let{tripwires:i,newlyTriggered:a}=j(e);s(e.id,i,r),a.length&&(E(e,a),e.alerts.inApp&&oe({dashboardId:e.id,dashboardTitle:e.title,tripwireLabel:a[0].label}));let o={...e,tripwires:i},c=N(o,a,r);if(!c.fire||!c.trigger||!n)return;X(e.id,!0);let u=await B(o,c.trigger,t,r);X(e.id,!1),u?m(e.id,u,r):l(e.id,r,`Mavéa couldn't get a fresh read — will try again.`),f(e.id,r),y({kind:c.trigger===`scheduled`?`check`:`alert`,text:u?u.text.slice(0,200):`Couldn't get a fresh read on ${e.title}.`,dashboardIds:[e.id],searches:1,...u?.sources?.length?{sourceCount:u.sources.length}:{}})}async function tt(e){if(q.has(e))return`busy`;let t=p(e);if(!t)return`busy`;let n=g(_());if(!n.apiKey)return`no-model`;q.add(e);try{let r=await Q([t],n,!0,{manual:!0});return r[e]===`failed`?`failed`:r[e]===`unverified`?`unverified`:`done`}finally{q.delete(e)}}async function nt(){let e=g(_());if(!e.apiKey)return`no-model`;let t=c().filter(C),n=t.filter(e=>!q.has(e.id));if(n.length===0)return t.length>0?`busy`:`done`;for(;n.length>0;){let t=R(n);if(t.length===0)break;let r=t.map(e=>e.d.id);r.forEach(e=>q.add(e));try{await Q(t.map(e=>e.d),e,!0,{manual:!0})}finally{r.forEach(e=>q.delete(e))}n=n.filter(e=>!r.includes(e.id))}return`done`}async function rt(e){if(J.has(e))return`busy`;let t=p(e);if(!t)return`failed`;let n=g(_());if(!n.apiKey)return`no-model`;let r=Date.now(),i=t.tripwires.find(e=>e.state===`TRIGGERED`),a=i??`scheduled`;X(e,!0);let o;try{o=await B(t,a,n,r)}finally{X(e,!1)}return o?m(e,o,r):l(e,r,`Mavéa couldn’t get a fresh read — try again in a moment.`),f(e,r),y({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 it(e,t,n,r,i){let a=me(e,r).filter(e=>!i.has(e.id)),o=he(e,r);o&&i.has(o.id)&&(o=null);let s=ee(t,n,r),c=!1;s.paused&&(c=a.some(C)||!!o,a=a.filter(e=>!C(e)),o=null);let l=R(a);return o&&l.some(e=>e.d.id===o.id)&&(o=null),{dueData:a,dueAi:o,pausedAndBlocked:c}}function $(){let e=(0,k.useRef)(!1);(0,k.useEffect)(()=>{let t=!0,n=async()=>{if(e.current||!t||typeof document<`u`&&document.visibilityState!==`visible`)return;let n=g(_()),r=!!n.apiKey,i=Date.now(),a=c(),o=x(),s=v();se(a,s,e=>b(s,e,i),e=>Fe(e,i-6048e5,i),i);for(let e of He(a,s,i))y({kind:`insight`,text:e.text,dashboardIds:e.dashboardIds,searches:0});let{dueData:l,dueAi:u,pausedAndBlocked:d}=it(a,s,o.dailySearchBudget,i,q);d&&Qe(i);let f=r&&o.briefingEnabled&&ae(i);if(l.length===0&&!u){if(f&&!a.some(C)){let e=O(a,new Set);if(e){let t=await z([],n,{briefingContext:e});t.briefing&&(D(t.briefing,a,i),y({kind:`briefing`,text:`Morning briefing compiled.`,dashboardIds:[],searches:1}))}}return}e.current=!0,l.forEach(e=>q.add(e.id)),u&&q.add(u.id);try{if(l.length>0){let e=f?{context:O(a,new Set(R(l).map(e=>e.d.id))),allDashboards:a}:void 0;await Q(l,n,r,e?{briefing:e}:{})}u&&await et(u,n,r,i)}finally{l.forEach(e=>q.delete(e.id)),u&&q.delete(u.id),e.current=!1}},r=window.setInterval(()=>void n(),We),i=()=>{document.visibilityState===`visible`&&n()};return document.addEventListener(`visibilitychange`,i),n(),()=>{t=!1,window.clearInterval(r),document.removeEventListener(`visibilitychange`,i)}},[])}export{qe as a,le as c,Ue as i,A as l,tt as n,Pe as o,$ as r,j as s,rt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{d as t,f as n,t as r}from"./store-DpmbKVs7.js";var i=e();function a(e){let t=t=>{(t.key===null||t.key===`mavea-dashboards-v1`)&&(n(),e())};return window.addEventListener(r,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(r,e),window.removeEventListener(`storage`,t)}}function o(){return(0,i.useSyncExternalStore)(a,t)}export{o as t};
|
|
@@ -1 +0,0 @@
|
|
|
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-DdJWf_PE.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,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),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`,`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),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,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 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";var n=e(),r=t(),i={min:.1,max:4};function a(e,t=i){return Math.min(t.max,Math.max(t.min,e))}function o(e,t,n=0){let r=Math.max(e.w,1),i=Math.max(e.h,1),a=Math.max(t.w-n*2,1),o=Math.max(t.h-n*2,1);return Math.min(a/r,o/i)}function s(e,t,n=0,r=i){let s=a(o(e,t,n),r),c=e.x+e.w/2,l=e.y+e.h/2;return{x:t.w/2-c*s,y:t.h/2-l*s,scale:s}}function c(e,t,n,r,o=i){let s=a(e.scale*t,o);if(s===e.scale)return e;let c=(n-e.x)/e.scale,l=(r-e.y)/e.scale;return{x:n-c*s,y:r-l*s,scale:s}}function l(e,t,n){return{...e,x:e.x+t,y:e.y+n}}function u(e,t,n,r,o=i){let s=a(n,o);return{x:r.w/2-e*s,y:r.h/2-t*s,scale:s}}function d(e){return`translate(${Math.round(e.x)}px, ${Math.round(e.y)}px) scale(${e.scale})`}function f(e,t,n){return{x:(t-e.x)/e.scale,y:(n-e.y)/e.scale}}function p(e){let t=(0,r.c)(27),a;t[0]===e?a=t[1]:(a=e===void 0?{}:e,t[0]=e,t[1]=a);let o=a,u=o.clamp?.min??i.min,f=o.clamp?.max??i.max,p=o.margin??0,m=o.insetBottom??0,h=(0,n.useRef)(null),g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g={x:0,y:0,scale:1},t[2]=g):g=t[2];let[_,v]=(0,n.useState)(g),y=(0,n.useRef)(null),b;t[3]===m?b=t[4]:(b=()=>{let e=h.current;if(!e)return null;let t=e.getBoundingClientRect();return t.width===0&&t.height===0?null:{w:t.width,h:Math.max(1,t.height-m)}},t[3]=m,t[4]=b);let x=b,S;t[5]!==f||t[6]!==u||t[7]!==p||t[8]!==x?(S=e=>{if(y.current=e,!e)return;let t=x();t&&v(s(e,t,p,{min:u,max:f}))},t[5]=f,t[6]=u,t[7]=p,t[8]=x,t[9]=S):S=t[9];let C=S,w;t[10]!==f||t[11]!==u?(w=(e,t,n)=>{let r=h.current;if(!r)return;let i=r.getBoundingClientRect();v(r=>c(r,e,t-i.left,n-i.top,{min:u,max:f}))},t[10]=f,t[11]=u,t[12]=w):w=t[12];let T=w,E;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(E=(e,t)=>{v(n=>l(n,e,t))},t[13]=E):E=t[13];let D=E,O,k;t[14]!==f||t[15]!==u||t[16]!==p||t[17]!==x?(O=()=>{let e=h.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>{let e=y.current;if(!e)return;let t=x();t&&v(s(e,t,p,{min:u,max:f}))})});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},k=[x,p,u,f],t[14]=f,t[15]=u,t[16]=p,t[17]=x,t[18]=O,t[19]=k):(O=t[18],k=t[19]),(0,n.useEffect)(O,k);let A;t[20]===_?A=t[21]:(A=d(_),t[20]=_,t[21]=A);let j;return t[22]!==_||t[23]!==C||t[24]!==A||t[25]!==T?(j={camera:_,transform:A,viewportRef:h,fitTo:C,zoomAtClient:T,pan:D,setCamera:v},t[22]=_,t[23]=C,t[24]=A,t[25]=T,t[26]=j):j=t[26],j}export{u as n,f as r,p as t};
|
|
File without changes
|