@mavea/mavea 1.0.16 → 1.0.17
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/dist/.vite/manifest.json +589 -567
- package/dist/assets/{AppCommandPalette-Dzl_DbDd.js → AppCommandPalette-B3E1gTd4.js} +1 -1
- package/dist/assets/{BlockEmpty-B5Q0hgDJ.js → BlockEmpty-DQkdduUE.js} +1 -1
- package/dist/assets/{BriefingPlayer-Dy7JCGm-.js → BriefingPlayer-CRKTlKa3.js} +1 -1
- package/dist/assets/{CanvasSkeleton-CJwPWnFG.js → CanvasSkeleton-cQ6KF-6z.js} +2 -2
- package/dist/assets/{CheckLogRail-DNtXlkcR.js → CheckLogRail-C6nouD1Y.js} +1 -1
- package/dist/assets/{CodeOutput-Bg64AyKu.js → CodeOutput-H8TQzjqL.js} +1 -1
- package/dist/assets/{CommandPalette-mO1FEvlx.js → CommandPalette-CSvgbXxg.js} +1 -1
- package/dist/assets/CourseLessonReader-1KDKwxIj.js +2 -0
- package/dist/assets/{CourseRail-CRcB319H.js → CourseRail-BijCpApU.js} +1 -1
- package/dist/assets/CoursesApp-BWkdYL07.js +2 -0
- package/dist/assets/{CrossExamPanel-Deywo95y.js → CrossExamPanel-Cn7b5y7B.js} +1 -1
- package/dist/assets/{DashPresent-BEm1tGse.js → DashPresent-B025i7iJ.js} +1 -1
- package/dist/assets/DashboardDetail-CZLnxgp0.js +2 -0
- package/dist/assets/DashboardLoopRuntime-7MpMUcMg.js +1 -0
- package/dist/assets/{DashboardOverview-DrdqBgds.js → DashboardOverview-COyleu7v.js} +1 -1
- package/dist/assets/{DashboardSettings-CBhzLW0P.js → DashboardSettings-DUfUqbsp.js} +1 -1
- package/dist/assets/DashboardsApp-6xMz2qCP.js +2 -0
- package/dist/assets/{DeepZoomApp-Chz6laKc.js → DeepZoomApp-CQaTT2Uh.js} +1 -1
- package/dist/assets/{DelegatePanel-DmtTY_lE.js → DelegatePanel-D4OrMa2D.js} +1 -1
- package/dist/assets/{DemoGallery-zw3d7ap9.js → DemoGallery-Bt92vKqc.js} +1 -1
- package/dist/assets/{DropSelect-Bo2Oyi-2.js → DropSelect-Q310fTbf.js} +1 -1
- package/dist/assets/{ExportModal-DICXavg9.js → ExportModal-D0zXlC8w.js} +2 -2
- package/dist/assets/ExtractionPreview-0SZYynDs.js +18 -0
- package/dist/assets/{FlagshipCTA-B-7nH43r.js → FlagshipCTA-D845jkdt.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-DgTL_Kjj.js → FlagshipCommandPalette-DHMnyG7j.js} +1 -1
- package/dist/assets/{FlagshipShowcase-CbAC2s4X.js → FlagshipShowcase-BuR3PZvU.js} +1 -1
- package/dist/assets/{FlashcardsApp-CatYcaJJ.js → FlashcardsApp-BzWb4cRP.js} +1 -1
- package/dist/assets/{ForecastPanel-BOG361kr.js → ForecastPanel-lTnux0EB.js} +1 -1
- package/dist/assets/GalleryApp-D0NGZ1_t.js +1 -0
- package/dist/assets/{HonestByDesign-hCxc0A7b.js → HonestByDesign-CCOt31nx.js} +1 -1
- package/dist/assets/{HowItWorks-BlbQcUxx.js → HowItWorks-auW5XXCZ.js} +1 -1
- package/dist/assets/{LegalApp-sCZjJYWx.js → LegalApp-DXDomKFv.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-Bk3U7ChN.js → LegalMarkdownDocument-DBjLz9Yf.js} +1 -1
- package/dist/assets/{LegalPageShell-BsgRV7aL.js → LegalPageShell-BG5UUk-9.js} +1 -1
- package/dist/assets/{LeverPanel-CP32QcIf.js → LeverPanel-CvYnTLjh.js} +1 -1
- package/dist/assets/{Library-CJTnp1pC.js → Library-Cl1gE9Qg.js} +1 -1
- package/dist/assets/{LibraryOverlay-geQRGAzG.js → LibraryOverlay-CX4cJLqD.js} +1 -1
- package/dist/assets/LiveApp-CDckMWYX.js +61 -0
- package/dist/assets/LiveSettings-DgfIXanM.js +6 -0
- package/dist/assets/{MindMapViewerDrawer-7HLErRQF.js → MindMapViewerDrawer-ClU9wgSH.js} +1 -1
- package/dist/assets/{MindShape-Bhu4yoIj.js → MindShape-yF19n9qq.js} +1 -1
- package/dist/assets/{PinToDashboard-Cj8S9XKC.js → PinToDashboard-CpIDAcIU.js} +1 -1
- package/dist/assets/PlanReview-CPcqOxjp.js +1 -0
- package/dist/assets/{Presence-DDxb6yE5.js → Presence-CHGZ1JRp.js} +1 -1
- package/dist/assets/{PresentationDeck-B6AHRYEA.js → PresentationDeck-CrtiWjiM.js} +1 -1
- package/dist/assets/PrismApp-D7RbekoX.js +2 -0
- package/dist/assets/{PrismAskController-DUvOTeW9.js → PrismAskController-D6_7Epdb.js} +1 -1
- package/dist/assets/PrismBriefingPlayer-Dq5_KRU3.js +2 -0
- package/dist/assets/PrismOverlay-CduGpA8D.js +131 -0
- package/dist/assets/{PrivacyApp-CatB3OpJ.js → PrivacyApp-rhzy-5HG.js} +1 -1
- package/dist/assets/{Recap-DkKrrqi5.js → Recap-BPg2xEPo.js} +1 -1
- package/dist/assets/{ReelJelly-DCD4bG10.js → ReelJelly-LWeMsFpj.js} +1 -1
- package/dist/assets/ReplayCard-C3dGQfxG.js +2 -0
- package/dist/assets/{ReplayOverlay-DbJX08Kr.js → ReplayOverlay-C9W603B5.js} +1 -1
- package/dist/assets/{RewindOverlay-Bop4a63b.js → RewindOverlay-BIWmxQlx.js} +1 -1
- package/dist/assets/RippleApp-C9-KFvkn.js +2 -0
- package/dist/assets/{RippleAskController-CK4iSwT0.js → RippleAskController-DEKz-6Vn.js} +1 -1
- package/dist/assets/RippleOverlay-CfXvnUHE.js +6 -0
- package/dist/assets/{SeeDontRead-CGGKmvBV.js → SeeDontRead-DrG1qBxJ.js} +1 -1
- package/dist/assets/{ShareModal-D4En6Y3L.js → ShareModal-eJ6sdMpf.js} +1 -1
- package/dist/assets/{ShipCascade-k_GWrcau.js → ShipCascade-BP8qL0yM.js} +1 -1
- package/dist/assets/{ShipCourse-BQOY4MyI.js → ShipCourse-BoqW58VU.js} +1 -1
- package/dist/assets/{ShipHotspots-vLRK0w_b.js → ShipHotspots-_9XPhZg2.js} +1 -1
- package/dist/assets/{ShipIncident-BWxerYtX.js → ShipIncident-Xod2gbjc.js} +1 -1
- package/dist/assets/{ShipMigration-OgAGEbjm.js → ShipMigration-BdkaiJ9D.js} +1 -1
- package/dist/assets/{ShipOnboarding-B_2IEq3N.js → ShipOnboarding-CblWatXR.js} +1 -1
- package/dist/assets/{ShipRead--gGqg2SE.js → ShipRead-BBn7xkOF.js} +1 -1
- package/dist/assets/{ShipRollout-B_U2P8Yw.js → ShipRollout-i5BY3YnP.js} +1 -1
- package/dist/assets/{ShipSuggestions-D9coTmgw.js → ShipSuggestions-liytLgC-.js} +1 -1
- package/dist/assets/{ShipWorkspace-BmdcHZXa.js → ShipWorkspace-C3VQwGn1.js} +1 -1
- package/dist/assets/{SignatureLoop-KA6Cf93g.js → SignatureLoop-Ba7plTb5.js} +1 -1
- package/dist/assets/{SynthesisApp-BCBhCJhx.js → SynthesisApp-Ch0tWRBS.js} +2 -2
- package/dist/assets/{SynthesisOverlay-BuGIeaKq.js → SynthesisOverlay-DMZndCzV.js} +1 -1
- package/dist/assets/{TermsApp-CleIlDtR.js → TermsApp-Dk2jpxq-.js} +1 -1
- package/dist/assets/{TopicCanvas-BRu3xVL8.js → TopicCanvas-DX0Z1ZHv.js} +2 -2
- package/dist/assets/{TourPrism-zbVLe2ag.js → TourPrism-6fWPMU4Z.js} +1 -1
- package/dist/assets/{TrackerTile-D9Wa3CSq.js → TrackerTile-BboQpBGy.js} +2 -2
- package/dist/assets/{TwoSurfaces-TyWXgAdq.js → TwoSurfaces-Cabk1rES.js} +1 -1
- package/dist/assets/{UnderstoodPanel-BS9OhgLJ.js → UnderstoodPanel-B6jfiKx1.js} +1 -1
- package/dist/assets/{WhyMachineOverlay-B-KJhCjr.js → WhyMachineOverlay-BRNibJSf.js} +1 -1
- package/dist/assets/{WowFeatures-Bv1-PmXF.js → WowFeatures-C7f4qzIf.js} +1 -1
- package/dist/assets/{ZoomDeck-C2Q6xbgX.js → ZoomDeck-BtlVyhwv.js} +1 -1
- package/dist/assets/{alternateFinishes-BG6svkXG.js → alternateFinishes-CVUX4x0C.js} +1 -1
- package/dist/assets/{annotationAuto-BpBsjbDQ.js → annotationAuto-BjWqgseH.js} +1 -1
- package/dist/assets/{annotationReel-yzysA-Gr.js → annotationReel-B5A2RZkx.js} +1 -1
- package/dist/assets/{backup-BdeBr3wq.js → backup-d46KwktS.js} +1 -1
- package/dist/assets/cachedImport-DW0gP14h.js +1 -0
- package/dist/assets/canvas-BuMP6u6i.js +1 -0
- package/dist/assets/{catalog-DF7YTNju.js → catalog-Bv0dWU_C.js} +1 -1
- package/dist/assets/confirmAdd-CWWtX1VN.js +1 -0
- package/dist/assets/{dashboardEvents-C_XvGVLJ.js → dashboardEvents-Be4sftHN.js} +1 -1
- package/dist/assets/{dist-CBEt6Q8V.js → dist-DIKAXwpM.js} +1 -1
- package/dist/assets/{fit-B1LJWvMO.js → fit-CuHWhwsj.js} +1 -1
- package/dist/assets/{generateLive-ChhSWKbq.js → generateLive-CMbGT3eM.js} +1 -1
- package/dist/assets/index-Dbr1j8Fe.js +22 -0
- package/dist/assets/{jspdf.es.min-DutJi91O.js → jspdf.es.min-ydC1TxUW.js} +1 -1
- package/dist/assets/{kokoro-kGWf7M0e.js → kokoro-DsmNzulR.js} +1 -1
- package/dist/assets/{lib-C7zXL8h0.js → lib-B6qSkBPa.js} +1 -1
- package/dist/assets/{liveSchema-DCL21WdS.js → liveSchema-B1MGdSkK.js} +1 -1
- package/dist/assets/{motion-dfA87zbb.js → motion-luJxBPnj.js} +1 -1
- package/dist/assets/notes-3WQ6b0Mi.js +1 -0
- package/dist/assets/{pdf-DFYCstCC.js → pdf-RyoPCIGN.js} +1 -1
- package/dist/assets/{perfProbe-CCSPF3EA.js → perfProbe-Xs39DqMh.js} +1 -1
- package/dist/assets/{pin-D5_Ebl_s.js → pin-Cj-LMfpK.js} +1 -1
- package/dist/assets/{portal-BndazODr.js → portal-zyqZwnb1.js} +1 -1
- package/dist/assets/{pptxgen.es-CwCkoJdp.js → pptxgen.es-CveAizg8.js} +1 -1
- package/dist/assets/{prewarm--KODwuMi.js → prewarm-K5WcvrNh.js} +1 -1
- package/dist/assets/{quietHours-DVPplPtM.js → quietHours-BklvMqsV.js} +1 -1
- package/dist/assets/{registry-DQIm_hbI.js → registry-1h9idbfk.js} +1 -1
- package/dist/assets/{registry-Dphh5ADP.js → registry-2zthbrHC.js} +1 -1
- package/dist/assets/{registry-D7rspCZr.js → registry-4O5l9cd5.js} +1 -1
- package/dist/assets/{registry-WJE8Z0T1.js → registry-BRB85vr4.js} +1 -1
- package/dist/assets/registry-BdMZ_4cm.js +2 -0
- package/dist/assets/{registry-Ba9xMFO4.js → registry-Bnp_yh8G.js} +2 -2
- package/dist/assets/{registry-BlB0FYf0.js → registry-C1IrZBk8.js} +1 -1
- package/dist/assets/{registry-B3V5-8v0.js → registry-C5DK98Hl.js} +1 -1
- package/dist/assets/{registry-0E1uKPCI.js → registry-CK0-re_Q.js} +1 -1
- package/dist/assets/{registry-DrNMbrA_.js → registry-COrl_Heq.js} +1 -1
- package/dist/assets/{registry-wJhGGVuP.js → registry-CQUQlrSx.js} +1 -1
- package/dist/assets/{registry-COxprhRN.js → registry-CXa3qXl3.js} +1 -1
- package/dist/assets/{registry-CWkBxxsI.js → registry-C_baBbqq.js} +1 -1
- package/dist/assets/{registry-CIa1EU-G.js → registry-CjY5POtx.js} +1 -1
- package/dist/assets/{registry-C30HGS2G.js → registry-CoBAqOlY.js} +1 -1
- package/dist/assets/{registry-Dvv84L9K.js → registry-DJj-o3MQ.js} +1 -1
- package/dist/assets/{registry-DNzF-nvu.js → registry-DfCCnIfu.js} +1 -1
- package/dist/assets/{registry-D-qEhm1d.js → registry-DfgFkD3J.js} +1 -1
- package/dist/assets/{registry-M3VgAiQv.js → registry-Dhlx1mF4.js} +1 -1
- package/dist/assets/{registry-nG70-amx.js → registry-DnEh7nbX.js} +1 -1
- package/dist/assets/{registry-hsSlT6pi.js → registry-VD94nLXO.js} +1 -1
- package/dist/assets/{registry-BH6FfyZk.js → registry-mFD4P5dI.js} +1 -1
- package/dist/assets/registry-sDzDmht4.js +1 -0
- package/dist/assets/{relate-DxAi8xpo.js → relate-CEND9Qlk.js} +1 -1
- package/dist/assets/{shikiHighlight-B_TEagaE.js → shikiHighlight-SCFIB43b.js} +1 -1
- package/dist/assets/useDashboardLoop-C8Mcbcto.js +5 -0
- package/dist/assets/{useLiveConfig-Lm0cYTcu.js → useLiveConfig-BW1WkpTc.js} +1 -1
- package/dist/assets/{useSpatialCanvas-D_C8VoCy.js → useSpatialCanvas-C5TNlpeK.js} +1 -1
- package/dist/assets/{useSpotlightWalk-CCQT0-_g.js → useSpotlightWalk-dA3IdI-1.js} +1 -1
- package/dist/assets/{useSrsCards-BKCPBPYw.js → useSrsCards-C7Xni9C0.js} +1 -1
- package/dist/assets/{useStudy-Diy4ITBm.js → useStudy-DHRIx8p-.js} +1 -1
- package/dist/assets/{useZoomGesture-B82XnSfi.js → useZoomGesture-BsPXvLw2.js} +1 -1
- package/dist/index.html +2 -1
- package/package.json +1 -1
- package/dist/assets/CourseLessonReader-CKfvBMtL.js +0 -2
- package/dist/assets/CoursesApp-BbCGxAav.js +0 -2
- package/dist/assets/DashboardDetail-tK6FpgtH.js +0 -2
- package/dist/assets/DashboardLoopRuntime-Cis4WMqk.js +0 -1
- package/dist/assets/DashboardsApp-Dc43FBIi.js +0 -2
- package/dist/assets/ExtractionPreview-C636AVw-.js +0 -18
- package/dist/assets/GalleryApp-uW6b1Y0d.js +0 -1
- package/dist/assets/LiveApp-C0BN0o3_.js +0 -61
- package/dist/assets/LiveSettings-CzSXXMoo.js +0 -6
- package/dist/assets/PlanReview-3NxZD9wt.js +0 -1
- package/dist/assets/PrismApp-BlPpWxao.js +0 -2
- package/dist/assets/PrismBriefingPlayer-Bmo9tOGX.js +0 -2
- package/dist/assets/PrismOverlay-9Q_14eEO.js +0 -131
- package/dist/assets/ReplayCard-Bz69tOST.js +0 -2
- package/dist/assets/RippleApp-u3hCfb5b.js +0 -2
- package/dist/assets/RippleOverlay-BM_B9JEc.js +0 -6
- package/dist/assets/canvas-Ep2Kfupo.js +0 -1
- package/dist/assets/index-C7H7A1rW.js +0 -22
- package/dist/assets/notes-DblI4Ko_.js +0 -1
- package/dist/assets/registry-B51MhOLx.js +0 -2
- package/dist/assets/registry-Pr5IKqro.js +0 -1
- package/dist/assets/useDashboardLoop-DzbRz-V9.js +0 -5
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-RyoPCIGN.js","assets/index-Dbr1j8Fe.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ShareModal-eJ6sdMpf.js","assets/ReelJelly-LWeMsFpj.js","assets/geometry-DXAbnb0J.js","assets/registry-BdMZ_4cm.js","assets/fit-CuHWhwsj.js","assets/share-QHGHNDhQ.js","assets/icons-CHVz6kv_.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/spokenText-D4zPX9JY.js","assets/toast-BBNs2h3L.js","assets/threads-CkMgrSDP.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-DsmNzulR.js","assets/ShareModal-PobtP7AJ.css","assets/annotationAuto-BjWqgseH.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/BriefingPlayer-CRKTlKa3.js","assets/BriefingPlayer-TpFZB77N.css","assets/annotationReel-B5A2RZkx.js","assets/PrismAskController-D6_7Epdb.js","assets/sourceHost-BV3t2XDb.js","assets/citation-BcvmjKS8.js","assets/verbatim-CBMzUDlf.js","assets/search-Be63DJkp.js","assets/PrismAskController-DBoxQSJR.css","assets/PrismBriefingPlayer-Dq5_KRU3.js","assets/CrossExamPanel-Cn7b5y7B.js","assets/CrossExamPanel-CZ0ShGma.css","assets/ForecastPanel-lTnux0EB.js","assets/ForecastPanel-Da2ZBUrE.css","assets/LeverPanel-CvYnTLjh.js","assets/dag-C3Xx8pOD.js","assets/LeverPanel-DhpJY76O.css","assets/WhyMachineOverlay-BRNibJSf.js","assets/useSpatialCanvas-C5TNlpeK.js","assets/WhyMachineOverlay-BZk3PVTl.css","assets/run-BYP2YlZT.js","assets/extractNumbers-CuhagRkd.js","assets/streamParse-DRgMHWye.js","assets/run-DSVvshaB.js","assets/run-Dc2ZJz6n.js","assets/model-BE0UHu1w.js","assets/explode-WBykfhqW.js","assets/json-B0N3XRZU.js","assets/cache-BumECILO.js","assets/speed-DwPw9KSv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./cachedImport-DW0gP14h.js";import{I as r,J as i,L as a,ht as o,k as s,mt as c,q as l}from"./index-Dbr1j8Fe.js";import{t as u}from"./useFocusTrap-DbfG6zbM.js";import{t as d}from"./toast-BBNs2h3L.js";import{r as f}from"./sourceHost-BV3t2XDb.js";import{t as p}from"./penStrokes-DlHnO9xE.js";import{S as m,b as h,d as g,h as _,m as v,o as y,s as b,t as x,v as S,x as C,y as w}from"./providers-wzm7E8Pa.js";import{n as T}from"./streamParse-DRgMHWye.js";import{t as E}from"./search-Be63DJkp.js";import{a as D,i as O,t as k}from"./verbatim-CBMzUDlf.js";import{t as A}from"./officeDoc-B6nEhNp4.js";import{t as j}from"./citation-BcvmjKS8.js";var M=e(),ee=o();function N(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 te(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 P(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 F(e,t){let n=[];for(let r of e){let e=k(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=D(r.quote,t[e-1]);if(i){n.push({...r,quote:i,page:e});break}}}return n}var I=null,ne=0,L=new Map;function re(){if(typeof Worker>`u`)return null;if(I)return I;try{return I=new Worker(new URL(`/assets/prismGround.worker-CIvKqxm2.js`,``+import.meta.url),{type:`module`}),I.onmessage=e=>{let t=e.data,n=L.get(t.id);n&&(L.delete(t.id),t.ok?n.resolve(t.claims??[]):n.reject(Error(t.error??`Grounding failed`)))},I.onerror=()=>{let e=Error(`Grounding worker failed`);for(let t of L.values())t.reject(e);L.clear(),I?.terminate(),I=null},I}catch{return I=null,null}}async function ie(e,t){let n=[];for(let r=0;r<e.length;r+=16)n.push(...F(e.slice(r,r+16),t)),r+16<e.length&&await new Promise(e=>setTimeout(e,0));return n}async function ae(e,t){let n=re();if(!n)return ie(e,t);let r=ne+=1;try{return await new Promise((i,a)=>{L.set(r,{resolve:i,reject:a}),n.postMessage({id:r,candidates:e,pages:t})})}catch{return ie(e,t)}}i();var R=n(()=>l(()=>import(`./pdf-RyoPCIGN.js`).then(e=>{let t=e.default??e;return t?.GlobalWorkerOptions&&(t.GlobalWorkerOptions.workerSrc=new URL(`/assets/pdf.worker.min-yatZIOMy.mjs`,``+import.meta.url).href),t}),__vite__mapDeps([0,1,2,3,4,5,6,7])));function oe(){return R().catch(()=>null)}function z(e){if(typeof e?.str!=`string`||e.str.trim()===``)return null;let t=e.transform??[1,0,0,1,0,0],n=Math.hypot(t[2],t[3])||(typeof e.height==`number`?e.height:0)||10;return{it:e,left:t[4],y:t[5],w:typeof e.width==`number`?e.width:0,h:n}}function B(e){e.sort((e,t)=>t.y-e.y||e.left-t.left);let t=[],n=[],r=0,i=0;for(let a of e)n.length>0&&Math.abs(a.y-r)>Math.max(i,a.h)*.5&&(t.push(n),n=[]),n.length===0&&(r=a.y,i=a.h),n.push(a);n.length>0&&t.push(n);let a=[];for(let e of t){e.sort((e,t)=>e.left-t.left);for(let t of e)a.push(t.it)}return a}function V(e){let t=e.map(z).filter(e=>e!==null);if(t.length<2)return t.map(e=>e.it);let n=Math.min(...t.map(e=>e.left)),r=Math.max(...t.map(e=>e.left+e.w)),i=Math.max(...t.map(e=>e.y)),a=Math.min(...t.map(e=>e.y)),o=r-n||1,s=i-a||1,c=null,l=t.filter(e=>e.y<i-.1*s&&e.y>a+.04*s);if(l.length>6)for(let e of[.5,.48,.52,.46,.54]){let r=n+e*o,i=l.filter(e=>e.left<r-2&&e.left+e.w>r+2).length,a=t.filter(e=>e.left+e.w/2<r).length,s=t.length-a;if(i<=Math.max(2,l.length*.02)&&a>t.length*.2&&s>t.length*.2){c=r;break}}if(c===null)return B(t);let u=c;return[...B(t.filter(e=>e.left+e.w/2<u)),...B(t.filter(e=>e.left+e.w/2>=u))]}async function H(e){let t=await oe();if(!t?.getDocument)return null;try{let n=await y(e),r=await t.getDocument({data:n.slice()}).promise,i=[];for(let e=1;e<=r.numPages;e+=1){let t=await r.getPage(e),n=V((await t.getTextContent()).items).map(e=>typeof e.str==`string`?e.str:``).join(` `);i.push(n),t.cleanup?.()}return await r.destroy?.(),i}catch{return null}}function se(){return Math.min(2,Math.max(1,typeof window<`u`&&window.devicePixelRatio||1))}function U(e){return Math.max(600,Math.min(1900,Math.round((Number.isFinite(e)&&e>0?e:1200)*1.15)))}var ce=e=>e.file??e.bytes??e.data,le=null,W=null,G=null,K=0;async function ue(e,t){let n=ce(e);for(;G&&G.key!==n;)await G.promise.catch(()=>{});if(le===n&&W)return W;if(G&&G.key===n)return G.promise;let r=K,i=(async()=>{if(W)try{await W.destroy?.()}catch{}let i=b(e)??await y(e),a=await t.getDocument({data:i.slice()}).promise;if(r!==K){try{await a.destroy?.()}catch{}throw Error(`render doc superseded`)}return W=a,le=n,a})(),a={key:n,promise:i};G=a;try{return await i}finally{G===a&&(G=null)}}async function q(){K+=1,G=null;let e=W;W=null,le=null;try{await e?.destroy?.()}catch{}}function de(e){return Array.from(e.normalize(`NFKC`)).map(e=>e===``?``:`‘’‛`.includes(e)?`'`:`“”`.includes(e)?`"`:/[‐-―]/.test(e)?`-`:/\s/.test(e)?` `:e.toLowerCase())}async function fe(e,t,n,r=720,i=!1,a=[]){let o=await oe();if(!o?.getDocument)return null;let s=null;try{let c=await ue(e,o);if(t<1||t>c.numPages)return null;s=await c.getPage(t);let l=s.getViewport({scale:1}),u=se(),d=r/l.width*u,f=s.getViewport({scale:d}),p=document.createElement(`canvas`);p.width=Math.ceil(f.width),p.height=Math.ceil(f.height);let m=p.getContext(`2d`);if(!m)return null;await s.render({canvasContext:m,viewport:f}).promise;let h=await s.getTextContent(),g=pe(h,n,f,o),_=a.map(e=>pe(h,e,f,o)),v=null;if(i||ge(n))try{v=be(await s.getOperatorList(),h,g,f,o)}catch{v=null}return{canvas:p,rects:g,figure:v,alsoRects:_}}catch{return null}finally{s?.cleanup?.()}}function pe(e,t,n,r){let i=O(t);if(!i)return[];let a=[];for(let t of V(e.items)){if(typeof t.str!=`string`)continue;let e=me(t,n,r);if(!e)continue;let i=de(t.str),o=i.filter(e=>e.length>0).length||1,s=e.w/o,c=0;for(let t of i)t!==``&&(a.push({ch:t,rect:{x:e.x+s*c,y:e.y,w:s,h:e.h}}),c+=1);a.push({ch:` `,rect:{x:e.x+e.w,y:e.y,w:0,h:e.h}})}let o=[];for(let e=0;e<a.length;e+=1){let t=a[e];if(t.ch===`-`){let t=e+1;for(;t<a.length&&a[t].ch===` `;)t+=1;if(t>e+1){e=t-1;continue}}if(t.ch===` `){let t=o[o.length-1];if(t&&`$€£¥`.includes(t.ch)){let t=e+1;for(;t<a.length&&a[t].ch===` `;)t+=1;if(t<a.length&&/[\d(]/.test(a[t].ch))continue}if(t&&t.ch===` `)continue}o.push(t)}let s=o.map(e=>e.ch).join(``).indexOf(i);return s<0?[]:he(o.slice(s,s+i.length).filter(e=>e.rect.w>0).map(e=>e.rect))}function me(e,t,n){try{let r=n.Util.transform(t.transform,e.transform),i=r[4],a=r[5],o=(e.width||0)*t.scale,s=Math.hypot(r[2],r[3])||10,c=s*1.15;return o<=0?null:{x:i,y:a-s,w:o,h:c}}catch{return null}}function he(e){if(e.length===0)return e;let t=[...e].sort((e,t)=>e.y-t.y||e.x-t.x),n=[];for(let e of t){let t=n[n.length-1];if(t&&Math.abs(t.y-e.y)<t.h*.6&&e.x<=t.x+t.w+t.h){let n=Math.max(t.x+t.w,e.x+e.w);t.x=Math.min(t.x,e.x),t.w=n-t.x,t.y=Math.min(t.y,e.y),t.h=Math.max(t.h,e.h)}else n.push({...e})}return n}function ge(e){return/\b(fig(?:ure|\.)?|table|chart|diagram|graph|plot|schematic|illustration)\b/i.test(e)}function _e(e,t,n){let r=n.OPS??{},i=e.fnArray??[],a=e.argsArray??[],o=t.transform,s=[],c=[];for(let e=0;e<i.length;e+=1){let l=i[e];if(l===r.save)s.push(o);else if(l===r.restore)o=s.pop()??t.transform;else if(l===r.transform)o=n.Util.transform(o,a[e]);else if(l===r.paintImageXObject||l===r.paintInlineImage||l===r.paintImageMaskXObject||l===r.paintJpegXObject){let e=o,t=[e[4],e[0]+e[4],e[2]+e[4],e[0]+e[2]+e[4]],n=[e[5],e[1]+e[5],e[3]+e[5],e[1]+e[3]+e[5]],r=Math.min(...t),i=Math.min(...n),a=Math.max(...t)-r,s=Math.max(...n)-i;a>8&&s>8&&c.push({x:r,y:i,w:a,h:s})}}return c}function ve(e,t,n){let r=[];for(let i of e.items){if(typeof i.str!=`string`||i.str.trim()===``)continue;let e=me(i,t,n);e&&r.push(e)}return he(r)}function ye(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function be(e,t,n,r,i){let a=_e(e,r,i);if(a.length===0||n.length===0)return null;let o=xe(n),s=o.x+o.w/2,c=null,l=1/0;for(let e of a){let t=e.x+e.w/2,n=Math.abs(t-s);if(n>Math.max(e.w,o.w))continue;let r=Se(e,o)+n*.5;r<l&&(l=r,c=e)}if(!c)return null;let u=ve(t,r,i).filter(e=>!ye(e,o)),d=Ce(c,u,o);return!d||d.w<10||d.h<10?null:d}function xe(e){let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.w)),i=Math.max(...e.map(e=>e.y+e.h));return{x:t,y:n,w:r-t,h:i-n}}function Se(e,t){return e.y+e.h<t.y?t.y-(e.y+e.h):t.y+t.h<e.y?e.y-(t.y+t.h):0}function Ce(e,t,n){let r=e.y,i=e.y+e.h,a=n.y+n.h/2;for(let n of t){let t=n.y+n.h/2;Math.min(e.x+e.w,n.x+n.w)-Math.max(e.x,n.x)<e.w*.3||(t<a&&n.y+n.h>e.y&&t<e.y+e.h/2&&(r=Math.max(r,n.y+n.h)),t>a&&n.y<i&&(i=Math.min(i,n.y)))}return i-r<10?null:{x:e.x,y:r,w:e.w,h:i-r}}var we=/\.(csv|tsv|tab)$/i,Te=/\.(md|markdown)$/i,Ee=/\.(json|jsonl|ndjson)$/i,De=/\.(ya?ml|toml|xml|js|ts|jsx|tsx|py|rb|go|rs|java|c|h|cpp|cs|sh|sql|css|html?)$/i,Oe=40,ke=1600;function Ae(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+=Oe)i.push([n,...r.slice(e,e+Oe)].join(`
|
|
8
|
+
`));return i}function je(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:Me(e)}function Me(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>ke?(r.push(i),i=e):i=i?`${i}\n\n${e}`:e;return i&&r.push(i),r}function Ne(e){let t=e.replace(/\r\n?/g,`
|
|
14
|
+
`).trim();if(!t)return[];if(t.length<=ke*1.5)return[t];let n=t.split(`
|
|
15
|
+
`),r=[],i=``;for(let e of n)i&&i.length+e.length>ke?(r.push(i),i=e):i=i?`${i}\n${e}`:e;return i&&r.push(i),r}function Pe(e,t,n){if(!n.trim())return null;let r;return r=we.test(e)||t===`text/csv`?Ae(n):Te.test(e)?je(n):Ee.test(e)||t===`application/json`||De.test(e)?Ne(n):Me(n),r.length>0?r:null}function Fe(e,t,n){return Pe(e,t,new TextDecoder(`utf-8`).decode(n))}var Ie=null,Le=0,Re=new Map;function ze(){if(typeof Worker>`u`)return null;if(Ie)return Ie;try{return Ie=new Worker(new URL(`/assets/prismExtract.worker-Cws9K1NG.js`,``+import.meta.url),{type:`module`}),Ie.onmessage=e=>{let t=e.data,n=Re.get(t.id);n&&(Re.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`)))},Ie.onerror=()=>{let e=Error(`Document extraction worker failed`);for(let t of Re.values())t.reject(e);Re.clear(),Ie?.terminate(),Ie=null},Ie}catch{return Ie=null,null}}function Be(e,t){let n=ze();if(!n)return null;let r=Le+=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)=>{Re.set(r,{attachment:t,resolve:e,reject:s});try{n.postMessage(a,o)}catch(e){Re.delete(r),i&&i.byteLength>0&&(t.bytes=i),s(e instanceof Error?e:Error(`Could not start document extraction`))}})}function Ve(){return new Promise(e=>setTimeout(e,0))}async function He(e,t){await Ve();let n=await y(t);return await Ve(),e===`office`?A(t.name,n):Fe(t.name,t.mime,n)}async function Ue(e){let t=Be(`office`,e);try{return t?await t:await He(`office`,e)}catch{return await He(`office`,e)}}async function We(e){let t=Be(`text`,e);try{return t?await t:await He(`text`,e)}catch{return await He(`text`,e)}}var Ge=[`forecast`,`stat`,`finding`,`risk`,`definition`,`method`,`diagram`];function Ke(e){let t=String(e??``).toLowerCase();return Ge.includes(t)?t:`finding`}var qe=[`load-bearing`,`supporting`,`context`];function Je(e){let t=String(e??``).toLowerCase().trim();return qe.includes(t)?t:`supporting`}var Ye=30,Xe=40,Ze=2e3,Qe=220,$e=700,et=`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 ${Xe} pages, in reading order.`;async function tt(e,t,n){try{return te((await x(t.provider).generate({system:`You pick the most important pages of a document and return strict JSON only.`,history:[],user:`${et}\n\n${N(e,Qe)}`,attachments:[],maxTokens:$e,temperature:0,format:null,...n?{signal:n}:{}},t)).raw,e.length,Xe)}catch{return te(`{}`,e.length,Xe)}}var nt=`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.`,rt=`${nt}
|
|
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 it(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 at(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 ot(e){return typeof e==`string`?e:``}function st(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 ct(e){let t=at(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=ot(t.quote),r=Number(t.page);!n||!Number.isInteger(r)||i.push({quote:n,page:r,kind:ot(t.kind)||void 0,title:ot(t.title)||void 0,ask:ot(t.ask)||void 0,role:ot(t.role)||void 0,region:ot(t.region)||void 0,...Number.isInteger(Number(t.contradictsPage))?{contradictsPage:Number(t.contradictsPage)}:{},...st(t.box)?{box:st(t.box)}:{}})}return i}function J(e){let t=e.replace(/\.pdf$/i,``).trim();return t.length>28?t.slice(0,27).trimEnd()+`…`:t||`Document`}function lt(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 ut(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 Y(e){let t=String(e);return t===`agrees`?`agrees`:t===`in-tension`?`in-tension`:`contradicts`}function X(e,t){return[e,t].sort().join(`|`)}async function dt(e,t,n,r,i){let a=S(e),o=!a&&!w(e)&&C(e),s,c,l,u,d;if(i)s=i;else if(a){let t=await Ue(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,Ye),u=l.map((t,n)=>({name:`${e.name} — slide ${n+1}`,mime:t.mime,data:t.data,size:0})))}else s=o?await We(e):await H(e)??null;let f=!s&&!!u,p=s?s.reduce((e,t)=>e+t.length,0):0,m=w(e)&&!!s&&p>Math.max(400,s.length*60),h=a||o||m,_=x(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(w(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>Xe?await tt(s,t,r):null;if(r?.aborted)return{fileName:e.name,pages:s??[],claims:[],proposed:0,...d?{pageLabels:d}:{}};let y=f?u?.length??1:Math.min(s?.length??1,Xe),b=Math.min(8192,Math.max(4096,3e3+y*240)),T=f?u:h?[]:[e],E=await Promise.all(T.map(g)),D=await _.generate({system:`You extract grounded, verbatim-quoted claims from a document and return strict JSON only.`,history:[],user:f?rt:v?`${nt}\n\n${P(s,v,Ze,d)}`:`${nt}\n\n${it(s,d)}`,attachments:E,maxTokens:b,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(!D.ok)return{fileName:e.name,pages:s??[],claims:[],proposed:0,error:D.error,...d?{pageLabels:d}:{}};let O=ct(D.raw),k=f?ft(O,u.length):s,A=await ae(O,k);if(typeof process<`u`&&{}.SNAP_DEBUG)for(let e of O)A.some(t=>t.title===e.title&&t.kind===e.kind)||console.log(` DROPPED p${e.page}: ${JSON.stringify((e.quote??``).slice(0,130))}`);let j=A.map((e,t)=>({id:`d${n}c${t}`,quote:e.quote,page:e.page,kind:Ke(e.kind),title:e.title?.trim()||e.quote.slice(0,40),ask:e.ask?.trim()||`What does this mean?`,role:Je(e.role),region:e.region?.trim()||`Document`,source:n,...e.contradictsPage?{contradictsPage:e.contradictsPage}:{},...f&&e.box?{box:e.box}:{}}));return{fileName:e.name,pages:k,claims:j,proposed:O.length,...l?{slideImages:l}:{},...d?{pageLabels:d}:{}}}function ft(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 pt(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)=>dt(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=ut(c),d=i.length>1;if(!d){let e=await ht(c,t,u,n);u.push(...e)}if(d&&o.filter(e=>e.claims.length>0).length>1){let e=await gt(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=`${J(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:lt(p),threads:u},proposed:l,corpus:o.map(e=>e.pages)}}function mt(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 Z(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 ht(e,t,n,r){if(e.length<2)return[];let i=new Map(e.map(e=>[e.id,e])),a;try{a=(await x(t.provider).generate({system:`You compare grounded claims within documents and return strict JSON only.`,history:[],user:Z(e),maxTokens:1024,temperature:0,format:null,...r?{signal:r}:{}},t)).raw}catch{return[]}let o=at(a),s=o&&typeof o==`object`&&Array.isArray(o.pairs)?o.pairs:[],c=[],l=new Set(n.map(e=>X(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=X(n.id,r.id);l.has(a)||(l.add(a),c.push({a:n.id,b:r.id,relation:Y(t.relation)}))}return c}async function gt(e,t,n){let r=new Map(e.map(e=>[e.id,e])),i;try{i=(await x(t.provider).generate({system:`You compare claims across documents and return strict JSON only.`,history:[],user:mt(e),maxTokens:1024,temperature:0,format:null,...n?{signal:n}:{}},t)).raw}catch{return[]}let a=at(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=Y(String(t.relation)),o=X(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 _t=900;function vt(e){let t=(0,ee.c)(13),[n,r]=(0,M.useState)(`idle`),[i,a]=(0,M.useState)(null),[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(0),[u,d]=(0,M.useState)(null),f=(0,M.useRef)(null),p=(0,M.useRef)(null),m=(0,M.useRef)(0),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{f.current?.abort(),f.current=null,p.current!==null&&(clearTimeout(p.current),p.current=null)},t[0]=h):h=t[0];let g=h,_,v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>g,v=[g],t[1]=_,t[2]=v):(_=t[1],v=t[2]),(0,M.useEffect)(_,v);let y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{g(),m.current+=1,r(`idle`),a(null),s(null),l(0),d(null)},t[3]=y):y=t[3];let b=y,x;t[4]===e?x=t[5]:(x=t=>{if(!e){d(`Connect a model that reads documents (Anthropic or Gemini) to explode one.`),r(`error`);return}g();let n=m.current+=1,i=new AbortController;f.current=i,a(null),s(null),l(0),d(null),r(`igniting`),p.current=setTimeout(()=>{m.current===n&&r(yt)},_t),pt(t,e,i.signal).then(e=>{m.current===n&&(l(e.proposed),e.spec?(a(e.spec),s(e.corpus??null),r(`settled`)):(d(e.error??`This document could not be mapped.`),r(`error`)))}).catch(e=>{m.current===n&&(i.signal.aborted||(d(e instanceof Error?e.message:`Mapping failed.`),r(`error`)))})},t[4]=e,t[5]=x);let S=x,C;return t[6]!==o||t[7]!==u||t[8]!==S||t[9]!==n||t[10]!==c||t[11]!==i?(C={phase:n,spec:i,corpus:o,proposed:c,error:u,explode:S,reset:b},t[6]=o,t[7]=u,t[8]=S,t[9]=n,t[10]=c,t[11]=i,t[12]=C):C=t[12],C}function yt(e){return e===`igniting`?`blooming`:e}var bt=.15,xt=4;function St(e,t,n,r){let i=(0,ee.c)(29),a;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={x:0,y:0,scale:1},i[0]=a):a=i[0];let[o,s]=(0,M.useState)(a),[c,l]=(0,M.useState)(!1),u=(0,M.useRef)(null),d=(0,M.useRef)(!1),f=(0,M.useRef)(`auto`),p=(0,M.useRef)(null),m;i[1]!==r||i[2]!==e||i[3]!==n||i[4]!==t?(m=()=>{let i=e.current;if(!i)return;f.current=`auto`;let a=r&&r.w>0&&r.h>0?r:{x:0,y:0,w:t,h:n},o=i.clientWidth-64,c=i.clientHeight-64;if(o<=0||c<=0)return;let l=Math.max(bt,Math.min(xt,1.35,Math.min(o/a.w,c/a.h))),u=a.x+a.w/2,d=a.y+a.h/2;s({x:i.clientWidth/2-u*l,y:i.clientHeight/2-d*l,scale:l})},i[1]=r,i[2]=e,i[3]=n,i[4]=t,i[5]=m):m=i[5];let h=m,g;i[6]===e?g=i[7]:(g=(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;f.current=`framed`,p.current={bbox:t,opts:n};let o=n?.maxScale??1.4,c=Math.max(bt,Math.min(xt,o,Math.min(i/t.w,a/t.h))),l=t.x+t.w/2,u=t.y+t.h/2;s({x:r.clientWidth/2-l*c,y:r.clientHeight/2-u*c,scale:c})},i[6]=e,i[7]=g);let _=g,v,y;i[8]!==h||i[9]!==_||i[10]!==e?(v=()=>{let t=e.current;if(!t||(h(),typeof ResizeObserver>`u`))return;let n=new ResizeObserver(()=>{f.current===`auto`?h():f.current===`framed`&&p.current&&_(p.current.bbox,p.current.opts)});return n.observe(t),()=>n.disconnect()},y=[e,h,_],i[8]=h,i[9]=_,i[10]=e,i[11]=v,i[12]=y):(v=i[11],y=i[12]),(0,M.useEffect)(v,y);let b;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(e,t,n)=>{f.current=`user`,s(r=>{let i=Math.max(bt,Math.min(xt,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}})},i[13]=b):b=i[13];let x=b,S;i[14]===e?S=i[15]:(S=t=>{let n=e.current;x(t,n?n.clientWidth/2:0,n?n.clientHeight/2:0)},i[14]=e,i[15]=S);let C=S,w;i[16]===e?w=i[17]:(w=t=>{let n=e.current;if(!n)return;t.preventDefault();let r=n.getBoundingClientRect();x(t.deltaY<0?1.12:.8928571428571428,t.clientX-r.left,t.clientY-r.top)},i[16]=e,i[17]=w);let T=w,E;i[18]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e.button===0&&(u.current={id:e.pointerId,x:e.clientX,y:e.clientY,moved:!1},d.current=!1)},i[18]=E):E=i[18];let D=E,O;i[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{let t=u.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,l(!0);try{e.currentTarget.setPointerCapture(t.id)}catch{}}t.x=e.clientX,t.y=e.clientY,d.current=!0,f.current=`user`,s(e=>({...e,x:e.x+n,y:e.y+r}))}},i[19]=O):O=i[19];let k=O,A;i[20]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{let t=u.current;if(!t||e.pointerId!==t.id)return;let n=t.moved;if(n)try{e.currentTarget.releasePointerCapture(t.id)}catch{}u.current=null,l(!1),n&&requestAnimationFrame(()=>d.current=!1)},i[20]=A):A=i[20];let j=A,N=`translate(${o.x}px, ${o.y}px) scale(${o.scale})`,te;return i[21]!==o||i[22]!==h||i[23]!==_||i[24]!==T||i[25]!==c||i[26]!==N||i[27]!==C?(te={camera:o,transform:N,panning:c,fit:h,frame:_,zoomBy:C,onWheel:T,onPointerDown:D,onPointerMove:k,onPointerUp:j,movedRef:d},i[21]=o,i[22]=h,i[23]=_,i[24]=T,i[25]=c,i[26]=N,i[27]=C,i[28]=te):te=i[28],te}var Ct=1360,wt=2.39996322;function Tt(e){let t=Ct/820,n=e*240*136,r=Math.max(Ct*820,n/.22),i=Math.sqrt(r/t);return{w:Math.round(i*t),h:Math.round(i)}}function Et(e,t,n){let{w:r,h:i}=n?{w:n.width,h:n.height}:Tt(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*wt;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=200/2+r+14-Math.abs(s),u=96/2+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)<200/2+r+14&&Math.abs(t-n.cy)<96/2+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*wt,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 Dt(e,t,n){let r=Et({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)))+200*.7;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:Ot(r,o,l,s)}}function Ot(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,200/2,96/2);for(let e of[...t,...n])o(e.x,e.y,200/2,96/2);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 kt=null,At=0,jt=new Map;function Mt(){if(typeof Worker>`u`)return null;if(kt)return kt;try{return kt=new Worker(new URL(`/assets/prismLayout.worker-CZO2CY7B.js`,``+import.meta.url),{type:`module`}),kt.onmessage=e=>{let t=e.data,n=jt.get(t.id);n&&(jt.delete(t.id),t.ok&&t.result?n.resolve(t.result):n.reject(Error(t.error??`Layout failed`)))},kt.onerror=()=>{let e=Error(`Layout worker failed`);for(let t of jt.values())t.reject(e);jt.clear(),kt?.terminate(),kt=null},kt}catch{return kt=null,null}}function Nt(e){let t=Mt();if(!t)return null;let n=At+=1;return new Promise((r,i)=>{jt.set(n,{resolve:r,reject:i}),t.postMessage({...e,id:n,palette:[...e.palette]})})}async function Pt(e,t){try{return await(Nt({kind:`prism`,spec:e,palette:t})??new Promise(n=>setTimeout(()=>n(Et(e,t)),0)))}catch{return new Promise(n=>setTimeout(()=>n(Et(e,t)),0))}}async function Ft(e,t){try{return await(Nt({kind:`corpus`,spec:e,palette:t})??new Promise(n=>setTimeout(()=>n(Dt(e,t)),0)))}catch{return new Promise(n=>setTimeout(()=>n(Dt(e,t)),0))}}var Q=t();function It(e){let t=(0,ee.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 Lt=4;function Rt(e,t){let n=(0,ee.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)<Lt)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,M.useEffect)(r,i)}function $({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 Rt(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)(It,{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 zt(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 Bt({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:m}=e,h=o===!0&&r.trim().length>0&&u.w>0,g=(0,M.useMemo)(()=>{if(!h)return[];let e=p(d,m??void 0,a??!1,u.w,u.h,l,c),t=f.flatMap((e,t)=>e.length?p(e,void 0,!1,u.w,u.h,`${l}:also${t}`):[]);return[...e,...t]},[h,d,f,m,a,u.w,u.h,l,c]);return(0,Q.jsxs)(Q.Fragment,{children:[(d.length>0||m)&&(0,Q.jsxs)(`div`,{className:`prism-page-marks`,style:{transform:`scale(${t})`,transformOrigin:`0 0`},"aria-hidden":`true`,children:[m&&(0,Q.jsx)(`span`,{className:`prism-page-figure`,style:{left:m.x,top:m.y,width:m.w,height:m.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 Vt({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 Ht(e,t,n){let r=(0,M.useRef)(n);r.current=n;let[i,a]=(0,M.useState)({w:0,h:0}),o=(0,M.useRef)(i),[s,c]=(0,M.useState)(1),l=(0,M.useRef)(`width`),u=(0,M.useRef)(!1),d=(0,M.useRef)(!1),f=(0,M.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,M.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,M.useCallback)(()=>{l.current=`manual`,c(e=>Math.min(4,e*1.25))},[]),h=(0,M.useCallback)(()=>{l.current=`manual`,c(e=>Math.max(.2,e/1.25))},[]),g=(0,M.useCallback)((e=!1)=>{l.current=`width`,u.current=!0,d.current=e,c(1)},[]),_=(0,M.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,M.useRef)(null);return(0,M.useLayoutEffect)(()=>{let n=e.current;if(!n||!t||typeof ResizeObserver>`u`)return;let a=i.w/se(),o=new ResizeObserver(()=>{l.current===`width`?f():l.current===`screen`&&p();let e=r.current?.onSettledGrow;if(!e)return;let t=U(n.clientWidth)*se(),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 Ut({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,M.useRef)(null),x=!!o?.trim()||(a??[]).some(e=>!!e.note?.trim()),S=(0,M.useRef)(null),C=(0,M.useRef)(null),[w,T]=(0,M.useState)(`loading`),[E,D]=(0,M.useState)([]),[O,k]=(0,M.useState)([]),[A,j]=(0,M.useState)(null),[ee,N]=(0,M.useState)(0),te=Ht(S,w===`ready`,{gutterReserve:x?218:0,onSettledGrow:(0,M.useCallback)(()=>N(e=>e+1),[])}),{zoom:P,dims:F,setDims:I,resetForNewContent:ne}=te,L=(a??[]).map(e=>e.quote).join(`\0`),re=(0,M.useRef)(null);(0,M.useEffect)(()=>{let t=!1,i=re.current,a=!i||i.pdf!==e||i.page!==n||i.quote!==r||i.isFigure!==p||i.alsoKey!==L;re.current={pdf:e,page:n,quote:r,isFigure:p,alsoKey:L};let o=S.current?.clientWidth??0,s=U(o);a&&(T(`loading`),D([]),k([]),j(null),ne(o===0));let c=L?L.split(`\0`):[];return(async()=>{let i=await fe(e,n,r,s,p,c);return i||t?i:(await new Promise(e=>window.setTimeout(e,120)),t?null:fe(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),I({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,L,ee,ne,I]);let ie=F.w*P,ae=F.h*P,R=`${t}:${n}:${r}`,oe=(0,M.useMemo)(()=>F.w===0?[]:zt(E,O,i,o,a,P),[F.w,E,O,o,a,i,P]);(0,M.useEffect)(()=>{if(!s||w!==`ready`||!r.trim()||!u)return;let e=C.current,t=``;try{e&&(t=e.toDataURL(`image/jpeg`,.72))}catch{}u({pageImage:t,imgW:F.w,imgH:F.h,rects:E.map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),figure:A?{x:A.x,y:A.y,w:A.w,h:A.h}:void 0,isFigure:p??!1,seed:R})},[s,w,r,u,F,E,A,p,R]);let z={dims:F,rects:E,alsoRects:O,figure:A};return(0,Q.jsxs)($,{ariaLabel:`Source page ${n}`,kindLabel:d,color:i,page:n,title:f,docName:m?.replace(/\.pdf$/i,``),pageCount:v,onPageChange:y,zoom:w===`ready`?te: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:ie?ie+(oe.length>0?218:0):void 0,display:w===`ready`?void 0:`none`},children:[(0,Q.jsxs)(`div`,{className:`prism-page-frame`,style:{width:ie||void 0,height:ae||void 0},children:[(0,Q.jsx)(`div`,{className:`prism-page-holder`,ref:b}),w===`ready`&&(0,Q.jsx)(Bt,{geometry:z,zoom:P,color:i,quote:r,also:a,isFigure:p,penOn:s,penColor:c,penAccent:l,seed:R})]}),w===`ready`&&(0,Q.jsx)(Vt,{entries:oe,dims:F,zoom:P,seed:R})]})]})}function Wt(e){let t=(0,ee.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,M.useRef)(null),h=(0,M.useRef)(null),[g,_]=(0,M.useState)(`loading`),v=Ht(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,M.useEffect)(E,D);let O=b.w*y,k=b.h*y,A=`Source slide ${r}`,j=`SLIDE ${r}`,N;t[9]===c?N=t[10]:(N=c?.replace(/\.(pptx|docx|xlsx)$/i,``),t[9]=c,t[10]=N);let te=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]!==N||t[31]!==te||t[32]!==P||t[33]!==F||t[34]!==s?(I=(0,Q.jsx)($,{ariaLabel:A,kindLabel:o,color:a,page:r,pageLabel:j,title:s,docName:N,pageCount:f,onPageChange:p,zoom:te,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]=N,t[31]=te,t[32]=P,t[33]=F,t[34]=s,t[35]=I):I=t[35],I}function Gt(e){let t=[],n=``;for(let r=0;r<e.length;r+=1){let i=O(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 Kt(e,t,n){let r=O(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 qt(e,t,n){if(!e)return[];let{norm:r,map:i}=Gt(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=Kt(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 Jt={dims:{w:0,h:0},rects:[],alsoRects:[]};function Yt(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 Xt(e,t,n){let[r,i]=(0,M.useState)(Jt);return(0,M.useEffect)(()=>{let n=e.current;if(!n){i(Jt);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=>Yt(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(Yt(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 Zt=680,Qt=14;function $t(e,t,n){if(e===`primary`)return t;let r=Number(e.slice(5));return n?.[r]?.color??t}function en(e){let t=(0,ee.c)(84),{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,C]=(0,M.useState)(null),[w,T]=(0,M.useState)(`loading`),E,D;t[0]===n?(E=t[1],D=t[2]):(E=()=>{let e=!1;return T(`loading`),(S(n)?Ue(n).then(rn):We(n)).then(t=>{if(!e){if(!t||t.length===0){T(`failed`);return}C(t),T(`ready`)}}),()=>{e=!0}},D=[n],t[0]=n,t[1]=E,t[2]=D),(0,M.useEffect)(E,D);let O=x?.[i-1]??``,k;t[3]!==s||t[4]!==O||t[5]!==a?(k=qt(O,a,s),t[3]=s,t[4]=O,t[5]=a,t[6]=k):k=t[6];let A=k,j=A.some(nn),N=(0,M.useRef)(null),te=(0,M.useRef)(null),P=!!c?.trim()||(s??[]).some(tn),F=P?218:0,I;t[7]===F?I=t[8]:(I={gutterReserve:F},t[7]=F,t[8]=I);let ne=Ht(N,w===`ready`,I),{zoom:L,resetForNewContent:re}=ne,ie=(0,M.useRef)(null),ae,R;t[9]!==n||t[10]!==i||t[11]!==re?(ae=()=>{let e=ie.current;ie.current={doc:n,page:i},(!e||e.doc!==n||e.page!==i)&&re()},R=[n,i,re],t[9]=n,t[10]=i,t[11]=re,t[12]=ae,t[13]=R):(ae=t[12],R=t[13]),(0,M.useEffect)(ae,R);let oe;t[14]===A?oe=t[15]:(oe=[A],t[14]=A,t[15]=oe);let z=Xt(te,L,oe),B;t[16]!==z.alsoRects||t[17]!==z.dims||t[18]!==z.rects?(B={dims:z.dims,rects:z.rects,alsoRects:z.alsoRects},t[16]=z.alsoRects,t[17]=z.dims,t[18]=z.rects,t[19]=B):B=t[19];let V=B,H;t[20]!==s||t[21]!==o||t[22]!==z.alsoRects||t[23]!==z.dims.w||t[24]!==z.rects||t[25]!==c||t[26]!==L?(H=z.dims.w===0?[]:zt(z.rects,z.alsoRects,o,c,s,L),t[20]=s,t[21]=o,t[22]=z.alsoRects,t[23]=z.dims.w,t[24]=z.rects,t[25]=c,t[26]=L,t[27]=H):H=t[27];let se=H,U=`${r}:${i}:${a}`,ce;t[28]!==z.dims.h||t[29]!==z.dims.w||t[30]!==z.rects||t[31]!==f||t[32]!==l||t[33]!==a||t[34]!==U||t[35]!==w?(ce=()=>{!l||w!==`ready`||!a.trim()||!f||z.dims.w===0||f({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:U})},t[28]=z.dims.h,t[29]=z.dims.w,t[30]=z.rects,t[31]=f,t[32]=l,t[33]=a,t[34]=U,t[35]=w,t[36]=ce):ce=t[36];let le;t[37]!==z||t[38]!==f||t[39]!==l||t[40]!==a||t[41]!==U||t[42]!==w?(le=[l,w,a,f,z,U],t[37]=z,t[38]=f,t[39]=l,t[40]=a,t[41]=U,t[42]=w,t[43]=le):le=t[43],(0,M.useEffect)(ce,le);let W=P?218:0,G=`Source page ${i}`,K;t[44]===h?K=t[45]:(K=h?.replace(/\.docx$/i,``),t[44]=h,t[45]=K);let ue=w===`ready`?ne:void 0,q=a.trim()?w===`ready`&&j?`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.`,de;t[46]!==i||t[47]!==w?(de=w===`loading`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading page `,i,`…`]}),t[46]=i,t[47]=w,t[48]=de):de=t[48];let fe;t[49]!==i||t[50]!==w?(fe=w===`failed`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t read this page. The quote is still grounded on page `,i,`.`]}),t[49]=i,t[50]=w,t[51]=fe):fe=t[51];let pe;t[52]!==s||t[53]!==o||t[54]!==z.dims||t[55]!==W||t[56]!==se||t[57]!==d||t[58]!==u||t[59]!==l||t[60]!==a||t[61]!==U||t[62]!==A||t[63]!==w||t[64]!==V||t[65]!==L?(pe=w===`ready`&&(0,Q.jsxs)(`div`,{className:`prism-doc-unit`,style:{maxWidth:Zt+W},children:[(0,Q.jsxs)(`div`,{className:`prism-doc-sheet prism-doc-text`,ref:te,style:{width:W?`calc(100% - ${W}px)`:`100%`,maxWidth:Zt,fontSize:`${Qt*L}px`},children:[A.map((e,t)=>e.anchor?(0,Q.jsx)(`mark`,{"data-prism-anchor":e.anchor,className:`prism-office-mark`,style:{background:`color-mix(in oklab, ${$t(e.anchor,o,s)} 30%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${$t(e.anchor,o,s)} 55%, transparent)`},children:e.text},t):(0,Q.jsx)(M.Fragment,{children:e.text},t)),(0,Q.jsx)(Bt,{geometry:V,zoom:L,color:o,quote:a,also:s,penOn:l,penColor:u,penAccent:d,seed:U})]}),(0,Q.jsx)(Vt,{entries:se,dims:z.dims,zoom:L,seed:U})]}),t[52]=s,t[53]=o,t[54]=z.dims,t[55]=W,t[56]=se,t[57]=d,t[58]=u,t[59]=l,t[60]=a,t[61]=U,t[62]=A,t[63]=w,t[64]=V,t[65]=L,t[66]=pe):pe=t[66];let me;return t[67]!==o||t[68]!==g||t[69]!==p||t[70]!==v||t[71]!==_||t[72]!==b||t[73]!==i||t[74]!==y||t[75]!==G||t[76]!==K||t[77]!==ue||t[78]!==q||t[79]!==de||t[80]!==fe||t[81]!==pe||t[82]!==m?(me=(0,Q.jsxs)($,{ariaLabel:G,kindLabel:p,color:o,page:i,title:m,docName:K,pageCount:y,onPageChange:b,zoom:ue,zoomVariant:`scale`,onClose:v,closeLabel:`Close source page`,connections:g,onNavigate:_,scrollRef:N,footer:q,children:[de,fe,pe]}),t[67]=o,t[68]=g,t[69]=p,t[70]=v,t[71]=_,t[72]=b,t[73]=i,t[74]=y,t[75]=G,t[76]=K,t[77]=ue,t[78]=q,t[79]=de,t[80]=fe,t[81]=pe,t[82]=m,t[83]=me):me=t[83],me}function tn(e){return!!e.note?.trim()}function nn(e){return e.anchor===`primary`}function rn(e){return e.pages}var an=960,on=540,sn={w:an,h:on},cn=[];function ln(e,t,n){if(e===`primary`)return t;let r=Number(e.slice(5));return n?.[r]?.color??t}function un(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, ${ln(e.anchor,t,n)} 30%, transparent)`,boxShadow:`0 0 0 1px color-mix(in oklab, ${ln(e.anchor,t,n)} 55%, transparent)`},children:e.text},`${r}-${i}`):(0,Q.jsx)(M.Fragment,{children:e.text},`${r}-${i}`))}function dn(e){return e>70?30:e>40?34:40}function fn(e){return e<=4?22:e<=7?19:e<=11?16:14}function pn(e){return e<=220?20:e<=500?17:e<=900?15:13}function mn(e){let t=(0,ee.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,M.useState)(null),[C,w]=(0,M.useState)(void 0),[T,E]=(0,M.useState)(`loading`),D,O;t[0]===n?(D=t[1],O=t[2]):(D=()=>{let e=!1;return E(`loading`),Ue(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,M.useEffect)(D,O);let k=(0,M.useRef)(null),A=(0,M.useRef)(null),j=c?.trim()||(s??[]).some(bn)?218:0,N;t[3]===j?N=t[4]:(N={gutterReserve:j},t[3]=j,t[4]=N);let te=Ht(k,T===`ready`,N),{zoom:P,dims:F,setDims:I,resetForNewContent:ne,fitScreen:L}=te,re;t[5]!==L||t[6]!==ne||t[7]!==I?(re=()=>{ne((k.current?.clientWidth??0)===0),I(sn),L()},t[5]=L,t[6]=ne,t[7]=I,t[8]=re):re=t[8];let ie;t[9]!==n||t[10]!==L||t[11]!==i||t[12]!==ne||t[13]!==I?(ie=[n,i,ne,I,L],t[9]=n,t[10]=L,t[11]=i,t[12]=ne,t[13]=I,t[14]=ie):ie=t[14],(0,M.useEffect)(re,ie);let ae=x?.[i-1]??``,R=C?.[i-1],oe;t[15]===R?oe=t[16]:(oe=!!R&&(!!R.title?.trim()||R.body.some(yn)),t[15]=R,t[16]=oe);let z=oe,B;t[17]!==z||t[18]!==R?.title?(B=z?R?.title?.trim():void 0,t[17]=z,t[18]=R?.title,t[19]=B):B=t[19];let V=B,H=z?R?.body??cn:cn,se;t[20]!==s||t[21]!==V||t[22]!==a?(se=V?qt(V,a,s):[],t[20]=s,t[21]=V,t[22]=a,t[23]=se):se=t[23];let U=se,ce;if(t[24]!==s||t[25]!==H||t[26]!==a){let e;t[28]!==s||t[29]!==a?(e=e=>qt(e,a,s),t[28]=s,t[29]=a,t[30]=e):e=t[30],ce=H.map(e),t[24]=s,t[25]=H,t[26]=a,t[27]=ce}else ce=t[27];let le=ce,W;t[31]!==s||t[32]!==z||t[33]!==ae||t[34]!==a?(W=z?[]:qt(ae,a,s),t[31]=s,t[32]=z,t[33]=ae,t[34]=a,t[35]=W):W=t[35];let G=W,K=z?U.some(vn)||le.some(gn):G.some(hn),ue;t[36]!==le||t[37]!==G||t[38]!==U?(ue=[U,le,G],t[36]=le,t[37]=G,t[38]=U,t[39]=ue):ue=t[39];let q=Xt(A,P,ue),de;t[40]!==F||t[41]!==q.alsoRects||t[42]!==q.rects?(de={dims:F,rects:q.rects,alsoRects:q.alsoRects},t[40]=F,t[41]=q.alsoRects,t[42]=q.rects,t[43]=de):de=t[43];let fe=de,pe;t[44]!==s||t[45]!==o||t[46]!==F.w||t[47]!==q.alsoRects||t[48]!==q.rects||t[49]!==c||t[50]!==P?(pe=F.w===0?[]:zt(q.rects,q.alsoRects,o,c,s,P),t[44]=s,t[45]=o,t[46]=F.w,t[47]=q.alsoRects,t[48]=q.rects,t[49]=c,t[50]=P,t[51]=pe):pe=t[51];let me=pe,he=`${r}:${i}:${a}`,ge;t[52]!==q.dims||t[53]!==q.rects||t[54]!==f||t[55]!==l||t[56]!==a||t[57]!==he||t[58]!==T?(ge=()=>{!l||T!==`ready`||!a.trim()||!f||q.dims.w===0||f({pageImage:``,imgW:an,imgH:on,rects:q.rects,isFigure:!1,seed:he})},t[52]=q.dims,t[53]=q.rects,t[54]=f,t[55]=l,t[56]=a,t[57]=he,t[58]=T,t[59]=ge):ge=t[59];let _e;t[60]!==q||t[61]!==f||t[62]!==l||t[63]!==a||t[64]!==he||t[65]!==T?(_e=[l,T,a,f,q,he],t[60]=q,t[61]=f,t[62]=l,t[63]=a,t[64]=he,t[65]=T,t[66]=_e):_e=t[66],(0,M.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`?te:void 0,we=a.trim()?T===`ready`&&K?`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]!==G||t[80]!==ye||t[81]!==ve||t[82]!==z||t[83]!==me||t[84]!==H||t[85]!==V||t[86]!==ae||t[87]!==d||t[88]!==u||t[89]!==l||t[90]!==a||t[91]!==he||t[92]!==T||t[93]!==fe||t[94]!==U||t[95]!==P?(De=T===`ready`&&(0,Q.jsxs)(`div`,{className:`prism-slide-unit`,style:{width:ve?ve+(me.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:[V&&(0,Q.jsx)(`h2`,{className:`prism-slide-title`,style:{fontSize:dn(V.length)},children:un(U,o,s,`title`)}),H.length>0&&(0,Q.jsx)(`div`,{className:`prism-slide-body`,style:{fontSize:fn(H.length)},children:H.map((e,t)=>(0,Q.jsx)(`p`,{className:`prism-slide-body-line`,children:un(le[t]??[],o,s,`b${t}`)},t))})]}):(0,Q.jsx)(`div`,{className:`prism-slide-flat`,style:{fontSize:pn(ae.length)},children:un(G,o,s,`flat`)})}),(0,Q.jsx)(Bt,{geometry:fe,zoom:P,color:o,quote:a,also:s,penOn:l,penColor:u,penAccent:d,seed:he})]}),(0,Q.jsx)(Vt,{entries:me,dims:F,zoom:P,seed:he})]}),t[75]=s,t[76]=le,t[77]=o,t[78]=F,t[79]=G,t[80]=ye,t[81]=ve,t[82]=z,t[83]=me,t[84]=H,t[85]=V,t[86]=ae,t[87]=d,t[88]=u,t[89]=l,t[90]=a,t[91]=he,t[92]=T,t[93]=fe,t[94]=U,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)($,{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 hn(e){return e.anchor===`primary`}function gn(e){return e.some(_n)}function _n(e){return e.anchor===`primary`}function vn(e){return e.anchor===`primary`}function yn(e){return e.trim()}function bn(e){return!!e.note?.trim()}var xn=2e4;function Sn(e){let t=e.slice(0,e.indexOf(`
|
|
103
|
+
`)===-1?e.length:e.indexOf(`
|
|
104
|
+
`)),n={",":0," ":0,";":0},r=!1;for(let e of t)e===`"`?r=!r:!r&&e in n&&(n[e]+=1);let i=`,`;for(let e of Object.keys(n))n[e]>n[i]&&(i=e);return i}function Cn(e,t){let n=[],r=``,i=[],a=!1,o=()=>{i.push(r),r=``},s=()=>{o(),n.push(i),i=[]};for(let n=0;n<e.length;n+=1){let i=e[n];if(a){i===`"`?e[n+1]===`"`?(r+=`"`,n+=1):a=!1:r+=i;continue}i===`"`?a=!0:i===t?o():i===`
|
|
105
|
+
`?s():i===`\r`?e[n+1]!==`
|
|
106
|
+
`&&s():r+=i}return(r.length>0||i.length>0)&&s(),n}function wn(e){let t=e.replace(/^\uFEFF/,``);if(!t.trim())return null;let n=Cn(t,Sn(t)).filter(e=>!(e.length===1&&e[0].trim()===``));if(n.length===0)return null;let r=n[0].map((e,t)=>e.trim()||`col${t+1}`),i=r.length,a=n.slice(1),o=a.length,s=a.slice(0,xn).map(e=>{let t=e.slice(0,i);for(;t.length<i;)t.push(``);return t});return{headers:r,rows:s,sourceRowCount:o,truncated:o>s.length}}function Tn(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 En(e,t,n){let r=Tn(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 Dn(e,t){if(!t.trim())return[];let n=[];return e.forEach((e,r)=>{if(!e)return;let{norm:i,map:a}=Gt(e),o=Kt(t,i,a);if(!o)return;let[s,c]=o,l=En(e,s,c);n.push(l?{row:r,cells:l}:{row:r})}),n}var On=880,kn=13;function An(e){let t=e.trim();if(!t)return!1;let n=t.replace(/^[-+(]/,``).replace(/[)%]$/,``).replace(/^[$€£¥]\s?/,``);return/^[\d,]*\.?\d+$/.test(n)}function jn(e,t){return e.length>=t?e.slice(0,t):[...e,...Array(t-e.length).fill(``)]}function Mn(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,xn).map(e=>jn(e,n.length));return{headers:n,rows:a,sheet:t,sourceRowCount:i,truncated:i>a.length}}function Nn(e,t){return e.find(e=>e.row>=1&&!t.has(e.row))}function Pn({doc:e,source:t,page:n,quote:r,color:i,also:a,note:o,penOn:s,penColor:c,penAccent:l,onAnnotated:u,kindLabel:d,title:f,docName:p,connections:h,onNavigate:g,onClose:_,pageCount:v,onPageChange:y}){let[b,x]=(0,M.useState)(`loading`),[S,C]=(0,M.useState)(null),[w,T]=(0,M.useState)(null);(0,M.useEffect)(()=>{let t=!1;return x(`loading`),C(null),T(null),m(e)?Ue(e).then(e=>{if(!t){if(!e.sheetGrids||e.sheetGrids.length===0){x(`failed`);return}T({rows:e.sheetGrids,labels:e.pageLabels??[]}),x(`ready`)}}):We(e).then(e=>{t||(!e||e.length===0?x(`failed`):(C(e),x(`ready`)))}),()=>{t=!0}},[e]);let E=w?.rows[n-1],D=w?.labels[n-1],O=S?.[n-1],k=(0,M.useMemo)(()=>b===`ready`?E?Mn(E,D):O===void 0?null:wn(O):null,[b,E,D,O]),A=(0,M.useMemo)(()=>E?E.map(e=>e.join(` `)):O===void 0?[]:O.replace(/\r\n?/g,`
|
|
107
|
+
`).split(`
|
|
108
|
+
`),[E,O]),j=(0,M.useMemo)(()=>Dn(A,r),[A,r]),ee=(0,M.useMemo)(()=>(a??[]).map(e=>Dn(A,e.quote)),[A,a]),{primaryHit:N,alsoHits:te}=(0,M.useMemo)(()=>{let e=new Set,t=Nn(j,e);return t&&e.add(t.row),{primaryHit:t,alsoHits:ee.map(t=>{let n=Nn(t,e);return n&&e.add(n.row),n})}},[j,ee]),P=!!N,F=(0,M.useRef)(null),I=(0,M.useRef)(null),ne=!!o?.trim()||(a??[]).some(e=>!!e.note?.trim()),L=Ht(F,b===`ready`,{gutterReserve:ne?218:0}),{zoom:re,resetForNewContent:ie}=L,ae=(0,M.useRef)(null);(0,M.useEffect)(()=>{let t=ae.current;ae.current={doc:e,page:n},(!t||t.doc!==e||t.page!==n)&&ie()},[e,n,ie]);let R=Xt(I,re,[k,N,te]),oe={dims:R.dims,rects:R.rects,alsoRects:R.alsoRects},z=(0,M.useMemo)(()=>R.dims.w===0?[]:zt(R.rects,R.alsoRects,i,o,a,re),[R,o,a,i,re]),B=`${t}:${n}:${r}`;(0,M.useEffect)(()=>{!s||b!==`ready`||!r.trim()||!u||R.dims.w===0||u({pageImage:``,imgW:Math.max(1,Math.round(R.dims.w)),imgH:Math.max(1,Math.round(R.dims.h)),rects:R.rects,isFigure:!1,seed:B})},[s,b,r,u,R,B]);let V=ne?218:0,H=D?`SHEET · ${D}`:void 0;return(0,Q.jsxs)($,{ariaLabel:`Source page ${n}`,kindLabel:d,color:i,page:n,pageLabel:H,title:f,docName:p?.replace(/\.(csv|tsv|xlsx)$/i,``),pageCount:v,onPageChange:y,zoom:b===`ready`?L:void 0,zoomVariant:`scale`,onClose:_,closeLabel:`Close source page`,connections:h,onNavigate:g,scrollRef:F,footer:r.trim()?b===`ready`&&P?`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:[b===`loading`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Reading page `,n,`…`]}),b===`failed`&&(0,Q.jsxs)(`div`,{className:`prism-page-status`,children:[`Couldn’t read this page. The quote is still grounded on page `,n,`.`]}),b===`ready`&&k&&(0,Q.jsxs)(`div`,{className:`prism-sheet-unit`,style:{maxWidth:On+V},children:[(0,Q.jsx)(`div`,{className:`prism-sheet-scroll`,children:(0,Q.jsxs)(`div`,{className:`prism-sheet-inner`,ref:I,style:{fontSize:`${kn*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:An(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=te.findIndex(e=>e!==void 0&&e.row-1===t),i=r>=0?te[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:[An(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)(Bt,{geometry:oe,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)(Vt,{entries:z,dims:R.dims,zoom:re,seed:B})]})]})}function Fn(e){let t=(0,ee.c)(27),n,r,i,a;if(t[0]!==e){a=Symbol.for(`react.early_return_sentinel`);bb0:{let{slideImages:t,...o}=e;if(r=o,n=r.pdf,t&&t.length>0){a=(0,Q.jsx)(Wt,{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)(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});break bb0}if(_(n)||C(n)&&!v(n)){a=(0,Q.jsx)(en,{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}i=m(n)||v(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)(Pn,{doc:n,source:r.source,page:r.page,quote:r.quote,color:r.color,also:r.also,note:r.note,penOn:r.penOn,penColor:r.penColor,penAccent:r.penAccent,onAnnotated:r.onAnnotated,kindLabel:r.kindLabel,title:r.title,docName:r.docName,connections:r.connections,onNavigate:r.onNavigate,onClose:r.onClose,pageCount:r.pageCount,onPageChange:r.onPageChange}),t[5]=n,t[6]=r.also,t[7]=r.color,t[8]=r.connections,t[9]=r.docName,t[10]=r.kindLabel,t[11]=r.note,t[12]=r.onAnnotated,t[13]=r.onClose,t[14]=r.onNavigate,t[15]=r.onPageChange,t[16]=r.page,t[17]=r.pageCount,t[18]=r.penAccent,t[19]=r.penColor,t[20]=r.penOn,t[21]=r.quote,t[22]=r.source,t[23]=r.title,t[24]=e):e=t[24],e}let o;return t[25]===r?o=t[26]:(o=(0,Q.jsx)(Ut,{...r}),t[25]=r,t[26]=o),o}var In={holds:{label:`HOLDS`,token:`var(--insight)`},outdated:{label:`OUTDATED`,token:`var(--warning)`},disputed:{label:`DISPUTED`,token:`var(--warning)`},contradicted:{label:`CONTRADICTED`,token:`var(--danger)`},unsupported:{label:`UNSUPPORTED`,token:`#8c90a0`}},Ln=[`outdated`,`disputed`,`contradicted`,`unsupported`];function Rn(e,t,n=t+`s`){return e===1?t:n}function zn(e){let t=e.length;if(t===0)return``;let n=e.filter(e=>Ln.includes(e));if(n.length===0){let e=t===1?`holds`:`hold`;return`All ${t} checked ${Rn(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 ${Rn(t,`claim`)} need a second look: ${a.join(` · `)}.`}var Bn=[`holds`,`outdated`,`disputed`,`contradicted`];function Vn(e,t){let n=j(e,t);if(Bn.includes(e.verdict)&&!n)return{claimId:e.claimId,verdict:`unsupported`,note:`Nothing in the searched sources backs this up.`};let r=(e.note??``).trim();return{claimId:e.claimId,verdict:e.verdict,note:r||(e.verdict===`unsupported`?`Nothing in the searched sources backs this up.`:`The public record speaks to this.`),...n?{citation:n}:{}}}function Hn(e,t){let n=E(e);return n.needsKey&&!t?E(`wikipedia`):n}var Un=[`holds`,`outdated`,`disputed`,`contradicted`,`unsupported`];function Wn(e){let t=String(e??``).toLowerCase().trim();return Un.includes(t)?t:`unsupported`}function Gn(e){return`${e.title} ${e.quote}`.replace(/\s+/g,` `).trim().slice(0,200)}function Kn(e){if(e&&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 qn(e){return(typeof e==`string`?e.trim():``)||void 0}function Jn(e){let t=Kn(e),n=t&&Array.isArray(t.verdicts)?t.verdicts:typeof e==`string`?T(e,`verdicts`):[],r=[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=e,n=qn(t.claimId);n&&r.push({claimId:n,verdict:Wn(t.verdict),note:qn(t.note),citationQuote:qn(t.citationQuote),citationUrl:qn(t.citationUrl),citationDate:qn(t.citationDate)})}return r}var Yn=`You are a meticulous fact-checker. You judge claims only against the sources given to you and return strict JSON. You never invent a source, a URL, or a quote, and you default to "unsupported" whenever the evidence is thin.`;function Xn(e,t){return`For each CLAIM below (a verbatim quote pulled from a document), decide how it stands against
|
|
109
|
+
the SOURCES listed for it (short web-search snippets — that is all you have, no full pages).
|
|
110
|
+
|
|
111
|
+
Return ONLY JSON (no prose, no fences):
|
|
112
|
+
{ "verdicts": [ { "claimId": "...", "verdict": "holds|outdated|disputed|contradicted|unsupported",
|
|
113
|
+
"note": "<=120 chars, plain", "citationQuote": "copied VERBATIM from one of that claim's sources",
|
|
114
|
+
"citationUrl": "that source's URL, copied exactly from the list" } ] }
|
|
115
|
+
|
|
116
|
+
Rules:
|
|
117
|
+
- "holds": a source clearly supports the claim. "outdated": a source gives a newer/superseding figure.
|
|
118
|
+
"disputed": credible sources genuinely conflict. "contradicted": a source directly contradicts it.
|
|
119
|
+
"unsupported": the sources don't actually bear on the claim — this is the DEFAULT; when in doubt, pick it.
|
|
120
|
+
- For ANY verdict other than "unsupported" you MUST copy a "citationQuote" word-for-word from ONE of
|
|
121
|
+
that claim's own sources, and copy its "citationUrl" exactly. If you cannot, the verdict is "unsupported".
|
|
122
|
+
- Never invent a source, URL, or quote. Only the snippets above are real. Bias hard toward "unsupported"
|
|
123
|
+
when evidence is thin or only loosely related — do not stretch a weak match into a verdict.
|
|
124
|
+
- "note" is a plain restatement ("the public record shows X" / "a 2024 source reports Y"), never "they lied".
|
|
125
|
+
|
|
126
|
+
CLAIMS AND THEIR SOURCES:
|
|
127
|
+
${e.map(e=>{let n=(t.get(e.id)??[]).map(e=>` - "${e.title}": ${e.snippet} (${e.url})`).join(`
|
|
128
|
+
`);return`[claim ${e.id}] "${e.quote}"\n sources:\n${n}`}).join(`
|
|
129
|
+
|
|
130
|
+
`)}`}async function Zn(e,t){let n=t.provider??Hn(t.searchProviderId,t.apiKey),r=e.filter(e=>e.role===`load-bearing`).slice(0,t.maxClaims??12);if(r.length===0)return[];let i=new Map;await Promise.all(r.map(async e=>{let r=await n.search(Gn(e),{apiKey:t.apiKey,signal:t.signal,limit:t.perClaimResults??4});i.set(e.id,r.map(e=>({title:e.title,url:e.url,snippet:e.snippet})))}));let a=r.filter(e=>(i.get(e.id)?.length??0)>0),o=r.filter(e=>(i.get(e.id)?.length??0)===0).map(e=>({claimId:e.id,verdict:`unsupported`,note:`No live source was found to check this.`}));if(a.length===0)return o;let s=Math.min(4096,Math.max(1400,250+a.length*150)),c;try{c=(await x(t.cfg.provider).generate({system:Yn,history:[],user:Xn(a,i),maxTokens:s,temperature:0,format:null,...t.signal?{signal:t.signal}:{}},t.cfg)).raw}catch{for(let e of a)o.push({claimId:e.id,verdict:`unsupported`,note:`Could not reach the fact-checker.`});return o}let l=Jn(c),u=new Set;for(let e of l)u.has(e.claimId)||a.some(t=>t.id===e.claimId)&&(u.add(e.claimId),o.push(Vn(e,i.get(e.claimId)??[])));for(let e of a)u.has(e.id)||o.push({claimId:e.id,verdict:`unsupported`,note:`The sources did not clearly speak to this.`});return o}var Qn=4,$n=3,er=2,tr={contradicted:4,disputed:3,outdated:2,unsupported:1,holds:0},nr={contradicts:`contradicts`,"in-tension":`is in tension with`,agrees:`agrees with`};function rr(e,t){let n=e.replace(/\s+/g,` `).trim();if(n.length<=t)return n;let r=n.slice(0,t),i=r.lastIndexOf(` `);return(i>t*.6?r.slice(0,i):r).trimEnd()+`…`}function ir(e){return Math.max(2600,Math.min(7e3,Math.round(e.length*60)+1200))}function ar(e){let t=new Map;for(let n of e)t.set(n.a,(t.get(n.a)??0)+1),t.set(n.b,(t.get(n.b)??0)+1);return t}function or(e,t,n){if(e.length===0)return[];let r=new Map(e.map(e=>[e.id,e])),i=ar(t),a=[],o=new Set,s=0,c=(e,t,n,r)=>{a.push({id:`b${s+=1}`,kind:e,claimIds:t,caption:n,spoken:r,dwellMs:ir(r)});for(let e of t)o.add(e)},l=e.filter(e=>e.role===`load-bearing`),u=[...l.length>0?l:e].sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||e.page-t.page||e.id.localeCompare(t.id))[0];c(`open`,[u.id],`The case rests on this — “${rr(u.quote,96)}” · p.${u.page}`,`The whole case rests on this, on page ${u.page}. ${rr(u.quote,220)}`);let d={contradicts:0,"in-tension":1,agrees:2},f=t.filter(e=>e.relation!==`agrees`&&r.has(e.a)&&r.has(e.b)).sort((e,t)=>d[e.relation]-d[t.relation]).slice(0,Qn);for(let e of f){let t=r.get(e.a),n=r.get(e.b),i=e.crossDoc?` (across documents)`:``;c(`tension`,[t.id,n.id],`p.${t.page}: “${rr(t.quote,52)}” — ${nr[e.relation]}${i} — p.${n.page}: “${rr(n.quote,52)}”`,`On page ${t.page}, the document says ${rr(t.quote,140)}. But it ${nr[e.relation]} page ${n.page}: ${rr(n.quote,140)}.`)}let p=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&tr[e.v]>=2&&!o.has(e.c.id)).sort((e,t)=>tr[t.v]-tr[e.v]||e.c.page-t.c.page).slice(0,$n);for(let{c:e,v:t}of p){let n=In[t].label;c(`verdict`,[e.id],`${n} — “${rr(e.quote,72)}” · p.${e.page}`,`The public record marks this ${n.toLowerCase()}: ${rr(e.quote,160)}`)}let m=e.filter(e=>(e.role===`context`||e.kind===`definition`)&&!o.has(e.id)).sort((e,t)=>e.page-t.page).slice(0,er);for(let e of m)c(`context`,[e.id],`Context — ${rr(e.title,64)} · p.${e.page}`,`For context: ${e.title}.`);let h=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&tr[e.v]>=2).sort((e,t)=>tr[t.v]-tr[e.v]||e.c.page-t.c.page)[0];if(h){let e=In[h.v].label;c(`close`,[h.c.id],`The weak point — ${e}: “${rr(h.c.quote,68)}” · p.${h.c.page}`,`So the weakest point: the public record marks this ${e.toLowerCase()} — ${rr(h.c.quote,150)}`)}else if(f.length>0){let e=f[0],t=r.get(e.a),n=r.get(e.b);c(`close`,[t.id,n.id],`The weak point — the document contradicts itself: p.${t.page} vs p.${n.page}`,`And the weakest point is that the document contradicts itself, between page ${t.page} and page ${n.page}.`)}else{let e=n.get(u.id)===`holds`;c(`close`,[u.id],e?`Nothing here contradicts itself — the case rests on this one claim, and it holds.`:`Nothing here contradicts itself — the whole case rests on this one claim.`,e?`Nothing here contradicts itself. The case rests entirely on that one claim — and the public record backs it.`:`Nothing here contradicts itself. The whole case rests on that one claim.`)}return a}var sr=16;function cr(){let e=(0,ee.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=(0,M.useRef)(t),[r,i]=(0,M.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>sr&&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 lr={forecast:`#5468e0`,stat:`#12a37a`,finding:`#1f9d7e`,risk:`#e0474d`,definition:`#5a6678`,method:`#cf8327`,diagram:`#5468e0`},ur=`#6a4fd0`;function dr(e){return lr[e]}var fr={"load-bearing":`The document leans on this`,supporting:`Supporting evidence`,context:`Context`};function pr(e){return`${fr[e.role]} — ${e.title}`}function mr(e){let t=e.role===`load-bearing`,n=e.kind===`forecast`;if(!(!t&&!n))return{...t?{star:t}:{},...n?{question:n}:{}}}var hr={forecast:`forecast`,stat:`figure`,finding:`finding`,risk:`risk`,definition:`definition`,method:`method`,diagram:`figure`},gr={"load-bearing":e=>`The ${e} the document leans on`,supporting:e=>`Supporting ${e}`,context:e=>`Context — ${e}`};function _r(e){return`${gr[e.role](hr[e.kind])} · page ${e.page}`}var vr=c();i();var yr=r(()=>l(()=>import(`./ShareModal-eJ6sdMpf.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([8,2,1,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22]))),br=yr.Component;function xr({steps:e,spec:t,pdfs:n,cfg:r,placed:i,verdicts:o}){let[c,u]=(0,M.useState)(!1),[f,p]=(0,M.useState)(null);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,disabled:c,onClick:(0,M.useCallback)(async()=>{if(!c){u(!0);try{let[{autoAnnotationSteps:r},{buildAnnotationReel:a}]=await Promise.all([l(()=>import(`./annotationAuto-BjWqgseH.js`),__vite__mapDeps([23,24,2,25,26,27,1,3,4,5,6,7,28])),l(()=>import(`./annotationReel-B5A2RZkx.js`).then(e=>e.t),__vite__mapDeps([29,2,11,1,3,4,5,6,7,12,17])),yr.preload()]),s=e.current,c=s.length>=1?s.slice():await r(t,n,{placed:i,verdicts:o,max:6});if(!c.length){d(`Turn on Annotate, then ask a question or tap a claim to mark it up`,`warn`);return}p(a(c,{fileName:t.fileName}))}finally{u(!1)}}},[c,e,t,n,i,o]),title:`Make a shareable reel of the marked-up pages`,...a(yr.preload),children:c?`Preparing…`:`Share reel`}),f&&(0,vr.createPortal)((0,Q.jsx)(s,{label:`Annotation reel`,overlay:!0,children:(0,Q.jsx)(br,{script:f,cfg:r??void 0,onClose:()=>p(null)})}),document.body)]})}i();var Sr=r(()=>l(()=>import(`./PrismAskController-D6_7Epdb.js`).then(e=>({default:e.PrismAskController})),__vite__mapDeps([30,1,2,3,4,5,6,7,24,25,26,31,32,33,34,35]))),Cr=r(()=>l(()=>import(`./PrismBriefingPlayer-Dq5_KRU3.js`).then(e=>({default:e.PrismBriefingPlayer})),__vite__mapDeps([36,1,2,3,4,5,6,7,27,28]))),wr=r(()=>l(()=>import(`./CrossExamPanel-Cn7b5y7B.js`).then(e=>({default:e.CrossExamPanel})),__vite__mapDeps([37,1,2,3,4,5,6,7,38]))),Tr=r(()=>l(()=>import(`./ForecastPanel-lTnux0EB.js`).then(e=>({default:e.ForecastPanel})),__vite__mapDeps([39,1,2,3,4,5,6,7,31,40]))),Er=r(()=>l(()=>import(`./LeverPanel-CvYnTLjh.js`).then(e=>({default:e.LeverPanel})),__vite__mapDeps([41,1,2,3,4,5,6,7,42,43]))),Dr=r(()=>l(()=>import(`./WhyMachineOverlay-BRNibJSf.js`).then(e=>({default:e.WhyMachineOverlay})),__vite__mapDeps([44,1,2,3,4,5,6,7,45,31,46]))),Or=Sr.Component,kr=Cr.Component,Ar=wr.Component,jr=Tr.Component,Mr=Er.Component,Nr=Dr.Component,Pr=n(()=>l(()=>import(`./run-BYP2YlZT.js`),__vite__mapDeps([47,24,2,25,26,33,48,49]))),Fr=n(()=>l(()=>import(`./run-DSVvshaB.js`),__vite__mapDeps([50,24,2,25,26,33,49]))),Ir=n(()=>l(()=>import(`./run-Dc2ZJz6n.js`),__vite__mapDeps([51,24,2,25,26,32,33,48,34,49]))),Lr=n(()=>l(()=>import(`./model-BE0UHu1w.js`),__vite__mapDeps([52,24,2,25,26,33,42,48]))),Rr=n(()=>l(()=>import(`./explode-WBykfhqW.js`),__vite__mapDeps([53,24,2,25,26,32,33,54,55,56]))),zr=n(()=>l(()=>import(`./kokoro-DsmNzulR.js`).then(e=>e.i),__vite__mapDeps([21,2,1,3,4,5,6,7,17]))),Br=null;function Vr(){return Br=zr()}function Hr(){Br&&Br.then(e=>e.cancelKokoro(),()=>void 0)}function Ur(e){Vr().then(t=>t.speakKokoroResult(e,`mavea`))}var Wr={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`}},Gr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`],Kr={contradicts:`contradicts`,"in-tension":`in tension`,agrees:`agrees`},qr=[{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`}],Jr=[{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`}],Yr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--insight-soft)`];function Xr(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 Zr(e){return e?e.relation:`anchored`}function Qr(e){return e?e.relation===`agrees`?`agrees · ready`:e.relation===`in-tension`?`in tension`:`in contradiction`:`anchored · ready`}function $r({pdf:e,cfg:t,search:n,onClose:r,world:i,corpusChrome:o,autoBriefing:c}){let l=(0,M.useMemo)(()=>Array.isArray(e)?e:[e],[e]),d=l.length>1,[p,m]=(0,M.useState)(!1),h=vt(t),{phase:g,spec:_,corpus:v,proposed:y,error:b}=i??h,{explode:x}=h,[S,C]=(0,M.useState)(null),[w,T]=(0,M.useState)(null),[E,D]=(0,M.useState)(null),[O,k]=(0,M.useState)(()=>new Set),[A,j]=(0,M.useState)(!1),[ee,N]=(0,M.useState)(!1),[te,P]=(0,M.useState)(null),[F,I]=(0,M.useState)(0),[ne,L]=(0,M.useState)(null),[re,ie]=(0,M.useState)(()=>new Set),ae=(0,M.useRef)(()=>{}),[R,oe]=(0,M.useState)(null),[z,B]=(0,M.useState)(!1),[V,H]=(0,M.useState)(!1),se=(0,M.useRef)(null),[U,ce]=(0,M.useState)(null),[le,W]=(0,M.useState)(!1),[G,K]=(0,M.useState)(!1),[ue,de]=(0,M.useState)(null),fe=(0,M.useRef)(null),[pe,me]=(0,M.useState)(null),[he,ge]=(0,M.useState)(!1),[_e,ve]=(0,M.useState)(!1),[ye,be]=(0,M.useState)(null),xe=(0,M.useRef)(null),[Se,Ce]=(0,M.useState)(null),[we,Te]=(0,M.useState)(!1),[Ee,De]=(0,M.useState)(!1),Oe=(0,M.useRef)(!1),ke=(0,M.useRef)(null),[Ae,je]=(0,M.useState)(`map`),[Me,Ne]=(0,M.useState)(null),[Pe,Fe]=(0,M.useState)(null),Ie=(0,M.useRef)(null),[Le,Re]=(0,M.useState)(!1),[ze,Be]=(0,M.useState)(44),Ve=(0,M.useRef)(null),He=(0,M.useRef)(!1),Ue=(0,M.useRef)(null);u(Ue);let[We,Ge]=(0,M.useState)(()=>new Map),[Ke,qe]=(0,M.useState)(!1),[Je,Ye]=(0,M.useState)(c===!0),[Xe,Ze]=(0,M.useState)(!1),[Qe,$e]=(0,M.useState)(``),{steps:et,record:tt,clear:nt}=cr(),rt=(0,M.useCallback)(e=>{He.current=!0,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[]),it=(0,M.useCallback)(e=>{if(!He.current||!Ve.current)return;let t=Ve.current.getBoundingClientRect(),n=(t.right-e.clientX)/t.width*100;Be(Math.max(24,Math.min(100,n)))},[]),at=(0,M.useCallback)(e=>{He.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),ot=(0,M.useRef)(!1);(0,M.useEffect)(()=>{i||ot.current||(ot.current=!0,x(l))},[l,x]),(0,M.useEffect)(()=>()=>void q(),[]),(0,M.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(ne?(Hr(),L(null),ie(new Set),C(null),ae.current()):w?T(null):E?D(null):S?C(null):r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[ne,w,E,S,r]);let[st,ct]=(0,M.useState)(null);(0,M.useEffect)(()=>{if(!_||_.claims.length<48)return;let e=!0;return Pt(_,Gr).then(t=>{e&&ct({spec:_,result:t})}),()=>{e=!1}},[_]);let J=(0,M.useMemo)(()=>_?_.claims.length<48?Et(_,Gr):st?.spec===_?st.result:null:null,[st,_]),lt=(0,M.useRef)(null),ut=(0,M.useMemo)(()=>{if(!J||J.claims.length===0)return;let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i of J.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 J.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}},[J]),Y=St(lt,J?.width??1,J?.height??1,ut),X=(0,M.useMemo)(()=>{let e=new Map;if(J)for(let t of J.claims)e.set(t.id,t);return e},[J]),dt=(0,M.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(J)for(let e of J.links)t(e.a,e.b);if(_)for(let e of _.threads)t(e.a,e.b);let n=new Map;for(let[t,r]of e)n.set(t,[...r].map(e=>X.get(e)).filter(e=>!!e).sort((e,t)=>e.page-t.page||e.title.localeCompare(t.title)).map(e=>e.id));return n},[J,_,X]),ft=S?X.get(S)??null:null,pt=(0,M.useMemo)(()=>S?dt.get(S)??[]:[],[S,dt]),mt=_?.threads.filter(e=>e.crossDoc).length??0,Z=g===`settled`&&!!J,[ht,gt]=(0,M.useState)(null),_t=(0,M.useMemo)(()=>{let e=new Set;return o?.contradictions.forEach(t=>{e.add(t.a),e.add(t.b)}),e},[o]),yt=(0,M.useMemo)(()=>{let e=new Set;return o?.consensus.forEach(t=>t.memberClaimIds.forEach(t=>e.add(t))),e},[o]),bt=o?.lens??`all`;(0,M.useEffect)(()=>{if(!o||!Z)return;let e=bt===`contradictions`?o.contradictions:bt===`gaps`?o.gaps:bt===`consensus`?o.consensus:[];if(bt===`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})},[bt,Z]);let xt=g===`igniting`?`EXTRACTING`:g===`blooming`?`MAPPING`:g===`settled`?`SETTLED`:g===`error`?`COULDN’T MAP`:`READY`,Ct=_?.claims.length??0,wt=(0,M.useCallback)(()=>{C(null),T(null),D(null),k(new Set),Hr(),L(null),ie(new Set),se.current?.abort(),oe(null),H(!1),B(!1),fe.current?.abort(),ce(null),K(!1),W(!1),de(null),xe.current?.abort(),me(null),ve(!1),ge(!1),be(null),ke.current?.abort(),Ce(null),De(!1),Te(!1),Oe.current=!1,Ie.current?.abort(),Ne(null),Fe(null),je(`map`),x(l)},[x,l]),Tt=(0,M.useRef)(null),{frame:Dt,fit:Ot}=Y;ae.current=Ot,(0,M.useEffect)(()=>{if(!Z||!J||!_||Tt.current===_)return;Tt.current=_;let e=J.claims.filter(e=>e.role===`load-bearing`);if(e.length===0||e.length===J.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;Dt({x:t-200,y:n-a,w:r-t+400,h:i-n+a*2},{maxScale:1.2})},[Z,J,_,Dt]);let kt=(0,M.useRef)(null);(0,M.useEffect)(()=>{if(!Z||!_||!t||kt.current===_||(kt.current=_,Ge(new Map),qe(!1),!n?.enabled)||_.claims.filter(e=>e.role===`load-bearing`).length===0)return;let e=new AbortController;return qe(!0),Zn(_.claims,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal}).then(t=>{e.signal.aborted||Ge(new Map(t.map(e=>[e.claimId,e])))}).catch(()=>{}).finally(()=>{e.signal.aborted||qe(!1)}),()=>e.abort()},[Z,_,t,n]);let At=(0,M.useMemo)(()=>[...We.values()].map(e=>e.verdict),[We]),jt=(0,M.useMemo)(()=>zn(At),[At]),Mt=(0,M.useCallback)(e=>{let t=(_?.documents[e]?.fileName??`Doc ${e+1}`).replace(/\.[^.]+$/,``).trim();return t.length>18?t.slice(0,17).trimEnd()+`…`:t||`Doc ${e+1}`},[_]),Nt=(0,M.useCallback)((e,t)=>{if(!J)return;let n=J.claims.filter(n=>n.source===e&&n.page===t);if(n.length===0){let r=J.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);Dt({x:r-200,y:i-96*1.3,w:a-r+400,h:o-i+96*2.6},{maxScale:1.4})},[J,Dt]),Ft=(0,M.useCallback)(e=>{T(null),C(null),$e(``),D(e),Nt(e.doc,e.page)},[Nt]),It=(0,M.useCallback)(e=>{k(new Set(e.spans.map(e=>`${e.doc}:${e.page}`))),e.spans.length>0&&Ft(e.spans[0]),$e(e.text)},[Ft]),Lt=(0,M.useMemo)(()=>!Z||!t||!v?null:{corpus:v,cfg:t,multiDoc:d,...n?{search:n}:{}},[Z,t,v,d,n]);(0,M.useEffect)(()=>()=>Ie.current?.abort(),[]);let Rt=(0,M.useCallback)(()=>{if(!t||!v)return;Ie.current?.abort();let e=new AbortController;Ie.current=e,Fe(`why`);let n=v.flat().join(`
|
|
131
|
+
`).slice(0,8e3),r=d?`Why — the argument these documents make`:`Why does "${l[0].name.replace(/\.[a-z0-9]+$/i,``)}" reach its conclusion?`;Rr().then(({explodeWhy:i})=>i(r,n,t,e.signal)).then(t=>{e.signal.aborted||Ne(t)}).finally(()=>{e.signal.aborted||Fe(null)})},[t,v,d,l]);(0,M.useEffect)(()=>{I(e=>e+1),j(!1),N(!1),P(null),D(null),$e(``),gt(null),k(new Set),Hr(),nt(),L(null),ie(new Set),se.current?.abort(),oe(null),H(!1),B(!1),fe.current?.abort(),ce(null),K(!1),W(!1),de(null),xe.current?.abort(),me(null),ve(!1),ge(!1),be(null),ke.current?.abort(),Ce(null),De(!1),Te(!1),Oe.current=!1,Ie.current?.abort(),Ne(null),Fe(null)},[_,nt]);let $=(0,M.useMemo)(()=>{if(!Z)return null;if(w)return{source:w.doc,page:w.page,quote:``,color:`var(--presence)`,kindLabel:`PAGE`,title:`Reading the document`,isFigure:!1,connections:[],fromAsk:!1,browse:!0,penExplain:``,penColor:ur};if(E)return{source:E.doc,page:E.page,quote:E.quote,color:`var(--presence)`,kindLabel:`ANSWER`,title:`From your question`,isFigure:!1,connections:[],fromAsk:!0,penExplain:Qe||`“${E.quote.slice(0,160)}”`,penColor:ur};if(ft){let e=(J?.claims??[]).filter(e=>e.id!==ft.id&&e.source===ft.source&&e.page===ft.page&&e.quote.trim().length>0).slice(0,6).map(e=>({quote:e.quote,color:Wr[e.kind].color,note:e.title}));return{source:ft.source,page:ft.page,quote:ft.quote,color:Wr[ft.kind].color,kindLabel:Wr[ft.kind].label,title:ft.title,isFigure:ft.kind===`diagram`,...ft.box?{box:ft.box}:{},also:e,connections:pt.map(e=>({id:e,title:X.get(e)?.title??``})),fromAsk:!1,penExplain:pr(ft),penColor:dr(ft.kind),...mr(ft)?{penAccent:mr(ft)}:{}}}return null},[Z,w,E,Qe,ft,pt,X,J]),zt=Z&&(!!$||!!ht),Bt=(0,M.useCallback)(e=>{if(!$)return;let t={...e,color:$.penColor,title:$.title,explanation:$.penExplain,...$.penAccent?{accent:$.penAccent}:{}};tt(t),Xe&&t.explanation&&(Hr(),Ur(t.explanation))},[$,Xe,tt]),Vt=!!ne,Ht=(0,M.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);Dt({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,Dt]),Ut=(0,M.useMemo)(()=>new Map([...We].map(([e,t])=>[e,t.verdict])),[We]),Wt=(0,M.useCallback)(e=>{ie(new Set(e.claimIds)),Ht(e.claimIds),(Je||c)&&C(e.claimIds[0]??null)},[Je,c,Ht]),Gt=(0,M.useCallback)(()=>{Hr(),L(null),ie(new Set),C(null),Ot()},[Ot]),Kt=(0,M.useCallback)(e=>{e!==`recon`&&(se.current?.abort(),B(!1)),e!==`xe`&&(fe.current?.abort(),W(!1)),e!==`fa`&&(xe.current?.abort(),ge(!1)),e!==`lv`&&(ke.current?.abort(),Te(!1))},[]),qt=(0,M.useCallback)(()=>{if(!J||!_)return;let e=or(J.claims,_.threads,Ut);e.length!==0&&(Hr(),Kt(`none`),C(null),D(null),j(!1),H(!1),K(!1),ve(!1),De(!1),(Je||c)&&Be(e=>Math.max(e,60)),L(e))},[J,_,Ut,Je,c,Kt]),Jt=(0,M.useRef)(!1),Yt=(0,M.useRef)(qt);Yt.current=qt;let Xt=(0,M.useRef)(null);(0,M.useEffect)(()=>{!c||Jt.current||g!==`settled`||!J||!_||(Jt.current=!0,Xt.current=setTimeout(()=>Yt.current(),800))},[c,g,J,_]),(0,M.useEffect)(()=>()=>{Xt.current!==null&&clearTimeout(Xt.current)},[]),(0,M.useEffect)(()=>()=>se.current?.abort(),[]);let Zt=(0,M.useMemo)(()=>{let e=new Set;if(R)for(let t of R)for(let n of t.claimIds)e.add(n);return e},[R]),Qt=(0,M.useCallback)(()=>{if(V){H(!1);return}if(Kt(`recon`),K(!1),ve(!1),De(!1),j(!1),R){H(!0);return}if(!_||!v||!t)return;se.current?.abort();let e=new AbortController;se.current=e,B(!0);let n=_.claims.map(e=>({id:e.id,page:e.page,quote:e.quote}));Pr().then(({runReconcile:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||(oe(t),H(!0))}).catch(()=>{e.signal.aborted||oe([])}).finally(()=>{e.signal.aborted||B(!1)})},[V,R,_,v,t,Kt]);(0,M.useEffect)(()=>()=>fe.current?.abort(),[]);let $t=(0,M.useMemo)(()=>{let e=new Set;if(U)for(let t of U)e.add(t.claimId);return e},[U]),en=(0,M.useMemo)(()=>{let e=new Set;if(U)for(let t of U)t.status===`open`&&e.add(t.claimId);return e},[U]),tn=(0,M.useCallback)(e=>{de(e.id),Ft({doc:e.doc,page:e.anchorPage,quote:e.anchorQuote})},[Ft]),nn=(0,M.useCallback)(()=>{if(G){K(!1);return}if(Kt(`xe`),H(!1),ve(!1),De(!1),j(!1),U){K(!0);return}if(!_||!v||!t)return;fe.current?.abort();let e=new AbortController;fe.current=e,W(!0),K(!0);let n=_.claims.filter(e=>e.role===`load-bearing`).map(e=>({id:e.id,source:e.source,page:e.page,quote:e.quote,title:e.title}));Fr().then(({runCrossExam:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||ce(t)}).catch(()=>{e.signal.aborted||ce([])}).finally(()=>{e.signal.aborted||W(!1)})},[G,U,_,v,t,Kt]);(0,M.useEffect)(()=>()=>xe.current?.abort(),[]);let rn=(0,M.useMemo)(()=>{let e=new Set;if(pe)for(let t of pe)e.add(t.claimId);return e},[pe]),an=(0,M.useCallback)(e=>{be(e.claimId);let t=X.get(e.claimId);t&&Ft({doc:t.source,page:e.page,quote:e.predicted})},[X,Ft]),on=(0,M.useCallback)(()=>{if(_e){ve(!1);return}if(Kt(`fa`),H(!1),K(!1),De(!1),j(!1),pe){ve(!0);return}if(!_||!t||!n?.enabled)return;xe.current?.abort();let e=new AbortController;xe.current=e,ge(!0),ve(!0);let r=_.claims.filter(e=>e.kind===`forecast`).map(e=>({id:e.id,page:e.page,quote:e.quote}));Ir().then(({runAutopsy:i})=>i(r,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal})).then(t=>{e.signal.aborted||me(t)}).catch(()=>{e.signal.aborted||me([])}).finally(()=>{e.signal.aborted||ge(!1)})},[_e,pe,_,t,n,Kt]);(0,M.useEffect)(()=>()=>ke.current?.abort(),[]);let sn=(0,M.useMemo)(()=>{let e=new Set;if(Se)for(let t of Se.nodes)e.add(`${t.doc}:${t.page}`);return e},[Se]),cn=(0,M.useCallback)(e=>{Ft({doc:e.doc,page:e.page,quote:e.quote})},[Ft]),ln=(0,M.useCallback)(()=>{if(Ee){De(!1);return}if(Kt(`lv`),H(!1),K(!1),ve(!1),j(!1),Oe.current){De(!0);return}if(!_||!v||!t)return;ke.current?.abort();let e=new AbortController;ke.current=e,Oe.current=!0,Te(!0),De(!0);let n=_.claims.map(e=>({quote:e.quote,page:e.page,doc:e.source}));Lr().then(({runLevers:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||Ce(t)}).catch(()=>{e.signal.aborted||Ce(null)}).finally(()=>{e.signal.aborted||Te(!1)})},[Ee,_,v,t,Kt]);return(0,Q.jsxs)(`div`,{className:`prism-scrim`,"data-expanded":p?`true`:void 0,onClick:r,role:`button`,tabIndex:0,"aria-label":`Close Prism`,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),r())},children:[(0,Q.jsxs)(`section`,{className:`prism-panel`,role:`dialog`,"aria-label":`Prism`,"data-phase":g,ref:Ue,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:d?`${l.length} documents`:l[0].name}),_&&(0,Q.jsxs)(`span`,{className:`prism-file-pages`,children:[`· `,_.pageCount,` pages`]})]}),(0,Q.jsxs)(`div`,{className:`prism-head-right`,children:[Z&&o&&(0,Q.jsx)(`div`,{className:`syn-lenses`,role:`tablist`,"aria-label":`Lens`,children:[[`all`,`All`,0],[`contradictions`,`Contradictions`,o.counts.contradictions],[`gaps`,`Gaps`,o.counts.gaps],[`consensus`,`Consensus`,o.counts.consensus]].map(([e,t,n])=>(0,Q.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":o.lens===e,className:`syn-lens`+(o.lens===e?` is-active`:``),onClick:()=>{gt(null),o.setLens(e)},children:[t,n>0&&(0,Q.jsx)(`span`,{className:`syn-lens-n`,children:n})]},e))}),Z&&y>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:y}),` read · `,(0,Q.jsx)(`strong`,{children:Ct}),` grounded`,y>Ct?(0,Q.jsxs)(Q.Fragment,{children:[` `,`· `,(0,Q.jsx)(`strong`,{children:y-Ct}),` dropped`]}):null]}),(0,Q.jsxs)(`span`,{className:`prism-phase`,"data-active":g===`igniting`||g===`blooming`,title:xt,children:[(0,Q.jsx)(`span`,{className:`prism-phase-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-phase-label`,children:xt})]}),Z&&(0,Q.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:()=>{D(null),C(null),T({doc:0,page:1})},"aria-label":`Read the whole document, page by page`,title:`Read the whole document, page by page`,children:[`▤`,(0,Q.jsx)(`span`,{className:`prism-replay-label`,children:` Read document`})]}),Z&&(0,Q.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:wt,"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:()=>m(e=>!e),"aria-label":p?`Exit full screen`:`Expand to full screen`,title:p?`Exit full screen`:`Full screen`,children:p?`⤡`:`⤢`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-close`,onClick:r,"aria-label":`Close Prism`,children:`✕`})]})]}),d&&Z&&_&&(0,Q.jsxs)(`div`,{className:`prism-legend`,role:`list`,"aria-label":`Documents`,children:[_.documents.map((e,t)=>{let n=_.claims.filter(e=>e.source===t).length;return(0,Q.jsxs)(`span`,{className:`prism-legend-item`,role:`listitem`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-swatch`,style:{background:Yr[t%Yr.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)}),mt>0&&(0,Q.jsxs)(`span`,{className:`prism-legend-cross`,children:[mt,` cross-document link`,mt===1?``:`s`]})]}),(0,Q.jsxs)(`div`,{className:`prism-split`,"data-split":zt?`true`:void 0,"data-pdfonly":zt&&ze>=99?`true`:void 0,ref:Ve,children:[(0,Q.jsxs)(`div`,{className:`prism-stage`+(Y.panning?` is-panning`:``),ref:lt,onWheel:Z?Y.onWheel:void 0,onPointerDown:Z?Y.onPointerDown:void 0,onPointerMove:Z?Y.onPointerMove:void 0,onPointerUp:Z?Y.onPointerUp:void 0,onPointerCancel:Z?Y.onPointerUp:void 0,onClickCapture:e=>{Y.movedRef.current&&(e.stopPropagation(),e.preventDefault(),Y.movedRef.current=!1)},children:[(g===`idle`||g===`igniting`)&&(0,Q.jsxs)(`div`,{className:`prism-doc`,"data-igniting":g===`igniting`,"aria-hidden":`true`,children:[(0,Q.jsxs)(`div`,{className:`prism-doc-page`,children:[(0,Q.jsx)(`span`,{className:`prism-doc-eyebrow`,children:d?`DOCUMENTS`:`DOCUMENT`}),(0,Q.jsx)(`span`,{className:`prism-doc-title`,children:d?`${l.length} documents`:l[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))})]}),g===`igniting`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`prism-shock`}),ei.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))]})]}),g===`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…`})]}),g===`error`&&(0,Q.jsxs)(`div`,{className:`prism-error`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`prism-error-msg`,children:b}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-error-retry`,onClick:wt,children:`Try again`})]}),Z&&J&&(0,Q.jsxs)(`div`,{className:`prism-world`,"data-briefing":Vt?`true`:void 0,style:{width:J.width,height:J.height,transform:Y.transform},children:[J.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)),J.links.length>0&&(0,Q.jsx)(`svg`,{className:`prism-links`,width:J.width,height:J.height,"aria-hidden":`true`,children:J.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)})}),_&&_.threads.length>0&&(0,Q.jsx)(`svg`,{className:`prism-threads`,width:J.width,height:J.height,"aria-hidden":`true`,children:_.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`+(Ae===`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:[Kr[e.relation],e.crossDoc?` across docs`:` · p.${n.page}↔p.${r.page}`]})})]},t)})}),V&&R&&R.length>0&&(0,Q.jsx)(`svg`,{className:`prism-threads prism-recon`,width:J.width,height:J.height,"aria-hidden":`true`,children:R.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)})}),J.claims.map(e=>{let t=Wr[e.kind],n=S===e.id,r=We.get(e.id),i=_?.threads.find(t=>t.a===e.id||t.b===e.id),a=r?.citation?f(r.citation.url):null,s=!!i,c=i?i.relation===`agrees`?`var(--insight)`:i.relation===`in-tension`?`var(--warning)`:`var(--danger)`:t.color,l=Ae===`contra`&&!s,u=O.has(`${e.source}:${e.page}`),d=!!E&&O.size>0&&!u,p=re.has(e.id),m=Vt&&re.size>0&&!p,h=V&&Zt.has(e.id),g=V&&Zt.size>0&&!h,v=G&&en.has(e.id),y=G&&en.size>0&&!$t.has(e.id),b=_e&&rn.has(e.id),x=_e&&rn.size>0&&!b,w=Ee&&sn.has(`${e.source}:${e.page}`),k=Ee&&sn.size>0&&!w,A=!!o&&(bt===`gaps`?!0:bt===`contradictions`?!_t.has(e.id):bt===`consensus`?!yt.has(e.id):!1),j=()=>{Vt||(T(null),D(null),gt(null),C(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||p||h||b||w?` is-cited`:``)+(v?` is-objected`:``)+(l||d||m||g||y||x||k||A?` is-dim`:``),"data-role":e.role,style:{left:e.x,top:e.y,"--kind-color":c},onClick:j,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),j())},children:[(0,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":In[r.verdict].token},children:[(0,Q.jsx)(`span`,{className:`prism-seal-dot`,"aria-hidden":`true`}),In[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:[Xr(i.relation,i.crossDoc),` — follow the thread`]}),r&&(0,Q.jsxs)(`span`,{className:`prism-claim-verdict`,"data-verdict":r.verdict,style:{"--seal-color":In[r.verdict].token},children:[(0,Q.jsxs)(`span`,{className:`prism-verdict-head`,children:[(0,Q.jsx)(`span`,{className:`prism-verdict-label`,children:In[r.verdict].label}),(0,Q.jsx)(`span`,{className:`prism-verdict-note`,children:r.note})]}),r.citation&&a&&(0,Q.jsxs)(`a`,{className:`prism-verdict-cite`,href:a,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":Zr(i),children:Qr(i)})]},e.id)}),o&&(0,Q.jsxs)(Q.Fragment,{children:[o.consensus.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`syn-consensus`+(bt!==`all`&&bt!==`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||(C(null),gt({kind:`consensus`,id:e.id}))},children:(0,Q.jsxs)(`span`,{className:`syn-consensus-badge`,children:[e.sourceCount,` of `,e.corpusSize,` agree`]})},e.id)),o.contradictions.map(e=>{let t=bt!==`all`&&bt!==`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||(C(null),gt({kind:`contradiction`,id:e.id}))},children:[(0,Q.jsx)(`span`,{className:`syn-obj-dot`,"aria-hidden":`true`}),e.label]},e.id)}),o.gaps.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`syn-obj syn-gap`+(bt!==`all`&&bt!==`gaps`?` is-dim`:``),style:{left:e.x,top:e.y},onClick:()=>{Y.movedRef.current||(C(null),gt({kind:`gap`,id:e.id}))},children:e.label},e.id))]})]}),Z&&(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:`⤢`})]}),Z&&ee&&Lt&&(0,Q.jsx)(s,{label:`Document ask`,children:(0,Q.jsx)(Or,{open:A&&!Vt&&!G&&!_e&&!Ee,ctx:Lt,seed:te,onAnswer:It,onFocusSpan:Ft,activeSpan:E,multiDoc:d,docLabel:Mt,onClose:()=>j(!1)},F)}),Z&&ne&&(0,Q.jsx)(s,{label:`Briefing`,children:(0,Q.jsx)(kr,{beats:ne,onBeat:Wt,onExit:Gt})}),Z&&G&&!Vt&&(0,Q.jsx)(s,{label:`Cross-examination`,children:(0,Q.jsx)(Ar,{objections:U??[],busy:le,onFocusObjection:tn,activeId:ue,multiDoc:d,docLabel:Mt,onClose:()=>K(!1)})}),Z&&_e&&!Vt&&(0,Q.jsx)(s,{label:`Forecast review`,children:(0,Q.jsx)(jr,{grades:pe??[],busy:he,onFocusForecast:an,activeId:ye,onClose:()=>ve(!1)})}),Z&&Ee&&!Vt&&(0,Q.jsx)(s,{label:`Live levers`,children:(0,Q.jsx)(Mr,{model:Se,busy:we,onFocusNode:cn,onClose:()=>De(!1)})})]}),zt&&(0,Q.jsx)(`div`,{className:`prism-divider`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the map and the source page`,tabIndex:0,onPointerDown:rt,onPointerMove:it,onPointerUp:at,onPointerCancel:at,onKeyDown:e=>{e.key===`ArrowLeft`?Be(e=>Math.min(100,e+4)):e.key===`ArrowRight`&&Be(e=>Math.max(24,e-4))},children:(0,Q.jsx)(`span`,{className:`prism-divider-grip`,"aria-hidden":`true`})}),$&&Z&&l[$.source]&&(()=>{let e=l[$.source],t=_?.documents[$.source]?.slideImages,n=_?.documents[$.source]?.pageCount??1;return(0,Q.jsxs)(`div`,{className:`prism-page-wrap`,style:{"--pdf-pct":`${ze}%`},children:[(0,Q.jsx)(Fn,{pdf:e,slideImages:t,source:$.source,page:$.page,quote:$.quote,color:$.color,also:$.also,note:$.penExplain,penOn:Je,penColor:$.penColor,penAccent:$.penAccent,onAnnotated:Bt,kindLabel:$.kindLabel,isFigure:$.isFigure,docName:d?e.name:void 0,title:$.title,connections:$.connections,onNavigate:e=>{T(null),D(null),C(e)},onClose:()=>{T(null),D(null),C(null)},pageCount:n,onPageChange:e=>{let t=Math.min(n,Math.max(1,e));D(null),C(null),T({doc:$.source,page:t})}}),Je&&!Vt&&$.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:()=>Ze(e=>!e),"aria-pressed":Xe,title:Xe?`Mute narration`:`Read it aloud`,children:Xe?`🔊`:`🔇`})]})]})})(),ht&&Z&&o&&(0,Q.jsx)(`div`,{className:`prism-page-wrap syn-detail-panel`,style:{"--pdf-pct":`${ze}%`},children:(0,Q.jsxs)(`div`,{className:`syn-detail`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-page-close syn-detail-close`,onClick:()=>gt(null),"aria-label":`Close`,children:`✕`}),ht.kind===`contradiction`&&(()=>{let e=o.contradictions.find(e=>e.id===ht.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:()=>{gt(null),C(e.id)},children:[(0,Q.jsxs)(`span`,{className:`syn-tape-cite`,children:[o.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:()=>{N(!0),j(!0),P(t=>({id:(t?.id??0)+1,question:e.seedQuestion}))},children:`Interrogate — are these comparable?`})]})})(),ht.kind===`gap`&&(()=>{let e=o.gaps.find(e=>e.id===ht.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})(),ht.kind===`consensus`&&(()=>{let e=o.consensus.find(e=>e.id===ht.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:()=>{gt(null),C(e)},children:[(0,Q.jsxs)(`span`,{className:`syn-tape-cite`,children:[o.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})()]})})]}),Z&&!z&&!V&&(Ke||jt)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":Ke?`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:Ke?`Checking the key claims against the public record…`:jt})]}),Z&&(z||V)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":z?`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:z?`Checking the document’s own numbers against each other…`:R&&R.length>0?`${R.length===1?`A number doesn’t`:`${R.length} numbers don’t`} add up — the document’s own figures disagree`:`Every number checks out — the document’s figures are consistent.`})]}),Z&&(0,Q.jsxs)(`footer`,{className:`prism-foot`,children:[(0,Q.jsxs)(`span`,{className:`prism-foot-stat`,children:[Ct,` claim`,Ct===1?``:`s`,` · `,J?.regions.length??0,` region`,(J?.regions.length??0)===1?``:`s`,` · every card cites a real page`,y>Ct?` · ${y-Ct} 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`+(A?` is-active`:` prism-foot-btn--primary`),onClick:()=>{A||(H(!1),K(!1),ve(!1),De(!1)),A||N(!0),j(e=>!e)},...a(Sr.preload),"aria-pressed":A,title:`Ask the document a question — the answer lights up the exact lines`,children:A?`Hide ask`:`Ask the document`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Vt?` is-active`:``),onClick:Vt?Gt:qt,...a(Cr.preload),disabled:!J||J.claims.length===0,"aria-pressed":Vt,title:`Play a silent, captioned flight through the document's argument — ending on its weakest point`,children:Vt?`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`+(V?` is-active`:``),onClick:Qt,...a(()=>Pr().then(()=>void 0)),disabled:z||!t||!_||_.claims.length===0,"aria-pressed":V,title:`Check the document's own figures against each other — flags numbers that don't add up, computed in pure code`,children:z?`Checking…`:V?`Hide numbers`:`Check the numbers`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(G?` is-active`:``),onClick:nn,...a(()=>Promise.all([wr.preload(),Fr()]).then(()=>void 0)),disabled:le||!t||!_||_.claims.filter(e=>e.role===`load-bearing`).length===0,"aria-pressed":G,title:`Raise the sharpest objection to each load-bearing claim — and show only the ones the document never answers`,children:le?`Examining…`:G?`Hide objections`:`Cross-examine`}),_&&_.claims.some(e=>e.kind===`forecast`)&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(_e?` is-active`:``),onClick:on,...a(()=>Promise.all([Tr.preload(),Ir()]).then(()=>void 0)),disabled:he||!t||!n?.enabled,"aria-pressed":_e,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:he?`Grading…`:_e?`Hide forecasts`:`Grade forecasts`}),_&&_.claims.some(e=>/\d/.test(e.quote))&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Ee?` is-active`:``),onClick:ln,...a(()=>Promise.all([Er.preload(),Lr()]).then(()=>void 0)),disabled:we||!t||!v,"aria-pressed":Ee,title:`Find the model implied under the document and drag its assumptions — every figure traces to a page, the conclusion recomputes live`,children:we?`Modeling…`:Ee?`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`+(Ae===`contra`?` is-active`:``),onClick:()=>je(e=>e===`contra`?`map`:`contra`),disabled:!_||_.threads.length===0,title:_&&_.threads.length===0?d?`No links found between these documents`:`No contradictions found in this document`:void 0,children:_&&_.threads.length>0?d?`Show links (${_.threads.length})`:`Find contradictions (${_.threads.length})`:d?`No links`:`No contradictions`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:Rt,...a(()=>Promise.all([Dr.preload(),Rr()]).then(()=>void 0)),disabled:!t||!v||Pe!==null,title:`Explode this document into a causal web — every link traces to a page`,children:Pe===`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`+(Je?` is-active`:``),onClick:()=>Ye(e=>!e),"aria-pressed":Je,title:`Annotate — Mavéa draws a pen mark over the cited lines and explains, on every question, claim, and briefing beat`,children:Je?`Pen on`:`Annotate`}),_&&(0,Q.jsx)(xr,{steps:et,spec:_,pdfs:l,cfg:t,placed:J?.claims,verdicts:Ut})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group prism-foot-group--quiet`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:()=>je(`map`),children:`Reset view`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Le?` is-active`:``),onClick:()=>Re(e=>!e),"aria-pressed":Le,children:`Legend`})]})]})]}),Z&&Le&&(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:qr.map(e=>(0,Q.jsxs)(`li`,{className:`prism-legend-kind`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-kind-dot`,style:{background:Wr[e.kind].color},"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-legend-kind-name`,children:Wr[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:Jr.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.`]})]})]}),!Z&&g!==`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.`})})]}),Me&&(0,Q.jsx)(s,{label:`Why map`,overlay:!0,children:(0,Q.jsx)(Nr,{dag:Me,onClose:()=>Ne(null)})})]})}var ei=[{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{$r as PrismOverlay,Ft as a,We as c,ae as d,or as i,H as l,_r as n,Dt as o,dr as r,Ue as s,mr as t,fe as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DaSxXjOY.js";import{ht as t}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-DaSxXjOY.js";import{ht as t}from"./index-Dbr1j8Fe.js";import{t as n}from"./LegalMarkdownDocument-DBjLz9Yf.js";var r=t(),i=`# Mavéa Privacy Notice
|
|
2
2
|
|
|
3
3
|
Effective: July 19, 2026
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-Dbr1j8Fe.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";var i=e(),a=n(),o=t();function s(e){let t=(0,a.c)(34),{model:n,onJump:s,onShare:l,onClose:u}=e,d=(0,i.useRef)(null);r(d);let f,p;t[0]===u?(f=t[1],p=t[2]):(f=()=>{let e=e=>{e.key===`Escape`&&u()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},p=[u],t[0]=u,t[1]=f,t[2]=p),(0,i.useEffect)(f,p);let m;t[3]===u?m=t[4]:(m=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),u())},t[3]=u,t[4]=m);let h;t[5]===n.heading?h=t[6]:(h=(0,o.jsx)(`h2`,{className:`recap-title voice-text`,children:n.heading}),t[5]=n.heading,t[6]=h);let g;t[7]===n.meta?g=t[8]:(g=(0,o.jsx)(`p`,{className:`recap-meta`,children:n.meta}),t[7]=n.meta,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,o.jsxs)(`header`,{className:`recap-head`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;if(t[12]!==n.rows||t[13]!==s){let e;t[15]===s?e=t[16]:(e=e=>(0,o.jsx)(`li`,{children:(0,o.jsxs)(`button`,{type:`button`,className:`recap-row`,onClick:()=>s(e.frameIndex),children:[(0,o.jsxs)(`span`,{className:`recap-row-key`,children:[e.title,(0,o.jsx)(`span`,{className:`recap-row-clock`,children:e.clock})]}),(0,o.jsx)(`span`,{className:`recap-row-line`,children:e.line}),e.corrected&&(0,o.jsx)(`span`,{className:`recap-row-corrected`,children:e.corrected})]})},e.frameIndex),t[15]=s,t[16]=e),v=n.rows.map(e),t[12]=n.rows,t[13]=s,t[14]=v}else v=t[14];let y;t[17]===v?y=t[18]:(y=(0,o.jsx)(`ul`,{className:`recap-rows`,children:v}),t[17]=v,t[18]=y);let b;t[19]===l?b=t[20]:(b=l&&(0,o.jsx)(`button`,{type:`button`,className:`recap-share`,onClick:l,children:`Share as Story`}),t[19]=l,t[20]=b);let x;t[21]===u?x=t[22]:(x=(0,o.jsx)(`button`,{type:`button`,className:`recap-keep`,onClick:u,children:`Keep talking`}),t[21]=u,t[22]=x);let S;t[23]!==x||t[24]!==b?(S=(0,o.jsxs)(`footer`,{className:`recap-actions`,children:[b,x]}),t[23]=x,t[24]=b,t[25]=S):S=t[25];let C;t[26]!==S||t[27]!==_||t[28]!==y?(C=(0,o.jsxs)(`section`,{className:`recap-panel`,ref:d,tabIndex:-1,role:`dialog`,"aria-label":`Session recap`,onClick:c,children:[_,y,S]}),t[26]=S,t[27]=_,t[28]=y,t[29]=C):C=t[29];let w;return t[30]!==u||t[31]!==C||t[32]!==m?(w=(0,o.jsx)(`div`,{className:`recap-scrim`,onClick:u,role:`button`,tabIndex:0,"aria-label":`Close session recap`,onKeyDown:m,children:C}),t[30]=u,t[31]=C,t[32]=m,t[33]=w):w=t[33],w}function c(e){return e.stopPropagation()}export{s as Recap};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-Dbr1j8Fe.js";import{d as r,f as i,i as a,n as o,r as s,t as c}from"./geometry-DXAbnb0J.js";var l=n(),u=e(),d=t();function f(e){let t=(0,l.c)(19),{size:n}=e,f=(0,u.useId)(),g;if(t[0]!==f){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\W/g,t[2]=e):e=t[2],g=f.replace(e,``),t[0]=f,t[1]=g}else g=t[1];let _=`reel-jelly-${g}`,v,y,b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,d.jsx)(`stop`,{className:`reel-jelly-stop s1`,offset:`0`}),y=(0,d.jsx)(`stop`,{className:`reel-jelly-stop s2`,offset:`0.55`}),b=(0,d.jsx)(`stop`,{className:`reel-jelly-stop s3`,offset:`1`}),t[3]=v,t[4]=y,t[5]=b):(v=t[3],y=t[4],b=t[5]);let x;t[6]===_?x=t[7]:(x=(0,d.jsx)(`defs`,{children:(0,d.jsxs)(`linearGradient`,{id:_,x1:`40`,y1:`60`,x2:`160`,y2:`104`,gradientUnits:`userSpaceOnUse`,children:[v,y,b]})}),t[6]=_,t[7]=x);let S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,d.jsx)(`g`,{className:`reel-jelly-strands`,children:i.map(h)}),t[8]=S):S=t[8];let C=`url(#${_})`,w;t[9]===C?w=t[10]:(w=(0,d.jsx)(`path`,{className:`reel-jelly-bell`,d:c,fill:C}),t[9]=C,t[10]=w);let T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,d.jsx)(`path`,{className:`reel-jelly-sheen`,d:o}),t[11]=T):T=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,d.jsxs)(`g`,{className:`reel-jelly-face`,children:[s.map(m),a.map(p),(0,d.jsx)(`path`,{className:`reel-jelly-smile`,d:r})]}),t[12]=E):E=t[12];let D;t[13]!==x||t[14]!==w?(D=(0,d.jsxs)(`svg`,{viewBox:`0 0 200 220`,focusable:`false`,children:[x,S,w,T,E]}),t[13]=x,t[14]=w,t[15]=D):D=t[15];let O;return t[16]!==n||t[17]!==D?(O=(0,d.jsx)(`div`,{className:`reel-jelly`,"data-size":n,"aria-hidden":`true`,children:D}),t[16]=n,t[17]=D,t[18]=O):O=t[18],O}function p(e){let{side:t,x:n}=e;return(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`circle`,{className:`reel-jelly-ball`,cx:n,cy:72,r:9}),(0,d.jsx)(`circle`,{className:`reel-jelly-pupil`,cx:n,cy:72.7,r:5.2}),(0,d.jsx)(`circle`,{className:`reel-jelly-glint`,cx:n+2.5,cy:69.3,r:2.3})]},t)}function m(e){let{side:t,cx:n,cy:r}=e;return(0,d.jsx)(`ellipse`,{className:`reel-jelly-cheek`,cx:n,cy:r,rx:8,ry:5},t)}function h(e,t){return(0,d.jsx)(`path`,{className:`c${t+1}`,d:e},t)}export{f as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-eJ6sdMpf.js","assets/chunk-BVpWp9h4.js","assets/index-Dbr1j8Fe.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ReelJelly-LWeMsFpj.js","assets/geometry-DXAbnb0J.js","assets/registry-BdMZ_4cm.js","assets/fit-CuHWhwsj.js","assets/share-QHGHNDhQ.js","assets/icons-CHVz6kv_.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/spokenText-D4zPX9JY.js","assets/toast-BBNs2h3L.js","assets/threads-CkMgrSDP.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-DsmNzulR.js","assets/ShareModal-PobtP7AJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{I as r,J as i,L as a,ht as o,k as s,mt as c,q as l}from"./index-Dbr1j8Fe.js";import{n as u}from"./icons-CHVz6kv_.js";import"./ShareModal-eJ6sdMpf.js";import"./annotationReel-B5A2RZkx.js";var d=t(),f=o(),p=c();function m(e){if(!e||!e.blocks?.length)return[];let t=e.blocks.map((e,t)=>({index:t}));return[{question:e.opener||e.title||``,narration:e.found||e.sub||e.opener||e.title||``,mode:`replace`,tour:t,spec:e,at:0}]}var h=n();i();var g=r(()=>l(()=>import(`./ShareModal-eJ6sdMpf.js`).then(e=>e.t).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]))),_=g.Component;function v(e){let t=(0,f.c)(9),{frames:n,spec:r}=e,[i,o]=(0,d.useState)(!1),c;t[0]!==n||t[1]!==r?(c=n??(r?m(r):[]),t[0]=n,t[1]=r,t[2]=c):c=t[2];let l=c;if(!l.length)return null;let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,h.jsx)(`button`,{type:`button`,style:y,onClick:()=>o(!0),...a(g.preload),children:`✨ Share as a story`}),t[3]=u):u=t[3];let v;t[4]!==i||t[5]!==l?(v=i&&(0,p.createPortal)((0,h.jsx)(s,{label:`Share story`,overlay:!0,children:(0,h.jsx)(_,{frames:l,onClose:()=>o(!1)})}),document.body),t[4]=i,t[5]=l,t[6]=v):v=t[6];let b;return t[7]===v?b=t[8]:(b=(0,h.jsxs)(h.Fragment,{children:[u,v]}),t[7]=v,t[8]=b),b}var y={display:`inline-flex`,alignItems:`center`,gap:8,padding:`10px 18px`,borderRadius:`var(--r-full)`,border:`none`,background:`var(--presence)`,color:`#fff`,font:`650 14px/1 var(--font)`,cursor:`pointer`,alignSelf:`flex-start`},b=e({ReplayCard:()=>x});function x(e){let t=(0,f.c)(12),{delay:n,line:r,spec:i}=e,a=(n||0)+`ms`,o;t[0]===a?o=t[1]:(o={"--delay":a},t[0]=a,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,h.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,h.jsx)(u.play,{className:`ic`,style:{color:`var(--presence-soft)`}}),` Mavéa Replay`]}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={fontSize:17,marginBottom:14},t[3]=l):l=t[3];let d=r||`“I dropped in 3 statements. Mavéa showed me where my money went in 20 seconds.”`,p;t[4]===d?p=t[5]:(p=(0,h.jsx)(`div`,{className:`insight-title`,style:l,children:d}),t[4]=d,t[5]=p);let m;t[6]===i?m=t[7]:(m=i&&(0,h.jsx)(v,{spec:i}),t[6]=i,t[7]=m);let g;return t[8]!==s||t[9]!==p||t[10]!==m?(g=(0,h.jsxs)(`div`,{className:`card replay-card reveal`,style:s,children:[c,p,m]}),t[8]=s,t[9]=p,t[10]=m,t[11]=g):g=t[11],g}export{b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./TopicCanvas-
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./TopicCanvas-DX0Z1ZHv.js";import"./canvas-BuMP6u6i.js";import{t as r}from"./generateBeats-b64CL54v.js";var i=e();function a(e){let t=[];for(let n of e.tour){let r=e.spec.blocks[n.index]?.id;r&&t.push(n.say?{spot:r,say:n.say}:{spot:r})}return t}function o(e){let t=a(e),n=r(e.spec.blocks,{opener:e.narration,...t.length?{tour:t}:{}});return{spec:e.spec,say:e.spoken??e.narration,beats:n}}function s(e,t=0){let n=Math.max(0,Math.min(t,e.length));return e.slice(n).map(o)}var c=t(),l=700;function u({frames:e,initialIndex:t,speak:r,cancelSpeak:a,onClose:o}){let[u,d]=(0,i.useState)(()=>Math.min(Math.max(0,t),e.length-1)),[f,p]=(0,i.useState)(null),[m,h]=(0,i.useState)(!1),[g,_]=(0,i.useState)(()=>e[t]?.spec??null),v=(0,i.useRef)(null),y=(0,i.useRef)(null),b=e[u]??null,x=(0,i.useCallback)(()=>{y.current?.(),y.current=null,a?.(),h(!1),p(null)},[a]),S=(0,i.useCallback)((e,t)=>{if(x(),!e.length)return;let n=!1,i;y.current=()=>{n=!0,i&&clearTimeout(i)},h(!0);let o=0,s=()=>{if(n)return;if(o>=e.length){h(!1),p(null);return}let c=e[o];d(t+o),_(c.spec),a?.(),c.say&&r?.(c.say);let u=0,f=()=>{if(n)return;if(u>=c.beats.length){o+=1,i=setTimeout(s,l);return}let e=c.beats[u++];e.set&&`spot`in e.set&&p(e.set.spot??null),i=setTimeout(f,e.ms??0)};f()};s()},[x,r,a]),C=(0,i.useCallback)(()=>{b&&S(s([b],0),u)},[b,u,S]),w=(0,i.useCallback)(()=>{S(s(e,u),u)},[e,u,S]),T=(0,i.useCallback)(()=>{d(0),S(s(e,0),0)},[e,S]),E=(0,i.useCallback)(t=>{x(),d(t),_(e[t]?.spec??null)},[e,x]);return(0,i.useEffect)(()=>{if(!f)return;let e=window.setTimeout(()=>{let e=v.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)},[f]),(0,i.useEffect)(()=>()=>x(),[x]),!b||!g?null:(0,c.jsxs)(`div`,{onClick:()=>{x(),o()},role:`button`,tabIndex:0,"aria-label":`Close replay overlay`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),x(),o())},style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.6)`,zIndex:60,display:`flex`,padding:20,gap:16},children:[(0,c.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),e.stopPropagation())},style:{flex:`0 0 240px`,display:`flex`,flexDirection:`column`,gap:8,overflow:`auto`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:12,padding:12},children:[(0,c.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,c.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Conversation`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:12},onClick:()=>{x(),o()},children:`← Live`})]}),e.map((e,t)=>{let n=t===u;return(0,c.jsxs)(`button`,{onClick:()=>E(t),title:e.question,style:{textAlign:`left`,padding:`8px 10px`,borderRadius:8,border:`1px solid `+(n?`var(--presence)`:`var(--line)`),background:n?`var(--surface-elevated)`:`transparent`,cursor:`pointer`,color:`inherit`,font:`inherit`,display:`flex`,flexDirection:`column`,gap:2},children:[(0,c.jsxs)(`span`,{style:{fontSize:12.5,fontWeight:n?600:400,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[t+1,`. `,e.question||e.spec.title]}),(0,c.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-muted)`},children:[e.spec.blocks.length,` cards`,e.mode===`replace`?``:` · ${e.mode}`]})]},t)})]}),(0,c.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),e.stopPropagation())},style:{flex:1,display:`flex`,flexDirection:`column`,gap:10,minWidth:0},children:[(0,c.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexWrap:`wrap`},children:[(0,c.jsx)(`span`,{className:`faint`,style:{fontSize:12.5,marginRight:`auto`},children:b.spec.title}),m?(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:x,children:`◼ Stop`}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:C,children:`▶ Replay this`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:w,children:`▶ From here`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:T,children:`▶ From start`})]})]}),(0,c.jsx)(`div`,{ref:v,className:`canvas-scroll`,style:{flex:1,overflow:`auto`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:12,padding:16},children:(0,c.jsx)(`div`,{className:`topic-wrap`,children:(0,c.jsx)(n,{data:g,spot:f,built:{},onProve:()=>{}})})})]})]})}export{u as ReplayOverlay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-C7H7A1rW.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";import{t as i}from"./motion-dfA87zbb.js";import{o as a}from"./useStudy-Diy4ITBm.js";import{C as o}from"./dashboardEvents-C_XvGVLJ.js";import{n as s,o as c,r as l}from"./CheckLogRail-DNtXlkcR.js";import{r as u}from"./predictions-CYS7Vo39.js";var d=e(),f=n(),p=10080*60*1e3,m=20;function h(e,t){return e.reduce((e,n)=>{let r=u(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=t(),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=s(r),t[0]=r,t[1]=i);let a=i,o=a?.tone??`plain`,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`The moment that mattered`}),t[2]=c):c=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(110),t[3]=u):u=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:[c,(0,b.jsxs)(`div`,{className:`rw-moment rw-child`,"data-tone":o,style:u,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),s;t[0]===n?s=t[1]:(s={onEscape:n},t[0]=n,t[1]=s),r(i,s);let[l]=(0,d.useState)(ie),u=c(),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-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-Dbr1j8Fe.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";import{t as i}from"./motion-luJxBPnj.js";import{o as a}from"./useStudy-DHRIx8p-.js";import{C as o}from"./dashboardEvents-Be4sftHN.js";import{n as s,o as c,r as l}from"./CheckLogRail-C6nouD1Y.js";import{r as u}from"./predictions-CYS7Vo39.js";var d=e(),f=n(),p=10080*60*1e3,m=20;function h(e,t){return e.reduce((e,n)=>{let r=u(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=t(),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=s(r),t[0]=r,t[1]=i);let a=i,o=a?.tone??`plain`,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`The moment that mattered`}),t[2]=c):c=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(110),t[3]=u):u=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:[c,(0,b.jsxs)(`div`,{className:`rw-moment rw-child`,"data-tone":o,style:u,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),s;t[0]===n?s=t[1]:(s={onEscape:n},t[0]=n,t[1]=s),r(i,s);let[l]=(0,d.useState)(ie),u=c(),p=a(),m;t[2]!==u||t[3]!==l?(m=o(u,l),t[2]=u,t[3]=l,t[4]=m):m=t[4];let x=m,S;t[5]!==p||t[6]!==l?(S=h(p,l),t[5]=p,t[6]=l,t[7]=S):S=t[7];let C=S,w;t[8]!==p||t[9]!==l?(w=g(p,l),t[8]=p,t[9]=l,t[10]=w):w=t[10];let E=w,D;t[11]!==p||t[12]!==l?(D=_(p,l),t[11]=p,t[12]=l,t[13]=D):D=t[13];let k=D,A;t[14]!==x||t[15]!==C?(A=v(x,C),t[14]=x,t[15]=C,t[16]=A):A=t[16];let j=A,M;t[17]===j?M=t[18]:(M=y(j),t[17]=j,t[18]=M);let N=M,[P,F]=(0,d.useState)(0),I,L;t[19]===N.length?(I=t[20],L=t[21]):(I=()=>{F(e=>Math.min(e,N.length-1))},L=[N.length],t[19]=N.length,t[20]=I,t[21]=L),(0,d.useEffect)(I,L);let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>F(re),t[22]=R):R=t[22];let z=R,B;t[23]===N.length?B=t[24]:(B=()=>F(e=>Math.min(N.length-1,e+1)),t[23]=N.length,t[24]=B);let V=B,H;t[25]===V?H=t[26]:(H=e=>{e.key===`ArrowRight`||e.key===` `?(e.preventDefault(),V()):e.key===`ArrowLeft`&&(e.preventDefault(),z())},t[25]=V,t[26]=H);let U=H,W=N.length>1,G;t[27]!==W||t[28]!==P||t[29]!==N.length?(G=W&&(0,b.jsxs)(`span`,{className:`rw-counter`,"aria-live":`polite`,children:[P+1,` of `,N.length]}),t[27]=W,t[28]=P,t[29]=N.length,t[30]=G):G=t[30];let K;t[31]===n?K=t[32]:(K=(0,b.jsx)(`button`,{type:`button`,className:`rw-close`,onClick:n,"aria-label":`Close`,children:`×`}),t[31]=n,t[32]=K);let q;t[33]!==G||t[34]!==K?(q=(0,b.jsxs)(`div`,{className:`rw-chrome`,children:[G,K]}),t[33]=G,t[34]=K,t[35]=q):q=t[35];let J;t[36]!==W||t[37]!==P?(J=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--prev`,"aria-label":`Previous slide`,onClick:z,disabled:P===0}),t[36]=W,t[37]=P,t[38]=J):J=t[38];let Y;if(t[39]!==E||t[40]!==P||t[41]!==k||t[42]!==x||t[43]!==N||t[44]!==C){let e;t[46]!==E||t[47]!==P||t[48]!==k||t[49]!==x||t[50]!==C?(e=(e,t)=>(0,b.jsxs)(`div`,{className:`rw-slide`,"data-active":t===P||void 0,children:[e===`searches`&&(0,b.jsx)(T,{rewind:x}),e===`moment`&&(0,b.jsx)(ee,{rewind:x}),e===`calls`&&(0,b.jsx)(O,{tally:C,grades:E,quote:k}),e===`saved`&&(0,b.jsx)(te,{rewind:x}),e===`fallback`&&(0,b.jsx)(ne,{})]},e),t[46]=E,t[47]=P,t[48]=k,t[49]=x,t[50]=C,t[51]=e):e=t[51],Y=N.map(e),t[39]=E,t[40]=P,t[41]=k,t[42]=x,t[43]=N,t[44]=C,t[45]=Y}else Y=t[45];let X;t[52]!==W||t[53]!==V||t[54]!==P||t[55]!==N.length?(X=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--next`,"aria-label":`Next slide`,onClick:V,disabled:P===N.length-1}),t[52]=W,t[53]=V,t[54]=P,t[55]=N.length,t[56]=X):X=t[56];let Z;t[57]!==J||t[58]!==Y||t[59]!==X?(Z=(0,b.jsxs)(`div`,{className:`rw-stage`,children:[J,Y,X]}),t[57]=J,t[58]=Y,t[59]=X,t[60]=Z):Z=t[60];let Q;t[61]!==W||t[62]!==P||t[63]!==N?(Q=W&&(0,b.jsx)(`div`,{className:`rw-dots`,children:N.map((e,t)=>(0,b.jsx)(`button`,{type:`button`,className:`rw-dot`,"data-active":t===P||void 0,"aria-label":`Go to slide ${t+1} of ${N.length}`,onClick:()=>F(t)},e))}),t[61]=W,t[62]=P,t[63]=N,t[64]=Q):Q=t[64];let $;return t[65]!==U||t[66]!==q||t[67]!==Z||t[68]!==Q?($=(0,b.jsxs)(`div`,{className:`rw-overlay`,ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Weekly Rewind`,tabIndex:-1,onKeyDown:U,children:[q,Z,Q]}),t[65]=U,t[66]=q,t[67]=Z,t[68]=Q,t[69]=$):$=t[69],$}function re(e){return Math.max(0,e-1)}function ie(){return Date.now()}export{A as RewindOverlay};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RippleOverlay-CfXvnUHE.js","assets/index-Dbr1j8Fe.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/useSpatialCanvas-C5TNlpeK.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/cache-BumECILO.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/githubToken-DtcLYqwm.js","assets/keyVault-DEsNh9FR.js","assets/useFocusTrap-DbfG6zbM.js","assets/RippleOverlay-_iiZsQVZ.css","assets/useLiveConfig-BW1WkpTc.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/kokoro-DsmNzulR.js","assets/spokenText-D4zPX9JY.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./lazyRetry-D50B1UMY.js";import{I as r,J as i,M as a,N as o,k as s,o as c,q as l}from"./index-Dbr1j8Fe.js";import{t as u}from"./homeTarget-BcZYH3DY.js";var d=e(),f=t();i();var p=r(()=>l(()=>import(`./RippleOverlay-CfXvnUHE.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]))),m=p.Component,h=n(()=>l(()=>import(`./seed-b1xc0dj2.js`),[]));function g(){(0,d.useEffect)(()=>a(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,r]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0,t=window.setTimeout(()=>{l(async()=>{let{getLiveConfigV2:e,toModelConfig:t}=await import(`./useLiveConfig-BW1WkpTc.js`).then(e=>e.d);return{getLiveConfigV2:e,toModelConfig:t}},__vite__mapDeps([18,2,1,3,4,5,6,7,19,20,21,15])).then(({getLiveConfigV2:t,toModelConfig:n})=>{if(!e)return;let i=n(t());r(i.apiKey?i:null)})},250);return()=>{e=!1,window.clearTimeout(t)}},[]);let i=(0,d.useCallback)(e=>{l(()=>import(`./kokoro-DsmNzulR.js`).then(e=>e.y).then(t=>t.speak(e,`mavea`)),__vite__mapDeps([22,2,1,3,4,5,6,7,23]))},[]);return e?(0,f.jsx)(s,{label:`Ripple overview`,children:(0,f.jsx)(m,{model:e,cfg:n,speak:i,onClose:()=>{window.location.hash=u().href}})}):(0,f.jsx)(c,{})}export{g as RippleApp};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-Dbr1j8Fe.js";import{t as r}from"./providers-wzm7E8Pa.js";import{r as i}from"./githubBrowser-DywfDeYx.js";import{t as a}from"./json-B0N3XRZU.js";import{n as o}from"./verbatim-CBMzUDlf.js";import{t as s}from"./links--u_phi0x.js";var c=e(),l=n(),u=t(),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=>i(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(`
|