@mavea/mavea 1.0.18 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +140 -1
- package/DISCLAIMER.md +2 -1
- package/PRIVACY.md +5 -4
- package/README.md +21 -11
- package/TERMS.md +3 -1
- package/dist/.vite/manifest.json +846 -611
- package/dist/assets/AnnotationLayer-qV6CIUZv.js +0 -0
- package/dist/assets/{AppCommandPalette-DKBglbNo.js → AppCommandPalette-BHaYBZ5e.js} +1 -1
- package/dist/assets/AreaChart-DZGCSEwt.js +1 -0
- package/dist/assets/CadenceCard-P4teI7Se.js +1 -0
- package/dist/assets/CanvasSkeleton-CRGWlafo.js +1 -0
- package/dist/assets/{CheckLogRail-Btg7Linv.js → CheckLogRail-DkHIHL0E.js} +1 -1
- package/dist/assets/{CommandPalette-DagPdSGZ.js → CommandPalette-Bs6tpdZl.js} +1 -1
- package/dist/assets/{ConversationVideoStudio-EPw6H4lE.js → ConversationVideoStudio-C1sd4k53.js} +1 -1
- package/dist/assets/CourseLessonReader-YCcNKEW7.js +2 -0
- package/dist/assets/{CourseRail-Dx9IIbTZ.js → CourseRail-DXt3bzjU.js} +1 -1
- package/dist/assets/{CoursesApp-CzUGaYWZ.js → CoursesApp-Dz6xjf4V.js} +2 -2
- package/dist/assets/{DashPresent-DXwesMIr.js → DashPresent-5SRScC2i.js} +1 -1
- package/dist/assets/DashboardDetail-8J8TsdQg.css +1 -0
- package/dist/assets/DashboardDetail-DOfm8UCQ.js +2 -0
- package/dist/assets/DashboardLoopGate-Cf0y_HQ7.js +2 -0
- package/dist/assets/DashboardLoopRuntime-CnN5VayH.js +1 -0
- package/dist/assets/DashboardSettings-CE0B2y2y.js +1 -0
- package/dist/assets/DashboardsApp-_gbfdbX6.js +2 -0
- package/dist/assets/{DeepZoomApp-CwqKpjo7.js → DeepZoomApp-BOLEl-kQ.js} +1 -1
- package/dist/assets/{DelegatePanel-Bi1qPgGG.js → DelegatePanel-CHEB-OZl.js} +1 -1
- package/dist/assets/DemoGallery-DBqnu8TR.js +1 -0
- package/dist/assets/{DropSelect-C3g0PjuN.js → DropSelect-DjbdVfIR.js} +1 -1
- package/dist/assets/ExportModal-CLobMv1F.js +2 -0
- package/dist/assets/ExtractionPreview-QZ2VHmsb.js +18 -0
- package/dist/assets/{FeatureUseNotice-BhljPjUv.js → FeatureUseNotice-Dc8joBGM.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-DyNsP8k3.js → FlagshipCommandPalette-DnWuBjYI.js} +1 -1
- package/dist/assets/{FlagshipShowcase-DHpGPlca.js → FlagshipShowcase-3qQDOK6g.js} +1 -1
- package/dist/assets/{FlashcardsApp-Cm50X3Hl.js → FlashcardsApp-BQGM-Tr1.js} +1 -1
- package/dist/assets/{GalleryApp-BFop9Eu7.js → GalleryApp-BWQ-J450.js} +1 -1
- package/dist/assets/{HonestByDesign-HeTTCiis.js → HonestByDesign-57LDf-gm.js} +1 -1
- package/dist/assets/{HowItWorks-gAuUl7VQ.js → HowItWorks-DMfPX3GK.js} +1 -1
- package/dist/assets/{LegalApp-jOlpLQSV.js → LegalApp-CcO5Qq6R.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-RSNiyAu0.js → LegalMarkdownDocument-Be_fQbZ_.js} +1 -1
- package/dist/assets/{LegalPageShell-Cr90l1I2.js → LegalPageShell-B-HY1WG7.js} +1 -1
- package/dist/assets/{LibraryOverlay-DEQ5GuIs.js → LibraryOverlay-BilW6q_z.js} +1 -1
- package/dist/assets/LiveApp-C-OPBybd.css +1 -0
- package/dist/assets/LiveApp-DH3OxJFV.js +79 -0
- package/dist/assets/{LiveSettings-jn26sH4v.js → LiveSettings-CuVMy7rZ.js} +3 -3
- package/dist/assets/{MindMapViewerDrawer-CDDzzpFi.js → MindMapViewerDrawer-DI_S7fRZ.js} +1 -1
- package/dist/assets/{MindShape-BeZFay7O.js → MindShape-C_Bo9hW9.js} +1 -1
- package/dist/assets/PinToDashboard-Cz5UJCmq.js +1 -0
- package/dist/assets/PlanReview-CmUxzNqL.js +1 -0
- package/dist/assets/{Presence-CKSoyuhE.js → Presence-UqXfH4Y-.js} +1 -1
- package/dist/assets/PresentationDeck-B_EI33Pp.js +1 -0
- package/dist/assets/PrismApp-DtLsPiQF.js +2 -0
- package/dist/assets/PrismAskController-Bt0k9hAA.js +37 -0
- package/dist/assets/{PrismBriefingPlayer-BoB_PCTT.js → PrismBriefingPlayer-DzdtnFj4.js} +2 -2
- package/dist/assets/PrismOverlay-D1cDZamt.js +105 -0
- package/dist/assets/{PrismWorkbench-f0rLNBxb.js → PrismWorkbench-BEIp4MiL.js} +1 -1
- package/dist/assets/{PrivacyApp-CFs0PM5C.js → PrivacyApp-B4DT2RUz.js} +6 -5
- package/dist/assets/{ReplayCard-BkJbY0-I.js → ReplayCard-Dx46HCBT.js} +2 -2
- package/dist/assets/{ReplayOverlay-Dm_k7FBA.js → ReplayOverlay-CnJAxf0u.js} +1 -1
- package/dist/assets/{RewindOverlay-BSDbLgcN.js → RewindOverlay-CousnxXo.js} +1 -1
- package/dist/assets/RippleApp-D5j2VCt2.js +2 -0
- package/dist/assets/{RippleAskController-CywVzqUA.js → RippleAskController-9SxpZnHX.js} +2 -2
- package/dist/assets/{RippleOverlay-DVxfWEQ8.js → RippleOverlay-zcXAHPuJ.js} +2 -2
- package/dist/assets/{SeeDontRead-Ct4PY63d.js → SeeDontRead-Dqfzha0V.js} +1 -1
- package/dist/assets/{ShareModal-BILPvqjZ.js → ShareModal-DWxlrJSz.js} +2 -2
- package/dist/assets/{ShipCourse-DGj9BbRM.js → ShipCourse-BavQppkt.js} +1 -1
- package/dist/assets/{SignatureLoop-CfM-rTXb.js → SignatureLoop-L8W2h62w.js} +1 -1
- package/dist/assets/SynthesisApp-C2O6pFeM.js +2 -0
- package/dist/assets/{SynthesisOverlay-Dunk_JWD.js → SynthesisOverlay-DLvwiSMv.js} +1 -1
- package/dist/assets/{TermsApp-BUQa48cB.js → TermsApp-CxY1yorm.js} +4 -2
- package/dist/assets/TopicCanvas-LMI0zC7R.js +2 -0
- package/dist/assets/{TourPrism-zt1LIaLd.js → TourPrism-CI-iJZil.js} +1 -1
- package/dist/assets/TrackerTile-oz6IoG8m.js +2 -0
- package/dist/assets/{TwoSurfaces-CLOIlVvY.js → TwoSurfaces-Rnf-_WgY.js} +1 -1
- package/dist/assets/WhyMachineOverlay-ks9-rRiL.js +1 -0
- package/dist/assets/WorldOverlay-BaQNNClA.js +2 -0
- package/dist/assets/WorldOverlay-D7ay5y4D.css +1 -0
- package/dist/assets/{WowFeatures-CNVwRlf0.js → WowFeatures-C4efSbNV.js} +1 -1
- package/dist/assets/{ZoomDeck-DNgyW7Nm.js → ZoomDeck-CBrr0yfy.js} +1 -1
- package/dist/assets/{annotationAuto-C9weSF2k.js → annotationAuto-CDv6Es44.js} +1 -1
- package/dist/assets/{annotationReel-va1i-lKs.js → annotationReel-K2FYv-3B.js} +1 -1
- package/dist/assets/{backup-D--1WRte.js → backup-ZrlVatXc.js} +1 -1
- package/dist/assets/{blockTypes-CgNGx27_.js → blockTypes-DUDdP3pB.js} +1 -1
- package/dist/assets/canvas-Bsx3eSaS.js +1 -0
- package/dist/assets/{capture-BBxyt5SN.js → capture-D8uPIcfj.js} +1 -1
- package/dist/assets/confirmAdd-DzMO9jKV.js +1 -0
- package/dist/assets/{coreIcons-BzqW7Qiz.js → coreIcons-DDTChE1H.js} +1 -1
- package/dist/assets/csv-DAqzYXUs.js +5 -0
- package/dist/assets/{dashboardEvents-BDKxoLch.js → dashboardEvents-DKl5rrTD.js} +1 -1
- package/dist/assets/dashboards-C1u2ks-d.css +1 -0
- package/dist/assets/dataPending-DGdCvY5Y.js +1 -0
- package/dist/assets/display-CAb_PiGv.js +1 -0
- package/dist/assets/emphasize-BqCIst-B.js +1 -0
- package/dist/assets/engine-BiM6INsW.js +1 -0
- package/dist/assets/engine-CTvOaA86.css +1 -0
- package/dist/assets/explode-BgZIWY9m.js +15 -0
- package/dist/assets/format-g3dP8OI3.js +1 -0
- package/dist/assets/{generate-CemSUZ8A.js → generate-Dl2EJ_SR.js} +3 -3
- package/dist/assets/generateBeats-DZHkvFvh.js +1 -0
- package/dist/assets/{generateCourse-BIBbw-ZJ.js → generateCourse-C9qvaJRo.js} +1 -1
- package/dist/assets/{generateLive-BsXn4Y_d.js → generateLive-B6purd69.js} +18 -18
- package/dist/assets/index-Dk0QapqQ.js +22 -0
- package/dist/assets/index-DmKgC_TJ.css +1 -0
- package/dist/assets/{kokoro-C6P0LV4L.js → kokoro-P_fkcX-A.js} +1 -1
- package/dist/assets/lens-ChFJD9il.js +1 -0
- package/dist/assets/{liveSchema-B8OByCPH.js → liveSchema-B4bQtO88.js} +22 -21
- package/dist/assets/loader-DKJEcbPm.js +2 -0
- package/dist/assets/{model-BsQ5ixwB.js → model-BFRTN9Eh.js} +1 -1
- package/dist/assets/nextFrame-12y0UrAd.js +1 -0
- package/dist/assets/notes-B0-EE0FK.js +1 -0
- package/dist/assets/number-zqlPMliA.js +1 -0
- package/dist/assets/officeDoc-GU6Cssjf.js +3 -0
- package/dist/assets/openWorld-BHTJM39n.js +1 -0
- package/dist/assets/{pen-D9UT-ioQ.js → pen-DNMslo3e.js} +1 -1
- package/dist/assets/{perfProbe-BxyiHsI2.js → perfProbe-B9zJpjo9.js} +1 -1
- package/dist/assets/{pin-qQrH_dBi.js → pin-CZAIlpXt.js} +1 -1
- package/dist/assets/{planTracker-CjnznF7v.js → planTracker-KKAtTBWs.js} +1 -1
- package/dist/assets/portal-Dogggsub.js +1 -0
- package/dist/assets/{prewarm-CAZcnT4x.js → prewarm-B4ELBOxf.js} +1 -1
- package/dist/assets/providers-BovElgRL.js +1 -0
- package/dist/assets/{quietHours-_i5Uqz7z.js → quietHours-CeBje_uU.js} +1 -1
- package/dist/assets/ready-Ba6nk9O1.js +1 -0
- package/dist/assets/{ready-4lPJes2S.js → ready-jtAUOb62.js} +1 -1
- package/dist/assets/receipts-D7zveV-I.js +1 -0
- package/dist/assets/registry-6DGRAB1m.js +1 -0
- package/dist/assets/{registry-BzH7mEl7.js → registry-6MOD-I7p.js} +1 -1
- package/dist/assets/registry-BFrgx1tE.js +1 -0
- package/dist/assets/{registry-COkvZrNA.css → registry-BZuT2Epw.css} +1 -1
- package/dist/assets/{registry-CtvKPLd7.js → registry-CD1s3eQ-.js} +1 -1
- package/dist/assets/{registry-NbNNn_ra.js → registry-CqhpLHM7.js} +1 -1
- package/dist/assets/registry-Cse2wF7x.css +1 -0
- package/dist/assets/registry-DGNSqTxE.js +1 -0
- package/dist/assets/{registry-CkScyZGa.js → registry-GeAC3ZD7.js} +1 -1
- package/dist/assets/{relate-DHPSGB7a.js → relate-BYdM5eiV.js} +1 -1
- package/dist/assets/{replay-zh4xVk5G.js → replay-TYXO0Brm.js} +1 -1
- package/dist/assets/{run-DiPX83_J.js → run-Df10YPyB.js} +1 -1
- package/dist/assets/{run-ByCJN-29.js → run-DlvA3l28.js} +1 -1
- package/dist/assets/{run-BdDyp6Xv.js → run-gmqUaxcL.js} +2 -2
- package/dist/assets/seed-D_P5jyog.js +1 -0
- package/dist/assets/shapes-Cx5SCKgj.js +39 -0
- package/dist/assets/{spokenText-D3iS8fuI.js → spokenText-C88IQJ0M.js} +1 -1
- package/dist/assets/store-CsjDEADX.js +1 -0
- package/dist/assets/theme-7IrMJ70_.js +1 -0
- package/dist/assets/tiles-D-s6v-mA.js +1 -0
- package/dist/assets/types-C42I77wh.js +1 -0
- package/dist/assets/types-DuEbJpIA.js +1 -0
- package/dist/assets/useDashboardLoop-DDqCFJKY.js +5 -0
- package/dist/assets/useDashboards-SRk8LqHe.js +1 -0
- package/dist/assets/useLiveConfig-Cpy0_E_-.js +1 -0
- package/dist/assets/useSpatialCanvas-CfmZOXXP.js +1 -0
- package/dist/assets/{useStudy-B5874Bcg.js → useStudy-GwNcQWtv.js} +1 -1
- package/dist/assets/validate-sGUCmPAs.js +4 -0
- package/dist/assets/value-Dx7DZob4.js +1 -0
- package/dist/assets/walkSync-CPsd-xu7.js +1 -0
- package/dist/index.html +14 -13
- package/dist/legal/DISCLAIMER.md +2 -1
- package/dist/legal/PRIVACY.md +5 -4
- package/dist/legal/TERMS.md +3 -1
- package/docs/media/course-lesson.jpg +0 -0
- package/docs/media/living-answer.jpg +0 -0
- package/package.json +4 -1
- package/dist/assets/AnnotationLayer-DHHGgh8x.js +0 -2
- package/dist/assets/CanvasSkeleton-Bx0s36b_.js +0 -2
- package/dist/assets/CourseLessonReader-DeAuL1tO.js +0 -2
- package/dist/assets/DashboardDetail-CJzB85NC.js +0 -2
- package/dist/assets/DashboardLoopRuntime-CEnUpS-I.js +0 -1
- package/dist/assets/DashboardSettings-CmZWG3US.js +0 -1
- package/dist/assets/DashboardsApp-wCgs98G0.js +0 -2
- package/dist/assets/DemoGallery-Cg0ykVpG.js +0 -1
- package/dist/assets/ExportModal-rxndDhoO.js +0 -2
- package/dist/assets/ExtractionPreview-ChRAimKr.js +0 -18
- package/dist/assets/LiveApp-Bl7WBgqJ.css +0 -1
- package/dist/assets/LiveApp-CUoQgVo1.js +0 -62
- package/dist/assets/PinToDashboard-CSqwDBLD.js +0 -1
- package/dist/assets/PlanReview-ChZeUHQO.js +0 -1
- package/dist/assets/PresentationDeck-Dj9MQVZC.js +0 -1
- package/dist/assets/PrismApp-Dfs6eAuR.js +0 -2
- package/dist/assets/PrismAskController-CSsCkRC8.js +0 -37
- package/dist/assets/PrismOverlay-CGtr7lBl.js +0 -109
- package/dist/assets/RippleApp-DW1rpKHe.js +0 -2
- package/dist/assets/SynthesisApp-C43ZO6Ew.js +0 -2
- package/dist/assets/TopicCanvas-DR26Swr_.js +0 -2
- package/dist/assets/TrackerTile-sYD2MM_4.js +0 -2
- package/dist/assets/WhyMachineOverlay-Nll4Wco-.js +0 -1
- package/dist/assets/canvas-DIs20T9l.js +0 -1
- package/dist/assets/confirmAdd-BDNV8RqF.js +0 -1
- package/dist/assets/dashboards-Dy4MTJQ5.css +0 -1
- package/dist/assets/dataPending-lZUzUEo6.js +0 -1
- package/dist/assets/explode-fgkkWz8o.js +0 -13
- package/dist/assets/format-rPI6ZwwH.js +0 -1
- package/dist/assets/generateBeats-aqKTlSN2.js +0 -1
- package/dist/assets/index-B69GkoTc.css +0 -1
- package/dist/assets/index-D1SPhBGd.js +0 -22
- package/dist/assets/notes-U6gRKVHk.js +0 -1
- package/dist/assets/number-DXgzss0v.js +0 -1
- package/dist/assets/officeDoc-Dn8jw1fG.js +0 -3
- package/dist/assets/portal-t0bsUEg2.js +0 -1
- package/dist/assets/providers-DdJWf_PE.js +0 -1
- package/dist/assets/ready-LSwk88I-.js +0 -1
- package/dist/assets/registry-9QjeHgKs.js +0 -1
- package/dist/assets/registry-CueC1vq1.js +0 -1
- package/dist/assets/registry-CxUmdwDk.js +0 -1
- package/dist/assets/registry-DScSjt8p.css +0 -1
- package/dist/assets/shapes-DI0LQC8n.js +0 -1
- package/dist/assets/store-DpmbKVs7.js +0 -1
- package/dist/assets/theme-f0mztBcq.js +0 -1
- package/dist/assets/tiles-pdNi6MGe.js +0 -1
- package/dist/assets/useDashboardLoop-DuckIfJX.js +0 -5
- package/dist/assets/useDashboards-BMcuCWoz.js +0 -1
- package/dist/assets/useLiveConfig-9eJ7EM3B.js +0 -1
- package/dist/assets/useSpatialCanvas-CtVsYmp8.js +0 -1
- /package/dist/assets/{registry-DLyrLfe-2.js → registry-DLyrLfe-.js} +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-DWxlrJSz.js","assets/react-BZJXY1be.js","assets/rolldown-runtime-DkW27tQK.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/icons-gLFQTv74.js","assets/registry-Dd1lcXrO.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/spokenText-C88IQJ0M.js","assets/useFocusTrap-DBtkeyRy.js","assets/toast-BBNs2h3L.js","assets/capture-D8uPIcfj.js","assets/index-Dk0QapqQ.js","assets/useInView-CXTOAEV3.js","assets/coreIcons-DDTChE1H.js","assets/theme-7IrMJ70_.js","assets/index-DmKgC_TJ.css","assets/kokoro-P_fkcX-A.js","assets/share-kW3pZ027.js","assets/ReelJelly-D5e-jt-8.js","assets/geometry-DXAbnb0J.js","assets/threads-Cu2t3070.js","assets/FeatureUseNotice-Dc8joBGM.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/ShareModal-D1QuQEko.css","assets/annotationAuto-CDv6Es44.js","assets/attachments-BW-vki-E.js","assets/pen-DNMslo3e.js","assets/streamParse-B-Gjwa9T.js","assets/providers-BovElgRL.js","assets/http-Lar_UMKb.js","assets/blockTypes-DUDdP3pB.js","assets/info-CiqHR5cs.js","assets/verbatim-DBTj9sPD.js","assets/citation-BsSvaaer.js","assets/search-ZN7v_P5B.js","assets/BriefingPlayer-C0D_2ILa.js","assets/BriefingPlayer-TpFZB77N.css","assets/annotationReel-K2FYv-3B.js","assets/PrismAskController-Bt0k9hAA.js","assets/sourceHost-BV3t2XDb.js","assets/PrismAskController-DBoxQSJR.css","assets/PrismBriefingPlayer-DzdtnFj4.js","assets/CrossExamPanel-CdIYUu-B.js","assets/CrossExamPanel-CZ0ShGma.css","assets/ForecastPanel-zPUh2ClQ.js","assets/ForecastPanel-Da2ZBUrE.css","assets/LeverPanel-D1SNRGdm.js","assets/dag-C3Xx8pOD.js","assets/LeverPanel-DhpJY76O.css","assets/WhyMachineOverlay-ks9-rRiL.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/receipts-D7zveV-I.js","assets/types-C42I77wh.js","assets/engine-BiM6INsW.js","assets/engine-CTvOaA86.css","assets/WhyMachineOverlay-BZk3PVTl.css","assets/run-DlvA3l28.js","assets/extractNumbers-CuhagRkd.js","assets/run-Df10YPyB.js","assets/run-gmqUaxcL.js","assets/model-BFRTN9Eh.js","assets/explode-BgZIWY9m.js","assets/speed-K5_Ebj-8.js","assets/cache-CvbSI-pr.js","assets/json-B0N3XRZU.js","assets/number-zqlPMliA.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{t as n}from"./compiler-runtime-qQQXpJgv.js";import{t as r}from"./jsx-runtime-DeHZSEgm.js";import{n as i,t as a}from"./preload-helper-CiWYd9n-.js";import{t as o}from"./cachedImport-DW0gP14h.js";import{n as s,t as c}from"./preloadableLazy-MIX1ApBW.js";import{it as l,k as u}from"./index-Dk0QapqQ.js";import{t as d}from"./useFocusTrap-DBtkeyRy.js";import{t as f}from"./toast-BBNs2h3L.js";import{r as p}from"./sourceHost-BV3t2XDb.js";import{t as m}from"./penStrokes-DlHnO9xE.js";import{_ as h,c as g,d as _,f as v,g as y,h as b,r as x,v as S,y as C}from"./attachments-BW-vki-E.js";import{t as w}from"./types-CaO6xOn5.js";import{t as T}from"./providers-BovElgRL.js";import{a as E,i as D,t as O}from"./verbatim-DBTj9sPD.js";import{t as k}from"./officeDoc-GU6Cssjf.js";import{n as A,t as j}from"./csv-DAqzYXUs.js";import{a as M,c as ee,d as N,f as P,l as F,m as te,n as ne,o as re,p as ie,r as ae,s as I,t as oe,u as L}from"./pen-DNMslo3e.js";var R=t(),se=n();function ce(e,t=220){return`DOCUMENT OUTLINE — a thin slice of every page:\n${e.map((e,n)=>`[page ${n+1}] ${e.slice(0,t).replace(/\s+/g,` `).trim()}`).join(`
|
|
3
|
+
`)}`}function z(e,t,n){let r=[];try{let n=typeof e==`object`?e:JSON.parse(String(e).match(/\{[\s\S]*\}/)?.[0]??`{}`);Array.isArray(n.pages)&&(r=n.pages.map(e=>Number(e)).filter(e=>Number.isInteger(e)&&e>=1&&e<=t))}catch{}let i=[...new Set(r)].sort((e,t)=>e-t).slice(0,n);if(i.length>0)return i;let a=Math.max(1,Math.floor(t/Math.max(1,n))),o=[];for(let e=1;e<=t&&o.length<n;e+=a)o.push(e);return o}function le(e,t,n,r){return`DOCUMENT TEXT (cite "page" by these markers):\n${t.map(t=>{let i=r?.[t-1];return`${i?`[page ${t} — "${i}"]`:`[page ${t}]`}\n${(e[t-1]??``).slice(0,n)}`}).join(`
|
|
4
|
+
|
|
5
|
+
`)}`}function B(e,t){let n=[];for(let r of e){let e=O(r.quote,t,r.page);if(e>0){n.push({...r,page:e});continue}let i=[...new Set([r.page,...t.map((e,t)=>t+1)])].filter(e=>e>=1&&e<=t.length);for(let e of i){let i=E(r.quote,t[e-1]);if(i){n.push({...r,quote:i,page:e});break}}}return n}var V=null,H=0,ue=new Map;function de(){if(typeof Worker>`u`)return null;if(V)return V;try{return V=new Worker(new URL(`/assets/prismGround.worker-C9hyveb3.js`,``+import.meta.url),{type:`module`}),V.onmessage=e=>{let t=e.data,n=ue.get(t.id);n&&(ue.delete(t.id),t.ok?n.resolve(t.claims??[]):n.reject(Error(t.error??`Grounding failed`)))},V.onerror=()=>{let e=Error(`Grounding worker failed`);for(let t of ue.values())t.reject(e);ue.clear(),V?.terminate(),V=null},V}catch{return V=null,null}}async function U(e,t){let n=[];for(let r=0;r<e.length;r+=16)n.push(...B(e.slice(r,r+16),t)),r+16<e.length&&await new Promise(e=>setTimeout(e,0));return n}async function fe(e,t){let n=de();if(!n)return U(e,t);let r=H+=1;try{return await new Promise((i,a)=>{ue.set(r,{resolve:i,reject:a}),n.postMessage({id:r,candidates:e,pages:t})})}catch{return U(e,t)}}var pe=/\.(csv|tsv|tab)$/i,W=/\.(md|markdown)$/i,me=/\.(json|jsonl|ndjson)$/i,he=/\.(ya?ml|toml|xml|js|ts|jsx|tsx|py|rb|go|rs|java|c|h|cpp|cs|sh|sql|css|html?)$/i,ge=40,_e=1600;function G(e){let t=e.replace(/\r\n?/g,`
|
|
6
|
+
`).split(`
|
|
7
|
+
`);if(t.length&&t[t.length-1]===``&&t.pop(),t.length===0)return[];let n=t[0],r=t.slice(1);if(r.length===0)return[n];let i=[];for(let e=0;e<r.length;e+=ge)i.push([n,...r.slice(e,e+ge)].join(`
|
|
8
|
+
`));return i}function ve(e){let t=e.replace(/\r\n?/g,`
|
|
9
|
+
`).split(`
|
|
10
|
+
`),n=[],r=[];for(let e of t)/^#{1,6}\s/.test(e)&&r.some(e=>e.trim())?(n.push(r.join(`
|
|
11
|
+
`).trim()),r=[e]):r.push(e);r.some(e=>e.trim())&&n.push(r.join(`
|
|
12
|
+
`).trim());let i=n.filter(e=>e.length>0);return i.length>1?i:K(e)}function K(e){let t=e.replace(/\r\n?/g,`
|
|
13
|
+
`).trim();if(!t)return[];let n=t.split(/\n\s*\n/).map(e=>e.trim()).filter(Boolean);if(n.length===0)return[t];let r=[],i=``;for(let e of n)i&&i.length+e.length>_e?(r.push(i),i=e):i=i?`${i}\n\n${e}`:e;return i&&r.push(i),r}function q(e){let t=e.replace(/\r\n?/g,`
|
|
14
|
+
`).trim();if(!t)return[];if(t.length<=_e*1.5)return[t];let n=t.split(`
|
|
15
|
+
`),r=[],i=``;for(let e of n)i&&i.length+e.length>_e?(r.push(i),i=e):i=i?`${i}\n${e}`:e;return i&&r.push(i),r}function ye(e,t,n){if(!n.trim())return null;let r;return r=pe.test(e)||t===`text/csv`?G(n):W.test(e)?ve(n):me.test(e)||t===`application/json`||he.test(e)?q(n):K(n),r.length>0?r:null}function be(e,t,n){return ye(e,t,new TextDecoder(`utf-8`).decode(n))}var xe=null,Se=0,Ce=new Map;function we(){if(typeof Worker>`u`)return null;if(xe)return xe;try{return xe=new Worker(new URL(`/assets/prismExtract.worker-OxGWMXXN.js`,``+import.meta.url),{type:`module`}),xe.onmessage=e=>{let t=e.data,n=Ce.get(t.id);n&&(Ce.delete(t.id),t.bytes&&(n.attachment.bytes=t.bytes),t.ok?n.resolve(t.result??null):n.reject(Error(t.error??`Document extraction failed`)))},xe.onerror=()=>{let e=Error(`Document extraction worker failed`);for(let t of Ce.values())t.reject(e);Ce.clear(),xe?.terminate(),xe=null},xe}catch{return xe=null,null}}function Te(e,t){let n=we();if(!n)return null;let r=Se+=1,i=t.bytes,a={id:r,kind:e,name:t.name,mime:t.mime,...t.file?{file:t.file}:{},...i?{bytes:i,returnBytes:!0}:{},...!t.file&&!i?{data:t.data}:{}},o=i?[i]:[];return i&&(t.bytes=void 0),new Promise((e,s)=>{Ce.set(r,{attachment:t,resolve:e,reject:s});try{n.postMessage(a,o)}catch(e){Ce.delete(r),i&&i.byteLength>0&&(t.bytes=i),s(e instanceof Error?e:Error(`Could not start document extraction`))}})}function Ee(){return new Promise(e=>setTimeout(e,0))}async function De(e,t){await Ee();let n=await x(t);return await Ee(),e===`office`?k(t.name,n):be(t.name,t.mime,n)}async function Oe(e){let t=Te(`office`,e);try{return t?await t:await De(`office`,e)}catch{return await De(`office`,e)}}async function ke(e){let t=Te(`text`,e);try{return t?await t:await De(`text`,e)}catch{return await De(`text`,e)}}var Ae=[`load-bearing`,`supporting`,`context`];function je(e){let t=String(e??``).toLowerCase().trim();return Ae.includes(t)?t:`supporting`}var Me=30,Ne=40,Pe=2e3,Fe=220,Ie=700,Le=`You are given a THIN slice of every page of a long document. Pick the pages that carry the most important, quotable content — the thesis, key findings, definitions, decisive data, and the conclusions — and skip filler (title/cover pages, tables of contents, reference lists, boilerplate). Return STRICT JSON only, no prose: {"pages":[<1-based page numbers>]}. Choose at most ${Ne} pages, in reading order.`;async function Re(e,t,n){try{return z((await T(t.provider).generate({system:`You pick the most important pages of a document and return strict JSON only.`,history:[],user:`${Le}\n\n${ce(e,Fe)}`,attachments:[],maxTokens:Ie,temperature:0,format:null,...n?{signal:n}:{}},t)).raw,e.length,Ne)}catch{return z(`{}`,e.length,Ne)}}var ze=`You are mapping a document for a spatial "explode" view — a map of its key claims.
|
|
16
|
+
|
|
17
|
+
Return ONLY a JSON object (no prose, no markdown fences) of this exact shape:
|
|
18
|
+
{
|
|
19
|
+
"regions": ["Section A", "Section B", ...],
|
|
20
|
+
"claims": [
|
|
21
|
+
{
|
|
22
|
+
"quote": "a phrase copied VERBATIM from the document (about 6-160 characters, appearing word-for-word in the text)",
|
|
23
|
+
"page": 3,
|
|
24
|
+
"kind": "forecast|stat|finding|risk|definition|method|diagram",
|
|
25
|
+
"title": "a 3-7 word headline for the claim",
|
|
26
|
+
"ask": "a short follow-up question about this claim",
|
|
27
|
+
"role": "load-bearing|supporting|context",
|
|
28
|
+
"region": "which of regions[] this claim belongs to",
|
|
29
|
+
"contradictsPage": 27
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
Rules:
|
|
35
|
+
- Each claim "quote" MUST be copied character-for-character, and "page" MUST be the page it appears on.
|
|
36
|
+
When a "DOCUMENT TEXT" section is given below, copy every quote from THERE — not from the rendered
|
|
37
|
+
look of the page — exactly as it appears, including how "$", digits, commas, units, and the spacing
|
|
38
|
+
between them are written. That text is what your quote is verified against; a number retyped from the
|
|
39
|
+
visual layout won't match. Quotes are checked verbatim — anything not found is dropped, so no
|
|
40
|
+
paraphrasing, no "[...]", no rounding ("$7,438" not "$7.4 billion"). Quote a single CONTIGUOUS run of
|
|
41
|
+
the text: a table row reads label-then-number (e.g. "Total net revenue $ 10,253"), so quote it that
|
|
42
|
+
way — never stitch words from across the table.
|
|
43
|
+
- "regions" are the document's own sections/themes (3-6 of them). Every claim's "region" must be one.
|
|
44
|
+
- "role" marks how central the claim is to the document's case: "load-bearing" for the thesis, the
|
|
45
|
+
headline number, or the assertion the whole conclusion rests on; "supporting" for real evidence and
|
|
46
|
+
findings; "context" for definitions, background, or method detail. Mark only a FEW (about 2-4) as
|
|
47
|
+
"load-bearing" — these are what the reader sees first, so reserve it for the claims that truly carry
|
|
48
|
+
the argument.
|
|
49
|
+
- Include "contradictsPage" ONLY when this claim genuinely conflicts with a claim on that other page.
|
|
50
|
+
- For a DATA TABLE (a financial statement, a results table), do NOT just emit one "diagram" claim of
|
|
51
|
+
the table's title — the title alone ("Selected Corporate Data Table") is not analysis. Pull the KEY
|
|
52
|
+
FIGURES out of the table as separate "stat" claims: the headline totals, each major line item or
|
|
53
|
+
segment, and any growth rate or margin. Quote each figure's row from the DOCUMENT TEXT (e.g. "Total
|
|
54
|
+
net revenue $ 10,253", "Data Center Segment $ 5,775"). The specific numbers ARE the point.
|
|
55
|
+
- Reserve kind "diagram" for a genuine CHART, FIGURE, or DIAGRAM (something visual — not a number
|
|
56
|
+
table), using its caption as the verbatim quote (e.g. "Figure 2: Partitioning and replication of keys").
|
|
57
|
+
- Cover the WHOLE document — spread claims across ALL of its pages and sections, not just the first page
|
|
58
|
+
or the opening summary. Later sections, financial statements, and data tables matter as much as the
|
|
59
|
+
intro; pull the key figures from each major section, citing the page each is really on.
|
|
60
|
+
- Aim for 12-24 of the document's most important claims — and MORE for a long or data-dense document (a
|
|
61
|
+
financial report with multiple statements, a deck, a long paper): take the key figures from each major
|
|
62
|
+
section, as "stat" claims, and spread them across the regions.`,Be=`${ze}
|
|
63
|
+
|
|
64
|
+
This document is a slide deck exported as IMAGES — each attached image is one slide, in order. Read
|
|
65
|
+
the text visible ON each slide. Every claim "quote" must be a phrase you can actually see on a slide,
|
|
66
|
+
transcribed exactly, and "page" must be that slide's number (the 1-based order of the attached
|
|
67
|
+
images). Skip purely decorative slides. Treat each slide as its own "region" when no clearer section
|
|
68
|
+
emerges from the content.`;function Ve(e,t){let n=Math.max(1400,Math.min(2600,Math.round(34e3/Math.max(1,e.length))));return`DOCUMENT TEXT (cite "page" by these markers):\n${e.map((e,r)=>{let i=t?.[r];return`${i?`[page ${r+1} — "${i}"]`:`[page ${r+1}]`}\n${e.slice(0,n)}`}).join(`
|
|
69
|
+
|
|
70
|
+
`)}`}function He(e){if(typeof e==`object`)return e;let t=String(e),n=t.indexOf(`{`);if(n<0)return null;let r=0,i=!1,a=!1;for(let e=n;e<t.length;e+=1){let o=t[e];if(i){a?a=!1:o===`\\`?a=!0:o===`"`&&(i=!1);continue}if(o===`"`)i=!0;else if(o===`{`)r+=1;else if(o===`}`&&(--r,r===0))try{return JSON.parse(t.slice(n,e+1))}catch{return null}}return null}function Ue(e){return typeof e==`string`?e:``}function We(e){if(!e||typeof e!=`object`)return null;let t=e,n=Number(t.x),r=Number(t.y),i=Number(t.w),a=Number(t.h);if(![n,r,i,a].every(Number.isFinite)||i<=0||a<=0)return null;let o=Math.max(0,Math.min(1e3,n)),s=Math.max(0,Math.min(1e3,r)),c=Math.max(1,Math.min(1e3-o,i)),l=Math.max(1,Math.min(1e3-s,a));return c>=985&&l>=985?null:{x:o,y:s,w:c,h:l}}function Ge(e){let t=He(e);if(!t||typeof t!=`object`)return[];let n=t,r=Array.isArray(n.claims)?n.claims:[],i=[];for(let e of r){if(!e||typeof e!=`object`)continue;let t=e,n=Ue(t.quote),r=Number(t.page);!n||!Number.isInteger(r)||i.push({quote:n,page:r,kind:Ue(t.kind)||void 0,title:Ue(t.title)||void 0,ask:Ue(t.ask)||void 0,role:Ue(t.role)||void 0,region:Ue(t.region)||void 0,...Number.isInteger(Number(t.contradictsPage))?{contradictsPage:Number(t.contradictsPage)}:{},...We(t.box)?{box:We(t.box)}:{}})}return i}function Ke(e){let t=e.replace(/\.pdf$/i,``).trim();return t.length>28?t.slice(0,27).trimEnd()+`…`:t||`Document`}function qe(e){let t=new Set,n=[];for(let r of e)t.has(r.region)||(t.add(r.region),n.push(r.region));return n}function Je(e){let t=new Map,n=(e,t)=>`${e}:${t}`;for(let r of e){let e=n(r.source,r.page),i=t.get(e)??[];i.push(r),t.set(e,i)}let r=[],i=new Set;for(let a of e){let e=a.contradictsPage;if(!e)continue;let o=t.get(n(a.source,e));if(!o?.length)continue;let s=o.find(e=>e.id!==a.id);if(!s)continue;let c=[a.id,s.id].sort().join(`|`);i.has(c)||(i.add(c),r.push({a:a.id,b:s.id,relation:`contradicts`}))}return r}function Ye(e){let t=String(e);return t===`agrees`?`agrees`:t===`in-tension`?`in-tension`:`contradicts`}function Xe(e,t){return[e,t].sort().join(`|`)}async function Ze(e,t,n,r,i){let a=b(e),o=!a&&!y(e)&&S(e),s,c,l,u,d;if(i)s=i;else if(a){let t=await Oe(e);s=t.pages,c=t.reason,d=t.pageLabels,(!t.pages||t.pages.length===0)&&t.images&&t.images.length>0&&(l=t.images.slice(0,Me),u=l.map((t,n)=>({name:`${e.name} — slide ${n+1}`,mime:t.mime,data:t.data,size:0})))}else s=o?await ke(e):await P(e)??null;let f=!s&&!!u,p=s?s.reduce((e,t)=>e+t.length,0):0,m=y(e)&&!!s&&p>Math.max(400,s.length*60),h=a||o||m,_=T(t.provider);if(!f&&(!s||s.length===0))return{fileName:e.name,pages:[],claims:[],proposed:0,error:a||o?`Couldn't read this document's text${c?` — ${c}`:``}.`:`Couldn't open this PDF — it may be corrupt, password-protected, or not a PDF.`};if(y(e)&&!f&&p===0&&!_.capabilities.vision)return{fileName:e.name,pages:s??[],claims:[],proposed:0,error:`This PDF has no selectable text — it looks like a scan. Connect a model that reads documents (Anthropic or Gemini) to read it.`};let v=h&&s&&s.length>Ne?await Re(s,t,r):null;if(r?.aborted)return{fileName:e.name,pages:s??[],claims:[],proposed:0,...d?{pageLabels:d}:{}};let x=f?u?.length??1:Math.min(s?.length??1,Ne),C=Math.min(8192,Math.max(4096,3e3+x*240)),E=f?u:h?[]:[e],D=await Promise.all(E.map(g)),O=await _.generate({system:`You extract grounded, verbatim-quoted claims from a document and return strict JSON only.`,history:[],user:f?Be:v?`${ze}\n\n${le(s,v,Pe,d)}`:`${ze}\n\n${Ve(s,d)}`,attachments:D,maxTokens:C,temperature:0,format:null,...r?{signal:r}:{}},t).then(e=>({ok:!0,raw:e.raw})).catch(e=>({ok:!1,error:e instanceof Error?e.message:`request failed`}));if(!O.ok)return{fileName:e.name,pages:s??[],claims:[],proposed:0,error:O.error,...d?{pageLabels:d}:{}};let k=Ge(O.raw),A=f?Qe(k,u.length):s,j=await fe(k,A);if(typeof process<`u`&&{}.SNAP_DEBUG)for(let e of k)j.some(t=>t.title===e.title&&t.kind===e.kind)||console.log(` DROPPED p${e.page}: ${JSON.stringify((e.quote??``).slice(0,130))}`);let M=j.map((e,t)=>({id:`d${n}c${t}`,quote:e.quote,page:e.page,kind:w(e.kind),title:e.title?.trim()||e.quote.slice(0,40),ask:e.ask?.trim()||`What does this mean?`,role:je(e.role),region:e.region?.trim()||`Document`,source:n,...e.contradictsPage?{contradictsPage:e.contradictsPage}:{},...f&&e.box?{box:e.box}:{}}));return{fileName:e.name,pages:A,claims:M,proposed:k.length,...l?{slideImages:l}:{},...d?{pageLabels:d}:{}}}function Qe(e,t){let n=Array.from({length:t},()=>``);for(let r of e){let e=typeof r.page==`number`?r.page:0;e>=1&&e<=t&&typeof r.quote==`string`&&(n[e-1]+=(n[e-1]?`
|
|
71
|
+
`:``)+r.quote)}return n}async function $e(e,t,n,r){let i=Array.isArray(e)?e:[e],a=r?Array.isArray(r[0])?r:[r]:i.map(()=>void 0),o=await Promise.all(i.map((e,r)=>Ze(e,t,r,n,a[r]))),s=o.find(e=>e.error&&e.proposed===0),c=o.flatMap(e=>e.claims),l=o.reduce((e,t)=>e+t.proposed,0);if(c.length===0)return{spec:null,proposed:l,error:s?.error??(l===0?`No claims could be mapped from this document.`:`No claims were grounded in the page text.`)};let u=Je(c),d=i.length>1;if(!d){let e=await nt(c,t,u,n);u.push(...e)}if(d&&o.filter(e=>e.claims.length>0).length>1){let e=await rt(c,t,n);u.push(...e)}let f=o.map(e=>({fileName:e.fileName,pageCount:e.pages.length,...e.slideImages?{slideImages:e.slideImages}:{},...e.pageLabels?{pageLabels:e.pageLabels}:{}})),p=c.map(({contradictsPage:e,...t})=>t);if(d)for(let e of p)e.region=`${Ke(f[e.source]?.fileName??`Doc ${e.source+1}`)} · ${e.region}`;return{spec:{documents:f,fileName:f[0]?.fileName??`document.pdf`,pageCount:f.reduce((e,t)=>e+t.pageCount,0),claims:p,regions:qe(p),threads:u},proposed:l,corpus:o.map(e=>e.pages)}}function et(e){return`These are grounded claims pulled from MULTIPLE documents (doc 0, doc 1, …). Find pairs of
|
|
72
|
+
claims FROM DIFFERENT DOCUMENTS that relate, and classify each pair.
|
|
73
|
+
|
|
74
|
+
Claims:
|
|
75
|
+
${e.map(e=>`${e.id} (doc ${e.source}, p.${e.page}): "${e.quote}"`).join(`
|
|
76
|
+
`)}
|
|
77
|
+
|
|
78
|
+
Return ONLY JSON (no prose):
|
|
79
|
+
{ "pairs": [ { "a": "<claim id>", "b": "<claim id>", "relation": "agrees|contradicts|in-tension" } ] }
|
|
80
|
+
|
|
81
|
+
Rules:
|
|
82
|
+
- a and b MUST be ids from the list above, and MUST come from different documents.
|
|
83
|
+
- "agrees": the two claims make the same point. "contradicts": they directly conflict.
|
|
84
|
+
"in-tension": related but pulling different ways.
|
|
85
|
+
- Only include pairs with a real, defensible relationship. Quality over quantity (aim for the
|
|
86
|
+
strongest 3-8 pairs). If nothing relates across documents, return { "pairs": [] }.`}function tt(e){return`These are grounded claims pulled from one or more documents. Find pairs of claims FROM THE
|
|
87
|
+
SAME DOCUMENT that relate, and classify each pair.
|
|
88
|
+
|
|
89
|
+
Claims:
|
|
90
|
+
${e.map(e=>`${e.id} (doc ${e.source}, p.${e.page}, ${e.kind}): "${e.quote}"`).join(`
|
|
91
|
+
`)}
|
|
92
|
+
|
|
93
|
+
Return ONLY JSON (no prose):
|
|
94
|
+
{ "pairs": [ { "a": "<claim id>", "b": "<claim id>", "relation": "contradicts|in-tension|agrees" } ] }
|
|
95
|
+
|
|
96
|
+
Rules:
|
|
97
|
+
- a and b MUST be ids from the list above, and MUST come from the same document.
|
|
98
|
+
- Contradictions can be on the SAME PAGE. Do not skip a pair just because both claims cite p.3.
|
|
99
|
+
- "contradicts": the claims directly conflict or one claim undercuts the other.
|
|
100
|
+
"in-tension": related but pulling different ways. "agrees": the two claims make the same point.
|
|
101
|
+
- Only include defensible relationships visible from the quoted claims. Quality over quantity (aim for
|
|
102
|
+
the strongest 1-8 pairs). If nothing relates, return { "pairs": [] }.`}async function nt(e,t,n,r){if(e.length<2)return[];let i=new Map(e.map(e=>[e.id,e])),a;try{a=(await T(t.provider).generate({system:`You compare grounded claims within documents and return strict JSON only.`,history:[],user:tt(e),maxTokens:1024,temperature:0,format:null,...r?{signal:r}:{}},t)).raw}catch{return[]}let o=He(a),s=o&&typeof o==`object`&&Array.isArray(o.pairs)?o.pairs:[],c=[],l=new Set(n.map(e=>Xe(e.a,e.b)));for(let e of s){if(!e||typeof e!=`object`)continue;let t=e,n=i.get(String(t.a)),r=i.get(String(t.b));if(!n||!r||n.id===r.id||n.source!==r.source)continue;let a=Xe(n.id,r.id);l.has(a)||(l.add(a),c.push({a:n.id,b:r.id,relation:Ye(t.relation)}))}return c}async function rt(e,t,n){let r=new Map(e.map(e=>[e.id,e])),i;try{i=(await T(t.provider).generate({system:`You compare claims across documents and return strict JSON only.`,history:[],user:et(e),maxTokens:1024,temperature:0,format:null,...n?{signal:n}:{}},t)).raw}catch{return[]}let a=He(i),o=a&&typeof a==`object`&&Array.isArray(a.pairs)?a.pairs:[],s=[],c=new Set;for(let e of o){if(!e||typeof e!=`object`)continue;let t=e,n=r.get(String(t.a)),i=r.get(String(t.b));if(!n||!i||n.id===i.id||n.source===i.source)continue;let a=Ye(String(t.relation)),o=Xe(n.id,i.id);c.has(o)||(c.add(o),s.push({a:n.id,b:i.id,relation:a,crossDoc:!0}))}return s}var it=900;function at(e){let t=(0,se.c)(13),[n,r]=(0,R.useState)(`idle`),[i,a]=(0,R.useState)(null),[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(0),[u,d]=(0,R.useState)(null),f=(0,R.useRef)(null),p=(0,R.useRef)(null),m=(0,R.useRef)(0),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{f.current?.abort(),f.current=null,p.current!==null&&(clearTimeout(p.current),p.current=null)},t[0]=h):h=t[0];let g=h,_,v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>g,v=[g],t[1]=_,t[2]=v):(_=t[1],v=t[2]),(0,R.useEffect)(_,v);let y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{g(),m.current+=1,r(`idle`),a(null),s(null),l(0),d(null)},t[3]=y):y=t[3];let b=y,x;t[4]===e?x=t[5]:(x=t=>{if(!e){d(`Connect a model that reads documents (Anthropic or Gemini) to explode one.`),r(`error`);return}g();let n=m.current+=1,i=new AbortController;f.current=i,a(null),s(null),l(0),d(null),r(`igniting`),p.current=setTimeout(()=>{m.current===n&&r(ot)},it),$e(t,e,i.signal).then(e=>{m.current===n&&(l(e.proposed),e.spec?(a(e.spec),s(e.corpus??null),r(`settled`)):(d(e.error??`This document could not be mapped.`),r(`error`)))}).catch(e=>{m.current===n&&(i.signal.aborted||(d(e instanceof Error?e.message:`Mapping failed.`),r(`error`)))})},t[4]=e,t[5]=x);let S=x,C;return t[6]!==o||t[7]!==u||t[8]!==S||t[9]!==n||t[10]!==c||t[11]!==i?(C={phase:n,spec:i,corpus:o,proposed:c,error:u,explode:S,reset:b},t[6]=o,t[7]=u,t[8]=S,t[9]=n,t[10]=c,t[11]=i,t[12]=C):C=t[12],C}function ot(e){return e===`igniting`?`blooming`:e}var st=.15,ct=4;function lt(e,t,n,r,i){let a=(0,se.c)(31),[o,s]=(0,R.useState)(!1),c=(0,R.useRef)(null),l=(0,R.useRef)(!1),u=(0,R.useRef)(`auto`),d=(0,R.useRef)(null),f;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={x:0,y:0,scale:1},a[0]=f):f=a[0];let p=(0,R.useRef)(f),m=(0,R.useRef)(null),h;a[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{let e=m.current;if(!e)return;let t=p.current;e.style.transform=`translate(${t.x}px, ${t.y}px) scale(${t.scale})`},a[1]=h):h=a[1];let g=h,_;a[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{p.current=typeof e==`function`?e(p.current):e,g()},a[2]=_):_=a[2];let v=_,y;a[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{m.current=e,g()},a[3]=y):y=a[3];let b=y,x;a[4]!==r||a[5]!==e||a[6]!==n||a[7]!==t?(x=()=>{let i=e.current;if(!i)return;u.current=`auto`;let a=r&&r.w>0&&r.h>0?r:{x:0,y:0,w:t,h:n},o=i.clientWidth-64,s=i.clientHeight-64;if(o<=0||s<=0)return;let c=Math.max(st,Math.min(ct,1.35,Math.min(o/a.w,s/a.h))),l=a.x+a.w/2,d=a.y+a.h/2;v({x:i.clientWidth/2-l*c,y:i.clientHeight/2-d*c,scale:c})},a[4]=r,a[5]=e,a[6]=n,a[7]=t,a[8]=x):x=a[8];let S=x,C;a[9]===e?C=a[10]:(C=(t,n)=>{let r=e.current;if(!r)return;let i=r.clientWidth-96,a=r.clientHeight-96;if(i<=0||a<=0||t.w<=0||t.h<=0)return;u.current=`framed`,d.current={bbox:t,opts:n};let o=n?.maxScale??1.4,s=Math.max(st,Math.min(ct,o,Math.min(i/t.w,a/t.h))),c=t.x+t.w/2,l=t.y+t.h/2;v({x:r.clientWidth/2-c*s,y:r.clientHeight/2-l*s,scale:s})},a[9]=e,a[10]=C);let w=C,T,E;a[11]!==S||a[12]!==w||a[13]!==e?(T=()=>{let t=e.current;if(!t||(S(),typeof ResizeObserver>`u`))return;let n=new ResizeObserver(()=>{u.current===`auto`?S():u.current===`framed`&&d.current&&w(d.current.bbox,d.current.opts)});return n.observe(t),()=>n.disconnect()},E=[e,S,w],a[11]=S,a[12]=w,a[13]=e,a[14]=T,a[15]=E):(T=a[14],E=a[15]),(0,R.useEffect)(T,E);let D;a[16]===Symbol.for(`react.memo_cache_sentinel`)?(D=(e,t,n)=>{u.current=`user`,v(r=>{let i=Math.max(st,Math.min(ct,r.scale*e));if(i===r.scale)return r;let a=(t-r.x)/r.scale,o=(n-r.y)/r.scale;return{x:t-a*i,y:n-o*i,scale:i}})},a[16]=D):D=a[16];let O=D,k;a[17]===e?k=a[18]:(k=t=>{let n=e.current,r=n?n.clientWidth/2:0,i=n?n.clientHeight/2:0;O(t,r,i)},a[17]=e,a[18]=k);let A=k,j=i?.wheelZoom??!0,M,ee;a[19]!==e||a[20]!==j?(M=()=>{let t=e.current;if(!t||!j)return;let n=e=>{e.preventDefault();let n=t.getBoundingClientRect();O(e.deltaY<0?1.12:.8928571428571428,e.clientX-n.left,e.clientY-n.top)};return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},ee=[e,j,O],a[19]=e,a[20]=j,a[21]=M,a[22]=ee):(M=a[21],ee=a[22]),(0,R.useEffect)(M,ee);let N;a[23]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{e.button===0&&(c.current={id:e.pointerId,x:e.clientX,y:e.clientY,moved:!1},l.current=!1)},a[23]=N):N=a[23];let P=N,F;a[24]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{let t=c.current;if(!t||e.pointerId!==t.id)return;let n=e.clientX-t.x,r=e.clientY-t.y;if(!(!t.moved&&Math.hypot(n,r)<4)){if(!t.moved){t.moved=!0,s(!0);try{e.currentTarget.setPointerCapture(t.id)}catch{}}t.x=e.clientX,t.y=e.clientY,l.current=!0,u.current=`user`,v(e=>({...e,x:e.x+n,y:e.y+r}))}},a[24]=F):F=a[24];let te=F,ne;a[25]===Symbol.for(`react.memo_cache_sentinel`)?(ne=e=>{let t=c.current;if(!t||e.pointerId!==t.id)return;let n=t.moved;if(n)try{e.currentTarget.releasePointerCapture(t.id)}catch{}c.current=null,s(!1),n&&requestAnimationFrame(()=>l.current=!1)},a[25]=ne):ne=a[25];let re=ne,ie;return a[26]!==S||a[27]!==w||a[28]!==o||a[29]!==A?(ie={worldRef:b,panning:o,fit:S,frame:w,zoomBy:A,onPointerDown:P,onPointerMove:te,onPointerUp:re,movedRef:l},a[26]=S,a[27]=w,a[28]=o,a[29]=A,a[30]=ie):ie=a[30],ie}var ut=1360,dt=2.39996322;function ft(e){let t=ut/820,n=e*240*136,r=Math.max(ut*820,n/.22),i=Math.sqrt(r/t);return{w:Math.round(i*t),h:Math.round(i)}}function pt(e,t,n){let{w:r,h:i}=n?{w:n.width,h:n.height}:ft(e.claims.length),a=e=>n?.claims.has(e)??!1,o=Math.max(1,e.regions.length),s=Math.min(r,i)*.34,c=e.regions.map((e,a)=>{let c=n?.regions.get(e),l=a/o*Math.PI*2-Math.PI/2;return{name:e,color:t[a%t.length],cx:c?c.cx:r/2+Math.cos(l)*s,cy:c?c.cy:i/2+Math.sin(l)*s*.82}}),l=new Map(c.map(e=>[e.name,e])),u=new Map;for(let t of e.claims){let e=u.get(t.region)??[];e.push(t),u.set(t.region,e)}let d=[];for(let[e,t]of u){let r=l.get(e)??c[0];t.forEach((e,t)=>{let i=n?.claims.get(e.id);if(i){d.push({...e,x:i.x,y:i.y});return}let a=30+56*Math.sqrt(t),o=t*dt;d.push({...e,x:r.cx+Math.cos(o)*a,y:r.cy+Math.sin(o)*a*.92})})}let f=e=>{e.x=Math.min(r-120,Math.max(120,e.x)),e.y=Math.min(i-92,Math.max(92,e.y))},p=e=>({hw:Math.max(70,e.name.length*7+24)/2,hh:26}),m=e=>!a(e.id),h=e=>Math.floor(e/214),g=e=>Math.floor(e/110),_=2**26,v=(e,t)=>e*_+t,y=()=>{let e=new Map,t=d.map(e=>v(h(e.x),g(e.y)));for(let n=0;n<d.length;n+=1){let r=e.get(t[n]);r?r.push(n):e.set(t[n],[n])}let n=n=>{let r=v(h(d[n].x),g(d[n].y));if(r===t[n])return;let i=e.get(t[n]);i&&i.splice(i.indexOf(n),1),t[n]=r;let a=e.get(r);a?a.push(n):e.set(r,[n])},r=(t,n)=>{let r=d[t],i=m(r),a=h(r.x),o=g(r.y),s=-1;for(let t=-1;t<=1;t+=1)for(let c=-1;c<=1;c+=1){let l=e.get(v(a+t,o+c));if(l)for(let e=0;e<l.length;e+=1){let t=l[e];if(t<=n||s>=0&&t>s)continue;let a=d[t];if(!i&&!m(a))continue;let o=214-Math.abs(a.x-r.x),c=110-Math.abs(a.y-r.y);o>0&&c>0&&(s=t)}}return s};for(let e=0;e<600;e+=1){let e=!1;for(let t=0;t<d.length;t+=1){let i=d[t],a=m(i),o=t;for(let s=r(t,o);s>=0;s=r(t,o)){o=s;let r=d[s],c=m(r),l=r.x-i.x,u=r.y-i.y,p=214-Math.abs(l),h=110-Math.abs(u),g=a?c?.5:1:0,_=c?a?.5:1:0;if(p<h){let e=(p+1)*(l<0?-1:1);i.x-=e*g,r.x+=e*_}else{let e=(h+1)*(u<0?-1:1);i.y-=e*g,r.y+=e*_}a&&f(i),c&&f(r),n(t),n(s),e=!0}}for(let t of c){let{hw:r,hh:i}=p(t);for(let a=0;a<d.length;a+=1){let o=d[a];if(!m(o))continue;let s=o.x-t.cx,c=o.y-t.cy,l=100+r+14-Math.abs(s),u=48+i+14-Math.abs(c);l>0&&u>0&&(l<u?o.x+=(l/2+.5)*(s<0?-1:1):o.y+=(u/2+.5)*(c<0?-1:1),f(o),n(a),e=!0)}}if(!e)break}for(let e of d)m(e)&&f(e)};if(n){let e=(e,t,n)=>{if(e<120||e>r-120||t<92||t>i-92)return!1;for(let r of n)if(Math.abs(e-r.x)<214&&Math.abs(t-r.y)<110)return!1;for(let n of c){let{hw:r,hh:i}=p(n);if(Math.abs(e-n.cx)<100+r+14&&Math.abs(t-n.cy)<48+i+14)return!1}return!0},t=d.filter(e=>a(e.id));for(let n of d){if(a(n.id))continue;let r=l.get(n.region)??c[0];for(let i=0;i<4e3;i+=1){let a=20+22*Math.sqrt(i),o=i*dt,s=r.cx+Math.cos(o)*a,c=r.cy+Math.sin(o)*a*.92;if(e(s,c,t)){n.x=s,n.y=c;break}}t.push(n)}}y();for(let e of c){if(n?.regions.has(e.name))continue;let t=d.filter(t=>t.region===e.name);if(t.length===0)continue;let i=1/0,a=0;for(let e of t)e.y<i&&(i=e.y),a+=e.x;e.cx=Math.min(r-80,Math.max(80,a/t.length)),e.cy=Math.max(28,i-74)}y();let b=[],x=[];for(let e of c){let t=d.filter(t=>t.region===e.name);if(t.length===0)continue;x.push(t[0]);let n=t.slice(1),r=t[0];for(;n.length>0;){let e=0,t=1/0;for(let i=0;i<n.length;i+=1){let a=(n[i].x-r.x)**2+(n[i].y-r.y)**2;a<t&&(t=a,e=i)}let i=n.splice(e,1)[0];b.push({a:r.id,b:i.id}),r=i}}for(let e=1;e<x.length;e+=1)b.push({a:x[e-1].id,b:x[e].id});return{regions:c,claims:d,links:b,width:r,height:i}}function mt(e,t,n){let r=pt({claims:e.claims,regions:e.themes.map(e=>e.id)},t,n),i=new Map(r.claims.map(e=>[e.id,{x:e.x,y:e.y}])),a=new Map(r.regions.map(e=>[e.name,e])),o=e.contradictions.map(e=>{let t=i.get(e.a),n=i.get(e.b),a=t&&n?(t.x+n.x)/2:t?.x??n?.x??r.width/2,o=t&&n?(t.y+n.y)/2:t?.y??n?.y??r.height/2;return{...e,x:a,y:o}}),s=e.consensus.map(e=>{let t=e.memberClaimIds.map(e=>i.get(e)).filter(e=>!!e);if(t.length===0)return{...e,x:r.width/2,y:r.height/2,r:200};let n=t.reduce((e,t)=>e+t.x,0)/t.length,a=t.reduce((e,t)=>e+t.y,0)/t.length,o=Math.max(...t.map(e=>Math.hypot(e.x-n,e.y-a)))+140;return{...e,x:n,y:a,r:o}}),c=new Map,l=e.gaps.map((e,t)=>{let n=e.theme?a.get(e.theme):void 0,i=c.get(e.theme)??0;if(c.set(e.theme,i+1),n){let t=r.claims.filter(t=>t.region===e.theme),a=t.length?Math.max(...t.map(e=>e.y)):n.cy;return{...e,x:n.cx,y:a+96+24+i*114}}return{...e,x:r.width*(.2+.6*(t%4/3)),y:r.height-60-i*114}});return{...r,contradictions:o,gaps:l,consensus:s,contentBox:ht(r,o,l,s)}}function ht(e,t,n,r){let i=[],a=[],o=(e,t,n,r)=>{i.push(e-n,e+n),a.push(t-r,t+r)};for(let t of e.claims)o(t.x,t.y,100,48);for(let e of[...t,...n])o(e.x,e.y,100,48);for(let e of r)o(e.x,e.y,e.r,e.r);for(let t of e.regions)o(t.cx,t.cy,90,22);if(i.length===0)return{x:0,y:0,w:e.width,h:e.height};let s=Math.min(...i),c=Math.min(...a);return{x:s,y:c,w:Math.max(1,Math.max(...i)-s),h:Math.max(1,Math.max(...a)-c)}}var gt=null,_t=0,vt=new Map;function yt(){if(typeof Worker>`u`)return null;if(gt)return gt;try{return gt=new Worker(new URL(`/assets/prismLayout.worker-CJa4orCT.js`,``+import.meta.url),{type:`module`}),gt.onmessage=e=>{let t=e.data,n=vt.get(t.id);n&&(vt.delete(t.id),t.ok&&t.result?n.resolve(t.result):n.reject(Error(t.error??`Layout failed`)))},gt.onerror=()=>{let e=Error(`Layout worker failed`);for(let t of vt.values())t.reject(e);vt.clear(),gt?.terminate(),gt=null},gt}catch{return gt=null,null}}function bt(e){let t=yt();if(!t)return null;let n=_t+=1;return new Promise((r,i)=>{vt.set(n,{resolve:r,reject:i}),t.postMessage({...e,id:n,palette:[...e.palette]})})}async function xt(e,t){try{return await(bt({kind:`prism`,spec:e,palette:t})??new Promise(n=>setTimeout(()=>n(pt(e,t)),0)))}catch{return new Promise(n=>setTimeout(()=>n(pt(e,t)),0))}}async function St(e,t){try{return await(bt({kind:`corpus`,spec:e,palette:t})??new Promise(n=>setTimeout(()=>n(mt(e,t)),0)))}catch{return new Promise(n=>setTimeout(()=>n(mt(e,t)),0))}}var J=r();function Ct(e){let t=(0,se.c)(23),{page:n,pageCount:r,onPageChange:i}=e;if(r<=1)return null;let a=n<=1,o;t[0]!==i||t[1]!==n?(o=()=>i(n-1),t[0]=i,t[1]=n,t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==o?(s=(0,J.jsx)(`button`,{type:`button`,className:`prism-page-nav-btn`,disabled:a,onClick:o,"aria-label":`Previous page`,children:`‹`}),t[3]=a,t[4]=o,t[5]=s):s=t[5];let c;t[6]===n?c=t[7]:(c=(0,J.jsx)(`strong`,{children:n}),t[6]=n,t[7]=c);let l;t[8]===r?l=t[9]:(l=(0,J.jsxs)(`span`,{className:`prism-page-nav-of`,children:[` / `,r]}),t[8]=r,t[9]=l);let u;t[10]!==c||t[11]!==l?(u=(0,J.jsxs)(`span`,{className:`prism-page-nav-at`,children:[c,l]}),t[10]=c,t[11]=l,t[12]=u):u=t[12];let d=n>=r,f;t[13]!==i||t[14]!==n?(f=()=>i(n+1),t[13]=i,t[14]=n,t[15]=f):f=t[15];let p;t[16]!==d||t[17]!==f?(p=(0,J.jsx)(`button`,{type:`button`,className:`prism-page-nav-btn`,disabled:d,onClick:f,"aria-label":`Next page`,children:`›`}),t[16]=d,t[17]=f,t[18]=p):p=t[18];let m;return t[19]!==s||t[20]!==u||t[21]!==p?(m=(0,J.jsxs)(`div`,{className:`prism-page-nav`,role:`group`,"aria-label":`Page through the document`,children:[s,u,p]}),t[19]=s,t[20]=u,t[21]=p,t[22]=m):m=t[22],m}var Y=4;function X(e,t){let n=(0,se.c)(4),r,i;n[0]!==t||n[1]!==e?(r=()=>{let n=e.current;if(!n||!t)return;let r=!1,i=!1,a=-1,o=0,s=0,c=0,l=0,u=()=>n.scrollWidth>n.clientWidth+1||n.scrollHeight>n.clientHeight+1,d=e=>{e.button!==0||!u()||e.target?.closest(`button, a, input, textarea, select, [role="button"]`)||(r=!0,i=!1,a=e.pointerId,o=e.clientX,s=e.clientY,c=n.scrollLeft,l=n.scrollTop)},f=e=>{if(!r||e.pointerId!==a)return;let t=e.clientX-o,u=e.clientY-s;if(!i){if(Math.hypot(t,u)<Y)return;i=!0,n.classList.add(`is-panning`);try{n.setPointerCapture(a)}catch{}}e.preventDefault(),n.scrollLeft=c-t,n.scrollTop=l-u},p=e=>{if(e.pointerId===a){if(r=!1,i){i=!1,n.classList.remove(`is-panning`);try{n.releasePointerCapture(a)}catch{}}a=-1}};return n.addEventListener(`pointerdown`,d),n.addEventListener(`pointermove`,f),n.addEventListener(`pointerup`,p),n.addEventListener(`pointercancel`,p),()=>{n.removeEventListener(`pointerdown`,d),n.removeEventListener(`pointermove`,f),n.removeEventListener(`pointerup`,p),n.removeEventListener(`pointercancel`,p),n.classList.remove(`is-panning`)}},i=[e,t],n[0]=t,n[1]=e,n[2]=r,n[3]=i):(r=n[2],i=n[3]),(0,R.useEffect)(r,i)}function wt({ariaLabel:e,kindLabel:t,color:n,page:r,pageLabel:i,title:a,docName:o,pageCount:s,onPageChange:c,zoom:l,zoomVariant:u=`fit`,onClose:d,closeLabel:f,connections:p,onNavigate:m,footer:h,scrollRef:g,panBody:_=!1,children:v}){return X(g,_),(0,J.jsxs)(`aside`,{className:`prism-page`,"aria-label":e,children:[(0,J.jsxs)(`header`,{className:`prism-page-head`,children:[(0,J.jsxs)(`span`,{className:`prism-page-tag`,style:{color:n},children:[t,` · `,i??`SOURCE p.${r}`]}),(0,J.jsx)(`span`,{className:`prism-page-title`,children:o?`${o} — ${a}`:a}),s&&c&&(0,J.jsx)(Ct,{page:r,pageCount:s,onPageChange:c}),l&&(0,J.jsxs)(`div`,{className:`prism-page-zoom`,"aria-label":`Zoom the page`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:l.zoomOut,"aria-label":`Zoom out`,children:`−`}),(0,J.jsx)(`button`,{type:`button`,onClick:l.zoomIn,"aria-label":`Zoom in`,children:`+`}),u===`fit`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`button`,{type:`button`,onClick:l.fitWidth,"aria-label":`Fit width`,title:`Fit width`,children:`↔`}),(0,J.jsx)(`button`,{type:`button`,onClick:l.fitScreen,"aria-label":`Fit whole page`,title:`Fit page`,children:`⊡`})]})]}),(0,J.jsx)(`button`,{type:`button`,className:`prism-page-close`,onClick:d,"aria-label":f,children:`✕`})]}),(0,J.jsx)(`div`,{className:`prism-page-scroll`+(_?` is-pannable`:``),ref:g,children:v}),p&&p.length>0&&m&&(0,J.jsxs)(`nav`,{className:`prism-page-conns`,"aria-label":`Connected claims`,children:[(0,J.jsxs)(`span`,{className:`prism-page-conns-label`,children:[`Connected (`,p.length,`)`]}),(0,J.jsx)(`div`,{className:`prism-page-conns-list`,children:p.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:`prism-page-conn`,onClick:()=>m(e.id),title:`Go to “${e.title}”`,children:[e.title,` →`]},e.id))})]}),(0,J.jsx)(`footer`,{className:`prism-page-foot`,children:h})]})}function Tt(e,t,n,r,i,a){let o=[];if(e.length>0&&r?.trim()){let t=e[0];o.push({y:t.y,anchorY:t.y+t.h/2,anchorX:t.x+t.w,color:n,text:r.trim()})}t.forEach((e,t)=>{let n=i?.[t];if(e.length>0&&n?.note?.trim()){let t=e[0];o.push({y:t.y,anchorY:t.y+t.h/2,anchorX:t.x+t.w,color:n.color,text:n.note.trim()})}}),o.sort((e,t)=>e.y-t.y);let s=86/(a||1);for(let e=1;e<o.length;e++)o[e].y<o[e-1].y+s&&(o[e].y=o[e-1].y+s);return o}function Z({geometry:e,zoom:t,color:n,quote:r,also:i,isFigure:a,penOn:o,penColor:s,penAccent:c,seed:l}){let{dims:u,rects:d,alsoRects:f,figure:p}=e,h=o===!0&&r.trim().length>0&&u.w>0,g=(0,R.useMemo)(()=>{if(!h)return[];let e=m(d,p??void 0,a??!1,u.w,u.h,l,c),t=f.flatMap((e,t)=>e.length?m(e,void 0,!1,u.w,u.h,`${l}:also${t}`):[]);return[...e,...t]},[h,d,f,p,a,u.w,u.h,l,c]);return(0,J.jsxs)(J.Fragment,{children:[(d.length>0||p)&&(0,J.jsxs)(`div`,{className:`prism-page-marks`,style:{transform:`scale(${t})`,transformOrigin:`0 0`},"aria-hidden":`true`,children:[p&&(0,J.jsx)(`span`,{className:`prism-page-figure`,style:{left:p.x,top:p.y,width:p.w,height:p.h,borderColor:`color-mix(in oklab, ${n} 70%, transparent)`,boxShadow:`0 0 0 3px color-mix(in oklab, ${n} 20%, transparent)`}}),f.map((e,t)=>e.map((e,r)=>(0,J.jsx)(`span`,{className:`prism-page-mark`,style:{left:e.x,top:e.y,width:e.w,height:e.h,background:`color-mix(in oklab, ${i?.[t]?.color??n} 18%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${i?.[t]?.color??n} 35%, transparent)`}},`a${t}-${r}`))),d.map((e,t)=>(0,J.jsx)(`span`,{className:`prism-page-mark`,style:{left:e.x,top:e.y,width:e.w,height:e.h,background:`color-mix(in oklab, ${n} 32%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${n} 55%, transparent)`}},t))]}),o&&g.length>0&&(0,J.jsx)(`svg`,{className:`prism-pen`,width:u.w,height:u.h,viewBox:`0 0 ${u.w} ${u.h}`,style:{transform:`scale(${t})`,transformOrigin:`0 0`,color:s},"aria-hidden":`true`,children:g.map((e,t)=>(0,J.jsxs)(`g`,{style:{"--ink-delay":`${t*450}ms`},children:[(0,J.jsx)(`path`,{className:`prism-pen-halo`,d:e.d,pathLength:1,fill:e.fill?`currentColor`:`none`}),(0,J.jsx)(`path`,{className:`prism-pen-stroke`,d:e.d,pathLength:1,fill:e.fill?`currentColor`:`none`}),e.head&&(0,J.jsx)(`path`,{className:`prism-pen-head`,d:e.head,pathLength:1,fill:`none`}),e.label&&(0,J.jsx)(`text`,{className:`prism-pen-glyph`,x:e.label.x,y:e.label.y,textAnchor:e.label.anchor,fontSize:e.label.size??26,children:e.label.text})]},t))},l)]})}function Q({entries:e,dims:t,zoom:n,seed:r}){if(e.length===0)return null;let i=t.w*n,a=t.w+210/(n||1);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`svg`,{className:`prism-note-arrows`,width:a,height:t.h,viewBox:`0 0 ${a} ${t.h}`,style:{transform:`scale(${n})`,transformOrigin:`0 0`},"aria-hidden":`true`,children:e.map((e,r)=>{let i=t.w+12/(n||1),a=e.y+14/(n||1),o=(e.anchorX+i)/2,s=`M ${i} ${a} C ${o} ${a}, ${o} ${e.anchorY}, ${e.anchorX+6} ${e.anchorY}`,c=`M ${e.anchorX+14} ${e.anchorY-6} L ${e.anchorX+5} ${e.anchorY} L ${e.anchorX+15} ${e.anchorY+5}`;return(0,J.jsxs)(`g`,{style:{"--ink-delay":`${400+r*500}ms`,color:e.color},children:[(0,J.jsx)(`path`,{className:`prism-note-arrow`,d:s,pathLength:1,fill:`none`}),(0,J.jsx)(`path`,{className:`prism-note-arrow-head`,d:c,pathLength:1,fill:`none`})]},r)})},`na-`+r),(0,J.jsx)(`div`,{className:`prism-margin`,style:{width:190,left:i+24},children:e.map((e,t)=>(0,J.jsx)(`div`,{className:`prism-margin-note`,style:{top:e.y*n,"--note-c":e.color,"--ink-delay":`${400+t*500}ms`},children:e.text},t))})]})}function Et(e,t,n){let r=(0,R.useRef)(n);r.current=n;let[i,a]=(0,R.useState)({w:0,h:0}),o=(0,R.useRef)(i),[s,c]=(0,R.useState)(1),l=(0,R.useRef)(`width`),u=(0,R.useRef)(!1),d=(0,R.useRef)(!1),f=(0,R.useCallback)(()=>{l.current=`width`;let t=e.current,n=o.current;if(!t||n.w===0)return;let i=r.current?.padding??32,a=r.current?.gutterReserve??0,s=t.clientWidth-i-a;s>0&&c(s/n.w)},[e]),p=(0,R.useCallback)(()=>{l.current=`screen`;let t=e.current,n=o.current;if(!t||n.w===0||n.h===0)return;let i=r.current?.padding??32,a=r.current?.gutterReserve??0,s=t.clientWidth-i-a,u=t.clientHeight-i;s>0&&u>0&&c(Math.min(s/n.w,u/n.h))},[e]),m=(0,R.useCallback)(()=>{l.current=`manual`,c(e=>Math.min(4,e*1.25))},[]),h=(0,R.useCallback)(()=>{l.current=`manual`,c(e=>Math.max(.2,e/1.25))},[]),g=(0,R.useCallback)((e=!1)=>{l.current=`width`,u.current=!0,d.current=e,c(1)},[]),_=(0,R.useCallback)(e=>{let t=o.current;if(o.current=e,a(e),u.current){u.current=!1,f();return}if(l.current===`manual`){t.w>0&&c(n=>n*(t.w/e.w));return}l.current===`screen`?p():f()},[f,p]),v=(0,R.useRef)(null);return(0,R.useLayoutEffect)(()=>{let n=e.current;if(!n||!t||typeof ResizeObserver>`u`)return;let a=i.w/L(),o=new ResizeObserver(()=>{l.current===`width`?f():l.current===`screen`&&p();let e=r.current?.onSettledGrow;if(!e)return;let t=ie(n.clientWidth)*L(),o=n.clientWidth>a*1.1&&t>i.w,s=d.current&&n.clientWidth>0&&t!==i.w;if(o||s){d.current=!1,v.current&&clearTimeout(v.current);let t=n.clientWidth;v.current=setTimeout(()=>e(t),350)}});return o.observe(n),()=>{o.disconnect(),v.current&&clearTimeout(v.current)}},[t,i.w,f,p,e]),{zoom:s,fitMode:l.current,dims:i,fitWidth:f,fitScreen:p,zoomIn:m,zoomOut:h,setDims:_,resetForNewContent:g}}function Dt({pdf:e,source:t,page:n,quote:r,color:i,also:a,note:o,penOn:s,penColor:c,penAccent:l,onAnnotated:u,kindLabel:d,title:f,isFigure:p,docName:m,connections:h,onNavigate:g,onClose:_,pageCount:v,onPageChange:y}){let b=(0,R.useRef)(null),x=!!o?.trim()||(a??[]).some(e=>!!e.note?.trim()),S=(0,R.useRef)(null),C=(0,R.useRef)(null),[w,T]=(0,R.useState)(`loading`),[E,D]=(0,R.useState)([]),[O,k]=(0,R.useState)([]),[A,j]=(0,R.useState)(null),[M,ee]=(0,R.useState)(0),N=Et(S,w===`ready`,{gutterReserve:x?218:0,onSettledGrow:(0,R.useCallback)(()=>ee(e=>e+1),[])}),{zoom:P,dims:F,setDims:ne,resetForNewContent:re}=N,ae=(a??[]).map(e=>e.quote).join(`\0`),I=(0,R.useRef)(null);(0,R.useEffect)(()=>{let t=!1,i=I.current,a=!i||i.pdf!==e||i.page!==n||i.quote!==r||i.isFigure!==p||i.alsoKey!==ae;I.current={pdf:e,page:n,quote:r,isFigure:p,alsoKey:ae};let o=S.current?.clientWidth??0,s=ie(o);a&&(T(`loading`),D([]),k([]),j(null),re(o===0));let c=ae?ae.split(`\0`):[];return(async()=>{let i=await te(e,n,r,s,p,c);return i||t?i:(await new Promise(e=>window.setTimeout(e,120)),t?null:te(e,n,r,s,p,c))})().then(e=>{if(t)return;let n=b.current;if(!e||!n){a&&T(`failed`);return}if(e.canvas.classList.add(`prism-page-canvas`),n.replaceChildren(e.canvas),C.current=e.canvas,D(e.rects),k(e.alsoRects??[]),j(e.figure??null),ne({w:e.canvas.width,h:e.canvas.height}),a){T(`ready`);let t=e.figure??e.rects[0];if(t){let e=n.closest(`.prism-page-scroll`);try{e?.scrollTo?.({top:Math.max(0,t.y-120),behavior:`smooth`})}catch{}}}}),()=>{t=!0}},[e,n,r,p,ae,M,re,ne]);let oe=F.w*P,L=F.h*P,se=`${t}:${n}:${r}`,ce=(0,R.useMemo)(()=>F.w===0?[]:Tt(E,O,i,o,a,P),[F.w,E,O,o,a,i,P]);(0,R.useEffect)(()=>{if(!s||w!==`ready`||!r.trim()||!u)return;let e=C.current,t=``;try{e&&(t=e.toDataURL(`image/jpeg`,.72))}catch{}u({pageImage:t,imgW:F.w,imgH:F.h,rects:E.map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),figure:A?{x:A.x,y:A.y,w:A.w,h:A.h}:void 0,isFigure:p??!1,seed:se})},[s,w,r,u,F,E,A,p,se]);let z={dims:F,rects:E,alsoRects:O,figure:A};return(0,J.jsxs)(wt,{ariaLabel:`Source page ${n}`,kindLabel:d,color:i,page:n,title:f,docName:m?.replace(/\.pdf$/i,``),pageCount:v,onPageChange:y,zoom:w===`ready`?N:void 0,onClose:_,closeLabel:`Close source page`,connections:h,onNavigate:g,scrollRef:S,panBody:!0,footer:r.trim()?w===`ready`&&A?`The outlined figure and the highlighted caption are what this claim cites.`:w===`ready`&&E.length===0?`Quote grounded on this page — highlight unavailable for this layout.`:`The highlighted text is the claim’s verbatim quote, on its real page.`:`Reading the document — the full page, exactly as it appears in the file.`,children:[w===`loading`&&(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Rendering page `,n,`…`]}),w===`failed`&&(0,J.jsxs)(`div`,{className:`prism-page-fallback`,role:`status`,children:[(0,J.jsxs)(`span`,{className:`prism-page-fallback-kicker`,children:[`Source excerpt · page `,n]}),(0,J.jsx)(`strong`,{children:`Page preview unavailable`}),r.trim()?(0,J.jsxs)(`blockquote`,{children:[`“`,r.trim(),`”`]}):(0,J.jsx)(`p`,{children:`The original file is still attached. Try another page or reopen the document.`}),(0,J.jsx)(`span`,{className:`prism-page-fallback-note`,children:r.trim()?`Verbatim text grounded to page ${n}. Try another page or reopen the document.`:`The page could not be rasterized in this browser.`})]}),(0,J.jsxs)(`div`,{className:`prism-page-unit`,style:{width:oe?oe+(ce.length>0?218:0):void 0,display:w===`ready`?void 0:`none`},children:[(0,J.jsxs)(`div`,{className:`prism-page-frame`,style:{width:oe||void 0,height:L||void 0},children:[(0,J.jsx)(`div`,{className:`prism-page-holder`,ref:b}),w===`ready`&&(0,J.jsx)(Z,{geometry:z,zoom:P,color:i,quote:r,also:a,isFigure:p,penOn:s,penColor:c,penAccent:l,seed:se})]}),w===`ready`&&(0,J.jsx)(Q,{entries:ce,dims:F,zoom:P,seed:se})]})]})}function Ot(e){let t=(0,se.c)(36),{image:n,page:r,quote:i,color:a,kindLabel:o,title:s,docName:c,connections:l,onNavigate:u,onClose:d,pageCount:f,onPageChange:p}=e,m=(0,R.useRef)(null),h=(0,R.useRef)(null),[g,_]=(0,R.useState)(`loading`),v=Et(m,g===`ready`),{zoom:y,dims:b,setDims:x,resetForNewContent:S}=v,C;t[0]===x?C=t[1]:(C=e=>{x({w:e.naturalWidth,h:e.naturalHeight}),_(`ready`)},t[0]=x,t[1]=C);let w=C,T=n?`${n.mime}:${n.data}`:void 0,E;t[2]!==w||t[3]!==S?(E=()=>{_(`loading`),S();let e=h.current;e&&e.complete&&e.naturalWidth>0&&w(e)},t[2]=w,t[3]=S,t[4]=E):E=t[4];let D;t[5]!==w||t[6]!==S||t[7]!==T?(D=[T,S,w],t[5]=w,t[6]=S,t[7]=T,t[8]=D):D=t[8],(0,R.useEffect)(E,D);let O=b.w*y,k=b.h*y,A=`Source slide ${r}`,j=`SLIDE ${r}`,M;t[9]===c?M=t[10]:(M=c?.replace(/\.(pptx|docx|xlsx)$/i,``),t[9]=c,t[10]=M);let ee=g===`ready`?v:void 0,N=i.trim()?`This slide is an image — the quote above is the exact text Mavéa read on it.`:`Reading the document — the full slide, exactly as it appears in the file.`,P;t[11]!==a||t[12]!==k||t[13]!==O||t[14]!==n||t[15]!==w||t[16]!==r||t[17]!==i||t[18]!==g?(P=n?(0,J.jsxs)(`figure`,{className:`prism-slide-figure`,children:[(0,J.jsx)(`div`,{className:`prism-slide-stage`,style:{width:O||void 0,height:k||void 0,display:g===`ready`?void 0:`none`},children:(0,J.jsx)(`img`,{ref:h,className:`prism-slide-img`,src:`data:${n.mime};base64,${n.data}`,alt:`Slide ${r}`,onLoad:e=>w(e.currentTarget),onError:()=>_(`failed`)})}),g===`loading`&&(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Rendering slide `,r,`…`]}),g===`failed`&&(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t load this slide image. The quote is still grounded on slide `,r,`.`]}),g===`ready`&&i.trim()&&(0,J.jsxs)(`figcaption`,{className:`prism-slide-quote`,style:{borderColor:a},children:[(0,J.jsx)(`span`,{className:`prism-slide-quote-label`,style:{color:a},children:`Mavéa read this on the slide`}),`“`,i,`”`]})]}):(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Slide `,r,` image unavailable.`]}),t[11]=a,t[12]=k,t[13]=O,t[14]=n,t[15]=w,t[16]=r,t[17]=i,t[18]=g,t[19]=P):P=t[19];let F;return t[20]!==a||t[21]!==l||t[22]!==o||t[23]!==d||t[24]!==u||t[25]!==p||t[26]!==r||t[27]!==f||t[28]!==A||t[29]!==j||t[30]!==M||t[31]!==ee||t[32]!==N||t[33]!==P||t[34]!==s?(F=(0,J.jsx)(wt,{ariaLabel:A,kindLabel:o,color:a,page:r,pageLabel:j,title:s,docName:M,pageCount:f,onPageChange:p,zoom:ee,onClose:d,closeLabel:`Close source slide`,connections:l,onNavigate:u,scrollRef:m,panBody:!0,footer:N,children:P}),t[20]=a,t[21]=l,t[22]=o,t[23]=d,t[24]=u,t[25]=p,t[26]=r,t[27]=f,t[28]=A,t[29]=j,t[30]=M,t[31]=ee,t[32]=N,t[33]=P,t[34]=s,t[35]=F):F=t[35],F}function kt(e){let t=[],n=``;for(let r=0;r<e.length;r+=1){let i=D(e[r]);for(let e=0;e<i.length;e+=1)n+=i[e],t.push(r);/\s/.test(e[r])&&n.at(-1)!==` `&&(n+=` `,t.push(r))}return{norm:n,map:t}}function At(e,t,n){let r=D(e);if(!r)return null;let i=t.indexOf(r);return i<0?null:[n[i],n[Math.min(i+r.length-1,n.length-1)]+1]}function jt(e,t,n){if(!e)return[];let{norm:r,map:i}=kt(e),a=[],o=[{anchor:`primary`,quote:t},...(n??[]).map((e,t)=>({anchor:`also-${t}`,quote:e.quote}))];for(let e of o){if(!e.quote.trim())continue;let t=At(e.quote,r,i);if(!t)continue;let[n,o]=t;a.some(e=>n<e.end&&e.start<o)||a.push({anchor:e.anchor,start:n,end:o})}a.sort((e,t)=>e.start-t.start);let s=[],c=0;for(let t of a)t.start>c&&s.push({text:e.slice(c,t.start)}),s.push({text:e.slice(t.start,t.end),anchor:t.anchor}),c=t.end;return c<e.length&&s.push({text:e.slice(c)}),s}var Mt={dims:{w:0,h:0},rects:[],alsoRects:[]};function Nt(e,t,n){let r=e.getBoundingClientRect();return{x:(r.left-t.left)/n,y:(r.top-t.top)/n,w:r.width/n,h:r.height/n}}function Pt(e,t,n){let[r,i]=(0,R.useState)(Mt);return(0,R.useEffect)(()=>{let n=e.current;if(!n){i(Mt);return}let r=()=>{let e=n.getBoundingClientRect();if(e.width===0&&e.height===0)return;let r=Array.from(n.querySelectorAll(`[data-prism-anchor="primary"]`)).map(n=>Nt(n,e,t)),a=[];n.querySelectorAll(`[data-prism-anchor^="also-"]`).forEach(n=>{let r=n.getAttribute(`data-prism-anchor`)??``,i=Number(r.slice(5));!Number.isInteger(i)||i<0||(a[i]??=[]).push(Nt(n,e,t))});for(let e=0;e<a.length;e+=1)a[e]??=[];i({dims:{w:e.width/t,h:e.height/t},rects:r,alsoRects:a})};if(r(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(r);return a.observe(n),()=>a.disconnect()},[e,t,...n]),r}var Ft=680,It=14;function Lt(e,t,n){if(e===`primary`)return t;let r=Number(e.slice(5));return n?.[r]?.color??t}function Rt(e){let t=(0,se.c)(85),{doc:n,pages:r,source:i,page:a,quote:o,color:s,also:c,note:l,penOn:u,penColor:d,penAccent:f,onAnnotated:p,kindLabel:m,title:h,docName:g,connections:_,onNavigate:v,onClose:y,pageCount:x,onPageChange:S}=e,[C,w]=(0,R.useState)(null),[T,E]=(0,R.useState)(`loading`),D=r&&r.length>0?r:void 0,O,k;t[0]!==n||t[1]!==D?(O=()=>{if(D)return;let e=!1;return E(`loading`),(b(n)?Oe(n).then(Vt):ke(n)).then(t=>{if(!e){if(!t||t.length===0){E(`failed`);return}w(t),E(`ready`)}}),()=>{e=!0}},k=[n,D],t[0]=n,t[1]=D,t[2]=O,t[3]=k):(O=t[2],k=t[3]),(0,R.useEffect)(O,k);let A=D??C,j=D?`ready`:T,M=A?.[a-1]??``,ee;t[4]!==c||t[5]!==M||t[6]!==o?(ee=jt(M,o,c),t[4]=c,t[5]=M,t[6]=o,t[7]=ee):ee=t[7];let N=ee,P=N.some(Bt),F=(0,R.useRef)(null),te=(0,R.useRef)(null),ne=!!l?.trim()||(c??[]).some(zt),re=ne?218:0,ie;t[8]===re?ie=t[9]:(ie={gutterReserve:re},t[8]=re,t[9]=ie);let ae=Et(F,j===`ready`,ie),{zoom:I,resetForNewContent:oe}=ae,L=(0,R.useRef)(null),ce,z;t[10]!==n||t[11]!==a||t[12]!==oe?(ce=()=>{let e=L.current;L.current={doc:n,page:a},(!e||e.doc!==n||e.page!==a)&&oe()},z=[n,a,oe],t[10]=n,t[11]=a,t[12]=oe,t[13]=ce,t[14]=z):(ce=t[13],z=t[14]),(0,R.useEffect)(ce,z);let le;t[15]===N?le=t[16]:(le=[N],t[15]=N,t[16]=le);let B=Pt(te,I,le),V;t[17]!==B.alsoRects||t[18]!==B.dims||t[19]!==B.rects?(V={dims:B.dims,rects:B.rects,alsoRects:B.alsoRects},t[17]=B.alsoRects,t[18]=B.dims,t[19]=B.rects,t[20]=V):V=t[20];let H=V,ue;t[21]!==c||t[22]!==s||t[23]!==B.alsoRects||t[24]!==B.dims.w||t[25]!==B.rects||t[26]!==l||t[27]!==I?(ue=B.dims.w===0?[]:Tt(B.rects,B.alsoRects,s,l,c,I),t[21]=c,t[22]=s,t[23]=B.alsoRects,t[24]=B.dims.w,t[25]=B.rects,t[26]=l,t[27]=I,t[28]=ue):ue=t[28];let de=ue,U=`${i}:${a}:${o}`,fe;t[29]!==B.dims.h||t[30]!==B.dims.w||t[31]!==B.rects||t[32]!==p||t[33]!==u||t[34]!==o||t[35]!==U||t[36]!==j?(fe=()=>{!u||j!==`ready`||!o.trim()||!p||B.dims.w===0||p({pageImage:``,imgW:Math.max(1,Math.round(B.dims.w)),imgH:Math.max(1,Math.round(B.dims.h)),rects:B.rects,isFigure:!1,seed:U})},t[29]=B.dims.h,t[30]=B.dims.w,t[31]=B.rects,t[32]=p,t[33]=u,t[34]=o,t[35]=U,t[36]=j,t[37]=fe):fe=t[37];let pe;t[38]!==B||t[39]!==p||t[40]!==u||t[41]!==o||t[42]!==U||t[43]!==j?(pe=[u,j,o,p,B,U],t[38]=B,t[39]=p,t[40]=u,t[41]=o,t[42]=U,t[43]=j,t[44]=pe):pe=t[44],(0,R.useEffect)(fe,pe);let W=ne?218:0,me=`Source page ${a}`,he;t[45]===g?he=t[46]:(he=g?.replace(/\.docx$/i,``),t[45]=g,t[46]=he);let ge=j===`ready`?ae:void 0,_e=o.trim()?j===`ready`&&P?`The highlighted text is the claim’s verbatim quote, on its real page.`:`Quote grounded on this page.`:`Reading the document — the full page, exactly as it appears in the file.`,G;t[47]!==a||t[48]!==j?(G=j===`loading`&&(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading page `,a,`…`]}),t[47]=a,t[48]=j,t[49]=G):G=t[49];let ve;t[50]!==a||t[51]!==j?(ve=j===`failed`&&(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t read this page. The quote is still grounded on page `,a,`.`]}),t[50]=a,t[51]=j,t[52]=ve):ve=t[52];let K;t[53]!==c||t[54]!==s||t[55]!==B.dims||t[56]!==W||t[57]!==de||t[58]!==f||t[59]!==d||t[60]!==u||t[61]!==o||t[62]!==U||t[63]!==N||t[64]!==j||t[65]!==H||t[66]!==I?(K=j===`ready`&&(0,J.jsxs)(`div`,{className:`prism-doc-unit`,style:{maxWidth:Ft+W},children:[(0,J.jsxs)(`div`,{className:`prism-doc-sheet prism-doc-text`,ref:te,style:{width:W?`calc(100% - ${W}px)`:`100%`,maxWidth:Ft,fontSize:`${It*I}px`},children:[N.map((e,t)=>e.anchor?(0,J.jsx)(`mark`,{"data-prism-anchor":e.anchor,className:`prism-office-mark`,style:{background:`color-mix(in oklab, ${Lt(e.anchor,s,c)} 30%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${Lt(e.anchor,s,c)} 55%, transparent)`},children:e.text},t):(0,J.jsx)(R.Fragment,{children:e.text},t)),(0,J.jsx)(Z,{geometry:H,zoom:I,color:s,quote:o,also:c,penOn:u,penColor:d,penAccent:f,seed:U})]}),(0,J.jsx)(Q,{entries:de,dims:B.dims,zoom:I,seed:U})]}),t[53]=c,t[54]=s,t[55]=B.dims,t[56]=W,t[57]=de,t[58]=f,t[59]=d,t[60]=u,t[61]=o,t[62]=U,t[63]=N,t[64]=j,t[65]=H,t[66]=I,t[67]=K):K=t[67];let q;return t[68]!==s||t[69]!==_||t[70]!==m||t[71]!==y||t[72]!==v||t[73]!==S||t[74]!==a||t[75]!==x||t[76]!==me||t[77]!==he||t[78]!==ge||t[79]!==_e||t[80]!==G||t[81]!==ve||t[82]!==K||t[83]!==h?(q=(0,J.jsxs)(wt,{ariaLabel:me,kindLabel:m,color:s,page:a,title:h,docName:he,pageCount:x,onPageChange:S,zoom:ge,zoomVariant:`scale`,onClose:y,closeLabel:`Close source page`,connections:_,onNavigate:v,scrollRef:F,footer:_e,children:[G,ve,K]}),t[68]=s,t[69]=_,t[70]=m,t[71]=y,t[72]=v,t[73]=S,t[74]=a,t[75]=x,t[76]=me,t[77]=he,t[78]=ge,t[79]=_e,t[80]=G,t[81]=ve,t[82]=K,t[83]=h,t[84]=q):q=t[84],q}function zt(e){return!!e.note?.trim()}function Bt(e){return e.anchor===`primary`}function Vt(e){return e.pages}var Ht=960,Ut=540,Wt={w:Ht,h:Ut},Gt=[];function Kt(e,t,n){if(e===`primary`)return t;let r=Number(e.slice(5));return n?.[r]?.color??t}function qt(e,t,n,r){return e.map((e,i)=>e.anchor?(0,J.jsx)(`mark`,{"data-prism-anchor":e.anchor,className:`prism-office-mark`,style:{background:`color-mix(in oklab, ${Kt(e.anchor,t,n)} 30%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${Kt(e.anchor,t,n)} 55%, transparent)`},children:e.text},`${r}-${i}`):(0,J.jsx)(R.Fragment,{children:e.text},`${r}-${i}`))}function Jt(e){return e>70?30:e>40?34:40}function Yt(e){return e<=4?22:e<=7?19:e<=11?16:14}function $(e){return e<=220?20:e<=500?17:e<=900?15:13}function Xt(e){let t=(0,se.c)(115),{doc:n,source:r,page:i,quote:a,color:o,also:s,note:c,penOn:l,penColor:u,penAccent:d,onAnnotated:f,kindLabel:p,title:m,docName:h,connections:g,onNavigate:_,onClose:v,pageCount:y,onPageChange:b}=e,[x,S]=(0,R.useState)(null),[C,w]=(0,R.useState)(void 0),[T,E]=(0,R.useState)(`loading`),D,O;t[0]===n?(D=t[1],O=t[2]):(D=()=>{let e=!1;return E(`loading`),Oe(n).then(t=>{if(!e){if(!t.pages||t.pages.length===0){E(`failed`);return}S(t.pages),w(t.slideOutlines),E(`ready`)}}),()=>{e=!0}},O=[n],t[0]=n,t[1]=D,t[2]=O),(0,R.useEffect)(D,O);let k=(0,R.useRef)(null),A=(0,R.useRef)(null),j=c?.trim()||(s??[]).some(nn)?218:0,M;t[3]===j?M=t[4]:(M={gutterReserve:j},t[3]=j,t[4]=M);let ee=Et(k,T===`ready`,M),{zoom:N,dims:P,setDims:F,resetForNewContent:te,fitScreen:ne}=ee,re;t[5]!==ne||t[6]!==te||t[7]!==F?(re=()=>{let e=k.current?.clientWidth??0;te(e===0),F(Wt),ne()},t[5]=ne,t[6]=te,t[7]=F,t[8]=re):re=t[8];let ie;t[9]!==n||t[10]!==ne||t[11]!==i||t[12]!==te||t[13]!==F?(ie=[n,i,te,F,ne],t[9]=n,t[10]=ne,t[11]=i,t[12]=te,t[13]=F,t[14]=ie):ie=t[14],(0,R.useEffect)(re,ie);let ae=x?.[i-1]??``,I=C?.[i-1],oe;t[15]===I?oe=t[16]:(oe=!!I&&(!!I.title?.trim()||I.body.some(tn)),t[15]=I,t[16]=oe);let L=oe,ce;t[17]!==L||t[18]!==I?.title?(ce=L?I?.title?.trim():void 0,t[17]=L,t[18]=I?.title,t[19]=ce):ce=t[19];let z=ce,le=L?I?.body??Gt:Gt,B;t[20]!==s||t[21]!==z||t[22]!==a?(B=z?jt(z,a,s):[],t[20]=s,t[21]=z,t[22]=a,t[23]=B):B=t[23];let V=B,H;if(t[24]!==s||t[25]!==le||t[26]!==a){let e;t[28]!==s||t[29]!==a?(e=e=>jt(e,a,s),t[28]=s,t[29]=a,t[30]=e):e=t[30],H=le.map(e),t[24]=s,t[25]=le,t[26]=a,t[27]=H}else H=t[27];let ue=H,de;t[31]!==s||t[32]!==L||t[33]!==ae||t[34]!==a?(de=L?[]:jt(ae,a,s),t[31]=s,t[32]=L,t[33]=ae,t[34]=a,t[35]=de):de=t[35];let U=de,fe=L?V.some(en)||ue.some(Qt):U.some(Zt),pe;t[36]!==ue||t[37]!==U||t[38]!==V?(pe=[V,ue,U],t[36]=ue,t[37]=U,t[38]=V,t[39]=pe):pe=t[39];let W=Pt(A,N,pe),me;t[40]!==P||t[41]!==W.alsoRects||t[42]!==W.rects?(me={dims:P,rects:W.rects,alsoRects:W.alsoRects},t[40]=P,t[41]=W.alsoRects,t[42]=W.rects,t[43]=me):me=t[43];let he=me,ge;t[44]!==s||t[45]!==o||t[46]!==P.w||t[47]!==W.alsoRects||t[48]!==W.rects||t[49]!==c||t[50]!==N?(ge=P.w===0?[]:Tt(W.rects,W.alsoRects,o,c,s,N),t[44]=s,t[45]=o,t[46]=P.w,t[47]=W.alsoRects,t[48]=W.rects,t[49]=c,t[50]=N,t[51]=ge):ge=t[51];let _e=ge,G=`${r}:${i}:${a}`,ve;t[52]!==W.dims||t[53]!==W.rects||t[54]!==f||t[55]!==l||t[56]!==a||t[57]!==G||t[58]!==T?(ve=()=>{!l||T!==`ready`||!a.trim()||!f||W.dims.w===0||f({pageImage:``,imgW:Ht,imgH:Ut,rects:W.rects,isFigure:!1,seed:G})},t[52]=W.dims,t[53]=W.rects,t[54]=f,t[55]=l,t[56]=a,t[57]=G,t[58]=T,t[59]=ve):ve=t[59];let K;t[60]!==W||t[61]!==f||t[62]!==l||t[63]!==a||t[64]!==G||t[65]!==T?(K=[l,T,a,f,W,G],t[60]=W,t[61]=f,t[62]=l,t[63]=a,t[64]=G,t[65]=T,t[66]=K):K=t[66],(0,R.useEffect)(ve,K);let q=P.w*N,ye=P.h*N,be=`Source slide ${i}`,xe=`SLIDE ${i}`,Se;t[67]===h?Se=t[68]:(Se=h?.replace(/\.pptx$/i,``),t[67]=h,t[68]=Se);let Ce=T===`ready`?ee:void 0,we=a.trim()?T===`ready`&&fe?`The highlighted text is the claim’s verbatim quote, on its real slide.`:`Quote grounded on this slide.`:`Reading the deck — the full slide, exactly as it appears in the file.`,Te;t[69]!==i||t[70]!==T?(Te=T===`loading`&&(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading slide `,i,`…`]}),t[69]=i,t[70]=T,t[71]=Te):Te=t[71];let Ee;t[72]!==i||t[73]!==T?(Ee=T===`failed`&&(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t read this slide. The quote is still grounded on slide `,i,`.`]}),t[72]=i,t[73]=T,t[74]=Ee):Ee=t[74];let De;t[75]!==s||t[76]!==ue||t[77]!==o||t[78]!==P||t[79]!==U||t[80]!==ye||t[81]!==q||t[82]!==L||t[83]!==_e||t[84]!==le||t[85]!==z||t[86]!==ae||t[87]!==d||t[88]!==u||t[89]!==l||t[90]!==a||t[91]!==G||t[92]!==T||t[93]!==he||t[94]!==V||t[95]!==N?(De=T===`ready`&&(0,J.jsxs)(`div`,{className:`prism-slide-unit`,style:{width:q?q+(_e.length>0?218:0):void 0},children:[(0,J.jsxs)(`div`,{className:`prism-slide-frame`,style:{width:q||void 0,height:ye||void 0},children:[(0,J.jsx)(`div`,{className:`prism-slide-canvas`,ref:A,style:{transform:`scale(${N})`},children:L?(0,J.jsxs)(J.Fragment,{children:[z&&(0,J.jsx)(`h2`,{className:`prism-slide-title`,style:{fontSize:Jt(z.length)},children:qt(V,o,s,`title`)}),le.length>0&&(0,J.jsx)(`div`,{className:`prism-slide-body`,style:{fontSize:Yt(le.length)},children:le.map((e,t)=>(0,J.jsx)(`p`,{className:`prism-slide-body-line`,children:qt(ue[t]??[],o,s,`b${t}`)},t))})]}):(0,J.jsx)(`div`,{className:`prism-slide-flat`,style:{fontSize:$(ae.length)},children:qt(U,o,s,`flat`)})}),(0,J.jsx)(Z,{geometry:he,zoom:N,color:o,quote:a,also:s,penOn:l,penColor:u,penAccent:d,seed:G})]}),(0,J.jsx)(Q,{entries:_e,dims:P,zoom:N,seed:G})]}),t[75]=s,t[76]=ue,t[77]=o,t[78]=P,t[79]=U,t[80]=ye,t[81]=q,t[82]=L,t[83]=_e,t[84]=le,t[85]=z,t[86]=ae,t[87]=d,t[88]=u,t[89]=l,t[90]=a,t[91]=G,t[92]=T,t[93]=he,t[94]=V,t[95]=N,t[96]=De):De=t[96];let ke;return t[97]!==o||t[98]!==g||t[99]!==p||t[100]!==v||t[101]!==_||t[102]!==b||t[103]!==i||t[104]!==y||t[105]!==be||t[106]!==xe||t[107]!==Se||t[108]!==Ce||t[109]!==we||t[110]!==Te||t[111]!==Ee||t[112]!==De||t[113]!==m?(ke=(0,J.jsxs)(wt,{ariaLabel:be,kindLabel:p,color:o,page:i,pageLabel:xe,title:m,docName:Se,pageCount:y,onPageChange:b,zoom:Ce,onClose:v,closeLabel:`Close source slide`,connections:g,onNavigate:_,scrollRef:k,panBody:!0,footer:we,children:[Te,Ee,De]}),t[97]=o,t[98]=g,t[99]=p,t[100]=v,t[101]=_,t[102]=b,t[103]=i,t[104]=y,t[105]=be,t[106]=xe,t[107]=Se,t[108]=Ce,t[109]=we,t[110]=Te,t[111]=Ee,t[112]=De,t[113]=m,t[114]=ke):ke=t[114],ke}function Zt(e){return e.anchor===`primary`}function Qt(e){return e.some($t)}function $t(e){return e.anchor===`primary`}function en(e){return e.anchor===`primary`}function tn(e){return e.trim()}function nn(e){return!!e.note?.trim()}function rn(e){let t=[],n=/\S+/g,r;for(;r=n.exec(e);)t.push({start:r.index,end:r.index+r[0].length});return t}function an(e,t,n){let r=rn(e);if(r.length<=1)return;let i=r.findIndex(e=>e.end>t);if(i<0)return;let a=i;for(let e=i;e<r.length&&r[e].start<n;e+=1)a=e;return[i,a]}function on(e,t){if(!t.trim())return[];let n=[];return e.forEach((e,r)=>{if(!e)return;let{norm:i,map:a}=kt(e),o=At(t,i,a);if(!o)return;let[s,c]=o,l=an(e,s,c);n.push(l?{row:r,cells:l}:{row:r})}),n}var sn=880,cn=13;function ln(e){let t=e.trim();if(!t)return!1;let n=t.replace(/^[-+(]/,``).replace(/[)%]$/,``).replace(/^[$€£¥]\s?/,``);return/^[\d,]*\.?\d+$/.test(n)}function un(e,t){return e.length>=t?e.slice(0,t):[...e,...Array(t-e.length).fill(``)]}function dn(e,t){if(e.length===0)return null;let n=e[0].map((e,t)=>e.trim()||`col${t+1}`),r=e.slice(1),i=r.length,a=r.slice(0,A).map(e=>un(e,n.length));return{headers:n,rows:a,sheet:t,sourceRowCount:i,truncated:i>a.length}}function fn(e,t){return e.find(e=>e.row>=1&&!t.has(e.row))}function pn({doc:e,source:t,page:n,quote:r,color:i,also:a,note:o,penOn:s,penColor:c,penAccent:l,onAnnotated:u,kindLabel:d,title:f,docName:p,connections:m,onNavigate:h,onClose:g,pageCount:_,onPageChange:v}){let[y,b]=(0,R.useState)(`loading`),[x,S]=(0,R.useState)(null),[w,T]=(0,R.useState)(null);(0,R.useEffect)(()=>{let t=!1;return b(`loading`),S(null),T(null),C(e)?Oe(e).then(e=>{if(!t){if(!e.sheetGrids||e.sheetGrids.length===0){b(`failed`);return}T({rows:e.sheetGrids,labels:e.pageLabels??[]}),b(`ready`)}}):ke(e).then(e=>{t||(!e||e.length===0?b(`failed`):(S(e),b(`ready`)))}),()=>{t=!0}},[e]);let E=w?.rows[n-1],D=w?.labels[n-1],O=x?.[n-1],k=(0,R.useMemo)(()=>y===`ready`?E?dn(E,D):O===void 0?null:j(O):null,[y,E,D,O]),A=(0,R.useMemo)(()=>E?E.map(e=>e.join(` `)):O===void 0?[]:O.replace(/\r\n?/g,`
|
|
103
|
+
`).split(`
|
|
104
|
+
`),[E,O]),M=(0,R.useMemo)(()=>on(A,r),[A,r]),ee=(0,R.useMemo)(()=>(a??[]).map(e=>on(A,e.quote)),[A,a]),{primaryHit:N,alsoHits:P}=(0,R.useMemo)(()=>{let e=new Set,t=fn(M,e);return t&&e.add(t.row),{primaryHit:t,alsoHits:ee.map(t=>{let n=fn(t,e);return n&&e.add(n.row),n})}},[M,ee]),F=!!N,te=(0,R.useRef)(null),ne=(0,R.useRef)(null),re=!!o?.trim()||(a??[]).some(e=>!!e.note?.trim()),ie=Et(te,y===`ready`,{gutterReserve:re?218:0}),{zoom:ae,resetForNewContent:I}=ie,oe=(0,R.useRef)(null);(0,R.useEffect)(()=>{let t=oe.current;oe.current={doc:e,page:n},(!t||t.doc!==e||t.page!==n)&&I()},[e,n,I]);let L=Pt(ne,ae,[k,N,P]),se={dims:L.dims,rects:L.rects,alsoRects:L.alsoRects},ce=(0,R.useMemo)(()=>L.dims.w===0?[]:Tt(L.rects,L.alsoRects,i,o,a,ae),[L,o,a,i,ae]),z=`${t}:${n}:${r}`;(0,R.useEffect)(()=>{!s||y!==`ready`||!r.trim()||!u||L.dims.w===0||u({pageImage:``,imgW:Math.max(1,Math.round(L.dims.w)),imgH:Math.max(1,Math.round(L.dims.h)),rects:L.rects,isFigure:!1,seed:z})},[s,y,r,u,L,z]);let le=re?218:0,B=D?`SHEET · ${D}`:void 0;return(0,J.jsxs)(wt,{ariaLabel:`Source page ${n}`,kindLabel:d,color:i,page:n,pageLabel:B,title:f,docName:p?.replace(/\.(csv|tsv|xlsx)$/i,``),pageCount:_,onPageChange:v,zoom:y===`ready`?ie:void 0,zoomVariant:`scale`,onClose:g,closeLabel:`Close source page`,connections:m,onNavigate:h,scrollRef:te,footer:r.trim()?y===`ready`&&F?`The highlighted row is the claim’s verbatim source, on its real page.`:`Quote grounded on this page.`:`Reading the document — the full sheet, exactly as it appears in the file.`,children:[y===`loading`&&(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading page `,n,`…`]}),y===`failed`&&(0,J.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t read this page. The quote is still grounded on page `,n,`.`]}),y===`ready`&&k&&(0,J.jsxs)(`div`,{className:`prism-sheet-unit`,style:{maxWidth:sn+le},children:[(0,J.jsx)(`div`,{className:`prism-sheet-scroll`,children:(0,J.jsxs)(`div`,{className:`prism-sheet-inner`,ref:ne,style:{fontSize:`${cn*ae}px`},children:[(0,J.jsxs)(`table`,{className:`prism-sheet-table`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsx)(`tr`,{children:k.headers.map((e,t)=>(0,J.jsx)(`th`,{className:ln(e)?`prism-sheet-num`:void 0,children:e},t))})}),(0,J.jsx)(`tbody`,{children:k.rows.map((e,t)=>{let n=N!==void 0&&N.row-1===t?N:void 0,r=P.findIndex(e=>e!==void 0&&e.row-1===t),i=r>=0?P[r]:void 0,a=n?`primary`:i?`also-${r}`:void 0,o=n?.cells??i?.cells;return(0,J.jsx)(`tr`,{"data-prism-anchor":a,children:e.map((e,t)=>(0,J.jsx)(`td`,{className:[ln(e)&&`prism-sheet-num`,o&&t>=o[0]&&t<=o[1]&&`prism-sheet-cell-hit`].filter(Boolean).join(` `)||void 0,children:e},t))},t)})})]}),(0,J.jsx)(Z,{geometry:se,zoom:ae,color:i,quote:r,also:a,penOn:s,penColor:c,penAccent:l,seed:z})]})}),k.truncated&&(0,J.jsxs)(`p`,{className:`prism-sheet-truncated`,children:[`Showing the first `,k.rows.length.toLocaleString(),` of`,` `,k.sourceRowCount.toLocaleString(),` rows.`]}),(0,J.jsx)(Q,{entries:ce,dims:L.dims,zoom:ae,seed:z})]})]})}function mn(e){let t=(0,se.c)(27),n,r,i,a;if(t[0]!==e){a=Symbol.for(`react.early_return_sentinel`);bb0:{let{slideImages:t,pages:o,...s}=e;if(r=s,n=r.pdf,t&&t.length>0){a=(0,J.jsx)(Ot,{image:t[r.page-1],page:r.page,quote:r.quote,color:r.color,kindLabel:r.kindLabel,title:r.title,docName:r.docName,connections:r.connections,onNavigate:r.onNavigate,onClose:r.onClose,pageCount:r.pageCount,onPageChange:r.onPageChange});break bb0}if(h(n)){a=(0,J.jsx)(Xt,{doc:n,source:r.source,page:r.page,quote:r.quote,color:r.color,also:r.also,note:r.note,penOn:r.penOn,penColor:r.penColor,penAccent:r.penAccent,onAnnotated:r.onAnnotated,kindLabel:r.kindLabel,title:r.title,docName:r.docName,connections:r.connections,onNavigate:r.onNavigate,onClose:r.onClose,pageCount:r.pageCount,onPageChange:r.onPageChange});break bb0}if(v(n)||S(n)&&!_(n)){a=(0,J.jsx)(Rt,{doc:n,pages:o,source:r.source,page:r.page,quote:r.quote,color:r.color,also:r.also,note:r.note,penOn:r.penOn,penColor:r.penColor,penAccent:r.penAccent,onAnnotated:r.onAnnotated,kindLabel:r.kindLabel,title:r.title,docName:r.docName,connections:r.connections,onNavigate:r.onNavigate,onClose:r.onClose,pageCount:r.pageCount,onPageChange:r.onPageChange});break bb0}i=C(n)||_(n)}t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a}else n=t[1],r=t[2],i=t[3],a=t[4];if(a!==Symbol.for(`react.early_return_sentinel`))return a;if(i){let e;return t[5]!==n||t[6]!==r.also||t[7]!==r.color||t[8]!==r.connections||t[9]!==r.docName||t[10]!==r.kindLabel||t[11]!==r.note||t[12]!==r.onAnnotated||t[13]!==r.onClose||t[14]!==r.onNavigate||t[15]!==r.onPageChange||t[16]!==r.page||t[17]!==r.pageCount||t[18]!==r.penAccent||t[19]!==r.penColor||t[20]!==r.penOn||t[21]!==r.quote||t[22]!==r.source||t[23]!==r.title?(e=(0,J.jsx)(pn,{doc:n,source:r.source,page:r.page,quote:r.quote,color:r.color,also:r.also,note:r.note,penOn:r.penOn,penColor:r.penColor,penAccent:r.penAccent,onAnnotated:r.onAnnotated,kindLabel:r.kindLabel,title:r.title,docName:r.docName,connections:r.connections,onNavigate:r.onNavigate,onClose:r.onClose,pageCount:r.pageCount,onPageChange:r.onPageChange}),t[5]=n,t[6]=r.also,t[7]=r.color,t[8]=r.connections,t[9]=r.docName,t[10]=r.kindLabel,t[11]=r.note,t[12]=r.onAnnotated,t[13]=r.onClose,t[14]=r.onNavigate,t[15]=r.onPageChange,t[16]=r.page,t[17]=r.pageCount,t[18]=r.penAccent,t[19]=r.penColor,t[20]=r.penOn,t[21]=r.quote,t[22]=r.source,t[23]=r.title,t[24]=e):e=t[24],e}let o;return t[25]===r?o=t[26]:(o=(0,J.jsx)(Dt,{...r}),t[25]=r,t[26]=o),o}function hn(e,t,n=t+`s`){return e===1?t:n}function gn(e){let t=e.length;if(t===0)return``;let n=e.filter(e=>ee.includes(e));if(n.length===0){let e=t===1?`holds`:`hold`;return`All ${t} checked ${hn(t,`claim`)} ${e} up against the public record.`}let r=[`contradicted`,`outdated`,`disputed`,`unsupported`],i={contradicted:`contradicted`,outdated:`outdated`,disputed:`disputed`,unsupported:`unsupported`},a=[];for(let e of r){let t=n.filter(t=>t===e).length;t>0&&a.push(`${t} ${i[e]}`)}return`${n.length} of ${t} checked ${hn(t,`claim`)} need a second look: ${a.join(` · `)}.`}var _n=16;function vn(){let e=(0,se.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=(0,R.useRef)(t),[r,i]=(0,R.useState)(0),a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{let t=n.current,r=t.findIndex(t=>t.seed===e.seed);r>=0?t[r]=e:(t.push(e),t.length>_n&&t.shift()),i(t.length)},e[1]=a):a=e[1];let o=a,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{n.current=[],i(0)},e[2]=s):s=e[2];let c=s,l;return e[3]===r?l=e[4]:(l={steps:n,count:r,record:o,clear:c},e[3]=r,e[4]=l),l}var yn=l();i();var bn=c(()=>a(()=>import(`./ShareModal-DWxlrJSz.js`).then(e=>({default:e.ShareModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),xn=bn.Component;function Sn({steps:e,spec:t,pdfs:n,placed:r,verdicts:i}){let[o,c]=(0,R.useState)(!1),[l,d]=(0,R.useState)(null),p=(0,R.useCallback)(async()=>{if(!o){c(!0);try{let[{autoAnnotationSteps:o},{buildAnnotationReel:s}]=await Promise.all([a(()=>import(`./annotationAuto-CDv6Es44.js`),__vite__mapDeps([30,31,32,5,2,7,33,34,35,36,37,38,39,40,41,1,3,4,42])),a(()=>import(`./annotationReel-K2FYv-3B.js`).then(e=>e.t),__vite__mapDeps([43,2,10,1,3,4,5,7,11,12,13])),bn.preload()]),c=e.current,l=c.length>=1?c.slice():await o(t,n,{placed:r,verdicts:i,max:6});if(!l.length){f(`Turn on Annotate, then ask a question or tap a claim to mark it up`,`warn`);return}d(s(l,{fileName:t.fileName}))}catch{f(`Couldn’t build the reel — try again`,`warn`)}finally{c(!1)}}},[o,e,t,n,r,i]);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,disabled:o,onClick:p,title:`Make a shareable reel of the marked-up pages`,...s(bn.preload),children:o?`Preparing…`:`Share reel`}),l&&(0,yn.createPortal)((0,J.jsx)(u,{label:`Annotation reel`,overlay:!0,children:(0,J.jsx)(xn,{script:l,onClose:()=>d(null)})}),document.body)]})}var Cn=e({PrismOverlay:()=>tr});i();var wn=c(()=>a(()=>import(`./PrismAskController-Bt0k9hAA.js`).then(e=>({default:e.PrismAskController})),__vite__mapDeps([44,1,2,3,4,45,34,35,36,37,31,38,39,40,46]))),Tn=c(()=>a(()=>import(`./PrismBriefingPlayer-DzdtnFj4.js`).then(e=>({default:e.PrismBriefingPlayer})),__vite__mapDeps([47,4,2,5,41,1,3,42]))),En=c(()=>a(()=>import(`./CrossExamPanel-CdIYUu-B.js`).then(e=>({default:e.CrossExamPanel})),__vite__mapDeps([48,3,2,1,4,49]))),Dn=c(()=>a(()=>import(`./ForecastPanel-zPUh2ClQ.js`).then(e=>({default:e.ForecastPanel})),__vite__mapDeps([50,3,2,1,4,45,51]))),On=c(()=>a(()=>import(`./LeverPanel-D1SNRGdm.js`).then(e=>({default:e.LeverPanel})),__vite__mapDeps([52,1,2,3,4,53,54]))),kn=c(()=>a(()=>import(`./WhyMachineOverlay-ks9-rRiL.js`).then(e=>({default:e.WhyMachineOverlay})),__vite__mapDeps([55,1,2,3,4,56,45,57,58,39,38,59,60,61]))),An=wn.Component,jn=Tn.Component,Mn=En.Component,Nn=Dn.Component,Pn=On.Component,Fn=kn.Component,In=o(()=>a(()=>import(`./run-DlvA3l28.js`),__vite__mapDeps([62,33,2,34,35,36,37,31,38,63]))),Ln=o(()=>a(()=>import(`./run-Df10YPyB.js`),__vite__mapDeps([64,33,2,34,35,36,37,31,38]))),Rn=o(()=>a(()=>import(`./run-gmqUaxcL.js`),__vite__mapDeps([65,33,2,34,35,36,37,31,39,38,40,63]))),zn=o(()=>a(()=>import(`./model-BFRTN9Eh.js`),__vite__mapDeps([66,34,35,36,37,31,38,63,53]))),Bn=o(()=>a(()=>import(`./explode-BgZIWY9m.js`),__vite__mapDeps([67,34,35,36,37,31,68,69,70,38,71,57,58,39]))),Vn=o(()=>a(()=>import(`./kokoro-P_fkcX-A.js`).then(e=>e.a),__vite__mapDeps([22,2,17,1,3,18,4,19,5,6,7,8,20,21,13]))),Hn=null;function Un(){return Hn=Vn()}function Wn(){Hn&&Hn.then(e=>e.cancelKokoro(),()=>void 0)}function Gn(e){Un().then(t=>t.speakKokoroResult(e,`mavea`))}var Kn={forecast:{color:`var(--presence)`,label:`FORECAST`},stat:{color:`var(--insight)`,label:`STAT`},finding:{color:`var(--insight-soft)`,label:`FINDING`},risk:{color:`var(--danger)`,label:`RISK`},definition:{color:`var(--text-muted)`,label:`DEFINITION`},method:{color:`var(--warning)`,label:`METHOD`},diagram:{color:`var(--presence)`,label:`FIGURE`}},qn=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`],Jn={contradicts:`contradicts`,"in-tension":`in tension`,agrees:`agrees`},Yn=[{kind:`forecast`,desc:`what it predicts`},{kind:`finding`,desc:`what it observed`},{kind:`definition`,desc:`its terms`},{kind:`method`,desc:`how it knows`},{kind:`stat`,desc:`a hard number`},{kind:`risk`,desc:`the caveats`},{kind:`diagram`,desc:`a figure or chart`}],Xn=[{relation:`agrees`,name:`Supports`,desc:`one claim props up another`},{relation:`contradicts`,name:`Contradicts`,desc:`two passages disagree`},{relation:`in-tension`,name:`In tension`,desc:`a softer pull, not a clash`}],Zn=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--insight-soft)`];function Qn(e,t){let n=t?`another document`:`another passage`;return e===`agrees`?`agrees with ${n}`:e===`in-tension`?`in tension with ${n}`:`contradicts ${n}`}function $n(e){return e?e.relation:`anchored`}function er(e){return e?e.relation===`agrees`?`agrees · ready`:e.relation===`in-tension`?`in tension`:`in contradiction`:`anchored · ready`}function tr({pdf:e,cfg:t,search:n,onClose:r,world:i,corpusChrome:a,autoBriefing:o}){let c=(0,R.useMemo)(()=>Array.isArray(e)?e:[e],[e]),l=c.length>1,[f,m]=(0,R.useState)(!1),h=at(t),{phase:g,spec:_,corpus:v,proposed:y,error:b}=i??h,{explode:x}=h,[S,C]=(0,R.useState)(null),[w,T]=(0,R.useState)(null),[E,D]=(0,R.useState)(null),[O,k]=(0,R.useState)(()=>new Set),[A,j]=(0,R.useState)(!1),[ee,P]=(0,R.useState)(!1),[te,ie]=(0,R.useState)(null),[L,se]=(0,R.useState)(0),[ce,z]=(0,R.useState)(null),[le,B]=(0,R.useState)(()=>new Set),V=(0,R.useRef)(()=>{}),[H,ue]=(0,R.useState)(null),[de,U]=(0,R.useState)(!1),[fe,pe]=(0,R.useState)(!1),[W,me]=(0,R.useState)(!1),he=(0,R.useRef)(null),[ge,_e]=(0,R.useState)(null),[G,ve]=(0,R.useState)(!1),[K,q]=(0,R.useState)(!1),[ye,be]=(0,R.useState)(!1),[xe,Se]=(0,R.useState)(null),Ce=(0,R.useRef)(null),[we,Te]=(0,R.useState)(null),[Ee,De]=(0,R.useState)(!1),[Oe,ke]=(0,R.useState)(!1),[Ae,je]=(0,R.useState)(null),Me=(0,R.useRef)(null),[Ne,Pe]=(0,R.useState)(null),[Fe,Ie]=(0,R.useState)(!1),[Le,Re]=(0,R.useState)(!1),ze=(0,R.useRef)(!1),Be=(0,R.useRef)(null),[Ve,He]=(0,R.useState)(`map`),[Ue,We]=(0,R.useState)(null),[Ge,Ke]=(0,R.useState)(null),qe=(0,R.useRef)(null),[Je,Ye]=(0,R.useState)(!1),[Xe,Ze]=(0,R.useState)(44),Qe=(0,R.useRef)(null),$e=(0,R.useRef)(!1),et=(0,R.useRef)(null);d(et);let[tt,nt]=(0,R.useState)(()=>new Map),[rt,it]=(0,R.useState)(!1),[ot,st]=(0,R.useState)(o===!0),[ct,ut]=(0,R.useState)(!1),[dt,ft]=(0,R.useState)(``),{steps:mt,record:ht,clear:gt}=vn(),_t=(0,R.useCallback)(e=>{$e.current=!0,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[]),vt=(0,R.useCallback)(e=>{if(!$e.current||!Qe.current)return;let t=Qe.current.getBoundingClientRect(),n=(t.right-e.clientX)/t.width*100;Ze(Math.max(24,Math.min(100,n)))},[]),yt=(0,R.useCallback)(e=>{$e.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),bt=(0,R.useRef)(!1);(0,R.useEffect)(()=>{i||bt.current||(bt.current=!0,x(c))},[c,x]),(0,R.useEffect)(()=>()=>void N(),[]),(0,R.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(ce?(Wn(),z(null),B(new Set),C(null),V.current()):w?T(null):E?D(null):S?C(null):r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ce,w,E,S,r]);let[St,Ct]=(0,R.useState)(null);(0,R.useEffect)(()=>{if(!_||_.claims.length<48)return;let e=!0;return xt(_,qn).then(t=>{e&&Ct({spec:_,result:t})}),()=>{e=!1}},[_]);let Y=(0,R.useMemo)(()=>_?_.claims.length<48?pt(_,qn):St?.spec===_?St.result:null:null,[St,_]),X=g===`settled`&&!!Y,wt=(0,R.useRef)(null),Tt=(0,R.useMemo)(()=>{if(!Y||Y.claims.length===0)return;let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i of Y.claims)e=Math.min(e,i.x),t=Math.min(t,i.y),n=Math.max(n,i.x+200),r=Math.max(r,i.y+96);for(let i of Y.regions)e=Math.min(e,i.cx),t=Math.min(t,i.cy),n=Math.max(n,i.cx),r=Math.max(r,i.cy);return{x:e-56,y:t-56,w:n-e+112,h:r-t+112}},[Y]),Z=lt(wt,Y?.width??1,Y?.height??1,Tt,{wheelZoom:X}),Q=(0,R.useMemo)(()=>{let e=new Map;if(Y)for(let t of Y.claims)e.set(t.id,t);return e},[Y]),Et=(0,R.useMemo)(()=>{let e=new Map,t=(t,n)=>{(e.get(t)??e.set(t,new Set).get(t)).add(n),(e.get(n)??e.set(n,new Set).get(n)).add(t)};if(Y)for(let e of Y.links)t(e.a,e.b);if(_)for(let e of _.threads)t(e.a,e.b);let n=new Map;for(let[t,r]of e)n.set(t,[...r].map(e=>Q.get(e)).filter(e=>!!e).sort((e,t)=>e.page-t.page||e.title.localeCompare(t.title)).map(e=>e.id));return n},[Y,_,Q]),Dt=S?Q.get(S)??null:null,Ot=(0,R.useMemo)(()=>S?Et.get(S)??[]:[],[S,Et]),kt=_?.threads.filter(e=>e.crossDoc).length??0,[At,jt]=(0,R.useState)(null),Mt=(0,R.useMemo)(()=>{let e=new Set;return a?.contradictions.forEach(t=>{e.add(t.a),e.add(t.b)}),e},[a]),Nt=(0,R.useMemo)(()=>{let e=new Set;return a?.consensus.forEach(t=>t.memberClaimIds.forEach(t=>e.add(t))),e},[a]),Pt=a?.lens??`all`;(0,R.useEffect)(()=>{if(!a||!X)return;let e=Pt===`contradictions`?a.contradictions:Pt===`gaps`?a.gaps:Pt===`consensus`?a.consensus:[];if(Pt===`all`||e.length===0){Z.fit();return}let t=e.map(e=>e.x),n=e.map(e=>e.y);Z.frame({x:Math.min(...t)-200,y:Math.min(...n)-200,w:Math.max(...t)-Math.min(...t)+400,h:Math.max(...n)-Math.min(...n)+400},{maxScale:1.1})},[Pt,X]);let Ft=g===`igniting`?`EXTRACTING`:g===`blooming`?`MAPPING`:g===`settled`?`SETTLED`:g===`error`?`COULDN’T MAP`:`READY`,It=_?.claims.length??0,Lt=(0,R.useCallback)(()=>{C(null),T(null),D(null),k(new Set),Wn(),z(null),B(new Set),he.current?.abort(),ue(null),pe(!1),U(!1),Ce.current?.abort(),_e(null),q(!1),ve(!1),Se(null),Me.current?.abort(),Te(null),ke(!1),De(!1),je(null),Be.current?.abort(),Pe(null),Re(!1),Ie(!1),ze.current=!1,qe.current?.abort(),We(null),Ke(null),He(`map`),x(c)},[x,c]),Rt=(0,R.useRef)(null),{frame:zt,fit:Bt}=Z;V.current=Bt,(0,R.useEffect)(()=>{if(!X||!Y||!_||Rt.current===_)return;Rt.current=_;let e=Y.claims.filter(e=>e.role===`load-bearing`);if(e.length===0||e.length===Y.claims.length)return;let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);let a=96*1.3;zt({x:t-200,y:n-a,w:r-t+400,h:i-n+a*2},{maxScale:1.2})},[X,Y,_,zt]);let Vt=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!X||!_||!t||Vt.current===_||(Vt.current=_,nt(new Map),it(!1),!n?.enabled)||_.claims.filter(e=>e.role===`load-bearing`).length===0)return;let e=new AbortController;return it(!0),I(_.claims,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal}).then(t=>{e.signal.aborted||nt(new Map(t.map(e=>[e.claimId,e])))}).catch(()=>{}).finally(()=>{e.signal.aborted||it(!1)}),()=>e.abort()},[X,_,t,n]);let Ht=(0,R.useMemo)(()=>[...tt.values()].map(e=>e.verdict),[tt]),Ut=(0,R.useMemo)(()=>gn(Ht),[Ht]),Wt=(0,R.useCallback)(e=>{let t=(_?.documents[e]?.fileName??`Doc ${e+1}`).replace(/\.[^.]+$/,``).trim();return t.length>18?t.slice(0,17).trimEnd()+`…`:t||`Doc ${e+1}`},[_]),Gt=(0,R.useCallback)((e,t)=>{if(!Y)return;let n=Y.claims.filter(n=>n.source===e&&n.page===t);if(n.length===0){let r=Y.claims.filter(t=>t.source===e);if(r.length===0)return;let i=r.reduce((e,n)=>Math.abs(n.page-t)<Math.abs(e.page-t)?n:e);n=r.filter(e=>e.page===i.page)}let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let e of n)r=Math.min(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);zt({x:r-200,y:i-96*1.3,w:a-r+400,h:o-i+96*2.6},{maxScale:1.4})},[Y,zt]),Kt=(0,R.useCallback)(e=>{T(null),C(null),ft(``),D(e),Gt(e.doc,e.page)},[Gt]),qt=(0,R.useCallback)(e=>{k(new Set(e.spans.map(e=>`${e.doc}:${e.page}`))),e.spans.length>0&&Kt(e.spans[0]),ft(e.text)},[Kt]),Jt=(0,R.useMemo)(()=>!X||!t||!v?null:{corpus:v,cfg:t,multiDoc:l,...n?{search:n}:{}},[X,t,v,l,n]);(0,R.useEffect)(()=>()=>qe.current?.abort(),[]);let Yt=(0,R.useCallback)(()=>{if(!t||!v)return;qe.current?.abort();let e=new AbortController;qe.current=e,Ke(`why`);let n=v.flat().join(`
|
|
105
|
+
`).slice(0,8e3),r=l?`Why — the argument these documents make`:`Why does "${c[0].name.replace(/\.[a-z0-9]+$/i,``)}" reach its conclusion?`;Bn().then(({explodeWhy:i})=>i(r,n,t,e.signal)).then(t=>{e.signal.aborted||We(t)}).finally(()=>{e.signal.aborted||Ke(null)})},[t,v,l,c]);(0,R.useEffect)(()=>{se(e=>e+1),j(!1),P(!1),ie(null),D(null),ft(``),jt(null),k(new Set),Wn(),gt(),z(null),B(new Set),he.current?.abort(),ue(null),pe(!1),U(!1),Ce.current?.abort(),_e(null),q(!1),ve(!1),Se(null),Me.current?.abort(),Te(null),ke(!1),De(!1),je(null),Be.current?.abort(),Pe(null),Re(!1),Ie(!1),ze.current=!1,qe.current?.abort(),We(null),Ke(null)},[_,gt]);let $=(0,R.useMemo)(()=>{if(!X)return null;if(w)return{source:w.doc,page:w.page,quote:``,color:`var(--presence)`,kindLabel:`PAGE`,title:`Reading the document`,isFigure:!1,connections:[],fromAsk:!1,browse:!0,penExplain:``,penColor:oe};if(E)return{source:E.doc,page:E.page,quote:E.quote,color:`var(--presence)`,kindLabel:`ANSWER`,title:`From your question`,isFigure:!1,connections:[],fromAsk:!0,penExplain:dt||`“${E.quote.slice(0,160)}”`,penColor:oe};if(Dt){let e=(Y?.claims??[]).filter(e=>e.id!==Dt.id&&e.source===Dt.source&&e.page===Dt.page&&e.quote.trim().length>0).slice(0,6).map(e=>({quote:e.quote,color:Kn[e.kind].color,note:e.title}));return{source:Dt.source,page:Dt.page,quote:Dt.quote,color:Kn[Dt.kind].color,kindLabel:Kn[Dt.kind].label,title:Dt.title,isFigure:Dt.kind===`diagram`,...Dt.box?{box:Dt.box}:{},also:e,connections:Ot.map(e=>({id:e,title:Q.get(e)?.title??``})),fromAsk:!1,penExplain:ae(Dt),penColor:M(Dt.kind),...ne(Dt)?{penAccent:ne(Dt)}:{}}}return null},[X,w,E,dt,Dt,Ot,Q,Y]),Xt=X&&(!!$||!!At),Zt=(0,R.useCallback)(e=>{if(!$)return;let t={...e,color:$.penColor,title:$.title,explanation:$.penExplain,...$.penAccent?{accent:$.penAccent}:{}};ht(t),ct&&t.explanation&&(Wn(),Gn(t.explanation))},[$,ct,ht]),Qt=!!ce,$t=(0,R.useCallback)(e=>{let t=e.map(e=>Q.get(e)).filter(e=>!!e);if(t.length===0)return;let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let e of t)n=Math.min(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.x),a=Math.max(a,e.y);zt({x:n-200,y:r-96*1.4,w:i-n+400,h:a-r+96*2.8},{maxScale:t.length>1?1.05:1.5})},[Q,zt]),en=(0,R.useMemo)(()=>new Map([...tt].map(([e,t])=>[e,t.verdict])),[tt]),tn=(0,R.useCallback)(e=>{B(new Set(e.claimIds)),$t(e.claimIds),(ot||o)&&C(e.claimIds[0]??null)},[ot,o,$t]),nn=(0,R.useCallback)(()=>{Wn(),z(null),B(new Set),C(null),Bt()},[Bt]),rn=(0,R.useCallback)(e=>{e!==`recon`&&(he.current?.abort(),U(!1),me(!1)),e!==`xe`&&(Ce.current?.abort(),ve(!1),be(!1)),e!==`fa`&&(Me.current?.abort(),De(!1)),e!==`lv`&&(Be.current?.abort(),Ie(!1))},[]),an=(0,R.useCallback)(()=>{if(!Y||!_)return;let e=re(Y.claims,_.threads,en);e.length!==0&&(Wn(),rn(`none`),C(null),D(null),j(!1),pe(!1),q(!1),ke(!1),Re(!1),(ot||o)&&Ze(e=>Math.max(e,60)),z(e))},[Y,_,en,ot,o,rn]),on=(0,R.useRef)(!1),sn=(0,R.useRef)(an);sn.current=an;let cn=(0,R.useRef)(null);(0,R.useEffect)(()=>{!o||on.current||g!==`settled`||!Y||!_||(on.current=!0,cn.current=setTimeout(()=>sn.current(),800))},[o,g,Y,_]),(0,R.useEffect)(()=>()=>{cn.current!==null&&clearTimeout(cn.current)},[]),(0,R.useEffect)(()=>()=>he.current?.abort(),[]);let ln=(0,R.useMemo)(()=>{let e=new Set;if(H)for(let t of H)for(let n of t.claimIds)e.add(n);return e},[H]),un=(0,R.useCallback)(()=>{if(fe){pe(!1);return}if(rn(`recon`),q(!1),ke(!1),Re(!1),j(!1),H){pe(!0);return}if(!_||!v||!t)return;he.current?.abort();let e=new AbortController;he.current=e,U(!0),me(!1);let n=_.claims.map(e=>({id:e.id,page:e.page,quote:e.quote}));In().then(({runReconcile:r})=>r(n,v,t,e.signal)).then(t=>{if(!e.signal.aborted){if(!t){me(!0);return}ue(t),pe(!0)}}).catch(()=>{e.signal.aborted||me(!0)}).finally(()=>{e.signal.aborted||U(!1)})},[fe,H,_,v,t,rn]);(0,R.useEffect)(()=>()=>Ce.current?.abort(),[]);let dn=(0,R.useMemo)(()=>{let e=new Set;if(ge)for(let t of ge)e.add(t.claimId);return e},[ge]),fn=(0,R.useMemo)(()=>{let e=new Set;if(ge)for(let t of ge)t.status===`open`&&e.add(t.claimId);return e},[ge]),pn=(0,R.useCallback)(e=>{Se(e.id),Kt({doc:e.doc,page:e.anchorPage,quote:e.anchorQuote})},[Kt]),hn=(0,R.useCallback)(()=>{if(K&&!ye){q(!1);return}if(rn(`xe`),pe(!1),ke(!1),Re(!1),j(!1),ge){q(!0);return}if(!_||!v||!t)return;Ce.current?.abort();let e=new AbortController;Ce.current=e,ve(!0),q(!0),be(!1);let n=_.claims.filter(e=>e.role===`load-bearing`).map(e=>({id:e.id,source:e.source,page:e.page,quote:e.quote,title:e.title}));Ln().then(({runCrossExam:r})=>r(n,v,t,e.signal)).then(t=>{if(!e.signal.aborted){if(!t){be(!0);return}_e(t)}}).catch(()=>{e.signal.aborted||be(!0)}).finally(()=>{e.signal.aborted||ve(!1)})},[K,ye,ge,_,v,t,rn]);(0,R.useEffect)(()=>()=>Me.current?.abort(),[]);let _n=(0,R.useMemo)(()=>{let e=new Set;if(we)for(let t of we)e.add(t.claimId);return e},[we]),yn=(0,R.useCallback)(e=>{je(e.claimId);let t=Q.get(e.claimId);t&&Kt({doc:t.source,page:e.page,quote:e.predicted})},[Q,Kt]),bn=(0,R.useCallback)(()=>{if(Oe){ke(!1);return}if(rn(`fa`),pe(!1),q(!1),Re(!1),j(!1),we){ke(!0);return}if(!_||!t||!n?.enabled)return;Me.current?.abort();let e=new AbortController;Me.current=e,De(!0),ke(!0);let r=_.claims.filter(e=>e.kind===`forecast`).map(e=>({id:e.id,page:e.page,quote:e.quote}));Rn().then(({runAutopsy:i})=>i(r,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal})).then(t=>{e.signal.aborted||Te(t)}).catch(()=>{e.signal.aborted||Te([])}).finally(()=>{e.signal.aborted||De(!1)})},[Oe,we,_,t,n,rn]);(0,R.useEffect)(()=>()=>Be.current?.abort(),[]);let xn=(0,R.useMemo)(()=>{let e=new Set;if(Ne)for(let t of Ne.nodes)e.add(`${t.doc}:${t.page}`);return e},[Ne]),Cn=(0,R.useCallback)(e=>{Kt({doc:e.doc,page:e.page,quote:e.quote})},[Kt]),Vn=(0,R.useCallback)(()=>{if(Le){Re(!1);return}if(rn(`lv`),pe(!1),q(!1),ke(!1),j(!1),ze.current){Re(!0);return}if(!_||!v||!t)return;Be.current?.abort();let e=new AbortController;Be.current=e,ze.current=!0,Ie(!0),Re(!0);let n=_.claims.map(e=>({quote:e.quote,page:e.page,doc:e.source}));zn().then(({runLevers:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||Pe(t)}).catch(()=>{e.signal.aborted||Pe(null)}).finally(()=>{e.signal.aborted||Ie(!1)})},[Le,_,v,t,rn]);return(0,J.jsxs)(`div`,{className:`prism-scrim`,"data-expanded":f?`true`:void 0,onClick:r,role:`button`,tabIndex:0,"aria-label":`Close Prism`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},children:[(0,J.jsxs)(`section`,{className:`prism-panel`,role:`dialog`,"aria-label":`Prism`,"data-phase":g,ref:et,onClick:e=>e.stopPropagation(),children:[(0,J.jsxs)(`header`,{className:`prism-head`,children:[(0,J.jsxs)(`div`,{className:`prism-file`,children:[(0,J.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,J.jsx)(`path`,{d:`M6 2h8l4 4v16H6z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,J.jsx)(`path`,{d:`M14 2v4h4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`})]}),(0,J.jsx)(`span`,{className:`prism-file-name`,children:l?`${c.length} documents`:c[0].name}),_&&(0,J.jsxs)(`span`,{className:`prism-file-pages`,children:[`· `,_.pageCount,` pages`]})]}),(0,J.jsxs)(`div`,{className:`prism-head-right`,children:[X&&a&&(0,J.jsx)(`div`,{className:`syn-lenses`,role:`tablist`,"aria-label":`Lens`,children:[[`all`,`All`,0],[`contradictions`,`Contradictions`,a.counts.contradictions],[`gaps`,`Gaps`,a.counts.gaps],[`consensus`,`Consensus`,a.counts.consensus]].map(([e,t,n])=>(0,J.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":a.lens===e,className:`syn-lens`+(a.lens===e?` is-active`:``),onClick:()=>{jt(null),a.setLens(e)},children:[t,n>0&&(0,J.jsx)(`span`,{className:`syn-lens-n`,children:n})]},e))}),X&&y>0&&(0,J.jsxs)(`span`,{className:`prism-counter`,title:`Every shown claim is a verbatim quote on its real page. Anything that couldn't be cited was dropped before it rendered.`,children:[(0,J.jsx)(`strong`,{children:y}),` read · `,(0,J.jsx)(`strong`,{children:It}),` grounded`,y>It?(0,J.jsxs)(J.Fragment,{children:[` `,`· `,(0,J.jsx)(`strong`,{children:y-It}),` dropped`]}):null]}),(0,J.jsxs)(`span`,{className:`prism-phase`,"data-active":g===`igniting`||g===`blooming`,title:Ft,children:[(0,J.jsx)(`span`,{className:`prism-phase-dot`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`prism-phase-label`,children:Ft})]}),X&&(0,J.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:()=>{D(null),C(null),T({doc:0,page:1})},"aria-label":`Read the whole document, page by page`,title:`Read the whole document, page by page`,children:[`▤`,(0,J.jsx)(`span`,{className:`prism-replay-label`,children:` Read document`})]}),X&&(0,J.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:Lt,"aria-label":`Replay — re-map the document from scratch`,title:`Replay — re-map the document from scratch`,children:[`↻`,(0,J.jsx)(`span`,{className:`prism-replay-label`,children:` Replay`})]}),(0,J.jsx)(`button`,{type:`button`,className:`prism-close`,onClick:()=>m(e=>!e),"aria-label":f?`Exit full screen`:`Expand to full screen`,title:f?`Exit full screen`:`Full screen`,children:f?`⤡`:`⤢`}),(0,J.jsx)(`button`,{type:`button`,className:`prism-close`,onClick:r,"aria-label":`Close Prism`,children:`✕`})]})]}),l&&X&&_&&(0,J.jsxs)(`div`,{className:`prism-legend`,role:`list`,"aria-label":`Documents`,children:[_.documents.map((e,t)=>{let n=_.claims.filter(e=>e.source===t).length;return(0,J.jsxs)(`span`,{className:`prism-legend-item`,role:`listitem`,children:[(0,J.jsx)(`span`,{className:`prism-legend-swatch`,style:{background:Zn[t%Zn.length]},"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`prism-legend-name`,children:e.fileName.replace(/\.pdf$/i,``)}),(0,J.jsx)(`span`,{className:`prism-legend-count`,children:n})]},t)}),kt>0&&(0,J.jsxs)(`span`,{className:`prism-legend-cross`,children:[kt,` cross-document link`,kt===1?``:`s`]})]}),(0,J.jsxs)(`div`,{className:`prism-split`,"data-split":Xt?`true`:void 0,"data-pdfonly":Xt&&Xe>=99?`true`:void 0,ref:Qe,children:[(0,J.jsxs)(`div`,{className:`prism-stage`+(Z.panning?` is-panning`:``),ref:wt,onPointerDown:X?Z.onPointerDown:void 0,onPointerMove:X?Z.onPointerMove:void 0,onPointerUp:X?Z.onPointerUp:void 0,onPointerCancel:X?Z.onPointerUp:void 0,onClickCapture:e=>{Z.movedRef.current&&(e.stopPropagation(),e.preventDefault(),Z.movedRef.current=!1)},children:[(g===`idle`||g===`igniting`)&&(0,J.jsxs)(`div`,{className:`prism-doc`,"data-igniting":g===`igniting`,"aria-hidden":`true`,children:[(0,J.jsxs)(`div`,{className:`prism-doc-page`,children:[(0,J.jsx)(`span`,{className:`prism-doc-eyebrow`,children:l?`DOCUMENTS`:`DOCUMENT`}),(0,J.jsx)(`span`,{className:`prism-doc-title`,children:l?`${c.length} documents`:c[0].name.replace(/\.pdf$/i,``)}),(0,J.jsx)(`div`,{className:`prism-doc-lines`,children:[92,84,88,70,90,60,80,66].map((e,t)=>(0,J.jsx)(`span`,{className:`prism-doc-line`,style:{width:`${e}%`}},t))})]}),g===`igniting`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`prism-shock`}),nr.map((e,t)=>(0,J.jsx)(`span`,{className:`prism-shard`,style:{"--sx":e.x,"--sy":e.y,"--sr":e.r,width:e.w,height:e.h,animationDelay:`${e.d}ms`}},t))]})]}),g===`blooming`&&(0,J.jsxs)(`div`,{className:`prism-blooming`,children:[(0,J.jsx)(`span`,{className:`prism-bloom-orb`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`prism-bloom-label`,children:`Reading the document — mapping its claims…`})]}),g===`error`&&(0,J.jsxs)(`div`,{className:`prism-error`,role:`alert`,children:[(0,J.jsx)(`p`,{className:`prism-error-msg`,children:b}),(0,J.jsx)(`button`,{type:`button`,className:`prism-error-retry`,onClick:Lt,children:`Try again`})]}),X&&Y&&(0,J.jsxs)(`div`,{className:`prism-world`,"data-briefing":Qt?`true`:void 0,ref:Z.worldRef,style:{width:Y.width,height:Y.height},children:[Y.regions.map(e=>(0,J.jsxs)(`div`,{className:`prism-region`,style:{left:e.cx,top:e.cy,"--region-color":e.color},children:[(0,J.jsx)(`span`,{className:`prism-region-glow`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`prism-region-name`,children:e.name})]},e.name)),Y.links.length>0&&(0,J.jsx)(`svg`,{className:`prism-links`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:Y.links.map((e,t)=>{let n=Q.get(e.a),r=Q.get(e.b);return!n||!r?null:(0,J.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y},t)})}),_&&_.threads.length>0&&(0,J.jsx)(`svg`,{className:`prism-threads`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:_.threads.map((e,t)=>{let n=Q.get(e.a),r=Q.get(e.b);if(!n||!r)return null;let i=(n.x+r.x)/2,a=(n.y+r.y)/2-28;return(0,J.jsxs)(`g`,{className:`prism-thread`+(Ve===`map`?``:` prism-thread-hot`),"data-relation":e.relation,"data-cross":e.crossDoc?`true`:void 0,children:[(0,J.jsx)(`path`,{d:`M ${n.x} ${n.y} Q ${i} ${a} ${r.x} ${r.y}`,fill:`none`}),(0,J.jsx)(`foreignObject`,{x:i-90,y:a-12,width:`180`,height:`22`,children:(0,J.jsxs)(`span`,{className:`prism-thread-label`,children:[Jn[e.relation],e.crossDoc?` across docs`:` · p.${n.page}↔p.${r.page}`]})})]},t)})}),fe&&H&&H.length>0&&(0,J.jsx)(`svg`,{className:`prism-threads prism-recon`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:H.map(e=>{if(e.a===e.b)return null;let t=Q.get(e.a),n=Q.get(e.b);if(!t||!n)return null;let r=(t.x+n.x)/2,i=(t.y+n.y)/2-28;return(0,J.jsxs)(`g`,{className:`prism-thread prism-thread-hot`,"data-relation":`contradicts`,children:[(0,J.jsx)(`path`,{d:`M ${t.x} ${t.y} Q ${r} ${i} ${n.x} ${n.y}`,fill:`none`}),(0,J.jsx)(`foreignObject`,{x:r-90,y:i-16,width:`180`,height:`30`,children:(0,J.jsxs)(`span`,{className:`prism-thread-label prism-recon-label`,children:[e.stated,` ≠ `,e.computed]})})]},e.id)})}),Y.claims.map(e=>{let t=Kn[e.kind],n=S===e.id,r=tt.get(e.id),i=_?.threads.find(t=>t.a===e.id||t.b===e.id),o=r?.citation?p(r.citation.url):null,s=!!i,c=i?i.relation===`agrees`?`var(--insight)`:i.relation===`in-tension`?`var(--warning)`:`var(--danger)`:t.color,l=Ve===`contra`&&!s,u=O.has(`${e.source}:${e.page}`),d=!!E&&O.size>0&&!u,f=le.has(e.id),m=Qt&&le.size>0&&!f,h=fe&&ln.has(e.id),g=fe&&ln.size>0&&!h,v=K&&fn.has(e.id),y=K&&fn.size>0&&!dn.has(e.id),b=Oe&&_n.has(e.id),x=Oe&&_n.size>0&&!b,w=Le&&xn.has(`${e.source}:${e.page}`),k=Le&&xn.size>0&&!w,A=!!a&&(Pt===`gaps`?!0:Pt===`contradictions`?!Mt.has(e.id):Pt===`consensus`&&!Nt.has(e.id)),j=()=>{Qt||(T(null),D(null),jt(null),C(n?null:e.id))};return(0,J.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-pressed":n,className:`prism-claim`+(n?` is-open`:``)+(s?` is-flagged`:``)+(u||f||h||b||w?` is-cited`:``)+(v?` is-objected`:``)+(l||d||m||g||y||x||k||A?` is-dim`:``),"data-role":e.role,style:{left:e.x,top:e.y,"--kind-color":c},onClick:j,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),j())},children:[(0,J.jsxs)(`span`,{className:`prism-claim-head`,children:[(0,J.jsxs)(`span`,{className:`prism-claim-kind`,children:[(0,J.jsx)(`span`,{className:`prism-claim-dot`,"aria-hidden":`true`}),t.label]}),e.role===`load-bearing`&&(0,J.jsx)(`span`,{className:`prism-claim-key`,title:`Load-bearing — the document leans on this`,children:`★ KEY`}),(0,J.jsxs)(`span`,{className:`prism-claim-page`,children:[`p.`,e.page]})]}),(0,J.jsx)(`span`,{className:`prism-claim-title`,children:e.title}),r&&(0,J.jsxs)(`span`,{className:`prism-seal`,"data-verdict":r.verdict,style:{"--seal-color":F[r.verdict].token},children:[(0,J.jsx)(`span`,{className:`prism-seal-dot`,"aria-hidden":`true`}),F[r.verdict].label]}),n&&(0,J.jsxs)(`span`,{className:`prism-claim-body`,children:[(0,J.jsxs)(`span`,{className:`prism-claim-quote`,children:[`“`,e.quote,`”`]}),i&&(0,J.jsxs)(`span`,{className:`prism-claim-flag`,children:[Qn(i.relation,i.crossDoc),` — follow the thread`]}),r&&(0,J.jsxs)(`span`,{className:`prism-claim-verdict`,"data-verdict":r.verdict,style:{"--seal-color":F[r.verdict].token},children:[(0,J.jsxs)(`span`,{className:`prism-verdict-head`,children:[(0,J.jsx)(`span`,{className:`prism-verdict-label`,children:F[r.verdict].label}),(0,J.jsx)(`span`,{className:`prism-verdict-note`,children:r.note})]}),r.citation&&o&&(0,J.jsxs)(`a`,{className:`prism-verdict-cite`,href:o,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),children:[`“`,r.citation.quote,`”`,(0,J.jsxs)(`span`,{className:`prism-verdict-host`,children:[`— `,r.citation.host,r.citation.date?` · ${r.citation.date}`:``]})]})]})]}),!n&&(0,J.jsx)(`span`,{className:`prism-claim-state`,"data-state":$n(i),children:er(i)})]},e.id)}),a&&(0,J.jsxs)(J.Fragment,{children:[a.consensus.map(e=>(0,J.jsx)(`button`,{type:`button`,className:`syn-consensus`+(Pt!==`all`&&Pt!==`consensus`?` is-dim`:``),style:{left:e.x-e.r,top:e.y-e.r,width:e.r*2,height:e.r*2},onClick:()=>{Z.movedRef.current||(C(null),jt({kind:`consensus`,id:e.id}))},children:(0,J.jsxs)(`span`,{className:`syn-consensus-badge`,children:[e.sourceCount,` of `,e.corpusSize,` agree`]})},e.id)),a.contradictions.map(e=>{let t=Pt!==`all`&&Pt!==`contradictions`;return(0,J.jsxs)(`button`,{type:`button`,className:`syn-obj syn-obj-`+e.relation+(t?` is-dim`:``),style:{left:e.x,top:e.y},onClick:()=>{Z.movedRef.current||(C(null),jt({kind:`contradiction`,id:e.id}))},children:[(0,J.jsx)(`span`,{className:`syn-obj-dot`,"aria-hidden":`true`}),e.label]},e.id)}),a.gaps.map(e=>(0,J.jsx)(`button`,{type:`button`,className:`syn-obj syn-gap`+(Pt!==`all`&&Pt!==`gaps`?` is-dim`:``),style:{left:e.x,top:e.y},onClick:()=>{Z.movedRef.current||(C(null),jt({kind:`gap`,id:e.id}))},children:e.label},e.id))]})]}),X&&(0,J.jsxs)(`div`,{className:`prism-zoom`,"aria-label":`Zoom the map`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>Z.zoomBy(1.25),"aria-label":`Zoom in`,children:`+`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>Z.zoomBy(1/1.25),"aria-label":`Zoom out`,children:`−`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>Z.fit(),"aria-label":`Fit the whole map`,title:`Fit`,children:`⊡`})]}),X&&ee&&Jt&&(0,J.jsx)(u,{label:`Document ask`,children:(0,J.jsx)(An,{open:A&&!Qt&&!K&&!Oe&&!Le,ctx:Jt,seed:te,onAnswer:qt,onFocusSpan:Kt,activeSpan:E,multiDoc:l,docLabel:Wt,onClose:()=>j(!1)},L)}),X&&ce&&(0,J.jsx)(u,{label:`Briefing`,children:(0,J.jsx)(jn,{beats:ce,onBeat:tn,onExit:nn})}),X&&K&&!Qt&&(0,J.jsx)(u,{label:`Cross-examination`,children:(0,J.jsx)(Mn,{objections:ge??[],busy:G,failed:ye,onFocusObjection:pn,activeId:xe,multiDoc:l,docLabel:Wt,onClose:()=>q(!1)})}),X&&Oe&&!Qt&&(0,J.jsx)(u,{label:`Forecast review`,children:(0,J.jsx)(Nn,{grades:we??[],busy:Ee,onFocusForecast:yn,activeId:Ae,onClose:()=>ke(!1)})}),X&&Le&&!Qt&&(0,J.jsx)(u,{label:`Live levers`,children:(0,J.jsx)(Pn,{model:Ne,busy:Fe,onFocusNode:Cn,onClose:()=>Re(!1)})})]}),Xt&&(0,J.jsx)(`div`,{className:`prism-divider`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the map and the source page`,"aria-valuenow":Math.round(Xe),"aria-valuemin":24,"aria-valuemax":100,tabIndex:0,onPointerDown:_t,onPointerMove:vt,onPointerUp:yt,onPointerCancel:yt,onKeyDown:e=>{e.key===`ArrowLeft`?Ze(e=>Math.min(100,e+4)):e.key===`ArrowRight`&&Ze(e=>Math.max(24,e-4))},children:(0,J.jsx)(`span`,{className:`prism-divider-grip`,"aria-hidden":`true`})}),$&&X&&c[$.source]&&(()=>{let e=c[$.source],t=_?.documents[$.source]?.slideImages,n=_?.documents[$.source]?.pageCount??1;return(0,J.jsxs)(`div`,{className:`prism-page-wrap`,style:{"--pdf-pct":`${Xe}%`},children:[(0,J.jsx)(mn,{pdf:e,slideImages:t,pages:v?.[$.source],source:$.source,page:$.page,quote:$.quote,color:$.color,also:$.also,note:$.penExplain,penOn:ot,penColor:$.penColor,penAccent:$.penAccent,onAnnotated:Zt,kindLabel:$.kindLabel,isFigure:$.isFigure,docName:l?e.name:void 0,title:$.title,connections:$.connections,onNavigate:e=>{T(null),D(null),C(e)},onClose:()=>{T(null),D(null),C(null)},pageCount:n,onPageChange:e=>{let t=Math.min(n,Math.max(1,e));D(null),C(null),T({doc:$.source,page:t})}}),ot&&!Qt&&$.penExplain&&(0,J.jsxs)(`div`,{className:`prism-pen-caption`,children:[(0,J.jsx)(`span`,{className:`prism-pen-caption-text`,children:$.penExplain}),(0,J.jsx)(`button`,{type:`button`,className:`prism-pen-mute`,onClick:()=>ut(e=>!e),"aria-pressed":ct,title:ct?`Mute narration`:`Read it aloud`,children:ct?`🔊`:`🔇`})]})]})})(),At&&X&&a&&(0,J.jsx)(`div`,{className:`prism-page-wrap syn-detail-panel`,style:{"--pdf-pct":`${Xe}%`},children:(0,J.jsxs)(`div`,{className:`syn-detail`,children:[(0,J.jsx)(`button`,{type:`button`,className:`prism-page-close syn-detail-close`,onClick:()=>jt(null),"aria-label":`Close`,children:`✕`}),At.kind===`contradiction`&&(()=>{let e=a.contradictions.find(e=>e.id===At.id);if(!e)return null;let t=Q.get(e.a),n=Q.get(e.b);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":e.relation,children:e.relation===`contradicts`?`Contradiction`:`In tension`}),(0,J.jsx)(`h3`,{className:`syn-detail-title`,children:e.label}),!e.comparable&&(0,J.jsxs)(`p`,{className:`syn-banner`,children:[`Not directly comparable`,e.caveat?` — differs on ${e.caveat}`:``,`.`]}),(0,J.jsx)(`div`,{className:`syn-tape`,children:[t,n].map((e,t)=>e&&(0,J.jsxs)(`button`,{type:`button`,className:`syn-tape-side`,onClick:()=>{jt(null),C(e.id)},children:[(0,J.jsxs)(`span`,{className:`syn-tape-cite`,children:[a.sourceLabel(e.source),` · p.`,e.page]}),(0,J.jsxs)(`span`,{className:`syn-tape-quote`,children:[`“`,e.quote,`”`]})]},t))}),e.delta&&(0,J.jsxs)(`p`,{className:`syn-delta`,children:[e.delta.aValue,` vs `,e.delta.bValue,` `,e.delta.unit]}),(0,J.jsx)(`button`,{type:`button`,className:`syn-interrogate`,onClick:()=>{P(!0),j(!0),ie(t=>({id:(t?.id??0)+1,question:e.seedQuestion}))},children:`Interrogate — are these comparable?`})]})})(),At.kind===`gap`&&(()=>{let e=a.gaps.find(e=>e.id===At.id);return e?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":`gap`,children:e.kind===`absent`?`Gap`:`Thin coverage`}),(0,J.jsx)(`h3`,{className:`syn-detail-title`,children:e.facet.label}),(0,J.jsxs)(`p`,{className:`syn-receipt`,children:[(0,J.jsxs)(`strong`,{children:[e.coveredCount,` of `,e.sourcesScanned,` sources`]}),` `,`mention this`,e.coveredCount===0?` — nothing in the corpus covers it`:``,`.`]}),(0,J.jsx)(`p`,{className:`syn-searched-label`,children:`Searched for, verbatim:`}),(0,J.jsx)(`ul`,{className:`syn-searched`,children:e.searchedForms.map(e=>(0,J.jsx)(`li`,{children:e},e))}),(0,J.jsx)(`p`,{className:`syn-note`,children:`A statement about the corpus text — it dissolves the moment a source covers it.`})]}):null})(),At.kind===`consensus`&&(()=>{let e=a.consensus.find(e=>e.id===At.id);return e?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":`agrees`,children:`Consensus`}),(0,J.jsxs)(`p`,{className:`syn-consensus-count`,children:[(0,J.jsxs)(`strong`,{children:[e.sourceCount,` of `,e.corpusSize,` sources`]}),` `,`agree`]}),(0,J.jsx)(`p`,{className:`syn-proposition`,children:e.proposition}),(0,J.jsx)(`p`,{className:`syn-proposition-note`,children:`A paraphrase of the shared point — the verbatim lines are below.`}),(0,J.jsx)(`div`,{className:`syn-members`,children:e.memberClaimIds.map(e=>{let t=Q.get(e);return t&&(0,J.jsxs)(`button`,{type:`button`,className:`syn-member`,onClick:()=>{jt(null),C(e)},children:[(0,J.jsxs)(`span`,{className:`syn-tape-cite`,children:[a.sourceLabel(t.source),` · p.`,t.page]}),(0,J.jsxs)(`span`,{className:`syn-tape-quote`,children:[`“`,t.quote,`”`]})]},e)})}),e.band&&(0,J.jsxs)(`p`,{className:`syn-delta`,children:[e.band.min,`–`,e.band.max,` `,e.band.unit]})]}):null})()]})})]}),X&&!de&&!fe&&!W&&(rt||Ut)&&(0,J.jsxs)(`div`,{className:`prism-standing`,"data-verifying":rt?`true`:void 0,role:`status`,children:[(0,J.jsx)(`span`,{className:`prism-standing-dot`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`prism-standing-text`,children:rt?`Checking the key claims against the public record…`:Ut})]}),X&&(de||fe||W)&&(0,J.jsxs)(`div`,{className:`prism-standing`,"data-verifying":de?`true`:void 0,"data-recon":`true`,role:`status`,children:[(0,J.jsx)(`span`,{className:`prism-standing-dot`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`prism-standing-text`,children:de?`Checking the document’s own numbers against each other…`:W?`Couldn’t check the numbers — try again.`:H&&H.length>0?`${H.length===1?`A number doesn’t`:`${H.length} numbers don’t`} add up — the document’s own figures disagree`:`Every number checks out — the document’s figures are consistent.`})]}),X&&(0,J.jsxs)(`footer`,{className:`prism-foot`,children:[(0,J.jsxs)(`span`,{className:`prism-foot-stat`,children:[It,` claim`,It===1?``:`s`,` · `,Y?.regions.length??0,` region`,(Y?.regions.length??0)===1?``:`s`,` · every card cites a real page`,y>It?` · ${y-It} ungrounded dropped`:``]}),(0,J.jsxs)(`div`,{className:`prism-foot-actions`,children:[(0,J.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,J.jsx)(`span`,{className:`prism-foot-group-label`,children:`Ask`}),(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(A?` is-active`:` prism-foot-btn--primary`),onClick:()=>{A||(pe(!1),q(!1),ke(!1),Re(!1)),A||P(!0),j(e=>!e)},...s(wn.preload),"aria-pressed":A,title:`Ask the document a question — the answer lights up the exact lines`,children:A?`Hide ask`:`Ask the document`}),(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Qt?` is-active`:``),onClick:Qt?nn:an,...s(Tn.preload),disabled:!Y||Y.claims.length===0,"aria-pressed":Qt,title:`Play a silent, captioned flight through the document's argument — ending on its weakest point`,children:Qt?`End briefing`:`Brief me`})]}),(0,J.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,J.jsx)(`span`,{className:`prism-foot-group-label`,children:`Verify`}),(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(fe?` is-active`:``),onClick:un,...s(()=>In().then(()=>void 0)),disabled:de||!t||!_||_.claims.length===0,"aria-pressed":fe,title:`Check the document's own figures against each other — flags numbers that don't add up, computed in pure code`,children:de?`Checking…`:fe?`Hide numbers`:`Check the numbers`}),(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(K?` is-active`:``),onClick:hn,...s(()=>Promise.all([En.preload(),Ln()]).then(()=>void 0)),disabled:G||!t||!_||_.claims.filter(e=>e.role===`load-bearing`).length===0,"aria-pressed":K,title:`Raise the sharpest objection to each load-bearing claim — and show only the ones the document never answers`,children:G?`Examining…`:K?`Hide objections`:`Cross-examine`}),_&&_.claims.some(e=>e.kind===`forecast`)&&(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Oe?` is-active`:``),onClick:bn,...s(()=>Promise.all([Dn.preload(),Rn()]).then(()=>void 0)),disabled:Ee||!t||!n?.enabled,"aria-pressed":Oe,title:n?.enabled?`Grade the document's dated predictions against what actually happened (uses web search)`:`Turn on web search in Live settings to grade the document’s forecasts against reality`,children:Ee?`Grading…`:Oe?`Hide forecasts`:`Grade forecasts`}),_&&_.claims.some(e=>/\d/.test(e.quote))&&(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Le?` is-active`:``),onClick:Vn,...s(()=>Promise.all([On.preload(),zn()]).then(()=>void 0)),disabled:Fe||!t||!v,"aria-pressed":Le,title:`Find the model implied under the document and drag its assumptions — every figure traces to a page, the conclusion recomputes live`,children:Fe?`Modeling…`:Le?`Hide levers`:`Live levers`})]}),(0,J.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,J.jsx)(`span`,{className:`prism-foot-group-label`,children:`Explore`}),(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Ve===`contra`?` is-active`:``),onClick:()=>He(e=>e===`contra`?`map`:`contra`),disabled:!_||_.threads.length===0,title:_&&_.threads.length===0?l?`No links found between these documents`:`No contradictions found in this document`:void 0,children:_&&_.threads.length>0?l?`Show links (${_.threads.length})`:`Find contradictions (${_.threads.length})`:l?`No links`:`No contradictions`}),(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:Yt,...s(()=>Promise.all([kn.preload(),Bn()]).then(()=>void 0)),disabled:!t||!v||Ge!==null,title:`Explode this document into a causal web — every link traces to a page`,children:Ge===`why`?`Tracing…`:`Why (causes)`})]}),(0,J.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,J.jsx)(`span`,{className:`prism-foot-group-label`,children:`Annotate & share`}),(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(ot?` is-active`:``),onClick:()=>st(e=>!e),"aria-pressed":ot,title:`Annotate — Mavéa draws a pen mark over the cited lines and explains, on every question, claim, and briefing beat`,children:ot?`Pen on`:`Annotate`}),_&&(0,J.jsx)(Sn,{steps:mt,spec:_,pdfs:c,placed:Y?.claims,verdicts:en})]}),(0,J.jsxs)(`div`,{className:`prism-foot-group prism-foot-group--quiet`,children:[(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:()=>He(`map`),children:`Reset view`}),(0,J.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Je?` is-active`:``),onClick:()=>Ye(e=>!e),"aria-pressed":Je,children:`Legend`})]})]})]}),X&&Je&&(0,J.jsxs)(`aside`,{className:`prism-legend-panel`,"aria-label":`What the colors and lines mean`,children:[(0,J.jsxs)(`div`,{className:`prism-legend-col`,children:[(0,J.jsx)(`span`,{className:`prism-legend-title`,children:`THE KIND PALETTE`}),(0,J.jsx)(`ul`,{className:`prism-legend-kinds`,children:Yn.map(e=>(0,J.jsxs)(`li`,{className:`prism-legend-kind`,children:[(0,J.jsx)(`span`,{className:`prism-legend-kind-dot`,style:{background:Kn[e.kind].color},"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`prism-legend-kind-name`,children:Kn[e.kind].label}),(0,J.jsxs)(`span`,{className:`prism-legend-kind-desc`,children:[`· `,e.desc]})]},e.kind))})]}),(0,J.jsxs)(`div`,{className:`prism-legend-col`,children:[(0,J.jsx)(`span`,{className:`prism-legend-title`,children:`THE THREAD PALETTE`}),(0,J.jsx)(`ul`,{className:`prism-legend-threads`,children:Xn.map(e=>(0,J.jsxs)(`li`,{className:`prism-legend-thread`,children:[(0,J.jsx)(`svg`,{className:`prism-legend-thread-line`,"data-relation":e.relation,viewBox:`0 0 40 8`,width:`40`,height:`8`,"aria-hidden":`true`,children:(0,J.jsx)(`line`,{x1:`2`,y1:`4`,x2:`38`,y2:`4`})}),(0,J.jsx)(`span`,{className:`prism-legend-thread-name`,children:e.name}),(0,J.jsxs)(`span`,{className:`prism-legend-thread-desc`,children:[`· `,e.desc]})]},e.relation))}),(0,J.jsxs)(`p`,{className:`prism-legend-note`,children:[`Threads never turn into red errors — a contradiction is a line you can follow to both pages. The thread map is what makes the document `,(0,J.jsx)(`strong`,{children:`arguable`}),`, not just readable.`]})]})]}),!X&&g!==`error`&&(0,J.jsx)(`footer`,{className:`prism-foot prism-foot-quiet`,children:(0,J.jsx)(`span`,{className:`prism-foot-stat`,children:`The document blooms into a map of its claims — each one a verbatim quote anchored to its page.`})})]}),Ue&&(0,J.jsx)(u,{label:`Why map`,overlay:!0,children:(0,J.jsx)(Fn,{dag:Ue,onClose:()=>We(null)})})]})}var nr=[{x:`-210px`,y:`-150px`,r:`-34deg`,w:34,h:44,d:0},{x:`190px`,y:`-170px`,r:`28deg`,w:28,h:38,d:40},{x:`-260px`,y:`40px`,r:`-14deg`,w:40,h:30,d:20},{x:`250px`,y:`70px`,r:`22deg`,w:30,h:40,d:60},{x:`-120px`,y:`190px`,r:`-44deg`,w:24,h:32,d:80},{x:`150px`,y:`200px`,r:`18deg`,w:36,h:28,d:30},{x:`-300px`,y:`-40px`,r:`-24deg`,w:26,h:36,d:50},{x:`300px`,y:`-30px`,r:`30deg`,w:32,h:42,d:10},{x:`40px`,y:`-220px`,r:`12deg`,w:22,h:30,d:70},{x:`-60px`,y:`230px`,r:`-18deg`,w:30,h:24,d:90}];export{Oe as a,mt as i,Cn as n,ke as o,St as r,fe as s,tr as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{l as n,n as r}from"./useLiveConfig-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{l as n,n as r}from"./useLiveConfig-Cpy0_E_-.js";import{t as i}from"./PrismOverlay-D1cDZamt.js";var a=e(),o=t();function s(e){let t=(0,a.c)(4),{pdf:s,onClose:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=n(r()),t[0]=l):l=t[0];let u=l,d;return t[1]!==c||t[2]!==s?(d=(0,o.jsx)(i,{pdf:s,cfg:u,onClose:c}),t[1]=c,t[2]=s,t[3]=d):d=t[3],d}export{s as PrismWorkbench};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{t as n}from"./LegalMarkdownDocument-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{t as n}from"./LegalMarkdownDocument-Be_fQbZ_.js";var r=e(),i=`# Mavéa Privacy Notice
|
|
2
2
|
|
|
3
|
-
Effective: August
|
|
3
|
+
Effective: August 17, 2026
|
|
4
4
|
|
|
5
5
|
This notice describes the current, unmodified local and self-hosted Mavéa software. It does not describe a future hosted service. Local-first does not mean every feature stays on your device: connected features send data through the deployment to third parties you choose. If a person or organization deploys Mavéa for others, that operator must provide any additional privacy notices and controls required for its deployment.
|
|
6
6
|
|
|
@@ -20,6 +20,7 @@ Depending on the features you use, browser storage may contain:
|
|
|
20
20
|
|
|
21
21
|
- conversations, saved canvases, bookmarks, memory items, and session history;
|
|
22
22
|
- courses, lessons, flashcards, quiz progress, Ripple analyses, and dashboards;
|
|
23
|
+
- the readings a dashboard has fetched over time, kept per tracked item as its own record so a value's history and the sites it came from survive between checks;
|
|
23
24
|
- preferences such as theme, performance, visual richness, voice, and setup state;
|
|
24
25
|
- drafts, tracked items, presentation settings, and recent feature state;
|
|
25
26
|
- provider and model configuration;
|
|
@@ -27,9 +28,9 @@ Depending on the features you use, browser storage may contain:
|
|
|
27
28
|
- temporary in-progress and finished video-export files in origin-private browser storage until the export is consumed or discarded; and
|
|
28
29
|
- short-lived demo, tour, route, and in-progress session data.
|
|
29
30
|
|
|
30
|
-
Saved content is encrypted in browser storage only where the relevant feature and browser support it. Course data, mastery and progress, some Ripple data and analysis caches, preferences, metadata, and fallback content can be stored in ordinary local storage or IndexedDB. Anyone who can use your unlocked device or browser profile, and malicious extensions or same-origin code, may be able to access browser data.
|
|
31
|
+
Saved content is encrypted in browser storage only where the relevant feature and browser support it. Dashboards and the readings they fetch are encrypted with the same device key, the readings in IndexedDB with only their routing details — which tracked item, and when — left readable so they can be looked up. Course data, mastery and progress, some Ripple data and analysis caches, preferences, metadata, and fallback content can be stored in ordinary local storage or IndexedDB. Anyone who can use your unlocked device or browser profile, and malicious extensions or same-origin code, may be able to access browser data.
|
|
31
32
|
|
|
32
|
-
Because this browser data is encrypted to this specific browser, it does not carry over to a different browser, an incognito window, or another device. You can export a backup file of your dashboards, memory, flashcards, saved canvases, map, and courses, and import it elsewhere to move that data. The backup is plain, unencrypted JSON under your control, so store and share it carefully; it deliberately excludes your provider and search keys. Importing a backup merges into existing data and never deletes it, and importing a file you did not create can add content from that file — import only backups you trust.
|
|
33
|
+
Because this browser data is encrypted to this specific browser, it does not carry over to a different browser, an incognito window, or another device. You can export a backup file of your dashboards, memory, flashcards, saved canvases, map, and courses, and import it elsewhere to move that data. A backup carries a dashboard's definition and its latest values, not its fetched reading history, so moving to another browser starts that history fresh. The backup is plain, unencrypted JSON under your control, so store and share it carefully; it deliberately excludes your provider and search keys. Importing a backup merges into existing data and never deletes it, and importing a file you did not create can add content from that file — import only backups you trust.
|
|
33
34
|
|
|
34
35
|
Browser and operating-system caches may retain application assets and optional voice models. The actions gateway may store connected-service credentials and configuration on the deployment operator's machine.
|
|
35
36
|
|
|
@@ -88,7 +89,7 @@ The unmodified project does not sell personal information or use it for cross-co
|
|
|
88
89
|
|
|
89
90
|
## 8. Retention and deletion
|
|
90
91
|
|
|
91
|
-
Memory-only values disappear on reload. Session storage generally remains until the tab or browser session ends. Local storage and IndexedDB remain until a feature removes the item, you use an available clear, forget, or reset control, you clear site data, or the browser evicts it. Some session history is capped and expires, but many course, progress, dashboard, memory, and Ripple records have no automatic expiration. Clearing all browser site data is the broadest local deletion control. Removing browser data does not delete copies already sent elsewhere.
|
|
92
|
+
Memory-only values disappear on reload. Session storage generally remains until the tab or browser session ends. Local storage and IndexedDB remain until a feature removes the item, you use an available clear, forget, or reset control, you clear site data, or the browser evicts it. Some session history is capped and expires, but many course, progress, dashboard, memory, and Ripple records have no automatic expiration. A dashboard's fetched reading history is capped per tracked item, and deleting a dashboard deletes its readings and its record of recent checks with it. Clearing all browser site data is the broadest local deletion control. Removing browser data does not delete copies already sent elsewhere.
|
|
92
93
|
|
|
93
94
|
Gateway tokens remain until disconnected or removed by the gateway operator. Server, proxy, infrastructure, and provider retention depends on the relevant operator, logs, backups, account settings, and third-party policy. Contact those parties for deletion of data they control and revoke credentials at the issuing service.
|
|
94
95
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-
|
|
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{n as o,t as s}from"./preloadableLazy-MIX1ApBW.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-DWxlrJSz.js","assets/react-BZJXY1be.js","assets/rolldown-runtime-DkW27tQK.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/icons-gLFQTv74.js","assets/registry-Dd1lcXrO.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/spokenText-C88IQJ0M.js","assets/useFocusTrap-DBtkeyRy.js","assets/toast-BBNs2h3L.js","assets/capture-D8uPIcfj.js","assets/index-Dk0QapqQ.js","assets/useInView-CXTOAEV3.js","assets/coreIcons-DDTChE1H.js","assets/theme-7IrMJ70_.js","assets/index-DmKgC_TJ.css","assets/kokoro-P_fkcX-A.js","assets/share-kW3pZ027.js","assets/ReelJelly-D5e-jt-8.js","assets/geometry-DXAbnb0J.js","assets/threads-Cu2t3070.js","assets/FeatureUseNotice-Dc8joBGM.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/ShareModal-D1QuQEko.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{n as o,t as s}from"./preloadableLazy-MIX1ApBW.js";import{it as c,k as l}from"./index-Dk0QapqQ.js";import{n as u}from"./icons-gLFQTv74.js";import"./annotationReel-K2FYv-3B.js";var d=t(),f=n(),p=c();function m(e){if(!e||!e.blocks?.length)return[];let t=e.blocks.map((e,t)=>({index:t}));return[{question:e.opener||e.title||``,narration:e.found||e.sub||e.opener||e.title||``,mode:`replace`,tour:t,spec:e,at:0}]}var h=r();i();var g=s(()=>a(()=>import(`./ShareModal-DWxlrJSz.js`).then(e=>({default:e.ShareModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),_=g.Component;function v(e){let t=(0,f.c)(9),{frames:n,spec:r}=e,[i,a]=(0,d.useState)(!1),s;t[0]!==n||t[1]!==r?(s=n??(r?m(r):[]),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=s;if(!c.length)return null;let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,h.jsx)(`button`,{type:`button`,className:`clip-launch`,onClick:()=>a(!0),...o(g.preload),children:`✨ Make a video`}),t[3]=u):u=t[3];let v;t[4]!==i||t[5]!==c?(v=i&&(0,p.createPortal)((0,h.jsx)(l,{label:`Make a video`,overlay:!0,children:(0,h.jsx)(_,{frames:c,onClose:()=>a(!1)})}),document.body),t[4]=i,t[5]=c,t[6]=v):v=t[6];let y;return t[7]===v?y=t[8]:(y=(0,h.jsxs)(h.Fragment,{children:[u,v]}),t[7]=v,t[8]=y),y}var y=e({ReplayCard:()=>b});function b(e){let t=(0,f.c)(12),{delay:n,line:r,spec:i}=e,a=(n||0)+`ms`,o;t[0]===a?o=t[1]:(o={"--delay":a},t[0]=a,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,h.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,h.jsx)(u.play,{className:`ic`,style:{color:`var(--presence-soft)`}}),` Mavéa Replay`]}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={fontSize:17,marginBottom:14},t[3]=l):l=t[3];let d=r||`“I dropped in 3 statements. Mavéa showed me where my money went in 20 seconds.”`,p;t[4]===d?p=t[5]:(p=(0,h.jsx)(`div`,{className:`insight-title`,style:l,children:d}),t[4]=d,t[5]=p);let m;t[6]===i?m=t[7]:(m=i&&(0,h.jsx)(v,{spec:i}),t[6]=i,t[7]=m);let g;return t[8]!==s||t[9]!==p||t[10]!==m?(g=(0,h.jsxs)(`div`,{className:`card replay-card reveal`,style:s,children:[c,p,m]}),t[8]=s,t[9]=p,t[10]=m,t[11]=g):g=t[11],g}export{y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{t as n}from"./TopicCanvas-
|
|
1
|
+
import{t as e}from"./react-BZJXY1be.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{t as n}from"./TopicCanvas-LMI0zC7R.js";import{t as r}from"./useFocusTrap-DBtkeyRy.js";import{n as i}from"./replay-TYXO0Brm.js";import"./canvas-Bsx3eSaS.js";import{t as a}from"./AnnotationLayer-qV6CIUZv.js";var o=e(),s=t(),c=700;function l({frames:e,initialIndex:t,speak:l,cancelSpeak:u,onClose:d}){let[f,p]=(0,o.useState)(()=>Math.min(Math.max(0,t),e.length-1)),[m,h]=(0,o.useState)(null),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)([]),[b,x]=(0,o.useState)(()=>e[t]?.spec??null),S=(0,o.useRef)(null),C=(0,o.useRef)(null),w=(0,o.useRef)(null),T=e[f]??null,E=(0,o.useCallback)(()=>{w.current?.(),w.current=null,u?.(),_(!1),h(null),y([])},[u]),D=(0,o.useCallback)(()=>{E(),d()},[E,d]);r(C,{onEscape:D});let O=(0,o.useCallback)((e,t)=>{if(E(),!e.length)return;let n=!1,r;w.current=()=>{n=!0,r&&clearTimeout(r)},_(!0);let i=0,a=()=>{if(n)return;if(i>=e.length){_(!1),h(null);return}let o=e[i];p(t+i),x(o.spec),y([]),u?.(),o.say&&l?.(o.say);let s=0,d=()=>{if(n)return;if(s>=o.beats.length){i+=1,r=setTimeout(a,c);return}let e=o.beats[s++];if(e.set&&`spot`in e.set){let t=e.set.spot??null;h(t);let n=t?o.cues.find(e=>e.spot===t):void 0;n?.marks.length&&y(e=>[...e,...n.marks.map((e,t)=>({spot:n.spot,line:n.say,mark:e,delayMs:t*240,...e.kind===`connect`&&typeof e.onIndex==`number`?{toSpot:o.spec.blocks[e.onIndex]?.id}:{}}))])}r=setTimeout(d,e.ms??0)};d()};a()},[E,l,u]),k=(0,o.useCallback)(()=>{T&&O(i([T],0),f)},[T,f,O]),A=(0,o.useCallback)(()=>{O(i(e,f),f)},[e,f,O]),j=(0,o.useCallback)(()=>{p(0),O(i(e,0),0)},[e,O]),M=(0,o.useCallback)(t=>{E(),p(t),x(e[t]?.spec??null)},[e,E]);return(0,o.useEffect)(()=>{if(!m)return;let e=window.setTimeout(()=>{let e=S.current;if(!e)return;let t=e.querySelector(`.spotlit`);if(!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top-n.top-(e.clientHeight-r.height)/2;e.scrollTo({top:Math.max(0,e.scrollTop+i),behavior:`smooth`})},90);return()=>window.clearTimeout(e)},[m]),(0,o.useEffect)(()=>()=>E(),[E]),!T||!b?null:(0,s.jsx)(`div`,{className:`replay-scrim`,onClick:D,children:(0,s.jsxs)(`div`,{className:`replay-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Replay`,ref:C,onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)(`div`,{className:`replay-timeline`,children:[(0,s.jsxs)(`div`,{className:`replay-timeline-head`,children:[(0,s.jsx)(`span`,{children:`Conversation`}),(0,s.jsx)(`button`,{className:`entry-action`,style:{fontSize:12},onClick:D,children:`← Live`})]}),e.map((e,t)=>(0,s.jsxs)(`button`,{className:`replay-turn`+(t===f?` is-active`:``),onClick:()=>M(t),title:e.question,children:[(0,s.jsxs)(`span`,{className:`replay-turn-title`,children:[t+1,`. `,e.question||e.spec.title]}),(0,s.jsxs)(`span`,{className:`replay-turn-meta`,children:[e.spec.blocks.length,` cards`,e.mode===`replace`?``:` · ${e.mode}`]})]},t))]}),(0,s.jsxs)(`div`,{className:`replay-main`,children:[(0,s.jsxs)(`div`,{className:`replay-bar`,children:[(0,s.jsx)(`span`,{className:`faint replay-bar-title`,children:T.spec.title}),g?(0,s.jsx)(`button`,{className:`entry-action`,onClick:E,children:`◼ Stop`}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`button`,{className:`entry-action`,onClick:k,children:`▶ Replay this`}),(0,s.jsx)(`button`,{className:`entry-action`,onClick:A,children:`▶ From here`}),(0,s.jsx)(`button`,{className:`entry-action`,onClick:j,children:`▶ From start`})]})]}),(0,s.jsxs)(`div`,{ref:S,className:`canvas-scroll replay-canvas`,children:[(0,s.jsx)(`div`,{className:`topic-wrap`,children:(0,s.jsx)(n,{data:b,spot:m,built:{},onProve:()=>{}})}),(0,s.jsx)(a,{spots:v,within:S.current,revision:f})]})]})]})})}export{l as ReplayOverlay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{t as r}from"./useFocusTrap-DBtkeyRy.js";import{t as i}from"./motion-DxHSlPN6.js";import{t as a}from"./useDashboards-BMcuCWoz.js";import{c as o}from"./ledger-Cv0LBflx.js";import{t as s}from"./useLedger-1WVXef68.js";import{r as c}from"./predictions-CkVKHq-5.js";import{n as l,t as u}from"./checkLogModel-BMtruriG.js";var d=e(),f=t(),p=6048e5,m=20;function h(e,t){return e.reduce((e,n)=>{let r=c(n.predictionHistory,t);return{hits:e.hits+r.hits,total:e.total+r.total}},{hits:0,total:0})}function g(e,t,n=m){let r=t-p,i=[];for(let t of e)for(let e of t.predictionHistory??[])e.at>=r&&i.push({grade:e,dashboardTitle:t.title});return i.sort((e,t)=>e.grade.at-t.grade.at),i.length>n?i.slice(i.length-n):i}function _(e,t){let n=t-p,r=null,i=-1;for(let t of e)for(let e of t.predictionHistory??[]){if(e.at<n||e.result!==`hit`)continue;let a=e.expected.length+(e.note?.length??0);a>i&&(i=a,r={expected:e.expected,note:e.note,dashboardTitle:t.title})}return r}function v(e,t){let n=[];return e.totalSearches>0&&n.push(`searches`),e.topMoment&&n.push(`moment`),t.total>0&&n.push(`calls`),e.estSavedPerMonth>0&&n.push(`saved`),n}function y(e){return e.length>0?e:[`fallback`]}var b=n(),x=[`S`,`M`,`T`,`W`,`T`,`F`,`S`];function S(e){return x[new Date(`${e}T00:00:00Z`).getUTCDay()]}function C(e){return new Date(e).toLocaleDateString([],{weekday:`long`,month:`long`,day:`numeric`})}function w(e){return{"--d":`${e}ms`}}function T(e){let t=(0,f.c)(22),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.totalSearches,r),o;t[1]===n.byDay?o=t[2]:(o=Math.max(1,...n.byDay.map(E)),t[1]=n.byDay,t[2]=o);let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`This week`}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=w(90),t[4]=l):l=t[4];let u;t[5]===a?u=t[6]:(u=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:l,children:a}),t[5]=a,t[6]=u);let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(170),t[7]=d):d=t[7];let p=n.totalSearches===1?``:`es`,m;t[8]===p?m=t[9]:(m=(0,b.jsxs)(`p`,{className:`rw-figure-label rw-child`,style:d,children:[`search`,p,`, all week`]}),t[8]=p,t[9]=m);let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(260),t[10]=h):h=t[10];let g;if(t[11]!==s||t[12]!==n.byDay){let e;t[14]===s?e=t[15]:(e=e=>(0,b.jsxs)(`div`,{className:`rw-bar`,title:`${e.searches} search${e.searches===1?``:`es`}`,children:[(0,b.jsx)(`div`,{className:`rw-bar-track`,children:(0,b.jsx)(`div`,{className:`rw-bar-fill`,style:{height:`${e.searches/s*100}%`}})}),(0,b.jsx)(`span`,{className:`rw-bar-day`,children:S(e.date)})]},e.date),t[14]=s,t[15]=e),g=n.byDay.map(e),t[11]=s,t[12]=n.byDay,t[13]=g}else g=t[13];let _;t[16]===g?_=t[17]:(_=(0,b.jsx)(`div`,{className:`rw-bars rw-child`,style:h,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==u||t[20]!==m?(v=(0,b.jsxs)(b.Fragment,{children:[c,u,m,_]}),t[18]=_,t[19]=u,t[20]=m,t[21]=v):v=t[21],v}function E(e){return e.searches}function ee(e){let t=(0,f.c)(22),{rewind:n}=e,r=n.topMoment;if(!r)return null;let i;t[0]===r?i=t[1]:(i=u(r),t[0]=r,t[1]=i);let a=i,o=a?.tone??`plain`,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`The moment that mattered`}),t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=w(110),t[3]=c):c=t[3];let d;t[4]===r.text?d=t[5]:(d=(0,b.jsx)(`p`,{className:`rw-moment-text`,children:r.text}),t[4]=r.text,t[5]=d);let p;t[6]===a?p=t[7]:(p=a&&(0,b.jsx)(`span`,{className:`rw-moment-chip`,children:a.label}),t[6]=a,t[7]=p);let m;t[8]===r.at?m=t[9]:(m=C(r.at),t[8]=r.at,t[9]=m);let h;t[10]===r.at?h=t[11]:(h=l(r.at),t[10]=r.at,t[11]=h);let g;t[12]!==m||t[13]!==h?(g=(0,b.jsxs)(`span`,{className:`rw-moment-time`,children:[m,` · `,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==p||t[16]!==g?(_=(0,b.jsxs)(`div`,{className:`rw-moment-meta`,children:[p,g]}),t[15]=p,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==d||t[19]!==_||t[20]!==o?(v=(0,b.jsxs)(b.Fragment,{children:[s,(0,b.jsxs)(`div`,{className:`rw-moment rw-child`,"data-tone":o,style:c,children:[d,_]})]}),t[18]=d,t[19]=_,t[20]=o,t[21]=v):v=t[21],v}var D={hit:`✓`,miss:`✗`,unclear:`—`};function O(e){let t=(0,f.c)(19),{tally:n,grades:r,quote:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={duration:1200},t[0]=o):o=t[0];let s=i(n.hits,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={duration:1200},t[1]=c):c=t[1];let l=i(n.total,c),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`Call record`}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(90),t[3]=d):d=t[3];let p;t[4]!==s||t[5]!==l?(p=(0,b.jsxs)(`p`,{className:`rw-figure rw-child`,style:d,children:[s,`/`,l]}),t[4]=s,t[5]=l,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`calls graded this week`}),t[7]=m):m=t[7];let h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(250),t[8]=h):h=t[8];let g;t[9]===r?g=t[10]:(g=r.map(k),t[9]=r,t[10]=g);let _;t[11]===g?_=t[12]:(_=(0,b.jsx)(`div`,{className:`rw-chips rw-child`,style:h,role:`list`,children:g}),t[11]=g,t[12]=_);let v;t[13]===a?v=t[14]:(v=a&&(0,b.jsxs)(`p`,{className:`rw-quote rw-child`,style:w(330),children:[`“`,a.expected,a.note?` — ${a.note}`:``,`”`,(0,b.jsx)(`span`,{className:`rw-quote-attr`,children:a.dashboardTitle})]}),t[13]=a,t[14]=v);let y;return t[15]!==v||t[16]!==p||t[17]!==_?(y=(0,b.jsxs)(b.Fragment,{children:[u,p,m,_,v]}),t[15]=v,t[16]=p,t[17]=_,t[18]=y):y=t[18],y}function k(e,t){let{grade:n}=e;return(0,b.jsx)(`span`,{className:`rw-chip rw-chip--${n.result}`,role:`listitem`,title:n.expected,children:D[n.result]},`${n.at}-${t}`)}function te(e){let t=(0,f.c)(12),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.estSavedPerMonth,r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`If you keep this up`}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=w(90),t[2]=s):s=t[2];let c;t[3]===a?c=t[4]:(c=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:s,children:a}),t[3]=a,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`searches saved / month`}),t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(250),t[6]=u):u=t[6];let d;t[7]===n.estSavedPerMonth?d=t[8]:(d=(0,b.jsxs)(`p`,{className:`rw-caption rw-child`,style:u,children:[`Applying Mavéa's suggestions this week is projected to save about `,n.estSavedPerMonth,` `,`searches a month — a rate estimate from real cadence changes, not a count of searches actually skipped this week.`]}),t[7]=n.estSavedPerMonth,t[8]=d);let p;return t[9]!==c||t[10]!==d?(p=(0,b.jsxs)(b.Fragment,{children:[o,c,l,d]}),t[9]=c,t[10]=d,t[11]=p):p=t[11],p}function ne(){let e=(0,f.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(`p`,{className:`rw-fallback-text rw-child`,style:w(40),children:`Nothing to look back on yet — come back after a week of checks.`}),e[0]=t):t=e[0],t}function A(e){let t=(0,f.c)(70),{onClose:n}=e,i=(0,d.useRef)(null),c;t[0]===n?c=t[1]:(c={onEscape:n},t[0]=n,t[1]=c),r(i,c);let[l]=(0,d.useState)(ie),u=s(),p=a(),m;t[2]!==u||t[3]!==l?(m=o(u,l),t[2]=u,t[3]=l,t[4]=m):m=t[4];let x=m,S;t[5]!==p||t[6]!==l?(S=h(p,l),t[5]=p,t[6]=l,t[7]=S):S=t[7];let C=S,w;t[8]!==p||t[9]!==l?(w=g(p,l),t[8]=p,t[9]=l,t[10]=w):w=t[10];let E=w,D;t[11]!==p||t[12]!==l?(D=_(p,l),t[11]=p,t[12]=l,t[13]=D):D=t[13];let k=D,A;t[14]!==x||t[15]!==C?(A=v(x,C),t[14]=x,t[15]=C,t[16]=A):A=t[16];let j=A,M;t[17]===j?M=t[18]:(M=y(j),t[17]=j,t[18]=M);let N=M,[P,F]=(0,d.useState)(0),I,L;t[19]===N.length?(I=t[20],L=t[21]):(I=()=>{F(e=>Math.min(e,N.length-1))},L=[N.length],t[19]=N.length,t[20]=I,t[21]=L),(0,d.useEffect)(I,L);let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>F(re),t[22]=R):R=t[22];let z=R,B;t[23]===N.length?B=t[24]:(B=()=>F(e=>Math.min(N.length-1,e+1)),t[23]=N.length,t[24]=B);let V=B,H;t[25]===V?H=t[26]:(H=e=>{e.key===`ArrowRight`||e.key===` `?(e.preventDefault(),V()):e.key===`ArrowLeft`&&(e.preventDefault(),z())},t[25]=V,t[26]=H);let U=H,W=N.length>1,G;t[27]!==W||t[28]!==P||t[29]!==N.length?(G=W&&(0,b.jsxs)(`span`,{className:`rw-counter`,"aria-live":`polite`,children:[P+1,` of `,N.length]}),t[27]=W,t[28]=P,t[29]=N.length,t[30]=G):G=t[30];let K;t[31]===n?K=t[32]:(K=(0,b.jsx)(`button`,{type:`button`,className:`rw-close`,onClick:n,"aria-label":`Close`,children:`×`}),t[31]=n,t[32]=K);let q;t[33]!==G||t[34]!==K?(q=(0,b.jsxs)(`div`,{className:`rw-chrome`,children:[G,K]}),t[33]=G,t[34]=K,t[35]=q):q=t[35];let J;t[36]!==W||t[37]!==P?(J=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--prev`,"aria-label":`Previous slide`,onClick:z,disabled:P===0}),t[36]=W,t[37]=P,t[38]=J):J=t[38];let Y;if(t[39]!==E||t[40]!==P||t[41]!==k||t[42]!==x||t[43]!==N||t[44]!==C){let e;t[46]!==E||t[47]!==P||t[48]!==k||t[49]!==x||t[50]!==C?(e=(e,t)=>(0,b.jsxs)(`div`,{className:`rw-slide`,"data-active":t===P||void 0,children:[e===`searches`&&(0,b.jsx)(T,{rewind:x}),e===`moment`&&(0,b.jsx)(ee,{rewind:x}),e===`calls`&&(0,b.jsx)(O,{tally:C,grades:E,quote:k}),e===`saved`&&(0,b.jsx)(te,{rewind:x}),e===`fallback`&&(0,b.jsx)(ne,{})]},e),t[46]=E,t[47]=P,t[48]=k,t[49]=x,t[50]=C,t[51]=e):e=t[51],Y=N.map(e),t[39]=E,t[40]=P,t[41]=k,t[42]=x,t[43]=N,t[44]=C,t[45]=Y}else Y=t[45];let X;t[52]!==W||t[53]!==V||t[54]!==P||t[55]!==N.length?(X=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--next`,"aria-label":`Next slide`,onClick:V,disabled:P===N.length-1}),t[52]=W,t[53]=V,t[54]=P,t[55]=N.length,t[56]=X):X=t[56];let Z;t[57]!==J||t[58]!==Y||t[59]!==X?(Z=(0,b.jsxs)(`div`,{className:`rw-stage`,children:[J,Y,X]}),t[57]=J,t[58]=Y,t[59]=X,t[60]=Z):Z=t[60];let Q;t[61]!==W||t[62]!==P||t[63]!==N?(Q=W&&(0,b.jsx)(`div`,{className:`rw-dots`,children:N.map((e,t)=>(0,b.jsx)(`button`,{type:`button`,className:`rw-dot`,"data-active":t===P||void 0,"aria-label":`Go to slide ${t+1} of ${N.length}`,onClick:()=>F(t)},e))}),t[61]=W,t[62]=P,t[63]=N,t[64]=Q):Q=t[64];let $;return t[65]!==U||t[66]!==q||t[67]!==Z||t[68]!==Q?($=(0,b.jsxs)(`div`,{className:`rw-overlay`,ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Weekly Rewind`,tabIndex:-1,onKeyDown:U,children:[q,Z,Q]}),t[65]=U,t[66]=q,t[67]=Z,t[68]=Q,t[69]=$):$=t[69],$}function re(e){return Math.max(0,e-1)}function ie(){return Date.now()}export{A as RewindOverlay};
|
|
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{t as r}from"./useFocusTrap-DBtkeyRy.js";import{t as i}from"./motion-DxHSlPN6.js";import{t as a}from"./useDashboards-SRk8LqHe.js";import{c as o}from"./ledger-Cv0LBflx.js";import{t as s}from"./useLedger-1WVXef68.js";import{r as c}from"./predictions-CkVKHq-5.js";import{n as l,t as u}from"./checkLogModel-BMtruriG.js";var d=e(),f=t(),p=6048e5,m=20;function h(e,t){return e.reduce((e,n)=>{let r=c(n.predictionHistory,t);return{hits:e.hits+r.hits,total:e.total+r.total}},{hits:0,total:0})}function g(e,t,n=m){let r=t-p,i=[];for(let t of e)for(let e of t.predictionHistory??[])e.at>=r&&i.push({grade:e,dashboardTitle:t.title});return i.sort((e,t)=>e.grade.at-t.grade.at),i.length>n?i.slice(i.length-n):i}function _(e,t){let n=t-p,r=null,i=-1;for(let t of e)for(let e of t.predictionHistory??[]){if(e.at<n||e.result!==`hit`)continue;let a=e.expected.length+(e.note?.length??0);a>i&&(i=a,r={expected:e.expected,note:e.note,dashboardTitle:t.title})}return r}function v(e,t){let n=[];return e.totalSearches>0&&n.push(`searches`),e.topMoment&&n.push(`moment`),t.total>0&&n.push(`calls`),e.estSavedPerMonth>0&&n.push(`saved`),n}function y(e){return e.length>0?e:[`fallback`]}var b=n(),x=[`S`,`M`,`T`,`W`,`T`,`F`,`S`];function S(e){return x[new Date(`${e}T00:00:00Z`).getUTCDay()]}function C(e){return new Date(e).toLocaleDateString([],{weekday:`long`,month:`long`,day:`numeric`})}function w(e){return{"--d":`${e}ms`}}function T(e){let t=(0,f.c)(22),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.totalSearches,r),o;t[1]===n.byDay?o=t[2]:(o=Math.max(1,...n.byDay.map(E)),t[1]=n.byDay,t[2]=o);let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`This week`}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=w(90),t[4]=l):l=t[4];let u;t[5]===a?u=t[6]:(u=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:l,children:a}),t[5]=a,t[6]=u);let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(170),t[7]=d):d=t[7];let p=n.totalSearches===1?``:`es`,m;t[8]===p?m=t[9]:(m=(0,b.jsxs)(`p`,{className:`rw-figure-label rw-child`,style:d,children:[`search`,p,`, all week`]}),t[8]=p,t[9]=m);let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(260),t[10]=h):h=t[10];let g;if(t[11]!==s||t[12]!==n.byDay){let e;t[14]===s?e=t[15]:(e=e=>(0,b.jsxs)(`div`,{className:`rw-bar`,title:`${e.searches} search${e.searches===1?``:`es`}`,children:[(0,b.jsx)(`div`,{className:`rw-bar-track`,children:(0,b.jsx)(`div`,{className:`rw-bar-fill`,style:{height:`${e.searches/s*100}%`}})}),(0,b.jsx)(`span`,{className:`rw-bar-day`,children:S(e.date)})]},e.date),t[14]=s,t[15]=e),g=n.byDay.map(e),t[11]=s,t[12]=n.byDay,t[13]=g}else g=t[13];let _;t[16]===g?_=t[17]:(_=(0,b.jsx)(`div`,{className:`rw-bars rw-child`,style:h,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==u||t[20]!==m?(v=(0,b.jsxs)(b.Fragment,{children:[c,u,m,_]}),t[18]=_,t[19]=u,t[20]=m,t[21]=v):v=t[21],v}function E(e){return e.searches}function ee(e){let t=(0,f.c)(22),{rewind:n}=e,r=n.topMoment;if(!r)return null;let i;t[0]===r?i=t[1]:(i=u(r),t[0]=r,t[1]=i);let a=i,o=a?.tone??`plain`,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`The moment that mattered`}),t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=w(110),t[3]=c):c=t[3];let d;t[4]===r.text?d=t[5]:(d=(0,b.jsx)(`p`,{className:`rw-moment-text`,children:r.text}),t[4]=r.text,t[5]=d);let p;t[6]===a?p=t[7]:(p=a&&(0,b.jsx)(`span`,{className:`rw-moment-chip`,children:a.label}),t[6]=a,t[7]=p);let m;t[8]===r.at?m=t[9]:(m=C(r.at),t[8]=r.at,t[9]=m);let h;t[10]===r.at?h=t[11]:(h=l(r.at),t[10]=r.at,t[11]=h);let g;t[12]!==m||t[13]!==h?(g=(0,b.jsxs)(`span`,{className:`rw-moment-time`,children:[m,` · `,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==p||t[16]!==g?(_=(0,b.jsxs)(`div`,{className:`rw-moment-meta`,children:[p,g]}),t[15]=p,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==d||t[19]!==_||t[20]!==o?(v=(0,b.jsxs)(b.Fragment,{children:[s,(0,b.jsxs)(`div`,{className:`rw-moment rw-child`,"data-tone":o,style:c,children:[d,_]})]}),t[18]=d,t[19]=_,t[20]=o,t[21]=v):v=t[21],v}var D={hit:`✓`,miss:`✗`,unclear:`—`};function O(e){let t=(0,f.c)(19),{tally:n,grades:r,quote:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={duration:1200},t[0]=o):o=t[0];let s=i(n.hits,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={duration:1200},t[1]=c):c=t[1];let l=i(n.total,c),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`Call record`}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(90),t[3]=d):d=t[3];let p;t[4]!==s||t[5]!==l?(p=(0,b.jsxs)(`p`,{className:`rw-figure rw-child`,style:d,children:[s,`/`,l]}),t[4]=s,t[5]=l,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`calls graded this week`}),t[7]=m):m=t[7];let h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(250),t[8]=h):h=t[8];let g;t[9]===r?g=t[10]:(g=r.map(k),t[9]=r,t[10]=g);let _;t[11]===g?_=t[12]:(_=(0,b.jsx)(`div`,{className:`rw-chips rw-child`,style:h,role:`list`,children:g}),t[11]=g,t[12]=_);let v;t[13]===a?v=t[14]:(v=a&&(0,b.jsxs)(`p`,{className:`rw-quote rw-child`,style:w(330),children:[`“`,a.expected,a.note?` — ${a.note}`:``,`”`,(0,b.jsx)(`span`,{className:`rw-quote-attr`,children:a.dashboardTitle})]}),t[13]=a,t[14]=v);let y;return t[15]!==v||t[16]!==p||t[17]!==_?(y=(0,b.jsxs)(b.Fragment,{children:[u,p,m,_,v]}),t[15]=v,t[16]=p,t[17]=_,t[18]=y):y=t[18],y}function k(e,t){let{grade:n}=e;return(0,b.jsx)(`span`,{className:`rw-chip rw-chip--${n.result}`,role:`listitem`,title:n.expected,children:D[n.result]},`${n.at}-${t}`)}function te(e){let t=(0,f.c)(12),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.estSavedPerMonth,r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`If you keep this up`}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=w(90),t[2]=s):s=t[2];let c;t[3]===a?c=t[4]:(c=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:s,children:a}),t[3]=a,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`searches saved / month`}),t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(250),t[6]=u):u=t[6];let d;t[7]===n.estSavedPerMonth?d=t[8]:(d=(0,b.jsxs)(`p`,{className:`rw-caption rw-child`,style:u,children:[`Applying Mavéa's suggestions this week is projected to save about `,n.estSavedPerMonth,` `,`searches a month — a rate estimate from real cadence changes, not a count of searches actually skipped this week.`]}),t[7]=n.estSavedPerMonth,t[8]=d);let p;return t[9]!==c||t[10]!==d?(p=(0,b.jsxs)(b.Fragment,{children:[o,c,l,d]}),t[9]=c,t[10]=d,t[11]=p):p=t[11],p}function ne(){let e=(0,f.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(`p`,{className:`rw-fallback-text rw-child`,style:w(40),children:`Nothing to look back on yet — come back after a week of checks.`}),e[0]=t):t=e[0],t}function A(e){let t=(0,f.c)(70),{onClose:n}=e,i=(0,d.useRef)(null),c;t[0]===n?c=t[1]:(c={onEscape:n},t[0]=n,t[1]=c),r(i,c);let[l]=(0,d.useState)(ie),u=s(),p=a(),m;t[2]!==u||t[3]!==l?(m=o(u,l),t[2]=u,t[3]=l,t[4]=m):m=t[4];let x=m,S;t[5]!==p||t[6]!==l?(S=h(p,l),t[5]=p,t[6]=l,t[7]=S):S=t[7];let C=S,w;t[8]!==p||t[9]!==l?(w=g(p,l),t[8]=p,t[9]=l,t[10]=w):w=t[10];let E=w,D;t[11]!==p||t[12]!==l?(D=_(p,l),t[11]=p,t[12]=l,t[13]=D):D=t[13];let k=D,A;t[14]!==x||t[15]!==C?(A=v(x,C),t[14]=x,t[15]=C,t[16]=A):A=t[16];let j=A,M;t[17]===j?M=t[18]:(M=y(j),t[17]=j,t[18]=M);let N=M,[P,F]=(0,d.useState)(0),I,L;t[19]===N.length?(I=t[20],L=t[21]):(I=()=>{F(e=>Math.min(e,N.length-1))},L=[N.length],t[19]=N.length,t[20]=I,t[21]=L),(0,d.useEffect)(I,L);let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>F(re),t[22]=R):R=t[22];let z=R,B;t[23]===N.length?B=t[24]:(B=()=>F(e=>Math.min(N.length-1,e+1)),t[23]=N.length,t[24]=B);let V=B,H;t[25]===V?H=t[26]:(H=e=>{e.key===`ArrowRight`||e.key===` `?(e.preventDefault(),V()):e.key===`ArrowLeft`&&(e.preventDefault(),z())},t[25]=V,t[26]=H);let U=H,W=N.length>1,G;t[27]!==W||t[28]!==P||t[29]!==N.length?(G=W&&(0,b.jsxs)(`span`,{className:`rw-counter`,"aria-live":`polite`,children:[P+1,` of `,N.length]}),t[27]=W,t[28]=P,t[29]=N.length,t[30]=G):G=t[30];let K;t[31]===n?K=t[32]:(K=(0,b.jsx)(`button`,{type:`button`,className:`rw-close`,onClick:n,"aria-label":`Close`,children:`×`}),t[31]=n,t[32]=K);let q;t[33]!==G||t[34]!==K?(q=(0,b.jsxs)(`div`,{className:`rw-chrome`,children:[G,K]}),t[33]=G,t[34]=K,t[35]=q):q=t[35];let J;t[36]!==W||t[37]!==P?(J=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--prev`,"aria-label":`Previous slide`,onClick:z,disabled:P===0}),t[36]=W,t[37]=P,t[38]=J):J=t[38];let Y;if(t[39]!==E||t[40]!==P||t[41]!==k||t[42]!==x||t[43]!==N||t[44]!==C){let e;t[46]!==E||t[47]!==P||t[48]!==k||t[49]!==x||t[50]!==C?(e=(e,t)=>(0,b.jsxs)(`div`,{className:`rw-slide`,"data-active":t===P||void 0,children:[e===`searches`&&(0,b.jsx)(T,{rewind:x}),e===`moment`&&(0,b.jsx)(ee,{rewind:x}),e===`calls`&&(0,b.jsx)(O,{tally:C,grades:E,quote:k}),e===`saved`&&(0,b.jsx)(te,{rewind:x}),e===`fallback`&&(0,b.jsx)(ne,{})]},e),t[46]=E,t[47]=P,t[48]=k,t[49]=x,t[50]=C,t[51]=e):e=t[51],Y=N.map(e),t[39]=E,t[40]=P,t[41]=k,t[42]=x,t[43]=N,t[44]=C,t[45]=Y}else Y=t[45];let X;t[52]!==W||t[53]!==V||t[54]!==P||t[55]!==N.length?(X=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--next`,"aria-label":`Next slide`,onClick:V,disabled:P===N.length-1}),t[52]=W,t[53]=V,t[54]=P,t[55]=N.length,t[56]=X):X=t[56];let Z;t[57]!==J||t[58]!==Y||t[59]!==X?(Z=(0,b.jsxs)(`div`,{className:`rw-stage`,children:[J,Y,X]}),t[57]=J,t[58]=Y,t[59]=X,t[60]=Z):Z=t[60];let Q;t[61]!==W||t[62]!==P||t[63]!==N?(Q=W&&(0,b.jsx)(`div`,{className:`rw-dots`,children:N.map((e,t)=>(0,b.jsx)(`button`,{type:`button`,className:`rw-dot`,"data-active":t===P||void 0,"aria-label":`Go to slide ${t+1} of ${N.length}`,onClick:()=>F(t)},e))}),t[61]=W,t[62]=P,t[63]=N,t[64]=Q):Q=t[64];let $;return t[65]!==U||t[66]!==q||t[67]!==Z||t[68]!==Q?($=(0,b.jsxs)(`div`,{className:`rw-overlay`,ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Weekly Rewind`,tabIndex:-1,onKeyDown:U,children:[q,Z,Q]}),t[65]=U,t[66]=q,t[67]=Z,t[68]=Q,t[69]=$):$=t[69],$}function re(e){return Math.max(0,e-1)}function ie(){return Date.now()}export{A as RewindOverlay};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RippleOverlay-zcXAHPuJ.js","assets/react-BZJXY1be.js","assets/rolldown-runtime-DkW27tQK.js","assets/compiler-runtime-qQQXpJgv.js","assets/jsx-runtime-DeHZSEgm.js","assets/preload-helper-CiWYd9n-.js","assets/cachedImport-DW0gP14h.js","assets/preloadableLazy-MIX1ApBW.js","assets/lazyRetry-D50B1UMY.js","assets/index-Dk0QapqQ.js","assets/useInView-CXTOAEV3.js","assets/coreIcons-DDTChE1H.js","assets/theme-7IrMJ70_.js","assets/index-DmKgC_TJ.css","assets/useFocusTrap-DBtkeyRy.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/FeatureUseNotice-Dc8joBGM.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/cache-CvbSI-pr.js","assets/buildShip-BgFg98tH.js","assets/parseDiff-D8uBQ9mQ.js","assets/incident-D3bmMmES.js","assets/githubToken-Bwa7V9YT.js","assets/keyVault-Aw5Y2PjT.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/RippleOverlay-_iiZsQVZ.css","assets/useLiveConfig-Cpy0_E_-.js","assets/info-CiqHR5cs.js","assets/providers-BovElgRL.js","assets/http-Lar_UMKb.js","assets/blockTypes-DUDdP3pB.js","assets/attachments-BW-vki-E.js","assets/kokoro-P_fkcX-A.js","assets/spokenText-C88IQJ0M.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./react-BZJXY1be.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{n,t as r}from"./preload-helper-CiWYd9n-.js";import{t as i}from"./lazyRetry-D50B1UMY.js";import{t as a}from"./preloadableLazy-MIX1ApBW.js";import{n as o,t as s}from"./theme-7IrMJ70_.js";import{c,k as l}from"./index-Dk0QapqQ.js";import{t as u}from"./homeTarget-CsO8nY7z.js";var d=e(),f=t();n();var p=a(()=>r(()=>import(`./RippleOverlay-zcXAHPuJ.js`).then(e=>({default:e.RippleOverlay})),__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]))),m=p.Component,h=i(()=>r(()=>import(`./seed-b1xc0dj2.js`),[]));function g(){(0,d.useEffect)(()=>s(o()),[]);let[e,t]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0;return p.preload().catch(()=>{}),h().then(({SEED_SHIP:n})=>{e&&t(n)}),()=>{e=!1}},[]);let[n,i]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0,t=window.setTimeout(()=>{r(async()=>{let{getLiveConfigV2:e,toModelConfig:t}=await import(`./useLiveConfig-Cpy0_E_-.js`).then(e=>e.d);return{getLiveConfigV2:e,toModelConfig:t}},__vite__mapDeps([27,2,1,3,28,23,29,30,31,32])).then(({getLiveConfigV2:t,toModelConfig:n})=>{if(!e)return;let r=n(t());i(r.apiKey?r:null)})},250);return()=>{e=!1,window.clearTimeout(t)}},[]);let a=(0,d.useCallback)(e=>{r(()=>import(`./kokoro-P_fkcX-A.js`).then(e=>e.M).then(t=>t.speak(e,`mavea`)),__vite__mapDeps([33,2,9,1,3,10,4,11,5,7,6,8,12,13,34]))},[]);return e?(0,f.jsx)(l,{label:`Ripple overview`,children:(0,f.jsx)(m,{model:e,cfg:n,speak:a,onClose:()=>{window.location.hash=u().href}})}):(0,f.jsx)(c,{})}export{g as RippleApp};
|
|
@@ -1,4 +1,4 @@
|
|
|
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{t as r}from"./providers-
|
|
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{t as r}from"./providers-BovElgRL.js";import{t as i}from"./json-B0N3XRZU.js";import{n as a}from"./verbatim-DBTj9sPD.js";import{r as o}from"./githubBrowser-BDiuD9dz.js";import{t as s}from"./links--u_phi0x.js";var c=e(),l=t(),u=n(),d={full:{label:`grounded in the repo`,token:`var(--insight)`},partial:{label:`partly grounded`,token:`var(--warning)`},none:{label:`not covered by what Ripple has read`,token:`var(--text-muted)`}},f={newgrad:[`Explain this repo like I’m new`,`Where should I start reading?`],working:[`What’s the blast radius of this change?`,`What would I need to know to review this?`],principal:[`What’s the crux here?`,`What would a principal push back on?`]};function p(e){let t=e.file?e.file.split(`/`).pop()??e.file:`source`;return e.unpinned?`${t} · unverified`:t}function m(e){let t=(0,l.c)(26),{open:n,onClose:r,turns:i,busy:a,onAsk:o,altitude:m,hasModel:g,seed:_,repo:v,gitRef:y,focusFile:b}=e,[x,S]=(0,c.useState)(``),C=(0,c.useRef)(null),w=(0,c.useRef)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{let e=C.current;e&&(e.scrollTop=e.scrollHeight)},t[0]=T):T=t[0];let E;t[1]===i?E=t[2]:(E=[i],t[1]=i,t[2]=E),(0,c.useEffect)(T,E);let D,O;t[3]===_?(D=t[4],O=t[5]):(D=()=>{_&&(S(_.text),w.current?.focus())},O=[_],t[3]=_,t[4]=D,t[5]=O),(0,c.useEffect)(D,O);let k;t[6]!==a||t[7]!==x||t[8]!==o?(k=e=>{let t=(e??x).trim();!t||a||(o(t),S(``))},t[6]=a,t[7]=x,t[8]=o,t[9]=k):k=t[9];let A=k,j=h;if(!n)return null;let M;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,u.jsxs)(`span`,{className:`ripple-ask-title`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-spark`,"aria-hidden":`true`}),`Ask`]}),t[10]=M):M=t[10];let N;t[11]===r?N=t[12]:(N=(0,u.jsxs)(`header`,{className:`ripple-ask-head`,children:[M,(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-min`,onClick:r,"aria-label":`Collapse the ask rail`,children:`✕`})]}),t[11]=r,t[12]=N);let P;t[13]!==m||t[14]!==a||t[15]!==x||t[16]!==b||t[17]!==y||t[18]!==g||t[19]!==v||t[20]!==A||t[21]!==i?(P=g?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`ripple-ask-chips`,role:`group`,"aria-label":`Suggested questions`,children:[f[m].map(e=>(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(e),disabled:a,children:e},e)),b&&(0,u.jsxs)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(`What breaks if I change ${b}?`),disabled:a,children:[`What breaks if I change `,b,`?`]})]}),(0,u.jsxs)(`div`,{className:`ripple-ask-thread`,ref:C,children:[i.length===0&&(0,u.jsx)(`p`,{className:`ripple-ask-empty`,children:`Ask anything about this repo or PR. The answer cites real files — and says so honestly when nothing gathered addresses it.`}),i.map(e=>(0,u.jsxs)(`div`,{className:`ripple-ask-turn`,children:[(0,u.jsx)(`p`,{className:`ripple-ask-q`,children:e.question}),e.status===`pending`&&(0,u.jsxs)(`p`,{className:`ripple-ask-pending`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-dot`,"aria-hidden":`true`}),`Reading the repo…`]}),e.status===`error`&&(0,u.jsx)(`p`,{className:`ripple-ask-err`,children:e.error}),e.status===`done`&&e.answer&&(0,u.jsxs)(`div`,{className:`ripple-ask-a`,children:[(0,u.jsxs)(`span`,{className:`ripple-ask-cover`,"data-coverage":e.answer.coverage,style:{"--cover-color":d[e.answer.coverage].token},children:[(0,u.jsx)(`span`,{className:`ripple-ask-cover-dot`,"aria-hidden":`true`}),d[e.answer.coverage].label]}),e.answer.text&&(0,u.jsx)(`p`,{className:`ripple-ask-text`,children:e.answer.text}),e.answer.citations.length>0&&(0,u.jsx)(`div`,{className:`ripple-ask-cites`,role:`group`,"aria-label":`Sources`,children:e.answer.citations.map((e,t)=>{let n=e.unpinned?null:s(v,y,e.file),r=p(e),i=`${e.file}\n“${e.quote}”`;return n?(0,u.jsxs)(`a`,{className:`ripple-ask-cite`,href:n,target:`_blank`,rel:`noopener noreferrer`,title:i,children:[r,` ↗`]},`${e.file}:${t}`):(0,u.jsx)(`span`,{className:`ripple-ask-cite`,"data-unpinned":e.unpinned?`true`:void 0,title:i,children:r},`${e.file}:${t}`)})})]})]},e.id))]}),(0,u.jsxs)(`form`,{className:`ripple-ask-form`,onSubmit:e=>{e.preventDefault(),A()},children:[(0,u.jsx)(`textarea`,{ref:w,className:`ripple-ask-input`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),A())},rows:1,placeholder:a?`Reading the repo…`:`Ask about this repo or PR…`,"aria-label":`Ask about this repo or PR`}),(0,u.jsx)(`button`,{type:`submit`,className:`ripple-ask-send`,disabled:a||x.trim().length===0,"aria-label":`Ask`,children:`↵`})]})]}):(0,u.jsx)(`div`,{className:`ripple-ask-empty-state`,children:(0,u.jsx)(`p`,{children:`Connect a model in Settings → Live to ask questions about this repo.`})}),t[13]=m,t[14]=a,t[15]=x,t[16]=b,t[17]=y,t[18]=g,t[19]=v,t[20]=A,t[21]=i,t[22]=P):P=t[22];let F;return t[23]!==N||t[24]!==P?(F=(0,u.jsxs)(`section`,{className:`ripple-ask-rail`,"aria-label":`Ask`,onPointerDown:j,onWheel:j,onClick:j,children:[N,P]}),t[23]=N,t[24]=P,t[25]=F):F=t[25],F}function h(e){return e.stopPropagation()}var g=3,_=3e3,v=6e3,y=40,b=40,x=30,S=12,C=6;function w(e,t){return`${e}::${t}`}function T(e,t,n=new Set,r=g){let i=Array.from(new Set(t.toLowerCase().match(/[a-z0-9]{4,}/g)??[]));return i.length===0?[]:e.map((e,t)=>({p:e,i:t})).filter(({p:e})=>!n.has(e)).map(({p:e,i:t})=>{let n=e.toLowerCase();return{p:e,i:t,score:i.reduce((e,t)=>e+ +!!n.includes(t),0)}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score||e.i-t.i).slice(0,r).map(e=>e.p)}async function E(e,t){if(!e.repo||!e.treePaths?.length)return;let n=T(e.treePaths,t,new Set(e.fileCache.keys()));if(n.length===0)return;let r=await Promise.all(n.map(t=>o(t,e.gitRef,e.repo).catch(()=>({ok:!1}))));e.signal?.aborted||r.forEach((t,r)=>{t.ok&&t.content&&e.fileCache.set(n[r],t.content.slice(0,_))})}function D(e,t){let n=[],r=e.pr;return n.push(`REPO: ${r.repo}${r.title?` — ${r.title}`:``}`),r.summary&&n.push(`SUMMARY: ${r.summary}`),r.risks.length&&n.push(`RISKS:\n${r.risks.slice(0,S).map(e=>`- [${e.level}] ${e.text}`).join(`
|
|
2
2
|
`)}`),e.changes.length&&n.push(`CHANGES (${e.changes.length}):\n${e.changes.slice(0,y).map(e=>`- ${e.file} [${e.kind}/${e.risk}]: ${e.intent}${e.why?` — ${e.why}`:``}`).join(`
|
|
3
3
|
`)}`),e.nodes.length&&n.push(`SYSTEM NODES (${e.nodes.length}):\n${e.nodes.slice(0,b).map(e=>{let t=[e.contract,e.problem,e.fix].filter(Boolean).join(` | `);return`- ${e.label}${e.sub?` (${e.sub})`:``}${t?`: ${t}`:``}`}).join(`
|
|
4
4
|
`)}`),e.modules.length&&n.push(`MODULES (${e.modules.length}):\n${e.modules.slice(0,x).map(e=>`- ${e.name}: ${[e.purpose,e.explain].filter(Boolean).join(` `)}`.trim()).join(`
|
|
@@ -31,4 +31,4 @@ Rules:
|
|
|
31
31
|
- "coverage": "full" if the material fully answers the question; "partial" if only part of it does;
|
|
32
32
|
"none" if the material doesn't address it at all.
|
|
33
33
|
- If nothing above addresses the question, set "coverage":"none", give a brief honest answer saying
|
|
34
|
-
so, and return "citations": [].`}function j(e){return typeof e==`string`?e:``}function M(e){let t=String(e??``).toLowerCase().trim();return t===`full`||t===`partial`||t===`none`?t:`partial`}function N(e,t,n){if(!Array.isArray(e))return[];let r=[],i=new Set;for(let
|
|
34
|
+
so, and return "citations": [].`}function j(e){return typeof e==`string`?e:``}function M(e){let t=String(e??``).toLowerCase().trim();return t===`full`||t===`partial`||t===`none`?t:`partial`}function N(e,t,n){if(!Array.isArray(e))return[];let r=[],i=new Set;for(let o of e){if(!o||typeof o!=`object`)continue;let e=o,s=j(e.file).trim(),c=j(e.quote).trim();if(!c)continue;let l=`${s}:${c.replace(/\s+/g,` `).toLowerCase()}`;if(i.has(l))continue;i.add(l);let u=s?t.get(s):void 0,d=!!u&&a(c,u)||!!n&&a(c,n);if(r.push(d?{file:s,quote:c}:{file:s,quote:c,unpinned:!0}),r.length>=C)break}return r}async function P(e,t){let n=e.trim();if(!n||(await E(t,n).catch(()=>void 0),t.signal?.aborted))return{text:``,coverage:`none`,citations:[]};let a=D(t.model,t.lessonDetails),o=t.diffText??``,s;try{s=(await r(t.cfg.provider).generate({system:O,history:[],user:A(n,t.altitude,a,o,t.fileCache),maxTokens:1e3,temperature:0,format:null,...t.signal?{signal:t.signal}:{}},t.cfg)).raw}catch(e){return e instanceof DOMException&&e.name===`AbortError`?{text:``,coverage:`none`,citations:[]}:{text:`Couldn’t reach the model just now.`,coverage:`none`,citations:[]}}if(t.signal?.aborted)return{text:``,coverage:`none`,citations:[]};let c=i(s),l=j(c?.answer).trim(),u=M(c?.coverage),d=N(c?.citations,t.fileCache,o);return l?{text:l,coverage:u,citations:d}:{text:`I couldn’t find this addressed in the repo.`,coverage:`none`,citations:[]}}function F(e,t){let[n,r]=(0,c.useState)([]),[i,a]=(0,c.useState)(!1),o=(0,c.useRef)(e);o.current=e;let s=(0,c.useRef)(t);s.current=t;let l=(0,c.useRef)(null),u=(0,c.useRef)(!1),d=(0,c.useRef)(0),f=(0,c.useCallback)(()=>{l.current?.abort(),l.current=null,u.current=!1,a(!1),r([])},[]);return(0,c.useEffect)(()=>()=>l.current?.abort(),[]),{turns:n,busy:i,ask:(0,c.useCallback)(e=>{if(u.current)return;let t=e.trim(),n=o.current;if(!t||!n)return;let i=new AbortController;l.current=i,u.current=!0,a(!0);let c=`q${d.current+=1}`;r(e=>[...e,{id:c,question:t,status:`pending`}]),P(t,{...n,signal:i.signal}).then(e=>{i.signal.aborted||(u.current=!1,a(!1),r(t=>t.map(t=>t.id===c?{...t,status:`done`,answer:e}:t)),s.current?.(e,t))}).catch(e=>{if(i.signal.aborted)return;u.current=!1,a(!1);let t=e instanceof Error?e.message:`Could not answer.`;r(e=>e.map(e=>e.id===c?{...e,status:`error`,error:t}:e))})},[]),reset:f}}function I(e){let t=(0,l.c)(11),{ctx:n,onClose:r,altitude:i,seed:a,repo:o,gitRef:s,focusFile:c}=e,{turns:d,busy:f,ask:p}=F(n),h=!!n,g;return t[0]!==i||t[1]!==p||t[2]!==f||t[3]!==c||t[4]!==s||t[5]!==r||t[6]!==o||t[7]!==a||t[8]!==h||t[9]!==d?(g=(0,u.jsx)(m,{open:!0,onClose:r,turns:d,busy:f,onAsk:p,altitude:i,hasModel:h,seed:a,repo:o,gitRef:s,focusFile:c}),t[0]=i,t[1]=p,t[2]=f,t[3]=c,t[4]=s,t[5]=r,t[6]=o,t[7]=a,t[8]=h,t[9]=d,t[10]=g):g=t[10],g}export{I as RippleAskController};
|