@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
|
@@ -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";import{B as r,a as i,d as a,f as o,x as s,z as c}from"./store-B39HvB_l.js";import{c as l}from"./useDashboardLoop-B_YA5jLs.js";import{i as u,n as d,r as f}from"./confirmAdd-CZPBG1xe.js";/* empty css *//* empty css */import{t as ee}from"./relate-BXcg3Ioz.js";var p=e(),m=t();function h(e){return e*4}function g(e,t,n,r={}){let i=`template:${e.id}`,a=new Map,o=[];e.metrics.forEach((e,i)=>{if(r.metrics?.[i]===!1)return;let s=`m-${n}-${i}`,c=e.label(t);a.set(i,s),o.push({id:s,label:c,query:e.query(t),...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},lastValue:null,origin:`empty`})});let s=[];e.tripwires.forEach((e,i)=>{if(!(r.tripwires?.[i]??e.enabledByDefault))return;let o=a.get(e.metricIndex);if(!o)return;let c=e.label(t);s.push({id:`t-${n}-${i}`,label:c,metricId:o,comparator:e.comparator,threshold:e.threshold,...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},state:`AWAITING`})});let c=[],l=[];return e.widgets.forEach((e,s)=>{if(r.widgets?.[s]===!1)return;if(e.metricIndex!==void 0){let t=a.get(e.metricIndex);if(!t)return;let r=o.find(e=>e.id===t);c.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:h(e.span),id:`wblk-${n}-${s}`,num:String(c.length+1),props:{title:r.label,stat:`—`,conf:`inferred`,summary:r.sourceQuote.text}},span:e.span,metricId:t,fromSource:i});return}let u=e.refreshQuery?.(t),d=e.seedProps?.(t)??{};l.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:h(e.span),id:`wblk-${n}-${s}`,props:u?{title:u,...d}:d},span:e.span,fromSource:i,...u?{refreshQuery:u}:{}})}),{metrics:o,tripwires:s,widgets:[...c,...l]}}function te(e,t,n={}){let i=n.now??Date.now(),a=`template:${e.id}`,o=e.title(t),{metrics:c,tripwires:l,widgets:u}=g(e,t,i,n.toggles),d=l.length>0,f={id:`w-thesis`,block:{type:`thesis`,col:8,id:`w-thesis`,props:{reasoning:e.thesis(t)}},span:2,fromSource:a},ee={id:`w-align`,block:{type:`alignmentgauge`,col:4,id:`w-align`,props:{pct:null}},span:1,fromSource:a},p={id:`w-alerts`,block:{type:`standingalerts`,col:4,id:`w-alerts`,props:{alerts:[]}},span:1,fromSource:a},m={id:`w-sources`,block:{type:`sourceslineage`,col:8,id:`w-sources`,props:{rows:[]}},span:2,fromSource:a},h=n.cadence??e.cadence,te=c.some(e=>e.query.trim()!==``&&!e.blankKey)||u.some(e=>e.refreshQuery?.trim());return{id:s(),title:o,question:o,thesis:{text:e.thesis(t),saidAt:i},tripwires:l,metrics:c,sources:[{kind:`ORIGIN`,conversationId:a,title:e.label,contributed:`Started from the '${e.label}' template.`,at:i}],widgets:[...d?[f,ee]:[],...u,...d?[p]:[],m],cadence:h,smartTrigger:d,alerts:{inApp:!0,push:!1},...e.topic?{topic:e.topic}:{},createdAt:i,updatedAt:i,nextDataAt:r(h,i),nextAiAt:2**53-1,lastRefreshedAt:null,...te?{oneShotAt:i,oneShotLabel:`first check`}:{}}}function ne(e,t,n,r=Date.now()){let i=new Set(e.metrics.map(e=>l(e.label))),a=new Set(e.tripwires.map(e=>l(e.label))),s=g(t,n,r),c=s.metrics.filter(e=>!i.has(l(e.label))),u=new Set(c.map(e=>e.id)),d=s.tripwires.filter(e=>u.has(e.metricId)&&!a.has(l(e.label))),f=s.widgets.filter(e=>!e.metricId||u.has(e.metricId)),ee=c.length+d.length,p=[];c.length&&p.push(`${c.length} metric${c.length>1?`s`:``}`),d.length&&p.push(`${d.length} alert${d.length>1?`s`:``}`);let m={kind:`ADDED`,conversationId:`template:${t.id}`,title:t.label,contributed:p.length?`Added: ${p.join(` + `)}`:`Linked the '${t.label}' template.`,at:r};return o(e.id,{metrics:c,tripwires:d,widgets:f,source:m}),ee}var _={chart:{labels:[],series:[]},scoreboard:{games:[]},standings:{rows:[]},forecast:{days:[]},list:{items:[]},timeline:{events:[]}};function re(e){return{id:`plan`,label:`Track anything`,blurb:``,input:{key:`ask`,label:`Track`,placeholder:``},title:()=>e.title,thesis:()=>`Tracking ${e.title}.`,metrics:e.metrics.map(e=>({label:()=>e.label,query:()=>e.query,...e.unit?{unit:e.unit}:{}})),tripwires:[],widgets:[...e.metrics.map((e,t)=>({blockType:`insight`,span:1,metricIndex:t})),...e.widgets.map(e=>({blockType:e.blockType,span:e.span,refreshQuery:()=>e.query,seedProps:()=>({..._[e.blockType]??{}})}))],cadence:{data:e.cadence,ai:`manual`}}}var v=n(),ie={"15min":`checks every 15 minutes while open`,hourly:`checks hourly while open`,"6h":`checks every 6 hours while open`,daily:`checks daily while open`,manual:`refreshes only when you ask`};function ae(e,t){let n=[...e];return n[t]=!n[t],n}function oe(e){let t=(0,m.c)(102),{plan:n,ask:r,existing:o,onDone:s}=e,[l,h]=(0,p.useState)(n.title),g;t[0]===n.metrics?g=t[1]:(g=()=>n.metrics.map(le),t[0]=n.metrics,t[1]=g);let[_,oe]=(0,p.useState)(g),y;t[2]===n.widgets?y=t[3]:(y=()=>n.widgets.map(ce),t[2]=n.widgets,t[3]=y);let[b,de]=(0,p.useState)(y),[x,fe]=(0,p.useState)(null),[S,pe]=(0,p.useState)(`manual`),me;t[4]===_?me=t[5]:(me=_.filter(Boolean),t[4]=_,t[5]=me);let he=me.length,C;t[6]===b?C=t[7]:(C=b.filter(Boolean),t[6]=b,t[7]=C);let w=he+C.length,ge=c(S),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(null),k=(0,p.useRef)(!0),A,j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>(k.current=!0,()=>{k.current=!1}),j=[],t[8]=A,t[9]=j):(A=t[8],j=t[9]),(0,p.useEffect)(A,j);let M;t[10]!==r||t[11]!==S||t[12]!==T||t[13]!==w||t[14]!==_||t[15]!==l||t[16]!==s||t[17]!==n||t[18]!==b?(M=async()=>{if(w===0||T)return;let e=re(n),t=[...n.metrics.map(se),...b],a=te(e,r.trim(),{toggles:{metrics:_,widgets:t},cadence:{data:S,ai:`manual`}});a.title=l.trim()||a.title,a.question=r.trim(),i(a),E(!0),O(null);let o=await u(a.id,null);if(k.current){if(E(!1),o!==`confirmed`){O(f(o));return}s(a.id)}},t[10]=r,t[11]=S,t[12]=T,t[13]=w,t[14]=_,t[15]=l,t[16]=s,t[17]=n,t[18]=b,t[19]=M):M=t[19];let N=M,P;t[20]!==r||t[21]!==T||t[22]!==s||t[23]!==n?(P=async e=>{if(T)return;let t=d(e);ne(e,re(n),r.trim()),a(e.id),E(!0),O(null);let i=await u(e.id,t);if(k.current){if(E(!1),i!==`confirmed`){O(f(i));return}s(e.id)}},t[20]=r,t[21]=T,t[22]=s,t[23]=n,t[24]=P):P=t[24];let _e=P,F;t[25]!==r||t[26]!==N||t[27]!==o||t[28]!==n.title?(F=()=>{let e=ee(o,{text:`${n.title} ${r}`});if(e){fe(e);return}N()},t[25]=r,t[26]=N,t[27]=o,t[28]=n.title,t[29]=F):F=t[29];let ve=F;if(x){let e;t[30]===x.title?e=t[31]:(e=(0,v.jsxs)(`p`,{className:`tpl-interstitial-text`,children:[`This looks related to your existing “`,x.title,`” dashboard — fold this in instead of creating a new one?`]}),t[30]=x.title,t[31]=e);let n;t[32]!==_e||t[33]!==x?(n=()=>void _e(x),t[32]=_e,t[33]=x,t[34]=n):n=t[34];let r=T?`Confirming live data…`:`Fold into “${x.title}”`,i;t[35]!==T||t[36]!==n||t[37]!==r?(i=(0,v.jsx)(`button`,{type:`button`,className:`tpl-fold-btn`,disabled:T,onClick:n,children:r}),t[35]=T,t[36]=n,t[37]=r,t[38]=i):i=t[38];let a;t[39]===N?a=t[40]:(a=()=>void N(),t[39]=N,t[40]=a);let o;t[41]!==T||t[42]!==a?(o=(0,v.jsx)(`button`,{type:`button`,className:`tpl-create-anyway`,disabled:T,onClick:a,children:`Create new anyway`}),t[41]=T,t[42]=a,t[43]=o):o=t[43];let s;t[44]!==i||t[45]!==o?(s=(0,v.jsxs)(`div`,{className:`tpl-interstitial-actions`,children:[i,o]}),t[44]=i,t[45]=o,t[46]=s):s=t[46];let c;t[47]===T?c=t[48]:(c=T&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:`Checking a live source before this joins your board — a search can take up to a minute. You can close this; the result lands in your check log either way.`}),t[47]=T,t[48]=c);let l;t[49]===D?l=t[50]:(l=D&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:D}),t[49]=D,t[50]=l);let u;return t[51]!==e||t[52]!==s||t[53]!==c||t[54]!==l?(u=(0,v.jsxs)(`div`,{className:`tpl-interstitial`,children:[e,s,c,l]}),t[51]=e,t[52]=s,t[53]=c,t[54]=l,t[55]=u):u=t[55],u}let I;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,v.jsx)(`span`,{className:`xt-section-label`,children:`Dashboard name`}),t[56]=I):I=t[56];let L;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>h(e.target.value),t[57]=L):L=t[57];let R;t[58]===l?R=t[59]:(R=(0,v.jsxs)(`label`,{className:`tpl-field`,children:[I,(0,v.jsx)(`input`,{className:`xt-name`,value:l,onChange:L,"aria-label":`Dashboard name`})]}),t[58]=l,t[59]=R);let z;t[60]!==_||t[61]!==n.metrics?(z=n.metrics.length>0&&(0,v.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,v.jsx)(`span`,{className:`xt-section-label`,children:`Numbers to watch`}),(0,v.jsx)(`div`,{className:`tpl-chips`,children:n.metrics.map((e,t)=>(0,v.jsx)(ue,{kind:`METRIC`,label:e.label,detail:e.query,on:_[t]??!0,onToggle:()=>oe(e=>ae(e,t))},`m${t}`))})]}),t[60]=_,t[61]=n.metrics,t[62]=z):z=t[62];let B;t[63]!==n.widgets||t[64]!==b?(B=n.widgets.length>0&&(0,v.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,v.jsx)(`span`,{className:`xt-section-label`,children:`Live cards`}),(0,v.jsx)(`div`,{className:`tpl-chips`,children:n.widgets.map((e,t)=>(0,v.jsx)(ue,{kind:`CARD`,label:e.query,detail:e.blockType,on:b[t]??!0,onToggle:()=>de(e=>ae(e,t))},`w${t}`))})]}),t[63]=n.widgets,t[64]=b,t[65]=B):B=t[65];let V;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,v.jsx)(`span`,{className:`xt-section-label`,children:`How often`}),t[66]=V):V=t[66];let ye=`tpl-chip xt-comp--goal${S===`manual`?``:` tpl-chip-off`}`,be=S===`manual`,H,U;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>pe(`manual`),U=(0,v.jsx)(`span`,{className:`tpl-chip-label`,children:`Manual — only when you ask`}),t[67]=H,t[68]=U):(H=t[67],U=t[68]);let W;t[69]!==ye||t[70]!==be?(W=(0,v.jsx)(`button`,{type:`button`,className:ye,"aria-pressed":be,onClick:H,children:U}),t[69]=ye,t[70]=be,t[71]=W):W=t[71];let G;t[72]!==S||t[73]!==n.cadence?(G=n.cadence!==`manual`&&(0,v.jsx)(`button`,{type:`button`,className:`tpl-chip xt-comp--metric${S===n.cadence?``:` tpl-chip-off`}`,"aria-pressed":S===n.cadence,onClick:()=>pe(n.cadence),title:ie[n.cadence],children:(0,v.jsxs)(`span`,{className:`tpl-chip-label`,children:[`Suggested — `,ie[n.cadence]]})}),t[72]=S,t[73]=n.cadence,t[74]=G):G=t[74];let K;t[75]!==W||t[76]!==G?(K=(0,v.jsxs)(`div`,{className:`tpl-chip-group`,children:[V,(0,v.jsxs)(`div`,{className:`tpl-chips`,children:[W,G]})]}),t[75]=W,t[76]=G,t[77]=K):K=t[77];let xe=ge>0?`≈ ${ge} searches/mo on your key, at this cadence.`:`No standing searches — this refreshes only when you ask.`,q;t[78]===xe?q=t[79]:(q=(0,v.jsx)(`p`,{className:`dash-plan-estimate`,children:xe}),t[78]=xe,t[79]=q);let Se=ie[S],J;t[80]===Se?J=t[81]:(J=(0,v.jsx)(`span`,{className:`tpl-cadence-note`,children:Se}),t[80]=Se,t[81]=J);let Ce=w===0||T,we=T?`Confirming live data…`:`Create dashboard →`,Y;t[82]!==ve||t[83]!==Ce||t[84]!==we?(Y=(0,v.jsx)(`button`,{type:`button`,className:`tpl-create`,onClick:ve,disabled:Ce,children:we}),t[82]=ve,t[83]=Ce,t[84]=we,t[85]=Y):Y=t[85];let X;t[86]!==J||t[87]!==Y?(X=(0,v.jsxs)(`div`,{className:`xt-build-row`,children:[J,Y]}),t[86]=J,t[87]=Y,t[88]=X):X=t[88];let Z;t[89]===T?Z=t[90]:(Z=T&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:`Checking a live source before this joins your board — a search can take up to a minute. You can close this; the result lands in your check log either way.`}),t[89]=T,t[90]=Z);let Q;t[91]===D?Q=t[92]:(Q=D&&(0,v.jsx)(`p`,{className:`tpl-cadence-note`,children:D}),t[91]=D,t[92]=Q);let $;return t[93]!==R||t[94]!==z||t[95]!==B||t[96]!==K||t[97]!==q||t[98]!==X||t[99]!==Z||t[100]!==Q?($=(0,v.jsxs)(`div`,{className:`tpl-form`,children:[R,z,B,K,q,X,Z,Q]}),t[93]=R,t[94]=z,t[95]=B,t[96]=K,t[97]=q,t[98]=X,t[99]=Z,t[100]=Q,t[101]=$):$=t[101],$}function se(){return!0}function ce(){return!0}function le(){return!0}function ue(e){let t=(0,m.c)(14),{kind:n,label:r,detail:i,on:a,onToggle:o}=e,s=`tpl-chip xt-comp--${n===`METRIC`?`metric`:`goal`}${a?``:` tpl-chip-off`}`,c;t[0]===n?c=t[1]:(c=(0,v.jsx)(`span`,{className:`tpl-chip-kind`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,v.jsx)(`span`,{className:`tpl-chip-label`,children:r}),t[2]=r,t[3]=l);let u=a?`Included ✓`:`Removed ✕`,d;t[4]===u?d=t[5]:(d=(0,v.jsx)(`span`,{className:`tpl-chip-state`,children:u}),t[4]=u,t[5]=d);let f;return t[6]!==i||t[7]!==a||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==d?(f=(0,v.jsxs)(`button`,{type:`button`,className:s,onClick:o,"aria-pressed":a,title:i,children:[c,l,d]}),t[6]=i,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d,t[13]=f):f=t[13],f}export{oe as PlanReview};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReplayCard-CKo5reXy.js","assets/rolldown-runtime-DkW27tQK.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/jsx-runtime-DeHZSEgm.js","assets/preload-helper-CiWYd9n-.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/index-CfcUMOBf.js","assets/useInView-CXTOAEV3.js","assets/coreIcons-BzqW7Qiz.js","assets/theme-7IrMJ70_.js","assets/index-D4FIsool.css","assets/icons-gLFQTv74.js","assets/annotationReel-K2FYv-3B.js","assets/registry-Dd1lcXrO.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/spokenText-C88IQJ0M.js","assets/ReplayCard-Cs6mzTRa.css"])))=>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{t as r}from"./jsx-runtime-DeHZSEgm.js";import{n as i,t as a}from"./preload-helper-CiWYd9n-.js";import{it as o}from"./index-CfcUMOBf.js";import{n as s}from"./icons-gLFQTv74.js";import{a as c,c as l,i as u,l as d,o as f,r as p,s as m,t as h,u as g}from"./CanvasSkeleton-CcHXJqdq.js";import{n as _,t as v}from"./FallbackCard-ap_4wOfj.js";import{n as y,t as b}from"./blockLabel-FogyzEQY.js";import{t as x}from"./useFocusTrap-DBtkeyRy.js";import{t as S}from"./motion-BY_Egaxm.js";import{i as C,n as w,t as T}from"./useSpatialCanvas-CfmZOXXP.js";import{t as E}from"./richText-BkxJhl9N.js";import{t as D}from"./toast-BBNs2h3L.js";import{i as O,r as k}from"./format-q0LwBjID.js";import{t as A}from"./safeImageUrl-BINWXOTz.js";import{t as j}from"./useValidatedImage-BQi2c66o.js";import{n as M,t as N}from"./layout-CEoNLr-w.js";import{i as P,r as F,t as I}from"./catalog-BHjl-1uH.js";import{n as L}from"./http-Lar_UMKb.js";import{n as ee}from"./lib-B7OE1ZQQ.js";var R=t();function te(e){let t=l(e),n=Array.from(t).sort().join(`,`),[r,i]=(0,R.useState)(()=>d(t));return(0,R.useEffect)(()=>{if(d(t)){i(!0);return}i(!1);let e=!0;return g(n.split(`,`)).then(()=>{e&&i(!0)}),()=>{e=!1}},[n]),r}var z=n(),B=null,V=new WeakMap;function ne(){return typeof ResizeObserver>`u`?null:(B||=new ResizeObserver(e=>{for(let t of e)V.get(t.target)?.()}),B)}function H(e,t){let n=ne();return n?(V.set(e,t),n.observe(e),()=>{n.unobserve(e),V.delete(e)}):()=>{}}var U=r(),W=new Set([`hidden`,`clip`,`auto`,`scroll`]);function G(e){let t=(0,z.c)(14),{children:n,maxAspect:r,className:i}=e,a=(0,R.useRef)(null),o=(0,R.useRef)(null),[s,c]=(0,R.useState)(1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=a.current,t=o.current;if(!e||!t)return;let n=()=>{let n=e.clientWidth;if(!n)return;let r=t.querySelectorAll(`*`),i=t.style.transform;t.style.transform=`none`;let a=[];for(let e of r){let t=getComputedStyle(e);(W.has(t.overflowX)||W.has(t.overflowY)||t.webkitLineClamp!==`none`)&&a.push(e)}let o=[];for(let e of a)o.push({el:e,o:e.style.overflow,c:e.style.webkitLineClamp}),e.style.overflow=`visible`,e.style.webkitLineClamp=`unset`;let s=t.scrollWidth;for(let e of r)e.scrollWidth>s&&(s=e.scrollWidth);for(let e of o)e.el.style.overflow=e.o,e.el.style.webkitLineClamp=e.c;if(t.style.transform=i,!s||s<=n+1){c(re);return}let l=n/s,u=Math.max(.4,Math.floor(l*1e3)/1e3);c(e=>Math.abs(e-u)>.002?u:e)};return n(),H(e,n)},t[0]=l):l=t[0];let u;t[1]===n?u=t[2]:(u=[n],t[1]=n,t[2]=u),(0,R.useLayoutEffect)(l,u);let d=s<1,f=`fit-box`+(i?` `+i:``),p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p={contentVisibility:`auto`,containIntrinsicSize:`auto 200px`},t[3]=p):p=t[3];let m;t[4]!==s||t[5]!==r||t[6]!==d?(m=d?{transformOrigin:`top left`,transform:`scale(${s})`,width:`${100/s}%`,marginBottom:`calc(${s-1} * 100%)`,...r?{maxHeight:`calc(${r} * 100cqw)`,overflow:`hidden`}:{}}:void 0,t[4]=s,t[5]=r,t[6]=d,t[7]=m):m=t[7];let h;t[8]!==n||t[9]!==m?(h=(0,U.jsx)(`div`,{ref:o,style:m,children:n}),t[8]=n,t[9]=m,t[10]=h):h=t[10];let g;return t[11]!==f||t[12]!==h?(g=(0,U.jsx)(`div`,{ref:a,className:f,style:p,children:h}),t[11]=f,t[12]=h,t[13]=g):g=t[13],g}function re(e){return e===1?e:1}var K=new Set([`gridtrace`,`chronologicaltimeline`,`roadmap`,`matrix`,`sparktable`,`gantt`]),ie=`mavea-bloom-mode`,ae=ie,q=!0,J=null;function oe(){try{if(typeof localStorage>`u`)return q;let e=localStorage.getItem(ie);return e===`on`||e!==`off`&&q}catch{return q}}function se(){return J===null&&(J=oe()),J}function ce(e){J=e;try{typeof localStorage<`u`&&localStorage.setItem(ie,e?`on`:`off`)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(ae))}catch{}}function le(){let[e,t]=(0,R.useState)(()=>se());return(0,R.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(se());return window.addEventListener(ae,e),()=>window.removeEventListener(ae,e)},[]),[e,(0,R.useCallback)(ce,[])]}var Y=o(),X=260,Z=56,Q={min:.2,max:3};function ue(e){return e.col>=10?640:e.col>=7?500:360}function $(e){return Math.max(1,Math.min(e,Math.round(Math.sqrt(e*1.3))))}function de(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=[];for(let a=0;a<r;a++){let r=X;for(let i=0;i<n;i++){let o=a*n+i;o<e.length&&(r=Math.max(r,t[o]||X))}i[a]=r}let a=[],o=0;for(let e=0;e<r;e++)a[e]=o,o+=i[e]+Z;let s=[];for(let t=0;t<r;t++){let r=[];for(let i=0;i<n;i++){let a=t*n+i;a<e.length&&r.push(a)}t%2==1&&r.reverse(),s[t]=r}let c=s.map(t=>t.reduce((t,n)=>t+ue(e[n]),0)+Math.max(0,t.length-1)*Z),l=Math.max(...c,1),u=Array(e.length);return s.forEach((t,n)=>{let r=(l-c[n])/2;for(let n of t){let t=ue(e[n]);u[n]={x:r,w:t},r+=t+Z}}),{placed:e.map((e,r)=>{let o=Math.floor(r/n),s=t[r]||X,{x:c,w:l}=u[r];return{block:e,x:c,y:a[o]+(i[o]-s)/2,w:l,h:s,cx:c+l/2,cy:a[o]+i[o]/2}}),w:l,h:Math.max(X,o-Z)}}function fe(e){if(e.length<2)return``;let t=`M ${e[0].x} ${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]??e[n],i=e[n],a=e[n+1],o=e[n+2]??a,s=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,l=a.x-(o.x-i.x)/6,u=a.y-(o.y-i.y)/6;t+=` C ${s} ${c} ${l} ${u} ${a.x} ${a.y}`}return t}function pe(e){let t=e.props?.title;return typeof t==`string`&&t.trim()?t.trim():y(e)}function me(e){let t=(0,z.c)(26),{data:n,onExit:r,selectedBlockIds:i}=e,a=(0,R.useRef)(null),o=i?.size??0,s=(0,R.useRef)(null),c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{s.current=a.current?.querySelector(`.cv-viewport`)??null},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,R.useLayoutEffect)(c,l);let u;t[2]===r?u=t[3]:(u={onEscape:r,initialFocus:s},t[2]=r,t[3]=u),x(a,u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],t[4]=d):d=t[4],(0,R.useEffect)(he,d);let f=`${n.title} — canvas`,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,U.jsx)(`span`,{className:`cv-takeover-glyph`,"aria-hidden":`true`,children:`◇`}),t[5]=p):p=t[5];let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,U.jsx)(`span`,{className:`cv-takeover-eyebrow`,children:`Canvas`}),t[6]=m):m=t[6];let h;t[7]===n.title?h=t[8]:(h=(0,U.jsxs)(`div`,{className:`cv-takeover-id`,children:[p,(0,U.jsxs)(`div`,{className:`cv-takeover-titles`,children:[m,(0,U.jsx)(`span`,{className:`cv-takeover-title`,children:n.title})]})]}),t[7]=n.title,t[8]=h);let g;t[9]===o?g=t[10]:(g=o>0&&(0,U.jsxs)(`span`,{className:`cv-takeover-selection`,"aria-live":`polite`,children:[o,` selected`]}),t[9]=o,t[10]=g);let _;t[11]!==r||t[12]!==o?(_=r&&(0,U.jsxs)(`button`,{type:`button`,className:`cv-takeover-close`,onClick:r,children:[o>0?(0,U.jsxs)(U.Fragment,{children:[`Ask about `,o,` →`]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` Back to answer`]}),(0,U.jsx)(`kbd`,{"aria-hidden":`true`,children:`esc`})]}),t[11]=r,t[12]=o,t[13]=_):_=t[13];let v;t[14]!==g||t[15]!==_?(v=(0,U.jsxs)(`div`,{className:`cv-takeover-actions`,children:[g,_]}),t[14]=g,t[15]=_,t[16]=v):v=t[16];let y;t[17]!==v||t[18]!==h?(y=(0,U.jsxs)(`header`,{className:`cv-takeover-head`,children:[h,v]}),t[17]=v,t[18]=h,t[19]=y):y=t[19];let b;t[20]===e?b=t[21]:(b=(0,U.jsx)(ge,{...e}),t[20]=e,t[21]=b);let S;return t[22]!==y||t[23]!==b||t[24]!==f?(S=(0,Y.createPortal)((0,U.jsxs)(`div`,{ref:a,className:`cv-takeover`,role:`dialog`,"aria-modal":`true`,"aria-label":f,children:[y,b]}),document.body),t[22]=y,t[23]=b,t[24]=f,t[25]=S):S=t[25],S}function he(){let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}}function ge({blocks:e,spot:t,renderBlock:n,onAskBlock:r,selectedBlockIds:i}){let a=(0,R.useMemo)(()=>e.filter(e=>!!e.id),[e]),o=(0,R.useMemo)(()=>$(a.length),[a.length]),s=(0,R.useRef)([]),[c,l]=(0,R.useState)([]),u=(0,R.useCallback)(()=>{let e=a.map((e,t)=>s.current[t]?.offsetHeight||X);l(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[a]);(0,R.useLayoutEffect)(()=>{u()},[u]),(0,R.useEffect)(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>u());return s.current.forEach(t=>t&&e.observe(t)),()=>e.disconnect()},[u,a]);let{placed:d,w:f,h:p}=(0,R.useMemo)(()=>de(a,c,o),[a,c,o]),m=(0,R.useMemo)(()=>({x:-28,y:-28,w:f+Z,h:p+Z}),[f,p]),h=(0,R.useMemo)(()=>fe(d.map(e=>({x:e.cx,y:e.cy}))),[d]),{camera:g,transform:y,viewportRef:b,fitTo:x,zoomAtClient:E,pan:D,setCamera:O}=T({clamp:Q,margin:40}),k=S(),A=(0,R.useRef)(g);A.current=g;let j=(0,R.useRef)(0),M=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(M.current)return;let e=0,t=0;e=requestAnimationFrame(()=>{t=requestAnimationFrame(()=>x(m))});let n=setTimeout(()=>x(m),360);return()=>{cancelAnimationFrame(e),cancelAnimationFrame(t),clearTimeout(n)}},[m,x]);let N=(0,R.useCallback)(e=>{let t=b.current,n=d[e];if(!t||!n)return;M.current=!0,j.current=e;let r=t.getBoundingClientRect(),i=Math.min(Math.max(A.current.scale,.85),Q.max);O(w(n.cx,n.cy,i,{w:r.width,h:r.height},Q))},[d,b,O]),P=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(!t){P.current&&(M.current=!1,x(m)),P.current=!1;return}let e=d.findIndex(e=>e.block.id===t);e>=0&&(P.current=!0,N(e))},[t,d,N,x,m]);let[F,I]=(0,R.useState)(!1),L=(0,R.useRef)(!1),ee=(0,R.useRef)(!1),te=(0,R.useRef)({x:0,y:0}),z=(0,R.useCallback)(e=>{e.button===0&&(e.target.closest(`.cv-node-ask, .cv-controls, a, button, input, select, textarea, [contenteditable="true"]`)||(L.current=!0,M.current=!0,ee.current=!1,I(!0),te.current={x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture(e.pointerId)))},[]),B=(0,R.useCallback)(e=>{if(!L.current)return;let t=e.clientX-te.current.x,n=e.clientY-te.current.y;Math.abs(t)+Math.abs(n)>3&&(ee.current=!0),te.current={x:e.clientX,y:e.clientY},D(t,n)},[D]),V=(0,R.useCallback)(e=>{let t=L.current;L.current=!1,I(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}if(!t||ee.current)return;let n=b.current;if(!n||d.length===0)return;let r=n.getBoundingClientRect(),i=C(A.current,e.clientX-r.left,e.clientY-r.top),a=d.findIndex(e=>i.x>=e.x&&i.x<=e.x+e.w&&i.y>=e.y&&i.y<=e.y+e.h);a>=0&&N(a)},[d,b,N]);(0,R.useEffect)(()=>{let e=b.current;if(!e)return;let t=e=>{e.preventDefault(),M.current=!0,E(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[b,E]);let ne=(0,R.useCallback)(e=>{let t=b.current;if(!t)return;let n=t.getBoundingClientRect();M.current=!0,E(e,n.left+n.width/2,n.top+n.height/2)},[b,E]),H=(0,R.useCallback)(e=>{e.key===`ArrowRight`||e.key===`ArrowDown`?(e.preventDefault(),N(Math.min(d.length-1,j.current+1))):e.key===`ArrowLeft`||e.key===`ArrowUp`?(e.preventDefault(),N(Math.max(0,j.current-1))):e.key===`Home`&&(e.preventDefault(),x(m))},[N,x,m,d.length]),W=g.scale>=.6;return(0,U.jsxs)(`div`,{className:`cv-viewport`+(F?` is-panning`:``),ref:b,role:`group`,"aria-label":`Answer canvas — this answer's cards as a board you can pan and zoom`,tabIndex:0,onPointerDown:z,onPointerMove:B,onPointerUp:V,onPointerCancel:V,onKeyDown:H,children:[(0,U.jsxs)(`div`,{className:`cv-controls`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>ne(1.25),title:`Zoom in`,"aria-label":`Zoom in`,children:`+`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>ne(1/1.25),title:`Zoom out`,"aria-label":`Zoom out`,children:`−`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>x(m),title:`Fit the whole canvas`,"aria-label":`Fit the whole canvas`,children:`⊡`})]}),(0,U.jsxs)(`div`,{className:`cv-world`,style:{width:f,height:p,transform:y},children:[(0,U.jsx)(`svg`,{className:`cv-thread-svg`,width:f,height:p,viewBox:`0 0 ${f} ${p}`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{className:`cv-thread`+(k?``:` cv-draw`),d:h,pathLength:1})}),d.map((e,a)=>{let o=e.block.id,c=i?.has(o)??!1;return(0,U.jsxs)(`div`,{ref:e=>{s.current[a]=e},className:`cv-node`+(c?` is-selected`:``)+(t===o?` is-spot`:``),style:{left:e.x,top:e.y,width:e.w},"data-kind":e.block.type,children:[(0,U.jsxs)(`div`,{className:`cv-node-label`,title:pe(e.block),children:[(0,U.jsx)(`span`,{className:`cv-node-step`,children:a+1}),(0,U.jsx)(`span`,{className:`cv-node-title`,children:pe(e.block)})]}),(0,U.jsx)(`div`,{className:`cv-node-inner`,children:(0,U.jsx)(_,{fallback:(0,U.jsx)(v,{block:e.block}),children:n(e.block)})}),r&&W&&(0,U.jsx)(`button`,{type:`button`,className:`cv-node-ask`,onClick:t=>{t.stopPropagation(),r(e.block)},children:c?`Selected`:`Ask`})]},o)})]})]})}function _e(e){let t=(0,z.c)(35),{num:n,title:r,summary:i,stat:a,delta:o,deltaDir:c,conf:l,sources:u,spotlight:d,dimmed:f,onProve:m,delay:h,children:g}=e,_=`card reveal`+(d?` spotlight`:``)+(f?` dimmed`:``),v=(h||0)+`ms`,y;t[0]===v?y=t[1]:(y={"--delay":v},t[0]=v,t[1]=y);let b=y,x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,U.jsx)(s.spark,{className:`ic`,style:{color:`var(--insight)`}}),t[2]=x):x=t[2];let S;t[3]===n?S=t[4]:(S=(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[x,`Finding `,n]}),t[3]=n,t[4]=S);let C;t[5]===r?C=t[6]:(C=(0,U.jsx)(`div`,{className:`insight-title`,children:r}),t[5]=r,t[6]=C);let w;t[7]!==o||t[8]!==c||t[9]!==a?(w=a&&(0,U.jsxs)(`div`,{className:`insight-stat`,children:[(0,U.jsx)(`span`,{className:`big tab-num`,"data-mark":`underline`,children:a}),o&&(0,U.jsxs)(`span`,{className:`delta `+(c||`up`),children:[c===`good`||c===`down`?(0,U.jsx)(s.arrowDown,{style:{width:13,height:13}}):(0,U.jsx)(s.arrowUp,{style:{width:13,height:13}}),o]})]}),t[7]=o,t[8]=c,t[9]=a,t[10]=w):w=t[10];let T;t[11]===i?T=t[12]:(T=(0,U.jsx)(`div`,{className:`insight-summary`,children:i}),t[11]=i,t[12]=T);let E;t[13]===u?E=t[14]:(E=u&&u.map(ve),t[13]=u,t[14]=E);let D;t[15]===E?D=t[16]:(D=(0,U.jsx)(`div`,{className:`card-foot-l`,children:E}),t[15]=E,t[16]=D);let O;t[17]!==l||t[18]!==u?.length?(O=l&&(0,U.jsx)(p,{level:l,title:u?.length?void 0:`Best estimate from the model's knowledge — not verified`}),t[17]=l,t[18]=u?.length,t[19]=O):O=t[19];let k;t[20]!==D||t[21]!==O?(k=(0,U.jsxs)(`div`,{className:`card-foot`,children:[D,O]}),t[20]=D,t[21]=O,t[22]=k):k=t[22];let A;t[23]===m?A=t[24]:(A=m&&(0,U.jsx)(`div`,{style:{marginTop:14},children:(0,U.jsxs)(`button`,{className:`mini-btn accent`,onClick:m,children:[(0,U.jsx)(s.proof,{}),` Prove it`]})}),t[23]=m,t[24]=A);let j;return t[25]!==g||t[26]!==_||t[27]!==k||t[28]!==A||t[29]!==b||t[30]!==S||t[31]!==C||t[32]!==w||t[33]!==T?(j=(0,U.jsxs)(`div`,{className:_,style:b,children:[S,C,w,T,g,k,A]}),t[25]=g,t[26]=_,t[27]=k,t[28]=A,t[29]=b,t[30]=S,t[31]=C,t[32]=w,t[33]=T,t[34]=j):j=t[34],j}function ve(e,t){return(0,U.jsx)(c,{file:e.file,loc:e.loc},t)}function ye({title:e,series:t,labels:n,unit:r=`$`,delay:i,footer:a,conf:o}){let[c,l]=(0,R.useState)(null),u={l:50,r:50,t:14,b:26},d=t.flatMap(e=>e.data),f=(d.length?Math.max(...d):1)*1.12,m=Math.min(0,...d),h=f-m||1,g=n.length,_=e=>u.l+(g>1?e/(g-1):0)*(560-u.l-u.r),v=e=>u.t+(1-(e-m)/h)*(220-u.t-u.b),y=(()=>{let e=0,n=-1/0;for(let r of t)r.data.forEach((t,r)=>{t>n&&(n=t,e=r)});return e})(),b=e=>e.map((e,t)=>`${t?`L`:`M`}${_(t).toFixed(1)} ${v(e).toFixed(1)}`).join(` `),x=e=>`${b(e)} L${_(g-1)} ${v(m)} L${_(0)} ${v(m)} Z`;return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.chart,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,U.jsxs)(`div`,{className:`chart-wrap`,children:[(0,U.jsxs)(`svg`,{viewBox:`0 0 560 220`,width:`100%`,style:{display:`block`,overflow:`visible`},onMouseLeave:()=>l(null),children:[(0,U.jsx)(`defs`,{children:t.map((e,t)=>(0,U.jsxs)(`linearGradient`,{id:`g${t}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:e.color,stopOpacity:`0.28`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:e.color,stopOpacity:`0`})]},t))}),[.25,.5,.75].map((e,t)=>(0,U.jsx)(`line`,{x1:u.l,x2:560-u.r,y1:u.t+e*(220-u.t-u.b),y2:u.t+e*(220-u.t-u.b),stroke:`var(--grid-line)`},t)),t.map((e,t)=>(0,U.jsxs)(`g`,{children:[e.area!==!1&&(0,U.jsx)(`path`,{className:`tc-area`,d:x(e.data),fill:`url(#g${t})`}),(0,U.jsx)(`path`,{className:`tc-line`,d:b(e.data),pathLength:1,fill:`none`,stroke:e.color,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`})]},t)),n.map((e,t)=>(0,U.jsx)(`rect`,{x:_(t)-560/g/2,y:0,width:560/g,height:220,fill:`transparent`,"data-mark":t===y?`circle`:void 0,onMouseEnter:()=>l(t)},t)),c!=null&&(0,U.jsxs)(`g`,{children:[(0,U.jsx)(`line`,{x1:_(c),x2:_(c),y1:u.t,y2:220-u.b,stroke:`var(--hover-line)`}),t.map((e,t)=>(0,U.jsx)(`circle`,{cx:_(c),cy:v(e.data[c]),r:`4.5`,fill:e.color,stroke:`var(--surface-default)`,strokeWidth:`2`},t))]}),n.map((e,t)=>(0,U.jsx)(`text`,{x:_(t),y:214,fontSize:`11`,textAnchor:`middle`,fill:`var(--text-muted)`,children:e},t))]}),c!=null&&(0,U.jsxs)(`div`,{className:`chart-tip`,style:{opacity:1,left:`${_(c)/560*100}%`,top:`${v(Math.max(...t.map(e=>e.data[c])))/220*100}%`},children:[(0,U.jsx)(`strong`,{children:n[c]}),t.map((e,n)=>(0,U.jsxs)(`div`,{style:{color:e.color,fontVariantNumeric:`tabular-nums`},children:[e.name,`: `,r,t[n].data[c].toLocaleString()]},n))]})]}),(0,U.jsx)(`div`,{className:`chart-legend`,children:t.map((e,t)=>(0,U.jsxs)(`span`,{className:`legend-item`,children:[(0,U.jsx)(`span`,{className:`sw`,style:{background:e.color}}),e.name]},t))}),a&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:a}),o&&(0,U.jsxs)(`div`,{className:`card-foot`,children:[(0,U.jsx)(`div`,{className:`card-foot-l`}),(0,U.jsx)(p,{level:o,title:`Best estimate from the model's knowledge — not verified`})]})]})}function be({title:e,icon:t=`table`,iconColor:n=`var(--insight)`,rows:r,conf:i,delay:a}){let o=s[t]||s.table,c=(()=>{let e=r.findIndex(e=>e.hot);if(e>=0)return e;let t=0;return r.forEach((e,n)=>{e.pct>r[t].pct&&(t=n)}),t})();return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsx)(`div`,{className:`cat-list`,children:r.map((e,t)=>(0,U.jsxs)(`div`,{className:`cat-row`,children:[(0,U.jsxs)(`div`,{className:`cat-top`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`cat-name`,children:e.name}),e.tag&&(0,U.jsx)(`span`,{className:`cat-tag`,style:e.tagColor?{color:e.tagColor,background:`transparent`,border:`1px solid currentColor`}:void 0,children:e.tag})]}),(0,U.jsx)(`span`,{className:`tab-num`,children:e.val})]}),(0,U.jsx)(`div`,{className:`cat-bar`,children:(0,U.jsx)(`i`,{"data-mark":t===c?`circle`:void 0,style:{width:e.pct+`%`,background:e.hot?`var(--warning)`:`var(--presence)`}})})]},e.name))}),i&&(0,U.jsxs)(`div`,{className:`card-foot`,children:[(0,U.jsx)(`div`,{className:`card-foot-l`}),(0,U.jsx)(p,{level:i,title:`Best estimate from the model's knowledge — not verified`})]})]})}function xe(e){let t=(0,z.c)(13),{title:n,events:r,delay:i,eyebrow:a}=e,o=(i||0)+`ms`,c;t[0]===o?c=t[1]:(c={"--delay":o},t[0]=o,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,U.jsx)(s.clock,{className:`ic`,style:{color:`var(--presence-soft)`}}),t[2]=u):u=t[2];let d=a||n,f;t[3]===d?f=t[4]:(f=(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[u,` `,d]}),t[3]=d,t[4]=f);let p;t[5]===r?p=t[6]:(p=r.map(Se),t[5]=r,t[6]=p);let m;t[7]===p?m=t[8]:(m=(0,U.jsx)(`div`,{className:`timeline`,children:p}),t[7]=p,t[8]=m);let h;return t[9]!==l||t[10]!==f||t[11]!==m?(h=(0,U.jsxs)(`div`,{className:`card reveal`,style:l,children:[f,m]}),t[9]=l,t[10]=f,t[11]=m,t[12]=h):h=t[12],h}function Se(e,t){return(0,U.jsxs)(`div`,{className:`tl-row`,children:[(0,U.jsx)(`div`,{className:`tl-rail`,children:(0,U.jsx)(`span`,{className:`tl-dot`,"data-mark":t===0?`point`:void 0,style:{background:e.color||`var(--presence)`}})}),(0,U.jsxs)(`div`,{className:`tl-body`,children:[(0,U.jsx)(`div`,{className:`tl-time`,children:e.time}),(0,U.jsxs)(`div`,{className:`tl-title`,children:[e.title,e.tag&&(0,U.jsx)(`span`,{className:`cat-tag`,style:{marginLeft:8},children:e.tag})]}),e.detail&&(0,U.jsx)(`div`,{className:`tl-detail`,children:e.detail})]})]},t)}function Ce({title:e,icon:t=`layers`,iconColor:n=`var(--presence-soft)`,items:r,delay:i}){let a=s[t]||s.layers;return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(a,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsx)(`div`,{className:`check-list`,children:r.map((e,t)=>(0,U.jsxs)(`div`,{className:`check-row`,children:[(0,U.jsx)(`span`,{className:`check-ic`,children:(0,U.jsx)(s.check,{})}),(0,U.jsx)(`span`,{"data-mark":t===0?`underline`:void 0,dangerouslySetInnerHTML:E(e)})]},t))})]})}function we(e){let t=(0,z.c)(26),{eyebrow:n,options:r,criteria:i,recommendation:a,delay:o}=e,c=(o||0)+`ms`,l;t[0]===c?l=t[1]:(l={"--delay":c},t[0]=c,t[1]=l);let u=l,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,U.jsx)(s.layers,{className:`ic`,style:{color:`var(--presence-soft)`}}),t[2]=d):d=t[2];let f=n||`Side by side`,p;t[3]===f?p=t[4]:(p=(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[d,` `,f]}),t[3]=f,t[4]=p);let m=`minmax(0, 1.1fr) repeat(${r.length}, minmax(0, 1fr))`,h;t[5]===m?h=t[6]:(h={gridTemplateColumns:m},t[5]=m,t[6]=h);let g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,U.jsx)(`div`,{className:`cmp-corner`}),t[7]=g):g=t[7];let _;t[8]===r?_=t[9]:(_=r.map(Te),t[8]=r,t[9]=_);let v;if(t[10]!==i||t[11]!==r){let e;t[13]===r?e=t[14]:(e=(e,t)=>(0,U.jsxs)(R.Fragment,{children:[(0,U.jsx)(`div`,{className:`cmp-crit`,children:e.label}),e.cells.map((e,t)=>(0,U.jsxs)(`div`,{className:`cmp-val`+(e.win?` win`:``)+(r[t]&&r[t].pick?` in-pick`:``),children:[e.win&&(0,U.jsx)(`span`,{className:`cmp-tick`,children:(0,U.jsx)(s.check,{style:{width:11,height:11}})}),(0,U.jsx)(`span`,{children:e.v})]},t))]},t),t[13]=r,t[14]=e),v=i.map(e),t[10]=i,t[11]=r,t[12]=v}else v=t[12];let y;t[15]!==_||t[16]!==v||t[17]!==h?(y=(0,U.jsxs)(`div`,{className:`cmp`,style:h,children:[g,_,v]}),t[15]=_,t[16]=v,t[17]=h,t[18]=y):y=t[18];let b;t[19]===a?b=t[20]:(b=a&&(0,U.jsxs)(`div`,{className:`cmp-rec`,children:[(0,U.jsx)(s.sparkle,{style:{width:16,height:16,color:`var(--insight)`,flexShrink:0}}),(0,U.jsx)(`span`,{dangerouslySetInnerHTML:E(a)})]}),t[19]=a,t[20]=b);let x;return t[21]!==y||t[22]!==b||t[23]!==u||t[24]!==p?(x=(0,U.jsxs)(`div`,{className:`card reveal`,style:u,children:[p,y,b]}),t[21]=y,t[22]=b,t[23]=u,t[24]=p,t[25]=x):x=t[25],x}function Te(e,t){return(0,U.jsxs)(`div`,{className:`cmp-opt`+(e.pick?` pick`:``),"data-mark":e.pick?`circle`:void 0,children:[(0,U.jsx)(`div`,{className:`cmp-opt-name`,children:e.name}),e.sub&&(0,U.jsx)(`div`,{className:`cmp-opt-sub`,children:e.sub}),e.pick&&(0,U.jsxs)(`div`,{className:`cmp-pick`,children:[(0,U.jsx)(s.check,{style:{width:12,height:12}}),` Mavéa's pick`]})]},t)}function Ee({kicker:e,head:t,bullets:n,foot:r,eyebrow:i=`One-pager · ready to share`,delay:a}){return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.slides,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,i]}),(0,U.jsxs)(`div`,{className:`slide-card`,children:[(0,U.jsx)(`div`,{className:`slide-kicker`,children:e}),(0,U.jsx)(`div`,{className:`slide-head`,children:t}),(0,U.jsx)(`div`,{className:`slide-bullets`,children:n.map((e,t)=>(0,U.jsxs)(`div`,{className:`slide-bullet`,children:[(0,U.jsx)(`span`,{className:`bdot`,"data-mark":t===0?`circle`:void 0,style:{background:e.color||`var(--presence)`}}),(0,U.jsx)(`span`,{dangerouslySetInnerHTML:E(e.text)})]},t))}),(0,U.jsxs)(`div`,{className:`slide-foot`,children:[(0,U.jsx)(`span`,{children:r||`Made by Mavéa · from your files`}),(0,U.jsx)(`span`,{children:`June 2026`})]})]}),(0,U.jsxs)(`div`,{className:`action-btns`,style:{marginTop:16},children:[(0,U.jsxs)(`button`,{className:`btn-ghost`,onClick:()=>D(`Tell Mavéa what to change — it'll redo the one-pager`,`info`),children:[(0,U.jsx)(s.edit,{style:{width:15,height:15}}),` Edit`]}),(0,U.jsx)(`button`,{className:`btn-ghost`,onClick:()=>D(`Simplified — fewer words, bigger takeaways`,`good`),children:`Make it simpler`}),(0,U.jsxs)(`button`,{className:`btn-primary`,style:{flex:`0 0 auto`,padding:`0 20px`},onClick:()=>window.print(),title:`Export this canvas to PDF`,children:[(0,U.jsx)(s.export,{style:{width:16,height:16}}),` Export`]})]})]})}function De(e,t){return t||(e?e.startsWith(`calendar.`)?`Adds one event to your calendar. No invites are sent.`:e.startsWith(`github.`)?`Opens a draft PR. It won't merge until you review and approve it on GitHub.`:`Mavéa needs your OK before it does anything. Nothing happens until you confirm.`:`Mavéa needs your OK before it does anything. Nothing happens until you confirm.`)}function Oe({delay:e,onConfirm:t,eyebrow:n=`Action`,icon:r=`mail`,title:i=`Run this action`,lines:a,perm:o,cta:c=`Confirm`,doneText:l=`Done`,mcpId:u,fields:d}){let[f,p]=(0,R.useState)(`idle`),[m,h]=(0,R.useState)(()=>Object.fromEntries((d??[]).map(e=>[e.param,e.value]))),[g,_]=(0,R.useState)(``),v=(0,R.useRef)(void 0);(0,R.useEffect)(()=>()=>clearTimeout(v.current),[]);let y=s[r]||s.mail,b=De(u,o),x=async()=>{p(`running`),await new Promise(e=>{v.current=setTimeout(e,1400)}),p(`done`),t?.()};return(0,U.jsxs)(`div`,{className:`card action-card reveal`,style:{"--delay":(e||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(y,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,n]}),(0,U.jsx)(`div`,{className:`insight-title`,style:{fontSize:17},children:i}),f!==`editing`&&a&&a.length>0&&(0,U.jsx)(`div`,{className:`action-preview`,children:a.map((e,t)=>(0,U.jsxs)(`div`,{style:{marginTop:t?6:0},children:[(0,U.jsx)(`span`,{className:`to`,children:e.k}),` · `,e.v]},t))}),f===`editing`&&d&&d.length>0&&(0,U.jsx)(`div`,{className:`action-edit-fields`,children:d.map(e=>(0,U.jsxs)(`div`,{className:`action-edit-field`,children:[(0,U.jsx)(`label`,{className:`action-edit-label`,children:e.label}),e.multiline?(0,U.jsx)(`textarea`,{className:`action-edit-input action-edit-textarea`,value:m[e.param]??``,onChange:t=>h(n=>({...n,[e.param]:t.target.value})),rows:4}):(0,U.jsx)(`input`,{className:`action-edit-input`,type:`text`,value:m[e.param]??``,onChange:t=>h(n=>({...n,[e.param]:t.target.value}))})]},e.param))}),f!==`editing`&&(0,U.jsxs)(`div`,{className:`perm`,children:[(0,U.jsx)(s.lock,{}),` `,b]}),f===`done`&&(0,U.jsxs)(`button`,{type:`button`,onClick:t,disabled:!t,style:{display:`flex`,alignItems:`center`,gap:8,color:`var(--insight)`,fontWeight:600,fontSize:14,marginTop:6,background:`none`,border:0,padding:0,textAlign:`left`,cursor:t?`pointer`:`default`},children:[(0,U.jsx)(s.check,{style:{width:18,height:18}}),` `,l,t&&(0,U.jsx)(`span`,{className:`open-app-hint`,children:`· open ↗`})]}),f===`error`&&(0,U.jsxs)(`div`,{className:`action-error`,children:[(0,U.jsx)(`span`,{className:`action-error-msg`,children:g}),(0,U.jsx)(`button`,{className:`btn-ghost`,style:{marginLeft:12},onClick:()=>{p(`idle`),_(``)},children:`Retry`})]}),f===`idle`&&(0,U.jsxs)(`div`,{className:`action-btns`,children:[(0,U.jsxs)(`button`,{className:`btn-primary`,onClick:x,children:[(0,U.jsx)(s.check,{style:{width:16,height:16}}),` `,c]}),d&&d.length>0&&(0,U.jsx)(`button`,{className:`btn-ghost`,onClick:()=>p(`editing`),children:`Edit first`})]}),f===`editing`&&(0,U.jsxs)(`div`,{className:`action-btns`,children:[(0,U.jsxs)(`button`,{className:`btn-primary`,onClick:()=>x(),children:[(0,U.jsx)(s.check,{style:{width:16,height:16}}),` Confirm`]}),(0,U.jsx)(`button`,{className:`btn-ghost`,onClick:()=>p(`idle`),children:`Cancel`})]}),f===`running`&&(0,U.jsx)(`div`,{className:`action-btns`,children:(0,U.jsxs)(`button`,{className:`btn-primary`,disabled:!0,children:[(0,U.jsx)(`span`,{className:`tiny-spin`}),` Working…`]})})]})}function ke({title:e,icon:t=`spark`,iconColor:n=`var(--insight)`,rings:r,footer:i,delay:a}){let o=s[t]||s.spark,c=`rs`+(0,R.useId)().replace(/:/g,``),l=2*Math.PI*52;return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsx)(`div`,{className:`ring-row`,children:r.map((e,t)=>{let n=Math.max(0,Math.min(1,e.pct)),r=e.color||`var(--presence)`;return(0,U.jsxs)(`div`,{className:`ring-item`,children:[(0,U.jsxs)(`svg`,{viewBox:`0 0 130 130`,className:`ring-svg`,children:[(0,U.jsxs)(`defs`,{children:[(0,U.jsxs)(`linearGradient`,{id:`${c}g${t}`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:r,stopOpacity:`0.65`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:r})]}),(0,U.jsxs)(`filter`,{id:`${c}f${t}`,x:`-40%`,y:`-40%`,width:`180%`,height:`180%`,children:[(0,U.jsx)(`feGaussianBlur`,{stdDeviation:`3`,result:`b`}),(0,U.jsxs)(`feMerge`,{children:[(0,U.jsx)(`feMergeNode`,{in:`b`}),(0,U.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})]}),(0,U.jsx)(`circle`,{cx:`65`,cy:`65`,r:52,fill:`none`,stroke:`var(--track)`,strokeWidth:`11`}),(0,U.jsx)(`circle`,{cx:`65`,cy:`65`,r:52,fill:`none`,stroke:`url(#${c}g${t})`,strokeWidth:`11`,strokeLinecap:`round`,strokeDasharray:l,strokeDashoffset:l*(1-n),filter:`url(#${c}f${t})`,transform:`rotate(-90 65 65)`,className:`ring-arc`,"data-mark":t===0?`circle`:void 0}),(()=>{let t=String(e.display??``),n=t.length,r=Math.max(9,Math.min(25,Math.round(155/Math.max(1,n)))),i=n>10;return(0,U.jsx)(`text`,{x:`65`,y:e.unit?61:70,textAnchor:`middle`,className:`ring-val`,style:{fontSize:r},...i?{textLength:92,lengthAdjust:`spacingAndGlyphs`}:{},children:t})})(),e.unit&&(0,U.jsx)(`text`,{x:`65`,y:`80`,textAnchor:`middle`,className:`ring-unit`,children:e.unit})]}),(0,U.jsx)(`div`,{className:`ring-label`,children:e.label}),e.hint&&(0,U.jsx)(`div`,{className:`ring-hint`,children:e.hint})]},t)})}),i&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:6},children:i})]})}function Ae({title:e,icon:t=`chart`,iconColor:n=`var(--presence-soft)`,bars:r,unit:i=``,goal:a,goalLabel:o,footer:c,conf:l,delay:u}){let d=s[t]||s.chart,f=Math.max(...r.map(e=>e.value),a||0)*1.05||1,m=(()=>{let e=r.findIndex(e=>e.hot);if(e>=0)return e;let t=0;return r.forEach((e,n)=>{e.value>r[t].value&&(t=n)}),t})(),h=i.trim(),g=h!==``&&(/^[$€£¥₹]/.test(h)||h===`%`||h.length<=2),_=g?``:h;return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(u||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),_&&(0,U.jsx)(`div`,{className:`bars-unit`,children:_}),(0,U.jsxs)(`div`,{className:`bars-chart`,children:[(0,U.jsxs)(`div`,{className:`bars-plot`,children:[a!=null&&(0,U.jsx)(`div`,{className:`bars-goal`,style:{bottom:`${a/f*100}%`},children:(0,U.jsx)(`span`,{className:`bars-goal-label`,children:o||`Goal`})}),r.map((e,t)=>(0,U.jsx)(`div`,{className:`bar-col`,children:(0,U.jsx)(`div`,{className:`bar-fill`,"data-mark":t===m?`circle`:void 0,style:{height:`${e.value/f*100}%`,background:e.hot?`var(--warning)`:e.color||`var(--presence)`},children:(0,U.jsx)(`span`,{className:`bar-val tab-num`,children:e.label2||(g?O(e.value,i):k(e.value))})})},t))]}),(0,U.jsx)(`div`,{className:`bars-axis`,children:r.map((e,t)=>(0,U.jsx)(`div`,{className:`bar-label`,children:e.label},t))})]}),c&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:14},children:c}),l&&(0,U.jsxs)(`div`,{className:`card-foot`,children:[(0,U.jsx)(`div`,{className:`card-foot-l`}),(0,U.jsx)(p,{level:l,title:`Best estimate from the model's knowledge — not verified`})]})]})}function je({title:e,icon:t=`layers`,iconColor:n=`var(--presence-soft)`,total:r,segments:i,footer:a,conf:o,delay:c}){let l=s[t]||s.layers,u=i.reduce((e,t)=>e+t.value,0)||1,d=i.reduce((e,t,n)=>t.value>i[e].value?n:e,0);return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(c||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),r&&(0,U.jsx)(`div`,{className:`stack-total tab-num`,children:r}),(0,U.jsx)(`div`,{className:`stack-bar`,children:i.map((e,t)=>(0,U.jsx)(`div`,{className:`stack-seg`,title:`${e.label} · ${e.display}`,"data-mark":t===d?`circle`:void 0,style:{width:`${e.value/u*100}%`,background:e.color}},t))}),(0,U.jsx)(`div`,{className:`stack-legend`,children:i.map((e,t)=>(0,U.jsxs)(`div`,{className:`stack-leg`,children:[(0,U.jsx)(`span`,{className:`sw`,style:{background:e.color}}),(0,U.jsx)(`span`,{className:`stack-leg-name`,children:e.label}),(0,U.jsx)(`span`,{className:`stack-leg-val tab-num`,children:e.display})]},t))}),a&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:a}),o&&(0,U.jsxs)(`div`,{className:`card-foot`,children:[(0,U.jsx)(`div`,{className:`card-foot-l`}),(0,U.jsx)(p,{level:o,title:`Best estimate from the model's knowledge — not verified`})]})]})}function Me({title:e,icon:t=`chart`,iconColor:n=`var(--warning)`,points:r,xLabel:i,yLabel:a,xDomain:o,yDomain:c,trend:l,footer:u,delay:d}){let f=s[t]||s.chart,p={l:54,r:14,t:14,b:38},m=1/0,h=-1/0,g=1/0,_=-1/0;for(let e of r)e.x<m&&(m=e.x),e.x>h&&(h=e.x),e.y<g&&(g=e.y),e.y>_&&(_=e.y);let v=o||[m,h],y=c||[g,_],b=v[1]-v[0]||1,x=y[1]-y[0]||1,S=e=>p.l+(e-v[0])/b*(540-p.l-p.r),C=e=>p.t+(1-(e-y[0])/x)*(240-p.t-p.b),w=(()=>{let e=r.findIndex(e=>e.hot);if(e>=0)return e;let t=0;return r.forEach((e,n)=>{e.y>r[t].y&&(t=n)}),t})();return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(d||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsxs)(`svg`,{viewBox:`0 0 540 240`,width:`100%`,style:{display:`block`,overflow:`visible`},children:[[0,.5,1].map((e,t)=>{let n=p.t+e*(240-p.t-p.b);return(0,U.jsx)(`line`,{x1:p.l,x2:540-p.r,y1:n,y2:n,stroke:`var(--grid-line)`},t)}),(0,U.jsx)(`line`,{x1:p.l,x2:p.l,y1:p.t,y2:240-p.b,stroke:`var(--grid-strong)`}),(0,U.jsx)(`line`,{x1:p.l,x2:540-p.r,y1:240-p.b,y2:240-p.b,stroke:`var(--grid-strong)`}),l&&(0,U.jsx)(`line`,{x1:S(l[0][0]),y1:C(l[0][1]),x2:S(l[1][0]),y2:C(l[1][1]),stroke:`var(--warning)`,strokeWidth:`2`,strokeDasharray:`5 5`,opacity:`0.7`}),r.map((e,t)=>(0,U.jsx)(`circle`,{cx:S(e.x),cy:C(e.y),r:e.hot?7:5.5,fill:e.hot?`var(--warning)`:`var(--presence)`,stroke:`var(--surface-default)`,strokeWidth:`2`,opacity:e.hot?1:.8,"data-mark":t===w?`circle`:void 0},t)),(0,U.jsx)(`text`,{x:270,y:234,textAnchor:`middle`,fontSize:`11`,fill:`var(--text-muted)`,children:i}),(0,U.jsx)(`text`,{x:0,y:0,transform:`translate(13, ${(p.t+240-p.b)/2}) rotate(-90)`,textAnchor:`middle`,fontSize:`11`,fill:`var(--text-muted)`,children:a})]}),u&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:10},children:u})]})}function Ne({title:e,icon:t=`clock`,iconColor:n=`var(--insight)`,cols:r,rows:i,levelColor:a,footer:o,legend:c,delay:l}){let u=s[t]||s.clock,d=0,f=0,p=-1;i.forEach((e,t)=>{e.cells.forEach((e,n)=>{let r=typeof e==`object`&&e?e.lvl??0:e??0;r!=null&&r>p&&(p=r,d=t,f=n)})});let m=e=>e==null?`var(--cell-empty)`:`color-mix(in oklab, ${a||`var(--presence)`} ${[.14,.34,.6,.92][Math.max(0,Math.min(3,e))]*100}%, transparent)`;return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(l||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsxs)(`div`,{className:`heat-wrap`,children:[r&&(0,U.jsxs)(`div`,{className:`heat-cols`,children:[(0,U.jsx)(`span`,{className:`heat-rowhead`}),r.map((e,t)=>(0,U.jsx)(`span`,{className:`heat-col-label`,children:e},t))]}),i.map((e,t)=>(0,U.jsxs)(`div`,{className:`heat-row`,children:[(0,U.jsx)(`span`,{className:`heat-rowhead`,children:e.label}),e.cells.map((e,n)=>(0,U.jsx)(`span`,{className:`heat-cell`,title:e&&typeof e==`object`&&e.note?e.note:``,"data-mark":t===d&&n===f?`circle`:void 0,style:{background:m(typeof e==`object`&&e?e.lvl:e)},children:typeof e==`object`&&e&&e.mark?(0,U.jsx)(`span`,{className:`heat-mark`,children:e.mark}):null},n))]},t))]}),c&&(0,U.jsxs)(`div`,{className:`heat-legend`,children:[(0,U.jsx)(`span`,{className:`faint`,children:c[0]}),[0,1,2,3].map(e=>(0,U.jsx)(`span`,{className:`heat-cell sm`,style:{background:m(e)}},e)),(0,U.jsx)(`span`,{className:`faint`,children:c[1]})]}),o&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:o})]})}function Pe({title:e,icon:t=`sparkle`,iconColor:n=`var(--presence-soft)`,steps:r,footer:i,delay:a}){let o=s[t]||s.sparkle;return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsx)(`div`,{className:`flow`,children:r.map((e,t)=>(0,U.jsxs)(R.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flow-step`,style:{"--sc":e.color||`var(--presence)`},children:[(0,U.jsx)(`div`,{className:`flow-num`,"data-mark":t===0?`circle`:void 0,children:t+1}),(0,U.jsx)(`div`,{className:`flow-title`,children:e.title}),(0,U.jsx)(`div`,{className:`flow-sub`,children:e.sub})]}),t<r.length-1&&(0,U.jsx)(`div`,{className:`flow-arrow`,children:(0,U.jsx)(s.chevR,{})})]},t))}),i&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:14},children:i})]})}function Fe({title:e=`From the web`,live:t=!0,results:n,footer:r,delay:i}){return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.globe,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e,t&&(0,U.jsxs)(`span`,{className:`web-live`,children:[(0,U.jsx)(`span`,{className:`web-live-dot`}),`live`]})]}),(0,U.jsx)(`div`,{className:`web-list`,children:n.map((e,t)=>(0,U.jsxs)(`button`,{type:`button`,className:`web-result`,onClick:()=>D(`Opening `+e.domain+` →`),children:[(0,U.jsx)(`span`,{className:`web-fav`,"data-mark":t===0?`circle`:void 0,style:{background:e.color||`var(--presence)`},children:(e.domain||`?`)[0].toUpperCase()}),(0,U.jsxs)(`span`,{className:`web-body`,children:[(0,U.jsx)(`span`,{className:`web-title`,children:e.title}),(0,U.jsxs)(`span`,{className:`web-url`,children:[e.domain,e.path||``]}),(0,U.jsx)(`span`,{className:`web-excerpt`,dangerouslySetInnerHTML:E(e.excerpt)})]}),(0,U.jsx)(s.external,{className:`web-ext`})]},t))}),r&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:r})]})}function Ie(e){let t=(0,z.c)(12),{item:n}=e,r=n.src??``,i;t[0]!==n.candidates||t[1]!==r?(i=[r,...n.candidates??[]].map(Re).filter(Le),t[0]=n.candidates,t[1]=r,t[2]=i):i=t[2];let a=i,o;t[3]===n.fallbackSrc?o=t[4]:(o=A(n.fallbackSrc),t[3]=n.fallbackSrc,t[4]=o);let c=o,l=j(a),u=l.src??(a.length&&l.state===`none`?c:void 0);if(!u){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,U.jsx)(s.image,{className:`img-ph-ic`}),t[5]=e):e=t[5],e}let d;t[6]===c?d=t[7]:(d=e=>{let t=e.currentTarget;c&&t.src!==c&&(t.src=c)},t[6]=c,t[7]=d);let f;return t[8]!==n.label||t[9]!==u||t[10]!==d?(f=(0,U.jsx)(`img`,{className:`img-real`,src:u,alt:n.label,loading:`lazy`,referrerPolicy:`no-referrer`,onError:d}),t[8]=n.label,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}function Le(e){return!!e}function Re(e){return A(e)}function ze({eyebrow:e=`From the web`,items:t,footer:n,delay:r}){return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(r||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.image,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,U.jsx)(`div`,{className:`gallery`,children:t.map((e,t)=>{let n=()=>D(`Saved “`+e.label+`” to your notes`);return(0,U.jsxs)(`div`,{className:`img-tile`,role:`button`,tabIndex:0,"aria-label":`Save ${e.label} to your notes`,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},style:{"--h1":e.h1||`#3a4a6e`,"--h2":e.h2||`#1a2236`,cursor:`pointer`},children:[(0,U.jsxs)(`span`,{className:`img-ph`,children:[(0,U.jsx)(Ie,{item:e}),e.tag&&(0,U.jsx)(`span`,{className:`img-tag`,children:e.tag}),e.source&&(0,U.jsx)(`span`,{className:`img-src`,children:e.source})]}),(0,U.jsx)(`span`,{className:`img-cap`,children:e.label})]},e.label+t)})}),n&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:n})]})}function Be({title:e=`What this change touches`,center:t,nodes:n,footer:r,delay:i}){let a=n.map((e,t)=>{let r=(-90+360/n.length*t)*Math.PI/180;return{...e,x:180+Math.cos(r)*74,y:125+Math.sin(r)*74*.86}}),o=Math.max(0,a.findIndex(e=>e.hot));return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.layers,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,U.jsx)(`div`,{className:`codemap`,children:(0,U.jsxs)(`svg`,{viewBox:`0 0 360 250`,width:`100%`,style:{display:`block`},children:[a.map((e,t)=>(0,U.jsx)(`line`,{x1:180,y1:125,x2:e.x,y2:e.y,stroke:e.hot?`var(--warning)`:`var(--grid-strong)`,strokeWidth:e.hot?1.6:1,strokeDasharray:e.hot?`0`:`3 3`},t)),a.map((e,t)=>(0,U.jsxs)(`g`,{transform:`translate(${e.x} ${e.y})`,children:[(0,U.jsx)(`circle`,{r:`6`,fill:e.hot?`var(--warning)`:`var(--surface-elevated-2)`,stroke:e.hot?`var(--warning)`:`var(--line-strong)`,strokeWidth:`1.5`,"data-mark":t===o?`circle`:void 0}),(0,U.jsx)(`text`,{x:`0`,y:e.y>125?20:-12,textAnchor:`middle`,fontSize:`10.5`,fill:`var(--text-secondary)`,className:`mono`,children:e.label}),e.note&&(0,U.jsx)(`text`,{x:`0`,y:e.y>125?32:-24,textAnchor:`middle`,fontSize:`9`,fill:`var(--text-muted)`,children:e.note})]},t)),(0,U.jsxs)(`g`,{transform:`translate(180 125)`,children:[(0,U.jsx)(`circle`,{r:`11`,fill:`var(--presence)`,stroke:`var(--surface-default)`,strokeWidth:`2`}),(0,U.jsx)(`circle`,{r:`11`,fill:`none`,stroke:`var(--presence)`,strokeWidth:`1`,opacity:`0.4`,className:`codemap-pulse`}),(0,U.jsx)(`text`,{x:`0`,y:`28`,textAnchor:`middle`,fontSize:`11`,fontWeight:`600`,fill:`var(--text-primary)`,className:`mono`,children:t})]})]})}),r&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:8},children:r})]})}function Ve(e){let t=(0,z.c)(32),{title:n,file:r,add:i,del:a,lines:o,footer:c,delay:l}=e,u=(l||0)+`ms`,d;t[0]===u?d=t[1]:(d={"--delay":u},t[0]=u,t[1]=d);let f=d,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,U.jsx)(s.edit,{className:`ic`,style:{color:`var(--presence-soft)`}}),t[2]=p):p=t[2];let m=n||`The change`,h;t[3]===m?h=t[4]:(h=(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[p,` `,m]}),t[3]=m,t[4]=h);let g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,U.jsx)(s.doc,{style:{width:13,height:13}}),t[5]=g):g=t[5];let _;t[6]===r?_=t[7]:(_=(0,U.jsxs)(`span`,{className:`diff-file mono`,children:[g,` `,r]}),t[6]=r,t[7]=_);let v;t[8]===i?v=t[9]:(v=(0,U.jsxs)(`span`,{className:`add`,children:[`+`,i]}),t[8]=i,t[9]=v);let y;t[10]===a?y=t[11]:(y=(0,U.jsxs)(`span`,{className:`del`,children:[`−`,a]}),t[10]=a,t[11]=y);let b;t[12]!==y||t[13]!==v?(b=(0,U.jsxs)(`span`,{className:`diff-stat`,children:[v,` `,y]}),t[12]=y,t[13]=v,t[14]=b):b=t[14];let x;t[15]!==b||t[16]!==_?(x=(0,U.jsxs)(`div`,{className:`diff-head`,children:[_,b]}),t[15]=b,t[16]=_,t[17]=x):x=t[17];let S;t[18]===o?S=t[19]:(S=o.map(He),t[18]=o,t[19]=S);let C;t[20]===S?C=t[21]:(C=(0,U.jsx)(`div`,{className:`diff-body mono`,children:S}),t[20]=S,t[21]=C);let w;t[22]!==x||t[23]!==C?(w=(0,U.jsxs)(`div`,{className:`diff`,children:[x,C]}),t[22]=x,t[23]=C,t[24]=w):w=t[24];let T;t[25]===c?T=t[26]:(T=c&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:c}),t[25]=c,t[26]=T);let E;return t[27]!==w||t[28]!==T||t[29]!==f||t[30]!==h?(E=(0,U.jsxs)(`div`,{className:`card reveal`,style:f,children:[h,w,T]}),t[27]=w,t[28]=T,t[29]=f,t[30]=h,t[31]=E):E=t[31],E}function He(e,t){return(0,U.jsxs)(`div`,{className:`diff-line `+(e.t||`ctx`),children:[(0,U.jsx)(`span`,{className:`diff-gutter`,children:e.t===`add`?`+`:e.t===`del`?`−`:``}),(0,U.jsx)(`span`,{className:`diff-code`,dangerouslySetInnerHTML:E(e.c)})]},t)}var Ue={pass:s.check,fail:s.x,skip:s.clock};function We({title:e=`Tests after the change`,summary:t,items:n,footer:r,delay:i}){let a=n.findIndex(e=>e.status===`fail`);return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.proof,{className:`ic`,style:{color:`var(--insight)`}}),` `,e]}),t&&(0,U.jsx)(`div`,{className:`checks-summary`,children:t}),(0,U.jsx)(`div`,{className:`checks-list`,children:n.map((e,t)=>{let n=Ue[e.status]||s.check;return(0,U.jsxs)(`div`,{className:`check2-row `+e.status,children:[(0,U.jsx)(`span`,{className:`check2-ic`,"data-mark":t===a?`circle`:void 0,children:(0,U.jsx)(n,{})}),(0,U.jsx)(`span`,{className:`check2-name mono`,children:e.name}),e.note&&(0,U.jsx)(`span`,{className:`check2-note`,children:e.note})]},t)})}),r&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:r})]})}function Ge({title:e,icon:t=`chart`,iconColor:n=`var(--presence-soft)`,size:r=132,thickness:i=18,rows:a,footer:o,conf:c,delay:l}){let u=s[t]||s.chart,d=r/2-i/2,f=2*Math.PI*d,m=0,h=a.map(e=>{let t=f*e.pct/100,n={len:t,off:-m,color:e.color};return m+=t,n}),g=a.reduce((e,t,n)=>t.pct>a[e].pct?n:e,0);return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(l||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsxs)(`div`,{className:`donut-wrap`,children:[(0,U.jsx)(`svg`,{className:`donut`,viewBox:`0 0 ${r} ${r}`,width:r,height:r,children:(0,U.jsxs)(`g`,{transform:`rotate(-90 ${r/2} ${r/2})`,children:[(0,U.jsx)(`circle`,{cx:r/2,cy:r/2,r:d,fill:`none`,stroke:`var(--surface-glass-strong)`,strokeWidth:i}),h.map((e,t)=>(0,U.jsx)(`circle`,{className:`donut-seg`,cx:r/2,cy:r/2,r:d,fill:`none`,stroke:e.color,strokeWidth:i,strokeLinecap:`butt`,strokeDasharray:`${Math.max(0,e.len-1.5)} ${f-Math.max(0,e.len-1.5)}`,strokeDashoffset:e.off,"data-mark":t===g?`circle`:void 0},t))]})}),(0,U.jsx)(`ul`,{className:`donut-legend`,children:a.map((e,t)=>(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`i`,{className:`sw`,style:{background:e.color}}),(0,U.jsx)(`span`,{className:`dl-label`,children:e.label}),(0,U.jsxs)(`span`,{className:`dl-pct tab-num`,children:[e.pct,`%`]})]},t))})]}),o&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:o}),c&&(0,U.jsxs)(`div`,{className:`card-foot`,children:[(0,U.jsx)(`div`,{className:`card-foot-l`}),(0,U.jsx)(p,{level:c,title:`Best estimate from the model's knowledge — not verified`})]})]})}function Ke({title:e,icon:t=`spark`,iconColor:n=`var(--insight)`,value:r,max:i=100,size:a=116,color:o,band:c,driver:l,footer:u,conf:d,delay:f}){let m=s[t]||s.spark,h=a/2-10,g=Math.max(0,Math.min(1,r/i)),_=o||(r>=40?`var(--warning)`:`var(--insight)`);return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(f||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(m,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsxs)(`div`,{className:`risk-wrap`,children:[(0,U.jsxs)(`div`,{className:`gauge-host`,children:[(0,U.jsxs)(`svg`,{className:`gauge`,viewBox:`0 0 ${a} ${a}`,width:a,height:a,children:[(0,U.jsx)(`circle`,{cx:a/2,cy:a/2,r:h,fill:`none`,stroke:`var(--surface-glass-strong)`,strokeWidth:`9`}),(0,U.jsx)(`circle`,{className:`gauge-arc`,cx:a/2,cy:a/2,r:h,fill:`none`,stroke:_,strokeWidth:`9`,strokeLinecap:`round`,pathLength:1,strokeDasharray:1,strokeDashoffset:1-g,transform:`rotate(-90 ${a/2} ${a/2})`})]}),(0,U.jsxs)(`div`,{className:`gauge-center`,children:[(0,U.jsx)(`div`,{className:`gauge-num tab-num`,"data-mark":`underline`,style:{color:_},children:r}),c&&(0,U.jsx)(`div`,{className:`gauge-band`,children:c})]})]}),l&&(0,U.jsx)(`p`,{className:`risk-driver`,dangerouslySetInnerHTML:E(l)})]}),u&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:u}),d&&(0,U.jsxs)(`div`,{className:`card-foot`,children:[(0,U.jsx)(`div`,{className:`card-foot-l`}),(0,U.jsx)(p,{level:d,title:`Best estimate from the model's knowledge — not verified`})]})]})}function qe({title:e=`Around the league`,icon:t=`bell`,iconColor:n=`var(--presence-soft)`,games:r,footer:i,delay:a}){let o=s[t]||s.bell,c=Math.max(0,r.findIndex(e=>e.hot));return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsx)(`ul`,{className:`score-list`,children:r.map((e,t)=>(0,U.jsxs)(`li`,{className:`game`+(e.hot?` hot`:``),"data-mark":t===c?`circle`:void 0,style:{"--ti":t},children:[(0,U.jsxs)(`div`,{className:`g-rows`,children:[(0,U.jsxs)(`div`,{className:`g-team`,children:[(0,U.jsx)(`span`,{className:`g-name`,children:e.away}),(0,U.jsx)(`span`,{className:`g-score tab-num`,children:e.as})]}),(0,U.jsxs)(`div`,{className:`g-team`,children:[(0,U.jsx)(`span`,{className:`g-name`,children:e.home}),(0,U.jsx)(`span`,{className:`g-score tab-num`,children:e.hs})]})]}),(0,U.jsxs)(`span`,{className:`g-status`+(e.hot?` live`:``),children:[e.hot&&(0,U.jsx)(`span`,{className:`live-dot`}),e.status]})]},t))}),i&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:i})]})}function Je({title:e=`Standings`,icon:t=`table`,iconColor:n=`var(--insight)`,rows:r,footer:i,delay:a}){let o=s[t]||s.table;return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsx)(`ul`,{className:`stand-list`,children:r.map((e,t)=>(0,U.jsxs)(`li`,{className:`stand`,style:{"--ti":t},children:[(0,U.jsx)(`span`,{className:`stand-rank`,children:t+1}),(0,U.jsx)(`span`,{className:`stand-team`,"data-mark":t===0?`underline`:void 0,children:e.team}),(0,U.jsx)(`span`,{className:`stand-rec tab-num`,children:e.rec}),(0,U.jsx)(`span`,{className:`stand-gb tab-num`,children:e.gb})]},t))}),i&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:i})]})}function Ye({title:e=`By stage`,icon:t=`layers`,iconColor:n=`var(--presence-soft)`,headline:r,sub:i,unit:a=`$`,suffix:o=`M`,stages:c,footer:l,delay:u}){let d=s[t]||s.layers,f=Math.max(1,...c.map(e=>e.v)),p=c.reduce((e,t,n)=>t.v>c[e].v?n:e,0);return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(u||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),(r||i)&&(0,U.jsxs)(`div`,{className:`stat-row`,children:[r&&(0,U.jsx)(`div`,{className:`big-stat tab-num`,style:{color:`var(--presence)`},children:r}),i&&(0,U.jsx)(`span`,{className:`delta accent`,children:i})]}),(0,U.jsx)(`ul`,{className:`funnel`,children:c.map((e,t)=>(0,U.jsxs)(`li`,{className:`funnel-row`,style:{"--ti":t},children:[(0,U.jsx)(`span`,{className:`funnel-label`,children:e.k}),(0,U.jsx)(`span`,{className:`funnel-track`,children:(0,U.jsx)(`span`,{className:`funnel-fill`,"data-mark":t===p?`circle`:void 0,style:{width:e.v/f*100+`%`}})}),(0,U.jsxs)(`span`,{className:`funnel-val tab-num`,children:[a,e.v,o]})]},t))}),l&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:l})]})}function Xe(e){return e===4?2:Math.min(Math.max(e,1),3)}function Ze({title:e,icon:t=`spark`,iconColor:n=`var(--insight)`,cols:r,kpis:i,footer:a,conf:o,delay:c}){let l=s[t]||s.spark;return(0,U.jsxs)(`div`,{className:`card reveal kpi-card`,style:{"--delay":(c||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsx)(`div`,{className:`kpi-grid`,style:{"--kpi-cols":r??Xe(i.length)},children:i.map((e,t)=>(0,U.jsxs)(`div`,{className:`kpi`,children:[(0,U.jsx)(`div`,{className:`kpi-val tab-num`,"data-mark":t===0?`underline`:void 0,style:e.color?{color:e.color}:void 0,children:e.val}),(0,U.jsx)(`div`,{className:`kpi-label`,children:e.label})]},t))}),a&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:a}),o&&(0,U.jsxs)(`div`,{className:`card-foot`,children:[(0,U.jsx)(`div`,{className:`card-foot-l`}),(0,U.jsx)(p,{level:o,title:`Best estimate from the model's knowledge — not verified`})]})]})}function Qe({title:e=`What customers are saying`,icon:t=`quote`,iconColor:n=`var(--presence-soft)`,quotes:r,footer:i,delay:a}){let o=s[t]||s.quote;return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsx)(`ul`,{className:`quote-list`,children:r.map((e,t)=>(0,U.jsxs)(`li`,{className:`quote-item q-`+(e.tone||`neutral`),style:{"--ti":t},children:[(0,U.jsxs)(`p`,{className:`quote-text`,children:[`“`,e.text,`”`]}),(0,U.jsx)(`span`,{className:`quote-who`,children:e.who})]},t))}),i&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:i})]})}function $e({title:e=`Plan`,icon:t=`check`,iconColor:n=`var(--insight)`,rows:r,footer:i,delay:a}){let o=s[t]||s.check,c=(()=>{let e=r.findIndex(e=>e.st===`doing`);return e>=0?e:r.findIndex(e=>e.st===`todo`)})();return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,U.jsx)(`ul`,{className:`plan-list`,children:r.map((e,t)=>(0,U.jsxs)(`li`,{className:`plan-row st-`+e.st,style:{"--ti":t},children:[(0,U.jsx)(`span`,{className:`plan-check`,"data-mark":t===c?`circle`:void 0,children:e.st===`done`?(0,U.jsx)(s.check,{style:{width:12,height:12}}):e.st===`doing`?(0,U.jsx)(`span`,{className:`plan-dot`}):null}),(0,U.jsx)(`span`,{className:`plan-t`,children:e.t})]},t))}),i&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:i})]})}function et({title:e=`What I learned about you`,items:t,conf:n,delay:r}){return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(r||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.sparkle,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,U.jsx)(`div`,{className:`understand-list`,children:t.map((e,t)=>(0,U.jsxs)(`div`,{className:`understand-row`,children:[(0,U.jsx)(`span`,{className:`understand-check`,children:(0,U.jsx)(s.check,{})}),(0,U.jsx)(`span`,{className:`understand-text`,"data-mark":t===0?`underline`:void 0,dangerouslySetInnerHTML:E(e.text)}),(0,U.jsxs)(`span`,{className:`understand-meta`,children:[e.source&&(0,U.jsx)(c,{file:e.source}),(0,U.jsx)(`button`,{className:`understand-edit`,title:`Fix this`,type:`button`,onClick:()=>D(`Tell Mavéa what's off — it'll adjust`,`info`),children:(0,U.jsx)(s.edit,{})})]})]},t))}),(0,U.jsxs)(`div`,{className:`card-foot`,style:{marginTop:14},children:[(0,U.jsx)(`span`,{className:`faint`,style:{fontSize:12.5},children:`Read straight from your site — correct anything.`}),n&&(0,U.jsx)(p,{level:n,title:t.some(e=>e.source)?void 0:`Best estimate from the model's knowledge — not verified`})]})]})}function tt({title:e=`The data model`,entities:t,relations:n,footer:r,delay:i}){return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.layers,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,U.jsx)(`div`,{className:`schema`,children:t.map((e,t)=>(0,U.jsxs)(`div`,{className:`entity`,style:{"--ec":e.color||`var(--presence)`},children:[(0,U.jsxs)(`div`,{className:`entity-head`,children:[(0,U.jsx)(s.table,{style:{width:13,height:13}}),` `,e.name,e.badge&&(0,U.jsx)(`span`,{className:`entity-badge`,children:e.badge})]}),(0,U.jsx)(`div`,{className:`entity-fields`,children:e.fields.map((e,t)=>(0,U.jsxs)(`div`,{className:`entity-field`,children:[(0,U.jsx)(`span`,{className:`ef-key`+(e.key?` is-key`:``),children:e.name}),(0,U.jsx)(`span`,{className:`ef-type`,children:e.type})]},t))})]},t))}),n&&(0,U.jsx)(`div`,{className:`relations`,children:n.map((e,t)=>(0,U.jsxs)(`span`,{className:`relation`,children:[(0,U.jsx)(`b`,{children:e.from}),` `,e.label,` `,(0,U.jsx)(`b`,{children:e.to})]},t))}),r&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:r})]})}var nt={dashboard:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`wl w60`}),(0,U.jsxs)(`div`,{className:`wgrid`,children:[(0,U.jsx)(`span`,{}),(0,U.jsx)(`span`,{}),(0,U.jsx)(`span`,{})]}),(0,U.jsx)(`span`,{className:`wbar`})]}),table:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`wl w40`}),(0,U.jsx)(`span`,{className:`wrow`}),(0,U.jsx)(`span`,{className:`wrow`}),(0,U.jsx)(`span`,{className:`wrow`}),(0,U.jsx)(`span`,{className:`wrow`})]}),board:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`wl w40`}),(0,U.jsxs)(`div`,{className:`wcols`,children:[(0,U.jsx)(`span`,{}),(0,U.jsx)(`span`,{}),(0,U.jsx)(`span`,{})]})]}),detail:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`wl w50`}),(0,U.jsx)(`span`,{className:`wblock`}),(0,U.jsx)(`span`,{className:`wl w70`}),(0,U.jsx)(`span`,{className:`wl w50`})]}),list:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`wl w40`}),(0,U.jsx)(`span`,{className:`wrow`}),(0,U.jsx)(`span`,{className:`wrow`}),(0,U.jsx)(`span`,{className:`wrow`})]})};function rt({title:e=`The screens you'll get`,screens:t,footer:n,delay:r}){return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(r||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.slides,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,U.jsx)(`div`,{className:`screenmap`,children:t.map((e,t)=>{let n=()=>D(`Opening `+e.name+` — you can rename or reorder`,`info`);return(0,U.jsxs)(`div`,{className:`screen-thumb`,role:`button`,tabIndex:0,"aria-label":`Open ${e.name}`,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},children:[(0,U.jsx)(`div`,{className:`screen-wire`,children:nt[e.kind]||nt.table}),(0,U.jsx)(`figcaption`,{children:e.name})]},t)})}),n&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:n})]})}function it({title:e=`Building it`,steps:t,footer:n,delay:r}){let[i,a]=(0,R.useState)(0),o=t.filter(e=>e.status===`active`).length;(0,R.useEffect)(()=>{if(o===0)return;let e=(r||0)+1400,t=Array.from({length:o},(t,n)=>setTimeout(()=>a(e=>Math.max(e,n+1)),e+n*900));return()=>t.forEach(clearTimeout)},[o,r]);let c=0,l=t.map(e=>{if(e.status!==`active`)return e;let t=c<i;return c+=1,t?{...e,status:`done`}:e}),u=l.findIndex(e=>e.status===`active`);return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(r||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.spark,{className:`ic`,style:{color:`var(--insight)`}}),` `,e]}),(0,U.jsx)(`div`,{className:`buildsteps`,children:l.map((e,t)=>(0,U.jsxs)(`div`,{className:`buildstep `+(e.status||`done`),children:[(0,U.jsx)(`span`,{className:`buildstep-ic`,"data-mark":t===u?`circle`:void 0,children:e.status===`active`?(0,U.jsx)(`span`,{className:`tiny-spin`}):e.status===`todo`?(0,U.jsx)(`span`,{className:`bs-dot`}):(0,U.jsx)(s.check,{})}),(0,U.jsxs)(`span`,{className:`buildstep-body`,children:[(0,U.jsx)(`span`,{className:`buildstep-label`,children:e.label}),e.sub&&(0,U.jsx)(`span`,{className:`buildstep-sub`,children:e.sub})]})]},t))}),n&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:n})]})}function at({app:e,seededFrom:t,nav:n,stages:r,rows:i,kpis:a,columns:o,groupColumns:c=[`Group`,`Items`,`Total`],pipelineLabel:l=`Pipeline by stage`,agg:u=`money`,createdNote:d=`created this with Mavéa`,activities:f,footer:p,delay:m}){let[h,g]=(0,R.useState)(n[0]?.label||``),_=n.find(e=>e.label===h)||n[0],v=e=>u===`money`?`$`+Math.round(e/1e3)+`k`:e.toLocaleString(),y=i.reduce((e,t)=>e+(t.amt||0),0),b=new Map,x=new Map;for(let e of i){let t=b.get(e.group)??{count:0,value:0,color:e.color};t.count+=1,t.value+=e.amt||0,b.set(e.group,t),x.set(e.stage,(x.get(e.stage)??0)+1)}let S=Array.from(b,([e,t])=>({name:e,...t})),C=r.reduce((e,t)=>Math.max(e,x.get(t.key)??0),1),w=f||[],T=({s:e})=>{let t=r.find(t=>t.key===e)||r[0];return(0,U.jsx)(`span`,{className:`at-stage `+t.kind,children:e})};return(0,U.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(m||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,U.jsx)(s.external,{className:`ic`,style:{color:`var(--insight)`}}),` Live preview · your app`,(0,U.jsxs)(`span`,{className:`preview-live`,children:[(0,U.jsx)(`span`,{className:`web-live-dot`}),`working`]})]}),(0,U.jsxs)(`div`,{className:`appframe`,children:[(0,U.jsxs)(`div`,{className:`appframe-bar`,children:[(0,U.jsx)(`span`,{className:`aflight`}),(0,U.jsx)(`span`,{className:`aflight`}),(0,U.jsx)(`span`,{className:`aflight`}),(0,U.jsxs)(`span`,{className:`afurl mono`,children:[e.toLowerCase().replace(/\s+/g,`-`),`.mavea.app`]})]}),(0,U.jsxs)(`div`,{className:`appframe-body`,children:[(0,U.jsxs)(`div`,{className:`appnav`,children:[(0,U.jsx)(`div`,{className:`appnav-brand`,children:e}),n.map((e,t)=>(0,U.jsx)(`button`,{className:`appnav-item`+(h===e.label?` on`:``),type:`button`,onClick:()=>g(e.label),children:e.label},t))]}),(0,U.jsxs)(`div`,{className:`appmain`,children:[(0,U.jsxs)(`div`,{className:`appmain-top`,children:[(0,U.jsx)(`span`,{className:`appmain-title`,children:_?.label}),_?.view===`dashboard`&&t&&(0,U.jsx)(`span`,{className:`appmain-sub`,children:t})]}),_?.view===`dashboard`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`appkpis`,children:a.map((e,t)=>(0,U.jsxs)(`div`,{className:`appkpi`,children:[(0,U.jsx)(`span`,{className:`appkpi-v tab-num`,children:e.v}),(0,U.jsx)(`span`,{className:`appkpi-k`,children:e.k})]},t))}),(0,U.jsxs)(`div`,{className:`appdash`,children:[(0,U.jsxs)(`div`,{className:`apppanel`,children:[(0,U.jsx)(`div`,{className:`apppanel-h`,children:l}),r.map((e,t)=>{let n=i.filter(t=>t.stage===e.key),r=n.reduce((e,t)=>e+(t.amt||0),0),a=Math.round(y?r/y*100:n.length/C*100);return(0,U.jsxs)(`div`,{className:`apppipe`,children:[(0,U.jsxs)(`span`,{className:`apppipe-l`,children:[e.key,` `,(0,U.jsxs)(`span`,{className:`faint`,children:[`· `,n.length]})]}),(0,U.jsx)(`span`,{className:`apppipe-bar`,children:(0,U.jsx)(`i`,{style:{width:Math.max(6,a)+`%`,background:e.color}})}),(0,U.jsx)(`span`,{className:`apppipe-v tab-num`,children:y?v(r):n.length})]},t)})]}),(0,U.jsxs)(`div`,{className:`apppanel`,children:[(0,U.jsx)(`div`,{className:`apppanel-h`,children:`Recent activity`}),w.map((e,t)=>(0,U.jsxs)(`div`,{className:`appact`,children:[(0,U.jsx)(`span`,{className:`at-ava`,style:{background:e.color},children:e.who[0]}),(0,U.jsxs)(`span`,{className:`appact-t`,children:[(0,U.jsx)(`b`,{children:e.who}),` `,e.what]}),(0,U.jsx)(`span`,{className:`appact-when`,children:e.when})]},t))]})]})]}),_?.view===`table`&&(0,U.jsxs)(`div`,{className:`apptable`,children:[(0,U.jsxs)(`div`,{className:`apptable-head`,children:[(0,U.jsx)(`span`,{children:o[0]}),(0,U.jsx)(`span`,{children:o[1]}),(0,U.jsx)(`span`,{children:o[2]}),(0,U.jsx)(`span`,{className:`ta-r`,children:o[3]})]}),i.map((e,t)=>(0,U.jsxs)(`div`,{className:`apptable-row`,children:[(0,U.jsxs)(`span`,{className:`at-name`,children:[(0,U.jsx)(`span`,{className:`at-ava`,style:{background:e.color},children:e.name[0]}),e.name]}),(0,U.jsx)(`span`,{children:e.group}),(0,U.jsx)(`span`,{children:(0,U.jsx)(T,{s:e.stage})}),(0,U.jsx)(`span`,{className:`ta-r tab-num`,children:e.value})]},t))]}),_?.view===`board`&&(0,U.jsx)(`div`,{className:`appboard`,children:r.map((e,t)=>(0,U.jsxs)(`div`,{className:`appcol`,children:[(0,U.jsxs)(`div`,{className:`appcol-h`,children:[(0,U.jsx)(`span`,{className:`appcol-dot`,style:{background:e.color}}),e.key,(0,U.jsx)(`span`,{className:`faint`,children:i.filter(t=>t.stage===e.key).length})]}),i.filter(t=>t.stage===e.key).map((e,t)=>(0,U.jsxs)(`div`,{className:`appdeal`,children:[(0,U.jsx)(`div`,{className:`appdeal-n`,children:e.name}),(0,U.jsxs)(`div`,{className:`appdeal-m`,children:[e.group,` · `,(0,U.jsx)(`span`,{className:`tab-num`,children:e.value})]})]},t))]},t))}),_?.view===`group`&&(0,U.jsxs)(`div`,{className:`apptable`,children:[(0,U.jsxs)(`div`,{className:`apptable-head threecol`,children:[(0,U.jsx)(`span`,{children:c[0]}),(0,U.jsx)(`span`,{children:c[1]}),(0,U.jsx)(`span`,{className:`ta-r`,children:c[2]})]}),S.map((e,t)=>(0,U.jsxs)(`div`,{className:`apptable-row threecol`,children:[(0,U.jsxs)(`span`,{className:`at-name`,children:[(0,U.jsx)(`span`,{className:`at-ava`,style:{background:e.color},children:e.name[0]}),e.name]}),(0,U.jsx)(`span`,{children:e.count}),(0,U.jsx)(`span`,{className:`ta-r tab-num`,children:v(e.value)})]},t))]}),_?.view===`activity`&&(0,U.jsx)(`div`,{className:`appactivity`,children:w.concat([{who:`You`,what:d,when:`just now`,color:`var(--presence-deep)`}]).map((e,t)=>(0,U.jsxs)(`div`,{className:`appact row`,children:[(0,U.jsx)(`span`,{className:`at-ava`,style:{background:e.color},children:e.who[0]}),(0,U.jsxs)(`span`,{className:`appact-t`,children:[(0,U.jsx)(`b`,{children:e.who}),` `,e.what]}),(0,U.jsx)(`span`,{className:`appact-when`,children:e.when})]},t))})]})]})]}),p&&(0,U.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:p})]})}function ot(e){return e>=1100?12:e>=820?9:e>=580?6:4}var st=e=>{let t=e.type??``,n=N[t],r=e.col;return r===void 0?n:n?{...n,pref:r}:{pref:r}};function ct(e,t){if(e.length===0)return e;try{return M(e,st,t)}catch{return e}}function lt(e,t){let n=(0,z.c)(9),[r,i]=(0,R.useState)(ut),a,o;n[0]===t?(a=n[1],o=n[2]):(a=()=>{let e=t.current;if(!e||typeof ResizeObserver>`u`)return;let n=0,r=new ResizeObserver(t=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>{let n=t[0]?.contentRect.width??e.offsetWidth;i(e=>{let t=ot(n);return e===t?e:t})})});r.observe(e);let a=ot(e.offsetWidth);return i(e=>e===a?e:a),()=>{cancelAnimationFrame(n),r.disconnect()}},o=[t],n[0]=t,n[1]=a,n[2]=o),(0,R.useLayoutEffect)(a,o);let s;try{let t;n[3]!==e||n[4]!==r?(t=M(e,st,r),n[3]=e,n[4]=r,n[5]=t):t=n[5],s=t}catch{s=e}let c=s,l;return n[6]!==r||n[7]!==c?(l={displayBlocks:c,budget:r},n[6]=r,n[7]=c,n[8]=l):l=n[8],l}function ut(){return typeof window<`u`?ot(window.innerWidth):12}var dt=new Set([`auto`,`scroll`]);function ft(e){let t=(e.closest(`.card`)?.querySelector(`.card-eyebrow, h1, h2, h3, [role="heading"]`)?.textContent)?.trim().replace(/\s+/g,` `).slice(0,100);return t?`Scrollable content: ${t}`:`Scrollable card content`}function pt(e,t){let n=(0,z.c)(5),r;n[0]===e.current?r=n[1]:(r=()=>{let t=e.current;if(!t)return;let n=new Map,r=0,i=e=>n.has(e)||e.scrollWidth<=e.clientWidth+8?!1:dt.has(getComputedStyle(e).overflowX),a=e=>{let t=e.hasAttribute(`tabindex`),r=e.hasAttribute(`role`),i=e.hasAttribute(`aria-label`)||e.hasAttribute(`aria-labelledby`);t||(e.tabIndex=0),r||e.setAttribute(`role`,`region`),i||e.setAttribute(`aria-label`,ft(e)),e.classList.add(`canvas-hscroll`);let a=()=>{let t=e.scrollLeft+e.clientWidth>=e.scrollWidth-2;e.classList.toggle(`canvas-hscroll--end`,t)};a(),e.addEventListener(`scroll`,a,{passive:!0}),n.set(e,()=>{e.removeEventListener(`scroll`,a),e.classList.remove(`canvas-hscroll`,`canvas-hscroll--end`),t||e.removeAttribute(`tabindex`),r||e.removeAttribute(`role`),i||e.removeAttribute(`aria-label`)})},o=()=>{r=0;let e=[];for(let n of t.querySelectorAll(`*`))i(n)&&e.push(n);for(let t of e)a(t)},s=()=>{r||=requestAnimationFrame(o)};s();let c=window.setTimeout(s,700),l=typeof MutationObserver>`u`?null:new MutationObserver(s);l?.observe(t,{childList:!0,subtree:!0});let u=typeof ResizeObserver>`u`?null:new ResizeObserver(s);return u?.observe(t),()=>{r&&cancelAnimationFrame(r),clearTimeout(c),l?.disconnect(),u?.disconnect();for(let e of n.values())e()}},n[0]=e.current,n[1]=r);let i;n[2]!==t||n[3]!==e?(i=[e,t],n[2]=t,n[3]=e,n[4]=i):i=n[4],(0,R.useEffect)(r,i)}var mt=/…\s*$/u,ht=0;function gt(e){return(e??``).replace(/\s+/g,` `).trim()}var _t=/\S/u;function vt(e){let t=new Map,n=e=>{if(e.tagName.toLowerCase()===`title`)return t.set(e,``),``;let r=``;for(let t of e.childNodes)t.nodeType===Node.TEXT_NODE?r+=`${t.textContent??``} `:t instanceof Element&&(r+=`${n(t)} `);return t.set(e,r),r};return n(e),t}function yt(e,t){let n=t.textOverflow===`ellipsis`&&t.whiteSpace.includes(`nowrap`)&&e.scrollWidth>e.clientWidth+1,r=t.webkitLineClamp||t.getPropertyValue(`-webkit-line-clamp`),i=Number.parseInt(r,10),a=Number.isFinite(i)&&i>0&&e.scrollHeight>e.clientHeight+2;return n||a}function bt(e){let t=[...e.children].find(e=>e.tagName.toLowerCase()===`title`);return gt(e.getAttribute(`data-full-text`)||e.getAttribute(`title`)||t?.textContent||e.getAttribute(`aria-label`))}function xt(e,t,n){let r=bt(e)||(n?t:``),i=e;if(!r||r===t){let n=e.parentElement,a=n?bt(n):``;a&&a!==t&&(r=a,i=n)}return!r||!n&&(r===t||r.length<=t.replace(mt,``).length)||!(i instanceof HTMLElement)&&!(i instanceof SVGElement)?null:{target:i,full:r}}function St(e){return e.matches(`button, a[href], input, select, textarea, summary, [contenteditable="true"]`)}function Ct(e,t){if(e.hasAttribute(`data-semantic-ellipsis`))return null;let n=t.get(e)??``;if(!_t.test(n))return null;let r=getComputedStyle(e);if(r.visibility===`hidden`||parseFloat(r.opacity)===0)return null;let i=gt(n),a=e instanceof HTMLElement&&yt(e,r);if(!mt.test(i)&&!a)return null;let o=xt(e,i,a);return o?{source:e,...o}:null}function wt(e,t){(0,R.useEffect)(()=>{let t=e.current;if(!t)return;let n=`canvas-text-disclosure-${++ht}`,r=document.createElement(`div`);r.id=n,r.className=`canvas-text-popover`,r.setAttribute(`role`,`tooltip`),r.hidden=!0,document.body.appendChild(r);let i=new Map,a=new Set,o=null,s=0,c=0,l=e=>{let t=e.getBoundingClientRect();r.style.maxWidth=`${Math.max(180,Math.min(420,window.innerWidth-24))}px`,r.style.left=`0px`,r.style.top=`0px`;let n=r.getBoundingClientRect(),i=Math.min(window.innerWidth-n.width-12,Math.max(12,t.left)),a=t.top-n.height-8,o=a>=12?a:Math.min(window.innerHeight-n.height-12,t.bottom+8);r.style.left=`${Math.round(i)}px`,r.style.top=`${Math.round(Math.max(12,o))}px`},u=()=>{c&&window.clearTimeout(c),c=0,o?.removeAttribute(`data-text-disclosure-active`),o=null,r.hidden=!0},d=(e,t)=>{c&&window.clearTimeout(c),o?.removeAttribute(`data-text-disclosure-active`),o=e,e.setAttribute(`data-text-disclosure-active`,`true`),r.textContent=t,r.hidden=!1,l(e)},f=({source:e,target:t,full:r})=>{if(e.setAttribute(`data-text-disclosure`,`true`),a.add(e),i.has(t))return;let s=t.hasAttribute(`tabindex`),l=t.hasAttribute(`role`),f=t.getAttribute(`aria-label`),p=t.getAttribute(`aria-describedby`);s||t.setAttribute(`tabindex`,`0`),!l&&!St(t)&&t.setAttribute(`role`,`button`),f||t.setAttribute(`aria-label`,r);let m=new Set(gt(p).split(` `).filter(Boolean));m.add(n),t.setAttribute(`aria-describedby`,[...m].join(` `)),t.setAttribute(`data-text-disclosure`,`true`);let h=()=>d(t,r),g=()=>{c=window.setTimeout(u,120)},_=()=>o===t?u():d(t,r),v=e=>{let n=e.key;n===`Escape`&&u(),(n===`Enter`||n===` `)&&!St(t)&&(e.preventDefault(),d(t,r))};t.addEventListener(`pointerenter`,h),t.addEventListener(`pointerleave`,g),t.addEventListener(`focus`,h),t.addEventListener(`blur`,g),t.addEventListener(`click`,_),t.addEventListener(`keydown`,v),i.set(t,()=>{t.removeEventListener(`pointerenter`,h),t.removeEventListener(`pointerleave`,g),t.removeEventListener(`focus`,h),t.removeEventListener(`blur`,g),t.removeEventListener(`click`,_),t.removeEventListener(`keydown`,v),t.removeAttribute(`data-text-disclosure`),t.removeAttribute(`data-text-disclosure-active`),s||t.removeAttribute(`tabindex`),l||t.removeAttribute(`role`),f||t.removeAttribute(`aria-label`),p===null?t.removeAttribute(`aria-describedby`):t.setAttribute(`aria-describedby`,p)})},p=()=>{s=0;let e=vt(t),n=[];for(let r of t.querySelectorAll(`*`)){let t=Ct(r,e);t&&n.push(t)}for(let e of n)f(e)},m=()=>{s||=requestAnimationFrame(p)},h=e=>{o&&!o.contains(e.target)&&u()},g=()=>{o&&!r.hidden&&l(o)};m();let _=window.setTimeout(m,700),v=typeof MutationObserver>`u`?null:new MutationObserver(m);v?.observe(t,{childList:!0,subtree:!0});let y=typeof ResizeObserver>`u`?null:new ResizeObserver(m);return y?.observe(t),document.addEventListener(`pointerdown`,h,!0),window.addEventListener(`resize`,g,{passive:!0}),window.addEventListener(`scroll`,g,{passive:!0,capture:!0}),()=>{s&&cancelAnimationFrame(s),c&&window.clearTimeout(c),clearTimeout(_),v?.disconnect(),y?.disconnect(),document.removeEventListener(`pointerdown`,h,!0),window.removeEventListener(`resize`,g),window.removeEventListener(`scroll`,g,!0);for(let e of i.values())e();for(let e of a)e.removeAttribute(`data-text-disclosure`);r.remove()}},[e,t])}function Tt(e){if(!e)return;let t=e.parentElement;if(!t)return;let n=()=>{let n=Math.ceil(e.getBoundingClientRect().width);n>0&&t.style.setProperty(`--block-actions-w`,`${n+18}px`)};return n(),H(e,n)}function Et(e){return e.some(e=>typeof e.section==`string`&&e.section.trim()!==``)}function Dt(e){if(!Et(e))return[{label:``,order:0,standard:e.slice(),deeper:[]}];let t=0,n=new Map;for(let r of e){let e=r.section,i=(typeof e==`string`?e.trim():``)||`__ungrouped__`;if(!n.has(i)){let e=typeof r.order==`number`?r.order:0;n.set(i,{ord:e||++t,standard:[],deeper:[]})}let a=n.get(i),o=r.depth;(typeof o==`number`?o:1)>=2?a.deeper.push(r):a.standard.push(r)}let r=[];for(let[e,t]of n)t.standard.length===0&&t.deeper.length>0&&t.standard.push(t.deeper.shift()),r.push({label:e===`__ungrouped__`?``:e,order:t.ord,standard:t.standard,deeper:t.deeper});return r.sort((e,t)=>e.order-t.order),r}function Ot(e){let t=(0,z.c)(25),{section:n,renderCard:r,readingMode:i}=e,[a,o]=(0,R.useState)(!1),c=i||a,l=n.deeper.length>0,u=`depth-drawer-${n.order}`,d;t[0]!==u||t[1]!==l||t[2]!==c||t[3]!==n.deeper.length||t[4]!==n.label||t[5]!==n.order?(d=n.label&&(0,U.jsxs)(`div`,{className:`depth-section-header`,children:[n.order>0&&(0,U.jsx)(`span`,{className:`depth-section-num`,"aria-hidden":`true`,children:n.order}),(0,U.jsx)(`span`,{className:`depth-section-label`,children:n.label}),l&&(0,U.jsxs)(`button`,{type:`button`,className:`depth-go-deeper`+(c?` is-open`:``),"aria-expanded":c,"aria-controls":u,onClick:()=>o(kt),children:[(0,U.jsx)(s.arrowDown,{className:`depth-deeper-icon`,"aria-hidden":`true`}),`Go deeper`,(0,U.jsxs)(`span`,{className:`depth-deeper-count`,children:[`(`,n.deeper.length,`)`]})]})]}),t[0]=u,t[1]=l,t[2]=c,t[3]=n.deeper.length,t[4]=n.label,t[5]=n.order,t[6]=d):d=t[6];let f;if(t[7]!==r||t[8]!==n.standard){let e;t[10]===r?e=t[11]:(e=(e,t)=>r(e,t),t[10]=r,t[11]=e),f=n.standard.map(e),t[7]=r,t[8]=n.standard,t[9]=f}else f=t[9];let p;t[12]===f?p=t[13]:(p=(0,U.jsx)(`div`,{className:`card-grid`,children:f}),t[12]=f,t[13]=p);let m;t[14]!==u||t[15]!==l||t[16]!==c||t[17]!==r||t[18]!==n.deeper||t[19]!==n.standard.length?(m=l&&(0,U.jsx)(`div`,{className:`depth-drawer`+(c?` is-open`:``),id:u,"aria-hidden":!c,children:(0,U.jsx)(`div`,{className:`depth-drawer-inner`,children:(0,U.jsx)(`div`,{className:`card-grid depth-drawer-grid`,children:n.deeper.map((e,t)=>r(e,n.standard.length+t))})})}),t[14]=u,t[15]=l,t[16]=c,t[17]=r,t[18]=n.deeper,t[19]=n.standard.length,t[20]=m):m=t[20];let h;return t[21]!==d||t[22]!==p||t[23]!==m?(h=(0,U.jsxs)(`div`,{className:`depth-section`,children:[d,p,m]}),t[21]=d,t[22]=p,t[23]=m,t[24]=h):h=t[24],h}function kt(e){return!e}function At(e){let t=(0,z.c)(33),{bend:n}=e,[r,i]=(0,R.useState)(n.param.value),a=n.param.unit??``,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,U.jsx)(`span`,{className:`bend-kicker`,children:`BEND IT`}),t[0]=o):o=t[0];let s;t[1]===n.label?s=t[2]:(s=(0,U.jsx)(`span`,{className:`bend-label`,children:n.label}),t[1]=n.label,t[2]=s);let c;t[3]===r?c=t[4]:(c=P(r),t[3]=r,t[4]=c);let l;t[5]===a?l=t[6]:(l=a&&(0,U.jsx)(`em`,{children:a}),t[5]=a,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,U.jsxs)(`span`,{className:`bend-value`,children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d;t[10]!==s||t[11]!==u?(d=(0,U.jsxs)(`div`,{className:`bend-head`,children:[o,s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>i(Number(e.target.value)),t[13]=f):f=t[13];let p=`Bend ${n.label}`,m;t[14]!==n.param.max||t[15]!==n.param.min||t[16]!==n.param.step||t[17]!==p||t[18]!==r?(m=(0,U.jsx)(`input`,{className:`bend-slider`,type:`range`,min:n.param.min,max:n.param.max,step:n.param.step,value:r,onChange:f,"aria-label":p}),t[14]=n.param.max,t[15]=n.param.min,t[16]=n.param.step,t[17]=p,t[18]=r,t[19]=m):m=t[19];let h;if(t[20]!==n.label||t[21]!==n.outputs||t[22]!==r){let e;t[24]!==n.label||t[25]!==r?(e=e=>{let t=F(e.formula,r);return t===null?null:(0,U.jsxs)(`li`,{title:`= ${e.formula.replaceAll(`x`,`(${n.label})`)}`,children:[(0,U.jsx)(`span`,{className:`bend-out-label`,children:e.label}),(0,U.jsxs)(`span`,{className:`bend-out-value`,children:[P(t),e.unit&&(0,U.jsx)(`em`,{children:e.unit})]})]},e.label)},t[24]=n.label,t[25]=r,t[26]=e):e=t[26],h=n.outputs.map(e),t[20]=n.label,t[21]=n.outputs,t[22]=r,t[23]=h}else h=t[23];let g;t[27]===h?g=t[28]:(g=(0,U.jsx)(`ul`,{className:`bend-outputs`,children:h}),t[27]=h,t[28]=g);let _;return t[29]!==g||t[30]!==d||t[31]!==m?(_=(0,U.jsxs)(`div`,{className:`bend-strip`,"data-bend":!0,children:[d,m,g]}),t[29]=g,t[30]=d,t[31]=m,t[32]=_):_=t[32],_}var jt=15e3,Mt=5e3;async function Nt(e,t){let n=I(e);if(!n)return{ok:!1,detail:`Unknown action: ${e}`};for(let e of n.params)if(e.required&&!(t[e.name]??``).trim())return{ok:!1,detail:`Missing required field: ${e.name}`};try{let r=JSON.stringify({args:t}),i=await L(`/actions/confirm`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,args:t})},Mt),a=await i.json().catch(()=>({}));if(!i.ok||!a.confirmationToken)return{ok:!1,detail:a.detail||`The action confirmation expired. Please try again.`};let o=await L(`/actions/${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`,"x-action-confirmation":a.confirmationToken},body:r},jt),s=await o.json().catch(()=>({}));return o.ok?{ok:!0,detail:s.detail||`${n.label} — done.`}:{ok:!1,detail:s.detail||`The ${n.mcp} action didn't go through (${o.status}).`}}catch{return{ok:!1,detail:`Couldn't reach the ${n.mcp} connector — is it set up in this deployment?`}}}function Pt({id:e,label:t,args:n={},delay:r=0}){let i=I(e),[a,o]=(0,R.useState)(`idle`),[s,c]=(0,R.useState)(``);if(!i)return null;let l={};for(let[e,t]of Object.entries(n))l[e]=typeof t==`string`?t:t==null?``:String(t);return(0,U.jsxs)(`div`,{className:`card reveal`,style:{animationDelay:`${r}ms`},children:[(0,U.jsx)(`div`,{className:`card-eyebrow`,children:i.label}),(0,U.jsx)(`div`,{style:{fontWeight:600,fontSize:15,marginBottom:10},children:t||i.desc}),(0,U.jsx)(`dl`,{style:{margin:`0 0 12px`,display:`grid`,gap:4},children:i.params.map(e=>{let t=l[e.name];return t?(0,U.jsxs)(`div`,{style:{display:`flex`,gap:8,fontSize:13},children:[(0,U.jsx)(`dt`,{className:`faint`,style:{minWidth:84},children:e.name}),(0,U.jsx)(`dd`,{style:{margin:0},children:t})]},e.name):null})}),a===`done`?(0,U.jsxs)(`div`,{style:{fontSize:13,color:`var(--insight)`},children:[`✓ `,s]}):a===`error`?(0,U.jsx)(`div`,{style:{fontSize:13,color:`var(--warning)`},children:s}):(0,U.jsx)(`button`,{className:`entry-action`,onClick:async()=>{o(`running`);let t=await Nt(e,l);c(t.detail),o(t.ok?`done`:`error`)},disabled:a===`running`,style:{fontSize:13},children:a===`running`?`Working…`:i.cta}),(0,U.jsx)(`div`,{className:`faint`,style:{fontSize:11.5,marginTop:8},children:`Review before confirming. You are responsible for recipients, account changes, irreversible effects, provider terms, charges, and other consequences.`})]})}var Ft=6;function It(e,t){return e?.find(e=>e.key===t)}function Lt(e,t){return!e||e.kind!==`card`?!1:!e.accepts||e.accepts.includes(t)}function Rt(e,t,n){let[r,i]=(0,R.useState)(null),a=(0,R.useRef)(null),o=(0,R.useRef)(null),s=(0,R.useRef)(e);s.current=e;let c=(0,R.useRef)(t);c.current=t;let l=(0,R.useRef)(n);l.current=n;let u=()=>{o.current?.classList.remove(`is-drop-target`),o.current=null},d=(e,t,n)=>{let r=document.elementFromPoint(e,t)?.closest(`[data-blank-key]`)??null,i=r?.getAttribute(`data-blank-key`)??``;return r&&Lt(It(s.current,i),n)?{el:r,key:i}:null};return{handleProps:(0,R.useCallback)(e=>({onPointerDown:t=>{t.button===0&&(a.current={block:e,startX:t.clientX,startY:t.clientY,armed:!1},t.currentTarget.setPointerCapture(t.pointerId))},onPointerMove:e=>{let t=a.current;if(!t)return;if(!t.armed){if(Math.hypot(e.clientX-t.startX,e.clientY-t.startY)<Ft)return;t.armed=!0}i({label:y(t.block),x:e.clientX,y:e.clientY});let n=d(e.clientX,e.clientY,t.block.type);if(o.current&&o.current!==n?.el&&u(),n){let e=n.el.querySelector(`.blank-drop`)??n.el;e.classList.add(`is-drop-target`),o.current=e}},onPointerUp:e=>{let t=a.current;if(a.current=null,i(null),u(),t){if(t.armed){let n=d(e.clientX,e.clientY,t.block.type);n&&c.current(n.key,t.block)}else l.current?.(t.block)}}}),[]),ghost:r?(0,U.jsx)(`div`,{className:`card-drag-ghost`,style:{left:r.x,top:r.y},"aria-hidden":!0,children:r.label}):null}}function zt(e){let t=e.find(e=>e.type===`insight`&&!!e.id);return t?.id?t.id:e.find(e=>!!e.id)?.id??null}var Bt=340;function Vt(e){let t=(0,z.c)(9),{block:n,renderBlock:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={width:Bt},t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,U.jsx)(v,{block:n}),t[1]=n,t[2]=a);let o;t[3]!==n||t[4]!==r?(o=r(n),t[3]=n,t[4]=r,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,U.jsx)(`span`,{className:`filmstrip-thumb`,"aria-hidden":`true`,inert:!0,children:(0,U.jsx)(`span`,{className:`filmstrip-thumb-design`,style:i,children:(0,U.jsx)(_,{fallback:a,children:o})})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}var Ht=(0,R.memo)(Vt,(e,t)=>e.block===t.block),Ut=24;function Wt(e){let t=(0,z.c)(21),{blocks:n,activeId:r,narratingId:i,onPick:a,renderBlock:o}=e,s=n.slice(0,Ut),c=n.length-s.length,l=(0,R.useRef)(null),u;t[0]===r?u=t[1]:(u=e=>e.id===r,t[0]=r,t[1]=u);let d=Math.max(0,s.findIndex(u)),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=window.setTimeout(()=>{let e=l.current?.querySelector(`.filmstrip-entry.active`);e&&typeof e.scrollIntoView==`function`&&e.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:S()?`auto`:`smooth`})},60);return()=>window.clearTimeout(e)},t[2]=f):f=t[2];let p;t[3]===r?p=t[4]:(p=[r],t[3]=r,t[4]=p),(0,R.useEffect)(f,p);let m=e=>{let t=s.length;if(!t)return;let n=document.activeElement,r=n instanceof HTMLElement?n.dataset.idx:void 0,i=r===void 0?d:Number(r),o;bb37:switch(e.key){case`ArrowDown`:case`ArrowRight`:o=Math.min(t-1,i+1);break bb37;case`ArrowUp`:case`ArrowLeft`:o=Math.max(0,i-1);break bb37;case`Home`:o=0;break bb37;case`End`:o=t-1;break bb37;default:return}e.preventDefault(),l.current?.querySelector(`[data-idx="${o}"]`)?.focus();let c=s[o].id;c&&a(c)},h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,U.jsx)(`div`,{className:`filmstrip-eyebrow`,children:`In this view`}),t[5]=h):h=t[5];let g;t[6]!==r||t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==d?(g=(e,t)=>{let n=e.id===r,s=!!e.id&&e.id===i;return(0,U.jsxs)(`div`,{role:`button`,"data-idx":t,tabIndex:t===d?0:-1,className:`filmstrip-entry`+(n?` active`:``)+(s?` speaking`:``),"aria-current":n?`true`:void 0,"aria-label":`${b(e)} — ${y(e)}`,onClick:()=>a(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),a(e.id))},children:[(0,U.jsx)(Ht,{block:e,renderBlock:o}),s&&(0,U.jsx)(`span`,{className:`filmstrip-speaking`,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{className:`filmstrip-meta`,children:[(0,U.jsx)(`span`,{className:`filmstrip-kind`,children:b(e)}),(0,U.jsx)(`span`,{className:`filmstrip-title`,children:y(e)})]})]},e.id)},t[6]=r,t[7]=i,t[8]=a,t[9]=o,t[10]=d,t[11]=g):g=t[11];let _=s.map(g),v;t[12]===c?v=t[13]:(v=c>0&&(0,U.jsxs)(`div`,{className:`filmstrip-more`,children:[`+`,c,` more card`,c===1?``:`s`]}),t[12]=c,t[13]=v);let x;t[14]!==m||t[15]!==_||t[16]!==v?(x=(0,U.jsxs)(`div`,{className:`filmstrip-list`,ref:l,role:`toolbar`,onKeyDown:m,children:[_,v]}),t[14]=m,t[15]=_,t[16]=v,t[17]=x):x=t[17];let C;return t[18]!==x||t[19]!==h?(C=(0,U.jsxs)(`aside`,{className:`filmstrip-rail`,"aria-label":`All cards in this view`,children:[h,x]}),t[18]=x,t[19]=h,t[20]=C):C=t[20],C}var Gt=560;function Kt(e){let t=(0,z.c)(93),{data:n,blocks:r,spot:i,renderBlock:a,onAskBlock:o,selectedBlockIds:c,onNarrate:l,narratingId:u,muted:d,walkNotes:f,presenting:p}=e,m;t[0]===r?m=t[1]:(m=r.filter(qt),t[0]=r,t[1]=m);let h=m,[g,b]=(0,R.useState)(null),x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>b(null),t[2]=x):x=t[2];let C;t[3]===n.id?C=t[4]:(C=[n.id],t[3]=n.id,t[4]=C),(0,R.useEffect)(x,C);let w;t[5]!==l||t[6]!==h?(w=e=>{b(e);let t=h.find(t=>t.id===e);t&&l?.(t)},t[5]=l,t[6]=h,t[7]=w):w=t[7];let T=w,E;t[8]!==g||t[9]!==h||t[10]!==i?(E=(g&&h.some(e=>e.id===g)?g:null)??(i&&h.some(e=>e.id===i)?i:null)??zt(h),t[8]=g,t[9]=h,t[10]=i,t[11]=E):E=t[11];let D=E,O;t[12]!==D||t[13]!==h?(O=h.find(e=>e.id===D)??h[0],t[12]=D,t[13]=h,t[14]=O):O=t[14];let k=O,[A,j]=(0,R.useState)(null),M=(0,R.useRef)(k?.id??null),N;t[15]===k?.id?N=t[16]:(N=()=>{let e=k?.id??null;if(e===M.current)return;let t=M.current;if(M.current=e,!t||S()){j(null);return}j(t);let n=window.setTimeout(()=>j(null),Gt);return()=>window.clearTimeout(n)},t[15]=k?.id,t[16]=N);let P=k?.id,F;t[17]===P?F=t[18]:(F=[P],t[17]=P,t[18]=F),(0,R.useEffect)(N,F);let I;t[19]!==k||t[20]!==c?(I=!!k?.id&&!!c?.has(k.id),t[19]=k,t[20]=c,t[21]=I):I=t[21];let L=I,ee=!d&&!!k?.id&&u===k.id,te=k?.note||null,B;t[22]!==k?.id||t[23]!==A||t[24]!==h?(B=A&&A!==k?.id?h.find(e=>e.id===A):void 0,t[22]=k?.id,t[23]=A,t[24]=h,t[25]=B):B=t[25];let V=B,ne;t[26]===k?.id?ne=t[27]:(ne=e=>e.id===k?.id,t[26]=k?.id,t[27]=ne);let H=h.findIndex(ne),W;t[28]!==H||t[29]!==T||t[30]!==h?(W=()=>{H>0&&T(h[H-1].id)},t[28]=H,t[29]=T,t[30]=h,t[31]=W):W=t[31];let G=W,re;t[32]!==H||t[33]!==T||t[34]!==h?(re=()=>{H<h.length-1&&T(h[H+1].id)},t[32]=H,t[33]=T,t[34]=h,t[35]=re):re=t[35];let K=re,ie,ae;if(t[36]!==K||t[37]!==G||t[38]!==p?(ie=()=>{if(!p)return;let e=e=>{e.key===`ArrowRight`||e.key===`ArrowDown`||e.key===` `?(e.preventDefault(),K()):(e.key===`ArrowLeft`||e.key===`ArrowUp`)&&(e.preventDefault(),G())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},ae=[p,G,K],t[36]=K,t[37]=G,t[38]=p,t[39]=ie,t[40]=ae):(ie=t[39],ae=t[40]),(0,R.useEffect)(ie,ae),!k)return null;let q,J;if(t[41]!==T||t[42]!==k.id||t[43]!==p||t[44]!==f){let e=!p&&f&&f.length>0?[...f].reverse():null;q=`focus-stage`+(e?` has-notes`:``),J=e&&(0,U.jsxs)(`aside`,{className:`focus-notes`,"aria-label":`Mavéa's notes`,children:[(0,U.jsx)(`div`,{className:`focus-notes-eyebrow`,children:`Mavéa’s notes`}),(0,U.jsx)(`ol`,{className:`focus-notes-list`,children:e.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsx)(`button`,{type:`button`,className:`focus-note`+(e.spot===k?.id?` active`:``),onClick:()=>T(e.spot),title:`Bring this card back on stage`,children:e.text})},e.spot))})]}),t[41]=T,t[42]=k.id,t[43]=p,t[44]=f,t[45]=q,t[46]=J}else q=t[45],J=t[46];let oe;t[47]!==V||t[48]!==a?(oe=V&&(0,U.jsx)(`div`,{className:`focus-hero-card focus-out`,"aria-hidden":`true`,children:(0,U.jsx)(_,{fallback:(0,U.jsx)(v,{block:V}),children:a(V)})},`out-`+V.id),t[47]=V,t[48]=a,t[49]=oe):oe=t[49];let se=k.id,ce=k.id,le;t[50]===ee?le=t[51]:(le=ee&&(0,U.jsxs)(`div`,{className:`focus-speaking`,"aria-hidden":`true`,children:[(0,U.jsxs)(`span`,{className:`focus-speaking-bars`,children:[(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{}),(0,U.jsx)(`i`,{})]}),`Speaking`]}),t[50]=ee,t[51]=le);let Y;t[52]===k?Y=t[53]:(Y=(0,U.jsx)(v,{block:k}),t[52]=k,t[53]=Y);let X;t[54]!==k||t[55]!==a?(X=a(k),t[54]=k,t[55]=a,t[56]=X):X=t[56];let Z;t[57]!==Y||t[58]!==X?(Z=(0,U.jsx)(_,{fallback:Y,children:X}),t[57]=Y,t[58]=X,t[59]=Z):Z=t[59];let Q;t[60]!==k||t[61]!==L||t[62]!==o?(Q=o&&k.id&&(0,U.jsx)(`div`,{className:`block-actions`,children:(0,U.jsxs)(`button`,{type:`button`,className:`block-action-pill block-ask`+(L?` picked`:``),"aria-pressed":L,"aria-label":L?`Unpin ${y(k)}`:`Ask about ${y(k)}`,onClick:e=>{e.stopPropagation(),o(k)},children:[(0,U.jsx)(s.chat,{}),(0,U.jsx)(`span`,{className:`block-pill-label`,children:L?`Selected`:`Ask`})]})}),t[60]=k,t[61]=L,t[62]=o,t[63]=Q):Q=t[63];let ue;t[64]!==k.id||t[65]!==le||t[66]!==Z||t[67]!==Q?(ue=(0,U.jsxs)(`div`,{className:`focus-hero-card focus-in askable`,"data-spot-id":ce,children:[le,Z,Q]},se),t[64]=k.id,t[65]=le,t[66]=Z,t[67]=Q,t[68]=ue):ue=t[68];let $;t[69]!==oe||t[70]!==ue?($=(0,U.jsxs)(`div`,{className:`focus-hero`,children:[oe,ue]}),t[69]=oe,t[70]=ue,t[71]=$):$=t[71];let de;t[72]!==k.id||t[73]!==te?(de=te&&(0,U.jsx)(`p`,{className:`focus-caption`,"aria-live":`polite`,children:te},`cap-`+k.id),t[72]=k.id,t[73]=te,t[74]=de):de=t[74];let fe;t[75]!==$||t[76]!==de?(fe=(0,U.jsxs)(`div`,{className:`focus-main`,children:[$,de]}),t[75]=$,t[76]=de,t[77]=fe):fe=t[77];let pe;t[78]!==H||t[79]!==K||t[80]!==T||t[81]!==G||t[82]!==k.id||t[83]!==u||t[84]!==p||t[85]!==h||t[86]!==a?(pe=p?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,className:`present-arrow present-arrow-prev`,onClick:G,disabled:H<=0,"aria-label":`Previous slide`,children:(0,U.jsx)(s.chevL,{})}),(0,U.jsx)(`button`,{type:`button`,className:`present-arrow present-arrow-next`,onClick:K,disabled:H>=h.length-1,"aria-label":`Next slide`,children:(0,U.jsx)(s.chevR,{})}),(0,U.jsx)(`div`,{className:`present-nav`,"aria-label":`Slide navigation`,children:(0,U.jsxs)(`span`,{className:`present-nav-count`,"aria-live":`polite`,"aria-atomic":`true`,children:[H+1,` `,(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),` `,h.length]})})]}):(0,U.jsx)(Wt,{blocks:h,activeId:k.id??null,narratingId:u??null,onPick:T,renderBlock:a}),t[78]=H,t[79]=K,t[80]=T,t[81]=G,t[82]=k.id,t[83]=u,t[84]=p,t[85]=h,t[86]=a,t[87]=pe):pe=t[87];let me;return t[88]!==q||t[89]!==J||t[90]!==fe||t[91]!==pe?(me=(0,U.jsxs)(`div`,{className:q,children:[J,fe,pe]}),t[88]=q,t[89]=J,t[90]=fe,t[91]=pe,t[92]=me):me=t[92],me}function qt(e){return!!e.id}var Jt=[{mode:`focus`,label:`Focus`},{mode:`everything`,label:`Everything`}];function Yt(e){let t=(0,z.c)(5),{value:n,onChange:r}=e,i;t[0]!==r||t[1]!==n?(i=Jt.map(e=>{let t=n===e.mode;return(0,U.jsx)(`button`,{type:`button`,className:`focus-toggle-opt`+(t?` active`:``),"aria-pressed":t,onClick:()=>r(e.mode),children:e.label},e.mode)}),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,U.jsx)(`div`,{className:`focus-toggle`,role:`group`,"aria-label":`Canvas view`,children:i}),t[3]=i,t[4]=a),a}var Xt=e({TopicCanvas:()=>sn});i();var Zt=(0,R.lazy)(()=>a(()=>import(`./ReplayCard-CKo5reXy.js`).then(e=>e.t).then(e=>({default:e.ReplayCard})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),Qt=1,$t=1.75,en=.15,tn=1.15;function nn(e){return typeof e!=`number`||!Number.isFinite(e)?6:Math.min(12,Math.max(1,Math.round(e)))}function rn(e,t){let n=s[e]||s.layers;return(0,U.jsx)(n,{className:`ic`,style:{color:t||`var(--presence)`}})}function an({block:e,nest:t,spotlight:n,dimmed:r,spot:i,onProve:a,onUnrenderable:o}){let s={delay:e.delay};if(e.type===`composite`){if(t>=2)return null;let n=e.props;return(0,U.jsxs)(`div`,{className:`card reveal cmp-card`,style:{"--delay":(e.delay||0)+`ms`},children:[(0,U.jsxs)(`div`,{className:`card-eyebrow`,children:[n.icon&&rn(n.icon,n.iconColor),` `,n.title]}),(0,U.jsx)(`div`,{className:`cmp-grid`,children:n.regions.map((e,n)=>(0,U.jsx)(`div`,{className:`cmp-cell`,"data-spot-id":e.block.id,"data-kind":e.block.type,style:{"--cmp-span":nn(e.span)},children:(0,U.jsx)(on,{block:e.block,nest:t+1,spotlight:!!e.block.id&&i===e.block.id,dimmed:!!e.block.id&&!!i&&i!==e.block.id,spot:e.block.type===`composite`?i:null,onProve:a,onUnrenderable:o})},n))}),n.footer&&(0,U.jsx)(`div`,{className:`cmp-foot`,children:n.footer})]})}if(e.type===`insight`)return(0,U.jsx)(_e,{num:e.num,...e.props,...s,spotlight:n,dimmed:r,onProve:e.prove?a:void 0});if(e.type===`chart`)return(0,U.jsx)(ye,{...e.props,...s});if(e.type===`breakdown`)return(0,U.jsx)(be,{...e.props,...s});if(e.type===`timeline`)return(0,U.jsx)(xe,{...e.props,...s});if(e.type===`list`)return(0,U.jsx)(Ce,{...e.props,...s});if(e.type===`compare`)return(0,U.jsx)(we,{...e.props,...s});if(e.type===`ring`)return(0,U.jsx)(ke,{...e.props,...s});if(e.type===`bars`)return(0,U.jsx)(Ae,{...e.props,...s});if(e.type===`stack`)return(0,U.jsx)(je,{...e.props,...s});if(e.type===`scatter`)return(0,U.jsx)(Me,{...e.props,...s});if(e.type===`heat`)return(0,U.jsx)(Ne,{...e.props,...s});if(e.type===`flow`)return(0,U.jsx)(Pe,{...e.props,...s});if(e.type===`web`)return(0,U.jsx)(Fe,{...e.props,...s});if(e.type===`gallery`)return(0,U.jsx)(ze,{...e.props,...s});if(e.type===`codemap`)return(0,U.jsx)(Be,{...e.props,...s});if(e.type===`diff`)return(0,U.jsx)(Ve,{...e.props,...s});if(e.type===`checks`)return(0,U.jsx)(We,{...e.props,...s});if(e.type===`donut`)return(0,U.jsx)(Ge,{...e.props,...s});if(e.type===`gauge`)return(0,U.jsx)(Ke,{...e.props,...s});if(e.type===`scoreboard`)return(0,U.jsx)(qe,{...e.props,...s});if(e.type===`standings`)return(0,U.jsx)(Je,{...e.props,...s});if(e.type===`pipeline`)return(0,U.jsx)(Ye,{...e.props,...s});if(e.type===`kpi`)return(0,U.jsx)(Ze,{...e.props,...s});if(e.type===`quotes`)return(0,U.jsx)(Qe,{...e.props,...s});if(e.type===`checklist`)return(0,U.jsx)($e,{...e.props,...s});if(e.type===`understand`)return(0,U.jsx)(et,{...e.props,...s});if(e.type===`schema`)return(0,U.jsx)(tt,{...e.props,...s});if(e.type===`screenmap`)return(0,U.jsx)(rt,{...e.props,...s});if(e.type===`buildprog`)return(0,U.jsx)(it,{...e.props,...s});if(e.type===`preview`)return(0,U.jsx)(at,{...e.props,...s});if(e.type===`action`){let t=e.props;return(0,U.jsx)(Pt,{...t,...s})}let c=e,l=m(c.type);if(l){let e=l(c.props,{delay:c.delay,spotlight:n,dimmed:r,blockId:c.id,onUnrenderable:o});return K.has(c.type)?(0,U.jsx)(G,{children:e}):e}return(0,U.jsx)(v,{block:e})}var on=(0,R.memo)(an);function sn({data:e,spot:t,built:n,onProve:r,onAskBlock:i,onAddToDashboard:a,selectedBlockIds:o,viewMode:c,onViewMode:l,onNarrate:d,narratingId:p,muted:m,noteGutter:g,walkNotes:b,bend:x,onAddToFlashcard:S,flashedIds:C,headerSlot:w,viewSlot:T,belowHeaderSlot:E,presenting:D,blankFill:O}){let[k,A]=(0,R.useState)(null),[j,M]=(0,R.useState)(!1),[N,P]=(0,R.useState)(null),[F,I]=(0,R.useState)(tn);(0,R.useEffect)(()=>{if(!N)return;let e=e=>{e.key===`Escape`&&P(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[N]);let L=(0,R.useRef)(null),[z]=le(),[B,V]=(0,R.useState)(()=>new Set);(0,R.useEffect)(()=>{V(e=>e.size?new Set:e)},[e.id]);let ne=(0,R.useCallback)(e=>{V(t=>t.has(e)?t:new Set(t).add(e))},[]),H=(0,R.useMemo)(()=>B.size?e.blocks.filter(e=>!e.id||!B.has(e.id)):e.blocks,[e.blocks,B]),{displayBlocks:W=H,budget:G}=lt(H,L),re=te(e.blocks),K=`${e.id}:${re}:${G}`;pt(L,K),wt(L,K);let ie=e.blocks.find(e=>e.type===`preview`),ae=ie?ie.props:null,q=c!==void 0&&W.filter(e=>!!e.id).length>=2,J=q&&c===`focus`,oe=c!==void 0&&f(e),se=oe&&c===`canvas`,ce=(0,R.useRef)(c);ce.current=c,(0,R.useEffect)(()=>{ce.current===`canvas`&&l?.(`everything`)},[e.id,l]);let Y=e.blanks?.filter(e=>e.kind===`card`)??[],X=!!O&&Y.length>0,Z=Rt(e.blanks,(e,t)=>O?.fill({kind:`card`,key:e,label:y(t),block:t}),e=>{let t=Y.find(e=>e.key===O?.activeKey)??Y[0];t&&O?.fill({kind:`card`,key:t.key,label:y(e),block:e})}),Q=(0,R.useRef)(r);Q.current=r;let ue=(0,R.useCallback)(()=>Q.current(),[]),$=e=>(0,U.jsx)(on,{block:e,nest:0,spotlight:!!e.id&&t===e.id,dimmed:!!e.id&&!!t&&t!==e.id,spot:e.type===`composite`?t:null,onProve:ue,onUnrenderable:ne}),de=t=>t.kind===`slide`?(0,U.jsx)(Ee,{...t.props}):t.kind===`action`?(0,U.jsx)(Oe,{...t.props,onConfirm:ae?()=>A(ae):void 0}):t.kind===`replay`?(0,U.jsx)(R.Suspense,{fallback:null,children:(0,U.jsx)(Zt,{...t.props,spec:e})}):null,fe=(0,R.useMemo)(()=>Dt(W).map(e=>({...e,standard:ct(e.standard,G),deeper:ct(e.deeper,G)})),[W,G]),pe=Et(W),he=fe.some(e=>e.deeper.length>0),ge=(e,n)=>{let r=!!e.id,c=r&&t===e.id,l=r&&!!t&&t!==e.id,u=r&&!!i,d=r&&!!a,f=r&&!!S,p=f&&!!C?.has(e.id),m=u&&!!o?.has(e.id),h=r&&(u||d||f),g=X&&r&&e.type!==`blanks`;return(0,U.jsxs)(`div`,{className:`col-`+e.col+(c?` spotlit`:``)+(l?` dimmed`:``)+(u?` askable`:``)+(d?` addable`:``)+(f?` flashcardable`:``)+(h?` zoomable`:``)+(m?` picked`:``),"data-spot-id":e.id,"data-kind":e.type,children:[(0,U.jsx)(_,{fallback:(0,U.jsx)(v,{block:e}),children:$(e)}),x&&x.blockId===e.id&&(0,U.jsx)(At,{bend:x}),(u||d||f||h||g)&&(0,U.jsxs)(`div`,{className:`block-actions`,ref:Tt,children:[g&&(0,U.jsx)(`button`,{type:`button`,className:`card-drag-handle`,title:`Drag ${y(e)} into a slot`,"aria-label":`Use ${y(e)} to fill a slot`,...Z.handleProps(e),children:(0,U.jsx)(`span`,{"aria-hidden":!0,children:`⠿`})}),u&&(0,U.jsxs)(`button`,{type:`button`,className:`block-action-pill block-ask`,"aria-pressed":m,title:m?`Selected — ask about it below`:`Ask about ${y(e)}`,"aria-label":m?`Unpin ${y(e)}`:`Ask about ${y(e)}`,onClick:t=>{t.stopPropagation(),i(e)},children:[(0,U.jsx)(s.chat,{}),(0,U.jsx)(`span`,{className:`block-pill-label`,children:m?`Selected`:`Ask`})]}),d&&(0,U.jsxs)(`button`,{type:`button`,className:`block-action-pill block-ask block-add`,title:`Add ${y(e)} to a dashboard`,"aria-label":`Add ${y(e)} to a dashboard`,onClick:t=>{t.stopPropagation(),a(e)},children:[(0,U.jsx)(s.plus,{}),(0,U.jsx)(`span`,{className:`block-pill-label`,children:`Dashboard`})]}),f&&(0,U.jsxs)(`button`,{type:`button`,className:`block-action-pill block-cards`+(p?` is-flashed`:``),"aria-pressed":p,title:p?`${y(e)} is in your flashcards`:`Make flashcards from ${y(e)}`,"aria-label":`Make flashcards from ${y(e)}`,onClick:t=>{t.stopPropagation(),S(e)},children:[p?(0,U.jsx)(s.check,{}):(0,U.jsx)(s.layers,{}),(0,U.jsx)(`span`,{className:`block-pill-label`,children:p?`Added`:`Cards`})]}),h&&(0,U.jsxs)(`button`,{type:`button`,className:`block-action-pill block-zoom`,title:`Zoom into ${y(e)}`,"aria-label":`Zoom into ${y(e)}`,onClick:t=>{t.stopPropagation(),P(e),I(tn)},children:[(0,U.jsx)(s.zoomIn,{}),(0,U.jsx)(`span`,{className:`block-pill-label`,children:`Zoom`})]})]})]},e.id||n)};return(0,U.jsxs)(ee.Provider,{value:O??null,children:[Z.ghost,(0,U.jsxs)(`div`,{className:`canvas-header`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`canvas-title`,children:e.title}),(0,U.jsx)(`div`,{className:`canvas-sub`,children:e.sub})]}),(0,U.jsxs)(`div`,{className:`canvas-header-actions`,children:[w,se?(0,U.jsxs)(`button`,{type:`button`,className:`canvas-exit`,onClick:()=>l?.(`everything`),children:[(0,U.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to answer`]}):(0,U.jsxs)(U.Fragment,{children:[pe&&he&&!J&&(0,U.jsx)(`button`,{type:`button`,className:`depth-reading-toggle`+(j?` is-reading`:``),"aria-pressed":j,title:j?`Collapse all deeper sections`:`Expand all deeper sections`,onClick:()=>M(e=>!e),children:j?`Collapse sections`:`Expand sections`}),q&&l&&(0,U.jsx)(Yt,{value:J?`focus`:`everything`,onChange:l}),T,oe&&l&&(0,U.jsxs)(`button`,{type:`button`,className:`canvas-open`,onClick:()=>l(`canvas`),title:`Spread this answer's cards on a board you can wander`,children:[(0,U.jsx)(`span`,{className:`canvas-open-glyph`,"aria-hidden":!0,children:`◇`}),` `,`View as canvas`]})]})]})]}),E,e.context.length>0&&(0,U.jsxs)(`div`,{className:`context-row`,style:{marginBottom:18},children:[(0,U.jsx)(`span`,{className:`faint`,style:{fontSize:12.5,marginRight:2},children:`Reading`}),e.context.map((e,t)=>(0,U.jsx)(u,{name:e.name,color:e.color},t))]}),re?se?(0,U.jsx)(me,{data:e,blocks:W,spot:t,renderBlock:$,onAskBlock:i,selectedBlockIds:o,onExit:()=>l?.(`everything`)}):J?(0,U.jsx)(Kt,{data:e,blocks:W,spot:t,renderBlock:$,onAskBlock:i,selectedBlockIds:o,onNarrate:d,narratingId:p,muted:m,walkNotes:b,presenting:D}):(0,U.jsxs)(`div`,{className:`card-grid`+(z?` bloom-on`:``)+(g?` note-gutter`:``),ref:L,children:[pe?fe.map((e,t)=>(0,U.jsx)(Ot,{section:e,renderCard:ge,readingMode:j},e.label||t)):W.map((e,t)=>ge(e,t)),Object.keys(n).filter(t=>n[t]&&e.extras&&e.extras[t]).map(t=>{let n=e.extras[t],r=Math.min(12,Math.max(1,n.col||6));return(0,U.jsx)(`div`,{className:`col-`+(G<9?12:r),children:de(n)},t)})]}):(0,U.jsx)(`div`,{className:`card-grid`+(z?` bloom-on`:``)+(g?` note-gutter`:``),ref:L,role:`status`,"aria-busy":`true`,"aria-label":`Loading visuals`,children:(0,U.jsx)(h,{blocks:W,budget:G})}),e.awaiting&&O?.complete&&(()=>{let t=Object.keys(O.values).length,n=e.blanks?.length??0,r=n>0&&t===n,i=O.busy?`Completing your answer…`:r?`All filled — finish when ready`:t===0?`Fill the blanks above to finish`:`${t} of ${n} filled`;return(0,U.jsxs)(`div`,{className:`blank-complete-bar${O.busy?` is-busy`:``}${r&&!O.busy?` is-ready`:``}`,role:`status`,"aria-live":`polite`,children:[(0,U.jsxs)(`span`,{className:`blank-complete-count`,children:[O.busy&&(0,U.jsx)(`span`,{className:`blank-complete-spinner`,"aria-hidden":`true`}),i]}),(0,U.jsx)(`button`,{type:`button`,className:`blank-complete-btn`,disabled:O.busy||t===0,onClick:O.complete,children:`Complete the answer`})]})})(),k&&(0,U.jsx)(`div`,{className:`app-scrim`,role:`button`,tabIndex:0,"aria-label":`Close app preview`,onClick:()=>A(null),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),A(null))},children:(0,U.jsxs)(`div`,{className:`app-launch`,role:`button`,tabIndex:0,onClick:e=>e.stopPropagation(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},children:[(0,U.jsxs)(`div`,{className:`app-launch-head`,children:[(0,U.jsxs)(`span`,{className:`app-launch-title`,children:[k.app,(0,U.jsxs)(`span`,{className:`app-launch-pill`,children:[(0,U.jsx)(`span`,{className:`web-live-dot`}),` Live on your workspace`]})]}),(0,U.jsx)(`button`,{className:`drawer-x`,onClick:()=>A(null),"aria-label":`Close app`,children:(0,U.jsx)(s.x,{})})]}),(0,U.jsx)(`div`,{className:`app-launch-body`,children:(0,U.jsx)(at,{...k})})]})}),N&&(0,U.jsx)(`div`,{className:`zoom-scrim`,role:`button`,tabIndex:0,"aria-label":`Close zoomed view`,onClick:()=>P(null),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),P(null))},children:(0,U.jsxs)(`div`,{className:`zoom-sheet`,role:`button`,tabIndex:0,"aria-label":y(N),onClick:e=>e.stopPropagation(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},children:[(0,U.jsxs)(`div`,{className:`zoom-sheet-toolbar`,children:[(0,U.jsx)(`button`,{type:`button`,className:`zoom-sheet-zoom-btn`,"aria-label":`Zoom out`,disabled:F<=Qt,onClick:()=>I(e=>Math.max(Qt,+(e-en).toFixed(2))),children:(0,U.jsx)(s.zoomOut,{})}),(0,U.jsxs)(`span`,{className:`zoom-sheet-zoom-level`,children:[Math.round(F*100),`%`]}),(0,U.jsx)(`button`,{type:`button`,className:`zoom-sheet-zoom-btn`,"aria-label":`Zoom in`,disabled:F>=$t,onClick:()=>I(e=>Math.min($t,+(e+en).toFixed(2))),children:(0,U.jsx)(s.zoomIn,{})}),(0,U.jsx)(`button`,{type:`button`,className:`zoom-sheet-x`,"aria-label":`Close`,onClick:()=>P(null),children:(0,U.jsx)(s.x,{})})]}),(0,U.jsx)(`div`,{className:`zoom-sheet-body`,style:{zoom:F},children:$(N)})]})})]})}export{Xt as n,sn as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/useDashboardLoop-B_YA5jLs.js","assets/rolldown-runtime-DkW27tQK.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/preload-helper-CiWYd9n-.js","assets/http-Lar_UMKb.js","assets/store-B39HvB_l.js","assets/friendlyAsk-BBdRZIar.js","assets/contentVault-xfUwSJ3i.js","assets/keyVault-Aw5Y2PjT.js","assets/providers-B2OCzEo1.js","assets/blockTypes-DUDdP3pB.js","assets/info-CiqHR5cs.js","assets/attachments-BW-vki-E.js","assets/useLiveConfig-DWz7BRdk.js","assets/json-B0N3XRZU.js","assets/number-Bmf7DqLj.js","assets/ledger-Cv0LBflx.js","assets/dataPending-lZUzUEo6.js","assets/format-rPI6ZwwH.js","assets/now-C9-UAzTC.js","assets/predictions-CkVKHq-5.js","assets/notify-Bz4wuE4T.js","assets/dashboardEvents-D-wLCp1A.js","assets/spokenText-C88IQJ0M.js","assets/kokoro-CdL8Kl48.js","assets/index-CfcUMOBf.js","assets/useInView-CXTOAEV3.js","assets/jsx-runtime-DeHZSEgm.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"])))=>i.map(i=>d[i]);
|
|
2
|
-
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,t as i}from"./preload-helper-CiWYd9n-.js";import{n as a}from"./icons-gLFQTv74.js";import{t as o}from"./route-D4kd-D3B.js";import{n as s}from"./dataPending-lZUzUEo6.js";import{a as c,o as l,t as u}from"./format-rPI6ZwwH.js";import{n as d,t as f}from"./tiles-pdNi6MGe.js";var p=e(),m={"15min":`15M`,hourly:`1H`,"6h":`6H`,daily:`DAILY`,manual:`MANUAL`};function h(e){return e.metrics.find(e=>e.lastValue!==null)??e.metrics[0]}function g(e,t){for(let n of e.widgets)if(n.block.type===t)return n.block}function _(e){if(!e.history||e.history.length<2)return!1;let t=e.unit?.trim();return t===`$`||t?.startsWith(`$`)?!0:/price/i.test(e.label)}function v(e){return e.metrics.length!==1||e.metrics[0].unit!==`%`?!1:!e.widgets.some(e=>e.block.type===`scoreboard`)}function y(e,t){if(e.oneShotAt!==void 0&&e.oneShotAt>t)return`scheduled`;if(e.cadence.window)return`live-event`;if(e.widgets.some(e=>e.block.type===`scoreboard`||e.block.type===`standings`))return`sports`;if(e.widgets.some(e=>e.block.type===`forecast`))return`weather`;if(v(e))return`probability`;let n=h(e);return n&&_(n)?`price`:`generic`}function b(e){if(!e?.history||e.history.length<2)return null;let t=e.history[e.history.length-2].value,n=e.history[e.history.length-1].value;if(n===t)return null;let r=n>t?`up`:`down`,i=Math.round(Math.abs(n-t)*100)/100;if(i===0)return null;let a=Number.isInteger(i)?String(i):i.toFixed(2),o=e.unit;return{direction:r,text:`${r===`up`?`+`:`-`}${o===`$`?`$`:``}${a}${o&&o!==`$`?o:``}`}}function x(e){return typeof e==`number`?Number.isFinite(e):typeof e==`string`&&e.trim()!==``}function S(e){let t=g(e,`scoreboard`);if(t)return t.props.games.filter(e=>x(e.as)&&x(e.hs)).slice(0,5).map(e=>({label:`${e.as}-${e.hs}`,tone:e.hot?`accent`:`flat`,title:`${e.away} @ ${e.home} · ${e.status}`}));let n=g(e,`standings`);return n?n.props.rows.filter(e=>!!e.rec?.trim()).slice(0,5).map((e,t)=>({label:e.rec,tone:t===0?`accent`:`flat`,title:e.team})):[]}function C(e){let t=g(e,`forecast`);return t?t.props.days.slice(0,4).map(e=>({label:e.label,hi:e.hi,lo:e.lo,icon:e.icon})):[]}function w(e){return e.replace(/^(updated|checked)\s+/,``)}var T={scheduled:`countdown`,"live-event":`livescore`,sports:`formchips`,weather:`forecast`,probability:`probability`};function E(e,t){let n=y(e,t),r=h(e),i=c(e),a=l(e),o=e.lastDataOutcome===`unverified`,s,d;i?(s=i.value,d=i.label):a>0?(s=String(a),d=a===1?`live card`:`live cards`):(s=`—`,d=o?`Couldn't verify with sources — check again`:`Not yet checked`);let f=i?r?.history??null:null,p=i?b(r):null,g;g=n===`price`?f&&f.length>=2?`area`:`none`:n===`generic`?f&&f.length>=2?`sparkline`:`none`:T[n];let _=e.cadence.window??null,v=_!==null&&t>=_.startAt&&t<=_.endAt,x=e.lastRefreshedAt!==null&&e.lastRefreshedAt>0,E=w(u(e.lastRefreshedAt,t,e.lastDataOutcome));return{id:e.id,name:e.title,kind:n,vizKind:g,cadenceLabel:m[e.cadence.data],pauseEligible:e.cadence.data!==`manual`,isLiveWindow:v,liveWindow:_,value:s,context:d,delta:p,history:f,probabilityPct:n===`probability`?e.metrics[0].lastValue:null,formChips:n===`sports`?S(e):[],forecastDays:n===`weather`?C(e):[],oneShotAt:e.oneShotAt??null,oneShotLabel:e.oneShotLabel??null,everChecked:x,asOf:E,unverified:o}}var D=t(),O=n();function k(e){let t=(0,D.c)(4),{days:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.map(A),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,O.jsx)(`div`,{className:`tile-forecast`,children:r}),t[2]=r,t[3]=i),i}function A(e,t){let n=e.icon?a[e.icon]:null;return(0,O.jsxs)(`div`,{className:`tile-forecast-day`,children:[(0,O.jsx)(`span`,{className:`tile-forecast-label`,children:e.label}),n&&(0,O.jsx)(n,{className:`tile-forecast-glyph`,"aria-hidden":`true`}),(0,O.jsxs)(`span`,{className:`tile-forecast-temp`,children:[e.hi??`—`,e.lo&&(0,O.jsxs)(`span`,{className:`tile-forecast-lo`,children:[`/`,e.lo]})]})]},`${e.label}-${t}`)}function j(e){let t=(0,D.c)(4),{items:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.map(M),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,O.jsx)(`div`,{className:`tile-chips`,children:r}),t[2]=r,t[3]=i),i}function M(e,t){return(0,O.jsx)(`span`,{className:`tile-chip tile-chip--${e.tone}`,title:e.title,children:e.label},`${e.label}-${t}`)}function N(e){let t=(0,D.c)(15),{liveWindow:n,now:r}=e,i=n.endAt-n.startAt||1,a=Math.min(1,Math.max(0,(r-n.startAt)/i)),o=r>=n.startAt,s;t[0]===o?s=t[1]:(s=o&&(0,O.jsx)(`i`,{className:`dash-live-dot`,"aria-hidden":`true`}),t[0]=o,t[1]=s);let c;t[2]===n.label?c=t[3]:(c=(0,O.jsx)(`span`,{className:`tile-live-label`,children:n.label}),t[2]=n.label,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,O.jsxs)(`div`,{className:`tile-live-head`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]!==a||t[8]!==o?(u=o&&(0,O.jsx)(`div`,{className:`tile-live-fill`,style:{width:`${a*100}%`}}),t[7]=a,t[8]=o,t[9]=u):u=t[9];let d;t[10]===u?d=t[11]:(d=(0,O.jsx)(`div`,{className:`tile-live-track`,children:u}),t[10]=u,t[11]=d);let f;return t[12]!==l||t[13]!==d?(f=(0,O.jsxs)(`div`,{className:`tile-live`,children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14],f}function P(e){let t=(0,D.c)(10),{pct:n}=e,r;t[0]===n?r=t[1]:(r=Math.round(Math.min(100,Math.max(0,n))),t[0]=n,t[1]=r);let i=r,a=`${i}% likely`,o=`${i}%`,s;t[2]===o?s=t[3]:(s=(0,O.jsx)(`div`,{className:`tile-prob-track`,children:(0,O.jsx)(`div`,{className:`tile-prob-fill`,style:{width:o}})}),t[2]=o,t[3]=s);let c;t[4]===i?c=t[5]:(c=(0,O.jsxs)(`span`,{className:`tile-prob-pct`,children:[i,`%`]}),t[4]=i,t[5]=c);let l;return t[6]!==a||t[7]!==s||t[8]!==c?(l=(0,O.jsxs)(`div`,{className:`tile-prob`,role:`img`,"aria-label":a,children:[s,c]}),t[6]=a,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}var F=200,I=40,L=3;function R(e){let t=(0,D.c)(14),{points:n}=e;if(n.length<2)return null;let r,i;if(t[0]!==n){let e=n.map(z);r=Math.min(...e),i=Math.max(...e),t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a=i-r||1,o=194/(n.length-1),s;if(t[3]!==r||t[4]!==n||t[5]!==a||t[6]!==o){let e;t[8]!==r||t[9]!==a||t[10]!==o?(e=(e,t)=>{let n=L+t*o,i=L+(1-(e.value-r)/a)*34;return`${t===0?`M`:`L`}${n.toFixed(1)},${i.toFixed(1)}`},t[8]=r,t[9]=a,t[10]=o,t[11]=e):e=t[11],s=n.map(e).join(` `),t[3]=r,t[4]=n,t[5]=a,t[6]=o,t[7]=s}else s=t[7];let c=s,l;return t[12]===c?l=t[13]:(l=(0,O.jsx)(`svg`,{className:`tile-viz-svg`,viewBox:`0 0 ${F} ${I}`,preserveAspectRatio:`none`,role:`presentation`,children:(0,O.jsx)(`path`,{d:c,fill:`none`,stroke:`var(--text-secondary)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})}),t[12]=c,t[13]=l),l}function z(e){return e.value}r();function B(e,t){switch(e.vizKind){case`area`:return e.history?(0,O.jsx)(d,{points:e.history,tone:e.delta?.direction??`flat`}):null;case`sparkline`:return e.history?(0,O.jsx)(R,{points:e.history}):null;case`probability`:return e.probabilityPct===null?null:(0,O.jsx)(P,{pct:e.probabilityPct});case`countdown`:return e.oneShotAt===null?null:(0,O.jsx)(f,{targetAt:e.oneShotAt,now:t,label:e.oneShotLabel??void 0});case`formchips`:return(0,O.jsx)(j,{items:e.formChips});case`forecast`:return(0,O.jsx)(k,{days:e.forecastDays});case`livescore`:return e.liveWindow?(0,O.jsx)(N,{liveWindow:e.liveWindow,now:t}):null;case`none`:return null}}var V={failed:`Couldn’t reach your model — check its key or quota, then try again.`,unverified:`Checked, but no source could verify new values — keeping the last real ones.`},H=8e3;function U({dashboard:e,now:t,paused:n=!1}){let r=(0,p.useMemo)(()=>E(e,t),[e,t]),c=s(e.id),[l,u]=(0,p.useState)(!1),d=c||l,[f,m]=(0,p.useState)(null),h=(0,p.useRef)(void 0);(0,p.useEffect)(()=>()=>window.clearTimeout(h.current),[]);let g=n&&r.pauseEligible,_=g?`paused`:r.isLiveWindow?`live`:`plain`,v=e=>{m(e),h.current=window.setTimeout(()=>m(null),H)},y=t=>{t.preventDefault(),t.stopPropagation(),!d&&(window.clearTimeout(h.current),m(null),u(!0),i(async()=>{let{refreshDashboardNow:e}=await import(`./useDashboardLoop-B_YA5jLs.js`).then(e=>e.i);return{refreshDashboardNow:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34])).then(({refreshDashboardNow:t})=>t(e.id)).then(e=>{(e===`failed`||e===`unverified`)&&v(e)}).catch(()=>v(`failed`)).finally(()=>u(!1)))};return(0,O.jsxs)(`a`,{className:`tile-frame`,href:o.detail(e.id),"data-tile-state":_===`plain`?void 0:_,children:[(0,O.jsxs)(`div`,{className:`tile-top`,children:[(0,O.jsx)(`span`,{className:`tile-name`,title:r.name,children:r.name}),(0,O.jsxs)(`span`,{className:`tile-cadence tile-cadence--${_}`,children:[_===`live`&&(0,O.jsx)(`i`,{className:`dash-live-dot`,"aria-hidden":`true`}),g?`PAUSED`:r.cadenceLabel]})]}),(0,O.jsxs)(`div`,{className:`tile-value-row`,children:[(0,O.jsx)(`span`,{className:`tile-value${d?` tile-value--checking`:``}`,children:r.value}),r.delta&&(0,O.jsx)(`span`,{className:`tile-delta tile-delta--${r.delta.direction}`,children:r.delta.text})]}),(0,O.jsx)(`p`,{className:`tile-context${!d&&f?` tile-context--note`:``}`,children:d?`Checking for live data…`:f?V[f]:r.context}),(0,O.jsx)(`div`,{className:`tile-viz`,children:B(r,t)}),(0,O.jsxs)(`div`,{className:`tile-foot`,children:[(0,O.jsx)(`span`,{className:`tile-asof`,children:r.everChecked?`AS OF ${r.asOf}`:r.asOf}),(0,O.jsx)(`span`,{role:`button`,tabIndex:0,className:`tile-check${d?` is-checking`:``}`,"aria-label":`Check ${r.name} now`,"aria-disabled":d,title:`Check now`,onClick:y,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&y(e)},children:(0,O.jsx)(a.refresh,{className:d?`dash-refresh-spin`:void 0})})]})]})}export{N as n,E as r,U 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";import{a as r,i,s as a}from"./spokenText-C88IQJ0M.js";import{t as o}from"./useFocusTrap-DBtkeyRy.js";import{r as s,t as c}from"./useSpatialCanvas-CfmZOXXP.js";import{i as l}from"./format-q0LwBjID.js";import{a as u,i as d,n as f,r as p}from"./scale-Bcgfo6Hp.js";import{t as m}from"./spreadLabels-CQ8hufvK.js";import{i as h,n as g,r as _,t as v}from"./display-BrieMea1.js";import{t as y}from"./types-C42I77wh.js";import{r as b,t as x}from"./sourceHost-BV3t2XDb.js";import{r as S}from"./stepDriver-DwjFet6U.js";import{c as C,l as w,o as T,u as E}from"./walkSync-AAocUygp.js";import{n as D}from"./emphasize-BqCIst-B.js";import{n as O,s as k}from"./receipts-ClyzFFGD.js";import{s as A,t as j}from"./validate-CnG23_8J.js";import{n as M,t as N}from"./engine-2U7mvPIl.js";var P=e(),F=t();function I(e){let t=[];for(let n of e?.points??[]){let e=A(n.t);e===null||!Number.isFinite(n.value)||t.push({t:e,v:n.value})}return t.sort((e,t)=>e.t-t.t)}function L(e,t){let n=e.date?A(e.date.t):null;if(n!==null){let t=e.date?.until?A(e.date.until):null;return t!==null&&t>n?{start:n,end:t}:{start:n}}if(t.length===0)return null;let r=t[0].t,i=t[t.length-1].t;return i>r?{start:r,end:i}:{start:r}}function R(e){return e.filter(e=>e.from!==e.to)}function z(e){return R(e).map((e,t)=>({id:e.id??`${e.from}->${e.to}#${t}`,from:e.from,to:e.to,sign:e.sign,...e.relation===void 0?{}:{kind:e.relation},...typeof e.weight==`number`?{weight:e.weight}:{},...e.provisional?{provisional:!0}:{}}))}function B(e){let t=[],n=(e,r)=>{let i=I(e.series),a=e.unit??e.series?.unit,o=L(e,i);t.push({id:e.id,label:e.label,role:e.role,depth:e.depth,tier:e.tier,...e.value===void 0?{}:{value:e.value},...a===void 0?{}:{unit:a},...i.length>0?{series:i}:{},...o?{date:o}:{},...e.domain===void 0?{}:{domain:e.domain},...r===void 0?{}:{parentId:r}});for(let t of e.children??[])n(t,e.id)};for(let t of e.nodes)n(t);return{nodes:t,edges:z(e.edges),outcomeId:e.outcomeId}}var V={w:1090,h:650},H=1.4,U=86*H;160*H;var W=116*H,G=9/(11*H),K=e=>String(Math.round(e*100)/100),q=e=>e&&/^[a-z-]{1,24}$/.test(e)?` morph-edge--rel-${e}`:``,J=525949.2*60*1e3,ee=e=>1970+e/J,te=e=>(e-1970)*J,ne=6e4,re=60*ne,ie={minute:ne,hour:re,day:24*re,month:J/12},ae=[{grain:`minute`,n:1},{grain:`minute`,n:5},{grain:`minute`,n:10},{grain:`minute`,n:15},{grain:`minute`,n:30},{grain:`hour`,n:1},{grain:`hour`,n:2},{grain:`hour`,n:3},{grain:`hour`,n:6},{grain:`hour`,n:12},{grain:`day`,n:1},{grain:`day`,n:2},{grain:`day`,n:5},{grain:`day`,n:10},{grain:`month`,n:1},{grain:`month`,n:2},{grain:`month`,n:3},{grain:`month`,n:6}],oe=3,se=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],ce=64;function le(e){let t=new Date(0);return t.setUTCFullYear(Math.floor(e/12),(e%12+12)%12,1),t.setUTCHours(0,0,0,0),t.getTime()}function ue(e,t,n){if(t.grain===`month`){let r=new Date(e),i=Math.floor((r.getUTCFullYear()*12+r.getUTCMonth())/t.n)*t.n,a=le(i);return n&&a<e?le(i+t.n):a}let r=ie[t.grain]*t.n,i=Math.floor(e/r)*r;return n&&i<e?i+r:i}function de(e,t){let n=new Date(e);if(!Number.isFinite(n.getTime()))return String(Math.round(ee(e)));let r=`${se[n.getUTCMonth()]} ${n.getUTCFullYear()}`;if(t===`month`)return r;let i=`${n.getUTCDate()} ${r}`;if(t===`day`||n.getUTCHours()===0&&n.getUTCMinutes()===0)return i;let a=e=>String(e).padStart(2,`0`);return`${a(n.getUTCHours())}:${a(n.getUTCMinutes())}`}function Y(e,t){if(t.grain!==`month`)return e+ie[t.grain]*t.n;let n=new Date(e);return le(n.getUTCFullYear()*12+n.getUTCMonth()+t.n)}function fe(e,t,n){let r=ue(te(e),n,!1),i=ue(te(t),n,!0),a=[];for(let e=r;e<=i&&a.length<ce;e=Y(e,n))a.push({year:ee(e),text:de(e,n.grain)});return{domain:[ee(r),ee(i)],ticks:a}}function pe(e,t,n){let r=Math.max(1,Math.round(p(t-e,n))),i=Math.floor(e/r)*r,a=Math.ceil(t/r)*r,o=[];for(let e=i;e<=a&&o.length<ce;e+=r)o.push({year:e,text:String(e)});return{domain:[i,a],ticks:o}}function me(e,t,n=6){let[r,i]=e<t?[e,t]:[e-.5,t+.5];if(i-r>=oe)return pe(r,i,n);let a=(i-r)*J/n,o=ae[ae.length-1],s=1/0;for(let e of ae){let t=Math.abs(Math.log(ie[e.grain]*e.n/a));t<s&&(s=t,o=e)}return fe(r,i,o)}var he=8,ge=12,_e=16,ve=6,ye=12+Math.ceil(15.525*H);function be(e,t,n,r=V){let i=new Map;if(e.length===0)return{positions:i,band:null,bbox:t};let a=W+_e,o=44*H+ve,s=Math.max(t.w,r.w),c=Math.max(1,Math.floor((s-24+_e)/a)),l=Math.min(e.length,c),u=Math.ceil(e.length/c),d=l*W+(l-1)*_e,f={id:`shelf`,x:t.x,y:t.y+t.h+he,w:Math.max(t.w,d+24),h:ye+ve+u*o-ve+ge,className:`morph-shelf`,label:n};return e.forEach((e,t)=>{i.set(e.id,{x:f.x+ge+t%c*a,y:f.y+ye+ve+Math.floor(t/c)*o,w:116,h:44,face:`entry`,shelved:!0})}),{positions:i,band:f,bbox:{x:t.x,y:t.y,w:Math.max(t.w,f.w),h:f.y+f.h-t.y}}}var X=n(),Z=440,xe=2,Se=1.25,Ce=320;function Q(e){if(!(e===void 0||!Number.isFinite(e))){if(e<.995)return`weaker`;if(e>1.005)return`stronger`}}function $(){let e=(0,F.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(`marker`,{id:`mv-arrow`,className:`mv-marker mv-marker-up`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,X.jsx)(`path`,{d:`M0.5 1 L9.5 5 L0.5 9 Z`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`marker`,{id:`mv-arrow-damp`,className:`mv-marker mv-marker-down`,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:17,markerHeight:17,orient:`auto`,children:(0,X.jsx)(`path`,{d:`M8 0.6 L8 9.4`})}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`marker`,{id:`mv-arrow-open`,className:`mv-marker mv-marker-open`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,X.jsx)(`path`,{d:`M1 1.4 L9 5 L1 8.6 Z`})}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(`marker`,{id:`mv-arrow-ring`,className:`mv-marker mv-marker-ring`,viewBox:`0 0 10 10`,refX:`7.4`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,X.jsx)(`circle`,{cx:`5`,cy:`5`,r:`3`})}),e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsxs)(`defs`,{children:[t,n,r,i,(0,X.jsx)(`marker`,{id:`mv-dot`,className:`mv-marker mv-marker-dot`,viewBox:`0 0 10 10`,refX:`5`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:9,markerHeight:9,orient:`auto`,children:(0,X.jsx)(`circle`,{cx:`5`,cy:`5`,r:`2.6`})})]}),e[4]=a):a=e[4],a}function we(e,t){let n=(0,F.c)(5),r;n[0]===e.current?r=n[1]:(r=()=>{let t=e.current;if(!t||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)return;let n=t.querySelectorAll(`[data-draw]:not(.m-draw-path):not([data-drawn])`),r=Array.from(n,Ee);n.forEach((e,t)=>{let n=r[t];n!==null&&(e.style.setProperty(`--path-len`,`${n}px`),e.style.setProperty(`--delay`,`${Z}ms`),e.classList.add(`m-draw-path`))});let i=Te;return t.addEventListener(`animationend`,i),()=>t.removeEventListener(`animationend`,i)},n[0]=e.current,n[1]=r);let i;n[2]!==t||n[3]!==e?(i=[e,t],n[2]=t,n[3]=e,n[4]=i):i=n[4],(0,P.useEffect)(r,i)}function Te(e){if(e.animationName!==`mavea-draw`)return;let t=e.target;t.classList.remove(`m-draw-path`),t.style.removeProperty(`--path-len`),t.style.removeProperty(`--delay`),t.dataset.drawn=``}function Ee(e){return typeof e.getTotalLength==`function`?e.getTotalLength():null}function De(e){let t=(0,F.c)(33),{chrome:n,bbox:r,exiting:i,onSettle:a}=e,o=(0,P.useRef)(null);we(o,n.paths);let s=i?``:void 0,c=i?!0:void 0,l=r.w,u=r.h,d=`${r.x} ${r.y} ${r.w} ${r.h}`,f;t[0]===n.bands?f=t[1]:(f=n.bands.map(ke),t[0]=n.bands,t[1]=f);let p;t[2]===n.paths?p=t[3]:(p=n.paths.map(Oe),t[2]=n.paths,t[3]=p);let m;t[4]!==r.h||t[5]!==r.w||t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,X.jsxs)(`svg`,{ref:o,className:`mv-chrome-svg`,width:l,height:u,viewBox:d,"aria-hidden":`true`,children:[f,p]}),t[4]=r.h,t[5]=r.w,t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;if(t[10]!==r.x||t[11]!==r.y||t[12]!==n.bands){let e;t[14]!==r.x||t[15]!==r.y?(e=e=>e.label===void 0?null:(0,X.jsx)(`div`,{className:`mv-shelf-label`,style:{left:e.x-r.x+12,top:e.y-r.y+12},children:e.label},`${e.id}:label`),t[14]=r.x,t[15]=r.y,t[16]=e):e=t[16],h=n.bands.map(e),t[10]=r.x,t[11]=r.y,t[12]=n.bands,t[13]=h}else h=t[13];let g;if(t[17]!==r.x||t[18]!==r.y||t[19]!==n.labels){let e;t[21]!==r.x||t[22]!==r.y?(e=e=>(0,X.jsx)(`div`,{className:`mv-chrome-label ${e.className}`,"data-anchor":e.anchor??`start`,style:{left:e.x-r.x,top:e.y-r.y},children:e.text},e.id),t[21]=r.x,t[22]=r.y,t[23]=e):e=t[23],g=n.labels.map(e),t[17]=r.x,t[18]=r.y,t[19]=n.labels,t[20]=g}else g=t[20];let _;t[24]!==g||t[25]!==h?(_=(0,X.jsxs)(`div`,{className:`mv-chrome-labels`,children:[h,g]}),t[24]=g,t[25]=h,t[26]=_):_=t[26];let v;return t[27]!==a||t[28]!==s||t[29]!==_||t[30]!==c||t[31]!==m?(v=(0,X.jsxs)(`div`,{className:`mv-chrome`,"data-exiting":s,onTransitionEnd:a,"aria-hidden":c,children:[m,_]}),t[27]=a,t[28]=s,t[29]=_,t[30]=c,t[31]=m,t[32]=v):v=t[32],v}function Oe(e){return(0,X.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":e.draw?``:void 0},e.id)}function ke(e){return(0,X.jsx)(`rect`,{className:`mv-band ${e.className}`,x:e.x,y:e.y,width:e.w,height:e.h,rx:12},e.id)}function Ae(e){if(e instanceof Element)return e.closest(`.mv-node`)?.dataset.id}var je=(0,P.memo)(function(e){let t=(0,F.c)(49),{nodes:n,edges:r,layout:i,exiting:a,settleExit:o,activate:s,lod:c,renderFace:l,onNodeClick:u,onEdgeClick:d,selectedId:f,litEdgeId:p}=e,m=(0,P.useRef)(null);we(m,i.edgePaths);let{bbox:h}=i,g;if(t[0]!==r||t[1]!==n){let e=new Map(n.map(Ne));g=new Map;for(let t of r){let n=e.get(t.from);n!==void 0&&Number.isFinite(n)&&g.set(t.id,n)}t[0]=r,t[1]=n,t[2]=g}else g=t[2];let _=g,v;t[3]!==a||t[4]!==o?(v=a&&(0,X.jsx)(De,{chrome:a.layout.chrome,bbox:a.layout.bbox,exiting:!0,onSettle:()=>o(a.token)},a.token),t[3]=a,t[4]=o,t[5]=v):v=t[5];let y;t[6]!==h||t[7]!==i.chrome||t[8]!==i.rep?(y=(0,X.jsx)(De,{chrome:i.chrome,bbox:h},i.rep),t[6]=h,t[7]=i.chrome,t[8]=i.rep,t[9]=y):y=t[9];let b=h.w,x=h.h,S=`${h.x} ${h.y} ${h.w} ${h.h}`,C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,X.jsx)($,{}),t[10]=C):C=t[10];let w;if(t[11]!==_||t[12]!==i.edgePaths||t[13]!==p||t[14]!==d){let e;t[16]!==_||t[17]!==p||t[18]!==d?(e=e=>(0,X.jsxs)(`g`,{className:`mv-edge-g`,"data-lit":p===e.id?``:void 0,"data-shift":Q(_.get(e.id)),style:_.has(e.id)?{"--mv-shift":_.get(e.id)}:void 0,onClick:d?()=>d(e.id):void 0,children:[d&&(0,X.jsx)(`path`,{className:`mv-edge-hit`,d:e.d,fill:`none`}),(0,X.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":``,style:e.width===void 0?void 0:{"--mv-edge-w":e.width}})]},e.id),t[16]=_,t[17]=p,t[18]=d,t[19]=e):e=t[19],w=i.edgePaths.map(e),t[11]=_,t[12]=i.edgePaths,t[13]=p,t[14]=d,t[15]=w}else w=t[15];let T;t[20]!==h.h||t[21]!==h.w||t[22]!==S||t[23]!==w?(T=(0,X.jsxs)(`svg`,{ref:m,className:`mv-edges`,width:b,height:x,viewBox:S,"aria-hidden":`true`,children:[C,w]}),t[20]=h.h,t[21]=h.w,t[22]=S,t[23]=w,t[24]=T):T=t[24];let E;if(t[25]!==s||t[26]!==h.x||t[27]!==h.y||t[28]!==i.positions||t[29]!==c||t[30]!==n||t[31]!==u||t[32]!==l||t[33]!==f){let e;t[35]!==s||t[36]!==h.x||t[37]!==h.y||t[38]!==i.positions||t[39]!==c||t[40]!==u||t[41]!==l||t[42]!==f?(e=(e,t)=>{let n=i.positions.get(e.id);if(!n)return null;let r={"--nx":`${n.x+n.w/2-h.x}px`,"--ny":`${n.y+n.h/2-h.y}px`,"--mv-i":t,...e.shift===void 0?{}:{"--mv-shift":e.shift}},a=u!==void 0&&!n.folded,o=l?.(e,`entry`);return(0,X.jsxs)(`div`,{className:`mv-node`,"data-id":e.id,"data-role":e.role,"data-tier":e.tier,"data-domain":e.domain,"data-series":e.series?.length?``:void 0,"data-face":n.face,"data-shelved":n.shelved?``:void 0,"data-folded":n.folded?``:void 0,"data-shift":Q(e.shift),"data-selected":f===e.id?``:void 0,"data-lod":c,style:r,"aria-hidden":n.folded?!0:void 0,role:a?`button`:void 0,tabIndex:a?0:void 0,onClick:a?()=>s(e):void 0,onKeyDown:a?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),u?.(e))}:void 0,children:[(0,X.jsxs)(`div`,{className:`mv-face mv-face-card`,children:[(0,X.jsx)(`span`,{className:`mv-label`,children:e.label}),(0,X.jsxs)(`span`,{className:`mv-card-foot`,children:[e.domain!==void 0&&(0,X.jsx)(`span`,{className:`mv-domain`,title:e.domain,"aria-label":e.domain}),e.value!==void 0&&(0,X.jsxs)(`span`,{className:`mv-value`,children:[e.value.toLocaleString(),e.unit??``]}),l?.(e,`card`),e.tier!==void 0&&(0,X.jsx)(`span`,{className:`mv-tier`,children:e.tier})]})]}),(0,X.jsx)(`div`,{className:`mv-face mv-face-entry`,children:(0,X.jsxs)(`span`,{className:`mv-label`,children:[o,o?` `:null,e.label]})}),(0,X.jsx)(`div`,{className:`mv-face mv-face-mark`,children:l?.(e,`mark`)})]},e.id)},t[35]=s,t[36]=h.x,t[37]=h.y,t[38]=i.positions,t[39]=c,t[40]=u,t[41]=l,t[42]=f,t[43]=e):e=t[43],E=n.map(e),t[25]=s,t[26]=h.x,t[27]=h.y,t[28]=i.positions,t[29]=c,t[30]=n,t[31]=u,t[32]=l,t[33]=f,t[34]=E}else E=t[34];let D;return t[44]!==v||t[45]!==y||t[46]!==T||t[47]!==E?(D=(0,X.jsxs)(X.Fragment,{children:[v,y,T,E]}),t[44]=v,t[45]=y,t[46]=T,t[47]=E,t[48]=D):D=t[48],D});function Me({stage:e,world:t,renderFace:n,onNodeClick:r,onEdgeClick:i,selectedId:a,litEdgeId:o}){let{cam:s,layout:c,exiting:l,lod:u,settleExit:d,morphing:f,settle:p}=e,{viewportRef:m,zoomAtClient:h,pan:g}=s,[_,v]=(0,P.useState)(!1),y=(0,P.useRef)(new Map),b=(0,P.useRef)(0),x=(0,P.useRef)(!1),S=(0,P.useRef)(!1),C=(0,P.useRef)(!1),w=(0,P.useRef)({x:0,y:0}),T=(0,P.useCallback)((t,n,r,i)=>{if(x.current){h(t,n,r);return}e.pinch(t,n,r,i)!==`zoom`&&(x.current=!0)},[e,h]),E=(0,P.useRef)(T);E.current=T,(0,P.useEffect)(()=>{let e=m.current;if(!e)return;let t,n=e=>{if(e.preventDefault(),p(),e.ctrlKey){E.current(Math.exp(-e.deltaY/100),e.clientX,e.clientY,Ae(e.target)),clearTimeout(t),t=setTimeout(()=>{x.current=!1},Ce);return}h(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,n,{passive:!1}),()=>{clearTimeout(t),e.removeEventListener(`wheel`,n)}},[m,h,p]);let D=()=>{let[e,t]=[...y.current.values()];return{x:(e.x+t.x)/2,y:(e.y+t.y)/2,d:Math.hypot(e.x-t.x,e.y-t.y)}},O=(0,P.useCallback)(e=>{if(p(),y.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),y.current.size>=2){e.currentTarget.setPointerCapture(e.pointerId),S.current=!1,v(!1),b.current=0;return}S.current=!0,C.current=!1,v(!0),w.current={x:e.clientX,y:e.clientY}},[p]),k=(0,P.useRef)({dx:0,dy:0}),A=(0,P.useRef)(0),j=(0,P.useCallback)(()=>{A.current!==0&&(cancelAnimationFrame(A.current),A.current=0);let{dx:e,dy:t}=k.current;(e!==0||t!==0)&&(k.current={dx:0,dy:0},g(e,t))},[g]),M=(0,P.useCallback)((e,t)=>{k.current.dx+=e,k.current.dy+=t,A.current===0&&(A.current=requestAnimationFrame(()=>{A.current=0;let e=k.current;k.current={dx:0,dy:0},(e.dx!==0||e.dy!==0)&&g(e.dx,e.dy)}))},[g]);(0,P.useEffect)(()=>()=>cancelAnimationFrame(A.current),[]);let N=(0,P.useCallback)(e=>{let t=y.current;if(!t.has(e.pointerId))return;if(t.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.size>=2){let{x:t,y:n,d:r}=D();if(b.current===0){b.current=r;return}let i=r/b.current;(i>Se||i<1/Se)&&(b.current=r,E.current(i,t,n,Ae(e.target)));return}if(!S.current)return;let n=e.clientX-w.current.x,r=e.clientY-w.current.y;Math.abs(n)+Math.abs(r)>xe&&!C.current&&(C.current=!0,e.currentTarget.setPointerCapture(e.pointerId)),w.current={x:e.clientX,y:e.clientY},M(n,r)},[M]),F=(0,P.useCallback)(e=>{j(),y.current.delete(e.pointerId),y.current.size<2&&(b.current=0,x.current=!1),y.current.size===0&&(S.current=!1,v(!1)),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},[j]),I=(0,P.useCallback)(e=>{C.current||r?.(e)},[r]),L=(0,P.useCallback)(e=>{e.propertyName===`transform`&&p()},[p]),{bbox:R}=c,z={transform:s.transform,width:R.w,height:R.h,"--mv-cam-scale":s.camera.scale};return(0,X.jsx)(`div`,{className:`mv-viewport`,ref:m,"data-panning":_?`true`:void 0,style:{"--mv-cam-scale":s.camera.scale},onPointerDown:O,onPointerMove:N,onPointerUp:F,onPointerCancel:F,children:(0,X.jsx)(`div`,{className:`mv-world`,style:z,"data-morphing":f?``:void 0,onTransitionEnd:L,children:(0,X.jsx)(je,{nodes:t.nodes,edges:t.edges,layout:c,exiting:l,settleExit:d,activate:I,lod:u,renderFace:n,onNodeClick:r,onEdgeClick:i,selectedId:a,litEdgeId:o})})})}function Ne(e){return[e.id,e.shift]}function Pe(e,t){return e===`in`?`zoom-camera`:t?`ascend`:`zoom-camera`}var Fe=880,Ie=340,Le=468,Re=56,ze=26,Be=16,Ve=7,He=30*H;function Ue(e){let t=(e.series??[]).filter(e=>Number.isFinite(e.t)&&Number.isFinite(e.v)).map(e=>({t:ee(e.t),v:e.v})).sort((e,t)=>e.t-t.t);return t.length>0?{node:e,points:t}:null}var We=e=>Ue(e)!==null;function Ge(e,t){let n=e*Math.max(Re,(t-1)*He+30)+(e-1)*ze,r=Math.min(Le,Math.max(Ie,n)),i=Math.max(He,Math.min(ze,r/(4*e)));return{h:(r-(e-1)*i)/e,gap:i}}function Ke(e,t,n){let[r,i]=e===t?f(e,t,n):[e,t],a=p(i-r,n),o=[Math.floor(r/a)*a,Math.ceil(i/a)*a];return{domain:o,ticks:u(o[0]-a*1e-9,o[1],a)}}function qe(e){let t=1/0,n=-1/0,r=new Map;for(let i of e){let e=new Map;for(let a of i.nodes){let i=Ue(a);if(!i)continue;let o=a.unit??``,s=r.get(o);s||r.set(o,s={lo:1/0,hi:-1/0,marks:0}),e.set(o,(e.get(o)??0)+1);for(let e of i.points)t=Math.min(t,e.t),n=Math.max(n,e.t),s.lo=Math.min(s.lo,e.v),s.hi=Math.max(s.hi,e.v)}for(let[t,n]of e){let e=r.get(t);e.marks=Math.max(e.marks,n)}}if(t===1/0)return null;let i=1;for(let e of r.values())i=Math.max(i,e.marks);let{h:a,gap:o}=Ge(r.size,i),s=Math.max(2,Math.min(5,Math.round(a/60))),c=[],l=new Map;for(let[e,t]of r){let{domain:n,ticks:r}=Ke(t.lo,t.hi,s);l.set(e,c.length),c.push({unit:e,domain:n,ticks:r,top:c.length*(a+o),h:a})}let u=me(t,n);return{x:u.domain,xTicks:u.ticks,bands:c,bandOf:l,height:c.length*a+(c.length-1)*o}}function Je(e,t){let n=new Map,r=new Map;for(let t of e){let e=r.get(t.band);e?e.push(t):r.set(t.band,[t])}for(let[e,i]of r){let{top:r,bottom:a}=t(e);i.sort((e,t)=>e.x-t.x||e.y-t.y||e.id.localeCompare(t.id));let o=[],s=()=>{if(o.length!==0){for(let[e,t]of m(o,{gap:He,top:r,bottom:a}))n.set(e,t);o=[]}};for(let e of i)o.length>0&&e.x-o[o.length-1].x>=He&&s(),o.push(e);s()}return n}function Ye(e,t,n){let r=[],i=[];for(let n of e.nodes){let e=Ue(n);e&&t?r.push(e):i.push(n)}let a=new Map,o={bands:[],paths:[],labels:[]},s=1/0,c=-1/0,l=56;if(r.length>0&&t){let e=d(t.x,[56,56+Fe]),n=t.bands.map(e=>d(e.domain,[56+e.top+e.h,56+e.top])),i=e=>t.bandOf.get(e.unit??``)??0;t.bands.forEach((e,r)=>{let i=n[r];for(let t of e.ticks)o.paths.push({id:`grid:${r}:${t}`,d:`M ${K(56)} ${K(i(t))} L ${K(56+Fe)} ${K(i(t))}`,className:`morph-gridline`}),o.labels.push({id:`ytick:${r}:${t}`,x:46,y:i(t)+4,text:String(t),className:`morph-axis-label`,anchor:`end`}),s=Math.min(s,46-String(t).length*Ve);t.bands.length>1&&o.labels.push({id:`unit:${r}`,x:56,y:56+e.top-11,text:e.unit===``?`no unit`:e.unit,className:`morph-axis-label`,anchor:`start`})}),t.xTicks.forEach((n,r)=>{let i=e(n.year);o.labels.push({id:`xtick:${r}`,x:i,y:56+t.height+22,text:n.text,className:`morph-axis-label`,anchor:`middle`});let a=n.text.length*Ve/2;s=Math.min(s,i-a),c=Math.max(c,i+a)}),s=Math.min(s,56),c=Math.max(c,56+Fe),l=Math.max(l,56+t.height+28);let u=[...r].sort((e,t)=>e.node.id.localeCompare(t.node.id)),f=u.map(t=>{let r=i(t.node),a=t.points[t.points.length-1];return{id:t.node.id,band:r,x:e(a.t),y:n[r](a.v)}}),p=Je(f,e=>({top:56+t.bands[e].top,bottom:56+t.bands[e].top+t.bands[e].h})),h=new Map,g=new Map;for(let e of f){let t=g.get(e.band);t?t.push(e):g.set(e.band,[e])}t.bands.forEach((e,t)=>{let n=g.get(t);if(n===void 0||n.length===0)return;let r=m(n.map(e=>({id:e.id,y:p.get(e.id)??e.y})),{gap:Be,top:56+e.top+6,bottom:56+e.top+e.h-6});for(let[e,t]of r)h.set(e,t)}),u.forEach((t,r)=>{let{x:i,y:s}=f[r],l=n[f[r].band],u=t.points.map((t,n)=>`${n===0?`M`:`L`} ${K(e(t.t))} ${K(l(t.v))}`).join(` `),d=t.node.id;o.paths.push({id:`series:${d}`,d:u,className:`morph-series`,draw:!0});let m=p.get(t.node.id)??s;Math.abs(m-s)>.01&&o.paths.push({id:`leader:${t.node.id}`,d:`M ${K(i)} ${K(s)} L ${K(i)} ${K(m)}`,className:`morph-tick`}),a.set(d,{x:i-15,y:m-15,w:30,h:30,face:`mark`});let g=i+15+8;o.labels.push({id:`label:${t.node.id}`,x:g,y:(h.get(t.node.id)??m)+4,text:t.node.label,className:`morph-series-label`,anchor:`start`}),c=Math.max(c,g+t.node.label.length*Ve)})}let u=be(i,s===1/0?{x:0,y:0,w:112,h:112}:{x:s-56,y:0,w:c-s+112,h:l+56},`${i.length} with nothing measured over time — the chart cannot plot these`,n);u.band&&o.bands.push(u.band);for(let[e,t]of u.positions)a.set(e,t);return{positions:a,edgePaths:[],chrome:o,bbox:u.bbox}}var Xe=(e,t)=>({rep:`chart`,...Ye(e,qe([e]),t?.viewport??V)}),Ze=new WeakMap;function Qe(e,t){let n=new Set;for(let r of e)r.from===r.to||!t(r)||(n.add(r.from),n.add(r.to));return n}function $e(e){let t=Ze.get(e);if(t)return t;let n=Qe(e.edges,e=>typeof e.weight==`number`);return Ze.set(e,n),n}var et=340,tt=4,nt=U+30,rt=3;function it(e,t){return e.parentId===void 0&&$e(t).has(e.id)}var at=(e,t)=>{let n=t?.viewport??V,r=e.nodes.filter(e=>e.parentId===void 0),i=r.filter(t=>it(t,e)),a=r.filter(t=>!it(t,e)),o=e.nodes.filter(e=>e.parentId!==void 0),s=new Map,c={bands:[],paths:[],labels:[]},l=[],u=new Set(i.map(e=>e.id)),d=e.edges.filter(e=>e.from!==e.to&&typeof e.weight==`number`&&u.has(e.from)&&u.has(e.to)),f=i.reduce((e,t)=>Math.min(e,t.depth??0),1/0),p=new Map;for(let e of d)p.set(e.from,(p.get(e.from)??0)+(e.weight??0));let m=i.reduce((e,t)=>Math.max(e,Number.isFinite(f)?(t.depth??0)-f:0),0),h=e=>{let t=Number.isFinite(f)?(e.depth??0)-f:0;return m<=0?0:m<tt?t:Math.round(t/m*3)},g=new Map;for(let e of i){let t=h(e),n=g.get(t);n?n.push(e):g.set(t,[e])}for(let e of g.values())e.sort((e,t)=>(p.get(t.id)??0)-(p.get(e.id)??0)||e.id.localeCompare(t.id));let _=Math.max(1,...[...g.values()].map(e=>e.length));for(let[e,t]of g){let n=(_-t.length)*nt/2;t.forEach((t,r)=>{s.set(t.id,{x:56+e*et,y:56+n+r*nt,w:200,h:64,face:`card`})})}for(let e of d){let t=s.get(e.from),n=s.get(e.to),r=t.x+t.w,i=t.y+t.h/2,a=n.x,o=n.y+n.h/2,c=(r+a)/2,u=Math.min(1,Math.max(0,e.weight??0));l.push({id:e.id,d:`M ${K(r)} ${K(i)} C ${K(c)} ${K(i)} ${K(c)} ${K(o)} ${K(a)} ${K(o)}`,className:`morph-edge morph-ribbon`+q(e.kind),width:rt+u*23})}for(let e of o){let t=(e.parentId===void 0?void 0:s.get(e.parentId))??{x:56,y:56};s.set(e.id,{x:t.x,y:t.y,w:200,h:64,face:`card`,folded:!0})}let v=be(a,{x:0,y:0,w:112+(Math.max(1,...[...g.keys()].map(e=>e+1))-1)*et+200,h:112+_*nt},`${a.length} with no measured share — the ribbons cannot size these`,n);for(let[e,t]of v.positions)s.set(e,t);return v.band&&c.bands.push(v.band),{rep:`flow`,positions:s,edgePaths:l,chrome:c,bbox:v.bbox}},ot=200;function st(e,t=24){let n=e.length;if(n<2)return;let r=0;for(let t of e)r=Math.max(r,t.w,t.h);r=Math.max(r+t,1);let i=Array(n),a=new Map;for(let o=0;o<ot;o++){a.clear();let o=[],s=[],c=[];for(let t=0;t<n;t++){let n=e[t],l=Math.floor((n.x+n.w/2)/r),u=Math.floor((n.y+n.h/2)/r),d=a.get(l);d===void 0&&(d=new Map,a.set(l,d));let f=d.get(u);f===void 0&&(f=c.length,d.set(u,f),o.push(l),s.push(u),c.push([])),c[f].push(t),i[t]=f}let l=c.map((e,t)=>{let n=[];for(let e=-1;e<=1;e++){let r=a.get(o[t]+e);if(r!==void 0)for(let e=-1;e<=1;e++){let i=r.get(s[t]+e);if(i!==void 0)for(let e of c[i])n.push(e)}}return n.sort((e,t)=>e-t)}),u=Array(c.length).fill(0),d=!1;for(let r=0;r<n;r++){let n=i[r],a=l[n],o=u[n];for(;o<a.length&&a[o]<=r;)o++;u[n]=o;let s=e[r];for(;o<a.length;o++){let n=a[o],i=e[n],c=i.x+i.w/2-(s.x+s.w/2),l=i.y+i.h/2-(s.y+s.h/2);c===0&&l===0&&(c=r-n,l=n-r);let u=(s.w+i.w)/2+t-Math.abs(c),f=(s.h+i.h)/2+t-Math.abs(l);if(!(u<=0||f<=0)){if(d=!0,u<=f){let e=u/2*(c<0?-1:1);s.x-=e,i.x+=e}else{let e=f/2*(l<0?-1:1);s.y-=e,i.y+=e}}}}if(!d)break}}var ct=300,lt=U+4,ut=4,dt=U+ut,ft=ct-200,pt=200+ut,mt=96,ht=30,gt=20,_t=18,vt=15,yt=2.5,bt=1/1.4,xt=1.7,St=2.6,Ct={rows:1,reach:0};function wt(e,t){let n=e.map(e=>t(e.id).rows).sort((e,t)=>t-e),r=e.map(e=>t(e.id).reach).sort((e,t)=>t-e),i=[0],a=0;for(let e of n)i.push(a+=e);return{size:e.length,rows:a,tallest:i,reaches:r}}function Tt(e,t){let n=[],r=[],i=[],a=[];for(let o of e){let e=Math.max(1,Math.min(o.size,Math.ceil(o.rows/t))),s=Math.ceil(o.size/e),c=Math.ceil(o.size/s);i.push(n.length),a.push(s);for(let e=0;e<c;e++)n.push(o.tallest[Math.min(s,o.size-e*s)]),r.push(200+(o.reaches[e]??0))}return{rows:n,widths:r,start:i,per:a}}function Et(e,t){let n=[],r=[],i=[];for(let a=0;a<e.rows.length;a++){let o=Math.floor(a/t),s=a%t===0?0:n[a-1]+e.widths[a-1]+ft;n.push(s),r[o]=Math.max(r[o]??1,e.rows[a]),i[o]=Math.max(i[o]??0,s+e.widths[a])}return{columnX:n,bandRows:r,bandW:i}}var Dt=12;function Ot(e,t){let n=n=>{let r=(t.h-(n-1)*mt-112)/n,i=Math.max(2,Math.floor((r-64)/lt)+1),a=Tt(e,i),o=Math.max(1,Math.ceil(a.rows.length/n)),{bandRows:s,bandW:c}=Et(a,o),l=200;for(let e of c)l=Math.max(l,e);let u=(n-1)*mt;for(let e=0;e<n;e++)u+=((s[e]??1)-1)*lt+64;return{bands:n,rowCap:i,perBand:o,fit:Math.min(t.w/(l+112),t.h/(u+112)),aspect:l/u}},r=n(1);if(e.length<2||r.fit>=bt)return r;let i=r;for(let e=2;e<=Dt;e++){let t=n(e);if(t.fit>=bt&&t.aspect<=yt)return t;if(t.fit>i.fit&&(i=t),t.perBand===1)break}return i}function kt(e,t,n){let r=Ot(t,n),i=Tt(t,r.rowCap),{columnX:a,bandRows:o}=Et(i,r.perBand),s=new Map,c=new Map;e.forEach((e,t)=>{s.set(e,i.start[t]),c.set(e,i.per[t])});let l=o.length>0?o:[1],u=[],d=[],f=[],p=0;for(let e of l){let t=(e-1)*lt+64;u.push(p+t/2),d.push(t),p+=t,f.push(p+mt/2),p+=mt}return{perBand:r.perBand,columnRows:i.rows,columnX:a,startOf:s,splitOf:c,centreY:u,height:d,gutterY:f}}function At(e,t){let n=new Map,r=new Set;for(let t of e)typeof t.depth==`number`&&Number.isFinite(t.depth)?(n.set(t.id,t.depth),r.add(t.id)):n.set(t.id,0);let i=t.edges.filter(e=>e.from!==e.to&&n.has(e.from)&&n.has(e.to)),a=new Map,o=new Map(e.map(e=>[e.id,0]));for(let e of i){let t=a.get(e.from);t===void 0?a.set(e.from,[e.to]):t.push(e.to),o.set(e.to,o.get(e.to)+1)}let s=(e,t)=>r.has(e)?t:t+1,c=e.filter(e=>o.get(e.id)===0).map(e=>e.id),l=new Set;for(let e=0;e<c.length;e++){let t=c[e];l.add(t);let r=n.get(t);for(let e of a.get(t)??[]){let t=s(e,r);t>n.get(e)&&n.set(e,t);let i=o.get(e)-1;o.set(e,i),i===0&&c.push(e)}}if(l.size<e.length){let t=i.filter(e=>!l.has(e.to));for(let r=e.length;r>0;r--){let e=!1;for(let r of t){let t=s(r.to,n.get(r.from));t>n.get(r.to)&&(n.set(r.to,t),e=!0)}if(!e)break}}let u=t.outcomeId;if(u!==void 0&&n.has(u)&&!r.has(u)&&(a.get(u)?.length??0)===0){let e=-1/0;for(let t of n.values())t>e&&(e=t);n.set(u,e)}return n}function jt(e,t){let n=new Map(e.map(e=>[e.id,0])),r=new Map(e.map(e=>[e.id,0])),i=new Map,a=0;for(let o of e)for(let e of t.get(o.id)??[]){if(e===o.id||!n.has(e))continue;let t=i.get(e);t===void 0?i.set(e,[o.id]):t.push(o.id),r.set(o.id,r.get(o.id)+1),a++}if(a===0)return n;let o=e.filter(e=>r.get(e.id)===0).map(e=>e.id);for(let e=0;e<o.length;e++){let t=o[e],a=n.get(t);for(let e of i.get(t)??[]){a+1>n.get(e)&&n.set(e,a+1);let t=r.get(e)-1;r.set(e,t),t===0&&o.push(e)}}return n}function Mt(e,t){let n=new Map,r=new Set,i=[],a=new Set;for(let o of e){if(n.has(o.id))continue;i.length=0,a.clear();let e=o,s=0,c=!1;for(;;){let o=e.parentId===void 0?void 0:t.get(e.parentId);if(o===void 0){n.set(e.id,null);break}if(i.push(e),a.add(e.id),n.has(o.id)){c=r.has(o.id),s=n.get(o.id)??0;break}if(a.has(o.id)){c=!0;break}e=o}if(c)for(let e of i)n.set(e.id,null),r.add(e.id);else for(let e=i.length-1;e>=0;e--)n.set(i[e].id,++s)}return n}function Nt(e,t){let n=new Map(e.nodes.map(e=>[e.id,e])),r=Mt(e.nodes,n),i=e.nodes.filter(e=>r.get(e.id)===null),a=e.nodes.filter(e=>r.get(e.id)!==null).sort((e,t)=>r.get(e.id)-r.get(t.id)||e.id.localeCompare(t.id)),o=t?.expandedIds,s=t?.previous,c=new Map,l=At(i,e),u=new Set(i.map(e=>e.id)),d=new Set;for(let e of a){let t=e.parentId;o?.has(t)===!0&&(u.has(t)||d.has(t))&&d.add(e.id)}let f=new Map,p=e=>f.get(e)??Ct;for(let e=a.length-1;e>=0;e--){let t=a[e];if(!d.has(t.id))continue;let n=p(t.id),r=f.get(t.parentId);f.set(t.parentId,{rows:(r?.rows??0)+n.rows,reach:Math.max(r?.reach??0,pt+n.reach)})}let m=new Map,h=new Map;for(let e of a){let t=h.get(e.parentId)??0;m.set(e.id,t),h.set(e.parentId,t+p(e.id).rows)}let g=new Map;for(let t of e.edges)!u.has(t.from)||!u.has(t.to)||(g.has(t.to)||g.set(t.to,[]),g.get(t.to).push(t.from));let _=new Map;for(let e of i){let t=l.get(e.id),n=_.get(t);n===void 0?_.set(t,[e]):n.push(e)}let v=[..._.keys()].sort((e,t)=>e-t),y=t?.viewport??V,b=kt(v,v.map(e=>wt(_.get(e),p)),y),x=new Map;for(let e of v){let t=_.get(e),n=jt(t,g),r=t.map((e,t)=>{let r=(g.get(e.id)??[]).map(e=>c.get(e)?.y).filter(e=>e!==void 0);return{n:e,bary:r.length?r.reduce((e,t)=>e+t,0)/r.length:s?.get(e.id)?.y??t*lt,rank:n.get(e.id)}});r.sort((e,t)=>e.rank-t.rank||e.bary-t.bary||e.n.id.localeCompare(t.n.id));let i=b.startOf.get(e),a=b.splitOf.get(e),o=[],l=[];r.forEach((e,t)=>{let n=Math.floor(t/a);o.push(l[n]??0),l[n]=(l[n]??0)+p(e.n.id).rows}),r.forEach((e,t)=>{let n=Math.floor(t/a),r=i+n,s=Math.floor(r/b.perBand),u=p(e.n.id).rows;x.set(e.n.id,s),c.set(e.n.id,{x:b.columnX[r],y:b.centreY[s]+(o[t]+(u-1)/2-(l[n]-1)/2)*lt})})}for(let e of a){let t=e.parentId,n=c.get(t);if(x.set(e.id,x.get(t)??0),d.has(e.id)){let r=p(e.id).rows,i=h.get(t);c.set(e.id,{x:n.x+pt,y:n.y+(m.get(e.id)+(r-1)/2-(i-1)/2)*dt})}else c.set(e.id,{x:n.x,y:n.y})}if(d.size>0){let e=[...i,...a.filter(e=>d.has(e.id))],t=e.map(e=>{let t=c.get(e.id);return{x:t.x-100,y:t.y-U/2,w:200,h:U}});st(t,ut),e.forEach((e,n)=>{c.set(e.id,{x:t[n].x+100,y:t[n].y+U/2})});for(let e of a){if(d.has(e.id))continue;let t=c.get(e.parentId);c.set(e.id,{x:t.x,y:t.y})}}let S=1/0,C=1/0,w=-1/0,T=-1/0;for(let e of c.values())S=Math.min(S,e.x-100),C=Math.min(C,e.y-32),w=Math.max(w,e.x+100),T=Math.max(T,e.y+32);let E=c.size===0,D=E?0:56-S,O=E?0:56-C,k=new Map;for(let t of e.nodes){let e=c.get(t.id);k.set(t.id,{x:e.x+D-100,y:e.y+O-32,w:200,h:64,face:`card`,...r.get(t.id)!==null&&!d.has(t.id)?{folded:!0}:{}})}let A=e=>u.has(e)||d.has(e),j=E?56:w+D,M=e.edges.filter(e=>A(e.from)&&A(e.to)).map(e=>{let t=k.get(e.from),n=k.get(e.to),r=x.get(e.from)??0,i=x.get(e.to)??0,a=r===i?-1:Math.max(r,i)-1;return{e,from:t,to:n,gutter:a,vertical:a<0&&n.x<=t.x&&Math.abs(n.y-t.y)>1}}),N=new Map,P=new Map,F=new Map,I=(e,t)=>void e.set(t,(e.get(t)??0)+1);for(let e of M)e.gutter>=0&&I(N,e.gutter),!e.vertical&&(I(P,e.e.to),I(F,e.e.from));let L=new Map,R=new Map,z=new Map,B=(e,t,n)=>e.y+e.h/2+(n-(t-1)/2)*Math.min(vt,e.h/(t+1)),H=[];for(let{e,from:t,to:n,gutter:r,vertical:i}of M){let a;if(i){let e=t.x+t.w/2,r=n.x+n.w/2,i=n.y>t.y,o=i?t.y+t.h:t.y,s=i?n.y:n.y+n.h,c=(o+s)/2;a=`M ${K(e)} ${K(o)} C ${K(e)} ${K(c)} ${K(r)} ${K(c)} ${K(r)} ${K(s)}`}else{let i=z.get(e.from)??0,o=R.get(e.to)??0;z.set(e.from,i+1),R.set(e.to,o+1);let s=t.x+t.w,c=B(t,F.get(e.from),i),l=n.x,u=B(n,P.get(e.to),o);if(r<0){let e=(s+l)/2;a=`M ${K(s)} ${K(c)} C ${K(e)} ${K(c)} ${K(e)} ${K(u)} ${K(l)} ${K(u)}`}else{let e=N.get(r),t=L.get(r)??0;L.set(r,t+1);let n=Math.min(_t,(mt-32)/Math.max(1,e)),i=b.gutterY[r]+O+(t-(e-1)/2)*n,o=j+ht,d=Math.min(l,56)-ht,f=(o+d)/2;a=`M ${K(s)} ${K(c)} C ${K(o)} ${K(c)} ${K(o)} ${K(i)} ${K(f)} ${K(i)} C ${K(d)} ${K(i)} ${K(d)} ${K(u)} ${K(l)} ${K(u)}`}}H.push({id:e.id,d:a,className:`morph-edge`+q(e.kind)+(e.sign===-1?` morph-edge--damp`:``)+(e.provisional?` morph-edge--provisional`:``)+(r<0?``:` morph-edge--wrap`),...typeof e.weight==`number`&&Number.isFinite(e.weight)?{width:xt+Math.min(1,Math.max(0,e.weight))*St}:{}})}let W=E?{x:0,y:0,w:112,h:112}:{x:0,y:0,w:w-S+112,h:T-C+112};return{positions:k,edgePaths:H,chrome:{bands:E||b.centreY.length<2?[]:b.centreY.map((e,t)=>{let n=Math.max(W.y,e-b.height[t]/2+O-gt),r=Math.min(W.y+W.h,e+b.height[t]/2+O+gt);return{id:`reading-band:${t}`,x:56-gt,y:n,w:j-56+40,h:Math.max(0,r-n),className:`morph-reading-band`}}),paths:[],labels:[]},bbox:W}}var Pt=(e,t)=>({rep:`graph`,...Nt(e,t)}),Ft=920,It=16,Lt=44+It,Rt=12,zt=8,Bt=12;function Vt(e){if(!e.date||!Number.isFinite(e.date.start))return null;let t=ee(e.date.start),n=e.date.end;return{node:e,startYear:t,...n!==void 0&&Number.isFinite(n)&&n>e.date.start?{endYear:ee(n)}:{}}}var Ht=e=>Vt(e)!==null;function Ut(e){let t=1/0,n=-1/0;for(let r of e)for(let e of r.nodes){let r=Vt(e);r&&(t=Math.min(t,r.startYear),n=Math.max(n,r.endYear??r.startYear))}return t===1/0?null:me(t,n,6)}function Wt(e){let t=1;for(;t<e;)t*=2;let n=Array(t*2).fill(1/0),r=0;return(e,i)=>{let a=1;if(n[1]<=i)for(;a<t;)a=n[a*2]<=i?a*2:a*2+1;else a=t+r++;let o=a-t;for(n[a]=e;a>1;)a>>=1,n[a]=Math.min(n[a*2],n[a*2+1]);return o}}function Gt(e,t,n){let r=[],i=[];for(let n of e.nodes){let e=Vt(n);e&&t?r.push(e):i.push(n)}r.sort((e,t)=>e.startYear-t.startYear||e.node.id.localeCompare(t.node.id));let a=new Map,o={bands:[],paths:[],labels:[]},s=[],c=1/0,l=-1/0,u=56;if(r.length>0&&t){let n=d(t.domain,[56,56+Ft]),i=Wt(r.length);for(let e of r){let t=n(e.startYear),r=e.endYear===void 0?t:n(e.endYear),s=e.endYear===void 0?t-80:t,d=Math.min(s,t)-32,f=Math.max(s+160,r)+32,p=56+i(f+Bt,d)*Lt;a.set(e.node.id,{x:s,y:p,w:160,h:44,face:`entry`}),e.endYear!==void 0&&o.bands.push({id:`period:${e.node.id}`,x:t,y:p-6,w:Math.max(r-t,2),h:56,className:`morph-period`}),c=Math.min(c,d),l=Math.max(l,f),u=Math.max(u,p+44)}let f=u+It+Rt;o.paths.push({id:`axis`,d:`M ${K(56)} ${K(f)} L ${K(56+Ft)} ${K(f)}`,className:`morph-axis`}),t.ticks.forEach((e,t)=>{let r=n(e.year);o.paths.push({id:`tick:${t}`,d:`M ${K(r)} ${K(f)} L ${K(r)} ${K(f+zt)}`,className:`morph-tick`}),o.labels.push({id:`tick-label:${t}`,x:r,y:f+zt+16,text:e.text,className:`morph-axis-label`,anchor:`middle`}),c=Math.min(c,r-e.text.length*3.5),l=Math.max(l,r+e.text.length*3.5)}),c=Math.min(c,56),l=Math.max(l,56+Ft),u=f+zt+20;let p=new Set(r.map(e=>e.node.id));for(let t of e.edges){if(t.from===t.to||!p.has(t.from)||!p.has(t.to))continue;let e=a.get(t.from),n=a.get(t.to),r=e.x+e.w/2,i=n.x+n.w/2,o=e.y,c=n.y,l=Math.min(72,Math.max(20,Math.abs(i-r)*.2));s.push({id:t.id,d:`M ${K(r)} ${K(o)} C ${K(r)} ${K(o-l)} ${K(i)} ${K(c-l)} ${K(i)} ${K(c)}`,className:`morph-edge morph-edge--faint`+q(t.kind)})}}let f=be(i,c===1/0?{x:0,y:0,w:112,h:112}:{x:c-56,y:0,w:l-c+112,h:u+56},`${i.length} with no date — the timeline cannot place these`,n);f.band&&o.bands.push(f.band);for(let[e,t]of f.positions)a.set(e,t);return{positions:a,edgePaths:s,chrome:o,bbox:f.bbox}}var Kt=(e,t)=>({rep:`timeline`,...Gt(e,Ut([e]),t?.viewport??V)}),qt={min:G,max:2.2},Jt=56,Yt=1300,Xt=1300,Zt=.7,Qt=120,$t=120,en=[`graph`,`flow`,`timeline`,`chart`],tn={graph:Pt,timeline:Kt,chart:Xe,flow:at},nn={graph:`What caused what`,timeline:`The same causes, in time`,chart:`How much each one moved`,flow:`How much each one contributed`},rn={graph:()=>!0,timeline:Ht,chart:We,flow:it},an=2,on=1/3;function sn(e,t){let n=t.nodes.filter(e=>e.parentId===void 0);if(n.length===0)return!1;let r=n.filter(n=>rn[e](n,t)).length;return r>=Math.min(an,n.length)&&r/n.length>=on}var cn=e=>({x:0,y:0,w:e.w,h:e.h}),ln=(e,t,n)=>[t-e.x,n-e.y];function un(e,t,n){let r=e.positions.get(t);if(!r)return null;let i=r.x,a=r.y,o=r.x+r.w,s=r.y+r.h;for(let r of n.get(t)??[]){let t=e.positions.get(r);!t||t.folded||(i=Math.min(i,t.x),a=Math.min(a,t.y),o=Math.max(o,t.x+t.w),s=Math.max(s,t.y+t.h))}let[c,l]=ln(e.bbox,i-Qt,a-Qt);return{x:c,y:l,w:o-i+240,h:s-a+240}}function dn(e){let{world:t,onAscend:n,driverId:r,insetBottom:i}=e,[a,o]=(0,P.useState)(e.initialRep??`graph`),[l,u]=(0,P.useState)(()=>new Set),[d,f]=(0,P.useState)(null),p=c({clamp:qt,margin:Jt,...i===void 0?{}:{insetBottom:i}}),m=(0,P.useRef)(void 0),{viewport:h}=p,g=(0,P.useMemo)(()=>h?{w:Math.max(1,h.w-112),h:Math.max(1,h.h-112)}:void 0,[h]),_=(0,P.useMemo)(()=>tn[a](t,{expandedIds:l,previous:m.current,...g?{viewport:g}:{}}),[a,t,l,g]);(0,P.useEffect)(()=>{let e=new Map;for(let[t,n]of _.positions)e.set(t,{x:n.x,y:n.y});m.current=e},[_]);let v=(0,P.useRef)(a);v.current=a;let y=(0,P.useRef)(_);y.current=_;let b=(0,P.useRef)(p.camera);b.current=p.camera;let x=(0,P.useRef)(l);x.current=l;let C=(0,P.useRef)(n);C.current=n;let[w,T]=(0,P.useState)(null),{endFlight:E}=p,D=(0,P.useCallback)(()=>{T({layout:y.current,rep:v.current,expandedIds:x.current}),E()},[E]),O=(0,P.useRef)(0),k=(0,P.useRef)(void 0);(0,P.useEffect)(()=>()=>clearTimeout(k.current),[]);let A=(0,P.useCallback)(e=>{if(e===v.current)return;let t=++O.current;f({layout:y.current,token:t}),clearTimeout(k.current),k.current=setTimeout(()=>{t===O.current&&f(null)},Yt),v.current=e,o(e)},[]),j=(0,P.useCallback)(e=>{e===O.current&&(clearTimeout(k.current),f(null))},[]),M=(0,P.useRef)(null),N=(0,P.useCallback)(e=>{let t=new Set(x.current);t.delete(e)||(t.add(e),M.current=e),u(t)},[]),F=(0,P.useMemo)(()=>{let e=new Map;for(let n of t.nodes){if(n.parentId===void 0)continue;let t=e.get(n.parentId);t?t.push(n.id):e.set(n.parentId,[n.id])}return e},[t]),{fitTo:I,setCamera:L,viewportRef:R}=p;(0,P.useEffect)(()=>{let e=M.current;if(M.current=null,e!==null){let t=un(_,e,F);if(t){I(t);return}}I(cn(_.bbox))},[_,F,I,L,R]);let z=(0,P.useMemo)(()=>new Map(t.nodes.map(e=>[e.id,e.parentId])),[t]),B=(0,P.useMemo)(()=>{let e=new Set;for(let t of z.values())t!==void 0&&e.add(t);return e},[z]),V=(0,P.useCallback)(e=>{let t=0,n=e,r=new Set;for(;n!==void 0&&!r.has(n);)r.add(n),n=z.get(n),n!==void 0&&(t+=1);return t},[z]),{zoomAtClient:H}=p,U=(0,P.useCallback)((e,t,n,r)=>{if(e>=1)return r!==void 0&&B.has(r)&&!x.current.has(r)?(N(r),`expand`):(H(e,t,n),`zoom`);let i=R.current?.getBoundingClientRect();if(Pe(`out`,!!i&&(i.width>0||i.height>0)&&s(b.current,cn(y.current.bbox),{w:i.width,h:i.height},Jt,qt))===`zoom-camera`)return H(e,t,n),`zoom`;let a=[...x.current];if(a.length>0){let e=a[0],t=V(e);for(let n of a){let r=V(n);r>t&&(e=n,t=r)}return N(e),`collapse`}return C.current?.(),`ascend`},[B,N,H,R,V]),W=(0,P.useCallback)(e=>{let t=y.current,n=e===null?void 0:t.positions.get(e);if(!n||n.folded){I(cn(t.bbox));return}let[r,i]=ln(t.bbox,n.x-$t,n.y-$t);I({x:r,y:i,w:n.w+240,h:n.h+240})},[I]);(0,P.useEffect)(()=>{if(r!==void 0)return S(r,{count:en.length,setIndex:e=>A(en[Math.min(en.length-1,Math.max(0,Math.trunc(e)))]),spokenFor:()=>void 0,captionFor:e=>{let t=en[e];return t?nn[t]:void 0}})},[r,A]);let G=w?.layout!==_||p.flying;return(0,P.useEffect)(()=>{if(!G)return;let e=setTimeout(D,Xt);return()=>clearTimeout(e)},[G,_,D]),{rep:a,setRep:A,layout:_,exiting:d,settleExit:j,expandedIds:l,toggleExpand:N,cam:p,morphing:G,settle:D,lod:p.camera.scale>=Zt?`near`:`far`,pinch:U,focusNode:W}}function fn({label:e,min:t,max:n,step:r=1,value:i,onChange:a,format:o,color:s=`var(--presence)`}){let c=n-t||1,l=(i-t)/c*100;return(0,X.jsxs)(`label`,{className:`viz-ctl`,style:{"--ctl-c":s,"--ctl-pct":l+`%`},children:[(0,X.jsx)(`span`,{className:`viz-ctl-label`,children:e}),(0,X.jsx)(`input`,{type:`range`,className:`viz-ctl-range`,min:t,max:n,step:r,value:i,"aria-label":e,onChange:e=>a(Number(e.target.value))}),(0,X.jsx)(`span`,{className:`viz-ctl-val tab-num`,children:o?o(i):i.toLocaleString()})]})}var pn=`No cause is established yet, so there is nothing to push on.`;function mn(e){let t=(0,F.c)(17),{levers:n,onSet:r,onReset:i}=e,a;t[0]===n?a=t[1]:(a=n.every(gn),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(`h3`,{className:`tr-sec-title`,children:`WHAT IF`}),t[2]=s):s=t[2];let c;t[3]!==i||t[4]!==o?(c=(0,X.jsxs)(`div`,{className:`tr-levers-head`,children:[s,(0,X.jsx)(`button`,{type:`button`,className:`tr-reset`,onClick:i,disabled:o,children:`Reset`})]}),t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===n.length?l=t[7]:(l=n.length===0&&(0,X.jsx)(`p`,{className:`tr-levers-empty`,children:pn}),t[6]=n.length,t[7]=l);let u;if(t[8]!==n||t[9]!==r){let e;t[11]===r?e=t[12]:(e=e=>(0,X.jsx)(fn,{label:e.label,min:0,max:100,value:e.pct,onChange:t=>r(e.id,t),format:hn},e.id),t[11]=r,t[12]=e),u=n.map(e),t[8]=n,t[9]=r,t[10]=u}else u=t[10];let d;return t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,X.jsxs)(`div`,{className:`tr-levers`,children:[c,l,u]}),t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function hn(e){return`${e}%`}function gn(e){return e.pct===100}var _n=(0,P.memo)(mn);function vn(e){return e.kind}var yn=(0,P.createContext)(null);function bn(){return(0,P.useContext)(yn)}function xn(e){let t=(0,F.c)(19),{id:n,className:r}=e,i=bn(),a,o,s,c,l,u;if(t[0]!==r||t[1]!==n||t[2]!==i){u=Symbol.for(`react.early_return_sentinel`);bb0:{let e=i?.registry.values.get(n);if(!e){u=null;break bb0}let d=`tr-num`+(r?` ${r}`:``);if(e.kind===`structure`){u=(0,X.jsx)(`span`,{className:`${d} tr-num-qual`,"data-status":`structure`,children:e.resolution.raw});break bb0}a=`button`,o=d,s=vn(e),t[9]!==n||t[10]!==i?(c=e=>i?.open(n,e.currentTarget),t[9]=n,t[10]=i,t[11]=c):c=t[11],l=_(e)}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u}else a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(`span`,{className:`tr-sr`,children:`, source available`}),t[12]=d):d=t[12];let f;return t[13]!==a||t[14]!==o||t[15]!==s||t[16]!==c||t[17]!==l?(f=(0,X.jsxs)(`button`,{type:a,className:o,"data-status":s,onClick:c,children:[l,d]}),t[13]=a,t[14]=o,t[15]=s,t[16]=c,t[17]=l,t[18]=f):f=t[18],f}var Sn=8,Cn=6;function wn(e,t,n){return Math.max(Sn,Math.min(e,n-t-Sn))}function Tn(e,t,n){if(!(e.width>0||e.height>0||e.left>0||e.top>0))return{left:wn((n.w-t.w)/2,t.w,n.w),top:wn((n.h-t.h)/2,t.h,n.h)};let r=e.bottom+Cn,i=e.top-Cn-t.h,a=r+t.h+Sn>n.h&&i>=Sn;return{left:wn(e.left,t.w,n.w),top:wn(a?i:r,t.h,n.h)}}var En=320,Dn=340,On=8;function kn(e){let t=(0,F.c)(64),{registry:n,valueId:r,anchorRect:i,trail:a,hinted:s,onMarkHinted:c,onDrill:l,onBack:u,onNavigate:d,onDismiss:f}=e,p=(0,P.useRef)(null),m;t[0]===f?m=t[1]:(m={onEscape:f},t[0]=f,t[1]=m),o(p,m);let[y]=(0,P.useState)(!s),S,C;t[2]===c?(S=t[3],C=t[4]):(S=()=>c(),C=[c],t[2]=c,t[3]=S,t[4]=C),(0,P.useEffect)(S,C);let w=(0,P.useRef)(!0),T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{w.current||p.current?.focus({preventScroll:!0}),w.current=!1},t[5]=T):T=t[5];let E;t[6]===r?E=t[7]:(E=[r],t[6]=r,t[7]=E),(0,P.useEffect)(T,E);let D,O;t[8]===f?(D=t[9],O=t[10]):(D=()=>{let e=e=>{let t=p.current;t&&e.target instanceof Node&&!t.contains(e.target)&&f()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},O=[f],t[8]=f,t[9]=D,t[10]=O),(0,P.useEffect)(D,O);let k=n.values,A,j,M,N,I,L,R,z,B,V,H,U,W,G;if(t[11]!==i||t[12]!==u||t[13]!==l||t[14]!==d||t[15]!==n.usedIn||t[16]!==n.values||t[17]!==a||t[18]!==r){U=Symbol.for(`react.early_return_sentinel`);bb0:{if(G=k.get(r),!G){U=null;break bb0}let e=vn(G),o=G.scope,s=n.usedIn.get(r)??[],c=G.kind===`grounded`?G.resolution.receipt:null,f=G.kind===`grounded`&&G.resolution.tier===`T1`,m=c?.url?b(c.url):null,y=c?c.host??(c.url?x(c.url):null):null,S=G.kind===`calculated`?G.calc.inputs:[],C=S.slice(0,On),w=S.length-C.length,T;t[33]!==n.values||t[34]!==a?(T=a.length>0?n.values.get(a[a.length-1]):void 0,t[33]=n.values,t[34]=a,t[35]=T):T=t[35];let E=T,D;t[36]===i?D=t[37]:(D=Tn(i,{w:En,h:Dn},{w:window.innerWidth,h:window.innerHeight}),t[36]=i,t[37]=D);let{left:O,top:P}=D;W=p,A=`tr-card`,j=`dialog`,M=`false`,N=`Where ${G.label} came from`,I=-1,t[38]!==O||t[39]!==P?(L={left:O,top:P,width:En,maxHeight:Dn},t[38]=O,t[39]=P,t[40]=L):L=t[40];let F;t[41]!==u||t[42]!==E?(F=E&&(0,X.jsxs)(`button`,{type:`button`,className:`tr-back`,onClick:u,"aria-label":`Back to ${E.label}`,children:[`‹ back`,(0,X.jsxs)(`span`,{className:`tr-back-to`,children:[` to `,E.label]})]}),t[41]=u,t[42]=E,t[43]=F):F=t[43],R=(0,X.jsxs)(`header`,{className:`tr-head`,children:[F,(0,X.jsx)(`span`,{className:`tr-badge`,"data-status":e,children:v[e]}),(0,X.jsx)(`p`,{className:`tr-figure`,children:_(G)}),(0,X.jsx)(`p`,{className:`tr-label`,children:G.label})]}),z=c&&(0,X.jsxs)(`section`,{className:`tr-sec`,children:[(0,X.jsx)(`h3`,{className:`tr-sec-title`,children:`SOURCE`}),c.quote&&(0,X.jsxs)(`blockquote`,{className:`tr-quote`,children:[`“`,c.quote,`”`]}),f?(0,X.jsx)(`p`,{className:`tr-host`,children:h(c)}):y&&(0,X.jsxs)(`p`,{className:`tr-host`,children:[m?(0,X.jsx)(`a`,{href:m,target:`_blank`,rel:`noreferrer noopener`,children:y}):y,c.date&&(0,X.jsxs)(`span`,{className:`tr-date`,children:[` · `,c.date]})]})]}),B=o&&(o.region||o.period||o.unit)&&(0,X.jsxs)(`section`,{className:`tr-sec`,children:[(0,X.jsx)(`h3`,{className:`tr-sec-title`,children:`SCOPE`}),(0,X.jsx)(`p`,{className:`tr-chips`,children:[o.region,o.period,o.unit].filter(jn).map(An)})]}),V=G.kind===`calculated`&&(0,X.jsxs)(`section`,{className:`tr-sec`,children:[(0,X.jsx)(`h3`,{className:`tr-sec-title`,children:`CALCULATION`}),(0,X.jsx)(`p`,{className:`tr-formula`,children:g(G.calc.formula,e=>n.values.get(e)?.label)}),(0,X.jsx)(`ul`,{className:`tr-inputs`,children:C.map(e=>{let t=n.values.get(e);return(0,X.jsx)(`li`,{children:t?(0,X.jsxs)(`button`,{type:`button`,className:`tr-input`,onClick:()=>l(e),children:[(0,X.jsx)(`span`,{className:`tr-input-label`,children:t.label}),(0,X.jsx)(`span`,{className:`tr-input-val`,children:_(t)})]}):(0,X.jsx)(`span`,{className:`tr-input tr-input-missing`,children:e})},e)})}),w>0&&(0,X.jsxs)(`p`,{className:`tr-more`,children:[`…and `,w,` more`]}),G.calc.note&&(0,X.jsx)(`p`,{className:`tr-note`,children:G.calc.note})]}),H=s.length>0&&(0,X.jsxs)(`section`,{className:`tr-sec`,children:[(0,X.jsx)(`h3`,{className:`tr-sec-title`,children:`USED IN`}),(0,X.jsx)(`ul`,{className:`tr-used`,children:s.map(e=>(0,X.jsx)(`li`,{children:d?(0,X.jsx)(`button`,{type:`button`,className:`tr-usedin`,onClick:()=>d(e),children:e.label}):(0,X.jsx)(`span`,{className:`tr-usedin tr-usedin-flat`,children:e.label})},`${e.surface}:${e.id}:${e.label}`))})]})}t[11]=i,t[12]=u,t[13]=l,t[14]=d,t[15]=n.usedIn,t[16]=n.values,t[17]=a,t[18]=r,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=I,t[24]=L,t[25]=R,t[26]=z,t[27]=B,t[28]=V,t[29]=H,t[30]=U,t[31]=W,t[32]=G}else A=t[19],j=t[20],M=t[21],N=t[22],I=t[23],L=t[24],R=t[25],z=t[26],B=t[27],V=t[28],H=t[29],U=t[30],W=t[31],G=t[32];if(U!==Symbol.for(`react.early_return_sentinel`))return U;let K;t[44]!==G.kind||t[45]!==G.resolution?(K=G.kind===`illustrative`&&(0,X.jsxs)(`p`,{className:`tr-caveat`,children:[`Illustrative — shows the shape, not a measured fact. `,G.resolution.illustrative]}),t[44]=G.kind,t[45]=G.resolution,t[46]=K):K=t[46];let q;t[47]===y?q=t[48]:(q=y&&(0,X.jsx)(`p`,{className:`tr-hint`,children:`Any figure like this one opens its own receipt.`}),t[47]=y,t[48]=q);let J;return t[49]!==A||t[50]!==j||t[51]!==M||t[52]!==N||t[53]!==I||t[54]!==L||t[55]!==R||t[56]!==z||t[57]!==B||t[58]!==V||t[59]!==H||t[60]!==K||t[61]!==q||t[62]!==W?(J=(0,X.jsxs)(`div`,{ref:W,className:A,role:j,"aria-modal":M,"aria-label":N,tabIndex:I,style:L,children:[R,z,B,V,H,K,q]}),t[49]=A,t[50]=j,t[51]=M,t[52]=N,t[53]=I,t[54]=L,t[55]=R,t[56]=z,t[57]=B,t[58]=V,t[59]=H,t[60]=K,t[61]=q,t[62]=W,t[63]=J):J=t[63],J}function An(e){return(0,X.jsx)(`span`,{className:`tr-chip`,children:e},e)}function jn(e){return!!e}function Mn(e){let t=(0,F.c)(23),{registry:n,onNavigate:r,children:i,ref:a}=e,[o,s]=(0,P.useState)(null),[c,l]=(0,P.useState)(!1),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(null),t[0]=u):u=t[0];let d;t[1]===n?d=t[2]:(d=[n],t[1]=n,t[2]=d),(0,P.useEffect)(u,d);let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>s(null),t[3]=f):f=t[3];let p=f,m,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>({dismiss:p}),h=[p],t[4]=m,t[5]=h):(m=t[4],h=t[5]),(0,P.useImperativeHandle)(a,m,h);let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(e,t)=>{t.focus(),s({valueId:e,anchorRect:t.getBoundingClientRect(),trail:[]})},t[6]=g):g=t[6];let _=g,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>l(!0),t[7]=v):v=t[7];let y=v,b;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{s(t=>t&&{valueId:e,anchorRect:t.anchorRect,trail:[...t.trail,t.valueId]})},t[8]=b):b=t[8];let x=b,S;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{s(Nn)},t[9]=S):S=t[9];let C=S,w;t[10]!==c||t[11]!==r||t[12]!==n?(w={registry:n,open:_,onNavigate:r,hinted:c,markHinted:y},t[10]=c,t[11]=r,t[12]=n,t[13]=w):w=t[13];let T=w,E;t[14]!==o||t[15]!==c||t[16]!==r||t[17]!==n?(E=o&&(0,X.jsx)(kn,{registry:n,valueId:o.valueId,anchorRect:o.anchorRect,trail:o.trail,hinted:c,onMarkHinted:y,onDrill:x,onBack:C,onNavigate:r,onDismiss:p}),t[14]=o,t[15]=c,t[16]=r,t[17]=n,t[18]=E):E=t[18];let D;return t[19]!==i||t[20]!==E||t[21]!==T?(D=(0,X.jsxs)(yn.Provider,{value:T,children:[i,E]}),t[19]=i,t[20]=E,t[21]=T,t[22]=D):D=t[22],D}function Nn(e){let t=e?.trail[e.trail.length-1];return!e||t===void 0?e:{valueId:t,anchorRect:e.anchorRect,trail:e.trail.slice(0,-1)}}var Pn=.33,Fn=.1,In=.005;function Ln(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return`would barely change`;let n=Math.abs(e)>1e-9?Math.abs(e):1,r=(t-e)/n,i=Math.abs(r);if(i<=In)return`would barely change`;let a=r>0?`rise`:`fall`;return i>=Pn?`would ${a} meaningfully`:i>=Fn?`would ${a} somewhat`:`would ${a} slightly`}var Rn=.6;function zn(e){if(!Number.isFinite(e))return null;let t=e-1,n=Math.abs(t);if(n<=.005)return null;let r=t>0?`stronger`:`weaker`;return n>=Rn?`much ${r}`:n>=Pn?r:`slightly ${r}`}var Bn=`Recomputed locally from the causes above — a model of what would happen, never an observation.`,Vn=`What was actually measured. This column never moves when a lever is pulled.`;function Hn(e,t){return(e>0?`+`:``)+l(e,t)}function Un(e){return e!==null&&Number.isFinite(e)&&e>=0&&e<=1}function Wn(e){return e.exactBase===null?`nothing measured stands behind this outcome`:`not every step is grounded, so the total stays unmeasured`}function Gn(e){let t=(0,F.c)(22),{baseline:n,current:r,unit:i,active:a,observedNote:o}=e,s;t[0]!==n.exactBase||t[1]!==n.fullyGrounded||t[2]!==i?(s=n.fullyGrounded&&n.exactBase!==null?l(n.exactBase,i):null,t[0]=n.exactBase,t[1]=n.fullyGrounded,t[2]=i,t[3]=s):s=t[3];let c=s,u=r.exactBase??n.exactBase,d=a?`1`:void 0,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(`span`,{className:`tr-chip tr-wi-chip`,title:Vn,children:`OBSERVED`}),t[4]=f):f=t[4];let p;t[5]!==n||t[6]!==c||t[7]!==o?(p=(0,X.jsxs)(`div`,{className:`tr-wi-col`,children:[f,c===null?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}),(0,X.jsx)(`p`,{className:`tr-wi-note tr-wi-why`,children:o??Wn(n)})]}):(0,X.jsx)(`p`,{className:`tr-wi-figure`,children:c})]}),t[5]=n,t[6]=c,t[7]=o,t[8]=p):p=t[8];let m;t[9]!==a||t[10]!==u||t[11]!==r.exactDelta||t[12]!==r.explainedPct||t[13]!==r.fullyGrounded||t[14]!==r.relBase||t[15]!==r.relCur||t[16]!==i?(m=a&&(0,X.jsxs)(`div`,{className:`tr-wi-col tr-wi-hypo`,"data-world":`hypothetical`,children:[(0,X.jsx)(`span`,{className:`tr-chip tr-wi-chip tr-wi-chip-hypo`,title:Bn,children:`HYPOTHETICAL (MODELED)`}),r.fullyGrounded&&u!==null&&r.exactDelta!==null?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`tr-wi-figure`,children:l(u+r.exactDelta,i)}),(0,X.jsx)(`p`,{className:`tr-wi-delta`,children:Hn(r.exactDelta,i)}),Un(r.explainedPct)&&(0,X.jsxs)(`p`,{className:`tr-wi-note`,children:[Math.round(r.explainedPct*100),`% explained`]})]}):r.relCur===null?(0,X.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`tr-wi-figure tr-wi-phrase`,children:Ln(r.relBase??0,r.relCur)}),(0,X.jsx)(`p`,{className:`tr-wi-note`,children:`relative, not measured`})]})]}),t[9]=a,t[10]=u,t[11]=r.exactDelta,t[12]=r.explainedPct,t[13]=r.fullyGrounded,t[14]=r.relBase,t[15]=r.relCur,t[16]=i,t[17]=m):m=t[17];let h;return t[18]!==d||t[19]!==p||t[20]!==m?(h=(0,X.jsxs)(`div`,{className:`tr-wi`,"data-active":d,children:[p,m]}),t[18]=d,t[19]=p,t[20]=m,t[21]=h):h=t[21],h}var Kn=(0,P.memo)(Gn);function qn(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})}function Jn(e){return{id:e.id,label:e.label,role:e.role,depth:e.depth,tier:e.tier,...e.value===void 0?{}:{value:e.value},...e.unit?{unit:e.unit}:{},...e.receipt?{receipt:e.receipt}:{}}}function Yn(e){let t=e.receipts?.[0]??e.receipt;return{from:e.from,to:e.to,sign:e.sign,tier:e.tier,...e.verb?{verb:e.verb}:{},...e.weight===void 0?{}:{weight:e.weight},...t&&!e.provisional?{receipt:t}:{},...e.provisional?{provisional:!0}:{}}}function Xn(e){return{center:e.title,outcomeId:e.outcomeId,nodes:e.nodes.map(Jn),edges:e.edges.map(Yn),provenance:{...e.provenance.illustrative?{illustrative:!0}:{},...e.provenance.notes?.length?{notes:e.provenance.notes}:{}}}}var Zn=1100;function Qn(e,t,n,r){let i=!1,a=e=>{i||(i=!0,r(e))};(async()=>{for(let r=Math.max(0,t);r<e.length;r++){let t=e[r];if(!t)continue;if(n.isCancelled()){a(`cancelled`);return}let i=C(t.say),o=n.speakLine?.(t.say)??null,s=o?await E(o):!1;if(n.isCancelled()){a(`cancelled`);return}n.apply(t,r),o&&s?await w(o,i,Zn):await T(i)}a(n.isCancelled()?`cancelled`:`complete`)})()}function $n({beats:e,apply:t,speakLine:n}){let[r,i]=(0,P.useState)(-1),[a,o]=(0,P.useState)(!1),s=(0,P.useRef)(0),c=(0,P.useRef)(e);c.current=e;let l=(0,P.useRef)(t);l.current=t;let u=(0,P.useRef)(n);u.current=n;let d=(0,P.useCallback)(()=>{s.current+=1,o(!1)},[]),f=(0,P.useCallback)(e=>{let t=s.current+=1;o(!0),Qn(c.current,e,{speakLine:e=>u.current?.(e)??null,apply:(e,t)=>{i(t),l.current(e,t)},isCancelled:()=>s.current!==t},()=>{s.current===t&&o(!1)})},[]);(0,P.useEffect)(()=>()=>void(s.current+=1),[]),(0,P.useEffect)(()=>{s.current+=1,o(!1),i(-1)},[e]);let p=(0,P.useCallback)(()=>{if(a){d();return}let e=c.current.length;e!==0&&f(r>=0&&r<e-1?r:0)},[a,r,f,d]),m=(0,P.useCallback)(e=>{let t=c.current.length;t!==0&&f(Math.min(Math.max(e,0),t-1))},[f]),h=(0,P.useCallback)(()=>{d(),i(-1)},[d]);return{index:r,playing:a,caption:r>=0?e[r]?.caption??null:null,toggle:p,seek:m,reset:h}}var er=e=>`node:${e}`,tr=(e,t)=>`node:${e}@${t}`;function nr(e){let t=(0,F.c)(28),{count:n,index:r,playing:i,caption:a,expanded:o,onToggle:s,onSeek:c}=e;if(n===0)return null;let l=Math.min(Math.max(r,-1),n-1),u=i?``:void 0,d=o?``:void 0,f=`${o?108:54}px`,p;t[0]===f?p=t[1]:(p={"--wo-transport-h":f},t[0]=f,t[1]=p);let m=p,h=i?`Pause the walkthrough`:`Walk me through it`,g=i?`❙❙`:`▶`,_;t[2]===g?_=t[3]:(_=(0,X.jsx)(`span`,{className:`wo-play-glyph`,"aria-hidden":`true`,children:g}),t[2]=g,t[3]=_);let v=i?`Pause`:`Walk me through it`,y;t[4]===v?y=t[5]:(y=(0,X.jsx)(`span`,{className:`wo-play-label`,children:v}),t[4]=v,t[5]=y);let b;t[6]!==s||t[7]!==y||t[8]!==h||t[9]!==_?(b=(0,X.jsxs)(`button`,{type:`button`,className:`wo-play`,onClick:s,"aria-label":h,children:[_,y]}),t[6]=s,t[7]=y,t[8]=h,t[9]=_,t[10]=b):b=t[10];let x;t[11]!==l||t[12]!==n||t[13]!==o||t[14]!==c?(x=o&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`wo-track`,role:`group`,"aria-label":`Walkthrough beats`,children:Array.from({length:n},(e,t)=>(0,X.jsx)(`button`,{type:`button`,className:`wo-tick`,"data-state":t<l?`past`:t===l?`now`:`ahead`,onClick:()=>c(t),"aria-label":`Beat ${t+1} of ${n}`,"aria-current":t===l?`step`:void 0},t))}),(0,X.jsxs)(`span`,{className:`wo-transport-count`,"aria-hidden":`true`,children:[l<0?n:l+1,`/`,n]})]}),t[11]=l,t[12]=n,t[13]=o,t[14]=c,t[15]=x):x=t[15];let S;t[16]!==b||t[17]!==x?(S=(0,X.jsxs)(`div`,{className:`wo-transport-row`,children:[b,x]}),t[16]=b,t[17]=x,t[18]=S):S=t[18];let C;t[19]!==a||t[20]!==o?(C=o&&(0,X.jsx)(`p`,{className:`wo-caption`,"aria-live":`polite`,children:a===null?``:D(a)}),t[19]=a,t[20]=o,t[21]=C):C=t[21];let w;return t[22]!==u||t[23]!==S||t[24]!==C||t[25]!==d||t[26]!==m?(w=(0,X.jsxs)(`div`,{className:`wo-transport`,"data-playing":u,"data-open":d,style:m,children:[S,C]}),t[22]=u,t[23]=S,t[24]=C,t[25]=d,t[26]=m,t[27]=w):w=t[27],w}var rr=170,ir={contributes:`fed by`,causes:`driven by`,dampens:`held back by`,enables:`made possible by`,correlates:`moving together with`},ar={1:`pushed up by`,[-1]:`pushed down by`};function or(e){let t=e.split(` `,1)[0]??``;return t.length===0||/[A-Z]/.test(t.slice(1))?e:e[0].toLowerCase()+e.slice(1)}var sr={graph:`And that is how the causes fit together.`,timeline:`And here are the same causes, in time.`,chart:`And here is what each one actually measured.`,flow:`And here is how much each one contributed.`};function cr(e,t){let n=e.values.get(er(t));if(!n||n.kind===`structure`)return null;let r=_(n);return n.kind===`illustrative`?{say:`Illustratively, about ${r}.`,shown:`Illustratively, about ${r}.`}:{say:`Measured at ${r}.`,shown:`Measured at ${r}.`}}function lr(e){return e.kind?e.kind===`dampens`||e.kind===`enables`||e.kind===`correlates`:e.sign===-1}function ur(e){return e.kind&&ir[e.kind]?ir[e.kind]:ar[e.sign??1]??`fed by`}function dr(e){let t=e.nodes.filter(e=>e.parentId===void 0),n=new Set(t.map(e=>e.id)),r=e.edges.filter(e=>n.has(e.from)&&n.has(e.to)),i=new Map(t.map(e=>[e.id,e.depth??0])),a=new Map;for(let e of r)a.set(e.from,(a.get(e.from)??0)+(e.weight??0));let o=new Map(t.map(e=>[e.id,0]));for(let e of r)o.set(e.to,(o.get(e.to)??0)+1);let s=(e,t)=>(i.get(e)??0)-(i.get(t)??0)||(a.get(t)??0)-(a.get(e)??0)||(e<t?-1:+(e>t)),c=t.filter(e=>o.get(e.id)===0).map(e=>e.id),l=[],u=new Set;for(;c.length>0;){c.sort(s);let e=c.shift();if(!(e===void 0||u.has(e))){u.add(e),l.push(e);for(let t of r){if(t.from!==e)continue;let n=(o.get(t.to)??0)-1;o.set(t.to,n),n<=0&&!u.has(t.to)&&c.push(t.to)}}}for(let e of t.map(e=>e.id).sort(s))u.has(e)||l.push(e);return l}function fr(e,t,n,o={}){let s=dr(t);if(s.length<2)return[];let c=new Map(e.nodes.map(e=>[e.id,e])),l=new Map(t.nodes.map(e=>[e.id,e.label])),u=new Map(s.map((e,t)=>[e,t])),d=e=>t.edges.filter(t=>t.to===e&&u.has(t.from)&&(u.get(t.from)??0)<(u.get(e)??0)).sort((e,t)=>(t.weight??0)-(e.weight??0)||(e.id<t.id?-1:1))[0],f=[],p=s.at(-1)===e.outcomeId?s.length-1:s.length,m=p===1?`One cause, one outcome. Here is how it connects.`:`${p} causes, one outcome. Here is how they connect.`;f.push({nodeId:e.outcomeId,wide:!0,rep:`graph`,say:m,caption:m});let h=null;for(let[t,o]of s.entries()){let u=c.get(o),p=l.get(o)??o,m=d(o),g=o===e.outcomeId&&t===s.length-1,_=m?l.get(m.from)??m.from:null,v;v=g?m?`And it ends here: ${or(p)} — ${ur(m)} ${m.from===h?`it`:or(_??``)}.`:`And it ends here: ${or(p)}.`:m?m.from===h?lr(m)?`Then ${or(p)} — ${ur(m)} it.`:`Then ${or(p)}.`:`${p} — ${ur(m)} ${or(_??``)}.`:t===0?`It starts with ${or(p)}.`:`Alongside it: ${p}.`,h=o;let y=[v],b=[v],x=cr(n,o);x&&(y.push(x.say),b.push(x.shown));let S=u?.detail;S&&(y.push(a(r(S),rr)),b.push(a(i(S),rr))),f.push({nodeId:o,...m?{edgeId:m.id}:{},say:y.join(` `),caption:b.join(` `)})}if(o.closeOn){let t=sr[o.closeOn];f.push({nodeId:e.outcomeId,wide:!0,rep:o.closeOn,say:t,caption:t})}return f}var pr=[{rep:`graph`,label:`Graph`},{rep:`flow`,label:`Contribution`},{rep:`timeline`,label:`Over time`},{rep:`chart`,label:`As a chart`}],mr={graph:`Left to right is what led to what. Colour is the direction of the push; thickness is how much of the outcome the link explains.`,timeline:`Left to right is WHEN, read against the axis below; a bar is how long a cause lasted. Height only keeps entries from overlapping — it means nothing.`,chart:`Each mark is a cause plotted against its own measured history. Causes with nothing measured are held aside rather than drawn at zero.`,flow:`Ribbon thickness is how much of the outcome that link was MEASURED to explain. A cause whose links carry no measured share is held aside rather than drawn thin, which would read as a finding nobody made.`},hr=`Shows the shape, not your numbers.`,gr=`an illustrative world measures nothing, so there is no baseline`;function _r(e,t,n,r,i,a,o,s){if(!Number.isFinite(n))return null;let c=l(n,i),u={...i?{unit:i}:{},...s?{period:s}:{}},d={id:e,label:t,...i||s?{scope:u}:{}};return o||r===`T3`?{...d,kind:`illustrative`,resolution:{ok:!0,tier:`T3`,value:n,raw:c,illustrative:a?.quote??hr,surface:`model`}}:!a||!y(r)?null:r===`T1`?{...d,kind:`grounded`,resolution:{ok:!0,tier:`T1`,value:n,raw:c,receipt:a,surface:`user`}}:{...d,kind:`grounded`,resolution:{ok:!0,tier:`T2`,value:n,raw:c,receipt:a,surface:`web`}}}function vr(e,t){let n=e.provenance.illustrative===!0,r=new Map,i=[],a=new Map,o=(e,t)=>{!e||r.has(e.id)||(r.set(e.id,e),i.push(t))},s=e=>{a.set(e.id,e.label);let t=e.series,r=e.unit??t?.unit,i=t=>({valueId:t,surface:`node`,id:e.id,label:e.label});if(e.value!==void 0){let t=er(e.id);o(_r(t,e.label,e.value,e.tier,r,e.receipt,n),i(t))}if(t)for(let r of t.points){let a=tr(e.id,r.t),s=`${e.label} · ${r.t}`,c=r.receipt??t.receipt,l=_r(a,s,r.value,t.tier,t.unit,c,n,r.t);o(l,i(a))}for(let t of e.children??[])s(t)};for(let t of e.nodes)s(t);return R(e.edges).forEach((e,n)=>{let r=`${a.get(e.from)??e.from} ${e.verb??`→`} ${a.get(e.to)??e.to}`,o=t.edges[n]?.id;if(o!==void 0)for(let t of[e.from,e.to])i.push({valueId:er(t),surface:`edge`,id:o,label:r})}),qn(r,i)}function yr(e){let{value:t,...n}=e;return n}function br(e,t){let n=new Map;for(let[r,i]of e.relativeByNode){let e=t.relativeByNode.get(r)??0;i>0&&n.set(r,e/i)}return n}function xr(e,t,n,r){return{exactBase:n??null,exactDelta:e.outcomeDelta,explainedPct:e.explainedPct,fullyGrounded:e.fullyGrounded&&!r,relBase:t.relativeOutcome,relCur:e.relativeOutcome}}function Sr(e){let t=(0,F.c)(11),{spec:n,question:r,failed:i,onRetry:a,onClose:o,view:s,onExpandNode:c,speakLine:l}=e;if(n){let e;return t[0]!==o||t[1]!==c||t[2]!==l||t[3]!==n||t[4]!==s?(e=(0,X.jsx)(wr,{spec:n,view:s,onClose:o,onExpandNode:c,speakLine:l}),t[0]=o,t[1]=c,t[2]=l,t[3]=n,t[4]=s,t[5]=e):e=t[5],e}let u=r??``,d=i===!0,f;return t[6]!==o||t[7]!==a||t[8]!==u||t[9]!==d?(f=(0,X.jsx)(Cr,{title:u,failed:d,onRetry:a,onClose:o}),t[6]=o,t[7]=a,t[8]=u,t[9]=d,t[10]=f):f=t[10],f}function Cr(e){let t=(0,F.c)(17),{title:n,failed:r,onRetry:i,onClose:a}=e,o=`Living answer: ${n}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=(0,X.jsxs)(`div`,{className:`wo-title`,children:[s,(0,X.jsx)(`h2`,{children:n})]}),t[1]=n,t[2]=c);let l;t[3]===a?l=t[4]:(l=a&&(0,X.jsx)(`div`,{className:`wo-head-actions`,children:(0,X.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:a,"aria-label":`Close`,children:`✕`})}),t[3]=a,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,X.jsxs)(`header`,{className:`wo-head`,children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]!==r||t[9]!==i?(d=(0,X.jsx)(`div`,{className:`wo-shell`,role:`status`,"aria-live":`polite`,children:r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`wo-shell-line`,children:`This world didn’t come back.`}),(0,X.jsx)(`p`,{className:`wo-shell-note`,children:`Nothing was built, and Mavéa won’t stand in a causal web it can’t source. The answer behind this card is untouched.`}),i&&(0,X.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:i,children:`Try again`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`wo-shell-pulse`,"aria-hidden":`true`}),(0,X.jsx)(`p`,{className:`wo-shell-line`,children:`Building this world…`}),(0,X.jsx)(`p`,{className:`wo-shell-note`,children:`One model call, grounded in what this answer already found. Once it is built it is kept — re-opening it, and replaying this turn, costs nothing.`})]})}),t[8]=r,t[9]=i,t[10]=d):d=t[10];let f;t[11]!==u||t[12]!==d?(f=(0,X.jsxs)(`div`,{className:`wo-panel`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==o||t[15]!==f?(p=(0,X.jsx)(`section`,{className:`wo-scrim`,"aria-label":o,children:f}),t[14]=o,t[15]=f,t[16]=p):p=t[16],p}function wr({spec:e,view:t,onClose:n,onExpandNode:r,speakLine:i}){let[a,o]=(0,P.useState)(()=>new Map),[s,c]=(0,P.useState)(null),l=(0,P.useMemo)(()=>{if(a.size===0)return e;let t=e;for(let[e,n]of a)t=j(t,e,n);return t},[e,a]),u=l.provenance.illustrative===!0,d=(0,P.useMemo)(()=>B(l),[l]),f=(0,P.useMemo)(()=>vr(l,d),[l,d]),p=(0,P.useMemo)(()=>Xn(l),[l]),[m,h]=(0,P.useState)(()=>new Map),[g,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(!1),b=(0,P.useMemo)(()=>[...m.values()].some(e=>e!==100),[m]),x=(0,P.useMemo)(()=>[...m].map(([e,t])=>({nodeId:e,pct:t/100})),[m]),S=(0,P.useMemo)(()=>N(p,[]),[p]),C=(0,P.useMemo)(()=>N(p,x),[p,x]),w=(0,P.useMemo)(()=>b?br(S,C):null,[b,S,C]),T=(0,P.useDeferredValue)(w),E=(0,P.useCallback)(e=>sn(e,d),[d]),D=t&&E(t)?t:void 0,A=dn({world:d,insetBottom:v?108:54,...D?{initialRep:D}:{}}),{rep:F,setRep:I,expandedIds:L,toggleExpand:z}=A;(0,P.useEffect)(()=>{D&&I(D)},[D,I]);let V=(0,P.useMemo)(()=>{let e=d.nodes.map(e=>{let t=yr(e),n=T?.get(e.parentId??e.id);return n===void 0?t:{...t,shift:n}});return{...d,nodes:e}},[d,T]),H=(0,P.useMemo)(()=>{let e=new Map,t=n=>{e.set(n.id,n);for(let e of n.children??[])t(e)};for(let e of l.nodes)t(e);return e},[l]),U=(0,P.useMemo)(()=>{let e=R(l.edges);return new Map(d.edges.map((t,n)=>[t.id,e[n]]))},[d,l]),W=(0,P.useMemo)(()=>new Set(d.nodes.map(e=>e.parentId).filter(e=>e!==void 0)),[d]),G=(0,P.useRef)(null),K=(0,P.useCallback)(()=>G.current?.dismiss(),[]),q=(0,P.useCallback)(e=>{(e.surface===`node`||e.surface===`edge`)&&_({kind:e.surface,id:e.id})},[]),[J,ee]=(0,P.useState)(void 0),te=E(`timeline`)?`timeline`:void 0,[ne,re]=(0,P.useState)([]);(0,P.useEffect)(()=>{let e=globalThis.requestIdleCallback,t=()=>re(fr(l,d,f,te?{closeOn:te}:{}));if(typeof e==`function`){let n=e(t,{timeout:2e3});return()=>globalThis.cancelIdleCallback?.(n)}let n=setTimeout(t,1);return()=>clearTimeout(n)},[l,d,f,te]);let{focusNode:ie}=A,ae=(0,P.useCallback)(e=>{e.rep&&I(e.rep),_({kind:`node`,id:e.nodeId}),ee(e.edgeId),e.wide?ie(null):e.rep||ie(e.nodeId)},[ie,I]),{index:oe,playing:se,caption:ce,toggle:le,seek:ue,reset:de}=$n((0,P.useMemo)(()=>({beats:ne,apply:ae,...i?{speakLine:i}:{}}),[ne,ae,i]));(0,P.useEffect)(()=>{y(se||oe>=0)},[se,oe]);let Y=(0,P.useCallback)(()=>{de(),ee(void 0)},[de]),fe=(0,P.useRef)(n);fe.current=n;let pe=(0,P.useRef)(le);pe.current=le;let me=(0,P.useRef)(Y);me.current=Y,(0,P.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){me.current(),fe.current?.();return}(e.key===` `||e.key===`Spacebar`)&&(e.target?.closest(`button, input, select, textarea, [contenteditable="true"]`)||(e.preventDefault(),pe.current()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let he=(0,P.useCallback)(e=>{Y(),_({kind:`node`,id:e.id})},[Y]),ge=(0,P.useCallback)(e=>{Y(),_({kind:`edge`,id:e})},[Y]),_e=(0,P.useCallback)((e,t)=>{Y(),h(n=>new Map(n).set(e,t))},[Y]),ve=(0,P.useCallback)(()=>{Y(),h(new Map)},[Y]),ye=(0,P.useCallback)(e=>{!r||s!==null||(c(e),r(e).then(t=>{c(null);let n=t?.nodes.find(t=>t.id===e)?.children;n?.length&&(o(t=>new Map(t).set(e,n)),z(e))},()=>c(null)))},[r,s,z]),be=(0,P.useCallback)((e,t)=>{if(t===`entry`&&F===`timeline`){let t=H.get(e.id),n=t?.date,r=t?.series?.points,i=n?.until!==void 0||(r?.length??0)>1,a=n?.t??r?.[0]?.t;return i||!a?null:(0,X.jsx)(`span`,{className:`wo-when`,children:a})}if(t!==`card`)return null;let n=L.has(e.id),i=W.has(e.id),a=!i&&r!==void 0&&e.parentId===void 0,o=s===e.id;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(xn,{id:er(e.id),className:`wo-num`}),e.shift!==void 0&&zn(e.shift)!==null&&(0,X.jsx)(`span`,{className:`wo-shift`,"data-dir":e.shift<1?`down`:`up`,children:zn(e.shift)}),(i||a)&&(0,X.jsx)(`button`,{type:`button`,className:`wo-expand`,"aria-expanded":n,"aria-busy":o||void 0,disabled:o||a&&s!==null,"aria-label":`${n?`Fold up`:`Break down`} ${e.label}`,onClick:t=>{t.stopPropagation(),i?z(e.id):ye(e.id)},children:o?`breaking down…`:n?`fold up`:`break down`})]})},[W,L,z,r,s,ye,H,F]),Z=H.get(l.outcomeId),xe=(0,P.useMemo)(()=>xr(S,S,Z?.value,u),[S,Z?.value,u]),Se=(0,P.useMemo)(()=>xr(C,S,Z?.value,u),[C,S,Z?.value,u]),Ce=(0,P.useMemo)(()=>({causes:l.nodes.length,links:l.edges.length,sourced:l.nodes.filter(e=>e.receipt!==void 0).length}),[l]),Q=g?.kind===`node`?H.get(g.id):void 0,$=g?.kind===`edge`?U.get(g.id):void 0,we=(0,P.useMemo)(()=>l.nodes.filter(e=>e.role===`root`).map(e=>({id:e.id,label:e.label,pct:m.get(e.id)??100})),[l.nodes,m]);return(0,X.jsx)(Mn,{registry:f,onNavigate:q,ref:G,children:(0,X.jsx)(`section`,{className:`wo-scrim`,"aria-label":`Living answer: ${l.title}`,children:(0,X.jsxs)(`div`,{className:`wo-panel`,children:[(0,X.jsxs)(`header`,{className:`wo-head`,children:[(0,X.jsxs)(`div`,{className:`wo-title`,children:[(0,X.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),(0,X.jsx)(`h2`,{children:l.title})]}),(0,X.jsxs)(`div`,{className:`wo-head-actions`,children:[(0,X.jsx)(`div`,{className:`wo-views`,role:`group`,"aria-label":`View`,children:pr.filter(e=>E(e.rep)).map(e=>(0,X.jsx)(`button`,{type:`button`,className:`wo-chip`,"aria-pressed":F===e.rep,onClick:()=>{Y(),I(e.rep)},children:e.label},e.rep))}),(0,X.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:ve,disabled:!b,children:`Reset`}),n&&(0,X.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:n,"aria-label":`Close`,children:`✕`})]})]}),u&&(0,X.jsx)(`div`,{className:`wo-banner wo-banner-illustrative`,children:`Illustrative model — shows the shape, not your numbers.`}),(0,X.jsx)(`p`,{className:`wo-legend`,children:mr[F]}),(0,X.jsxs)(`div`,{className:`wo-body`,children:[(0,X.jsxs)(`div`,{className:`wo-stage`,onWheelCapture:K,onPointerDownCapture:K,children:[(0,X.jsx)(Me,{stage:A,world:V,renderFace:be,onNodeClick:he,onEdgeClick:ge,selectedId:g?.kind===`node`?g.id:void 0,litEdgeId:J}),(0,X.jsx)(nr,{count:ne.length,index:oe,playing:se,caption:ce,expanded:v,onToggle:le,onSeek:ue})]}),(0,X.jsxs)(`aside`,{className:`wo-rail`,children:[(0,X.jsx)(_n,{levers:we,onSet:_e,onReset:ve}),(0,X.jsx)(Kn,{baseline:xe,current:Se,unit:Z?.unit,active:b,observedNote:u?gr:void 0}),(0,X.jsxs)(`div`,{className:`wo-detail`,children:[(0,X.jsx)(`span`,{className:`wo-rail-kicker`,children:`EVIDENCE`}),!g&&(0,X.jsxs)(`div`,{className:`wo-standing`,children:[(0,X.jsxs)(`dl`,{className:`wo-facts`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Causes`}),(0,X.jsx)(`dd`,{children:Ce.causes})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Links`}),(0,X.jsx)(`dd`,{children:Ce.links})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:u?`Illustrative`:`With a source`}),(0,X.jsx)(`dd`,{children:u?`every cause`:Ce.sourced})]})]}),Z&&(0,X.jsxs)(`p`,{className:`wo-standing-outcome`,children:[(0,X.jsx)(`span`,{className:`wo-standing-lead`,children:`It ends at`}),` `,Z.label,Z.detail?(0,X.jsx)(`span`,{className:`wo-standing-note`,children:Z.detail}):null]}),(0,X.jsx)(`p`,{className:`wo-hint`,children:`Tap a cause or a link to see what stands behind it.`})]}),Q&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`h3`,{className:`wo-detail-title`,children:Q.label}),Q.detail&&(0,X.jsx)(`p`,{className:`wo-detail-note`,children:Q.detail}),(0,X.jsx)(`p`,{className:`wo-detail-figure`,children:(0,X.jsx)(xn,{id:er(Q.id)})}),Q.series&&(0,X.jsx)(`ul`,{className:`wo-series`,children:Q.series.points.map((e,t)=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`wo-series-t`,children:e.t}),(0,X.jsx)(xn,{id:tr(Q.id,e.t)})]},`${e.t}:${t}`))})]}),$&&(0,X.jsx)(M,{relation:k($.relation),sign:$.sign,status:$.status??O($),receipts:$.receipts??($.receipt?[$.receipt]:[]),counter:$.counter,provisional:$.provisional})]})]})]})]})})})}export{Sr as WorldOverlay};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./ReplayCard-CKo5reXy.js";import"./TopicCanvas-DkzJORfl.js";import"./CanvasSkeleton-CcHXJqdq.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,j as t,p as n}from"./store-B39HvB_l.js";import{n as r}from"./ledger-Cv0LBflx.js";import{i}from"./format-rPI6ZwwH.js";import{n as a}from"./useDashboardLoop-B_YA5jLs.js";var o=`Checking a live source before this joins your board — a search can take up to a minute. You can close this; the result lands in your check log either way.`;function s(e){return e===`no-model`?`Connect a model with an API key first — a tile only joins the board once a real search has confirmed it returns real data.`:`Couldn't confirm this with a live source, so it wasn't added — a tile only joins the board once a real search returns real data. Try again in a moment, or reword what to track.`}var c=e=>`${e.conversationId}@${e.at}`;function l(e){return{metrics:new Set(e.metrics.map(e=>e.id)),widgets:new Set(e.widgets.map(e=>e.id)),tripwires:new Set(e.tripwires.map(e=>e.id)),sources:new Set(e.sources.map(c))}}function u(r,i){if(i===null){e(r);return}let a=n(r);a&&t(r,{metrics:a.metrics.filter(e=>i.metrics.has(e.id)),widgets:a.widgets.filter(e=>i.widgets.has(e.id)),tripwires:a.tripwires.filter(e=>i.tripwires.has(e.id)),sources:a.sources.filter(e=>i.sources.has(c(e)))})}var d=1500,f=45e3,p=2,m=1e4,h=e=>new Promise(t=>setTimeout(t,e));function g(e,t){return!(n(e)?.metrics??[]).filter(e=>!(t?.metrics.has(e.id)??!1)).some(e=>e.query.trim()!==``&&!e.blankKey&&e.lastValue==null)}var _={unverified:`no live source could confirm it returns real data`,"no-model":`no model was connected to check it with`,failed:`the model could not be reached to check it`};function v(e,t,n,i){u(e,t);let a=_[i];return r({kind:`alert`,text:t===null?`“${n}” wasn’t added — ${a}.`:`The addition to “${n}” was rolled back — ${a}.`,dashboardIds:t===null?[]:[e],searches:0}),i}async function y(e,t){let r=n(e);if(!r)return`failed`;if(!i(r))return`confirmed`;let o=r.title,s=Date.now(),c=async()=>{let t=await a(e);for(let r=0;t===`busy`&&r<f;r+=d){if(await h(d),(n(e)?.lastRefreshedAt??0)>=s)return`landed`;t=await a(e)}return t},l=await c();for(let e=0;e<p&&l===`failed`;e++)await h(m),l=await c();return(l===`done`||l===`landed`)&&g(e,t)?`confirmed`:l===`landed`?v(e,t,o,`unverified`):v(e,t,o,l===`no-model`||l===`failed`?l:`unverified`)}export{y as i,l as n,s as r,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{o as n}from"./ledger-Cv0LBflx.js";var r=e(),i=`mavea-dash-settings-v1`,a=i,o={dailySearchBudget:40,briefingEnabled:!0,briefingSpoken:!1,keyNudgeShown:!1};function s(e){return Math.min(200,Math.max(5,Math.round(e)))}function c(e){return!!e&&typeof e==`object`}function l(e){return c(e)?{dailySearchBudget:typeof e.dailySearchBudget==`number`&&Number.isFinite(e.dailySearchBudget)?s(e.dailySearchBudget):o.dailySearchBudget,briefingEnabled:typeof e.briefingEnabled==`boolean`?e.briefingEnabled:o.briefingEnabled,briefingSpoken:typeof e.briefingSpoken==`boolean`?e.briefingSpoken:o.briefingSpoken,keyNudgeShown:typeof e.keyNudgeShown==`boolean`?e.keyNudgeShown:o.keyNudgeShown}:{...o}}var u;function d(){try{if(typeof localStorage>`u`)return{...o};let e=localStorage.getItem(i);return e?l(JSON.parse(e)):{...o}}catch{return{...o}}}function f(){return u??=d(),u}function p(e){u=e;try{typeof localStorage<`u`&&localStorage.setItem(i,JSON.stringify(e))}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(a,{detail:e}))}catch{}}function m(){return f()}function h(e){p(l({...f(),...e}))}function g(){u=void 0}function _(e){let t=t=>{(t.key===null||t.key===i)&&(g(),e())};return window.addEventListener(a,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(a,e),window.removeEventListener(`storage`,t)}}function v(){return(0,r.useSyncExternalStore)(_,m)}var y=.85;function b(e){let t=new Date(e);return t.setHours(24,0,0,0),t.getTime()}function x(e,t,r){let i=n(e,r);return{used:i,cap:t,amber:i>=t*y,paused:i>=t,resumesAt:b(r)}}var S=t(),C=new Set,w=`mavea-dashboard-data-pending`;function T(e,t){for(let n of e)t?C.add(n):C.delete(n);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(w))}catch{}}function E(e){return window.addEventListener(w,e),()=>window.removeEventListener(w,e)}function D(e){let t=(0,S.c)(2),n;return t[0]===e?n=t[1]:(n=()=>C.has(e),t[0]=e,t[1]=n),(0,r.useSyncExternalStore)(E,n,O)}function O(){return!1}export{h as a,m as i,D as n,v as o,x as r,T as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={grounded:`GROUNDED`,calculated:`CALCULATED LOCALLY`,illustrative:`ILLUSTRATIVE`,structure:`NO NUMBER`};function t(e){return e.kind===`calculated`?e.raw:e.resolution.raw}function n(e){let t=[];return e.doc!==void 0&&t.push(`doc ${e.doc+1}`),e.page!==void 0&&t.push(`p. ${e.page}`),e.cell!==void 0&&t.push(`cell ${e.cell}`),t.length?`Your file · ${t.join(`, `)}`:`Your file`}var r=/[A-Za-z_][A-Za-z0-9_]*/g;function i(e,t){return e.replace(r,e=>t(e)??e)}export{n as i,i as n,t as r,e as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){let n=Math.max(0,Math.round((t-e)/1e3));if(n<45)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);if(i<24)return`${i}h ago`;let a=Math.round(i/24);return a===1?`yesterday`:`${a}d ago`}function t(t,n,r){return t===null||t<=0?`not yet refreshed`:`${r===`no-change`||r===`unverified`?`checked`:`updated`} ${e(t,n)}`}function n(e){return e.metrics.filter(e=>e.query.trim()!==``&&!e.blankKey).length}function r(e){return e.widgets.filter(e=>e.refreshQuery?.trim()).length}function i(e){return n(e)>0||r(e)>0}function a(t,n){if(!i(t))return`no live metrics on this dashboard`;if(t.lastRefreshedAt===null||t.lastRefreshedAt<=0)return`not yet refreshed`;let r=e(t.lastRefreshedAt,n);return t.lastDataOutcome===`unverified`?`checked ${r} — couldn't verify with sources`:t.lastDataOutcome===`no-change`?`checked ${r} — no new data`:`updated ${r}`}function o(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e),n=t>=1e3?0:t>=100?1:t>=1?2:4;return e.toLocaleString(void 0,{maximumFractionDigits:n})}function s(e,t){return t===`$`?`$${e}`:`${e}${t??``}`}function c(e){return e.replace(/\d+\.\d{5,}/g,e=>o(Number(e)))}function l(e){return e.lastRaw?c(e.lastRaw):e.lastValue===null?`—`:s(o(e.lastValue),e.unit)}function u(e){let t=e.metrics.find(e=>e.lastValue!==null)??e.metrics[0];return t?{value:l(t),label:t.label}:null}function d(e){let t=e.trim().replace(/\s+/g,` `),n=t;n=n.replace(/^(?:track(?:ing)?|watch(?:ing)?|follow(?:ing)?|monitor(?:ing)?)\s+(?:the\s+)?/i,``),n=n.replace(/\s+tracker\s*$/i,``);let r=n.split(/\s+[·—–-]\s+|:\s+/)[0].trim();if(r&&r.includes(` `)&&(n=r),n||=t,n.length<=28)return n;let i=n.slice(0,29),a=i.lastIndexOf(` `);return`${(a>0?i.slice(0,a):n.slice(0,28)).replace(/[\s,;:·—–-]+$/,``)}…`}export{u as a,s as c,i,a as n,r as o,d as r,n as s,t};
|