@mavea/mavea 2.0.1 → 2.1.1
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 +88 -0
- package/PRIVACY.md +9 -2
- package/README.md +7 -1
- package/SECURITY.md +1 -1
- package/TERMS.md +12 -4
- package/TRADEMARKS.md +3 -1
- package/dist/.vite/manifest.json +878 -838
- package/dist/assets/AnnotationLayer-0YQgrjN3.js +2 -0
- package/dist/assets/AnnotationLayer-BRYhJ1LB.css +1 -0
- package/dist/assets/{AppCommandPalette-Cucwjk5N.js → AppCommandPalette-CeNtZzhG.js} +1 -1
- package/dist/assets/{AtlasView-DO_p0TdZ.js → AtlasView-CYZ9sfXb.js} +1 -1
- package/dist/assets/BlockEmpty-B-giiUPy.js +1 -0
- package/dist/assets/{CadenceCard-DxceyiPA.js → CadenceCard-j1V7XOxX.js} +1 -1
- package/dist/assets/{CheckLogRail-vq2lZ7a5.js → CheckLogRail-CPKGKw7i.js} +1 -1
- package/dist/assets/{CommandPalette-Bs6tpdZl.js → CommandPalette-Cz8h94Jd.js} +1 -1
- package/dist/assets/ConversationVideoStudio-BLU1b2u_.js +1 -0
- package/dist/assets/CourseLessonReader-Ci4BguIU.js +2 -0
- package/dist/assets/CourseLessonReader-DNHFQOkX.css +1 -0
- package/dist/assets/{CourseRail-CUa7uIGG.css → CourseRail-BDQIWara.css} +1 -1
- package/dist/assets/{CourseRail-BQmUsG6v.js → CourseRail-DD8gtAn4.js} +1 -1
- package/dist/assets/CoursesApp-CErXxpH-.js +2 -0
- package/dist/assets/{DashPresent-DZcRdu6R.js → DashPresent-w5oqKZpo.js} +1 -1
- package/dist/assets/DashboardDetail-Dej7CPf7.js +2 -0
- package/dist/assets/DashboardLoopGate-DzJol3Os.js +2 -0
- package/dist/assets/DashboardLoopRuntime-CX63-Gn4.js +1 -0
- package/dist/assets/{DashboardSettings-DJon1Q4o.js → DashboardSettings-5tn-dw6G.js} +1 -1
- package/dist/assets/DashboardsApp-BQtz_4UA.js +2 -0
- package/dist/assets/DeepZoomApp-STtNq9C3.js +37 -0
- package/dist/assets/DelegatePanel-C2_s1eW9.js +33 -0
- package/dist/assets/{DemoGallery-BcQ9yz2u.js → DemoGallery-CXoaPF9b.js} +1 -1
- package/dist/assets/{DropSelect-GKioj__f.js → DropSelect-rrPFJVkl.js} +1 -1
- package/dist/assets/{ExportModal-1pWr-c7I.js → ExportModal-BS3He6V7.js} +1 -1
- package/dist/assets/ExportModal-sX8MPVPW.css +1 -0
- package/dist/assets/{ExtractionPreview-TKyfEqwM.js → ExtractionPreview-CQ73RXM8.js} +2 -2
- package/dist/assets/FeatureUseNotice-lFcApjaS.js +1 -0
- package/dist/assets/{FlagshipCommandPalette-D1pv3hfZ.js → FlagshipCommandPalette-D6gjWvTe.js} +1 -1
- package/dist/assets/{FlagshipShowcase-CCFFcaL7.js → FlagshipShowcase-mZDqHQtE.js} +1 -1
- package/dist/assets/{FlashcardsApp-Dbe-8UkQ.js → FlashcardsApp-C8gRaBO8.js} +1 -1
- package/dist/assets/GalleryApp-ChsuVZqR.js +1 -0
- package/dist/assets/{HonestByDesign-ByOR1sRQ.js → HonestByDesign-Czur9n6R.js} +1 -1
- package/dist/assets/{HowItWorks-Dllc30ph.js → HowItWorks-CA9WdZQ6.js} +1 -1
- package/dist/assets/LegalApp-BCnZfHNq.js +1 -0
- package/dist/assets/{LegalMarkdownDocument-CmxHsXlb.js → LegalMarkdownDocument-CNsihJ1F.js} +1 -1
- package/dist/assets/{LegalPageShell-CDD6D6T_.js → LegalPageShell-8HHhJAPo.js} +1 -1
- package/dist/assets/Library-CDgWdTiF.js +1 -0
- package/dist/assets/{LibraryOverlay-CHmubwG3.js → LibraryOverlay-CGDPmvnX.js} +1 -1
- package/dist/assets/LiveApp-CEaISHEZ.css +1 -0
- package/dist/assets/LiveApp-CnTYFYf1.js +79 -0
- package/dist/assets/LiveSettings-Bx7Uu6Fl.js +6 -0
- package/dist/assets/{MindMapViewerDrawer-BLRBWsTz.js → MindMapViewerDrawer-CBLaSq-i.js} +1 -1
- package/dist/assets/{MindShape-CaDuLyGa.js → MindShape-QuVL_EXi.js} +1 -1
- package/dist/assets/{PinToDashboard-ChK2Ou73.js → PinToDashboard-CddhBx85.js} +1 -1
- package/dist/assets/{PlanReview-Dg6VE0xF.js → PlanReview-DCPDkqLj.js} +1 -1
- package/dist/assets/PresentationDeck-DV8AeOrh.js +1 -0
- package/dist/assets/PrismApp-BHcClSEQ.js +2 -0
- package/dist/assets/{PrismAskController-C4MuB8om.js → PrismAskController-BgwijoI2.js} +1 -1
- package/dist/assets/PrismBriefingPlayer-CDkaBWup.js +2 -0
- package/dist/assets/PrismOverlay-5ZVXu4WL.css +1 -0
- package/dist/assets/PrismOverlay-DRWAI9Mh.js +105 -0
- package/dist/assets/PrismWorkbench-B2uSg63W.js +1 -0
- package/dist/assets/{PrivacyApp-CBPMqUEA.js → PrivacyApp-CoFgfPwJ.js} +10 -3
- package/dist/assets/ReplayCard-CLlaKpWg.js +2 -0
- package/dist/assets/ReplayOverlay-W3KwhRaQ.js +1 -0
- package/dist/assets/{RewindOverlay-BO7YgDsW.js → RewindOverlay-okltPbfw.js} +1 -1
- package/dist/assets/{RippleApp-BnIUhIA0.js → RippleApp-CEJvJl-c.js} +2 -2
- package/dist/assets/{RippleAskController-BzdwYcYY.js → RippleAskController-BqnazbZ7.js} +1 -1
- package/dist/assets/{RippleOverlay-C9W7uVOp.js → RippleOverlay-DHnHEYoS.js} +2 -2
- package/dist/assets/{SeeDontRead-ByW9HnOj.js → SeeDontRead-tA-fTWQW.js} +1 -1
- package/dist/assets/ShareModal-Ys5NYDZR.js +2 -0
- package/dist/assets/{ShipCourse-CT_F9oJH.js → ShipCourse-C3pjBELa.js} +1 -1
- package/dist/assets/{SignatureLoop-DejFTZ-Y.js → SignatureLoop-BNjDbepH.js} +1 -1
- package/dist/assets/SynthesisApp-BCsFms4h.js +2 -0
- package/dist/assets/SynthesisOverlay-iqXO09rf.js +66 -0
- package/dist/assets/TemplatePicker-PWw_xyWb.js +1 -0
- package/dist/assets/{TermsApp-ZzlhrXhd.js → TermsApp-B1D2SwN7.js} +13 -5
- package/dist/assets/TopicCanvas-xwDjwqxn.js +2 -0
- package/dist/assets/{TourPrism-Cng4h9Ly.js → TourPrism-Do4evVOo.js} +1 -1
- package/dist/assets/{TrackerTile-DuUsFQTj.js → TrackerTile-Dp7fvG4P.js} +2 -2
- package/dist/assets/{TwoSurfaces-BeYMvVuX.js → TwoSurfaces-CZA6zuue.js} +1 -1
- package/dist/assets/WorldOverlay-CLWtwuSl.css +1 -0
- package/dist/assets/WorldOverlay-EwAFBDvq.js +2 -0
- package/dist/assets/{WowFeatures-D58JgpLg.js → WowFeatures-DRKs2UGb.js} +1 -1
- package/dist/assets/{ZoomDeck-CPG2XQhr.js → ZoomDeck-qJqKFxkc.js} +1 -1
- package/dist/assets/{alternateFinishes-Cgks49KV.js → alternateFinishes-BHcX08Hs.js} +2 -2
- package/dist/assets/annotationAuto-B8_I3PNS.js +1 -0
- package/dist/assets/annotationReel-BA8Fv9Or.js +1 -0
- package/dist/assets/audioTrack-myyVq6Sp.js +1 -0
- package/dist/assets/{BlockEmpty-B82uCse8.js → axis-DHAV38YM.js} +1 -1
- package/dist/assets/backup-DkCsHNEE.js +1 -0
- package/dist/assets/cache-7UEbF3S6.js +1 -0
- package/dist/assets/canvas-OSBUSYbY.js +1 -0
- package/dist/assets/capture-MMxmbgt1.js +2 -0
- package/dist/assets/{catalog-DfIYAG3v.js → catalog-CRekRbKO.js} +1 -1
- package/dist/assets/chapters-DcdG3Lu8.js +1 -0
- package/dist/assets/{codeContext-goNoLAIr.js → codeContext-CFnI3GLf.js} +1 -1
- package/dist/assets/{confirmAdd-CxWIORcu.js → confirmAdd-VLwpBNf_.js} +1 -1
- package/dist/assets/contentVault-XKWjF2FB.js +1 -0
- package/dist/assets/{dashboardEvents-D1OP4ARB.js → dashboardEvents-CiE91_oj.js} +1 -1
- package/dist/assets/{deepen-BhP9OmH3.js → deepen-FZiVqiEc.js} +1 -1
- package/dist/assets/effort-CQY4uJMS.js +39 -0
- package/dist/assets/empty-D51uhW0E.js +1 -0
- package/dist/assets/explode-niun7Zqc.js +15 -0
- package/dist/assets/{format-g3dP8OI3.js → format-BkvssSOr.js} +1 -1
- package/dist/assets/{generate-COfYQFmT.js → generate-BZobrQPX.js} +1 -1
- package/dist/assets/{generateBeats-CtffeoEa.js → generateBeats-Ci99Isyk.js} +1 -1
- package/dist/assets/generateCourse-DPL0bO3L.js +28 -0
- package/dist/assets/generateLive-DzBVo6Yg.js +24 -0
- package/dist/assets/{gesture-Bouqjr3g.js → gesture-BBS5nQEi.js} +2 -2
- package/dist/assets/{githubBrowser-BDiuD9dz.js → githubBrowser-CErQprLW.js} +1 -1
- package/dist/assets/homeTarget-CDc-r2mj.js +1 -0
- package/dist/assets/http-Bqk6nJiH.js +2 -0
- package/dist/assets/index-CFE0vqqO.css +1 -0
- package/dist/assets/{index-CdUH6Eo9.js → index-yJfYsjAB.js} +4 -4
- package/dist/assets/json-J4Y32_i9.js +1 -0
- package/dist/assets/kokoro-DogSQaQB.js +1 -0
- package/dist/assets/{ledger-Cv0LBflx.js → ledger-DHS2di3l.js} +1 -1
- package/dist/assets/lens-DyGK7Owa.js +1 -0
- package/dist/assets/{lib-u95BsX_B.js → lib-Dkb5WBRc.js} +1 -1
- package/dist/assets/liveSchema-Z_39HuDI.js +125 -0
- package/dist/assets/{loader-ChcXMM9W.js → loader-BPVv7hEn.js} +2 -2
- package/dist/assets/{model-CAewjw45.js → model-FR-9md4s.js} +1 -1
- package/dist/assets/{neighborhoods-CqECCmo8.js → neighborhoods-B56WegJs.js} +1 -1
- package/dist/assets/notes-C-RNIoXo.js +1 -0
- package/dist/assets/offers-eBNj_lSP.js +1 -0
- package/dist/assets/{openWorld-BHTJM39n.js → openWorld-B4VY6xO7.js} +1 -1
- package/dist/assets/{owners-HRBX7JN_.js → owners-CP-4Q59L.js} +1 -1
- package/dist/assets/{pen-DtEW1xf4.js → pen-UKrUHlDA.js} +1 -1
- package/dist/assets/{penStrokes-DlHnO9xE.js → penStrokes-CTC3AYiz.js} +1 -1
- package/dist/assets/{perfProbe-DaLsQQBb.js → perfProbe-q5Gt55We.js} +1 -1
- package/dist/assets/{pin-BcKMUOiV.js → pin-BReqt-Wx.js} +1 -1
- package/dist/assets/{planTracker-BwoKEftp.js → planTracker-BA-x4jbw.js} +1 -1
- package/dist/assets/{portal-BIN_aqvw.js → portal-XWyi6FIz.js} +1 -1
- package/dist/assets/prewarm-DOqg5zPk.js +1 -0
- package/dist/assets/providers-CPhoN8j0.js +1 -0
- package/dist/assets/quietHours-kEvnJP2S.js +1 -0
- package/dist/assets/{ready-yBSGJubb.js → ready-_sg3IJkE.js} +1 -1
- package/dist/assets/{registry-DdgeK4fY.js → registry-B7zPuTCI.js} +1 -1
- package/dist/assets/{registry-BFQQpjO2.js → registry-BB0UFcJi.js} +1 -1
- package/dist/assets/registry-BQuygaKz.js +1 -0
- package/dist/assets/{registry-Bl2qfp5V.js → registry-Bjf2Ggs6.js} +1 -1
- package/dist/assets/{registry-CE1T0z9x.js → registry-BmjYillB.js} +1 -1
- package/dist/assets/{registry-DGNSqTxE.js → registry-BodYWiga.js} +1 -1
- package/dist/assets/{registry-Dt0wu9rC.js → registry-BvtWVDCw.js} +1 -1
- package/dist/assets/{registry-BdHj_oIs.js → registry-C3bIc5Kp.js} +1 -1
- package/dist/assets/{registry-C8FuGbOr.js → registry-CQ0bMOV_.js} +1 -1
- package/dist/assets/{registry-CvylL2BN.css → registry-CmWPyj7Q.css} +1 -1
- package/dist/assets/{registry-CcHxIYQN.js → registry-CnDAxBcl.js} +1 -1
- package/dist/assets/{registry-BDXwUn3i.js → registry-CvtHBjkb.js} +1 -1
- package/dist/assets/{registry-Dd1lcXrO.js → registry-Cz5cZREW.js} +2 -2
- package/dist/assets/registry-DTNUXJuV.js +1 -0
- package/dist/assets/{registry-DdVZGvkL.js → registry-Di1fTdpi.js} +1 -1
- package/dist/assets/registry-GxnzELw0.js +1 -0
- package/dist/assets/{registry-Cgo4C0ux.js → registry-JRteQJcE.js} +1 -1
- package/dist/assets/registry-MwJlqlFZ.js +1 -0
- package/dist/assets/{registry-B53EEn8S.js → registry-YrewlFlo.js} +1 -1
- package/dist/assets/{registry-qRfnKTt4.js → registry-uiAoJKXu.js} +1 -1
- package/dist/assets/{relate-CqYpFpsO.js → relate-CsRMEWBw.js} +1 -1
- package/dist/assets/{replay-NognvQfM.js → replay-BlrkSDMO.js} +1 -1
- package/dist/assets/{run-CwMSPOps.js → run-BVgCc5Xi.js} +1 -1
- package/dist/assets/{run-DCQrxgHA.js → run-CW67JOGe.js} +1 -1
- package/dist/assets/{run-CuHaB8wF.js → run-DqsfL9JC.js} +1 -1
- package/dist/assets/{select-Dp-OeZfq.js → select-BuqyXI8k.js} +1 -1
- package/dist/assets/sentenceCase-CLDiNB0f.js +1 -0
- package/dist/assets/shard070-BmNyRhxw.js +1 -0
- package/dist/assets/spokenText-Dy-GZvZV.js +1 -0
- package/dist/assets/store-C9s8Bfz0.js +1 -0
- package/dist/assets/store-CgA7mKy1.js +1 -0
- package/dist/assets/store-D16dGt7I.js +1 -0
- package/dist/assets/{store-BWLbFXiY.js → store-DqOaVRLn.js} +1 -1
- package/dist/assets/store-gfPI5TVE.js +1 -0
- package/dist/assets/useDashboardLoop-CA3LNVME.js +5 -0
- package/dist/assets/{useDashboards-lgQnk2Al.js → useDashboards-B-EjE8FH.js} +1 -1
- package/dist/assets/{useLedger-1WVXef68.js → useLedger-D4cXEwI0.js} +1 -1
- package/dist/assets/useLiveConfig-CvOQTr0s.js +1 -0
- package/dist/assets/useStudy-70Iz4ZVn.js +1 -0
- package/dist/assets/validate-MQG0EcTD.js +4 -0
- package/dist/assets/walkSync-BfK0U5vB.js +1 -0
- package/dist/fonts/LICENSE.txt +2 -0
- package/dist/fonts/PROVENANCE.md +1 -0
- package/dist/fonts/caveat-var-latin.woff2 +0 -0
- package/dist/fonts/fonts.css +10 -0
- package/dist/index.html +6 -2
- package/dist/legal/PRIVACY.md +9 -2
- package/dist/legal/SECURITY.md +1 -1
- package/dist/legal/TERMS.md +12 -4
- package/dist/legal/TRADEMARKS.md +3 -1
- package/docs/media/living-answer.jpg +0 -0
- package/package.json +1 -1
- package/dist/assets/AnnotationLayer-BsAcAd59.js +0 -0
- package/dist/assets/AnnotationLayer-ClU-e6qL.css +0 -1
- package/dist/assets/BriefingPlayer-74mRKyjl.js +0 -1
- package/dist/assets/ConversationVideoStudio-Df892wqs.js +0 -1
- package/dist/assets/CourseLessonReader-COmTQdSK.css +0 -1
- package/dist/assets/CourseLessonReader-DKQimh2S.js +0 -2
- package/dist/assets/CoursesApp-LeqL6dWT.js +0 -2
- package/dist/assets/DashboardDetail-2XL-J4rS.js +0 -2
- package/dist/assets/DashboardLoopGate-B95S4oKR.js +0 -2
- package/dist/assets/DashboardLoopRuntime-Wzk85QXi.js +0 -1
- package/dist/assets/DashboardsApp-ZGuT2QBi.js +0 -2
- package/dist/assets/DeepZoomApp-CPOsar8c.js +0 -37
- package/dist/assets/DelegatePanel-BkTtUMSl.js +0 -33
- package/dist/assets/ExportModal-D4WpAg2c.css +0 -1
- package/dist/assets/FeatureUseNotice-pQe4YHgJ.js +0 -1
- package/dist/assets/GalleryApp-CCLYcEqn.js +0 -1
- package/dist/assets/LegalApp-CpblxmmB.js +0 -1
- package/dist/assets/Library-CVj7R6F4.js +0 -1
- package/dist/assets/LiveApp-CSbjhgzM.js +0 -79
- package/dist/assets/LiveApp-CziqEsOb.css +0 -1
- package/dist/assets/LiveSettings-B4T6x41n.js +0 -6
- package/dist/assets/PresentationDeck-oEd6TXdN.js +0 -1
- package/dist/assets/PrismApp-Bju264hL.js +0 -2
- package/dist/assets/PrismBriefingPlayer-BY0RREUu.js +0 -2
- package/dist/assets/PrismOverlay-BwnF4BEn.css +0 -1
- package/dist/assets/PrismOverlay-DOWyOUVW.js +0 -105
- package/dist/assets/PrismWorkbench-9RonO2uv.js +0 -1
- package/dist/assets/ReplayCard-BnX73r9n.js +0 -2
- package/dist/assets/ReplayOverlay-B-Ok0mEs.js +0 -1
- package/dist/assets/ShareModal-Mo-dkgAZ.js +0 -2
- package/dist/assets/SynthesisApp-6W04mrMU.js +0 -2
- package/dist/assets/SynthesisOverlay-DDyFFiO8.js +0 -66
- package/dist/assets/TopicCanvas-CkqP92SC.js +0 -2
- package/dist/assets/WorldOverlay-D7ay5y4D.css +0 -1
- package/dist/assets/WorldOverlay-DeVpS8HE.js +0 -2
- package/dist/assets/annotationAuto-B2UdfJNj.js +0 -1
- package/dist/assets/annotationReel-K2FYv-3B.js +0 -1
- package/dist/assets/backup-CtEvuZoL.js +0 -1
- package/dist/assets/cache-CvbSI-pr.js +0 -1
- package/dist/assets/canvas-Ct-O9Jok.js +0 -1
- package/dist/assets/capture-CgaD86-q.js +0 -2
- package/dist/assets/chapters-CIvdCeBC.js +0 -1
- package/dist/assets/contentVault-xfUwSJ3i.js +0 -1
- package/dist/assets/effort-Bqti44UZ.js +0 -39
- package/dist/assets/empty-BO1NC9qY.js +0 -1
- package/dist/assets/explode-CPnvJiTg.js +0 -15
- package/dist/assets/friendlyAsk-BBdRZIar.js +0 -1
- package/dist/assets/generateCourse-BldPpgdh.js +0 -28
- package/dist/assets/generateLive-D5M8v38b.js +0 -24
- package/dist/assets/homeTarget-CwFsJYwb.js +0 -1
- package/dist/assets/http-Lar_UMKb.js +0 -2
- package/dist/assets/index-BIUYTk1W.css +0 -1
- package/dist/assets/json-B0N3XRZU.js +0 -1
- package/dist/assets/kokoro-D15HDMcP.js +0 -1
- package/dist/assets/lens-ChFJD9il.js +0 -1
- package/dist/assets/liveSchema-B8Y9HZxd.js +0 -100
- package/dist/assets/notes-BG5pIVAJ.js +0 -1
- package/dist/assets/prewarm-CyvSJKv4.js +0 -1
- package/dist/assets/providers-0DthJW_I.js +0 -1
- package/dist/assets/quietHours-D1nboK5q.js +0 -1
- package/dist/assets/registry-BQzvA61G.js +0 -1
- package/dist/assets/registry-CPImC7mO.js +0 -1
- package/dist/assets/registry-DPBJYRmC.js +0 -1
- package/dist/assets/registry-QbArAJKB.js +0 -1
- package/dist/assets/shard070-Dm9m2a5U.js +0 -1
- package/dist/assets/spokenText-C88IQJ0M.js +0 -1
- package/dist/assets/store-Ba9vzL4H.js +0 -1
- package/dist/assets/store-BwyOArJl.js +0 -1
- package/dist/assets/store-D-f8ZuaK.js +0 -1
- package/dist/assets/store-ruEsXJjU.js +0 -1
- package/dist/assets/useDashboardLoop-C3iCNS8X.js +0 -5
- package/dist/assets/useLiveConfig-B4CmBiAK.js +0 -1
- package/dist/assets/useStudy-CwCIyiTb.js +0 -1
- package/dist/assets/validate-sGUCmPAs.js +0 -4
- package/dist/assets/walkSync-DC9iE0BX.js +0 -1
- /package/dist/assets/{BriefingPlayer-DHV4vMga.css → PrismBriefingPlayer-DHV4vMga.css} +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-Ys5NYDZR.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/useFocusTrap-CJmpNZv2.js","assets/toast-BBNs2h3L.js","assets/spokenText-Dy-GZvZV.js","assets/capture-MMxmbgt1.js","assets/index-yJfYsjAB.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/share--tpc1nLE.js","assets/registry-Cz5cZREW.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/ReelJelly-D5e-jt-8.js","assets/geometry-DXAbnb0J.js","assets/threads-DNfxMTwx.js","assets/FeatureUseNotice-lFcApjaS.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/ShareModal-I_sxHKLv.css","assets/annotationAuto-B8_I3PNS.js","assets/attachments-BW-vki-E.js","assets/pen-UKrUHlDA.js","assets/streamParse-BX0bAppQ.js","assets/providers-CPhoN8j0.js","assets/http-Bqk6nJiH.js","assets/blockTypes-DUDdP3pB.js","assets/info-CiqHR5cs.js","assets/route-CMdTFx0P.js","assets/verbatim-DBTj9sPD.js","assets/citation-BsSvaaer.js","assets/search-ZN7v_P5B.js","assets/annotationReel-BA8Fv9Or.js","assets/PrismAskController-BgwijoI2.js","assets/sourceHost-BV3t2XDb.js","assets/PrismAskController-68gbUO5u.css","assets/PrismBriefingPlayer-CDkaBWup.js","assets/nextFrame-12y0UrAd.js","assets/walkSync-BfK0U5vB.js","assets/kokoro-DogSQaQB.js","assets/PrismBriefingPlayer-DHV4vMga.css","assets/CrossExamPanel-BfeGr5iw.js","assets/CrossExamPanel-BafTqkbf.css","assets/ForecastPanel-OfW39WGS.js","assets/ForecastPanel-Cq_yDhNQ.css","assets/LeverPanel-vco5UK2U.js","assets/dag-C3Xx8pOD.js","assets/LeverPanel-HOEwIr8k.css","assets/WhyMachineOverlay-D2K7y8SA.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/receipts-D7zveV-I.js","assets/types-C42I77wh.js","assets/engine-BiM6INsW.js","assets/engine-CTvOaA86.css","assets/WhyMachineOverlay-Rav-cuMm.css","assets/run-CW67JOGe.js","assets/extractNumbers-CuhagRkd.js","assets/run-DqsfL9JC.js","assets/run-BVgCc5Xi.js","assets/model-FR-9md4s.js","assets/explode-niun7Zqc.js","assets/number-zqlPMliA.js","assets/speed-BOytg6bC.js","assets/cache-7UEbF3S6.js","assets/json-J4Y32_i9.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{E as l,lt as u}from"./index-yJfYsjAB.js";import{t as d}from"./useFocusTrap-CJmpNZv2.js";import{t as f}from"./toast-BBNs2h3L.js";import{r as p}from"./sourceHost-BV3t2XDb.js";import{t as m}from"./penStrokes-CTC3AYiz.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-CPhoN8j0.js";import{n as E,r as D,t as O}from"./cache-7UEbF3S6.js";import{a as k,i as A,t as j}from"./verbatim-DBTj9sPD.js";import{t as M}from"./officeDoc-GU6Cssjf.js";import{n as N,t as P}from"./csv-DAqzYXUs.js";import{a as F,c as I,d as ee,f as L,l as te,m as ne,n as re,o as R,p as ie,r as z,s as ae,t as oe,u as B}from"./pen-UKrUHlDA.js";var V=t();function H(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 se(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 ce(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 le(e,t){let n=[];for(let r of e){let e=j(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=k(r.quote,t[e-1]);if(i){n.push({...r,quote:i,page:e});break}}}return n}var U=null,W=0,ue=new Map;function de(){if(typeof Worker>`u`)return null;if(U)return U;try{return U=new Worker(new URL(`/assets/prismGround.worker-C9hyveb3.js`,``+import.meta.url),{type:`module`}),U.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`)))},U.onerror=()=>{let e=Error(`Grounding worker failed`);for(let t of ue.values())t.reject(e);ue.clear(),U?.terminate(),U=null},U}catch{return U=null,null}}async function G(e,t){let n=[];for(let r=0;r<e.length;r+=16)n.push(...le(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 G(e,t);let r=W+=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 G(e,t)}}var pe=/\.(csv|tsv|tab)$/i,me=/\.(md|markdown)$/i,he=/\.(json|jsonl|ndjson)$/i,K=/\.(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 ve(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 ye(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:be(e)}function be(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 xe(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 Se(e,t,n){if(!n.trim())return null;let r;return r=pe.test(e)||t===`text/csv`?ve(n):me.test(e)?ye(n):he.test(e)||t===`application/json`||K.test(e)?xe(n):be(n),r.length>0?r:null}function Ce(e,t,n){return Se(e,t,new TextDecoder(`utf-8`).decode(n))}var we=null,Te=0,Ee=new Map;function De(){if(typeof Worker>`u`)return null;if(we)return we;try{return we=new Worker(new URL(`/assets/prismExtract.worker-OxGWMXXN.js`,``+import.meta.url),{type:`module`}),we.onmessage=e=>{let t=e.data,n=Ee.get(t.id);n&&(Ee.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`)))},we.onerror=()=>{let e=Error(`Document extraction worker failed`);for(let t of Ee.values())t.reject(e);Ee.clear(),we?.terminate(),we=null},we}catch{return we=null,null}}function Oe(e,t){let n=De();if(!n)return null;let r=Te+=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)=>{Ee.set(r,{attachment:t,resolve:e,reject:s});try{n.postMessage(a,o)}catch(e){Ee.delete(r),i&&i.byteLength>0&&(t.bytes=i),s(e instanceof Error?e:Error(`Could not start document extraction`))}})}function ke(){return new Promise(e=>setTimeout(e,0))}async function Ae(e,t){await ke();let n=await x(t);return await ke(),e===`office`?M(t.name,n):Ce(t.name,t.mime,n)}async function je(e){let t=Oe(`office`,e);try{return t?await t:await Ae(`office`,e)}catch{return await Ae(`office`,e)}}async function Me(e){let t=Oe(`text`,e);try{return t?await t:await Ae(`text`,e)}catch{return await Ae(`text`,e)}}var Ne=[`load-bearing`,`supporting`,`context`];function Pe(e){let t=String(e??``).toLowerCase().trim();return Ne.includes(t)?t:`supporting`}var Fe=30,Ie=40,Le=2e3,Re=220,ze=700,Be=`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 ${Ie} pages, in reading order.`;async function Ve(e,t,n){try{return se((await T(t.provider).generate({system:`You pick the most important pages of a document and return strict JSON only.`,history:[],user:`${Be}\n\n${H(e,Re)}`,attachments:[],maxTokens:ze,temperature:0,format:null,...n?{signal:n}:{}},t)).raw,e.length,Ie)}catch{return se(`{}`,e.length,Ie)}}var He=`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.`,Ue=`${He}
|
|
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 We(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 Ge(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 Ke(e){return typeof e==`string`?e:``}function qe(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 Je(e){let t=Ge(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=Ke(t.quote),r=Number(t.page);!n||!Number.isInteger(r)||i.push({quote:n,page:r,kind:Ke(t.kind)||void 0,title:Ke(t.title)||void 0,ask:Ke(t.ask)||void 0,role:Ke(t.role)||void 0,region:Ke(t.region)||void 0,...Number.isInteger(Number(t.contradictsPage))?{contradictsPage:Number(t.contradictsPage)}:{},...qe(t.box)?{box:qe(t.box)}:{}})}return i}function Ye(e){let t=e.replace(/\.pdf$/i,``).trim();return t.length>28?t.slice(0,27).trimEnd()+`…`:t||`Document`}function Xe(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 Ze(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 Qe(e){let t=String(e);return t===`agrees`?`agrees`:t===`in-tension`?`in-tension`:`contradicts`}function $e(e,t){return[e,t].sort().join(`|`)}async function et(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 je(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,Fe),u=l.map((t,n)=>({name:`${e.name} — slide ${n+1}`,mime:t.mime,data:t.data,size:0})))}else s=o?await Me(e):await L(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>Ie?await Ve(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,Ie),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?Ue:v?`${He}\n\n${ce(s,v,Le,d)}`:`${He}\n\n${We(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=Je(O.raw),A=f?tt(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:Pe(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 tt(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 nt(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)=>et(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=Ze(c),d=i.length>1;if(!d){let e=await at(c,t,u,n);u.push(...e)}if(d&&o.filter(e=>e.claims.length>0).length>1){let e=await ot(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=`${Ye(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:Xe(p),threads:u},proposed:l,corpus:o.map(e=>e.pages)}}function rt(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 it(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 at(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:it(e),maxTokens:1024,temperature:0,format:null,...r?{signal:r}:{}},t)).raw}catch{return[]}let o=Ge(a),s=o&&typeof o==`object`&&Array.isArray(o.pairs)?o.pairs:[],c=[],l=new Set(n.map(e=>$e(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=$e(n.id,r.id);l.has(a)||(l.add(a),c.push({a:n.id,b:r.id,relation:Qe(t.relation)}))}return c}async function ot(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:rt(e),maxTokens:1024,temperature:0,format:null,...n?{signal:n}:{}},t)).raw}catch{return[]}let a=Ge(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=Qe(String(t.relation)),o=$e(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 st=`prism-map`,ct=`prism-corpus`,lt=4096;function ut(e){if(e.length<=lt*3)return D(e);let t=Math.floor((e.length-lt)/2);return D(e.slice(0,lt)+e.slice(t,t+lt)+e.slice(-4096))}function dt(e){let t=`${e.name}|${e.size}|${e.mime}`;return e.file?`${t}|${e.file.lastModified}`:`${t}|${ut(e.data)}`}function ft(e,t,n){let r=t.map(dt).join(`||`);return`${e}:${D(r)}|${n.provider}:${n.model}|v1`}var pt=4e6;async function mt(e){let t=await O(e);return t?.spec?.claims?.length?t:null}async function ht(e,t){try{if(JSON.stringify(t).length>pt)return}catch{return}await E(e,t)}function gt(e){return{name:e.name,mime:e.mime,size:e.size,data:``}}function _t(e,t){if(!e)return null;let n=new Map(t.map(e=>[`${e.name}|${e.size}|${e.mime}`,e]));return e.map(e=>n.get(`${e.name}|${e.size}|${e.mime}`)??e)}function vt(e,t){return ft(st,e,t)}function yt(e,t){return ft(ct,e,t)}var bt=e=>mt(e),xt=e=>mt(e),St=(e,t)=>ht(e,t),q=(e,t)=>ht(e,{...t,sourcesAtt:t.sourcesAtt?.map(gt)??null}),J=900;function Ct(e){let[t,n]=(0,V.useState)(`idle`),[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(null),[s,c]=(0,V.useState)(0),[l,u]=(0,V.useState)(null),d=(0,V.useRef)(null),f=(0,V.useRef)(null),p=(0,V.useRef)(0),m=(0,V.useCallback)(()=>{d.current?.abort(),d.current=null,f.current!==null&&(clearTimeout(f.current),f.current=null)},[]);(0,V.useEffect)(()=>m,[m]);let h=(0,V.useCallback)(()=>{m(),p.current+=1,n(`idle`),i(null),o(null),c(0),u(null)},[m]);return{phase:t,spec:r,corpus:a,proposed:s,error:l,explode:(0,V.useCallback)((t,r)=>{if(!e){u(`Connect a model that reads documents (Anthropic or Gemini) to explode one.`),n(`error`);return}m();let a=p.current+=1,s=new AbortController;d.current=s,i(null),o(null),c(0),u(null),n(`igniting`),f.current=setTimeout(()=>{p.current===a&&n(e=>e===`igniting`?`blooming`:e)},J);let l=vt(Array.isArray(t)?t:[t],e),h=e=>{c(e.proposed),i(e.spec),o(e.corpus),n(`settled`)};(async()=>{try{if(!r?.fresh){let e=await bt(l);if(p.current!==a)return;if(e){h(e);return}}let i=await nt(t,e,s.signal);if(p.current!==a)return;if(c(i.proposed),i.spec){let e={spec:i.spec,corpus:i.corpus??null,proposed:i.proposed};h(e),St(l,e)}else u(i.error??`This document could not be mapped.`),n(`error`)}catch(e){if(p.current!==a||s.signal.aborted)return;u(e instanceof Error?e.message:`Mapping failed.`),n(`error`)}})()},[e,m]),reset:h}}var wt=n(),Tt=.15,Y=4;function Et(e,t,n,r,i){let a=(0,wt.c)(31),[o,s]=(0,V.useState)(!1),c=(0,V.useRef)(null),l=(0,V.useRef)(!1),u=(0,V.useRef)(`auto`),d=(0,V.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,V.useRef)(f),m=(0,V.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(Tt,Math.min(Y,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(Tt,Math.min(Y,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,V.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(Tt,Math.min(Y,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,N;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)},N=[e,j,O],a[19]=e,a[20]=j,a[21]=M,a[22]=N):(M=a[21],N=a[22]),(0,V.useEffect)(M,N);let P;a[23]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{e.button===0&&(c.current={id:e.pointerId,x:e.clientX,y:e.clientY,moved:!1},l.current=!1)},a[23]=P):P=a[23];let F=P,I;a[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=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]=I):I=a[24];let ee=I,L;a[25]===Symbol.for(`react.memo_cache_sentinel`)?(L=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]=L):L=a[25];let te=L,ne;return a[26]!==S||a[27]!==w||a[28]!==o||a[29]!==A?(ne={worldRef:b,panning:o,fit:S,frame:w,zoomBy:A,onPointerDown:F,onPointerMove:ee,onPointerUp:te,movedRef:l},a[26]=S,a[27]=w,a[28]=o,a[29]=A,a[30]=ne):ne=a[30],ne}var X=1360,Dt=2.39996322;function Z(e){let t=X/820,n=e*240*136,r=Math.max(X*820,n/.22),i=Math.sqrt(r/t);return{w:Math.round(i*t),h:Math.round(i)}}function Ot(e,t,n){let{w:r,h:i}=n?{w:n.width,h:n.height}:Z(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 kt(e,t,n){let r=Ot({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:At(r,o,l,s)}}function At(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 jt=null,Mt=0,Nt=new Map;function Pt(){if(typeof Worker>`u`)return null;if(jt)return jt;try{return jt=new Worker(new URL(`/assets/prismLayout.worker-CJa4orCT.js`,``+import.meta.url),{type:`module`}),jt.onmessage=e=>{let t=e.data,n=Nt.get(t.id);n&&(Nt.delete(t.id),t.ok&&t.result?n.resolve(t.result):n.reject(Error(t.error??`Layout failed`)))},jt.onerror=()=>{let e=Error(`Layout worker failed`);for(let t of Nt.values())t.reject(e);Nt.clear(),jt?.terminate(),jt=null},jt}catch{return jt=null,null}}function Ft(e){let t=Pt();if(!t)return null;let n=Mt+=1;return new Promise((r,i)=>{Nt.set(n,{resolve:r,reject:i}),t.postMessage({...e,id:n,palette:[...e.palette]})})}async function It(e,t){try{return await(Ft({kind:`prism`,spec:e,palette:t})??new Promise(n=>setTimeout(()=>n(Ot(e,t)),0)))}catch{return new Promise(n=>setTimeout(()=>n(Ot(e,t)),0))}}async function Lt(e,t){try{return await(Ft({kind:`corpus`,spec:e,palette:t})??new Promise(n=>setTimeout(()=>n(kt(e,t)),0)))}catch{return new Promise(n=>setTimeout(()=>n(kt(e,t)),0))}}var Q=r();function Rt(e){let t=(0,wt.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,Q.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,Q.jsx)(`strong`,{children:n}),t[6]=n,t[7]=c);let l;t[8]===r?l=t[9]:(l=(0,Q.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,Q.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,Q.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,Q.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 zt=4;function Bt(e,t){let n=(0,wt.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)<zt)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,V.useEffect)(r,i)}function Vt({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 Bt(g,_),(0,Q.jsxs)(`aside`,{className:`prism-page`,"aria-label":e,children:[(0,Q.jsxs)(`header`,{className:`prism-page-head`,children:[(0,Q.jsxs)(`span`,{className:`prism-page-tag`,style:{color:n},children:[t,` · `,i??`SOURCE p.${r}`]}),(0,Q.jsx)(`span`,{className:`prism-page-title`,children:o?`${o} — ${a}`:a}),s&&c&&(0,Q.jsx)(Rt,{page:r,pageCount:s,onPageChange:c}),l&&(0,Q.jsxs)(`div`,{className:`prism-page-zoom`,"aria-label":`Zoom the page`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:l.zoomOut,"aria-label":`Zoom out`,children:`−`}),(0,Q.jsx)(`button`,{type:`button`,onClick:l.zoomIn,"aria-label":`Zoom in`,children:`+`}),u===`fit`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,onClick:l.fitWidth,"aria-label":`Fit width`,title:`Fit width`,children:`↔`}),(0,Q.jsx)(`button`,{type:`button`,onClick:l.fitScreen,"aria-label":`Fit whole page`,title:`Fit page`,children:`⊡`})]})]}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-page-close`,onClick:d,"aria-label":f,children:`✕`})]}),(0,Q.jsx)(`div`,{className:`prism-page-scroll`+(_?` is-pannable`:``),ref:g,children:v}),p&&p.length>0&&m&&(0,Q.jsxs)(`nav`,{className:`prism-page-conns`,"aria-label":`Connected claims`,children:[(0,Q.jsxs)(`span`,{className:`prism-page-conns-label`,children:[`Connected (`,p.length,`)`]}),(0,Q.jsx)(`div`,{className:`prism-page-conns-list`,children:p.map(e=>(0,Q.jsxs)(`button`,{type:`button`,className:`prism-page-conn`,onClick:()=>m(e.id),title:`Go to “${e.title}”`,children:[e.title,` →`]},e.id))})]}),(0,Q.jsx)(`footer`,{className:`prism-page-foot`,children:h})]})}function Ht(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 Ut({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,V.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,Q.jsxs)(Q.Fragment,{children:[(d.length>0||p)&&(0,Q.jsxs)(`div`,{className:`prism-page-marks`,style:{transform:`scale(${t})`,transformOrigin:`0 0`},"aria-hidden":`true`,children:[p&&(0,Q.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,Q.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,Q.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,Q.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,Q.jsxs)(`g`,{style:{"--ink-delay":`${t*450}ms`},children:[(0,Q.jsx)(`path`,{className:`prism-pen-halo`,d:e.d,pathLength:1,fill:e.fill?`currentColor`:`none`}),(0,Q.jsx)(`path`,{className:`prism-pen-stroke`,d:e.d,pathLength:1,fill:e.fill?`currentColor`:`none`}),e.head&&(0,Q.jsx)(`path`,{className:`prism-pen-head`,d:e.head,pathLength:1,fill:`none`}),e.label&&(0,Q.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 Wt({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,Q.jsxs)(Q.Fragment,{children:[(0,Q.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,Q.jsxs)(`g`,{style:{"--ink-delay":`${400+r*500}ms`,color:e.color},children:[(0,Q.jsx)(`path`,{className:`prism-note-arrow`,d:s,pathLength:1,fill:`none`}),(0,Q.jsx)(`path`,{className:`prism-note-arrow-head`,d:c,pathLength:1,fill:`none`})]},r)})},`na-`+r),(0,Q.jsx)(`div`,{className:`prism-margin`,style:{width:190,left:i+24},children:e.map((e,t)=>(0,Q.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 Gt(e,t,n){let r=(0,V.useRef)(n);r.current=n;let[i,a]=(0,V.useState)({w:0,h:0}),o=(0,V.useRef)(i),[s,c]=(0,V.useState)(1),l=(0,V.useRef)(`width`),u=(0,V.useRef)(!1),d=(0,V.useRef)(!1),f=(0,V.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,V.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,V.useCallback)(()=>{l.current=`manual`,c(e=>Math.min(4,e*1.25))},[]),h=(0,V.useCallback)(()=>{l.current=`manual`,c(e=>Math.max(.2,e/1.25))},[]),g=(0,V.useCallback)((e=!1)=>{l.current=`width`,u.current=!0,d.current=e,c(1)},[]),_=(0,V.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,V.useRef)(null);return(0,V.useLayoutEffect)(()=>{let n=e.current;if(!n||!t||typeof ResizeObserver>`u`)return;let a=i.w/B(),o=new ResizeObserver(()=>{l.current===`width`?f():l.current===`screen`&&p();let e=r.current?.onSettledGrow;if(!e)return;let t=ie(n.clientWidth)*B(),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 Kt({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,V.useRef)(null),x=!!o?.trim()||(a??[]).some(e=>!!e.note?.trim()),S=(0,V.useRef)(null),C=(0,V.useRef)(null),[w,T]=(0,V.useState)(`loading`),[E,D]=(0,V.useState)([]),[O,k]=(0,V.useState)([]),[A,j]=(0,V.useState)(null),[M,N]=(0,V.useState)(0),P=Gt(S,w===`ready`,{gutterReserve:x?218:0,onSettledGrow:(0,V.useCallback)(()=>N(e=>e+1),[])}),{zoom:F,dims:I,setDims:ee,resetForNewContent:L}=P,te=(a??[]).map(e=>e.quote).join(`\0`),re=(0,V.useRef)(null);(0,V.useEffect)(()=>{let t=!1,i=re.current,a=!i||i.pdf!==e||i.page!==n||i.quote!==r||i.isFigure!==p||i.alsoKey!==te;re.current={pdf:e,page:n,quote:r,isFigure:p,alsoKey:te};let o=S.current?.clientWidth??0,s=ie(o);a&&(T(`loading`),D([]),k([]),j(null),L(o===0));let c=te?te.split(`\0`):[];return(async()=>{let i=await ne(e,n,r,s,p,c);return i||t?i:(await new Promise(e=>window.setTimeout(e,120)),t?null:ne(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),ee({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,te,M,L,ee]);let R=I.w*F,z=I.h*F,ae=`${t}:${n}:${r}`,oe=(0,V.useMemo)(()=>I.w===0?[]:Ht(E,O,i,o,a,F),[I.w,E,O,o,a,i,F]);(0,V.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:I.w,imgH:I.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:ae})},[s,w,r,u,I,E,A,p,ae]);let B={dims:I,rects:E,alsoRects:O,figure:A};return(0,Q.jsxs)(Vt,{ariaLabel:`Source page ${n}`,kindLabel:d,color:i,page:n,title:f,docName:m?.replace(/\.pdf$/i,``),pageCount:v,onPageChange:y,zoom:w===`ready`?P: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,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Rendering page `,n,`…`]}),w===`failed`&&(0,Q.jsxs)(`div`,{className:`prism-page-fallback`,role:`status`,children:[(0,Q.jsxs)(`span`,{className:`prism-page-fallback-kicker`,children:[`Source excerpt · page `,n]}),(0,Q.jsx)(`strong`,{children:`Page preview unavailable`}),r.trim()?(0,Q.jsxs)(`blockquote`,{children:[`“`,r.trim(),`”`]}):(0,Q.jsx)(`p`,{children:`The original file is still attached. Try another page or reopen the document.`}),(0,Q.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,Q.jsxs)(`div`,{className:`prism-page-unit`,style:{width:R?R+(oe.length>0?218:0):void 0,display:w===`ready`?void 0:`none`},children:[(0,Q.jsxs)(`div`,{className:`prism-page-frame`,style:{width:R||void 0,height:z||void 0},children:[(0,Q.jsx)(`div`,{className:`prism-page-holder`,ref:b}),w===`ready`&&(0,Q.jsx)(Ut,{geometry:B,zoom:F,color:i,quote:r,also:a,isFigure:p,penOn:s,penColor:c,penAccent:l,seed:ae})]}),w===`ready`&&(0,Q.jsx)(Wt,{entries:oe,dims:I,zoom:F,seed:ae})]})]})}function qt(e){let t=(0,wt.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,V.useRef)(null),h=(0,V.useRef)(null),[g,_]=(0,V.useState)(`loading`),v=Gt(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,V.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 N=g===`ready`?v:void 0,P=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.`,F;t[11]!==a||t[12]!==k||t[13]!==O||t[14]!==n||t[15]!==w||t[16]!==r||t[17]!==i||t[18]!==g?(F=n?(0,Q.jsxs)(`figure`,{className:`prism-slide-figure`,children:[(0,Q.jsx)(`div`,{className:`prism-slide-stage`,style:{width:O||void 0,height:k||void 0,display:g===`ready`?void 0:`none`},children:(0,Q.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,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Rendering slide `,r,`…`]}),g===`failed`&&(0,Q.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,Q.jsxs)(`figcaption`,{className:`prism-slide-quote`,style:{borderColor:a},children:[(0,Q.jsx)(`span`,{className:`prism-slide-quote-label`,style:{color:a},children:`Mavéa read this on the slide`}),`“`,i,`”`]})]}):(0,Q.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]=F):F=t[19];let I;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]!==N||t[32]!==P||t[33]!==F||t[34]!==s?(I=(0,Q.jsx)(Vt,{ariaLabel:A,kindLabel:o,color:a,page:r,pageLabel:j,title:s,docName:M,pageCount:f,onPageChange:p,zoom:N,onClose:d,closeLabel:`Close source slide`,connections:l,onNavigate:u,scrollRef:m,panBody:!0,footer:P,children:F}),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]=N,t[32]=P,t[33]=F,t[34]=s,t[35]=I):I=t[35],I}function Jt(e){let t=[],n=``;for(let r=0;r<e.length;r+=1){let i=A(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 Yt(e,t,n){let r=A(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 Xt(e,t,n){if(!e)return[];let{norm:r,map:i}=Jt(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=Yt(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 Zt={dims:{w:0,h:0},rects:[],alsoRects:[]};function $(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 Qt(e,t,n){let[r,i]=(0,V.useState)(Zt);return(0,V.useEffect)(()=>{let n=e.current;if(!n){i(Zt);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=>$(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($(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 $t=680,en=14;function tn(e,t,n){if(e===`primary`)return t;let r=Number(e.slice(5));return n?.[r]?.color??t}function nn(e){let t=(0,wt.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,V.useState)(null),[T,E]=(0,V.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)?je(n).then(on):Me(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,V.useEffect)(O,k);let A=D??C,j=D?`ready`:T,M=A?.[a-1]??``,N;t[4]!==c||t[5]!==M||t[6]!==o?(N=Xt(M,o,c),t[4]=c,t[5]=M,t[6]=o,t[7]=N):N=t[7];let P=N,F=P.some(an),I=(0,V.useRef)(null),ee=(0,V.useRef)(null),L=!!l?.trim()||(c??[]).some(rn),te=L?218:0,ne;t[8]===te?ne=t[9]:(ne={gutterReserve:te},t[8]=te,t[9]=ne);let re=Gt(I,j===`ready`,ne),{zoom:R,resetForNewContent:ie}=re,z=(0,V.useRef)(null),ae,oe;t[10]!==n||t[11]!==a||t[12]!==ie?(ae=()=>{let e=z.current;z.current={doc:n,page:a},(!e||e.doc!==n||e.page!==a)&&ie()},oe=[n,a,ie],t[10]=n,t[11]=a,t[12]=ie,t[13]=ae,t[14]=oe):(ae=t[13],oe=t[14]),(0,V.useEffect)(ae,oe);let B;t[15]===P?B=t[16]:(B=[P],t[15]=P,t[16]=B);let H=Qt(ee,R,B),se;t[17]!==H.alsoRects||t[18]!==H.dims||t[19]!==H.rects?(se={dims:H.dims,rects:H.rects,alsoRects:H.alsoRects},t[17]=H.alsoRects,t[18]=H.dims,t[19]=H.rects,t[20]=se):se=t[20];let ce=se,le;t[21]!==c||t[22]!==s||t[23]!==H.alsoRects||t[24]!==H.dims.w||t[25]!==H.rects||t[26]!==l||t[27]!==R?(le=H.dims.w===0?[]:Ht(H.rects,H.alsoRects,s,l,c,R),t[21]=c,t[22]=s,t[23]=H.alsoRects,t[24]=H.dims.w,t[25]=H.rects,t[26]=l,t[27]=R,t[28]=le):le=t[28];let U=le,W=`${i}:${a}:${o}`,ue;t[29]!==H.dims.h||t[30]!==H.dims.w||t[31]!==H.rects||t[32]!==p||t[33]!==u||t[34]!==o||t[35]!==W||t[36]!==j?(ue=()=>{!u||j!==`ready`||!o.trim()||!p||H.dims.w===0||p({pageImage:``,imgW:Math.max(1,Math.round(H.dims.w)),imgH:Math.max(1,Math.round(H.dims.h)),rects:H.rects,isFigure:!1,seed:W})},t[29]=H.dims.h,t[30]=H.dims.w,t[31]=H.rects,t[32]=p,t[33]=u,t[34]=o,t[35]=W,t[36]=j,t[37]=ue):ue=t[37];let de;t[38]!==H||t[39]!==p||t[40]!==u||t[41]!==o||t[42]!==W||t[43]!==j?(de=[u,j,o,p,H,W],t[38]=H,t[39]=p,t[40]=u,t[41]=o,t[42]=W,t[43]=j,t[44]=de):de=t[44],(0,V.useEffect)(ue,de);let G=L?218:0,fe=`Source page ${a}`,pe;t[45]===g?pe=t[46]:(pe=g?.replace(/\.docx$/i,``),t[45]=g,t[46]=pe);let me=j===`ready`?re:void 0,he=o.trim()?j===`ready`&&F?`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.`,K;t[47]!==a||t[48]!==j?(K=j===`loading`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading page `,a,`…`]}),t[47]=a,t[48]=j,t[49]=K):K=t[49];let ge;t[50]!==a||t[51]!==j?(ge=j===`failed`&&(0,Q.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]=ge):ge=t[52];let _e;t[53]!==c||t[54]!==s||t[55]!==H.dims||t[56]!==G||t[57]!==U||t[58]!==f||t[59]!==d||t[60]!==u||t[61]!==o||t[62]!==W||t[63]!==P||t[64]!==j||t[65]!==ce||t[66]!==R?(_e=j===`ready`&&(0,Q.jsxs)(`div`,{className:`prism-doc-unit`,style:{maxWidth:$t+G},children:[(0,Q.jsxs)(`div`,{className:`prism-doc-sheet prism-doc-text`,ref:ee,style:{width:G?`calc(100% - ${G}px)`:`100%`,maxWidth:$t,fontSize:`${en*R}px`},children:[P.map((e,t)=>e.anchor?(0,Q.jsx)(`mark`,{"data-prism-anchor":e.anchor,className:`prism-office-mark`,style:{background:`color-mix(in oklab, ${tn(e.anchor,s,c)} 30%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${tn(e.anchor,s,c)} 55%, transparent)`},children:e.text},t):(0,Q.jsx)(V.Fragment,{children:e.text},t)),(0,Q.jsx)(Ut,{geometry:ce,zoom:R,color:s,quote:o,also:c,penOn:u,penColor:d,penAccent:f,seed:W})]}),(0,Q.jsx)(Wt,{entries:U,dims:H.dims,zoom:R,seed:W})]}),t[53]=c,t[54]=s,t[55]=H.dims,t[56]=G,t[57]=U,t[58]=f,t[59]=d,t[60]=u,t[61]=o,t[62]=W,t[63]=P,t[64]=j,t[65]=ce,t[66]=R,t[67]=_e):_e=t[67];let ve;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]!==fe||t[77]!==pe||t[78]!==me||t[79]!==he||t[80]!==K||t[81]!==ge||t[82]!==_e||t[83]!==h?(ve=(0,Q.jsxs)(Vt,{ariaLabel:fe,kindLabel:m,color:s,page:a,title:h,docName:pe,pageCount:x,onPageChange:S,zoom:me,zoomVariant:`scale`,onClose:y,closeLabel:`Close source page`,connections:_,onNavigate:v,scrollRef:I,footer:he,children:[K,ge,_e]}),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]=fe,t[77]=pe,t[78]=me,t[79]=he,t[80]=K,t[81]=ge,t[82]=_e,t[83]=h,t[84]=ve):ve=t[84],ve}function rn(e){return!!e.note?.trim()}function an(e){return e.anchor===`primary`}function on(e){return e.pages}var sn=960,cn=540,ln={w:sn,h:cn},un=[];function dn(e,t,n){if(e===`primary`)return t;let r=Number(e.slice(5));return n?.[r]?.color??t}function fn(e,t,n,r){return e.map((e,i)=>e.anchor?(0,Q.jsx)(`mark`,{"data-prism-anchor":e.anchor,className:`prism-office-mark`,style:{background:`color-mix(in oklab, ${dn(e.anchor,t,n)} 30%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${dn(e.anchor,t,n)} 55%, transparent)`},children:e.text},`${r}-${i}`):(0,Q.jsx)(V.Fragment,{children:e.text},`${r}-${i}`))}function pn(e){return e>70?30:e>40?34:40}function mn(e){return e<=4?22:e<=7?19:e<=11?16:14}function hn(e){return e<=220?20:e<=500?17:e<=900?15:13}function gn(e){let t=(0,wt.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,V.useState)(null),[C,w]=(0,V.useState)(void 0),[T,E]=(0,V.useState)(`loading`),D,O;t[0]===n?(D=t[1],O=t[2]):(D=()=>{let e=!1;return E(`loading`),je(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,V.useEffect)(D,O);let k=(0,V.useRef)(null),A=(0,V.useRef)(null),j=c?.trim()||(s??[]).some(Sn)?218:0,M;t[3]===j?M=t[4]:(M={gutterReserve:j},t[3]=j,t[4]=M);let N=Gt(k,T===`ready`,M),{zoom:P,dims:F,setDims:I,resetForNewContent:ee,fitScreen:L}=N,te;t[5]!==L||t[6]!==ee||t[7]!==I?(te=()=>{let e=k.current?.clientWidth??0;ee(e===0),I(ln),L()},t[5]=L,t[6]=ee,t[7]=I,t[8]=te):te=t[8];let ne;t[9]!==n||t[10]!==L||t[11]!==i||t[12]!==ee||t[13]!==I?(ne=[n,i,ee,I,L],t[9]=n,t[10]=L,t[11]=i,t[12]=ee,t[13]=I,t[14]=ne):ne=t[14],(0,V.useEffect)(te,ne);let re=x?.[i-1]??``,R=C?.[i-1],ie;t[15]===R?ie=t[16]:(ie=!!R&&(!!R.title?.trim()||R.body.some(xn)),t[15]=R,t[16]=ie);let z=ie,ae;t[17]!==z||t[18]!==R?.title?(ae=z?R?.title?.trim():void 0,t[17]=z,t[18]=R?.title,t[19]=ae):ae=t[19];let oe=ae,B=z?R?.body??un:un,H;t[20]!==s||t[21]!==oe||t[22]!==a?(H=oe?Xt(oe,a,s):[],t[20]=s,t[21]=oe,t[22]=a,t[23]=H):H=t[23];let se=H,ce;if(t[24]!==s||t[25]!==B||t[26]!==a){let e;t[28]!==s||t[29]!==a?(e=e=>Xt(e,a,s),t[28]=s,t[29]=a,t[30]=e):e=t[30],ce=B.map(e),t[24]=s,t[25]=B,t[26]=a,t[27]=ce}else ce=t[27];let le=ce,U;t[31]!==s||t[32]!==z||t[33]!==re||t[34]!==a?(U=z?[]:Xt(re,a,s),t[31]=s,t[32]=z,t[33]=re,t[34]=a,t[35]=U):U=t[35];let W=U,ue=z?se.some(bn)||le.some(vn):W.some(_n),de;t[36]!==le||t[37]!==W||t[38]!==se?(de=[se,le,W],t[36]=le,t[37]=W,t[38]=se,t[39]=de):de=t[39];let G=Qt(A,P,de),fe;t[40]!==F||t[41]!==G.alsoRects||t[42]!==G.rects?(fe={dims:F,rects:G.rects,alsoRects:G.alsoRects},t[40]=F,t[41]=G.alsoRects,t[42]=G.rects,t[43]=fe):fe=t[43];let pe=fe,me;t[44]!==s||t[45]!==o||t[46]!==F.w||t[47]!==G.alsoRects||t[48]!==G.rects||t[49]!==c||t[50]!==P?(me=F.w===0?[]:Ht(G.rects,G.alsoRects,o,c,s,P),t[44]=s,t[45]=o,t[46]=F.w,t[47]=G.alsoRects,t[48]=G.rects,t[49]=c,t[50]=P,t[51]=me):me=t[51];let he=me,K=`${r}:${i}:${a}`,ge;t[52]!==G.dims||t[53]!==G.rects||t[54]!==f||t[55]!==l||t[56]!==a||t[57]!==K||t[58]!==T?(ge=()=>{!l||T!==`ready`||!a.trim()||!f||G.dims.w===0||f({pageImage:``,imgW:sn,imgH:cn,rects:G.rects,isFigure:!1,seed:K})},t[52]=G.dims,t[53]=G.rects,t[54]=f,t[55]=l,t[56]=a,t[57]=K,t[58]=T,t[59]=ge):ge=t[59];let _e;t[60]!==G||t[61]!==f||t[62]!==l||t[63]!==a||t[64]!==K||t[65]!==T?(_e=[l,T,a,f,G,K],t[60]=G,t[61]=f,t[62]=l,t[63]=a,t[64]=K,t[65]=T,t[66]=_e):_e=t[66],(0,V.useEffect)(ge,_e);let ve=F.w*P,ye=F.h*P,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`?N:void 0,we=a.trim()?T===`ready`&&ue?`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,Q.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,Q.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]!==le||t[77]!==o||t[78]!==F||t[79]!==W||t[80]!==ye||t[81]!==ve||t[82]!==z||t[83]!==he||t[84]!==B||t[85]!==oe||t[86]!==re||t[87]!==d||t[88]!==u||t[89]!==l||t[90]!==a||t[91]!==K||t[92]!==T||t[93]!==pe||t[94]!==se||t[95]!==P?(De=T===`ready`&&(0,Q.jsxs)(`div`,{className:`prism-slide-unit`,style:{width:ve?ve+(he.length>0?218:0):void 0},children:[(0,Q.jsxs)(`div`,{className:`prism-slide-frame`,style:{width:ve||void 0,height:ye||void 0},children:[(0,Q.jsx)(`div`,{className:`prism-slide-canvas`,ref:A,style:{transform:`scale(${P})`},children:z?(0,Q.jsxs)(Q.Fragment,{children:[oe&&(0,Q.jsx)(`h2`,{className:`prism-slide-title`,style:{fontSize:pn(oe.length)},children:fn(se,o,s,`title`)}),B.length>0&&(0,Q.jsx)(`div`,{className:`prism-slide-body`,style:{fontSize:mn(B.length)},children:B.map((e,t)=>(0,Q.jsx)(`p`,{className:`prism-slide-body-line`,children:fn(le[t]??[],o,s,`b${t}`)},t))})]}):(0,Q.jsx)(`div`,{className:`prism-slide-flat`,style:{fontSize:hn(re.length)},children:fn(W,o,s,`flat`)})}),(0,Q.jsx)(Ut,{geometry:pe,zoom:P,color:o,quote:a,also:s,penOn:l,penColor:u,penAccent:d,seed:K})]}),(0,Q.jsx)(Wt,{entries:he,dims:F,zoom:P,seed:K})]}),t[75]=s,t[76]=le,t[77]=o,t[78]=F,t[79]=W,t[80]=ye,t[81]=ve,t[82]=z,t[83]=he,t[84]=B,t[85]=oe,t[86]=re,t[87]=d,t[88]=u,t[89]=l,t[90]=a,t[91]=K,t[92]=T,t[93]=pe,t[94]=se,t[95]=P,t[96]=De):De=t[96];let Oe;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?(Oe=(0,Q.jsxs)(Vt,{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]=Oe):Oe=t[114],Oe}function _n(e){return e.anchor===`primary`}function vn(e){return e.some(yn)}function yn(e){return e.anchor===`primary`}function bn(e){return e.anchor===`primary`}function xn(e){return e.trim()}function Sn(e){return!!e.note?.trim()}function Cn(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 wn(e,t,n){let r=Cn(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 Tn(e,t){if(!t.trim())return[];let n=[];return e.forEach((e,r)=>{if(!e)return;let{norm:i,map:a}=Jt(e),o=Yt(t,i,a);if(!o)return;let[s,c]=o,l=wn(e,s,c);n.push(l?{row:r,cells:l}:{row:r})}),n}var En=880,Dn=13;function On(e){let t=e.trim();if(!t)return!1;let n=t.replace(/^[-+(]/,``).replace(/[)%]$/,``).replace(/^[$€£¥]\s?/,``);return/^[\d,]*\.?\d+$/.test(n)}function kn(e,t){return e.length>=t?e.slice(0,t):[...e,...Array(t-e.length).fill(``)]}function An(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,N).map(e=>kn(e,n.length));return{headers:n,rows:a,sheet:t,sourceRowCount:i,truncated:i>a.length}}function jn(e,t){return e.find(e=>e.row>=1&&!t.has(e.row))}function Mn({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,V.useState)(`loading`),[x,S]=(0,V.useState)(null),[w,T]=(0,V.useState)(null);(0,V.useEffect)(()=>{let t=!1;return b(`loading`),S(null),T(null),C(e)?je(e).then(e=>{if(!t){if(!e.sheetGrids||e.sheetGrids.length===0){b(`failed`);return}T({rows:e.sheetGrids,labels:e.pageLabels??[]}),b(`ready`)}}):Me(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,V.useMemo)(()=>y===`ready`?E?An(E,D):O===void 0?null:P(O):null,[y,E,D,O]),A=(0,V.useMemo)(()=>E?E.map(e=>e.join(` `)):O===void 0?[]:O.replace(/\r\n?/g,`
|
|
103
|
+
`).split(`
|
|
104
|
+
`),[E,O]),j=(0,V.useMemo)(()=>Tn(A,r),[A,r]),M=(0,V.useMemo)(()=>(a??[]).map(e=>Tn(A,e.quote)),[A,a]),{primaryHit:N,alsoHits:F}=(0,V.useMemo)(()=>{let e=new Set,t=jn(j,e);return t&&e.add(t.row),{primaryHit:t,alsoHits:M.map(t=>{let n=jn(t,e);return n&&e.add(n.row),n})}},[j,M]),I=!!N,ee=(0,V.useRef)(null),L=(0,V.useRef)(null),te=!!o?.trim()||(a??[]).some(e=>!!e.note?.trim()),ne=Gt(ee,y===`ready`,{gutterReserve:te?218:0}),{zoom:re,resetForNewContent:R}=ne,ie=(0,V.useRef)(null);(0,V.useEffect)(()=>{let t=ie.current;ie.current={doc:e,page:n},(!t||t.doc!==e||t.page!==n)&&R()},[e,n,R]);let z=Qt(L,re,[k,N,F]),ae={dims:z.dims,rects:z.rects,alsoRects:z.alsoRects},oe=(0,V.useMemo)(()=>z.dims.w===0?[]:Ht(z.rects,z.alsoRects,i,o,a,re),[z,o,a,i,re]),B=`${t}:${n}:${r}`;(0,V.useEffect)(()=>{!s||y!==`ready`||!r.trim()||!u||z.dims.w===0||u({pageImage:``,imgW:Math.max(1,Math.round(z.dims.w)),imgH:Math.max(1,Math.round(z.dims.h)),rects:z.rects,isFigure:!1,seed:B})},[s,y,r,u,z,B]);let H=te?218:0,se=D?`SHEET · ${D}`:void 0;return(0,Q.jsxs)(Vt,{ariaLabel:`Source page ${n}`,kindLabel:d,color:i,page:n,pageLabel:se,title:f,docName:p?.replace(/\.(csv|tsv|xlsx)$/i,``),pageCount:_,onPageChange:v,zoom:y===`ready`?ne:void 0,zoomVariant:`scale`,onClose:g,closeLabel:`Close source page`,connections:m,onNavigate:h,scrollRef:ee,footer:r.trim()?y===`ready`&&I?`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,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading page `,n,`…`]}),y===`failed`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t read this page. The quote is still grounded on page `,n,`.`]}),y===`ready`&&k&&(0,Q.jsxs)(`div`,{className:`prism-sheet-unit`,style:{maxWidth:En+H},children:[(0,Q.jsx)(`div`,{className:`prism-sheet-scroll`,children:(0,Q.jsxs)(`div`,{className:`prism-sheet-inner`,ref:L,style:{fontSize:`${Dn*re}px`},children:[(0,Q.jsxs)(`table`,{className:`prism-sheet-table`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsx)(`tr`,{children:k.headers.map((e,t)=>(0,Q.jsx)(`th`,{className:On(e)?`prism-sheet-num`:void 0,children:e},t))})}),(0,Q.jsx)(`tbody`,{children:k.rows.map((e,t)=>{let n=N!==void 0&&N.row-1===t?N:void 0,r=F.findIndex(e=>e!==void 0&&e.row-1===t),i=r>=0?F[r]:void 0,a=n?`primary`:i?`also-${r}`:void 0,o=n?.cells??i?.cells;return(0,Q.jsx)(`tr`,{"data-prism-anchor":a,children:e.map((e,t)=>(0,Q.jsx)(`td`,{className:[On(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,Q.jsx)(Ut,{geometry:ae,zoom:re,color:i,quote:r,also:a,penOn:s,penColor:c,penAccent:l,seed:B})]})}),k.truncated&&(0,Q.jsxs)(`p`,{className:`prism-sheet-truncated`,children:[`Showing the first `,k.rows.length.toLocaleString(),` of`,` `,k.sourceRowCount.toLocaleString(),` rows.`]}),(0,Q.jsx)(Wt,{entries:oe,dims:z.dims,zoom:re,seed:B})]})]})}function Nn(e){let t=(0,wt.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,Q.jsx)(qt,{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,Q.jsx)(gn,{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,Q.jsx)(nn,{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,Q.jsx)(Mn,{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,Q.jsx)(Kt,{...r}),t[25]=r,t[26]=o),o}function Pn(e,t,n=t+`s`){return e===1?t:n}function Fn(e){let t=e.length;if(t===0)return``;let n=e.filter(e=>I.includes(e));if(n.length===0){let e=t===1?`holds`:`hold`;return`All ${t} checked ${Pn(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 ${Pn(t,`claim`)} need a second look: ${a.join(` · `)}.`}var In=16;function Ln(){let e=(0,wt.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=(0,V.useRef)(t),[r,i]=(0,V.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>In&&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 Rn=u();i();var zn=c(()=>a(()=>import(`./ShareModal-Ys5NYDZR.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]))),Bn=zn.Component;function Vn({steps:e,spec:t,pdfs:n,placed:r,verdicts:i}){let[o,c]=(0,V.useState)(!1),[u,d]=(0,V.useState)(null),p=(0,V.useCallback)(async()=>{if(!o){c(!0);try{let[{autoAnnotationSteps:o},{buildAnnotationReel:s}]=await Promise.all([a(()=>import(`./annotationAuto-B8_I3PNS.js`),__vite__mapDeps([29,30,31,5,2,7,32,33,34,35,36,37,38,39,40])),a(()=>import(`./annotationReel-BA8Fv9Or.js`),__vite__mapDeps([41,12,20,1,2,3,4,5,7,21,22])),zn.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,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,disabled:o,onClick:p,title:`Make a shareable reel of the marked-up pages`,...s(zn.preload),children:o?`Preparing…`:`Share reel`}),u&&(0,Rn.createPortal)((0,Q.jsx)(l,{label:`Annotation reel`,overlay:!0,children:(0,Q.jsx)(Bn,{script:u,onClose:()=>d(null)})}),document.body)]})}var Hn=e({PrismOverlay:()=>br});i();var Un=c(()=>a(()=>import(`./PrismAskController-BgwijoI2.js`).then(e=>({default:e.PrismAskController})),__vite__mapDeps([42,1,2,3,4,43,33,34,35,36,30,37,38,39,40,44]))),Wn=c(()=>a(()=>import(`./PrismBriefingPlayer-CDkaBWup.js`).then(e=>({default:e.PrismBriefingPlayer})),__vite__mapDeps([45,1,2,3,4,5,46,47,48,14,15,16,6,7,8,17,18,12,49]))),Gn=c(()=>a(()=>import(`./CrossExamPanel-BfeGr5iw.js`).then(e=>({default:e.CrossExamPanel})),__vite__mapDeps([50,3,2,1,4,51]))),Kn=c(()=>a(()=>import(`./ForecastPanel-OfW39WGS.js`).then(e=>({default:e.ForecastPanel})),__vite__mapDeps([52,3,2,1,4,43,53]))),qn=c(()=>a(()=>import(`./LeverPanel-vco5UK2U.js`).then(e=>({default:e.LeverPanel})),__vite__mapDeps([54,1,2,3,4,55,56]))),Jn=c(()=>a(()=>import(`./WhyMachineOverlay-D2K7y8SA.js`).then(e=>({default:e.WhyMachineOverlay})),__vite__mapDeps([57,1,2,3,4,58,43,59,60,39,38,61,62,63]))),Yn=Un.Component,Xn=Wn.Component,Zn=Gn.Component,Qn=Kn.Component,$n=qn.Component,er=Jn.Component,tr=o(()=>a(()=>import(`./run-CW67JOGe.js`),__vite__mapDeps([64,32,2,33,34,35,36,30,37,38,65]))),nr=o(()=>a(()=>import(`./run-DqsfL9JC.js`),__vite__mapDeps([66,32,2,33,34,35,36,30,37,38]))),rr=o(()=>a(()=>import(`./run-BVgCc5Xi.js`),__vite__mapDeps([67,32,2,33,34,35,36,30,37,39,38,40,65]))),ir=o(()=>a(()=>import(`./model-FR-9md4s.js`),__vite__mapDeps([68,33,34,35,36,30,37,38,65,55]))),ar=o(()=>a(()=>import(`./explode-niun7Zqc.js`),__vite__mapDeps([69,70,33,34,35,36,30,37,71,72,73,38,59,60,39]))),or=o(()=>a(()=>import(`./kokoro-DogSQaQB.js`).then(e=>e.a),__vite__mapDeps([48,2,14,1,3,15,4,16,5,6,7,8,17,18,12]))),sr=null;function cr(){return sr=or()}function lr(){sr&&sr.then(e=>e.cancelKokoro(),()=>void 0)}function ur(e){cr().then(t=>t.speakKokoroResult(e,`mavea`))}var dr={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`}},fr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`],pr={contradicts:`contradicts`,"in-tension":`in tension`,agrees:`agrees`},mr=[{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`}],hr=[{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`}],gr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--insight-soft)`];function _r(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 vr(e){return e?e.relation:`anchored`}function yr(e){return e?e.relation===`agrees`?`agrees · ready`:e.relation===`in-tension`?`in tension`:`in contradiction`:`anchored · ready`}function br({pdf:e,cfg:t,search:n,onClose:r,world:i,corpusChrome:a,onReplay:o,autoBriefing:c}){let u=(0,V.useMemo)(()=>Array.isArray(e)?e:[e],[e]),f=u.length>1,[m,h]=(0,V.useState)(!1),g=Ct(t),{phase:_,spec:v,corpus:y,proposed:b,error:x}=i??g,{explode:S}=g,[C,w]=(0,V.useState)(null),[T,E]=(0,V.useState)(null),[D,O]=(0,V.useState)(null),[k,A]=(0,V.useState)(()=>new Set),[j,M]=(0,V.useState)(!1),[N,P]=(0,V.useState)(!1),[I,L]=(0,V.useState)(null),[ne,ie]=(0,V.useState)(0),[B,H]=(0,V.useState)(null),[se,ce]=(0,V.useState)(()=>new Set),le=(0,V.useRef)(()=>{}),[U,W]=(0,V.useState)(null),[ue,de]=(0,V.useState)(!1),[G,fe]=(0,V.useState)(!1),[pe,me]=(0,V.useState)(!1),he=(0,V.useRef)(null),[K,ge]=(0,V.useState)(null),[_e,ve]=(0,V.useState)(!1),[ye,be]=(0,V.useState)(!1),[xe,Se]=(0,V.useState)(!1),[Ce,we]=(0,V.useState)(null),Te=(0,V.useRef)(null),[Ee,De]=(0,V.useState)(null),[Oe,ke]=(0,V.useState)(!1),[Ae,je]=(0,V.useState)(!1),[Me,Ne]=(0,V.useState)(null),Pe=(0,V.useRef)(null),[Fe,Ie]=(0,V.useState)(null),[Le,Re]=(0,V.useState)(!1),[ze,Be]=(0,V.useState)(!1),Ve=(0,V.useRef)(!1),He=(0,V.useRef)(null),[Ue,We]=(0,V.useState)(`map`),[Ge,Ke]=(0,V.useState)(null),[qe,Je]=(0,V.useState)(null),Ye=(0,V.useRef)(null),[Xe,Ze]=(0,V.useState)(!1),[Qe,$e]=(0,V.useState)(44),et=(0,V.useRef)(null),tt=(0,V.useRef)(!1),nt=(0,V.useRef)(null),rt=(0,V.useRef)(!1);d(nt);let[it,at]=(0,V.useState)(()=>new Map),[ot,st]=(0,V.useState)(!1),[ct,lt]=(0,V.useState)(c===!0),[ut,dt]=(0,V.useState)(!1),[ft,pt]=(0,V.useState)(``),{steps:mt,record:ht,clear:gt}=Ln(),_t=(0,V.useCallback)(e=>{tt.current=!0,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[]),vt=(0,V.useCallback)(e=>{if(!tt.current||!et.current)return;let t=et.current.getBoundingClientRect(),n=(t.right-e.clientX)/t.width*100;$e(Math.max(24,Math.min(100,n)))},[]),yt=(0,V.useCallback)(e=>{tt.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),bt=(0,V.useRef)(!1);(0,V.useEffect)(()=>{i||bt.current||(bt.current=!0,S(u))},[u,S]),(0,V.useEffect)(()=>()=>void ee(),[]),(0,V.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(B?(lr(),H(null),ce(new Set),w(null),le.current()):T?E(null):D?O(null):C?w(null):r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[B,T,D,C,r]);let[xt,St]=(0,V.useState)(null);(0,V.useEffect)(()=>{if(!v||v.claims.length<48)return;let e=!0;return It(v,fr).then(t=>{e&&St({spec:v,result:t})}),()=>{e=!1}},[v]);let q=(0,V.useMemo)(()=>v?v.claims.length<48?Ot(v,fr):xt?.spec===v?xt.result:null:null,[xt,v]),J=_===`settled`&&!!q,wt=(0,V.useRef)(null),Tt=(0,V.useMemo)(()=>{if(!q||q.claims.length===0)return;let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i of q.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 q.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}},[q]),Y=Et(wt,q?.width??1,q?.height??1,Tt,{wheelZoom:J}),X=(0,V.useMemo)(()=>{let e=new Map;if(q)for(let t of q.claims)e.set(t.id,t);return e},[q]),Dt=(0,V.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(q)for(let e of q.links)t(e.a,e.b);if(v)for(let e of v.threads)t(e.a,e.b);let n=new Map;for(let[t,r]of e)n.set(t,[...r].map(e=>X.get(e)).filter(e=>!!e).sort((e,t)=>e.page-t.page||e.title.localeCompare(t.title)).map(e=>e.id));return n},[q,v,X]),Z=C?X.get(C)??null:null,kt=(0,V.useMemo)(()=>C?Dt.get(C)??[]:[],[C,Dt]),At=v?.threads.filter(e=>e.crossDoc).length??0,[jt,Mt]=(0,V.useState)(null),Nt=(0,V.useMemo)(()=>{let e=new Set;return a?.contradictions.forEach(t=>{e.add(t.a),e.add(t.b)}),e},[a]),Pt=(0,V.useMemo)(()=>{let e=new Set;return a?.consensus.forEach(t=>t.memberClaimIds.forEach(t=>e.add(t))),e},[a]),Ft=a?.lens??`all`;(0,V.useEffect)(()=>{if(!a||!J)return;let e=Ft===`contradictions`?a.contradictions:Ft===`gaps`?a.gaps:Ft===`consensus`?a.consensus:[];if(Ft===`all`||e.length===0){Y.fit();return}let t=e.map(e=>e.x),n=e.map(e=>e.y);Y.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})},[Ft,J]);let Lt=_===`igniting`?`EXTRACTING`:_===`blooming`?`MAPPING`:_===`settled`?`SETTLED`:_===`error`?`COULDN’T MAP`:`READY`,Rt=v?.claims.length??0,zt=(0,V.useCallback)(()=>{w(null),E(null),O(null),A(new Set),lr(),H(null),ce(new Set),he.current?.abort(),W(null),fe(!1),de(!1),Te.current?.abort(),ge(null),be(!1),ve(!1),we(null),Pe.current?.abort(),De(null),je(!1),ke(!1),Ne(null),He.current?.abort(),Ie(null),Be(!1),Re(!1),Ve.current=!1,Ye.current?.abort(),Ke(null),Je(null),We(`map`),o?o():S(u,{fresh:!0})},[S,u,o]),Bt=(0,V.useRef)(null),{frame:Vt,fit:Ht}=Y;le.current=Ht,(0,V.useEffect)(()=>{if(!J||!q||!v||Bt.current===v)return;Bt.current=v;let e=q.claims.filter(e=>e.role===`load-bearing`);if(e.length===0||e.length===q.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;Vt({x:t-200,y:n-a,w:r-t+400,h:i-n+a*2},{maxScale:1.2})},[J,q,v,Vt]);let Ut=(0,V.useRef)(null);(0,V.useEffect)(()=>{if(!J||!v||!t||Ut.current===v||(Ut.current=v,at(new Map),st(!1),!n?.enabled)||v.claims.filter(e=>e.role===`load-bearing`).length===0)return;let e=new AbortController;return st(!0),ae(v.claims,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal}).then(t=>{e.signal.aborted||at(new Map(t.map(e=>[e.claimId,e])))}).catch(()=>{}).finally(()=>{e.signal.aborted||st(!1)}),()=>e.abort()},[J,v,t,n]);let Wt=(0,V.useMemo)(()=>[...it.values()].map(e=>e.verdict),[it]),Gt=(0,V.useMemo)(()=>Fn(Wt),[Wt]),Kt=(0,V.useCallback)(e=>{let t=(v?.documents[e]?.fileName??`Doc ${e+1}`).replace(/\.[^.]+$/,``).trim();return t.length>18?t.slice(0,17).trimEnd()+`…`:t||`Doc ${e+1}`},[v]),qt=(0,V.useCallback)((e,t)=>{if(!q)return;let n=q.claims.filter(n=>n.source===e&&n.page===t);if(n.length===0){let r=q.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);Vt({x:r-200,y:i-96*1.3,w:a-r+400,h:o-i+96*2.6},{maxScale:1.4})},[q,Vt]),Jt=(0,V.useCallback)(e=>{E(null),w(null),pt(``),O(e),qt(e.doc,e.page)},[qt]),Yt=(0,V.useCallback)(e=>{A(new Set(e.spans.map(e=>`${e.doc}:${e.page}`))),e.spans.length>0&&Jt(e.spans[0]),pt(e.text)},[Jt]),Xt=(0,V.useMemo)(()=>!J||!t||!y?null:{corpus:y,cfg:t,multiDoc:f,...n?{search:n}:{}},[J,t,y,f,n]);(0,V.useEffect)(()=>()=>Ye.current?.abort(),[]);let Zt=(0,V.useCallback)(()=>{if(!t||!y)return;Ye.current?.abort();let e=new AbortController;Ye.current=e,Je(`why`);let n=y.flat().join(`
|
|
105
|
+
`).slice(0,8e3),r=f?`Why — the argument these documents make`:`Why does "${u[0].name.replace(/\.[a-z0-9]+$/i,``)}" reach its conclusion?`;ar().then(({explodeWhy:i})=>i(r,n,t,e.signal)).then(t=>{e.signal.aborted||Ke(t)}).finally(()=>{e.signal.aborted||Je(null)})},[t,y,f,u]);(0,V.useEffect)(()=>{ie(e=>e+1),M(!1),P(!1),L(null),O(null),pt(``),Mt(null),A(new Set),lr(),gt(),H(null),ce(new Set),he.current?.abort(),W(null),fe(!1),de(!1),Te.current?.abort(),ge(null),be(!1),ve(!1),we(null),Pe.current?.abort(),De(null),je(!1),ke(!1),Ne(null),He.current?.abort(),Ie(null),Be(!1),Re(!1),Ve.current=!1,Ye.current?.abort(),Ke(null),Je(null)},[v,gt]);let $=(0,V.useMemo)(()=>{if(!J)return null;if(T)return{source:T.doc,page:T.page,quote:``,color:`var(--presence)`,kindLabel:`PAGE`,title:`Reading the document`,isFigure:!1,connections:[],fromAsk:!1,browse:!0,penExplain:``,penColor:oe};if(D)return{source:D.doc,page:D.page,quote:D.quote,color:`var(--presence)`,kindLabel:`ANSWER`,title:`From your question`,isFigure:!1,connections:[],fromAsk:!0,penExplain:ft||`“${D.quote.slice(0,160)}”`,penColor:oe};if(Z){let e=(q?.claims??[]).filter(e=>e.id!==Z.id&&e.source===Z.source&&e.page===Z.page&&e.quote.trim().length>0).slice(0,6).map(e=>({quote:e.quote,color:dr[e.kind].color,note:e.title}));return{source:Z.source,page:Z.page,quote:Z.quote,color:dr[Z.kind].color,kindLabel:dr[Z.kind].label,title:Z.title,isFigure:Z.kind===`diagram`,...Z.box?{box:Z.box}:{},also:e,connections:kt.map(e=>({id:e,title:X.get(e)?.title??``})),fromAsk:!1,penExplain:z(Z),penColor:F(Z.kind),...re(Z)?{penAccent:re(Z)}:{}}}return null},[J,T,D,ft,Z,kt,X,q]),Qt=J&&(!!$||!!jt),$t=(0,V.useCallback)(e=>{if(!$)return;let t={...e,color:$.penColor,title:$.title,explanation:$.penExplain,...$.penAccent?{accent:$.penAccent}:{}};ht(t),ut&&t.explanation&&(lr(),ur(t.explanation))},[$,ut,ht]),en=!!B,tn=(0,V.useCallback)(e=>{let t=e.map(e=>X.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);Vt({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})},[X,Vt]),nn=(0,V.useMemo)(()=>new Map([...it].map(([e,t])=>[e,t.verdict])),[it]),rn=(0,V.useCallback)(e=>{ce(new Set(e.claimIds)),tn(e.claimIds),w(e.claimIds[0]??null)},[tn]),an=(0,V.useCallback)(()=>{lr(),H(null),ce(new Set),w(null),Ht()},[Ht]),on=(0,V.useCallback)(e=>{e!==`recon`&&(he.current?.abort(),de(!1),me(!1)),e!==`xe`&&(Te.current?.abort(),ve(!1),Se(!1)),e!==`fa`&&(Pe.current?.abort(),ke(!1)),e!==`lv`&&(He.current?.abort(),Re(!1))},[]),sn=(0,V.useCallback)(()=>{if(!q||!v)return;let e=R(q.claims,v.threads,nn);e.length!==0&&(lr(),on(`none`),w(null),O(null),M(!1),fe(!1),be(!1),je(!1),Be(!1),(ct||c)&&$e(e=>Math.max(e,60)),H(e))},[q,v,nn,ct,c,on]),cn=(0,V.useRef)(!1),ln=(0,V.useRef)(sn);ln.current=sn;let un=(0,V.useRef)(null);(0,V.useEffect)(()=>{!c||cn.current||_!==`settled`||!q||!v||(cn.current=!0,un.current=setTimeout(()=>ln.current(),800))},[c,_,q,v]),(0,V.useEffect)(()=>()=>{un.current!==null&&clearTimeout(un.current)},[]),(0,V.useEffect)(()=>()=>he.current?.abort(),[]);let dn=(0,V.useMemo)(()=>{let e=new Set;if(U)for(let t of U)for(let n of t.claimIds)e.add(n);return e},[U]),fn=(0,V.useCallback)(()=>{if(G){fe(!1);return}if(on(`recon`),be(!1),je(!1),Be(!1),M(!1),U){fe(!0);return}if(!v||!y||!t)return;he.current?.abort();let e=new AbortController;he.current=e,de(!0),me(!1);let n=v.claims.map(e=>({id:e.id,page:e.page,quote:e.quote}));tr().then(({runReconcile:r})=>r(n,y,t,e.signal)).then(t=>{if(!e.signal.aborted){if(!t){me(!0);return}W(t),fe(!0)}}).catch(()=>{e.signal.aborted||me(!0)}).finally(()=>{e.signal.aborted||de(!1)})},[G,U,v,y,t,on]);(0,V.useEffect)(()=>()=>Te.current?.abort(),[]);let pn=(0,V.useMemo)(()=>{let e=new Set;if(K)for(let t of K)e.add(t.claimId);return e},[K]),mn=(0,V.useMemo)(()=>{let e=new Set;if(K)for(let t of K)t.status===`open`&&e.add(t.claimId);return e},[K]),hn=(0,V.useCallback)(e=>{we(e.id),Jt({doc:e.doc,page:e.anchorPage,quote:e.anchorQuote})},[Jt]),gn=(0,V.useCallback)(()=>{if(ye&&!xe){be(!1);return}if(on(`xe`),fe(!1),je(!1),Be(!1),M(!1),K){be(!0);return}if(!v||!y||!t)return;Te.current?.abort();let e=new AbortController;Te.current=e,ve(!0),be(!0),Se(!1);let n=v.claims.filter(e=>e.role===`load-bearing`).map(e=>({id:e.id,source:e.source,page:e.page,quote:e.quote,title:e.title}));nr().then(({runCrossExam:r})=>r(n,y,t,e.signal)).then(t=>{if(!e.signal.aborted){if(!t){Se(!0);return}ge(t)}}).catch(()=>{e.signal.aborted||Se(!0)}).finally(()=>{e.signal.aborted||ve(!1)})},[ye,xe,K,v,y,t,on]);(0,V.useEffect)(()=>()=>Pe.current?.abort(),[]);let _n=(0,V.useMemo)(()=>{let e=new Set;if(Ee)for(let t of Ee)e.add(t.claimId);return e},[Ee]),vn=(0,V.useCallback)(e=>{Ne(e.claimId);let t=X.get(e.claimId);t&&Jt({doc:t.source,page:e.page,quote:e.predicted})},[X,Jt]),yn=(0,V.useCallback)(()=>{if(Ae){je(!1);return}if(on(`fa`),fe(!1),be(!1),Be(!1),M(!1),Ee){je(!0);return}if(!v||!t||!n?.enabled)return;Pe.current?.abort();let e=new AbortController;Pe.current=e,ke(!0),je(!0);let r=v.claims.filter(e=>e.kind===`forecast`).map(e=>({id:e.id,page:e.page,quote:e.quote}));rr().then(({runAutopsy:i})=>i(r,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal})).then(t=>{e.signal.aborted||De(t)}).catch(()=>{e.signal.aborted||De([])}).finally(()=>{e.signal.aborted||ke(!1)})},[Ae,Ee,v,t,n,on]);(0,V.useEffect)(()=>()=>He.current?.abort(),[]);let bn=(0,V.useMemo)(()=>{let e=new Set;if(Fe)for(let t of Fe.nodes)e.add(`${t.doc}:${t.page}`);return e},[Fe]),xn=(0,V.useCallback)(e=>{Jt({doc:e.doc,page:e.page,quote:e.quote})},[Jt]),Sn=(0,V.useCallback)(()=>{if(ze){Be(!1);return}if(on(`lv`),fe(!1),be(!1),je(!1),M(!1),Ve.current){Be(!0);return}if(!v||!y||!t)return;He.current?.abort();let e=new AbortController;He.current=e,Ve.current=!0,Re(!0),Be(!0);let n=v.claims.map(e=>({quote:e.quote,page:e.page,doc:e.source}));ir().then(({runLevers:r})=>r(n,y,t,e.signal)).then(t=>{e.signal.aborted||Ie(t)}).catch(()=>{e.signal.aborted||Ie(null)}).finally(()=>{e.signal.aborted||Re(!1)})},[ze,v,y,t,on]);return(0,Q.jsxs)(`div`,{className:`prism-scrim`,"data-expanded":m?`true`:void 0,onPointerDown:e=>{rt.current=e.target===e.currentTarget},onClick:e=>{e.target===e.currentTarget&&rt.current&&r()},role:`button`,tabIndex:0,"aria-label":`Close Prism`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},children:[(0,Q.jsxs)(`section`,{className:`prism-panel`,role:`dialog`,"aria-label":`Prism`,"data-phase":_,ref:nt,onClick:e=>e.stopPropagation(),children:[(0,Q.jsxs)(`header`,{className:`prism-head`,children:[(0,Q.jsxs)(`div`,{className:`prism-file`,children:[(0,Q.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,Q.jsx)(`path`,{d:`M6 2h8l4 4v16H6z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,Q.jsx)(`path`,{d:`M14 2v4h4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`})]}),(0,Q.jsx)(`span`,{className:`prism-file-name`,children:f?`${u.length} documents`:u[0].name}),v&&(0,Q.jsxs)(`span`,{className:`prism-file-pages`,children:[`· `,v.pageCount,` pages`]})]}),(0,Q.jsxs)(`div`,{className:`prism-head-right`,children:[J&&a&&(0,Q.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,Q.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":a.lens===e,className:`syn-lens`+(a.lens===e?` is-active`:``),onClick:()=>{Mt(null),a.setLens(e)},children:[t,n>0&&(0,Q.jsx)(`span`,{className:`syn-lens-n`,children:n})]},e))}),J&&b>0&&(0,Q.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,Q.jsx)(`strong`,{children:b}),` read · `,(0,Q.jsx)(`strong`,{children:Rt}),` grounded`,b>Rt?(0,Q.jsxs)(Q.Fragment,{children:[` `,`· `,(0,Q.jsx)(`strong`,{children:b-Rt}),` dropped`]}):null]}),(0,Q.jsxs)(`span`,{className:`prism-phase`,"data-active":_===`igniting`||_===`blooming`,title:Lt,children:[(0,Q.jsx)(`span`,{className:`prism-phase-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-phase-label`,children:Lt})]}),J&&(0,Q.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:()=>{O(null),w(null),E({doc:0,page:1})},"aria-label":`Read the whole document, page by page`,title:`Read the whole document, page by page`,children:[`▤`,(0,Q.jsx)(`span`,{className:`prism-replay-label`,children:` Read document`})]}),J&&(0,Q.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:zt,"aria-label":`Replay — re-map the document from scratch`,title:`Replay — re-map the document from scratch`,children:[`↻`,(0,Q.jsx)(`span`,{className:`prism-replay-label`,children:` Replay`})]}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-close`,onClick:()=>h(e=>!e),"aria-label":m?`Exit full screen`:`Expand to full screen`,title:m?`Exit full screen`:`Full screen`,children:m?`⤡`:`⤢`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-close`,onClick:r,"aria-label":`Close Prism`,children:`✕`})]})]}),f&&J&&v&&(0,Q.jsxs)(`div`,{className:`prism-legend`,role:`list`,"aria-label":`Documents`,children:[v.documents.map((e,t)=>{let n=v.claims.filter(e=>e.source===t).length;return(0,Q.jsxs)(`span`,{className:`prism-legend-item`,role:`listitem`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-swatch`,style:{background:gr[t%gr.length]},"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-legend-name`,children:e.fileName.replace(/\.pdf$/i,``)}),(0,Q.jsx)(`span`,{className:`prism-legend-count`,children:n})]},t)}),At>0&&(0,Q.jsxs)(`span`,{className:`prism-legend-cross`,children:[At,` cross-document link`,At===1?``:`s`]})]}),(0,Q.jsxs)(`div`,{className:`prism-split`,"data-split":Qt?`true`:void 0,"data-pdfonly":Qt&&Qe>=99?`true`:void 0,ref:et,children:[(0,Q.jsxs)(`div`,{className:`prism-stage`+(Y.panning?` is-panning`:``),ref:wt,onPointerDown:J?Y.onPointerDown:void 0,onPointerMove:J?Y.onPointerMove:void 0,onPointerUp:J?Y.onPointerUp:void 0,onPointerCancel:J?Y.onPointerUp:void 0,onClickCapture:e=>{Y.movedRef.current&&(e.stopPropagation(),e.preventDefault(),Y.movedRef.current=!1)},children:[(_===`idle`||_===`igniting`)&&(0,Q.jsxs)(`div`,{className:`prism-doc`,"data-igniting":_===`igniting`,"aria-hidden":`true`,children:[(0,Q.jsxs)(`div`,{className:`prism-doc-page`,children:[(0,Q.jsx)(`span`,{className:`prism-doc-eyebrow`,children:f?`DOCUMENTS`:`DOCUMENT`}),(0,Q.jsx)(`span`,{className:`prism-doc-title`,children:f?`${u.length} documents`:u[0].name.replace(/\.pdf$/i,``)}),(0,Q.jsx)(`div`,{className:`prism-doc-lines`,children:[92,84,88,70,90,60,80,66].map((e,t)=>(0,Q.jsx)(`span`,{className:`prism-doc-line`,style:{width:`${e}%`}},t))})]}),_===`igniting`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`prism-shock`}),xr.map((e,t)=>(0,Q.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))]})]}),_===`blooming`&&(0,Q.jsxs)(`div`,{className:`prism-blooming`,children:[(0,Q.jsx)(`span`,{className:`prism-bloom-orb`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-bloom-label`,children:`Reading the document — mapping its claims…`})]}),_===`error`&&(0,Q.jsxs)(`div`,{className:`prism-error`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`prism-error-msg`,children:x}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-error-retry`,onClick:zt,children:`Try again`})]}),J&&q&&(0,Q.jsxs)(`div`,{className:`prism-world`,"data-briefing":en?`true`:void 0,ref:Y.worldRef,style:{width:q.width,height:q.height},children:[q.regions.map(e=>(0,Q.jsxs)(`div`,{className:`prism-region`,style:{left:e.cx,top:e.cy,"--region-color":e.color},children:[(0,Q.jsx)(`span`,{className:`prism-region-glow`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-region-name`,children:e.name})]},e.name)),q.links.length>0&&(0,Q.jsx)(`svg`,{className:`prism-links`,width:q.width,height:q.height,"aria-hidden":`true`,children:q.links.map((e,t)=>{let n=X.get(e.a),r=X.get(e.b);return!n||!r?null:(0,Q.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y},t)})}),v&&v.threads.length>0&&(0,Q.jsx)(`svg`,{className:`prism-threads`,width:q.width,height:q.height,"aria-hidden":`true`,children:v.threads.map((e,t)=>{let n=X.get(e.a),r=X.get(e.b);if(!n||!r)return null;let i=(n.x+r.x)/2,a=(n.y+r.y)/2-28;return(0,Q.jsxs)(`g`,{className:`prism-thread`+(Ue===`map`?``:` prism-thread-hot`),"data-relation":e.relation,"data-cross":e.crossDoc?`true`:void 0,children:[(0,Q.jsx)(`path`,{d:`M ${n.x} ${n.y} Q ${i} ${a} ${r.x} ${r.y}`,fill:`none`}),(0,Q.jsx)(`foreignObject`,{x:i-90,y:a-12,width:`180`,height:`22`,children:(0,Q.jsxs)(`span`,{className:`prism-thread-label`,children:[pr[e.relation],e.crossDoc?` across docs`:` · p.${n.page}↔p.${r.page}`]})})]},t)})}),G&&U&&U.length>0&&(0,Q.jsx)(`svg`,{className:`prism-threads prism-recon`,width:q.width,height:q.height,"aria-hidden":`true`,children:U.map(e=>{if(e.a===e.b)return null;let t=X.get(e.a),n=X.get(e.b);if(!t||!n)return null;let r=(t.x+n.x)/2,i=(t.y+n.y)/2-28;return(0,Q.jsxs)(`g`,{className:`prism-thread prism-thread-hot`,"data-relation":`contradicts`,children:[(0,Q.jsx)(`path`,{d:`M ${t.x} ${t.y} Q ${r} ${i} ${n.x} ${n.y}`,fill:`none`}),(0,Q.jsx)(`foreignObject`,{x:r-90,y:i-16,width:`180`,height:`30`,children:(0,Q.jsxs)(`span`,{className:`prism-thread-label prism-recon-label`,children:[e.stated,` ≠ `,e.computed]})})]},e.id)})}),q.claims.map(e=>{let t=dr[e.kind],n=C===e.id,r=it.get(e.id),i=v?.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=Ue===`contra`&&!s,u=k.has(`${e.source}:${e.page}`),d=!!D&&k.size>0&&!u,f=se.has(e.id),m=en&&se.size>0&&!f,h=G&&dn.has(e.id),g=G&&dn.size>0&&!h,_=ye&&mn.has(e.id),y=ye&&mn.size>0&&!pn.has(e.id),b=Ae&&_n.has(e.id),x=Ae&&_n.size>0&&!b,S=ze&&bn.has(`${e.source}:${e.page}`),T=ze&&bn.size>0&&!S,A=!!a&&(Ft===`gaps`?!0:Ft===`contradictions`?!Nt.has(e.id):Ft===`consensus`&&!Pt.has(e.id)),j=()=>{en||(E(null),O(null),Mt(null),w(n?null:e.id))};return(0,Q.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-pressed":n,className:`prism-claim`+(n?` is-open`:``)+(s?` is-flagged`:``)+(u||f||h||b||S?` is-cited`:``)+(_?` is-objected`:``)+(l||d||m||g||y||x||T||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,Q.jsxs)(`span`,{className:`prism-claim-head`,children:[(0,Q.jsxs)(`span`,{className:`prism-claim-kind`,children:[(0,Q.jsx)(`span`,{className:`prism-claim-dot`,"aria-hidden":`true`}),t.label]}),e.role===`load-bearing`&&(0,Q.jsx)(`span`,{className:`prism-claim-key`,title:`Load-bearing — the document leans on this`,children:`★ KEY`}),(0,Q.jsxs)(`span`,{className:`prism-claim-page`,children:[`p.`,e.page]})]}),(0,Q.jsx)(`span`,{className:`prism-claim-title`,children:e.title}),r&&(0,Q.jsxs)(`span`,{className:`prism-seal`,"data-verdict":r.verdict,style:{"--seal-color":te[r.verdict].token},children:[(0,Q.jsx)(`span`,{className:`prism-seal-dot`,"aria-hidden":`true`}),te[r.verdict].label]}),n&&(0,Q.jsxs)(`span`,{className:`prism-claim-body`,children:[(0,Q.jsxs)(`span`,{className:`prism-claim-quote`,children:[`“`,e.quote,`”`]}),i&&(0,Q.jsxs)(`span`,{className:`prism-claim-flag`,children:[_r(i.relation,i.crossDoc),` — follow the thread`]}),r&&(0,Q.jsxs)(`span`,{className:`prism-claim-verdict`,"data-verdict":r.verdict,style:{"--seal-color":te[r.verdict].token},children:[(0,Q.jsxs)(`span`,{className:`prism-verdict-head`,children:[(0,Q.jsx)(`span`,{className:`prism-verdict-label`,children:te[r.verdict].label}),(0,Q.jsx)(`span`,{className:`prism-verdict-note`,children:r.note})]}),r.citation&&o&&(0,Q.jsxs)(`a`,{className:`prism-verdict-cite`,href:o,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),children:[`“`,r.citation.quote,`”`,(0,Q.jsxs)(`span`,{className:`prism-verdict-host`,children:[`— `,r.citation.host,r.citation.date?` · ${r.citation.date}`:``]})]})]})]}),!n&&(0,Q.jsx)(`span`,{className:`prism-claim-state`,"data-state":vr(i),children:yr(i)})]},e.id)}),a&&(0,Q.jsxs)(Q.Fragment,{children:[a.consensus.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`syn-consensus`+(Ft!==`all`&&Ft!==`consensus`?` is-dim`:``),style:{left:e.x-e.r,top:e.y-e.r,width:e.r*2,height:e.r*2},onClick:()=>{Y.movedRef.current||(w(null),Mt({kind:`consensus`,id:e.id}))},children:(0,Q.jsxs)(`span`,{className:`syn-consensus-badge`,children:[e.sourceCount,` of `,e.corpusSize,` agree`]})},e.id)),a.contradictions.map(e=>{let t=Ft!==`all`&&Ft!==`contradictions`;return(0,Q.jsxs)(`button`,{type:`button`,className:`syn-obj syn-obj-`+e.relation+(t?` is-dim`:``),style:{left:e.x,top:e.y},onClick:()=>{Y.movedRef.current||(w(null),Mt({kind:`contradiction`,id:e.id}))},children:[(0,Q.jsx)(`span`,{className:`syn-obj-dot`,"aria-hidden":`true`}),e.label]},e.id)}),a.gaps.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`syn-obj syn-gap`+(Ft!==`all`&&Ft!==`gaps`?` is-dim`:``),style:{left:e.x,top:e.y},onClick:()=>{Y.movedRef.current||(w(null),Mt({kind:`gap`,id:e.id}))},children:e.label},e.id))]})]}),J&&(0,Q.jsxs)(`div`,{className:`prism-zoom`,"aria-label":`Zoom the map`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>Y.zoomBy(1.25),"aria-label":`Zoom in`,children:`+`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>Y.zoomBy(1/1.25),"aria-label":`Zoom out`,children:`−`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>Y.fit(),"aria-label":`Fit the whole map`,title:`Fit`,children:`⊡`})]}),J&&N&&Xt&&(0,Q.jsx)(l,{label:`Document ask`,children:(0,Q.jsx)(Yn,{open:j&&!en&&!ye&&!Ae&&!ze,ctx:Xt,seed:I,onAnswer:Yt,onFocusSpan:Jt,activeSpan:D,multiDoc:f,docLabel:Kt,onClose:()=>M(!1)},ne)}),J&&B&&(0,Q.jsx)(l,{label:`Briefing`,children:(0,Q.jsx)(Xn,{beats:B,onBeat:rn,onExit:an,audioDefault:!c})}),J&&ye&&!en&&(0,Q.jsx)(l,{label:`Cross-examination`,children:(0,Q.jsx)(Zn,{objections:K??[],busy:_e,failed:xe,onFocusObjection:hn,activeId:Ce,multiDoc:f,docLabel:Kt,onClose:()=>be(!1)})}),J&&Ae&&!en&&(0,Q.jsx)(l,{label:`Forecast review`,children:(0,Q.jsx)(Qn,{grades:Ee??[],busy:Oe,onFocusForecast:vn,activeId:Me,onClose:()=>je(!1)})}),J&&ze&&!en&&(0,Q.jsx)(l,{label:`Live levers`,children:(0,Q.jsx)($n,{model:Fe,busy:Le,onFocusNode:xn,onClose:()=>Be(!1)})})]}),Qt&&(0,Q.jsx)(`div`,{className:`prism-divider`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the map and the source page`,"aria-valuenow":Math.round(Qe),"aria-valuemin":24,"aria-valuemax":100,tabIndex:0,onPointerDown:_t,onPointerMove:vt,onPointerUp:yt,onPointerCancel:yt,onKeyDown:e=>{e.key===`ArrowLeft`?$e(e=>Math.min(100,e+4)):e.key===`ArrowRight`&&$e(e=>Math.max(24,e-4))},children:(0,Q.jsx)(`span`,{className:`prism-divider-grip`,"aria-hidden":`true`})}),$&&J&&u[$.source]&&(()=>{let e=u[$.source],t=v?.documents[$.source]?.slideImages,n=v?.documents[$.source]?.pageCount??1;return(0,Q.jsxs)(`div`,{className:`prism-page-wrap`,style:{"--pdf-pct":`${Qe}%`},children:[(0,Q.jsx)(Nn,{pdf:e,slideImages:t,pages:y?.[$.source],source:$.source,page:$.page,quote:$.quote,color:$.color,also:$.also,note:$.penExplain,penOn:ct,penColor:$.penColor,penAccent:$.penAccent,onAnnotated:$t,kindLabel:$.kindLabel,isFigure:$.isFigure,docName:f?e.name:void 0,title:$.title,connections:$.connections,onNavigate:e=>{E(null),O(null),w(e)},onClose:()=>{E(null),O(null),w(null)},pageCount:n,onPageChange:e=>{let t=Math.min(n,Math.max(1,e));O(null),w(null),E({doc:$.source,page:t})}}),ct&&!en&&$.penExplain&&(0,Q.jsxs)(`div`,{className:`prism-pen-caption`,children:[(0,Q.jsx)(`span`,{className:`prism-pen-caption-text`,children:$.penExplain}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-pen-mute`,onClick:()=>dt(e=>!e),"aria-pressed":ut,title:ut?`Mute narration`:`Read it aloud`,children:ut?`🔊`:`🔇`})]})]})})(),jt&&J&&a&&(0,Q.jsx)(`div`,{className:`prism-page-wrap syn-detail-panel`,style:{"--pdf-pct":`${Qe}%`},children:(0,Q.jsxs)(`div`,{className:`syn-detail`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-page-close syn-detail-close`,onClick:()=>Mt(null),"aria-label":`Close`,children:`✕`}),jt.kind===`contradiction`&&(()=>{let e=a.contradictions.find(e=>e.id===jt.id);if(!e)return null;let t=X.get(e.a),n=X.get(e.b);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":e.relation,children:e.relation===`contradicts`?`Contradiction`:`In tension`}),(0,Q.jsx)(`h3`,{className:`syn-detail-title`,children:e.label}),!e.comparable&&(0,Q.jsxs)(`p`,{className:`syn-banner`,children:[`Not directly comparable`,e.caveat?` — differs on ${e.caveat}`:``,`.`]}),(0,Q.jsx)(`div`,{className:`syn-tape`,children:[t,n].map((e,t)=>e&&(0,Q.jsxs)(`button`,{type:`button`,className:`syn-tape-side`,onClick:()=>{Mt(null),w(e.id)},children:[(0,Q.jsxs)(`span`,{className:`syn-tape-cite`,children:[a.sourceLabel(e.source),` · p.`,e.page]}),(0,Q.jsxs)(`span`,{className:`syn-tape-quote`,children:[`“`,e.quote,`”`]})]},t))}),e.delta&&(0,Q.jsxs)(`p`,{className:`syn-delta`,children:[e.delta.aValue,` vs `,e.delta.bValue,` `,e.delta.unit]}),(0,Q.jsx)(`button`,{type:`button`,className:`syn-interrogate`,onClick:()=>{P(!0),M(!0),L(t=>({id:(t?.id??0)+1,question:e.seedQuestion}))},children:`Interrogate — are these comparable?`})]})})(),jt.kind===`gap`&&(()=>{let e=a.gaps.find(e=>e.id===jt.id);return e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":`gap`,children:e.kind===`absent`?`Gap`:`Thin coverage`}),(0,Q.jsx)(`h3`,{className:`syn-detail-title`,children:e.facet.label}),(0,Q.jsxs)(`p`,{className:`syn-receipt`,children:[(0,Q.jsxs)(`strong`,{children:[e.coveredCount,` of `,e.sourcesScanned,` sources`]}),` `,`mention this`,e.coveredCount===0?` — nothing in the corpus covers it`:``,`.`]}),(0,Q.jsx)(`p`,{className:`syn-searched-label`,children:`Searched for, verbatim:`}),(0,Q.jsx)(`ul`,{className:`syn-searched`,children:e.searchedForms.map(e=>(0,Q.jsx)(`li`,{children:e},e))}),(0,Q.jsx)(`p`,{className:`syn-note`,children:`A statement about the corpus text — it dissolves the moment a source covers it.`})]}):null})(),jt.kind===`consensus`&&(()=>{let e=a.consensus.find(e=>e.id===jt.id);return e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":`agrees`,children:`Consensus`}),(0,Q.jsxs)(`p`,{className:`syn-consensus-count`,children:[(0,Q.jsxs)(`strong`,{children:[e.sourceCount,` of `,e.corpusSize,` sources`]}),` `,`agree`]}),(0,Q.jsx)(`p`,{className:`syn-proposition`,children:e.proposition}),(0,Q.jsx)(`p`,{className:`syn-proposition-note`,children:`A paraphrase of the shared point — the verbatim lines are below.`}),(0,Q.jsx)(`div`,{className:`syn-members`,children:e.memberClaimIds.map(e=>{let t=X.get(e);return t&&(0,Q.jsxs)(`button`,{type:`button`,className:`syn-member`,onClick:()=>{Mt(null),w(e)},children:[(0,Q.jsxs)(`span`,{className:`syn-tape-cite`,children:[a.sourceLabel(t.source),` · p.`,t.page]}),(0,Q.jsxs)(`span`,{className:`syn-tape-quote`,children:[`“`,t.quote,`”`]})]},e)})}),e.band&&(0,Q.jsxs)(`p`,{className:`syn-delta`,children:[e.band.min,`–`,e.band.max,` `,e.band.unit]})]}):null})()]})})]}),J&&!ue&&!G&&!pe&&(ot||Gt)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":ot?`true`:void 0,role:`status`,children:[(0,Q.jsx)(`span`,{className:`prism-standing-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-standing-text`,children:ot?`Checking the key claims against the public record…`:Gt})]}),J&&(ue||G||pe)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":ue?`true`:void 0,"data-recon":`true`,role:`status`,children:[(0,Q.jsx)(`span`,{className:`prism-standing-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-standing-text`,children:ue?`Checking the document’s own numbers against each other…`:pe?`Couldn’t check the numbers — try again.`:U&&U.length>0?`${U.length===1?`A number doesn’t`:`${U.length} numbers don’t`} add up — the document’s own figures disagree`:`Every number checks out — the document’s figures are consistent.`})]}),J&&(0,Q.jsxs)(`footer`,{className:`prism-foot`,children:[(0,Q.jsxs)(`span`,{className:`prism-foot-stat`,children:[Rt,` claim`,Rt===1?``:`s`,` · `,q?.regions.length??0,` region`,(q?.regions.length??0)===1?``:`s`,` · every card cites a real page`,b>Rt?` · ${b-Rt} ungrounded dropped`:``]}),(0,Q.jsxs)(`div`,{className:`prism-foot-actions`,children:[(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Ask`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(j?` is-active`:` prism-foot-btn--primary`),onClick:()=>{j||(fe(!1),be(!1),je(!1),Be(!1)),j||P(!0),M(e=>!e)},...s(Un.preload),"aria-pressed":j,title:`Ask the document a question — the answer lights up the exact lines`,children:j?`Hide ask`:`Ask the document`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(en?` is-active`:``),onClick:en?an:sn,...s(Wn.preload),disabled:!q||q.claims.length===0,"aria-pressed":en,title:`Play a silent, captioned flight through the document's argument — ending on its weakest point`,children:en?`End briefing`:`Brief me`})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Verify`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(G?` is-active`:``),onClick:fn,...s(()=>tr().then(()=>void 0)),disabled:ue||!t||!v||v.claims.length===0,"aria-pressed":G,title:`Check the document's own figures against each other — flags numbers that don't add up, computed in pure code`,children:ue?`Checking…`:G?`Hide numbers`:`Check the numbers`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(ye?` is-active`:``),onClick:gn,...s(()=>Promise.all([Gn.preload(),nr()]).then(()=>void 0)),disabled:_e||!t||!v||v.claims.filter(e=>e.role===`load-bearing`).length===0,"aria-pressed":ye,title:`Raise the sharpest objection to each load-bearing claim — and show only the ones the document never answers`,children:_e?`Examining…`:ye?`Hide objections`:`Cross-examine`}),v&&v.claims.some(e=>e.kind===`forecast`)&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Ae?` is-active`:``),onClick:yn,...s(()=>Promise.all([Kn.preload(),rr()]).then(()=>void 0)),disabled:Oe||!t||!n?.enabled,"aria-pressed":Ae,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:Oe?`Grading…`:Ae?`Hide forecasts`:`Grade forecasts`}),v&&v.claims.some(e=>/\d/.test(e.quote))&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(ze?` is-active`:``),onClick:Sn,...s(()=>Promise.all([qn.preload(),ir()]).then(()=>void 0)),disabled:Le||!t||!y,"aria-pressed":ze,title:`Find the model implied under the document and drag its assumptions — every figure traces to a page, the conclusion recomputes live`,children:Le?`Modeling…`:ze?`Hide levers`:`Live levers`})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Explore`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Ue===`contra`?` is-active`:``),onClick:()=>We(e=>e===`contra`?`map`:`contra`),disabled:!v||v.threads.length===0,title:v&&v.threads.length===0?f?`No links found between these documents`:`No contradictions found in this document`:void 0,children:v&&v.threads.length>0?f?`Show links (${v.threads.length})`:`Find contradictions (${v.threads.length})`:f?`No links`:`No contradictions`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:Zt,...s(()=>Promise.all([Jn.preload(),ar()]).then(()=>void 0)),disabled:!t||!y||qe!==null,title:`Explode this document into a causal web — every link traces to a page`,children:qe===`why`?`Tracing…`:`Why (causes)`})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Annotate & share`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(ct?` is-active`:``),onClick:()=>lt(e=>!e),"aria-pressed":ct,title:`Annotate — Mavéa draws a pen mark over the cited lines and explains, on every question, claim, and briefing beat`,children:ct?`Pen on`:`Annotate`}),v&&(0,Q.jsx)(Vn,{steps:mt,spec:v,pdfs:u,placed:q?.claims,verdicts:nn})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group prism-foot-group--quiet`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:()=>We(`map`),children:`Reset view`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Xe?` is-active`:``),onClick:()=>Ze(e=>!e),"aria-pressed":Xe,children:`Legend`})]})]})]}),J&&Xe&&(0,Q.jsxs)(`aside`,{className:`prism-legend-panel`,"aria-label":`What the colors and lines mean`,children:[(0,Q.jsxs)(`div`,{className:`prism-legend-col`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-title`,children:`THE KIND PALETTE`}),(0,Q.jsx)(`ul`,{className:`prism-legend-kinds`,children:mr.map(e=>(0,Q.jsxs)(`li`,{className:`prism-legend-kind`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-kind-dot`,style:{background:dr[e.kind].color},"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-legend-kind-name`,children:dr[e.kind].label}),(0,Q.jsxs)(`span`,{className:`prism-legend-kind-desc`,children:[`· `,e.desc]})]},e.kind))})]}),(0,Q.jsxs)(`div`,{className:`prism-legend-col`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-title`,children:`THE THREAD PALETTE`}),(0,Q.jsx)(`ul`,{className:`prism-legend-threads`,children:hr.map(e=>(0,Q.jsxs)(`li`,{className:`prism-legend-thread`,children:[(0,Q.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,Q.jsx)(`line`,{x1:`2`,y1:`4`,x2:`38`,y2:`4`})}),(0,Q.jsx)(`span`,{className:`prism-legend-thread-name`,children:e.name}),(0,Q.jsxs)(`span`,{className:`prism-legend-thread-desc`,children:[`· `,e.desc]})]},e.relation))}),(0,Q.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,Q.jsx)(`strong`,{children:`arguable`}),`, not just readable.`]})]})]}),!J&&_!==`error`&&(0,Q.jsx)(`footer`,{className:`prism-foot prism-foot-quiet`,children:(0,Q.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.`})})]}),Ge&&(0,Q.jsx)(l,{label:`Why map`,overlay:!0,children:(0,Q.jsx)(er,{dag:Ge,onClose:()=>Ke(null)})})]})}var xr=[{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{xt as a,q as c,fe as d,kt as i,je as l,Hn as n,_t as o,Lt as r,yt as s,br as t,Me as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{n,u as r}from"./useLiveConfig-CvOQTr0s.js";import{t as i}from"./PrismOverlay-DRWAI9Mh.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=r(n()),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-CNsihJ1F.js";var r=e(),i=`# Mavéa Privacy Notice
|
|
2
2
|
|
|
3
|
-
Effective: August
|
|
3
|
+
Effective: August 22, 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
|
|
|
@@ -25,7 +25,8 @@ Depending on the features you use, browser storage may contain:
|
|
|
25
25
|
- drafts, tracked items, presentation settings, and recent feature state;
|
|
26
26
|
- provider and model configuration;
|
|
27
27
|
- remembered provider, search, or optional GitHub credentials;
|
|
28
|
-
- a short-lived cache of recent questions and the answers to them, kept on the device so that asking the same thing again does not bill your key a second time; it expires within a day, and it deliberately excludes any answer that drew on attachments, ink, filled-in blanks, cited sources, or your remembered facts;
|
|
28
|
+
- a short-lived cache of recent questions and the answers to them, kept on the device so that asking the same thing again does not bill your key a second time; it expires within a day, and it deliberately excludes any answer that drew on attachments, ink, filled-in blanks, cited sources, or your remembered facts (document text attached to a Prism or Synthesis map is kept separately — see the next entry);
|
|
29
|
+
- the map of a document you exploded with Prism or Synthesis — its claims and the extracted page text they are quoted against — kept on the device so re-opening the same file does not bill your key to read it again. It is filed under that file's identity and the model that read it, so it is only ever reused for the same document; it does not expire on a timer, because the mapping cannot go stale and re-running it would charge you for an identical result. It is bounded instead: the least recently opened entries are dropped once the store passes a fixed number of entries or a fixed total size. Clearing site data removes it;
|
|
29
30
|
- temporary in-progress and finished video-export files in origin-private browser storage until the export is consumed or discarded; and
|
|
30
31
|
- short-lived demo, tour, route, and in-progress session data.
|
|
31
32
|
|
|
@@ -41,6 +42,8 @@ Provider and search keys stay in memory until reload unless you choose Remember.
|
|
|
41
42
|
|
|
42
43
|
Keys are decrypted when needed and pass through the deployment's same-origin proxy to the provider you selected. The proxy and its host can technically access credentials and content in transit. Browser encryption does not protect against an active compromise of the device, browser, extension, deployment, proxy, or provider.
|
|
43
44
|
|
|
45
|
+
The scope you grant is the boundary of what these features can read: a token that can reach private repositories lets any feature you run reach them too, and what it reads can then be sent to your selected model provider (see section 4). Review the scopes at the point of authorization, prefer read-only, and revoke a connection you are no longer using.
|
|
46
|
+
|
|
44
47
|
Optional GitHub and Google connections can store access tokens, refresh tokens, or repository settings in the actions gateway or its host configuration. The unmodified gateway writes persisted OAuth tokens to an owner-readable host file and keeps limited audit metadata, not request bodies or provider response text. Whoever runs the gateway controls that file, its backups, logs, deletion, and security.
|
|
45
48
|
|
|
46
49
|
The unmodified gateway has no separate Mavéa user accounts. On a shared deployment, everyone allowed to use action features may act through the deployment operator's connected GitHub or Google account. Use a dedicated, least-privilege gateway and do not expose it to people who should not share those permissions.
|
|
@@ -51,6 +54,10 @@ Text you type or paste, conversation context, remembered facts, attached files,
|
|
|
51
54
|
|
|
52
55
|
Prism and Synthesis stage and extract supported files locally where possible, but relevant content can still be sent for analysis. Ripple can parse code locally before optional model enrichment sends relevant code or diffs. Local staging is not a promise that later analysis remains local.
|
|
53
56
|
|
|
57
|
+
Two of these flows do not wait for you to press anything, which is the part worth knowing. Features that watch something for you — tracked items, dashboards, and the morning brief — re-issue requests on the cadence you configure, so the same content and credentials go out again on a timer rather than only when you ask; most run only while Mavéa is open, and each run can bill your provider. And remembered facts are attached to later requests: something you told Mavéa once can be included in a request you make weeks afterwards, to whichever provider is selected at that time. You can review or forget remembered items, and turning a tracked item or a dashboard off stops its checks.
|
|
58
|
+
|
|
59
|
+
Connecting a code host is the same boundary, and it is worth stating plainly because the content is not something you typed: when you point Mavéa at a repository, the files, documentation, diffs, commit messages, issues, and other repository data a feature reads can be sent through the deployment to the model provider you selected. **A private repository is not treated differently from a public one** — if you grant a token or OAuth scope that can read private repositories, private source and internal documentation can leave your control the same way a pasted snippet does, and the provider's own retention and processing terms then apply to it. Grant the narrowest scope that makes the feature work, prefer read-only and a repository allowlist where your host offers one, use a dedicated account for shared deployments, and do not connect a repository whose contents you are not permitted to disclose to that provider.
|
|
60
|
+
|
|
54
61
|
## 5. Voice, microphone, speech, and reels
|
|
55
62
|
|
|
56
63
|
If you enable listening, the browser captures microphone input. Audio is processed by the deployment's configured speech-to-text endpoint — by default a local one on the same machine, though an operator can configure a different endpoint — which converts speech to text. Recognized transcripts may then be sent to your selected model provider, including while listening continues.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-Ys5NYDZR.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/useFocusTrap-CJmpNZv2.js","assets/toast-BBNs2h3L.js","assets/spokenText-Dy-GZvZV.js","assets/capture-MMxmbgt1.js","assets/index-yJfYsjAB.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/share--tpc1nLE.js","assets/registry-Cz5cZREW.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/ReelJelly-D5e-jt-8.js","assets/geometry-DXAbnb0J.js","assets/threads-DNfxMTwx.js","assets/FeatureUseNotice-lFcApjaS.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/ShareModal-I_sxHKLv.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{n as a,t as o}from"./preloadableLazy-MIX1ApBW.js";import{E as s,lt as c}from"./index-yJfYsjAB.js";import{n as l}from"./icons-gLFQTv74.js";var u=e(),d=t(),f=c();function p(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 m=n();r();var h=o(()=>i(()=>import(`./ShareModal-Ys5NYDZR.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]))),g=h.Component;function _(e){let t=(0,d.c)(9),{frames:n,spec:r}=e,[i,o]=(0,u.useState)(!1),c;t[0]!==n||t[1]!==r?(c=n??(r?p(r):[]),t[0]=n,t[1]=r,t[2]=c):c=t[2];let l=c;if(!l.length)return null;let _;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,m.jsx)(`button`,{type:`button`,className:`clip-launch`,onClick:()=>o(!0),...a(h.preload),children:`✨ Make a video`}),t[3]=_):_=t[3];let v;t[4]!==i||t[5]!==l?(v=i&&(0,f.createPortal)((0,m.jsx)(s,{label:`Make a video`,overlay:!0,children:(0,m.jsx)(g,{frames:l,onClose:()=>o(!1)})}),document.body),t[4]=i,t[5]=l,t[6]=v):v=t[6];let y;return t[7]===v?y=t[8]:(y=(0,m.jsxs)(m.Fragment,{children:[_,v]}),t[7]=v,t[8]=y),y}function v(e){let t=(0,d.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,m.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,m.jsx)(l.play,{className:`ic`,style:{color:`var(--presence-soft)`}}),` Mavéa Replay`]}),t[2]=c):c=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u={fontSize:17,marginBottom:14},t[3]=u):u=t[3];let f=r||`“I dropped in 3 statements. Mavéa showed me where my money went in 20 seconds.”`,p;t[4]===f?p=t[5]:(p=(0,m.jsx)(`div`,{className:`insight-title`,style:u,children:f}),t[4]=f,t[5]=p);let h;t[6]===i?h=t[7]:(h=i&&(0,m.jsx)(_,{spec:i}),t[6]=i,t[7]=h);let g;return t[8]!==s||t[9]!==p||t[10]!==h?(g=(0,m.jsxs)(`div`,{className:`card replay-card reveal`,style:s,children:[c,p,h]}),t[8]=s,t[9]=p,t[10]=h,t[11]=g):g=t[11],g}export{v as ReplayCard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-BZJXY1be.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{t as n}from"./TopicCanvas-xwDjwqxn.js";import{t as r}from"./useFocusTrap-CJmpNZv2.js";import{t as i}from"./sentenceCase-CLDiNB0f.js";import{n as a}from"./replay-BlrkSDMO.js";import"./canvas-OSBUSYbY.js";import{t as o}from"./AnnotationLayer-0YQgrjN3.js";var s=e(),c=t(),l=700;function u({frames:e,initialIndex:t,speak:u,cancelSpeak:d,onClose:f}){let[p,m]=(0,s.useState)(()=>Math.min(Math.max(0,t),e.length-1)),[h,g]=(0,s.useState)(null),[_,v]=(0,s.useState)(!1),[y,b]=(0,s.useState)([]),[x,S]=(0,s.useState)(()=>e[t]?.spec??null),C=(0,s.useRef)(null),w=(0,s.useRef)(null),T=(0,s.useRef)(null),E=e[p]??null,D=(0,s.useCallback)(()=>{T.current?.(),T.current=null,d?.(),v(!1),g(null),b([])},[d]),O=(0,s.useCallback)(()=>{D(),f()},[D,f]);r(w,{onEscape:O});let k=(0,s.useCallback)((e,t)=>{if(D(),!e.length)return;let n=!1,r;T.current=()=>{n=!0,r&&clearTimeout(r)},v(!0);let i=0,a=()=>{if(n)return;if(i>=e.length){v(!1),g(null);return}let o=e[i];m(t+i),S(o.spec),b([]),d?.(),o.say&&u?.(o.say);let s=0,c=()=>{if(n)return;if(s>=o.beats.length){i+=1,r=setTimeout(a,l);return}let e=o.beats[s++];if(e.set&&`spot`in e.set){let t=e.set.spot??null;g(t);let n=t?o.cues.find(e=>e.spot===t):void 0;n?.marks.length&&b(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(c,e.ms??0)};c()};a()},[D,u,d]),A=(0,s.useCallback)(()=>{E&&k(a([E],0),p)},[E,p,k]),j=(0,s.useCallback)(()=>{k(a(e,p),p)},[e,p,k]),M=(0,s.useCallback)(()=>{m(0),k(a(e,0),0)},[e,k]),N=(0,s.useCallback)(t=>{D(),m(t),S(e[t]?.spec??null)},[e,D]);return(0,s.useEffect)(()=>{if(!h)return;let e=window.setTimeout(()=>{let e=C.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)},[h]),(0,s.useEffect)(()=>()=>D(),[D]),!E||!x?null:(0,c.jsx)(`div`,{className:`replay-scrim`,onClick:O,children:(0,c.jsxs)(`div`,{className:`replay-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Replay`,ref:w,onClick:e=>e.stopPropagation(),children:[(0,c.jsxs)(`div`,{className:`replay-timeline`,children:[(0,c.jsxs)(`div`,{className:`replay-timeline-head`,children:[(0,c.jsx)(`span`,{children:`Conversation`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:12},onClick:O,children:`← Live`})]}),e.map((e,t)=>(0,c.jsxs)(`button`,{className:`replay-turn`+(t===p?` is-active`:``),onClick:()=>N(t),title:e.question&&i(e.question),children:[(0,c.jsxs)(`span`,{className:`replay-turn-title`,children:[t+1,`. `,i(e.question||e.spec.title)]}),(0,c.jsxs)(`span`,{className:`replay-turn-meta`,children:[e.spec.blocks.length,` cards`,e.mode===`replace`?``:` · ${e.mode}`]})]},t))]}),(0,c.jsxs)(`div`,{className:`replay-main`,children:[(0,c.jsxs)(`div`,{className:`replay-bar`,children:[(0,c.jsx)(`span`,{className:`faint replay-bar-title`,children:E.spec.title}),_?(0,c.jsx)(`button`,{className:`entry-action`,onClick:D,children:`◼ Stop`}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`button`,{className:`entry-action`,onClick:A,children:`▶ Replay this`}),(0,c.jsx)(`button`,{className:`entry-action`,onClick:j,children:`▶ From here`}),(0,c.jsx)(`button`,{className:`entry-action`,onClick:M,children:`▶ From start`})]})]}),(0,c.jsxs)(`div`,{ref:C,className:`canvas-scroll replay-canvas`,children:[(0,c.jsx)(`div`,{className:`topic-wrap`,children:(0,c.jsx)(n,{data:x,spot:h,built:{},onProve:()=>{}})}),(0,c.jsx)(o,{spots:y,within:C.current,revision:p})]})]})]})})}export{u 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-CJmpNZv2.js";import{t as i}from"./motion-DxHSlPN6.js";import{t as a}from"./useDashboards-lgQnk2Al.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-CJmpNZv2.js";import{t as i}from"./motion-DxHSlPN6.js";import{t as a}from"./useDashboards-B-EjE8FH.js";import{c as o}from"./ledger-DHS2di3l.js";import{t as s}from"./useLedger-D4cXEwI0.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,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RippleOverlay-
|
|
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-D5D55hZi.js";import{E as c,c as l}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RippleOverlay-DHnHEYoS.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-yJfYsjAB.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/useFocusTrap-CJmpNZv2.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/FeatureUseNotice-lFcApjaS.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/route-CMdTFx0P.js","assets/cache-7UEbF3S6.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-B3hg2KMN.css","assets/useLiveConfig-CvOQTr0s.js","assets/info-CiqHR5cs.js","assets/providers-CPhoN8j0.js","assets/http-Bqk6nJiH.js","assets/blockTypes-DUDdP3pB.js","assets/attachments-BW-vki-E.js","assets/kokoro-DogSQaQB.js","assets/spokenText-Dy-GZvZV.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-D5D55hZi.js";import{E as c,c as l}from"./index-yJfYsjAB.js";import{t as u}from"./homeTarget-CDc-r2mj.js";var d=e(),f=t();n();var p=a(()=>r(()=>import(`./RippleOverlay-DHnHEYoS.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,27]))),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-CvOQTr0s.js`).then(e=>e.f);return{getLiveConfigV2:e,toModelConfig:t}},__vite__mapDeps([28,2,1,3,29,24,30,31,32,33,18])).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-DogSQaQB.js`).then(e=>e.M).then(t=>t.speak(e,`mavea`)),__vite__mapDeps([34,2,9,1,3,10,4,11,5,7,6,8,12,13,35]))},[]);return e?(0,f.jsx)(c,{label:`Ripple overview`,children:(0,f.jsx)(m,{model:e,cfg:n,speak:a,onClose:()=>{window.location.hash=u().href}})}):(0,f.jsx)(l,{})}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-CPhoN8j0.js";import{t as i}from"./json-J4Y32_i9.js";import{n as a}from"./verbatim-DBTj9sPD.js";import{r as o}from"./githubBrowser-CErQprLW.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(`
|