@mavea/mavea 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +4 -3
- package/dist/.vite/manifest.json +587 -605
- package/dist/assets/{AppCommandPalette-D_g8-7C0.js → AppCommandPalette-D5nd3VO_.js} +1 -1
- package/dist/assets/{BlockEmpty-Ddhgr5pu.js → BlockEmpty-BZn5ETuL.js} +1 -1
- package/dist/assets/{BriefingPlayer-D-QhLgXI.js → BriefingPlayer-JnrrvxYE.js} +1 -1
- package/dist/assets/{CanvasSkeleton-BIiOmCMG.js → CanvasSkeleton-D00MzkIV.js} +2 -2
- package/dist/assets/{CheckLogRail-ZrDqyjQ7.js → CheckLogRail--9iHharq.js} +1 -1
- package/dist/assets/{CodeOutput-D7sVg1Nr.js → CodeOutput-408gGn9V.js} +1 -1
- package/dist/assets/{CommandPalette-DNa2q8E_.js → CommandPalette-BIUG6Sn7.js} +1 -1
- package/dist/assets/{CourseLessonReader-BIpGjcJk.js → CourseLessonReader-Yp2qEsDx.js} +2 -2
- package/dist/assets/{CourseRail-CQaotzN0.js → CourseRail-BVvnoWBR.js} +1 -1
- package/dist/assets/{CoursesApp-q3kZJmu1.js → CoursesApp-0N_F1p_u.js} +2 -2
- package/dist/assets/{CrossExamPanel-BIJslibV.js → CrossExamPanel-CocJ_GxK.js} +1 -1
- package/dist/assets/{DashPresent-DGSE0vYM.js → DashPresent-G8Actzx7.js} +1 -1
- package/dist/assets/{DashboardDetail-BpaLNg8R.js → DashboardDetail-BpSe8wBT.js} +2 -2
- package/dist/assets/DashboardLoopRuntime-CHPDkO3Y.js +1 -0
- package/dist/assets/{DashboardOverview-8x3OxX2i.js → DashboardOverview-Cdhy4x4b.js} +1 -1
- package/dist/assets/{DashboardSettings-f_zxcs5j.js → DashboardSettings-ChPkh0t4.js} +1 -1
- package/dist/assets/DashboardsApp-mp-V3d1i.js +2 -0
- package/dist/assets/{DeepZoomApp-E7bDmzuL.js → DeepZoomApp-mZHk132w.js} +1 -1
- package/dist/assets/{DelegatePanel-_9RZiLHM.css → DelegatePanel-Cf85-0qE.css} +1 -1
- package/dist/assets/DelegatePanel-Dtl0oHaA.js +33 -0
- package/dist/assets/{DemoGallery-DDzX8Z7I.js → DemoGallery-By2LV_U_.js} +1 -1
- package/dist/assets/{DropSelect-BMZYAX6q.js → DropSelect-CeCNaut0.js} +1 -1
- package/dist/assets/{ExportModal-CTMJaU1l.js → ExportModal-CZ1-Vihb.js} +2 -2
- package/dist/assets/{ExtractionPreview-C9wq7CrK.js → ExtractionPreview-CRkYnwCo.js} +1 -1
- package/dist/assets/{FlagshipCTA-DPNSflKv.js → FlagshipCTA-DNtUnl0n.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-55zqyPFm.js → FlagshipCommandPalette-DpP8joXb.js} +1 -1
- package/dist/assets/{FlagshipShowcase-BWpoPWOn.js → FlagshipShowcase-CoOezhT-.js} +1 -1
- package/dist/assets/{FlashcardsApp-apCj3I17.js → FlashcardsApp-REEdMdKG.js} +1 -1
- package/dist/assets/{ForecastPanel-CMRD-UKn.js → ForecastPanel-CpR32hwb.js} +1 -1
- package/dist/assets/{GalleryApp-CcsbirLT.js → GalleryApp-DJZRHjMH.js} +1 -1
- package/dist/assets/{HonestByDesign-DU4qmc61.js → HonestByDesign-CiOj_fA7.js} +1 -1
- package/dist/assets/{HowItWorks-CkZXftN-.js → HowItWorks-Ch2CgkVd.js} +1 -1
- package/dist/assets/{LegalApp-BmZpqH-6.js → LegalApp-BisEJynn.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-CcbAfubz.js → LegalMarkdownDocument-B7Yj_aRR.js} +1 -1
- package/dist/assets/{LegalPageShell-raMATqhx.js → LegalPageShell-k9e22JlP.js} +1 -1
- package/dist/assets/{LeverPanel-DVUgGcYW.js → LeverPanel-CXSDqinv.js} +1 -1
- package/dist/assets/{Library-D725dNcx.js → Library-CmpF6gOU.js} +1 -1
- package/dist/assets/{LibraryOverlay-D7PzQIpH.js → LibraryOverlay-BErgFYxu.js} +1 -1
- package/dist/assets/LiveApp-DZ7t3P1O.js +61 -0
- package/dist/assets/LiveApp-Dj_6EQuL.css +1 -0
- package/dist/assets/LiveSettings-BY5E3Ka8.js +6 -0
- package/dist/assets/{MindMapViewerDrawer-CIMuABKE.js → MindMapViewerDrawer-Bc_qHdm9.js} +1 -1
- package/dist/assets/MindShape-DGOmKwov.css +1 -0
- package/dist/assets/{MindShape-0KPrv0CF.js → MindShape-ULBAjrfD.js} +1 -1
- package/dist/assets/{PinToDashboard-ML4NFCAU.js → PinToDashboard-WgEX4YoY.js} +1 -1
- package/dist/assets/{PlanReview-CbJ_7Ld1.js → PlanReview-Dd3sxa_o.js} +1 -1
- package/dist/assets/{Presence-B_zDfiE7.js → Presence-DgzicbeF.js} +1 -1
- package/dist/assets/{PresentationDeck-Tm3PUdh5.js → PresentationDeck-Cx26X-wh.js} +1 -1
- package/dist/assets/{PrismApp-Bc-6PO_P.js → PrismApp-FPqASfhZ.js} +2 -2
- package/dist/assets/{PrismAskController-OwqFx5Pk.js → PrismAskController-Ds1tSE9S.js} +1 -1
- package/dist/assets/{PrismBriefingPlayer-Bu_ZxYdh.js → PrismBriefingPlayer-BzqCK6JP.js} +2 -2
- package/dist/assets/{PrismOverlay-UTsJ8R5d.js → PrismOverlay-Cq3DBJ-N.js} +4 -4
- package/dist/assets/{PrivacyApp-BLXan6dm.js → PrivacyApp-B8PGc-x5.js} +1 -1
- package/dist/assets/{Recap-5rYrcMCC.js → Recap-RwhzouRe.js} +1 -1
- package/dist/assets/{ReelJelly-Dg3XGB0c.js → ReelJelly-B2JQsaRI.js} +1 -1
- package/dist/assets/{ReplayCard-wMIMlorH.js → ReplayCard-DUBvQLBt.js} +2 -2
- package/dist/assets/{ReplayOverlay-BomkTonB.js → ReplayOverlay-CzUFHdjK.js} +1 -1
- package/dist/assets/{RewindOverlay-Izf89nG9.js → RewindOverlay-CMx_cVxX.js} +1 -1
- package/dist/assets/{RippleApp-8QSIEjTX.js → RippleApp-B186b8KW.js} +2 -2
- package/dist/assets/{RippleAskController-Cd86GrKs.js → RippleAskController-BA_kGOmL.js} +1 -1
- package/dist/assets/{RippleOverlay-SCrXZTqz.js → RippleOverlay-CkbkIgzC.js} +2 -2
- package/dist/assets/{SeeDontRead-Bp8qsF20.js → SeeDontRead-BZ4xFEKE.js} +1 -1
- package/dist/assets/{ShareModal-C-sD-aia.js → ShareModal-DNpc-U9U.js} +1 -1
- package/dist/assets/{ShipCascade-Cq_I4c_v.js → ShipCascade-BmTE193h.js} +1 -1
- package/dist/assets/{ShipCourse-CzsJyMnT.js → ShipCourse-K2vnS3Sw.js} +1 -1
- package/dist/assets/{ShipHotspots-OMjPhQWP.js → ShipHotspots-DILwqPxh.js} +1 -1
- package/dist/assets/{ShipIncident-Cqn6ZmKz.js → ShipIncident-DXXciEP7.js} +1 -1
- package/dist/assets/{ShipMigration-5_ZWn7K9.js → ShipMigration-rhBm0Tre.js} +1 -1
- package/dist/assets/{ShipOnboarding-Yr8oKgmQ.js → ShipOnboarding-9KCVVAkX.js} +1 -1
- package/dist/assets/{ShipRead-Bnw7mnv3.js → ShipRead-CMe1DNik.js} +1 -1
- package/dist/assets/{ShipRollout-ECsDrqAd.js → ShipRollout-BA4x-btU.js} +1 -1
- package/dist/assets/{ShipSuggestions-C6oDw2F8.js → ShipSuggestions-Jm45jfFl.js} +1 -1
- package/dist/assets/{ShipWorkspace-BT6gZrqd.js → ShipWorkspace--x-q6Ly3.js} +1 -1
- package/dist/assets/{SignatureLoop-D7sibSnc.js → SignatureLoop-B_cHyXgU.js} +1 -1
- package/dist/assets/{SynthesisApp-B768x2r_.js → SynthesisApp-CvR_8g1C.js} +2 -2
- package/dist/assets/{SynthesisOverlay-Ds0MhZLQ.js → SynthesisOverlay-DFFD69hf.js} +1 -1
- package/dist/assets/{TermsApp-Da8FeMj3.js → TermsApp-BxLgLSna.js} +1 -1
- package/dist/assets/{TopicCanvas-D64O3lvD.js → TopicCanvas-CKvJb_8Y.js} +2 -2
- package/dist/assets/{TopicCanvas-D2Nax9II.css → TopicCanvas-uRuHi99s.css} +1 -1
- package/dist/assets/{TourPrism-CTf1G-Vv.js → TourPrism-bqOmSZ9T.js} +1 -1
- package/dist/assets/{TrackerTile-DeujTCk-.js → TrackerTile-BuAVmOyi.js} +2 -2
- package/dist/assets/{TwoSurfaces-kyK2yqm0.js → TwoSurfaces-CjtKXWJr.js} +1 -1
- package/dist/assets/{UnderstoodPanel-Dgwk_Cuj.js → UnderstoodPanel-BWFbpk9o.js} +1 -1
- package/dist/assets/{WhyMachineOverlay-C4eQC0lg.js → WhyMachineOverlay-D6pGEE78.js} +1 -1
- package/dist/assets/{WowFeatures-CaBZ5WPM.js → WowFeatures-CLx5VoKn.js} +1 -1
- package/dist/assets/{ZoomDeck-DnCtbhx1.js → ZoomDeck-R6MLUt4Z.js} +1 -1
- package/dist/assets/{alternateFinishes-FSV_gA1A.js → alternateFinishes-C8DBTwo_.js} +1 -1
- package/dist/assets/{annotationAuto-x_dV8z65.js → annotationAuto-ofVcqRve.js} +1 -1
- package/dist/assets/{annotationReel-SeXzv0P-.js → annotationReel-CdAmTPlv.js} +1 -1
- package/dist/assets/{backup-0zODkqi-.js → backup-TgoSxdwf.js} +1 -1
- package/dist/assets/canvas-BrUiUI9Q.js +1 -0
- package/dist/assets/{catalog-Car_1ocN.js → catalog-BrmxA4bP.js} +1 -1
- package/dist/assets/{dashboardEvents-BqcPN-K8.js → dashboardEvents-DT6ye9n7.js} +1 -1
- package/dist/assets/{dist-BTg4yEWr.js → dist-COAFD72d.js} +1 -1
- package/dist/assets/{fit-I3tuibfX.js → fit-BtKObM5Q.js} +1 -1
- package/dist/assets/{generateLive-Dk24OxVt.js → generateLive-BvE3kOrf.js} +1 -1
- package/dist/assets/gesture-Bouqjr3g.js +2 -0
- package/dist/assets/{index-CWqRe4-B.js → index-DOpl5xzv.js} +3 -3
- package/dist/assets/{jspdf.es.min-wkD3BzGZ.js → jspdf.es.min-DSMzCXtv.js} +1 -1
- package/dist/assets/{kokoro-B-3GqktX.js → kokoro-B-MNB16v.js} +1 -1
- package/dist/assets/{lib-CwruVYU_.js → lib-BLt1wpw2.js} +1 -1
- package/dist/assets/{liveSchema-CCpVMy0H.js → liveSchema-DbjsSolX.js} +2 -2
- package/dist/assets/{motion-CURfDtdH.js → motion-DKmdzFji.js} +1 -1
- package/dist/assets/{notes-BG5QP-Dj.js → notes-D_uDKcr5.js} +1 -1
- package/dist/assets/{pdf-x4qTBJIZ.js → pdf-uUFiTOYW.js} +1 -1
- package/dist/assets/{penStrokes-9Q_l7NTt.js → penStrokes-DlHnO9xE.js} +1 -1
- package/dist/assets/{perfProbe-BFwfpxJt.js → perfProbe-DIAQR2bi.js} +1 -1
- package/dist/assets/{pin-DRN5H7py.js → pin-DoSzEmTm.js} +1 -1
- package/dist/assets/{portal-BYHo9LOD.js → portal-4sKB1Tgc.js} +1 -1
- package/dist/assets/{pptxgen.es-DGywGiaX.js → pptxgen.es-BVKKMlmO.js} +1 -1
- package/dist/assets/{prewarm-CQNCE4Uq.js → prewarm-D31Si_08.js} +1 -1
- package/dist/assets/{quietHours-CKjQ2pGY.js → quietHours-sfkvrkJv.js} +1 -1
- package/dist/assets/registry--yZ1HduK.js +1 -0
- package/dist/assets/{registry-CfTTYQrE.js → registry-B3RfPAd6.js} +1 -1
- package/dist/assets/{registry-DBsjgIxw.js → registry-B3u3--Kv.js} +1 -1
- package/dist/assets/{registry-DFmFBfRz.js → registry-BOS6AdnB.js} +1 -1
- package/dist/assets/{registry-Dw42uggW.js → registry-BWzoIPXp.js} +1 -1
- package/dist/assets/{registry-CNr6L-3z.js → registry-Bj8q4igW.js} +1 -1
- package/dist/assets/{registry-_T6pLDPG.js → registry-BnSnMnyk.js} +2 -2
- package/dist/assets/{registry-aUZZeh27.js → registry-BpccSYOo.js} +1 -1
- package/dist/assets/{registry-BueBIP-N.js → registry-C4KB6Ls0.js} +1 -1
- package/dist/assets/{registry-cPmSqaRu.js → registry-CAZ7ubmd.js} +1 -1
- package/dist/assets/{registry-1BWL6SXY.js → registry-CYnKlcEy.js} +1 -1
- package/dist/assets/{registry-BZQeYzgv.js → registry-Chzw1Udo.js} +1 -1
- package/dist/assets/{registry-DrqQbf_n.js → registry-CkXIaQmB.js} +1 -1
- package/dist/assets/{registry-BklPTZre.js → registry-CrKVDfq8.js} +1 -1
- package/dist/assets/registry-D5oMqeSa.js +1 -0
- package/dist/assets/{registry-9S6KiKjR.js → registry-DOsiT4_6.js} +1 -1
- package/dist/assets/{registry-Bl3NkU-0.js → registry-DsjrEa0W.js} +1 -1
- package/dist/assets/{registry-Bc6_RQ8l.js → registry-DssqYPgu.js} +1 -1
- package/dist/assets/{registry-CqfjqOX5.js → registry-DxtkIiAV.js} +2 -2
- package/dist/assets/{registry-Bpx4VBWb.js → registry-DzNYBJ_a.js} +1 -1
- package/dist/assets/{registry-GLjcQX0n.js → registry-NdA9xh9G.js} +1 -1
- package/dist/assets/{registry-D84Bs-bD.js → registry-VRtsyPV7.js} +1 -1
- package/dist/assets/{registry-DEgW3zel.js → registry-d3dHoriR.js} +1 -1
- package/dist/assets/{registry-BpBiRe-o.js → registry-fLKnCnS5.js} +1 -1
- package/dist/assets/{relate-yq30L3hZ.js → relate-BG7aZWOq.js} +1 -1
- package/dist/assets/{shikiHighlight-BgZoQAHs.js → shikiHighlight-D9nfk5pW.js} +1 -1
- package/dist/assets/{useDashboardLoop-mGmJwv27.js → useDashboardLoop-CJ0M7ZXf.js} +3 -3
- package/dist/assets/{useLiveConfig-vMyjo2gV.js → useLiveConfig-DIvKKKpP.js} +1 -1
- package/dist/assets/{useSpatialCanvas-CEXy6ZC2.js → useSpatialCanvas-L0r29F7F.js} +1 -1
- package/dist/assets/{useSpotlightWalk-B9XJ6OLK.js → useSpotlightWalk-oyvTWe20.js} +1 -1
- package/dist/assets/{useSrsCards-Vc6B2_he.js → useSrsCards-BLNBqRe7.js} +1 -1
- package/dist/assets/{useStudy-6QnY-Fw_.js → useStudy-hvN-iGz0.js} +1 -1
- package/dist/assets/{useZoomGesture-BONUz5cE.js → useZoomGesture-Dl_Cfmxm.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/DashboardLoopRuntime-14yzj-xx.js +0 -1
- package/dist/assets/DashboardsApp-mvMbGmp0.js +0 -2
- package/dist/assets/DelegatePanel-pwRk9pFf.js +0 -26
- package/dist/assets/LiveApp-B8Jw1Q0h.js +0 -61
- package/dist/assets/LiveApp-DQhDk2ma.css +0 -1
- package/dist/assets/LiveSettings-BQ06gZB7.js +0 -6
- package/dist/assets/MindShape-Bel2yDqO.css +0 -1
- package/dist/assets/RehearsalPanel-BCU615wg.css +0 -1
- package/dist/assets/RehearsalPanel-CM4466Os.js +0 -6
- package/dist/assets/canvas-uhcwigAL.js +0 -1
- package/dist/assets/gesture-DabMpPcq.js +0 -2
- package/dist/assets/registry-BffpZK5w.js +0 -1
- package/dist/assets/registry-Z3TIPbYJ.js +0 -1
|
@@ -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-DOpl5xzv.js";import{n as r}from"./icons-CHVz6kv_.js";import{t as i}from"./useFocusTrap-DbfG6zbM.js";import{n as a}from"./blockLabel-DAqaHKy3.js";import{S as o,V as s}from"./useStudy-hvN-iGz0.js";import{l as c,n as l}from"./useLiveConfig-DIvKKKpP.js";import{r as u}from"./format-hc2QOoIu.js";import{t as d}from"./pin-DoSzEmTm.js";var f=n(),p=e(),m=t(),h=[{v:`15min`,label:`15M`},{v:`hourly`,label:`1H`},{v:`6h`,label:`6H`},{v:`daily`,label:`DAILY`},{v:`manual`,label:`MANUAL`}],g={"15min":{text:`15 MIN`,tone:`fast`},hourly:{text:`HOURLY`,tone:`steady`},"6h":{text:`6 HOURS`,tone:`steady`},daily:{text:`DAILY`,tone:`calm`},manual:{text:`MANUAL`,tone:`calm`}};function _(e){let t=(0,f.c)(43),{block:n,conversationTitle:o,question:_,onClose:y,onAdded:b}=e,[x]=(0,p.useState)(v),S;t[0]===n?S=t[1]:(S=a(n),t[0]=n,t[1]=S);let C=S,[w,T]=(0,p.useState)(x.length===0),E;t[2]!==o||t[3]!==C||t[4]!==_?(E=()=>u(_?.trim()||o||C),t[2]=o,t[3]=C,t[4]=_,t[5]=E):E=t[5];let[D,O]=(0,p.useState)(E),[k,A]=(0,p.useState)(`manual`),j=(0,p.useRef)(null),M;t[6]===y?M=t[7]:(M={onEscape:y},t[6]=y,t[7]=M),i(j,M);let N=(0,p.useRef)(null),P,F;t[8]===w?(P=t[9],F=t[10]):(P=()=>{w?N.current?.focus():j.current?.querySelector(`.pin-row`)?.focus()},F=[w],t[8]=w,t[9]=P,t[10]=F),(0,p.useEffect)(P,F);let I;t[11]!==n||t[12]!==b||t[13]!==y||t[14]!==_?(I=e=>{let t=d({block:n,question:_,target:e});t&&b?.(t.dashboardId,t.title),y()},t[11]=n,t[12]=b,t[13]=y,t[14]=_,t[15]=I):I=t[15];let L=I,R=s(k),z;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(z=c(l()),t[16]=z):z=t[16];let B=!!z.apiKey,V;t[17]===y?V=t[18]:(V=e=>{e.target===e.currentTarget&&y()},t[17]=y,t[18]=V);let H;t[19]===y?H=t[20]:(H=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),y())},t[19]=y,t[20]=H);let U=w?`New dashboard`:`Add to dashboard`,W;t[21]===U?W=t[22]:(W=(0,m.jsx)(`span`,{className:`pin-eyebrow`,children:U}),t[21]=U,t[22]=W);let G;t[23]===C?G=t[24]:(G=(0,m.jsx)(`span`,{className:`pin-subject`,children:C}),t[23]=C,t[24]=G);let K;t[25]!==W||t[26]!==G?(K=(0,m.jsxs)(`div`,{className:`pin-head`,children:[W,G]}),t[25]=W,t[26]=G,t[27]=K):K=t[27];let q;t[28]!==k||t[29]!==x||t[30]!==C||t[31]!==D||t[32]!==w||t[33]!==L||t[34]!==R?(q=w?(0,m.jsxs)(`form`,{className:`pin-new-step`,onSubmit:e=>{e.preventDefault(),L({new:{title:D.trim()||C,cadence:k}})},children:[(0,m.jsxs)(`label`,{className:`pin-name-field`,children:[(0,m.jsx)(`span`,{className:`pin-plan-label`,children:`Name`}),(0,m.jsx)(`input`,{ref:N,className:`pin-name-input`,value:D,onChange:e=>O(e.target.value),"aria-label":`Dashboard name`})]}),(0,m.jsxs)(`div`,{className:`pin-plan-cadence`,children:[(0,m.jsx)(`span`,{className:`pin-plan-label`,children:`Check cadence`}),(0,m.jsx)(`div`,{className:`pin-cadence-seg`,role:`group`,"aria-label":`Check cadence`,children:h.map(e=>(0,m.jsx)(`button`,{type:`button`,className:`pin-cadence-opt`+(e.v===k?` is-active`:``),"aria-pressed":e.v===k,onClick:()=>A(e.v),children:e.label},e.v))}),(0,m.jsx)(`p`,{className:`pin-plan-estimate`,children:R>0?B?`≈ ${R} searches/mo on your key, at this cadence.`:`≈ ${R} searches/mo once a key is connected in Live — parked until then.`:`No standing searches — this refreshes only when you ask.`})]}),(0,m.jsxs)(`div`,{className:`pin-plan-actions`,children:[x.length>0?(0,m.jsx)(`button`,{type:`button`,className:`pin-secondary`,onClick:()=>T(!1),children:`← Back`}):(0,m.jsx)(`span`,{}),(0,m.jsx)(`button`,{type:`submit`,className:`pin-plan-confirm`,children:`Create · first check queued`})]})]}):(0,m.jsxs)(`div`,{className:`pin-list`,role:`menu`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`pin-row pin-new`,role:`menuitem`,onClick:()=>T(!0),children:[(0,m.jsx)(`span`,{className:`pin-row-ic`,children:(0,m.jsx)(r.plus,{})}),(0,m.jsxs)(`span`,{className:`pin-row-text`,children:[(0,m.jsx)(`span`,{className:`pin-row-title`,children:`New dashboard`}),(0,m.jsx)(`span`,{className:`pin-row-sub`,children:`Start one with this card`})]})]}),x.map(e=>{let t=g[e.cadence.data];return(0,m.jsxs)(`button`,{type:`button`,className:`pin-row`,role:`menuitem`,onClick:()=>L(e.id),children:[(0,m.jsx)(`span`,{className:`pin-row-ic`,children:(0,m.jsx)(r.table,{})}),(0,m.jsxs)(`span`,{className:`pin-row-text`,children:[(0,m.jsx)(`span`,{className:`pin-row-title`,children:u(e.title)}),(0,m.jsxs)(`span`,{className:`pin-row-sub`,children:[e.widgets.length,` `,e.widgets.length===1?`card`:`cards`]})]}),(0,m.jsx)(`span`,{className:`pin-row-cad pin-row-cad--${t.tone}`,children:t.text})]},e.id)})]}),t[28]=k,t[29]=x,t[30]=C,t[31]=D,t[32]=w,t[33]=L,t[34]=R,t[35]=q):q=t[35];let J;t[36]!==K||t[37]!==q?(J=(0,m.jsxs)(`div`,{className:`pin-sheet`,ref:j,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":`Add to a dashboard`,children:[K,q]}),t[36]=K,t[37]=q,t[38]=J):J=t[38];let Y;return t[39]!==J||t[40]!==V||t[41]!==H?(Y=(0,m.jsx)(`div`,{className:`pin-scrim`,onClick:V,role:`button`,tabIndex:0,"aria-label":`Close`,onKeyDown:H,children:J}),t[39]=J,t[40]=V,t[41]=H,t[42]=Y):Y=t[42],Y}function v(){return o()}export{_ as PinToDashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{D as r,H as i,V as a,b as o,p as s,y as c}from"./useStudy-6QnY-Fw_.js";import{l,n as u}from"./useDashboardLoop-mGmJwv27.js";/* empty css */import"./DashboardsApp-mvMbGmp0.js";import{t as d}from"./relate-yq30L3hZ.js";var f=e(),p=n();function m(e){return e*4}function h(e,t,n,r={}){let i=`template:${e.id}`,a=new Map,o=[];e.metrics.forEach((e,i)=>{if(r.metrics?.[i]===!1)return;let s=`m-${n}-${i}`,c=e.label(t);a.set(i,s),o.push({id:s,label:c,query:e.query(t),...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},lastValue:null,origin:`empty`})});let s=[];e.tripwires.forEach((e,i)=>{if(!(r.tripwires?.[i]??e.enabledByDefault))return;let o=a.get(e.metricIndex);if(!o)return;let c=e.label(t);s.push({id:`t-${n}-${i}`,label:c,metricId:o,comparator:e.comparator,threshold:e.threshold,...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},state:`AWAITING`})});let c=[],l=[];return e.widgets.forEach((e,s)=>{if(r.widgets?.[s]===!1)return;if(e.metricIndex!==void 0){let t=a.get(e.metricIndex);if(!t)return;let r=o.find(e=>e.id===t);c.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:m(e.span),id:`wblk-${n}-${s}`,num:String(c.length+1),props:{title:r.label,stat:`—`,conf:`inferred`,summary:r.sourceQuote.text}},span:e.span,metricId:t,fromSource:i});return}let u=e.refreshQuery?.(t),d=e.seedProps?.(t)??{};l.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:m(e.span),id:`wblk-${n}-${s}`,props:u?{title:u,...d}:d},span:e.span,fromSource:i,...u?{refreshQuery:u}:{}})}),{metrics:o,tripwires:s,widgets:[...c,...l]}}function g(e,t,n={}){let a=n.now??Date.now(),o=`template:${e.id}`,s=e.title(t),{metrics:c,tripwires:l,widgets:u}=h(e,t,a,n.toggles),d=l.length>0,f={id:`w-thesis`,block:{type:`thesis`,col:8,id:`w-thesis`,props:{reasoning:e.thesis(t)}},span:2,fromSource:o},p={id:`w-align`,block:{type:`alignmentgauge`,col:4,id:`w-align`,props:{pct:null}},span:1,fromSource:o},m={id:`w-alerts`,block:{type:`standingalerts`,col:4,id:`w-alerts`,props:{alerts:[]}},span:1,fromSource:o},g={id:`w-sources`,block:{type:`sourceslineage`,col:8,id:`w-sources`,props:{rows:[]}},span:2,fromSource:o},_=n.cadence??e.cadence,v=c.some(e=>e.query.trim()!==``&&!e.blankKey)||u.some(e=>e.refreshQuery?.trim());return{id:r(),title:s,question:s,thesis:{text:e.thesis(t),saidAt:a},tripwires:l,metrics:c,sources:[{kind:`ORIGIN`,conversationId:o,title:e.label,contributed:`Started from the '${e.label}' template.`,at:a}],widgets:[...d?[f,p]:[],...u,...d?[m]:[],g],cadence:_,smartTrigger:d,alerts:{inApp:!0,push:!1},...e.topic?{topic:e.topic}:{},createdAt:a,updatedAt:a,nextDataAt:i(_,a),nextAiAt:2**53-1,lastRefreshedAt:null,...v?{oneShotAt:a,oneShotLabel:`first check`}:{}}}function _(e,t,n,r=Date.now()){let i=new Set(e.metrics.map(e=>l(e.label))),a=new Set(e.tripwires.map(e=>l(e.label))),s=h(t,n,r),c=s.metrics.filter(e=>!i.has(l(e.label))),u=new Set(c.map(e=>e.id)),d=s.tripwires.filter(e=>u.has(e.metricId)&&!a.has(l(e.label))),f=s.widgets.filter(e=>!e.metricId||u.has(e.metricId)),p=c.length+d.length,m=[];c.length&&m.push(`${c.length} metric${c.length>1?`s`:``}`),d.length&&m.push(`${d.length} alert${d.length>1?`s`:``}`);let g={kind:`ADDED`,conversationId:`template:${t.id}`,title:t.label,contributed:m.length?`Added: ${m.join(` + `)}`:`Linked the '${t.label}' template.`,at:r};return o(e.id,{metrics:c,tripwires:d,widgets:f,source:g}),p}var v={chart:{labels:[],series:[]},scoreboard:{games:[]},standings:{rows:[]},forecast:{days:[]},list:{items:[]},timeline:{events:[]}};function ee(e){return{id:`plan`,label:`Track anything`,blurb:``,input:{key:`ask`,label:`Track`,placeholder:``},title:()=>e.title,thesis:()=>`Tracking ${e.title}.`,metrics:e.metrics.map(e=>({label:()=>e.label,query:()=>e.query,...e.unit?{unit:e.unit}:{}})),tripwires:[],widgets:[...e.metrics.map((e,t)=>({blockType:`insight`,span:1,metricIndex:t})),...e.widgets.map(e=>({blockType:e.blockType,span:e.span,refreshQuery:()=>e.query,seedProps:()=>({...v[e.blockType]??{}})}))],cadence:{data:e.cadence,ai:`manual`}}}var y=t(),b={"15min":`checks every 15 minutes while open`,hourly:`checks hourly while open`,"6h":`checks every 6 hours while open`,daily:`checks daily while open`,manual:`refreshes only when you ask`};function te(e,t){let n=[...e];return n[t]=!n[t],n}function ne(e){let t=(0,p.c)(81),{plan:n,ask:r,existing:i,onDone:o}=e,[l,m]=(0,f.useState)(n.title),h;t[0]===n.metrics?h=t[1]:(h=()=>n.metrics.map(ae),t[0]=n.metrics,t[1]=h);let[v,ne]=(0,f.useState)(h),x;t[2]===n.widgets?x=t[3]:(x=()=>n.widgets.map(ie),t[2]=n.widgets,t[3]=x);let[S,se]=(0,f.useState)(x),[C,ce]=(0,f.useState)(null),[w,le]=(0,f.useState)(`manual`),T;t[4]===v?T=t[5]:(T=v.filter(Boolean),t[4]=v,t[5]=T);let ue=T.length,E;t[6]===S?E=t[7]:(E=S.filter(Boolean),t[6]=S,t[7]=E);let D=ue+E.length,de=a(w),O;t[8]!==r||t[9]!==w||t[10]!==D||t[11]!==v||t[12]!==l||t[13]!==o||t[14]!==n||t[15]!==S?(O=()=>{if(D===0)return;let e=ee(n),t=[...n.metrics.map(re),...S],i=g(e,r.trim(),{toggles:{metrics:v,widgets:t},cadence:{data:w,ai:`manual`}});i.title=l.trim()||i.title,i.question=r.trim(),s(i),u(i.id),o(i.id)},t[8]=r,t[9]=w,t[10]=D,t[11]=v,t[12]=l,t[13]=o,t[14]=n,t[15]=S,t[16]=O):O=t[16];let k=O,A;t[17]!==r||t[18]!==o||t[19]!==n?(A=e=>{_(e,ee(n),r.trim()),c(e.id),u(e.id),o(e.id)},t[17]=r,t[18]=o,t[19]=n,t[20]=A):A=t[20];let j=A,M;t[21]!==r||t[22]!==k||t[23]!==i||t[24]!==n.title?(M=()=>{let e=d(i,{text:`${n.title} ${r}`});if(e){ce(e);return}k()},t[21]=r,t[22]=k,t[23]=i,t[24]=n.title,t[25]=M):M=t[25];let fe=M;if(C){let e;t[26]===C.title?e=t[27]:(e=(0,y.jsxs)(`p`,{className:`tpl-interstitial-text`,children:[`This looks related to your existing “`,C.title,`” dashboard — fold this in instead of creating a new one?`]}),t[26]=C.title,t[27]=e);let n;t[28]!==j||t[29]!==C?(n=()=>j(C),t[28]=j,t[29]=C,t[30]=n):n=t[30];let r;t[31]!==C.title||t[32]!==n?(r=(0,y.jsxs)(`button`,{type:`button`,className:`tpl-fold-btn`,onClick:n,children:[`Fold into “`,C.title,`”`]}),t[31]=C.title,t[32]=n,t[33]=r):r=t[33];let i;t[34]===k?i=t[35]:(i=(0,y.jsx)(`button`,{type:`button`,className:`tpl-create-anyway`,onClick:k,children:`Create new anyway`}),t[34]=k,t[35]=i);let a;t[36]!==r||t[37]!==i?(a=(0,y.jsxs)(`div`,{className:`tpl-interstitial-actions`,children:[r,i]}),t[36]=r,t[37]=i,t[38]=a):a=t[38];let o;return t[39]!==a||t[40]!==e?(o=(0,y.jsxs)(`div`,{className:`tpl-interstitial`,children:[e,a]}),t[39]=a,t[40]=e,t[41]=o):o=t[41],o}let N;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,y.jsx)(`span`,{className:`xt-section-label`,children:`Dashboard name`}),t[42]=N):N=t[42];let P;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>m(e.target.value),t[43]=P):P=t[43];let F;t[44]===l?F=t[45]:(F=(0,y.jsxs)(`label`,{className:`tpl-field`,children:[N,(0,y.jsx)(`input`,{className:`xt-name`,value:l,onChange:P,"aria-label":`Dashboard name`})]}),t[44]=l,t[45]=F);let I;t[46]!==v||t[47]!==n.metrics?(I=n.metrics.length>0&&(0,y.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,y.jsx)(`span`,{className:`xt-section-label`,children:`Numbers to watch`}),(0,y.jsx)(`div`,{className:`tpl-chips`,children:n.metrics.map((e,t)=>(0,y.jsx)(oe,{kind:`METRIC`,label:e.label,detail:e.query,on:v[t]??!0,onToggle:()=>ne(e=>te(e,t))},`m${t}`))})]}),t[46]=v,t[47]=n.metrics,t[48]=I):I=t[48];let L;t[49]!==n.widgets||t[50]!==S?(L=n.widgets.length>0&&(0,y.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,y.jsx)(`span`,{className:`xt-section-label`,children:`Live cards`}),(0,y.jsx)(`div`,{className:`tpl-chips`,children:n.widgets.map((e,t)=>(0,y.jsx)(oe,{kind:`CARD`,label:e.query,detail:e.blockType,on:S[t]??!0,onToggle:()=>se(e=>te(e,t))},`w${t}`))})]}),t[49]=n.widgets,t[50]=S,t[51]=L):L=t[51];let R;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,y.jsx)(`span`,{className:`xt-section-label`,children:`How often`}),t[52]=R):R=t[52];let z=`tpl-chip xt-comp--goal${w===`manual`?``:` tpl-chip-off`}`,B=w===`manual`,V,H;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>le(`manual`),H=(0,y.jsx)(`span`,{className:`tpl-chip-label`,children:`Manual — only when you ask`}),t[53]=V,t[54]=H):(V=t[53],H=t[54]);let U;t[55]!==z||t[56]!==B?(U=(0,y.jsx)(`button`,{type:`button`,className:z,"aria-pressed":B,onClick:V,children:H}),t[55]=z,t[56]=B,t[57]=U):U=t[57];let W;t[58]!==w||t[59]!==n.cadence?(W=n.cadence!==`manual`&&(0,y.jsx)(`button`,{type:`button`,className:`tpl-chip xt-comp--metric${w===n.cadence?``:` tpl-chip-off`}`,"aria-pressed":w===n.cadence,onClick:()=>le(n.cadence),title:b[n.cadence],children:(0,y.jsxs)(`span`,{className:`tpl-chip-label`,children:[`Suggested — `,b[n.cadence]]})}),t[58]=w,t[59]=n.cadence,t[60]=W):W=t[60];let G;t[61]!==U||t[62]!==W?(G=(0,y.jsxs)(`div`,{className:`tpl-chip-group`,children:[R,(0,y.jsxs)(`div`,{className:`tpl-chips`,children:[U,W]})]}),t[61]=U,t[62]=W,t[63]=G):G=t[63];let K=de>0?`≈ ${de} searches/mo on your key, at this cadence.`:`No standing searches — this refreshes only when you ask.`,q;t[64]===K?q=t[65]:(q=(0,y.jsx)(`p`,{className:`dash-plan-estimate`,children:K}),t[64]=K,t[65]=q);let J=b[w],Y;t[66]===J?Y=t[67]:(Y=(0,y.jsx)(`span`,{className:`tpl-cadence-note`,children:J}),t[66]=J,t[67]=Y);let X=D===0,Z;t[68]!==fe||t[69]!==X?(Z=(0,y.jsx)(`button`,{type:`button`,className:`tpl-create`,onClick:fe,disabled:X,children:`Create dashboard →`}),t[68]=fe,t[69]=X,t[70]=Z):Z=t[70];let Q;t[71]!==Y||t[72]!==Z?(Q=(0,y.jsxs)(`div`,{className:`xt-build-row`,children:[Y,Z]}),t[71]=Y,t[72]=Z,t[73]=Q):Q=t[73];let $;return t[74]!==F||t[75]!==I||t[76]!==L||t[77]!==G||t[78]!==q||t[79]!==Q?($=(0,y.jsxs)(`div`,{className:`tpl-form`,children:[F,I,L,G,q,Q]}),t[74]=F,t[75]=I,t[76]=L,t[77]=G,t[78]=q,t[79]=Q,t[80]=$):$=t[80],$}function re(){return!0}function ie(){return!0}function ae(){return!0}function oe(e){let t=(0,p.c)(14),{kind:n,label:r,detail:i,on:a,onToggle:o}=e,s=`tpl-chip xt-comp--${n===`METRIC`?`metric`:`goal`}${a?``:` tpl-chip-off`}`,c;t[0]===n?c=t[1]:(c=(0,y.jsx)(`span`,{className:`tpl-chip-kind`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,y.jsx)(`span`,{className:`tpl-chip-label`,children:r}),t[2]=r,t[3]=l);let u=a?`Included ✓`:`Removed ✕`,d;t[4]===u?d=t[5]:(d=(0,y.jsx)(`span`,{className:`tpl-chip-state`,children:u}),t[4]=u,t[5]=d);let f;return t[6]!==i||t[7]!==a||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==d?(f=(0,y.jsxs)(`button`,{type:`button`,className:s,onClick:o,"aria-pressed":a,title:i,children:[c,l,d]}),t[6]=i,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d,t[13]=f):f=t[13],f}export{ne as PlanReview};
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DOpl5xzv.js";import{D as r,H as i,V as a,b as o,p as s,y as c}from"./useStudy-hvN-iGz0.js";import{l,n as u}from"./useDashboardLoop-CJ0M7ZXf.js";/* empty css */import"./DashboardsApp-mp-V3d1i.js";import{t as d}from"./relate-BG7aZWOq.js";var f=e(),p=n();function m(e){return e*4}function h(e,t,n,r={}){let i=`template:${e.id}`,a=new Map,o=[];e.metrics.forEach((e,i)=>{if(r.metrics?.[i]===!1)return;let s=`m-${n}-${i}`,c=e.label(t);a.set(i,s),o.push({id:s,label:c,query:e.query(t),...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},lastValue:null,origin:`empty`})});let s=[];e.tripwires.forEach((e,i)=>{if(!(r.tripwires?.[i]??e.enabledByDefault))return;let o=a.get(e.metricIndex);if(!o)return;let c=e.label(t);s.push({id:`t-${n}-${i}`,label:c,metricId:o,comparator:e.comparator,threshold:e.threshold,...e.unit?{unit:e.unit}:{},sourceQuote:{text:c,saidAt:n},state:`AWAITING`})});let c=[],l=[];return e.widgets.forEach((e,s)=>{if(r.widgets?.[s]===!1)return;if(e.metricIndex!==void 0){let t=a.get(e.metricIndex);if(!t)return;let r=o.find(e=>e.id===t);c.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:m(e.span),id:`wblk-${n}-${s}`,num:String(c.length+1),props:{title:r.label,stat:`—`,conf:`inferred`,summary:r.sourceQuote.text}},span:e.span,metricId:t,fromSource:i});return}let u=e.refreshQuery?.(t),d=e.seedProps?.(t)??{};l.push({id:`w-${n}-${s}`,block:{type:e.blockType,col:m(e.span),id:`wblk-${n}-${s}`,props:u?{title:u,...d}:d},span:e.span,fromSource:i,...u?{refreshQuery:u}:{}})}),{metrics:o,tripwires:s,widgets:[...c,...l]}}function g(e,t,n={}){let a=n.now??Date.now(),o=`template:${e.id}`,s=e.title(t),{metrics:c,tripwires:l,widgets:u}=h(e,t,a,n.toggles),d=l.length>0,f={id:`w-thesis`,block:{type:`thesis`,col:8,id:`w-thesis`,props:{reasoning:e.thesis(t)}},span:2,fromSource:o},p={id:`w-align`,block:{type:`alignmentgauge`,col:4,id:`w-align`,props:{pct:null}},span:1,fromSource:o},m={id:`w-alerts`,block:{type:`standingalerts`,col:4,id:`w-alerts`,props:{alerts:[]}},span:1,fromSource:o},g={id:`w-sources`,block:{type:`sourceslineage`,col:8,id:`w-sources`,props:{rows:[]}},span:2,fromSource:o},_=n.cadence??e.cadence,v=c.some(e=>e.query.trim()!==``&&!e.blankKey)||u.some(e=>e.refreshQuery?.trim());return{id:r(),title:s,question:s,thesis:{text:e.thesis(t),saidAt:a},tripwires:l,metrics:c,sources:[{kind:`ORIGIN`,conversationId:o,title:e.label,contributed:`Started from the '${e.label}' template.`,at:a}],widgets:[...d?[f,p]:[],...u,...d?[m]:[],g],cadence:_,smartTrigger:d,alerts:{inApp:!0,push:!1},...e.topic?{topic:e.topic}:{},createdAt:a,updatedAt:a,nextDataAt:i(_,a),nextAiAt:2**53-1,lastRefreshedAt:null,...v?{oneShotAt:a,oneShotLabel:`first check`}:{}}}function _(e,t,n,r=Date.now()){let i=new Set(e.metrics.map(e=>l(e.label))),a=new Set(e.tripwires.map(e=>l(e.label))),s=h(t,n,r),c=s.metrics.filter(e=>!i.has(l(e.label))),u=new Set(c.map(e=>e.id)),d=s.tripwires.filter(e=>u.has(e.metricId)&&!a.has(l(e.label))),f=s.widgets.filter(e=>!e.metricId||u.has(e.metricId)),p=c.length+d.length,m=[];c.length&&m.push(`${c.length} metric${c.length>1?`s`:``}`),d.length&&m.push(`${d.length} alert${d.length>1?`s`:``}`);let g={kind:`ADDED`,conversationId:`template:${t.id}`,title:t.label,contributed:m.length?`Added: ${m.join(` + `)}`:`Linked the '${t.label}' template.`,at:r};return o(e.id,{metrics:c,tripwires:d,widgets:f,source:g}),p}var v={chart:{labels:[],series:[]},scoreboard:{games:[]},standings:{rows:[]},forecast:{days:[]},list:{items:[]},timeline:{events:[]}};function ee(e){return{id:`plan`,label:`Track anything`,blurb:``,input:{key:`ask`,label:`Track`,placeholder:``},title:()=>e.title,thesis:()=>`Tracking ${e.title}.`,metrics:e.metrics.map(e=>({label:()=>e.label,query:()=>e.query,...e.unit?{unit:e.unit}:{}})),tripwires:[],widgets:[...e.metrics.map((e,t)=>({blockType:`insight`,span:1,metricIndex:t})),...e.widgets.map(e=>({blockType:e.blockType,span:e.span,refreshQuery:()=>e.query,seedProps:()=>({...v[e.blockType]??{}})}))],cadence:{data:e.cadence,ai:`manual`}}}var y=t(),b={"15min":`checks every 15 minutes while open`,hourly:`checks hourly while open`,"6h":`checks every 6 hours while open`,daily:`checks daily while open`,manual:`refreshes only when you ask`};function te(e,t){let n=[...e];return n[t]=!n[t],n}function ne(e){let t=(0,p.c)(81),{plan:n,ask:r,existing:i,onDone:o}=e,[l,m]=(0,f.useState)(n.title),h;t[0]===n.metrics?h=t[1]:(h=()=>n.metrics.map(ae),t[0]=n.metrics,t[1]=h);let[v,ne]=(0,f.useState)(h),x;t[2]===n.widgets?x=t[3]:(x=()=>n.widgets.map(ie),t[2]=n.widgets,t[3]=x);let[S,se]=(0,f.useState)(x),[C,ce]=(0,f.useState)(null),[w,le]=(0,f.useState)(`manual`),T;t[4]===v?T=t[5]:(T=v.filter(Boolean),t[4]=v,t[5]=T);let ue=T.length,E;t[6]===S?E=t[7]:(E=S.filter(Boolean),t[6]=S,t[7]=E);let D=ue+E.length,de=a(w),O;t[8]!==r||t[9]!==w||t[10]!==D||t[11]!==v||t[12]!==l||t[13]!==o||t[14]!==n||t[15]!==S?(O=()=>{if(D===0)return;let e=ee(n),t=[...n.metrics.map(re),...S],i=g(e,r.trim(),{toggles:{metrics:v,widgets:t},cadence:{data:w,ai:`manual`}});i.title=l.trim()||i.title,i.question=r.trim(),s(i),u(i.id),o(i.id)},t[8]=r,t[9]=w,t[10]=D,t[11]=v,t[12]=l,t[13]=o,t[14]=n,t[15]=S,t[16]=O):O=t[16];let k=O,A;t[17]!==r||t[18]!==o||t[19]!==n?(A=e=>{_(e,ee(n),r.trim()),c(e.id),u(e.id),o(e.id)},t[17]=r,t[18]=o,t[19]=n,t[20]=A):A=t[20];let j=A,M;t[21]!==r||t[22]!==k||t[23]!==i||t[24]!==n.title?(M=()=>{let e=d(i,{text:`${n.title} ${r}`});if(e){ce(e);return}k()},t[21]=r,t[22]=k,t[23]=i,t[24]=n.title,t[25]=M):M=t[25];let fe=M;if(C){let e;t[26]===C.title?e=t[27]:(e=(0,y.jsxs)(`p`,{className:`tpl-interstitial-text`,children:[`This looks related to your existing “`,C.title,`” dashboard — fold this in instead of creating a new one?`]}),t[26]=C.title,t[27]=e);let n;t[28]!==j||t[29]!==C?(n=()=>j(C),t[28]=j,t[29]=C,t[30]=n):n=t[30];let r;t[31]!==C.title||t[32]!==n?(r=(0,y.jsxs)(`button`,{type:`button`,className:`tpl-fold-btn`,onClick:n,children:[`Fold into “`,C.title,`”`]}),t[31]=C.title,t[32]=n,t[33]=r):r=t[33];let i;t[34]===k?i=t[35]:(i=(0,y.jsx)(`button`,{type:`button`,className:`tpl-create-anyway`,onClick:k,children:`Create new anyway`}),t[34]=k,t[35]=i);let a;t[36]!==r||t[37]!==i?(a=(0,y.jsxs)(`div`,{className:`tpl-interstitial-actions`,children:[r,i]}),t[36]=r,t[37]=i,t[38]=a):a=t[38];let o;return t[39]!==a||t[40]!==e?(o=(0,y.jsxs)(`div`,{className:`tpl-interstitial`,children:[e,a]}),t[39]=a,t[40]=e,t[41]=o):o=t[41],o}let N;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,y.jsx)(`span`,{className:`xt-section-label`,children:`Dashboard name`}),t[42]=N):N=t[42];let P;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>m(e.target.value),t[43]=P):P=t[43];let F;t[44]===l?F=t[45]:(F=(0,y.jsxs)(`label`,{className:`tpl-field`,children:[N,(0,y.jsx)(`input`,{className:`xt-name`,value:l,onChange:P,"aria-label":`Dashboard name`})]}),t[44]=l,t[45]=F);let I;t[46]!==v||t[47]!==n.metrics?(I=n.metrics.length>0&&(0,y.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,y.jsx)(`span`,{className:`xt-section-label`,children:`Numbers to watch`}),(0,y.jsx)(`div`,{className:`tpl-chips`,children:n.metrics.map((e,t)=>(0,y.jsx)(oe,{kind:`METRIC`,label:e.label,detail:e.query,on:v[t]??!0,onToggle:()=>ne(e=>te(e,t))},`m${t}`))})]}),t[46]=v,t[47]=n.metrics,t[48]=I):I=t[48];let L;t[49]!==n.widgets||t[50]!==S?(L=n.widgets.length>0&&(0,y.jsxs)(`div`,{className:`tpl-chip-group`,children:[(0,y.jsx)(`span`,{className:`xt-section-label`,children:`Live cards`}),(0,y.jsx)(`div`,{className:`tpl-chips`,children:n.widgets.map((e,t)=>(0,y.jsx)(oe,{kind:`CARD`,label:e.query,detail:e.blockType,on:S[t]??!0,onToggle:()=>se(e=>te(e,t))},`w${t}`))})]}),t[49]=n.widgets,t[50]=S,t[51]=L):L=t[51];let R;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,y.jsx)(`span`,{className:`xt-section-label`,children:`How often`}),t[52]=R):R=t[52];let z=`tpl-chip xt-comp--goal${w===`manual`?``:` tpl-chip-off`}`,B=w===`manual`,V,H;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>le(`manual`),H=(0,y.jsx)(`span`,{className:`tpl-chip-label`,children:`Manual — only when you ask`}),t[53]=V,t[54]=H):(V=t[53],H=t[54]);let U;t[55]!==z||t[56]!==B?(U=(0,y.jsx)(`button`,{type:`button`,className:z,"aria-pressed":B,onClick:V,children:H}),t[55]=z,t[56]=B,t[57]=U):U=t[57];let W;t[58]!==w||t[59]!==n.cadence?(W=n.cadence!==`manual`&&(0,y.jsx)(`button`,{type:`button`,className:`tpl-chip xt-comp--metric${w===n.cadence?``:` tpl-chip-off`}`,"aria-pressed":w===n.cadence,onClick:()=>le(n.cadence),title:b[n.cadence],children:(0,y.jsxs)(`span`,{className:`tpl-chip-label`,children:[`Suggested — `,b[n.cadence]]})}),t[58]=w,t[59]=n.cadence,t[60]=W):W=t[60];let G;t[61]!==U||t[62]!==W?(G=(0,y.jsxs)(`div`,{className:`tpl-chip-group`,children:[R,(0,y.jsxs)(`div`,{className:`tpl-chips`,children:[U,W]})]}),t[61]=U,t[62]=W,t[63]=G):G=t[63];let K=de>0?`≈ ${de} searches/mo on your key, at this cadence.`:`No standing searches — this refreshes only when you ask.`,q;t[64]===K?q=t[65]:(q=(0,y.jsx)(`p`,{className:`dash-plan-estimate`,children:K}),t[64]=K,t[65]=q);let J=b[w],Y;t[66]===J?Y=t[67]:(Y=(0,y.jsx)(`span`,{className:`tpl-cadence-note`,children:J}),t[66]=J,t[67]=Y);let X=D===0,Z;t[68]!==fe||t[69]!==X?(Z=(0,y.jsx)(`button`,{type:`button`,className:`tpl-create`,onClick:fe,disabled:X,children:`Create dashboard →`}),t[68]=fe,t[69]=X,t[70]=Z):Z=t[70];let Q;t[71]!==Y||t[72]!==Z?(Q=(0,y.jsxs)(`div`,{className:`xt-build-row`,children:[Y,Z]}),t[71]=Y,t[72]=Z,t[73]=Q):Q=t[73];let $;return t[74]!==F||t[75]!==I||t[76]!==L||t[77]!==G||t[78]!==q||t[79]!==Q?($=(0,y.jsxs)(`div`,{className:`tpl-form`,children:[F,I,L,G,q,Q]}),t[74]=F,t[75]=I,t[76]=L,t[77]=G,t[78]=q,t[79]=Q,t[80]=$):$=t[80],$}function re(){return!0}function ie(){return!0}function ae(){return!0}function oe(e){let t=(0,p.c)(14),{kind:n,label:r,detail:i,on:a,onToggle:o}=e,s=`tpl-chip xt-comp--${n===`METRIC`?`metric`:`goal`}${a?``:` tpl-chip-off`}`,c;t[0]===n?c=t[1]:(c=(0,y.jsx)(`span`,{className:`tpl-chip-kind`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,y.jsx)(`span`,{className:`tpl-chip-label`,children:r}),t[2]=r,t[3]=l);let u=a?`Included ✓`:`Removed ✕`,d;t[4]===u?d=t[5]:(d=(0,y.jsx)(`span`,{className:`tpl-chip-state`,children:u}),t[4]=u,t[5]=d);let f;return t[6]!==i||t[7]!==a||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==d?(f=(0,y.jsxs)(`button`,{type:`button`,className:s,onClick:o,"aria-pressed":a,title:i,children:[c,l,d]}),t[6]=i,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=d,t[13]=f):f=t[13],f}export{ne as PlanReview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{lt as r}from"./index-
|
|
1
|
+
import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{lt as r}from"./index-DOpl5xzv.js";import{a as i,c as a,d as o,f as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./geometry-DXAbnb0J.js";var g=e({Presence:()=>b}),_=t(),v=n();function y({state:e=`idle`,emotion:t=`neutral`,gaze:n=`center`,muted:g=!1,hidden:y=!1}){let b=`mascot-bell-${(0,_.useId)().replace(/\W/g,``)}`;return(0,v.jsxs)(`div`,{className:`presence`+(y?` is-hidden`:``),"data-state":e,"data-emotion":t,"data-gaze":n,role:`img`,"aria-label":`Mavéa presence — ${e}`,children:[(0,v.jsx)(`div`,{className:`aura`}),(0,v.jsxs)(`svg`,{className:`mascot`,viewBox:`0 0 200 220`,"aria-hidden":`true`,focusable:`false`,children:[(0,v.jsx)(`defs`,{children:(0,v.jsxs)(`linearGradient`,{id:b,x1:`40`,y1:`60`,x2:`160`,y2:`104`,gradientUnits:`userSpaceOnUse`,children:[(0,v.jsx)(`stop`,{className:`bell-stop s1`,offset:`0`}),(0,v.jsx)(`stop`,{className:`bell-stop s2`,offset:`0.5`}),(0,v.jsx)(`stop`,{className:`bell-stop s3`,offset:`1`})]})}),(0,v.jsxs)(`g`,{className:`jelly`,children:[(0,v.jsx)(`g`,{className:`curtains long`,children:s.map((e,t)=>(0,v.jsxs)(`g`,{className:`curtain c${t+1}`,children:[(0,v.jsx)(`path`,{className:`tube`,d:e,pathLength:100}),(0,v.jsx)(`path`,{className:`strand`,d:e,pathLength:100}),(0,v.jsx)(`path`,{className:`beads`,d:e,pathLength:100}),(0,v.jsx)(`path`,{className:`shimmer`,d:e,pathLength:100})]},t))}),(0,v.jsx)(`g`,{className:`curtains short`,children:h.map((e,t)=>(0,v.jsxs)(`g`,{className:`curtain c${t+1}`,children:[(0,v.jsx)(`path`,{className:`tube`,d:e,pathLength:100}),(0,v.jsx)(`path`,{className:`strand`,d:e,pathLength:100})]},t))}),(0,v.jsxs)(`g`,{className:`curtain found`,children:[(0,v.jsx)(`path`,{className:`tube`,d:l,pathLength:100}),(0,v.jsx)(`path`,{className:`strand`,d:l,pathLength:100}),(0,v.jsx)(`path`,{className:`beads`,d:l,pathLength:100}),(0,v.jsx)(`circle`,{className:`found-dot`,cx:`152`,cy:`144`,r:`6`})]}),(0,v.jsxs)(`g`,{className:`glyph question`,children:[(0,v.jsx)(`path`,{className:`stroke`,d:a,pathLength:100}),(0,v.jsx)(`circle`,{className:`dot`,cx:`100`,cy:`186`,r:`4`})]}),(0,v.jsx)(`g`,{className:`glyph heart`,children:(0,v.jsx)(`path`,{className:`stroke`,d,pathLength:100})}),(0,v.jsxs)(`g`,{className:`glyph idea`,children:[(0,v.jsx)(`circle`,{className:`halo`,cx:`100`,cy:`163`,r:`15`}),p.map((e,t)=>(0,v.jsx)(`path`,{className:`stroke`,d:e,pathLength:100},t))]}),(0,v.jsx)(`g`,{className:`glyph check`,children:(0,v.jsx)(`path`,{className:`stroke`,d:i,pathLength:100})}),(0,v.jsxs)(`g`,{className:`bell`,children:[(0,v.jsx)(`path`,{className:`bell-body`,d:m,fill:`url(#${b})`}),(0,v.jsx)(`path`,{className:`bell-sheen`,d:u}),(0,v.jsx)(`path`,{className:`band b1`,d:`M52 74 C70 62 130 62 148 74`}),(0,v.jsx)(`path`,{className:`band b2`,d:`M58 56 C76 46 124 46 142 56`}),(0,v.jsxs)(`g`,{className:`face`,children:[f.map(({side:e,cx:t,cy:n})=>(0,v.jsx)(`ellipse`,{className:`cheek ${e}`,cx:t,cy:n,rx:8,ry:5},e)),(0,v.jsx)(`path`,{className:`brow l`,d:`M70 61 Q80 57 90 61`}),(0,v.jsx)(`path`,{className:`brow r`,d:`M110 61 Q120 57 130 61`}),(0,v.jsx)(`g`,{className:`eyes`,children:c.map(({side:e,x:t,crescent:n,closed:r})=>(0,v.jsxs)(`g`,{className:`eye ${e}`,children:[(0,v.jsxs)(`g`,{className:`blink`,children:[(0,v.jsx)(`circle`,{className:`ball`,cx:t,cy:72,r:9}),(0,v.jsx)(`circle`,{className:`pupil`,cx:t,cy:72.7,r:5.2}),(0,v.jsx)(`circle`,{className:`glint g1`,cx:t+2.5,cy:69.3,r:2.3}),(0,v.jsx)(`circle`,{className:`glint g2`,cx:t-2,cy:75.1,r:1.2})]}),(0,v.jsx)(`path`,{className:`crescent`,d:n}),(0,v.jsx)(`path`,{className:`closed`,d:r})]},e))}),(0,v.jsxs)(`g`,{className:`mouth`,children:[(0,v.jsx)(`path`,{className:`smile`,d:o}),(0,v.jsx)(`path`,{className:`frown`,d:`M92 96 Q100 91 108 96`}),(0,v.jsx)(`circle`,{className:`oo`,cx:`100`,cy:`92.5`,r:`4`}),(0,v.jsxs)(`g`,{className:`mouth-open`,children:[(0,v.jsx)(`path`,{className:`mouth-fill`,d:`M89 86 Q100 100 111 86 Z`}),(0,v.jsx)(`path`,{className:`tongue`,d:`M93 95 Q100 99 107 95`})]})]})]})]}),(0,v.jsxs)(`g`,{className:`sparks`,children:[(0,v.jsx)(`path`,{d:`M36 44 L36 56 M30 50 L42 50`}),(0,v.jsx)(`path`,{d:`M166 34 L166 46 M160 40 L172 40`}),(0,v.jsx)(`path`,{d:`M174 84 L182 84`})]}),(0,v.jsxs)(`g`,{className:`zzz`,children:[(0,v.jsx)(`text`,{x:`148`,y:`36`,children:`z`}),(0,v.jsx)(`text`,{x:`160`,y:`22`,children:`z`})]})]})]}),g&&(0,v.jsx)(`div`,{className:`muted-badge`,title:`Mavéa's voice is muted`,children:(0,v.jsx)(r,{})})]})}var b=(0,_.memo)(y);export{g as n,b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{i as r,n as i,o as a}from"./notes-BG5QP-Dj.js";import{t as o}from"./registry-CNr6L-3z.js";import{t as s}from"./pageVisibility-BxUVsw7Z.js";var c=n(),l=e(),u=t(),d=10,f=5,p=1500,m=60,h=1.5;function g(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function _(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?!0:e.isContentEditable:!1}var v=[{keys:`→ / Space / Page Down`,action:`Next slide`},{keys:`← / Page Up`,action:`Previous slide`},{keys:`Home / End`,action:`First / last slide`},{keys:`0–9, then Enter`,action:`Jump to a slide number`},{keys:`B`,action:`Blackout the screen`},{keys:`W`,action:`Whiteout the screen`},{keys:`F`,action:`Toggle fullscreen`},{keys:`O or G`,action:`Overview — every slide at once`},{keys:`S`,action:`Presenter notes`},{keys:`R`,action:`Reset the timer`},{keys:`X`,action:`Skip this slide for this run (restore it from the overview)`},{keys:`?`,action:`This help`},{keys:`Esc`,action:`Close the topmost panel — or end the show`}];function ee(e){let t=(0,c.c)(24),{slides:n,skipped:i,skin:a,selected:o,presentedIndex:s,onJump:l,onToggleSkip:d,onClose:f}=e,p;t[0]===f?p=t[1]:(p=(0,u.jsx)(`button`,{type:`button`,className:`preso-overview-close`,onClick:f,"aria-label":`Close overview`,children:`×`}),t[0]=f,t[1]=p);let m;t[2]===i.size?m=t[3]:(m=i.size>0&&(0,u.jsxs)(`div`,{className:`preso-overview-skipnote`,children:[i.size,` slide`,i.size===1?``:`s`,` skipped this run`]}),t[2]=i.size,t[3]=m);let h;if(t[4]!==l||t[5]!==d||t[6]!==s||t[7]!==o||t[8]!==a||t[9]!==n){let e;t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==o||t[15]!==a||t[16]!==n.length?(e=(e,t)=>{let i=s(t),c=i<0;return(0,u.jsxs)(`div`,{className:`preso-overview-cell`+(!c&&i===o?` is-selected`:``)+(c?` is-skipped`:``),children:[(0,u.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":!c&&i===o,className:`preso-overview-open`,"aria-label":c?`Slide ${t+1}, skipped — restore it`:`Go to slide ${t+1}`,onClick:()=>c?d(e.id):l(i),children:[(0,u.jsx)(`span`,{className:`preso-overview-thumb`,children:(0,u.jsx)(r,{slide:e,skin:a,ctx:{index:t,total:n.length}})}),(0,u.jsx)(`span`,{className:`preso-overview-num`,children:t+1})]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-overview-skip`,"aria-label":c?`Restore slide ${t+1}`:`Skip slide ${t+1} this run`,title:c?`Restore`:`Skip for this run`,onClick:()=>d(e.id),children:c?`↩`:`×`})]},e.id)},t[11]=l,t[12]=d,t[13]=s,t[14]=o,t[15]=a,t[16]=n.length,t[17]=e):e=t[17],h=n.map(e),t[4]=l,t[5]=d,t[6]=s,t[7]=o,t[8]=a,t[9]=n,t[10]=h}else h=t[10];let g;t[18]===h?g=t[19]:(g=(0,u.jsx)(`div`,{className:`preso-overview-grid`,children:h}),t[18]=h,t[19]=g);let _;return t[20]!==p||t[21]!==m||t[22]!==g?(_=(0,u.jsxs)(`div`,{className:`preso-overview`,role:`listbox`,"aria-label":`All slides`,children:[p,m,g]}),t[20]=p,t[21]=m,t[22]=g,t[23]=_):_=t[23],_}function te(e){let t=(0,c.c)(6),{onClose:n}=e,r;t[0]===n?r=t[1]:(r=(0,u.jsx)(`button`,{type:`button`,className:`preso-help-close`,onClick:n,"aria-label":`Close help`,children:`×`}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,u.jsx)(`h2`,{className:`preso-help-title`,children:`Keyboard shortcuts`}),t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,u.jsx)(`dl`,{className:`preso-help-list`,children:v.map(y)}),t[3]=a):a=t[3];let o;return t[4]===r?o=t[5]:(o=(0,u.jsxs)(`div`,{className:`preso-help`,role:`dialog`,"aria-modal":`true`,"aria-label":`Keyboard shortcuts`,children:[r,i,a]}),t[4]=r,t[5]=o),o}function y(e){return(0,u.jsxs)(`div`,{className:`preso-help-row`,children:[(0,u.jsx)(`dt`,{children:e.keys}),(0,u.jsx)(`dd`,{children:e.action})]},e.keys)}function ne(e){let t=(0,c.c)(3),{mode:n,onDismiss:r}=e,i=`preso-curtain preso-curtain-${n}`,a;return t[0]!==r||t[1]!==i?(a=(0,u.jsx)(`div`,{className:i,role:`presentation`,onClick:r}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function b({spec:e,question:t,narration:n,skinId:c,autoAdvanceMs:v,onExit:y}){let[b]=(0,l.useState)(()=>Date.now()),x=(0,l.useMemo)(()=>a(e?[e]:[],b),[e,b]).slides,[S,re]=(0,l.useState)(new Set),C=(0,l.useMemo)(()=>x.filter(e=>!S.has(e.id)),[x,S]),w=(0,l.useCallback)(e=>{re(t=>{let n=new Set(t);return n.has(e)?n.delete(e):x.filter(e=>!t.has(e.id)).length>1&&n.add(e),n})},[x]),T=o[c],[E,D]=(0,l.useState)(0),[O,k]=(0,l.useState)(!1),[ie,ae]=(0,l.useState)(0),[A,j]=(0,l.useState)(null),[M,N]=(0,l.useState)(!1),[P,F]=(0,l.useState)(0),[I,L]=(0,l.useState)(!1),[R,z]=(0,l.useState)(``),oe=(0,l.useRef)(null),B=(0,l.useRef)(null),V=(0,l.useRef)(null),H=C.length,U=(0,l.useCallback)(e=>Math.max(0,Math.min(H-1,e)),[H]),W=(0,l.useCallback)(()=>D(e=>U(e+1)),[U]),G=(0,l.useCallback)(()=>D(e=>U(e-1)),[U]),K=(0,l.useCallback)(()=>ae(0),[]),q=(0,l.useCallback)(()=>{let e=oe.current;e&&(document.fullscreenElement===e?document.exitFullscreen().catch(()=>{}):e.requestFullscreen?.().catch(()=>{}))},[]);(0,l.useEffect)(()=>()=>{B.current!==null&&window.clearTimeout(B.current)},[]);let se=(0,l.useCallback)(e=>{z(t=>t+e),B.current!==null&&window.clearTimeout(B.current),B.current=window.setTimeout(()=>z(``),p)},[]),ce=(0,l.useCallback)(()=>{B.current!==null&&(window.clearTimeout(B.current),B.current=null),R&&D(U(Number(R)-1)),z(``)},[R,U]);(0,l.useEffect)(()=>{let e=window.setInterval(()=>{s()||ae(e=>e+1)},1e3);return()=>window.clearInterval(e)},[]),(0,l.useEffect)(()=>{if(!v)return;let e=window.setInterval(()=>{s()||D(e=>e>=H-1?e:U(e+1))},v);return()=>window.clearInterval(e)},[v,H,U]),(0,l.useEffect)(()=>{let e=e=>{if(!_(e.target)){if(e.key===`Escape`){I?(e.preventDefault(),e.stopPropagation(),L(!1)):M?(e.preventDefault(),e.stopPropagation(),N(!1)):A?(e.preventDefault(),e.stopPropagation(),j(null)):O?(e.preventDefault(),e.stopPropagation(),k(!1)):y();return}if(I){e.key===`?`&&(e.preventDefault(),L(!1));return}if(M){if(e.key===`ArrowRight`){e.preventDefault(),F(e=>Math.min(H-1,e+1));return}else if(e.key===`ArrowLeft`){e.preventDefault(),F(e=>Math.max(0,e-1));return}else if(e.key===`ArrowDown`){e.preventDefault(),F(e=>Math.min(H-1,e+f));return}else if(e.key===`ArrowUp`){e.preventDefault(),F(e=>Math.max(0,e-f));return}else if(e.key===`Enter`){e.preventDefault(),D(P),N(!1);return}}if(R&&!/^[0-9]$/.test(e.key)&&e.key!==`Enter`&&(B.current!==null&&(window.clearTimeout(B.current),B.current=null),z(``)),e.key===`ArrowRight`||e.key===`PageDown`||e.key===` `)e.preventDefault(),j(null),W();else if(e.key===`ArrowLeft`||e.key===`PageUp`)e.preventDefault(),j(null),G();else if(e.key===`Home`)e.preventDefault(),j(null),D(0);else if(e.key===`End`)e.preventDefault(),j(null),D(H-1);else if(e.key===`s`||e.key===`S`)k(e=>!e);else if(e.key===`b`||e.key===`B`)j(e=>e===`black`?null:`black`);else if(e.key===`w`||e.key===`W`)j(e=>e===`white`?null:`white`);else if(e.key===`f`||e.key===`F`)q();else if(e.key===`o`||e.key===`O`||e.key===`g`||e.key===`G`)M?N(!1):(F(U(E)),N(!0));else if(e.key===`?`)L(e=>!e);else if(e.key===`x`||e.key===`X`){let e=C[U(E)];e&&w(e.id)}else e.key===`r`||e.key===`R`?K():e.key===`Enter`?R&&(e.preventDefault(),ce()):/^[0-9]$/.test(e.key)&&(e.preventDefault(),se(e.key))}};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[W,G,H,U,E,y,I,M,P,A,O,R,q,K,se,ce,C,w]);let J=U(E),Y=C[J],X=(0,l.useRef)(J),le=J>=X.current?`next`:`prev`,[Z,Q]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(X.current===J)return;Q(X.current),X.current=J;let e=window.setTimeout(()=>Q(null),380);return()=>window.clearTimeout(e)},[J]);let ue=Y?.notes??(Y?.kind===`cover`?n||t||``:i(Y)),$=C[J+1],de=$?i($):`— end —`,fe=H?Math.round((J+1)/H*100):0,pe=(0,l.useCallback)(e=>{e.pointerType!==`touch`&&e.pointerType!==`pen`||e.target instanceof Element&&e.target.closest(`button`)||(V.current={x:e.clientX,y:e.clientY})},[]),me=(0,l.useCallback)(e=>{let t=V.current;if(V.current=null,!t||e.pointerType!==`touch`&&e.pointerType!==`pen`)return;let n=e.clientX-t.x,r=e.clientY-t.y;Math.abs(n)<m||Math.abs(n)<Math.abs(r)*h||(j(null),n<0?W():G())},[W,G]);return(0,u.jsxs)(`div`,{className:`preso-deck`,role:`region`,"aria-label":`Presentation`,style:{background:`#0a0c11`},ref:oe,children:[(0,u.jsx)(`div`,{className:`preso-sr`,"aria-live":`polite`,"aria-atomic":`true`,children:A?A===`black`?`Screen blacked out.`:`Screen whited out.`:H?`Slide ${J+1} of ${H}: ${i(Y)||Y?.kind||``}`:``}),(0,u.jsx)(`div`,{className:`preso-stage`,onPointerDown:pe,onPointerUp:me,children:(0,u.jsxs)(`div`,{className:`preso-skinframe`,style:{aspectRatio:`16 / 9`,width:`min(86vw, calc(84vh * 16 / 9))`,margin:`auto`,position:`relative`,borderRadius:12,overflow:`hidden`,border:`1px solid rgba(255,255,255,.08)`,boxShadow:`0 30px 90px rgba(0,0,0,.55)`},children:[Z!==null&&Z!==J&&C[Z]&&(0,u.jsx)(`div`,{className:`preso-slide-ghost`,"aria-hidden":!0,children:(0,u.jsx)(r,{slide:C[Z],skin:T,ctx:{index:Z,total:H}})}),Y&&(0,u.jsx)(`div`,{className:`preso-slide-anim preso-dir-${le}`,children:(0,u.jsx)(r,{slide:Y,skin:T,ctx:{index:J,total:H}})},J)]})}),(0,u.jsx)(`button`,{type:`button`,className:`preso-zone preso-zone-prev`,onClick:G,"aria-label":`Previous slide`,disabled:E===0}),(0,u.jsx)(`button`,{type:`button`,className:`preso-zone preso-zone-next`,onClick:W,"aria-label":`Next slide`,disabled:E>=H-1}),(0,u.jsxs)(`div`,{className:`preso-rail`,children:[R&&(0,u.jsxs)(`span`,{className:`preso-jumpchip`,role:`status`,children:[(0,u.jsx)(`span`,{"aria-hidden":!0,children:`→`}),` `,R]}),(0,u.jsxs)(`span`,{className:`preso-count`,children:[J+1,` / `,H]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-jump`,onClick:()=>D(0),"aria-label":`First slide`,disabled:J===0,children:`⤒`}),H<=d&&(0,u.jsx)(`div`,{className:`preso-dots`,role:`presentation`,children:C.map((e,t)=>(0,u.jsx)(`button`,{type:`button`,className:`preso-dot`+(t===J?` is-active`:``),onClick:()=>D(t),"aria-label":`Go to slide ${t+1}`,"aria-current":t===J},t))}),(0,u.jsx)(`button`,{type:`button`,className:`preso-jump`,onClick:()=>D(H-1),"aria-label":`Last slide`,disabled:J>=H-1,children:`⤓`}),(0,u.jsx)(`button`,{type:`button`,className:`preso-notes-btn`+(O?` is-on`:``),onClick:()=>k(e=>!e),"aria-pressed":O,title:`Presenter notes (S)`,children:`Notes`})]}),O&&(0,u.jsxs)(`aside`,{className:`preso-presenter`,"aria-label":`Presenter notes`,children:[(0,u.jsxs)(`div`,{className:`preso-presenter-head`,children:[(0,u.jsx)(`button`,{type:`button`,className:`preso-timer`,onClick:K,title:`Reset timer (R)`,children:g(ie)}),(0,u.jsxs)(`span`,{className:`preso-presenter-pct`,children:[fe,`%`]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-presenter-close`,onClick:()=>k(!1),"aria-label":`Hide presenter notes`,children:`×`})]}),(0,u.jsx)(`div`,{className:`preso-presenter-progress`,"aria-hidden":!0,children:(0,u.jsx)(`span`,{style:{width:`${fe}%`}})}),(0,u.jsxs)(`p`,{className:`preso-presenter-slide`,children:[J+1,`. `,i(Y)||Y?.kind]}),(0,u.jsx)(`p`,{className:`preso-presenter-notes`,children:ue||`No notes for this slide.`}),(0,u.jsxs)(`div`,{className:`preso-presenter-next`,children:[(0,u.jsx)(`span`,{className:`preso-presenter-next-label`,children:`Next`}),$?(0,u.jsx)(`div`,{className:`preso-presenter-thumb`,children:(0,u.jsx)(r,{slide:$,skin:T,ctx:{index:J+1,total:H}})}):null,(0,u.jsx)(`span`,{className:`preso-presenter-next-text`,children:de})]})]}),A&&(0,u.jsx)(ne,{mode:A,onDismiss:()=>j(null)}),M&&(0,u.jsx)(ee,{slides:x,skipped:S,skin:T,selected:P,presentedIndex:e=>S.has(x[e].id)?-1:x.slice(0,e).filter(e=>!S.has(e.id)).length,onJump:e=>{D(e),N(!1)},onToggleSkip:w,onClose:()=>N(!1)}),I&&(0,u.jsx)(te,{onClose:()=>L(!1)})]})}export{b as PresentationDeck};
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DOpl5xzv.js";import{i as r,n as i,o as a}from"./notes-D_uDKcr5.js";import{t as o}from"./registry-Bj8q4igW.js";import{t as s}from"./pageVisibility-BxUVsw7Z.js";var c=n(),l=e(),u=t(),d=10,f=5,p=1500,m=60,h=1.5;function g(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function _(e){return e instanceof HTMLElement?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?!0:e.isContentEditable:!1}var v=[{keys:`→ / Space / Page Down`,action:`Next slide`},{keys:`← / Page Up`,action:`Previous slide`},{keys:`Home / End`,action:`First / last slide`},{keys:`0–9, then Enter`,action:`Jump to a slide number`},{keys:`B`,action:`Blackout the screen`},{keys:`W`,action:`Whiteout the screen`},{keys:`F`,action:`Toggle fullscreen`},{keys:`O or G`,action:`Overview — every slide at once`},{keys:`S`,action:`Presenter notes`},{keys:`R`,action:`Reset the timer`},{keys:`X`,action:`Skip this slide for this run (restore it from the overview)`},{keys:`?`,action:`This help`},{keys:`Esc`,action:`Close the topmost panel — or end the show`}];function ee(e){let t=(0,c.c)(24),{slides:n,skipped:i,skin:a,selected:o,presentedIndex:s,onJump:l,onToggleSkip:d,onClose:f}=e,p;t[0]===f?p=t[1]:(p=(0,u.jsx)(`button`,{type:`button`,className:`preso-overview-close`,onClick:f,"aria-label":`Close overview`,children:`×`}),t[0]=f,t[1]=p);let m;t[2]===i.size?m=t[3]:(m=i.size>0&&(0,u.jsxs)(`div`,{className:`preso-overview-skipnote`,children:[i.size,` slide`,i.size===1?``:`s`,` skipped this run`]}),t[2]=i.size,t[3]=m);let h;if(t[4]!==l||t[5]!==d||t[6]!==s||t[7]!==o||t[8]!==a||t[9]!==n){let e;t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==o||t[15]!==a||t[16]!==n.length?(e=(e,t)=>{let i=s(t),c=i<0;return(0,u.jsxs)(`div`,{className:`preso-overview-cell`+(!c&&i===o?` is-selected`:``)+(c?` is-skipped`:``),children:[(0,u.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":!c&&i===o,className:`preso-overview-open`,"aria-label":c?`Slide ${t+1}, skipped — restore it`:`Go to slide ${t+1}`,onClick:()=>c?d(e.id):l(i),children:[(0,u.jsx)(`span`,{className:`preso-overview-thumb`,children:(0,u.jsx)(r,{slide:e,skin:a,ctx:{index:t,total:n.length}})}),(0,u.jsx)(`span`,{className:`preso-overview-num`,children:t+1})]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-overview-skip`,"aria-label":c?`Restore slide ${t+1}`:`Skip slide ${t+1} this run`,title:c?`Restore`:`Skip for this run`,onClick:()=>d(e.id),children:c?`↩`:`×`})]},e.id)},t[11]=l,t[12]=d,t[13]=s,t[14]=o,t[15]=a,t[16]=n.length,t[17]=e):e=t[17],h=n.map(e),t[4]=l,t[5]=d,t[6]=s,t[7]=o,t[8]=a,t[9]=n,t[10]=h}else h=t[10];let g;t[18]===h?g=t[19]:(g=(0,u.jsx)(`div`,{className:`preso-overview-grid`,children:h}),t[18]=h,t[19]=g);let _;return t[20]!==p||t[21]!==m||t[22]!==g?(_=(0,u.jsxs)(`div`,{className:`preso-overview`,role:`listbox`,"aria-label":`All slides`,children:[p,m,g]}),t[20]=p,t[21]=m,t[22]=g,t[23]=_):_=t[23],_}function te(e){let t=(0,c.c)(6),{onClose:n}=e,r;t[0]===n?r=t[1]:(r=(0,u.jsx)(`button`,{type:`button`,className:`preso-help-close`,onClick:n,"aria-label":`Close help`,children:`×`}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,u.jsx)(`h2`,{className:`preso-help-title`,children:`Keyboard shortcuts`}),t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,u.jsx)(`dl`,{className:`preso-help-list`,children:v.map(y)}),t[3]=a):a=t[3];let o;return t[4]===r?o=t[5]:(o=(0,u.jsxs)(`div`,{className:`preso-help`,role:`dialog`,"aria-modal":`true`,"aria-label":`Keyboard shortcuts`,children:[r,i,a]}),t[4]=r,t[5]=o),o}function y(e){return(0,u.jsxs)(`div`,{className:`preso-help-row`,children:[(0,u.jsx)(`dt`,{children:e.keys}),(0,u.jsx)(`dd`,{children:e.action})]},e.keys)}function ne(e){let t=(0,c.c)(3),{mode:n,onDismiss:r}=e,i=`preso-curtain preso-curtain-${n}`,a;return t[0]!==r||t[1]!==i?(a=(0,u.jsx)(`div`,{className:i,role:`presentation`,onClick:r}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function b({spec:e,question:t,narration:n,skinId:c,autoAdvanceMs:v,onExit:y}){let[b]=(0,l.useState)(()=>Date.now()),x=(0,l.useMemo)(()=>a(e?[e]:[],b),[e,b]).slides,[S,re]=(0,l.useState)(new Set),C=(0,l.useMemo)(()=>x.filter(e=>!S.has(e.id)),[x,S]),w=(0,l.useCallback)(e=>{re(t=>{let n=new Set(t);return n.has(e)?n.delete(e):x.filter(e=>!t.has(e.id)).length>1&&n.add(e),n})},[x]),T=o[c],[E,D]=(0,l.useState)(0),[O,k]=(0,l.useState)(!1),[ie,ae]=(0,l.useState)(0),[A,j]=(0,l.useState)(null),[M,N]=(0,l.useState)(!1),[P,F]=(0,l.useState)(0),[I,L]=(0,l.useState)(!1),[R,z]=(0,l.useState)(``),oe=(0,l.useRef)(null),B=(0,l.useRef)(null),V=(0,l.useRef)(null),H=C.length,U=(0,l.useCallback)(e=>Math.max(0,Math.min(H-1,e)),[H]),W=(0,l.useCallback)(()=>D(e=>U(e+1)),[U]),G=(0,l.useCallback)(()=>D(e=>U(e-1)),[U]),K=(0,l.useCallback)(()=>ae(0),[]),q=(0,l.useCallback)(()=>{let e=oe.current;e&&(document.fullscreenElement===e?document.exitFullscreen().catch(()=>{}):e.requestFullscreen?.().catch(()=>{}))},[]);(0,l.useEffect)(()=>()=>{B.current!==null&&window.clearTimeout(B.current)},[]);let se=(0,l.useCallback)(e=>{z(t=>t+e),B.current!==null&&window.clearTimeout(B.current),B.current=window.setTimeout(()=>z(``),p)},[]),ce=(0,l.useCallback)(()=>{B.current!==null&&(window.clearTimeout(B.current),B.current=null),R&&D(U(Number(R)-1)),z(``)},[R,U]);(0,l.useEffect)(()=>{let e=window.setInterval(()=>{s()||ae(e=>e+1)},1e3);return()=>window.clearInterval(e)},[]),(0,l.useEffect)(()=>{if(!v)return;let e=window.setInterval(()=>{s()||D(e=>e>=H-1?e:U(e+1))},v);return()=>window.clearInterval(e)},[v,H,U]),(0,l.useEffect)(()=>{let e=e=>{if(!_(e.target)){if(e.key===`Escape`){I?(e.preventDefault(),e.stopPropagation(),L(!1)):M?(e.preventDefault(),e.stopPropagation(),N(!1)):A?(e.preventDefault(),e.stopPropagation(),j(null)):O?(e.preventDefault(),e.stopPropagation(),k(!1)):y();return}if(I){e.key===`?`&&(e.preventDefault(),L(!1));return}if(M){if(e.key===`ArrowRight`){e.preventDefault(),F(e=>Math.min(H-1,e+1));return}else if(e.key===`ArrowLeft`){e.preventDefault(),F(e=>Math.max(0,e-1));return}else if(e.key===`ArrowDown`){e.preventDefault(),F(e=>Math.min(H-1,e+f));return}else if(e.key===`ArrowUp`){e.preventDefault(),F(e=>Math.max(0,e-f));return}else if(e.key===`Enter`){e.preventDefault(),D(P),N(!1);return}}if(R&&!/^[0-9]$/.test(e.key)&&e.key!==`Enter`&&(B.current!==null&&(window.clearTimeout(B.current),B.current=null),z(``)),e.key===`ArrowRight`||e.key===`PageDown`||e.key===` `)e.preventDefault(),j(null),W();else if(e.key===`ArrowLeft`||e.key===`PageUp`)e.preventDefault(),j(null),G();else if(e.key===`Home`)e.preventDefault(),j(null),D(0);else if(e.key===`End`)e.preventDefault(),j(null),D(H-1);else if(e.key===`s`||e.key===`S`)k(e=>!e);else if(e.key===`b`||e.key===`B`)j(e=>e===`black`?null:`black`);else if(e.key===`w`||e.key===`W`)j(e=>e===`white`?null:`white`);else if(e.key===`f`||e.key===`F`)q();else if(e.key===`o`||e.key===`O`||e.key===`g`||e.key===`G`)M?N(!1):(F(U(E)),N(!0));else if(e.key===`?`)L(e=>!e);else if(e.key===`x`||e.key===`X`){let e=C[U(E)];e&&w(e.id)}else e.key===`r`||e.key===`R`?K():e.key===`Enter`?R&&(e.preventDefault(),ce()):/^[0-9]$/.test(e.key)&&(e.preventDefault(),se(e.key))}};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[W,G,H,U,E,y,I,M,P,A,O,R,q,K,se,ce,C,w]);let J=U(E),Y=C[J],X=(0,l.useRef)(J),le=J>=X.current?`next`:`prev`,[Z,Q]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(X.current===J)return;Q(X.current),X.current=J;let e=window.setTimeout(()=>Q(null),380);return()=>window.clearTimeout(e)},[J]);let ue=Y?.notes??(Y?.kind===`cover`?n||t||``:i(Y)),$=C[J+1],de=$?i($):`— end —`,fe=H?Math.round((J+1)/H*100):0,pe=(0,l.useCallback)(e=>{e.pointerType!==`touch`&&e.pointerType!==`pen`||e.target instanceof Element&&e.target.closest(`button`)||(V.current={x:e.clientX,y:e.clientY})},[]),me=(0,l.useCallback)(e=>{let t=V.current;if(V.current=null,!t||e.pointerType!==`touch`&&e.pointerType!==`pen`)return;let n=e.clientX-t.x,r=e.clientY-t.y;Math.abs(n)<m||Math.abs(n)<Math.abs(r)*h||(j(null),n<0?W():G())},[W,G]);return(0,u.jsxs)(`div`,{className:`preso-deck`,role:`region`,"aria-label":`Presentation`,style:{background:`#0a0c11`},ref:oe,children:[(0,u.jsx)(`div`,{className:`preso-sr`,"aria-live":`polite`,"aria-atomic":`true`,children:A?A===`black`?`Screen blacked out.`:`Screen whited out.`:H?`Slide ${J+1} of ${H}: ${i(Y)||Y?.kind||``}`:``}),(0,u.jsx)(`div`,{className:`preso-stage`,onPointerDown:pe,onPointerUp:me,children:(0,u.jsxs)(`div`,{className:`preso-skinframe`,style:{aspectRatio:`16 / 9`,width:`min(86vw, calc(84vh * 16 / 9))`,margin:`auto`,position:`relative`,borderRadius:12,overflow:`hidden`,border:`1px solid rgba(255,255,255,.08)`,boxShadow:`0 30px 90px rgba(0,0,0,.55)`},children:[Z!==null&&Z!==J&&C[Z]&&(0,u.jsx)(`div`,{className:`preso-slide-ghost`,"aria-hidden":!0,children:(0,u.jsx)(r,{slide:C[Z],skin:T,ctx:{index:Z,total:H}})}),Y&&(0,u.jsx)(`div`,{className:`preso-slide-anim preso-dir-${le}`,children:(0,u.jsx)(r,{slide:Y,skin:T,ctx:{index:J,total:H}})},J)]})}),(0,u.jsx)(`button`,{type:`button`,className:`preso-zone preso-zone-prev`,onClick:G,"aria-label":`Previous slide`,disabled:E===0}),(0,u.jsx)(`button`,{type:`button`,className:`preso-zone preso-zone-next`,onClick:W,"aria-label":`Next slide`,disabled:E>=H-1}),(0,u.jsxs)(`div`,{className:`preso-rail`,children:[R&&(0,u.jsxs)(`span`,{className:`preso-jumpchip`,role:`status`,children:[(0,u.jsx)(`span`,{"aria-hidden":!0,children:`→`}),` `,R]}),(0,u.jsxs)(`span`,{className:`preso-count`,children:[J+1,` / `,H]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-jump`,onClick:()=>D(0),"aria-label":`First slide`,disabled:J===0,children:`⤒`}),H<=d&&(0,u.jsx)(`div`,{className:`preso-dots`,role:`presentation`,children:C.map((e,t)=>(0,u.jsx)(`button`,{type:`button`,className:`preso-dot`+(t===J?` is-active`:``),onClick:()=>D(t),"aria-label":`Go to slide ${t+1}`,"aria-current":t===J},t))}),(0,u.jsx)(`button`,{type:`button`,className:`preso-jump`,onClick:()=>D(H-1),"aria-label":`Last slide`,disabled:J>=H-1,children:`⤓`}),(0,u.jsx)(`button`,{type:`button`,className:`preso-notes-btn`+(O?` is-on`:``),onClick:()=>k(e=>!e),"aria-pressed":O,title:`Presenter notes (S)`,children:`Notes`})]}),O&&(0,u.jsxs)(`aside`,{className:`preso-presenter`,"aria-label":`Presenter notes`,children:[(0,u.jsxs)(`div`,{className:`preso-presenter-head`,children:[(0,u.jsx)(`button`,{type:`button`,className:`preso-timer`,onClick:K,title:`Reset timer (R)`,children:g(ie)}),(0,u.jsxs)(`span`,{className:`preso-presenter-pct`,children:[fe,`%`]}),(0,u.jsx)(`button`,{type:`button`,className:`preso-presenter-close`,onClick:()=>k(!1),"aria-label":`Hide presenter notes`,children:`×`})]}),(0,u.jsx)(`div`,{className:`preso-presenter-progress`,"aria-hidden":!0,children:(0,u.jsx)(`span`,{style:{width:`${fe}%`}})}),(0,u.jsxs)(`p`,{className:`preso-presenter-slide`,children:[J+1,`. `,i(Y)||Y?.kind]}),(0,u.jsx)(`p`,{className:`preso-presenter-notes`,children:ue||`No notes for this slide.`}),(0,u.jsxs)(`div`,{className:`preso-presenter-next`,children:[(0,u.jsx)(`span`,{className:`preso-presenter-next-label`,children:`Next`}),$?(0,u.jsx)(`div`,{className:`preso-presenter-thumb`,children:(0,u.jsx)(r,{slide:$,skin:T,ctx:{index:J+1,total:H}})}):null,(0,u.jsx)(`span`,{className:`preso-presenter-next-text`,children:de})]})]}),A&&(0,u.jsx)(ne,{mode:A,onDismiss:()=>j(null)}),M&&(0,u.jsx)(ee,{slides:x,skipped:S,skin:T,selected:P,presentedIndex:e=>S.has(x[e].id)?-1:x.slice(0,e).filter(e=>!S.has(e.id)).length,onJump:e=>{D(e),N(!1)},onToggleSkip:w,onClose:()=>N(!1)}),I&&(0,u.jsx)(te,{onClose:()=>L(!1)})]})}export{b as PresentationDeck};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrismOverlay-
|
|
2
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{I as n,J as r,L as i,M as a,N as o,ht as s,k as ee,q as c}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrismOverlay-Cq3DBJ-N.js","assets/index-DOpl5xzv.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/sourceHost-BV3t2XDb.js","assets/toast-BBNs2h3L.js","assets/penStrokes-DlHnO9xE.js","assets/gesture-Bouqjr3g.js","assets/citation-BcvmjKS8.js","assets/verbatim-CBMzUDlf.js","assets/officeDoc-B6nEhNp4.js","assets/search-Be63DJkp.js","assets/streamParse-DRgMHWye.js","assets/useFocusTrap-DbfG6zbM.js","assets/PrismOverlay-BTfAicBt.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{I as n,J as r,L as i,M as a,N as o,ht as s,k as ee,q as c}from"./index-DOpl5xzv.js";import{n as l}from"./icons-CHVz6kv_.js";import{t as te}from"./FeatureUseNotice-CoK5HkbR.js";import{c as ne,i as re,p as ie,u as ae}from"./providers-wzm7E8Pa.js";import{t as oe}from"./homeTarget-BcZYH3DY.js";import{l as se,n as ce}from"./useLiveConfig-DIvKKKpP.js";/* empty css */var u=s(),d=e(),f=t();r();var p=n(()=>c(()=>import(`./PrismOverlay-Cq3DBJ-N.js`).then(e=>({default:e.PrismOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),le=p.Component,m={"too-large":`File is too large. Documents up to 40 MB, images up to 10 MB.`,unsupported:`Unsupported file type. Try a PDF, Word doc, spreadsheet, image, or text file.`};function h(){let e=(0,u.c)(40),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=oe(),e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1],(0,d.useEffect)(de,r);let a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],e[2]=a):a=e[2];let[o,s]=(0,d.useState)(a),[c,h]=(0,d.useState)(null),[b,x]=(0,d.useState)(!1),[S,C]=(0,d.useState)(!1),[w,T]=(0,d.useState)(null),E=(0,d.useRef)(null),D;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=se(ce()),e[3]=D):D=e[3];let fe=D,O;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(O=async e=>{if(!e||e.length===0)return;p.preload().catch(y),T(null);let t=Array.from(e).flatMap(e=>{let t=ne(e);return t?(T(m[t]),[]):[e]});t.length>0&&s(e=>{let n=new Set(e.map(v));return[...e,...t.filter(e=>!n.has(e.name))]}),E.current&&(E.current.value=``)},e[4]=O):O=e[4];let k=O,A;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{s(t=>t.filter(t=>t.name!==e))},e[5]=A):A=e[5];let pe=A,j;e[6]!==b||e[7]!==o?(j=async()=>{if(o.length===0||b)return;x(!0),T(null),p.preload().catch(_);let e=await Promise.all(o.map(ie)),t=e.flatMap(g);t.length===o.length?h(t):T(m[e.find(ue)?.error??`unsupported`]),x(!1)},e[6]=b,e[7]=o,e[8]=j):j=e[8];let M=j,N;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{e.preventDefault(),C(!1),k(e.dataTransfer.files)},e[9]=N):N=e[9];let P=N,F;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{e.preventDefault(),C(!0)},e[10]=F):F=e[10];let me=F,I;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{e.currentTarget.contains(e.relatedTarget)||C(!1)},e[11]=I):I=e[11];let he=I;if(c){let t;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(t=()=>h(null),e[12]=t):t=e[12];let n;return e[13]===c?n=e[14]:(n=(0,f.jsx)(ee,{label:`Prism workbench`,overlay:!0,children:(0,f.jsx)(le,{pdf:c,cfg:fe,onClose:t})}),e[13]=c,e[14]=n),n}let L;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{window.location.hash=n.href},e[15]=L):L=e[15];let R;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,f.jsxs)(`header`,{className:`prism-app-header`,children:[(0,f.jsx)(`button`,{type:`button`,className:`prism-app-back`,onClick:L,"aria-label":`Back to ${n.label}`,title:`Back to ${n.label}`,children:(0,f.jsx)(l.chevL,{})}),(0,f.jsx)(`span`,{className:`prism-app-brand`,children:`Prism`})]}),e[16]=R):R=e[16];let z;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,f.jsxs)(`div`,{className:`prism-app-hero`,children:[(0,f.jsx)(`h1`,{className:`prism-app-title`,children:`Understand any document`}),(0,f.jsx)(`p`,{className:`prism-app-lede`,children:`Drop a PDF, Word doc, spreadsheet, or text file. Prism maps every claim, finding, and risk — every card cites its exact source.`}),(0,f.jsx)(te,{kind:`upload`})]}),e[17]=z):z=e[17];let B=`prism-dropzone${S?` prism-dropzone--over`:``}`,V;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>E.current?.click(),e[18]=V):V=e[18];let H,U;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{(e.key===`Enter`||e.key===` `)&&E.current?.click()},U=i(p.preload),e[19]=H,e[20]=U):(H=e[19],U=e[20]);let W,G;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,f.jsx)(`input`,{ref:E,type:`file`,accept:re,multiple:!0,className:`prism-dropzone-input`,onChange:e=>void k(e.target.files),"aria-hidden":`true`}),G=(0,f.jsx)(l.upload,{}),e[21]=W,e[22]=G):(W=e[21],G=e[22]);let K=S?`Drop to add`:o.length>0?`Drop more files or click to add`:`Drop files or click to browse`,q;e[23]===K?q=e[24]:(q=(0,f.jsx)(`span`,{className:`prism-dropzone-label`,children:K}),e[23]=K,e[24]=q);let J;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,f.jsx)(`span`,{className:`prism-dropzone-hint`,children:`PDF · Word · Excel · PowerPoint · Image · Text`}),e[25]=J):J=e[25];let Y;e[26]!==B||e[27]!==q?(Y=(0,f.jsxs)(`div`,{className:B,onDrop:P,onDragOver:me,onDragLeave:he,onClick:V,role:`button`,tabIndex:0,"aria-label":`Upload a document`,onKeyDown:H,...U,children:[W,G,q,J]}),e[26]=B,e[27]=q,e[28]=Y):Y=e[28];let X;e[29]===w?X=e[30]:(X=w&&(0,f.jsx)(`p`,{className:`prism-app-error`,role:`alert`,children:w}),e[29]=w,e[30]=X);let Z;e[31]!==M||e[32]!==b||e[33]!==o?(Z=o.length>0&&(0,f.jsxs)(`div`,{className:`prism-staged`,children:[(0,f.jsx)(`p`,{className:`prism-staged-label`,children:o.length===1?`1 document ready`:`${o.length} documents ready`}),(0,f.jsx)(`ul`,{className:`prism-staged-list`,children:o.map(e=>(0,f.jsxs)(`li`,{className:`prism-staged-item`,children:[(0,f.jsx)(l.doc,{}),(0,f.jsx)(`span`,{className:`prism-staged-name`,children:ae({name:e.name,mime:e.type,data:``,size:e.size})}),(0,f.jsx)(`button`,{type:`button`,className:`prism-staged-remove`,onClick:t=>{t.stopPropagation(),pe(e.name)},"aria-label":`Remove ${e.name}`,children:(0,f.jsx)(l.x,{})})]},e.name))}),(0,f.jsxs)(`button`,{type:`button`,className:`prism-confirm-btn`,onClick:()=>void M(),disabled:b,...i(p.preload),children:[b?`Preparing documents…`:`Open in Prism`,(0,f.jsx)(l.chevR,{})]})]}),e[31]=M,e[32]=b,e[33]=o,e[34]=Z):Z=e[34];let Q;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,f.jsxs)(`ul`,{className:`prism-app-features`,children:[(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Maps claims spatially`}),` — regions, findings, and risks laid out so you can see the whole shape at once.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Every card cites its source`}),` — verbatim quote + page number, always. If Mavéa can't cite it, the card doesn't exist.`]}),(0,f.jsxs)(`li`,{children:[(0,f.jsx)(`strong`,{children:`Ask the whole document`}),` — highlight any claim and ask a follow-up; the answer lights up the exact lines it came from.`]})]}),e[35]=Q):Q=e[35];let $;return e[36]!==Y||e[37]!==X||e[38]!==Z?($=(0,f.jsxs)(`div`,{className:`prism-app`,children:[R,(0,f.jsxs)(`main`,{className:`prism-app-main`,children:[z,Y,X,Z,Q]})]}),e[36]=Y,e[37]=X,e[38]=Z,e[39]=$):$=e[39],$}function ue(e){return e.error}function g(e){return e.attachment?[e.attachment]:[]}function _(){}function v(e){return e.name}function y(){}function de(){return a(o())}export{h as PrismApp};
|
|
@@ -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-DOpl5xzv.js";import{r}from"./sourceHost-BV3t2XDb.js";import{t as i}from"./providers-wzm7E8Pa.js";import{a,t as o}from"./search-Be63DJkp.js";import{t as s}from"./verbatim-CBMzUDlf.js";import{t as c}from"./citation-BcvmjKS8.js";var l=e(),u=n(),d=t(),f={full:{label:`in the document`,token:`var(--insight)`},partial:{label:`partly in the document`,token:`var(--warning)`},none:{label:`not in this document`,token:`var(--text-muted)`}};function p(e,t){return!!e&&e.doc===t.doc&&e.page===t.page&&e.quote===t.quote}function m(e){let t=(0,u.c)(50),{turns:n,busy:i,onAsk:a,onFocusSpan:o,activeSpan:s,multiDoc:c,docLabel:m,onClose:g}=e,[_,v]=(0,l.useState)(``),y=(0,l.useRef)(null),b=(0,l.useRef)(null),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{let e=y.current;e&&(e.scrollTop=e.scrollHeight)},t[0]=x):x=t[0];let S;t[1]===n?S=t[2]:(S=[n],t[1]=n,t[2]=S),(0,l.useEffect)(x,S);let C,w;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{b.current?.focus()},w=[],t[3]=C,t[4]=w):(C=t[3],w=t[4]),(0,l.useEffect)(C,w);let T;t[5]!==i||t[6]!==_||t[7]!==a?(T=()=>{let e=_.trim();!e||i||(a(e),v(``))},t[5]=i,t[6]=_,t[7]=a,t[8]=T):T=t[8];let E=T,D=h,O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,d.jsxs)(`span`,{className:`prism-ask-title`,children:[(0,d.jsx)(`span`,{className:`prism-ask-spark`,"aria-hidden":`true`}),`Ask this document`]}),t[9]=O):O=t[9];let k;t[10]===g?k=t[11]:(k=(0,d.jsxs)(`header`,{className:`prism-ask-head`,children:[O,(0,d.jsx)(`button`,{type:`button`,className:`prism-ask-min`,onClick:g,"aria-label":`Hide the ask panel`,children:`▾`})]}),t[10]=g,t[11]=k);let A;t[12]===n.length?A=t[13]:(A=n.length===0&&(0,d.jsx)(`p`,{className:`prism-ask-empty`,children:`Ask anything. The answer lights up the exact lines on the page — and says so honestly when the document doesn’t cover it.`}),t[12]=n.length,t[13]=A);let j;if(t[14]!==s||t[15]!==m||t[16]!==c||t[17]!==o||t[18]!==n){let e;t[20]!==s||t[21]!==m||t[22]!==c||t[23]!==o?(e=e=>(0,d.jsxs)(`div`,{className:`prism-ask-turn`,children:[(0,d.jsx)(`p`,{className:`prism-ask-q`,children:e.question}),e.status===`pending`&&(0,d.jsxs)(`p`,{className:`prism-ask-pending`,children:[(0,d.jsx)(`span`,{className:`prism-ask-dot`,"aria-hidden":`true`}),`Reading the document…`]}),e.status===`error`&&(0,d.jsx)(`p`,{className:`prism-ask-err`,children:e.error}),e.status===`done`&&e.answer&&(0,d.jsxs)(`div`,{className:`prism-ask-a`,children:[(0,d.jsxs)(`span`,{className:`prism-ask-cover`,"data-coverage":e.answer.coverage,style:{"--cover-color":f[e.answer.coverage].token},children:[(0,d.jsx)(`span`,{className:`prism-ask-cover-dot`,"aria-hidden":`true`}),e.answer.unpinned?`in the document — couldn’t highlight the exact line`:f[e.answer.coverage].label]}),e.answer.text&&(0,d.jsx)(`p`,{className:`prism-ask-text`,children:e.answer.text}),e.answer.spans.length>0&&(0,d.jsx)(`div`,{className:`prism-ask-spans`,role:`group`,"aria-label":`Where this is in the document`,children:e.answer.spans.map((e,t)=>(0,d.jsx)(`button`,{type:`button`,className:`prism-ask-chip`+(p(s,e)?` is-active`:``),onClick:()=>o(e),title:e.quote,children:c?`${m(e.doc)} · p.${e.page}`:`p.${e.page}`},`${e.doc}:${e.page}:${t}`))}),e.answer.outside&&(()=>{let t=r(e.answer.outside.citation.url),n=(0,d.jsxs)(d.Fragment,{children:[`“`,e.answer.outside.citation.quote,`”`,(0,d.jsxs)(`span`,{className:`prism-ask-outside-host`,children:[`— `,e.answer.outside.citation.host,e.answer.outside.citation.date?` · ${e.answer.outside.citation.date}`:``]})]});return(0,d.jsxs)(`div`,{className:`prism-ask-outside`,children:[(0,d.jsx)(`span`,{className:`prism-ask-outside-tag`,children:`from outside this document`}),(0,d.jsx)(`p`,{className:`prism-ask-outside-fact`,children:e.answer.outside.fact}),t?(0,d.jsx)(`a`,{className:`prism-ask-outside-cite`,href:t,target:`_blank`,rel:`noopener noreferrer`,children:n}):(0,d.jsx)(`span`,{className:`prism-ask-outside-cite`,children:n})]})})()]})]},e.id),t[20]=s,t[21]=m,t[22]=c,t[23]=o,t[24]=e):e=t[24],j=n.map(e),t[14]=s,t[15]=m,t[16]=c,t[17]=o,t[18]=n,t[19]=j}else j=t[19];let M;t[25]!==A||t[26]!==j?(M=(0,d.jsxs)(`div`,{className:`prism-ask-thread`,ref:y,children:[A,j]}),t[25]=A,t[26]=j,t[27]=M):M=t[27];let N;t[28]===E?N=t[29]:(N=e=>{e.preventDefault(),E()},t[28]=E,t[29]=N);let P;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>v(e.target.value),t[30]=P):P=t[30];let F;t[31]===E?F=t[32]:(F=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),E())},t[31]=E,t[32]=F);let I=i?`Reading the document…`:`Ask this document a question…`,L;t[33]!==_||t[34]!==F||t[35]!==I?(L=(0,d.jsx)(`textarea`,{ref:b,className:`prism-ask-input`,value:_,onChange:P,onKeyDown:F,rows:1,placeholder:I,"aria-label":`Ask this document a question`}),t[33]=_,t[34]=F,t[35]=I,t[36]=L):L=t[36];let R;t[37]!==i||t[38]!==_?(R=i||_.trim().length===0,t[37]=i,t[38]=_,t[39]=R):R=t[39];let z;t[40]===R?z=t[41]:(z=(0,d.jsx)(`button`,{type:`submit`,className:`prism-ask-send`,disabled:R,"aria-label":`Ask`,children:`↵`}),t[40]=R,t[41]=z);let B;t[42]!==N||t[43]!==L||t[44]!==z?(B=(0,d.jsxs)(`form`,{className:`prism-ask-form`,onSubmit:N,children:[L,z]}),t[42]=N,t[43]=L,t[44]=z,t[45]=B):B=t[45];let V;return t[46]!==M||t[47]!==B||t[48]!==k?(V=(0,d.jsxs)(`section`,{className:`prism-ask`,"aria-label":`Ask this document`,onPointerDown:D,onWheel:D,onClick:D,children:[k,M,B]}),t[46]=M,t[47]=B,t[48]=k,t[49]=V):V=t[49],V}function h(e){return e.stopPropagation()}var g=14e3,_=1500,v=8;function y(e){let t=[];return e.forEach((e,n)=>e.forEach((e,r)=>{let i=e.trim();i&&t.push({doc:n,page:r+1,text:i.slice(0,_)})})),t}function b(e,t,n=g){let r=y(e);if(r.reduce((e,t)=>e+t.text.length,0)<=n)return r;let i=Array.from(new Set(t.toLowerCase().match(/[a-z0-9]{4,}/g)??[])),a=e=>{let t=e.text.toLowerCase();return i.reduce((e,n)=>e+ +!!t.includes(n),0)},o=r.map(e=>({p:e,s:a(e)})).sort((e,t)=>t.s-e.s||e.p.doc-t.p.doc||e.p.page-t.p.page),s=[],c=0;for(let{p:e}of o)if(c+e.text.length>n&&s.length>=6||(s.push(e),c+=e.text.length,c>=n))break;return s.sort((e,t)=>e.doc-t.doc||e.page-t.page)}function x(e,t){return`DOCUMENT TEXT (cite "doc"/"page" by these markers):\n${e.map(e=>`[${t?`doc ${e.doc} · `:``}page ${e.page}]\n${e.text}`).join(`
|
|
2
2
|
|
|
3
3
|
`)}`}var S=`You answer a question strictly from the document text provided, quoting verbatim, and return strict JSON only. You never use outside knowledge and never invent a quote, page, or fact — when the document does not address the question you say so plainly.`;function C(e,t,n){return`${x(t,n)}
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/kokoro-B-
|
|
2
|
-
import{t as e}from"./jsx-runtime-DaSxXjOY.js";import{J as t,q as n}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/kokoro-B-MNB16v.js","assets/chunk-BVpWp9h4.js","assets/index-DOpl5xzv.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/spokenText-D4zPX9JY.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./jsx-runtime-DaSxXjOY.js";import{J as t,q as n}from"./index-DOpl5xzv.js";import{t as r}from"./BriefingPlayer-JnrrvxYE.js";var i=e();t();function a({beats:e,onBeat:t,onExit:a}){return(0,i.jsx)(r,{beats:e,onBeat:t,onExit:a,speak:e=>{n(()=>import(`./kokoro-B-MNB16v.js`).then(e=>e.i).then(t=>t.speakKokoroResult(e,`mavea`)),__vite__mapDeps([0,1,2,3,4,5,6,7]))},cancelSpeak:()=>{n(()=>import(`./kokoro-B-MNB16v.js`).then(e=>e.i).then(e=>e.cancelKokoro()),__vite__mapDeps([0,1,2,3,4,5,6,7]))}})}export{a as PrismBriefingPlayer};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-
|
|
2
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{I as n,J as r,L as i,ht as a,k as o,mt as s,q as c}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-uUFiTOYW.js","assets/index-DOpl5xzv.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ShareModal-DNpc-U9U.js","assets/ReelJelly-B2JQsaRI.js","assets/geometry-DXAbnb0J.js","assets/registry-BnSnMnyk.js","assets/fit-BtKObM5Q.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-B-MNB16v.js","assets/ShareModal-PobtP7AJ.css","assets/annotationAuto-ofVcqRve.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/BriefingPlayer-JnrrvxYE.js","assets/BriefingPlayer-TpFZB77N.css","assets/annotationReel-CdAmTPlv.js","assets/PrismAskController-Ds1tSE9S.js","assets/sourceHost-BV3t2XDb.js","assets/citation-BcvmjKS8.js","assets/verbatim-CBMzUDlf.js","assets/search-Be63DJkp.js","assets/PrismAskController-DBoxQSJR.css","assets/PrismBriefingPlayer-BzqCK6JP.js","assets/CrossExamPanel-CocJ_GxK.js","assets/CrossExamPanel-CZ0ShGma.css","assets/ForecastPanel-CpR32hwb.js","assets/ForecastPanel-Da2ZBUrE.css","assets/LeverPanel-CXSDqinv.js","assets/dag-C3Xx8pOD.js","assets/LeverPanel-DhpJY76O.css","assets/WhyMachineOverlay-D6pGEE78.js","assets/useSpatialCanvas-L0r29F7F.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{I as n,J as r,L as i,ht as a,k as o,mt as s,q as c}from"./index-DOpl5xzv.js";import{t as l}from"./useFocusTrap-DbfG6zbM.js";import{t as u}from"./toast-BBNs2h3L.js";import{r as d}from"./sourceHost-BV3t2XDb.js";import{t as f}from"./penStrokes-DlHnO9xE.js";import{S as p,b as m,d as h,h as g,m as _,o as v,s as y,t as b,v as x,x as S,y as C}from"./providers-wzm7E8Pa.js";import{n as w}from"./streamParse-DRgMHWye.js";import{t as T}from"./search-Be63DJkp.js";import{a as E,i as D,t as O}from"./verbatim-CBMzUDlf.js";import{t as k}from"./officeDoc-B6nEhNp4.js";import{t as A}from"./citation-BcvmjKS8.js";var j=e(),M=a();function ee(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
3
|
`)}`}function N(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 te(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
4
|
|
|
5
|
-
`)}`}function P(e,t){let n=[];for(let r of e){let e=O(r.quote,t,r.page);if(e>0){n.push({...r,page:e});continue}let i=[...new Set([r.page,...t.map((e,t)=>t+1)])].filter(e=>e>=1&&e<=t.length);for(let e of i){let i=E(r.quote,t[e-1]);if(i){n.push({...r,quote:i,page:e});break}}}return n}var F=null,I=0,L=new Map;function R(){if(typeof Worker>`u`)return null;if(F)return F;try{return F=new Worker(new URL(`/assets/prismGround.worker-CIvKqxm2.js`,``+import.meta.url),{type:`module`}),F.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`)))},F.onerror=()=>{let e=Error(`Grounding worker failed`);for(let t of L.values())t.reject(e);L.clear(),F?.terminate(),F=null},F}catch{return F=null,null}}async function z(e,t){let n=[];for(let r=0;r<e.length;r+=16)n.push(...P(e.slice(r,r+16),t)),r+16<e.length&&await new Promise(e=>setTimeout(e,0));return n}async function ne(e,t){let n=R();if(!n)return z(e,t);let r=I+=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 z(e,t)}}r();var re=null;function B(){return re||(re=c(()=>import(`./pdf-
|
|
5
|
+
`)}`}function P(e,t){let n=[];for(let r of e){let e=O(r.quote,t,r.page);if(e>0){n.push({...r,page:e});continue}let i=[...new Set([r.page,...t.map((e,t)=>t+1)])].filter(e=>e>=1&&e<=t.length);for(let e of i){let i=E(r.quote,t[e-1]);if(i){n.push({...r,quote:i,page:e});break}}}return n}var F=null,I=0,L=new Map;function R(){if(typeof Worker>`u`)return null;if(F)return F;try{return F=new Worker(new URL(`/assets/prismGround.worker-CIvKqxm2.js`,``+import.meta.url),{type:`module`}),F.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`)))},F.onerror=()=>{let e=Error(`Grounding worker failed`);for(let t of L.values())t.reject(e);L.clear(),F?.terminate(),F=null},F}catch{return F=null,null}}async function z(e,t){let n=[];for(let r=0;r<e.length;r+=16)n.push(...P(e.slice(r,r+16),t)),r+16<e.length&&await new Promise(e=>setTimeout(e,0));return n}async function ne(e,t){let n=R();if(!n)return z(e,t);let r=I+=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 z(e,t)}}r();var re=null;function B(){return re||(re=c(()=>import(`./pdf-uUFiTOYW.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])).catch(()=>null),re)}function ie(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 V(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 ae(e){let t=e.map(ie).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 V(t);let u=c;return[...V(t.filter(e=>e.left+e.w/2<u)),...V(t.filter(e=>e.left+e.w/2>=u))]}async function H(e){let t=await B();if(!t?.getDocument)return null;try{let n=await v(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=ae((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 U(){return Math.min(2,Math.max(1,typeof window<`u`&&window.devicePixelRatio||1))}function oe(e){return Math.max(600,Math.min(1900,Math.round((Number.isFinite(e)&&e>0?e:1200)*1.15)))}var W=e=>e.file??e.bytes??e.data,se=null,G=null,K=null,q=0;async function ce(e,t){let n=W(e);for(;K&&K.key!==n;)await K.promise.catch(()=>{});if(se===n&&G)return G;if(K&&K.key===n)return K.promise;let r=q,i=(async()=>{if(G)try{await G.destroy?.()}catch{}let i=y(e)??await v(e),a=await t.getDocument({data:i.slice()}).promise;if(r!==q){try{await a.destroy?.()}catch{}throw Error(`render doc superseded`)}return G=a,se=n,a})(),a={key:n,promise:i};K=a;try{return await i}finally{K===a&&(K=null)}}async function le(){q+=1,K=null;let e=G;G=null,se=null;try{await e?.destroy?.()}catch{}}function J(e){return Array.from(e.normalize(`NFKC`)).map(e=>e===``?``:`‘’‛`.includes(e)?`'`:`“”`.includes(e)?`"`:/[‐-―]/.test(e)?`-`:/\s/.test(e)?` `:e.toLowerCase())}async function ue(e,t,n,r=720,i=!1,a=[]){let o=await B();if(!o?.getDocument)return null;let s=null;try{let c=await ce(e,o);if(t<1||t>c.numPages)return null;s=await c.getPage(t);let l=s.getViewport({scale:1}),u=U(),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=de(h,n,f,o),_=a.map(e=>de(h,e,f,o)),v=null;if(i||me(n))try{v=ve(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 de(e,t,n,r){let i=D(t);if(!i)return[];let a=[];for(let t of ae(e.items)){if(typeof t.str!=`string`)continue;let e=fe(t,n,r);if(!e)continue;let i=J(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?[]:pe(o.slice(s,s+i.length).filter(e=>e.rect.w>0).map(e=>e.rect))}function fe(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 pe(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 me(e){return/\b(fig(?:ure|\.)?|table|chart|diagram|graph|plot|schematic|illustration)\b/i.test(e)}function he(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 ge(e,t,n){let r=[];for(let i of e.items){if(typeof i.str!=`string`||i.str.trim()===``)continue;let e=fe(i,t,n);e&&r.push(e)}return pe(r)}function _e(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 ve(e,t,n,r,i){let a=he(e,r,i);if(a.length===0||n.length===0)return null;let o=ye(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=be(e,o)+n*.5;r<l&&(l=r,c=e)}if(!c)return null;let u=ge(t,r,i).filter(e=>!_e(e,o)),d=xe(c,u,o);return!d||d.w<10||d.h<10?null:d}function ye(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 be(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 xe(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 Se=/\.(csv|tsv|tab)$/i,Ce=/\.(md|markdown)$/i,we=/\.(json|jsonl|ndjson)$/i,Te=/\.(ya?ml|toml|xml|js|ts|jsx|tsx|py|rb|go|rs|java|c|h|cpp|cs|sh|sql|css|html?)$/i,Ee=40,De=1600;function Oe(e){let t=e.replace(/\r\n?/g,`
|
|
6
6
|
`).split(`
|
|
7
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+=Ee)i.push([n,...r.slice(e,e+Ee)].join(`
|
|
8
8
|
`));return i}function ke(e){let t=e.replace(/\r\n?/g,`
|
|
@@ -127,5 +127,5 @@ CLAIMS AND THEIR SOURCES:
|
|
|
127
127
|
${e.map(e=>{let n=(t.get(e.id)??[]).map(e=>` - "${e.title}": ${e.snippet} (${e.url})`).join(`
|
|
128
128
|
`);return`[claim ${e.id}] "${e.quote}"\n sources:\n${n}`}).join(`
|
|
129
129
|
|
|
130
|
-
`)}`}async function Xn(e,t){let n=t.provider??Vn(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(Wn(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 b(t.cfg.provider).generate({system:Jn,history:[],user:Yn(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=qn(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(Bn(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 Zn=4,Qn=3,$n=2,er={contradicted:4,disputed:3,outdated:2,unsupported:1,holds:0},tr={contradicts:`contradicts`,"in-tension":`is in tension with`,agrees:`agrees with`};function nr(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 rr(e){return Math.max(2600,Math.min(7e3,Math.round(e.length*60)+1200))}function ir(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 ar(e,t,n){if(e.length===0)return[];let r=new Map(e.map(e=>[e.id,e])),i=ir(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:rr(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 — “${nr(u.quote,96)}” · p.${u.page}`,`The whole case rests on this, on page ${u.page}. ${nr(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,Zn);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}: “${nr(t.quote,52)}” — ${tr[e.relation]}${i} — p.${n.page}: “${nr(n.quote,52)}”`,`On page ${t.page}, the document says ${nr(t.quote,140)}. But it ${tr[e.relation]} page ${n.page}: ${nr(n.quote,140)}.`)}let p=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&er[e.v]>=2&&!o.has(e.c.id)).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page).slice(0,Qn);for(let{c:e,v:t}of p){let n=Fn[t].label;c(`verdict`,[e.id],`${n} — “${nr(e.quote,72)}” · p.${e.page}`,`The public record marks this ${n.toLowerCase()}: ${nr(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,$n);for(let e of m)c(`context`,[e.id],`Context — ${nr(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&&er[e.v]>=2).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page)[0];if(h){let e=Fn[h.v].label;c(`close`,[h.c.id],`The weak point — ${e}: “${nr(h.c.quote,68)}” · p.${h.c.page}`,`So the weakest point: the public record marks this ${e.toLowerCase()} — ${nr(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 or=16;function sr(){let e=(0,M.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=(0,j.useRef)(t),[r,i]=(0,j.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>or&&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 cr={forecast:`#5468e0`,stat:`#12a37a`,finding:`#1f9d7e`,risk:`#e0474d`,definition:`#5a6678`,method:`#cf8327`,diagram:`#5468e0`},lr=`#6a4fd0`;function ur(e){return cr[e]}var dr={"load-bearing":`The document leans on this`,supporting:`Supporting evidence`,context:`Context`};function fr(e){return`${dr[e.role]} — ${e.title}`}function pr(e){let t=e.role===`load-bearing`,n=e.kind===`forecast`;if(!(!t&&!n))return{...t?{star:t}:{},...n?{question:n}:{}}}var mr={forecast:`forecast`,stat:`figure`,finding:`finding`,risk:`risk`,definition:`definition`,method:`method`,diagram:`figure`},hr={"load-bearing":e=>`The ${e} the document leans on`,supporting:e=>`Supporting ${e}`,context:e=>`Context — ${e}`};function gr(e){return`${hr[e.role](mr[e.kind])} · page ${e.page}`}var _r=s();r();var vr=n(()=>c(()=>import(`./ShareModal-C-sD-aia.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([7,2,1,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),yr=vr.Component;function br({steps:e,spec:t,pdfs:n,cfg:r,placed:a,verdicts:s}){let[l,d]=(0,j.useState)(!1),[f,p]=(0,j.useState)(null);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,disabled:l,onClick:(0,j.useCallback)(async()=>{if(!l){d(!0);try{let[{autoAnnotationSteps:r},{buildAnnotationReel:i}]=await Promise.all([c(()=>import(`./annotationAuto-x_dV8z65.js`),__vite__mapDeps([22,23,2,24,25,26,1,3,4,5,6,27])),c(()=>import(`./annotationReel-SeXzv0P-.js`).then(e=>e.t),__vite__mapDeps([28,2,10,1,3,4,5,6,11,16])),vr.preload()]),o=e.current,l=o.length>=1?o.slice():await r(t,n,{placed:a,verdicts:s,max:6});if(!l.length){u(`Turn on Annotate, then ask a question or tap a claim to mark it up`,`warn`);return}p(i(l,{fileName:t.fileName}))}finally{d(!1)}}},[l,e,t,n,a,s]),title:`Make a shareable reel of the marked-up pages`,...i(vr.preload),children:l?`Preparing…`:`Share reel`}),f&&(0,_r.createPortal)((0,Q.jsx)(o,{label:`Annotation reel`,overlay:!0,children:(0,Q.jsx)(yr,{script:f,cfg:r??void 0,onClose:()=>p(null)})}),document.body)]})}r();var xr=n(()=>c(()=>import(`./PrismAskController-OwqFx5Pk.js`).then(e=>({default:e.PrismAskController})),__vite__mapDeps([29,1,2,3,4,5,6,23,24,25,30,31,32,33,34]))),Sr=n(()=>c(()=>import(`./PrismBriefingPlayer-Bu_ZxYdh.js`).then(e=>({default:e.PrismBriefingPlayer})),__vite__mapDeps([35,1,2,3,4,5,6,26,27]))),Cr=n(()=>c(()=>import(`./CrossExamPanel-BIJslibV.js`).then(e=>({default:e.CrossExamPanel})),__vite__mapDeps([36,1,2,3,4,5,6,37]))),wr=n(()=>c(()=>import(`./ForecastPanel-CMRD-UKn.js`).then(e=>({default:e.ForecastPanel})),__vite__mapDeps([38,1,2,3,4,5,6,30,39]))),Tr=n(()=>c(()=>import(`./LeverPanel-DVUgGcYW.js`).then(e=>({default:e.LeverPanel})),__vite__mapDeps([40,1,2,3,4,5,6,41,42]))),Er=n(()=>c(()=>import(`./WhyMachineOverlay-C4eQC0lg.js`).then(e=>({default:e.WhyMachineOverlay})),__vite__mapDeps([43,1,2,3,4,5,6,44,30,45]))),Dr=xr.Component,Or=Sr.Component,kr=Cr.Component,Ar=wr.Component,jr=Tr.Component,Mr=Er.Component,Nr=null,Pr=null,Fr=null,Ir=null,Lr=null,Rr=()=>Nr??=c(()=>import(`./run-BYP2YlZT.js`),__vite__mapDeps([46,23,2,24,25,32,47,48])),zr=()=>Pr??=c(()=>import(`./run-DSVvshaB.js`),__vite__mapDeps([49,23,2,24,25,32,48])),Br=()=>Fr??=c(()=>import(`./run-Dc2ZJz6n.js`),__vite__mapDeps([50,23,2,24,25,31,32,47,33,48])),Vr=()=>Ir??=c(()=>import(`./model-BE0UHu1w.js`),__vite__mapDeps([51,23,2,24,25,32,41,47])),Hr=()=>Lr??=c(()=>import(`./explode-WBykfhqW.js`),__vite__mapDeps([52,23,2,24,25,31,32,53,54,55])),Ur=null;function Wr(){return Ur??=c(()=>import(`./kokoro-B-3GqktX.js`).then(e=>e.i),__vite__mapDeps([20,2,1,3,4,5,6,16])),Ur}function Gr(){Ur&&Ur.then(e=>e.cancelKokoro())}function Kr(e){Wr().then(t=>t.speakKokoroResult(e,`mavea`))}var qr={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`}},Jr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`],Yr={contradicts:`contradicts`,"in-tension":`in tension`,agrees:`agrees`},Xr=[{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`}],Zr=[{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`}],Qr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--insight-soft)`];function $r(e,t){let n=t?`another document`:`another passage`;return e===`agrees`?`agrees with ${n}`:e===`in-tension`?`in tension with ${n}`:`contradicts ${n}`}function ei(e){return e?e.relation:`anchored`}function ti(e){return e?e.relation===`agrees`?`agrees · ready`:e.relation===`in-tension`?`in tension`:`in contradiction`:`anchored · ready`}function ni({pdf:e,cfg:t,search:n,onClose:r,world:a,corpusChrome:s,autoBriefing:c}){let u=(0,j.useMemo)(()=>Array.isArray(e)?e:[e],[e]),f=u.length>1,[p,m]=(0,j.useState)(!1),h=_t(t),{phase:g,spec:_,corpus:v,proposed:y,error:b}=a??h,{explode:x}=h,[S,C]=(0,j.useState)(null),[w,T]=(0,j.useState)(null),[E,D]=(0,j.useState)(null),[O,k]=(0,j.useState)(()=>new Set),[A,M]=(0,j.useState)(!1),[ee,N]=(0,j.useState)(!1),[te,P]=(0,j.useState)(null),[F,I]=(0,j.useState)(0),[L,R]=(0,j.useState)(null),[z,ne]=(0,j.useState)(()=>new Set),re=(0,j.useRef)(()=>{}),[B,ie]=(0,j.useState)(null),[V,ae]=(0,j.useState)(!1),[H,U]=(0,j.useState)(!1),oe=(0,j.useRef)(null),[W,se]=(0,j.useState)(null),[G,K]=(0,j.useState)(!1),[q,ce]=(0,j.useState)(!1),[J,ue]=(0,j.useState)(null),de=(0,j.useRef)(null),[fe,pe]=(0,j.useState)(null),[me,he]=(0,j.useState)(!1),[ge,_e]=(0,j.useState)(!1),[ve,ye]=(0,j.useState)(null),be=(0,j.useRef)(null),[xe,Se]=(0,j.useState)(null),[Ce,we]=(0,j.useState)(!1),[Te,Ee]=(0,j.useState)(!1),De=(0,j.useRef)(!1),Oe=(0,j.useRef)(null),[ke,Ae]=(0,j.useState)(`map`),[je,Me]=(0,j.useState)(null),[Ne,Pe]=(0,j.useState)(null),Fe=(0,j.useRef)(null),[Ie,Le]=(0,j.useState)(!1),[Re,ze]=(0,j.useState)(44),Be=(0,j.useRef)(null),Ve=(0,j.useRef)(!1),He=(0,j.useRef)(null);l(He);let[Ue,We]=(0,j.useState)(()=>new Map),[Ge,Ke]=(0,j.useState)(!1),[qe,Je]=(0,j.useState)(c===!0),[Ye,Xe]=(0,j.useState)(!1),[Ze,Qe]=(0,j.useState)(``),{steps:$e,record:et,clear:tt}=sr(),nt=(0,j.useCallback)(e=>{Ve.current=!0,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[]),rt=(0,j.useCallback)(e=>{if(!Ve.current||!Be.current)return;let t=Be.current.getBoundingClientRect(),n=(t.right-e.clientX)/t.width*100;ze(Math.max(24,Math.min(100,n)))},[]),it=(0,j.useCallback)(e=>{Ve.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),at=(0,j.useRef)(!1);(0,j.useEffect)(()=>{a||at.current||(at.current=!0,x(u))},[u,x]),(0,j.useEffect)(()=>()=>void le(),[]),(0,j.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(L?(Gr(),R(null),ne(new Set),C(null),re.current()):w?T(null):E?D(null):S?C(null):r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[L,w,E,S,r]);let[ot,st]=(0,j.useState)(null);(0,j.useEffect)(()=>{if(!_||_.claims.length<48)return;let e=!0;return Nt(_,Jr).then(t=>{e&&st({spec:_,result:t})}),()=>{e=!1}},[_]);let Y=(0,j.useMemo)(()=>_?_.claims.length<48?Tt(_,Jr):ot?.spec===_?ot.result:null:null,[ot,_]),ct=(0,j.useRef)(null),lt=(0,j.useMemo)(()=>{if(!Y||Y.claims.length===0)return;let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i of Y.claims)e=Math.min(e,i.x),t=Math.min(t,i.y),n=Math.max(n,i.x+200),r=Math.max(r,i.y+96);for(let i of Y.regions)e=Math.min(e,i.cx),t=Math.min(t,i.cy),n=Math.max(n,i.cx),r=Math.max(r,i.cy);return{x:e-56,y:t-56,w:n-e+112,h:r-t+112}},[Y]),X=xt(ct,Y?.width??1,Y?.height??1,lt),ut=(0,j.useMemo)(()=>{let e=new Map;if(Y)for(let t of Y.claims)e.set(t.id,t);return e},[Y]),dt=(0,j.useMemo)(()=>{let e=new Map,t=(t,n)=>{(e.get(t)??e.set(t,new Set).get(t)).add(n),(e.get(n)??e.set(n,new Set).get(n)).add(t)};if(Y)for(let e of Y.links)t(e.a,e.b);if(_)for(let e of _.threads)t(e.a,e.b);let n=new Map;for(let[t,r]of e)n.set(t,[...r].map(e=>ut.get(e)).filter(e=>!!e).sort((e,t)=>e.page-t.page||e.title.localeCompare(t.title)).map(e=>e.id));return n},[Y,_,ut]),ft=S?ut.get(S)??null:null,pt=(0,j.useMemo)(()=>S?dt.get(S)??[]:[],[S,dt]),mt=_?.threads.filter(e=>e.crossDoc).length??0,Z=g===`settled`&&!!Y,[ht,gt]=(0,j.useState)(null),vt=(0,j.useMemo)(()=>{let e=new Set;return s?.contradictions.forEach(t=>{e.add(t.a),e.add(t.b)}),e},[s]),yt=(0,j.useMemo)(()=>{let e=new Set;return s?.consensus.forEach(t=>t.memberClaimIds.forEach(t=>e.add(t))),e},[s]),bt=s?.lens??`all`;(0,j.useEffect)(()=>{if(!s||!Z)return;let e=bt===`contradictions`?s.contradictions:bt===`gaps`?s.gaps:bt===`consensus`?s.consensus:[];if(bt===`all`||e.length===0){X.fit();return}let t=e.map(e=>e.x),n=e.map(e=>e.y);X.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 St=g===`igniting`?`EXTRACTING`:g===`blooming`?`MAPPING`:g===`settled`?`SETTLED`:g===`error`?`COULDN’T MAP`:`READY`,Ct=_?.claims.length??0,wt=(0,j.useCallback)(()=>{C(null),T(null),D(null),k(new Set),Gr(),R(null),ne(new Set),oe.current?.abort(),ie(null),U(!1),ae(!1),de.current?.abort(),se(null),ce(!1),K(!1),ue(null),be.current?.abort(),pe(null),_e(!1),he(!1),ye(null),Oe.current?.abort(),Se(null),Ee(!1),we(!1),De.current=!1,Fe.current?.abort(),Me(null),Pe(null),Ae(`map`),x(u)},[x,u]),Et=(0,j.useRef)(null),{frame:Dt,fit:Ot}=X;re.current=Ot,(0,j.useEffect)(()=>{if(!Z||!Y||!_||Et.current===_)return;Et.current=_;let e=Y.claims.filter(e=>e.role===`load-bearing`);if(e.length===0||e.length===Y.claims.length)return;let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);let a=96*1.3;Dt({x:t-200,y:n-a,w:r-t+400,h:i-n+a*2},{maxScale:1.2})},[Z,Y,_,Dt]);let kt=(0,j.useRef)(null);(0,j.useEffect)(()=>{if(!Z||!_||!t||kt.current===_||(kt.current=_,We(new Map),Ke(!1),!n?.enabled)||_.claims.filter(e=>e.role===`load-bearing`).length===0)return;let e=new AbortController;return Ke(!0),Xn(_.claims,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal}).then(t=>{e.signal.aborted||We(new Map(t.map(e=>[e.claimId,e])))}).catch(()=>{}).finally(()=>{e.signal.aborted||Ke(!1)}),()=>e.abort()},[Z,_,t,n]);let At=(0,j.useMemo)(()=>[...Ue.values()].map(e=>e.verdict),[Ue]),jt=(0,j.useMemo)(()=>Rn(At),[At]),Mt=(0,j.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}`},[_]),Pt=(0,j.useCallback)((e,t)=>{if(!Y)return;let n=Y.claims.filter(n=>n.source===e&&n.page===t);if(n.length===0){let r=Y.claims.filter(t=>t.source===e);if(r.length===0)return;let i=r.reduce((e,n)=>Math.abs(n.page-t)<Math.abs(e.page-t)?n:e);n=r.filter(e=>e.page===i.page)}let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let e of n)r=Math.min(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);Dt({x:r-200,y:i-96*1.3,w:a-r+400,h:o-i+96*2.6},{maxScale:1.4})},[Y,Dt]),Ft=(0,j.useCallback)(e=>{T(null),C(null),Qe(``),D(e),Pt(e.doc,e.page)},[Pt]),It=(0,j.useCallback)(e=>{k(new Set(e.spans.map(e=>`${e.doc}:${e.page}`))),e.spans.length>0&&Ft(e.spans[0]),Qe(e.text)},[Ft]),Lt=(0,j.useMemo)(()=>!Z||!t||!v?null:{corpus:v,cfg:t,multiDoc:f,...n?{search:n}:{}},[Z,t,v,f,n]);(0,j.useEffect)(()=>()=>Fe.current?.abort(),[]);let Rt=(0,j.useCallback)(()=>{if(!t||!v)return;Fe.current?.abort();let e=new AbortController;Fe.current=e,Pe(`why`);let n=v.flat().join(`
|
|
130
|
+
`)}`}async function Xn(e,t){let n=t.provider??Vn(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(Wn(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 b(t.cfg.provider).generate({system:Jn,history:[],user:Yn(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=qn(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(Bn(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 Zn=4,Qn=3,$n=2,er={contradicted:4,disputed:3,outdated:2,unsupported:1,holds:0},tr={contradicts:`contradicts`,"in-tension":`is in tension with`,agrees:`agrees with`};function nr(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 rr(e){return Math.max(2600,Math.min(7e3,Math.round(e.length*60)+1200))}function ir(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 ar(e,t,n){if(e.length===0)return[];let r=new Map(e.map(e=>[e.id,e])),i=ir(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:rr(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 — “${nr(u.quote,96)}” · p.${u.page}`,`The whole case rests on this, on page ${u.page}. ${nr(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,Zn);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}: “${nr(t.quote,52)}” — ${tr[e.relation]}${i} — p.${n.page}: “${nr(n.quote,52)}”`,`On page ${t.page}, the document says ${nr(t.quote,140)}. But it ${tr[e.relation]} page ${n.page}: ${nr(n.quote,140)}.`)}let p=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&er[e.v]>=2&&!o.has(e.c.id)).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page).slice(0,Qn);for(let{c:e,v:t}of p){let n=Fn[t].label;c(`verdict`,[e.id],`${n} — “${nr(e.quote,72)}” · p.${e.page}`,`The public record marks this ${n.toLowerCase()}: ${nr(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,$n);for(let e of m)c(`context`,[e.id],`Context — ${nr(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&&er[e.v]>=2).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page)[0];if(h){let e=Fn[h.v].label;c(`close`,[h.c.id],`The weak point — ${e}: “${nr(h.c.quote,68)}” · p.${h.c.page}`,`So the weakest point: the public record marks this ${e.toLowerCase()} — ${nr(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 or=16;function sr(){let e=(0,M.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=(0,j.useRef)(t),[r,i]=(0,j.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>or&&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 cr={forecast:`#5468e0`,stat:`#12a37a`,finding:`#1f9d7e`,risk:`#e0474d`,definition:`#5a6678`,method:`#cf8327`,diagram:`#5468e0`},lr=`#6a4fd0`;function ur(e){return cr[e]}var dr={"load-bearing":`The document leans on this`,supporting:`Supporting evidence`,context:`Context`};function fr(e){return`${dr[e.role]} — ${e.title}`}function pr(e){let t=e.role===`load-bearing`,n=e.kind===`forecast`;if(!(!t&&!n))return{...t?{star:t}:{},...n?{question:n}:{}}}var mr={forecast:`forecast`,stat:`figure`,finding:`finding`,risk:`risk`,definition:`definition`,method:`method`,diagram:`figure`},hr={"load-bearing":e=>`The ${e} the document leans on`,supporting:e=>`Supporting ${e}`,context:e=>`Context — ${e}`};function gr(e){return`${hr[e.role](mr[e.kind])} · page ${e.page}`}var _r=s();r();var vr=n(()=>c(()=>import(`./ShareModal-DNpc-U9U.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([7,2,1,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),yr=vr.Component;function br({steps:e,spec:t,pdfs:n,cfg:r,placed:a,verdicts:s}){let[l,d]=(0,j.useState)(!1),[f,p]=(0,j.useState)(null);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,disabled:l,onClick:(0,j.useCallback)(async()=>{if(!l){d(!0);try{let[{autoAnnotationSteps:r},{buildAnnotationReel:i}]=await Promise.all([c(()=>import(`./annotationAuto-ofVcqRve.js`),__vite__mapDeps([22,23,2,24,25,26,1,3,4,5,6,27])),c(()=>import(`./annotationReel-CdAmTPlv.js`).then(e=>e.t),__vite__mapDeps([28,2,10,1,3,4,5,6,11,16])),vr.preload()]),o=e.current,l=o.length>=1?o.slice():await r(t,n,{placed:a,verdicts:s,max:6});if(!l.length){u(`Turn on Annotate, then ask a question or tap a claim to mark it up`,`warn`);return}p(i(l,{fileName:t.fileName}))}finally{d(!1)}}},[l,e,t,n,a,s]),title:`Make a shareable reel of the marked-up pages`,...i(vr.preload),children:l?`Preparing…`:`Share reel`}),f&&(0,_r.createPortal)((0,Q.jsx)(o,{label:`Annotation reel`,overlay:!0,children:(0,Q.jsx)(yr,{script:f,cfg:r??void 0,onClose:()=>p(null)})}),document.body)]})}r();var xr=n(()=>c(()=>import(`./PrismAskController-Ds1tSE9S.js`).then(e=>({default:e.PrismAskController})),__vite__mapDeps([29,1,2,3,4,5,6,23,24,25,30,31,32,33,34]))),Sr=n(()=>c(()=>import(`./PrismBriefingPlayer-BzqCK6JP.js`).then(e=>({default:e.PrismBriefingPlayer})),__vite__mapDeps([35,1,2,3,4,5,6,26,27]))),Cr=n(()=>c(()=>import(`./CrossExamPanel-CocJ_GxK.js`).then(e=>({default:e.CrossExamPanel})),__vite__mapDeps([36,1,2,3,4,5,6,37]))),wr=n(()=>c(()=>import(`./ForecastPanel-CpR32hwb.js`).then(e=>({default:e.ForecastPanel})),__vite__mapDeps([38,1,2,3,4,5,6,30,39]))),Tr=n(()=>c(()=>import(`./LeverPanel-CXSDqinv.js`).then(e=>({default:e.LeverPanel})),__vite__mapDeps([40,1,2,3,4,5,6,41,42]))),Er=n(()=>c(()=>import(`./WhyMachineOverlay-D6pGEE78.js`).then(e=>({default:e.WhyMachineOverlay})),__vite__mapDeps([43,1,2,3,4,5,6,44,30,45]))),Dr=xr.Component,Or=Sr.Component,kr=Cr.Component,Ar=wr.Component,jr=Tr.Component,Mr=Er.Component,Nr=null,Pr=null,Fr=null,Ir=null,Lr=null,Rr=()=>Nr??=c(()=>import(`./run-BYP2YlZT.js`),__vite__mapDeps([46,23,2,24,25,32,47,48])),zr=()=>Pr??=c(()=>import(`./run-DSVvshaB.js`),__vite__mapDeps([49,23,2,24,25,32,48])),Br=()=>Fr??=c(()=>import(`./run-Dc2ZJz6n.js`),__vite__mapDeps([50,23,2,24,25,31,32,47,33,48])),Vr=()=>Ir??=c(()=>import(`./model-BE0UHu1w.js`),__vite__mapDeps([51,23,2,24,25,32,41,47])),Hr=()=>Lr??=c(()=>import(`./explode-WBykfhqW.js`),__vite__mapDeps([52,23,2,24,25,31,32,53,54,55])),Ur=null;function Wr(){return Ur??=c(()=>import(`./kokoro-B-MNB16v.js`).then(e=>e.i),__vite__mapDeps([20,2,1,3,4,5,6,16])),Ur}function Gr(){Ur&&Ur.then(e=>e.cancelKokoro())}function Kr(e){Wr().then(t=>t.speakKokoroResult(e,`mavea`))}var qr={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`}},Jr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`],Yr={contradicts:`contradicts`,"in-tension":`in tension`,agrees:`agrees`},Xr=[{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`}],Zr=[{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`}],Qr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--insight-soft)`];function $r(e,t){let n=t?`another document`:`another passage`;return e===`agrees`?`agrees with ${n}`:e===`in-tension`?`in tension with ${n}`:`contradicts ${n}`}function ei(e){return e?e.relation:`anchored`}function ti(e){return e?e.relation===`agrees`?`agrees · ready`:e.relation===`in-tension`?`in tension`:`in contradiction`:`anchored · ready`}function ni({pdf:e,cfg:t,search:n,onClose:r,world:a,corpusChrome:s,autoBriefing:c}){let u=(0,j.useMemo)(()=>Array.isArray(e)?e:[e],[e]),f=u.length>1,[p,m]=(0,j.useState)(!1),h=_t(t),{phase:g,spec:_,corpus:v,proposed:y,error:b}=a??h,{explode:x}=h,[S,C]=(0,j.useState)(null),[w,T]=(0,j.useState)(null),[E,D]=(0,j.useState)(null),[O,k]=(0,j.useState)(()=>new Set),[A,M]=(0,j.useState)(!1),[ee,N]=(0,j.useState)(!1),[te,P]=(0,j.useState)(null),[F,I]=(0,j.useState)(0),[L,R]=(0,j.useState)(null),[z,ne]=(0,j.useState)(()=>new Set),re=(0,j.useRef)(()=>{}),[B,ie]=(0,j.useState)(null),[V,ae]=(0,j.useState)(!1),[H,U]=(0,j.useState)(!1),oe=(0,j.useRef)(null),[W,se]=(0,j.useState)(null),[G,K]=(0,j.useState)(!1),[q,ce]=(0,j.useState)(!1),[J,ue]=(0,j.useState)(null),de=(0,j.useRef)(null),[fe,pe]=(0,j.useState)(null),[me,he]=(0,j.useState)(!1),[ge,_e]=(0,j.useState)(!1),[ve,ye]=(0,j.useState)(null),be=(0,j.useRef)(null),[xe,Se]=(0,j.useState)(null),[Ce,we]=(0,j.useState)(!1),[Te,Ee]=(0,j.useState)(!1),De=(0,j.useRef)(!1),Oe=(0,j.useRef)(null),[ke,Ae]=(0,j.useState)(`map`),[je,Me]=(0,j.useState)(null),[Ne,Pe]=(0,j.useState)(null),Fe=(0,j.useRef)(null),[Ie,Le]=(0,j.useState)(!1),[Re,ze]=(0,j.useState)(44),Be=(0,j.useRef)(null),Ve=(0,j.useRef)(!1),He=(0,j.useRef)(null);l(He);let[Ue,We]=(0,j.useState)(()=>new Map),[Ge,Ke]=(0,j.useState)(!1),[qe,Je]=(0,j.useState)(c===!0),[Ye,Xe]=(0,j.useState)(!1),[Ze,Qe]=(0,j.useState)(``),{steps:$e,record:et,clear:tt}=sr(),nt=(0,j.useCallback)(e=>{Ve.current=!0,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[]),rt=(0,j.useCallback)(e=>{if(!Ve.current||!Be.current)return;let t=Be.current.getBoundingClientRect(),n=(t.right-e.clientX)/t.width*100;ze(Math.max(24,Math.min(100,n)))},[]),it=(0,j.useCallback)(e=>{Ve.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),at=(0,j.useRef)(!1);(0,j.useEffect)(()=>{a||at.current||(at.current=!0,x(u))},[u,x]),(0,j.useEffect)(()=>()=>void le(),[]),(0,j.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(L?(Gr(),R(null),ne(new Set),C(null),re.current()):w?T(null):E?D(null):S?C(null):r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[L,w,E,S,r]);let[ot,st]=(0,j.useState)(null);(0,j.useEffect)(()=>{if(!_||_.claims.length<48)return;let e=!0;return Nt(_,Jr).then(t=>{e&&st({spec:_,result:t})}),()=>{e=!1}},[_]);let Y=(0,j.useMemo)(()=>_?_.claims.length<48?Tt(_,Jr):ot?.spec===_?ot.result:null:null,[ot,_]),ct=(0,j.useRef)(null),lt=(0,j.useMemo)(()=>{if(!Y||Y.claims.length===0)return;let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i of Y.claims)e=Math.min(e,i.x),t=Math.min(t,i.y),n=Math.max(n,i.x+200),r=Math.max(r,i.y+96);for(let i of Y.regions)e=Math.min(e,i.cx),t=Math.min(t,i.cy),n=Math.max(n,i.cx),r=Math.max(r,i.cy);return{x:e-56,y:t-56,w:n-e+112,h:r-t+112}},[Y]),X=xt(ct,Y?.width??1,Y?.height??1,lt),ut=(0,j.useMemo)(()=>{let e=new Map;if(Y)for(let t of Y.claims)e.set(t.id,t);return e},[Y]),dt=(0,j.useMemo)(()=>{let e=new Map,t=(t,n)=>{(e.get(t)??e.set(t,new Set).get(t)).add(n),(e.get(n)??e.set(n,new Set).get(n)).add(t)};if(Y)for(let e of Y.links)t(e.a,e.b);if(_)for(let e of _.threads)t(e.a,e.b);let n=new Map;for(let[t,r]of e)n.set(t,[...r].map(e=>ut.get(e)).filter(e=>!!e).sort((e,t)=>e.page-t.page||e.title.localeCompare(t.title)).map(e=>e.id));return n},[Y,_,ut]),ft=S?ut.get(S)??null:null,pt=(0,j.useMemo)(()=>S?dt.get(S)??[]:[],[S,dt]),mt=_?.threads.filter(e=>e.crossDoc).length??0,Z=g===`settled`&&!!Y,[ht,gt]=(0,j.useState)(null),vt=(0,j.useMemo)(()=>{let e=new Set;return s?.contradictions.forEach(t=>{e.add(t.a),e.add(t.b)}),e},[s]),yt=(0,j.useMemo)(()=>{let e=new Set;return s?.consensus.forEach(t=>t.memberClaimIds.forEach(t=>e.add(t))),e},[s]),bt=s?.lens??`all`;(0,j.useEffect)(()=>{if(!s||!Z)return;let e=bt===`contradictions`?s.contradictions:bt===`gaps`?s.gaps:bt===`consensus`?s.consensus:[];if(bt===`all`||e.length===0){X.fit();return}let t=e.map(e=>e.x),n=e.map(e=>e.y);X.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 St=g===`igniting`?`EXTRACTING`:g===`blooming`?`MAPPING`:g===`settled`?`SETTLED`:g===`error`?`COULDN’T MAP`:`READY`,Ct=_?.claims.length??0,wt=(0,j.useCallback)(()=>{C(null),T(null),D(null),k(new Set),Gr(),R(null),ne(new Set),oe.current?.abort(),ie(null),U(!1),ae(!1),de.current?.abort(),se(null),ce(!1),K(!1),ue(null),be.current?.abort(),pe(null),_e(!1),he(!1),ye(null),Oe.current?.abort(),Se(null),Ee(!1),we(!1),De.current=!1,Fe.current?.abort(),Me(null),Pe(null),Ae(`map`),x(u)},[x,u]),Et=(0,j.useRef)(null),{frame:Dt,fit:Ot}=X;re.current=Ot,(0,j.useEffect)(()=>{if(!Z||!Y||!_||Et.current===_)return;Et.current=_;let e=Y.claims.filter(e=>e.role===`load-bearing`);if(e.length===0||e.length===Y.claims.length)return;let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);let a=96*1.3;Dt({x:t-200,y:n-a,w:r-t+400,h:i-n+a*2},{maxScale:1.2})},[Z,Y,_,Dt]);let kt=(0,j.useRef)(null);(0,j.useEffect)(()=>{if(!Z||!_||!t||kt.current===_||(kt.current=_,We(new Map),Ke(!1),!n?.enabled)||_.claims.filter(e=>e.role===`load-bearing`).length===0)return;let e=new AbortController;return Ke(!0),Xn(_.claims,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal}).then(t=>{e.signal.aborted||We(new Map(t.map(e=>[e.claimId,e])))}).catch(()=>{}).finally(()=>{e.signal.aborted||Ke(!1)}),()=>e.abort()},[Z,_,t,n]);let At=(0,j.useMemo)(()=>[...Ue.values()].map(e=>e.verdict),[Ue]),jt=(0,j.useMemo)(()=>Rn(At),[At]),Mt=(0,j.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}`},[_]),Pt=(0,j.useCallback)((e,t)=>{if(!Y)return;let n=Y.claims.filter(n=>n.source===e&&n.page===t);if(n.length===0){let r=Y.claims.filter(t=>t.source===e);if(r.length===0)return;let i=r.reduce((e,n)=>Math.abs(n.page-t)<Math.abs(e.page-t)?n:e);n=r.filter(e=>e.page===i.page)}let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let e of n)r=Math.min(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);Dt({x:r-200,y:i-96*1.3,w:a-r+400,h:o-i+96*2.6},{maxScale:1.4})},[Y,Dt]),Ft=(0,j.useCallback)(e=>{T(null),C(null),Qe(``),D(e),Pt(e.doc,e.page)},[Pt]),It=(0,j.useCallback)(e=>{k(new Set(e.spans.map(e=>`${e.doc}:${e.page}`))),e.spans.length>0&&Ft(e.spans[0]),Qe(e.text)},[Ft]),Lt=(0,j.useMemo)(()=>!Z||!t||!v?null:{corpus:v,cfg:t,multiDoc:f,...n?{search:n}:{}},[Z,t,v,f,n]);(0,j.useEffect)(()=>()=>Fe.current?.abort(),[]);let Rt=(0,j.useCallback)(()=>{if(!t||!v)return;Fe.current?.abort();let e=new AbortController;Fe.current=e,Pe(`why`);let n=v.flat().join(`
|
|
131
131
|
`).slice(0,8e3),r=f?`Why — the argument these documents make`:`Why does "${u[0].name.replace(/\.[a-z0-9]+$/i,``)}" reach its conclusion?`;Hr().then(({explodeWhy:i})=>i(r,n,t,e.signal)).then(t=>{e.signal.aborted||Me(t)}).finally(()=>{e.signal.aborted||Pe(null)})},[t,v,f,u]);(0,j.useEffect)(()=>{I(e=>e+1),M(!1),N(!1),P(null),D(null),Qe(``),gt(null),k(new Set),Gr(),tt(),R(null),ne(new Set),oe.current?.abort(),ie(null),U(!1),ae(!1),de.current?.abort(),se(null),ce(!1),K(!1),ue(null),be.current?.abort(),pe(null),_e(!1),he(!1),ye(null),Oe.current?.abort(),Se(null),Ee(!1),we(!1),De.current=!1,Fe.current?.abort(),Me(null),Pe(null)},[_,tt]);let $=(0,j.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:lr};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:Ze||`“${E.quote.slice(0,160)}”`,penColor:lr};if(ft){let e=(Y?.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:qr[e.kind].color,note:e.title}));return{source:ft.source,page:ft.page,quote:ft.quote,color:qr[ft.kind].color,kindLabel:qr[ft.kind].label,title:ft.title,isFigure:ft.kind===`diagram`,...ft.box?{box:ft.box}:{},also:e,connections:pt.map(e=>({id:e,title:ut.get(e)?.title??``})),fromAsk:!1,penExplain:fr(ft),penColor:ur(ft.kind),...pr(ft)?{penAccent:pr(ft)}:{}}}return null},[Z,w,E,Ze,ft,pt,ut,Y]),zt=Z&&(!!$||!!ht),Bt=(0,j.useCallback)(e=>{if(!$)return;let t={...e,color:$.penColor,title:$.title,explanation:$.penExplain,...$.penAccent?{accent:$.penAccent}:{}};et(t),Ye&&t.explanation&&(Gr(),Kr(t.explanation))},[$,Ye,et]),Vt=!!L,Ht=(0,j.useCallback)(e=>{let t=e.map(e=>ut.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})},[ut,Dt]),Ut=(0,j.useMemo)(()=>new Map([...Ue].map(([e,t])=>[e,t.verdict])),[Ue]),Wt=(0,j.useCallback)(e=>{ne(new Set(e.claimIds)),Ht(e.claimIds),(qe||c)&&C(e.claimIds[0]??null)},[qe,c,Ht]),Gt=(0,j.useCallback)(()=>{Gr(),R(null),ne(new Set),C(null),Ot()},[Ot]),Kt=(0,j.useCallback)(e=>{e!==`recon`&&(oe.current?.abort(),ae(!1)),e!==`xe`&&(de.current?.abort(),K(!1)),e!==`fa`&&(be.current?.abort(),he(!1)),e!==`lv`&&(Oe.current?.abort(),we(!1))},[]),qt=(0,j.useCallback)(()=>{if(!Y||!_)return;let e=ar(Y.claims,_.threads,Ut);e.length!==0&&(Gr(),Kt(`none`),C(null),D(null),M(!1),U(!1),ce(!1),_e(!1),Ee(!1),(qe||c)&&ze(e=>Math.max(e,60)),R(e))},[Y,_,Ut,qe,c,Kt]),Jt=(0,j.useRef)(!1),Yt=(0,j.useRef)(qt);Yt.current=qt;let Xt=(0,j.useRef)(null);(0,j.useEffect)(()=>{!c||Jt.current||g!==`settled`||!Y||!_||(Jt.current=!0,Xt.current=setTimeout(()=>Yt.current(),800))},[c,g,Y,_]),(0,j.useEffect)(()=>()=>{Xt.current!==null&&clearTimeout(Xt.current)},[]),(0,j.useEffect)(()=>()=>oe.current?.abort(),[]);let Zt=(0,j.useMemo)(()=>{let e=new Set;if(B)for(let t of B)for(let n of t.claimIds)e.add(n);return e},[B]),Qt=(0,j.useCallback)(()=>{if(H){U(!1);return}if(Kt(`recon`),ce(!1),_e(!1),Ee(!1),M(!1),B){U(!0);return}if(!_||!v||!t)return;oe.current?.abort();let e=new AbortController;oe.current=e,ae(!0);let n=_.claims.map(e=>({id:e.id,page:e.page,quote:e.quote}));Rr().then(({runReconcile:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||(ie(t),U(!0))}).catch(()=>{e.signal.aborted||ie([])}).finally(()=>{e.signal.aborted||ae(!1)})},[H,B,_,v,t,Kt]);(0,j.useEffect)(()=>()=>de.current?.abort(),[]);let $t=(0,j.useMemo)(()=>{let e=new Set;if(W)for(let t of W)e.add(t.claimId);return e},[W]),en=(0,j.useMemo)(()=>{let e=new Set;if(W)for(let t of W)t.status===`open`&&e.add(t.claimId);return e},[W]),tn=(0,j.useCallback)(e=>{ue(e.id),Ft({doc:e.doc,page:e.anchorPage,quote:e.anchorQuote})},[Ft]),nn=(0,j.useCallback)(()=>{if(q){ce(!1);return}if(Kt(`xe`),U(!1),_e(!1),Ee(!1),M(!1),W){ce(!0);return}if(!_||!v||!t)return;de.current?.abort();let e=new AbortController;de.current=e,K(!0),ce(!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}));zr().then(({runCrossExam:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||se(t)}).catch(()=>{e.signal.aborted||se([])}).finally(()=>{e.signal.aborted||K(!1)})},[q,W,_,v,t,Kt]);(0,j.useEffect)(()=>()=>be.current?.abort(),[]);let rn=(0,j.useMemo)(()=>{let e=new Set;if(fe)for(let t of fe)e.add(t.claimId);return e},[fe]),an=(0,j.useCallback)(e=>{ye(e.claimId);let t=ut.get(e.claimId);t&&Ft({doc:t.source,page:e.page,quote:e.predicted})},[ut,Ft]),on=(0,j.useCallback)(()=>{if(ge){_e(!1);return}if(Kt(`fa`),U(!1),ce(!1),Ee(!1),M(!1),fe){_e(!0);return}if(!_||!t||!n?.enabled)return;be.current?.abort();let e=new AbortController;be.current=e,he(!0),_e(!0);let r=_.claims.filter(e=>e.kind===`forecast`).map(e=>({id:e.id,page:e.page,quote:e.quote}));Br().then(({runAutopsy:i})=>i(r,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal})).then(t=>{e.signal.aborted||pe(t)}).catch(()=>{e.signal.aborted||pe([])}).finally(()=>{e.signal.aborted||he(!1)})},[ge,fe,_,t,n,Kt]);(0,j.useEffect)(()=>()=>Oe.current?.abort(),[]);let sn=(0,j.useMemo)(()=>{let e=new Set;if(xe)for(let t of xe.nodes)e.add(`${t.doc}:${t.page}`);return e},[xe]),cn=(0,j.useCallback)(e=>{Ft({doc:e.doc,page:e.page,quote:e.quote})},[Ft]),ln=(0,j.useCallback)(()=>{if(Te){Ee(!1);return}if(Kt(`lv`),U(!1),ce(!1),_e(!1),M(!1),De.current){Ee(!0);return}if(!_||!v||!t)return;Oe.current?.abort();let e=new AbortController;Oe.current=e,De.current=!0,we(!0),Ee(!0);let n=_.claims.map(e=>({quote:e.quote,page:e.page,doc:e.source}));Vr().then(({runLevers:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||Se(t)}).catch(()=>{e.signal.aborted||Se(null)}).finally(()=>{e.signal.aborted||we(!1)})},[Te,_,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:He,onClick:e=>e.stopPropagation(),children:[(0,Q.jsxs)(`header`,{className:`prism-head`,children:[(0,Q.jsxs)(`div`,{className:`prism-file`,children:[(0,Q.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,Q.jsx)(`path`,{d:`M6 2h8l4 4v16H6z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,Q.jsx)(`path`,{d:`M14 2v4h4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`})]}),(0,Q.jsx)(`span`,{className:`prism-file-name`,children:f?`${u.length} documents`:u[0].name}),_&&(0,Q.jsxs)(`span`,{className:`prism-file-pages`,children:[`· `,_.pageCount,` pages`]})]}),(0,Q.jsxs)(`div`,{className:`prism-head-right`,children:[Z&&s&&(0,Q.jsx)(`div`,{className:`syn-lenses`,role:`tablist`,"aria-label":`Lens`,children:[[`all`,`All`,0],[`contradictions`,`Contradictions`,s.counts.contradictions],[`gaps`,`Gaps`,s.counts.gaps],[`consensus`,`Consensus`,s.counts.consensus]].map(([e,t,n])=>(0,Q.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":s.lens===e,className:`syn-lens`+(s.lens===e?` is-active`:``),onClick:()=>{gt(null),s.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:St,children:[(0,Q.jsx)(`span`,{className:`prism-phase-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-phase-label`,children:St})]}),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:`✕`})]})]}),f&&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:Qr[t%Qr.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&&Re>=99?`true`:void 0,ref:Be,children:[(0,Q.jsxs)(`div`,{className:`prism-stage`+(X.panning?` is-panning`:``),ref:ct,onWheel:Z?X.onWheel:void 0,onPointerDown:Z?X.onPointerDown:void 0,onPointerMove:Z?X.onPointerMove:void 0,onPointerUp:Z?X.onPointerUp:void 0,onPointerCancel:Z?X.onPointerUp:void 0,onClickCapture:e=>{X.movedRef.current&&(e.stopPropagation(),e.preventDefault(),X.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:f?`DOCUMENTS`:`DOCUMENT`}),(0,Q.jsx)(`span`,{className:`prism-doc-title`,children:f?`${u.length} documents`:u[0].name.replace(/\.pdf$/i,``)}),(0,Q.jsx)(`div`,{className:`prism-doc-lines`,children:[92,84,88,70,90,60,80,66].map((e,t)=>(0,Q.jsx)(`span`,{className:`prism-doc-line`,style:{width:`${e}%`}},t))})]}),g===`igniting`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`prism-shock`}),ri.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&&Y&&(0,Q.jsxs)(`div`,{className:`prism-world`,"data-briefing":Vt?`true`:void 0,style:{width:Y.width,height:Y.height,transform:X.transform},children:[Y.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)),Y.links.length>0&&(0,Q.jsx)(`svg`,{className:`prism-links`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:Y.links.map((e,t)=>{let n=ut.get(e.a),r=ut.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:Y.width,height:Y.height,"aria-hidden":`true`,children:_.threads.map((e,t)=>{let n=ut.get(e.a),r=ut.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`+(ke===`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:[Yr[e.relation],e.crossDoc?` across docs`:` · p.${n.page}↔p.${r.page}`]})})]},t)})}),H&&B&&B.length>0&&(0,Q.jsx)(`svg`,{className:`prism-threads prism-recon`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:B.map(e=>{if(e.a===e.b)return null;let t=ut.get(e.a),n=ut.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)})}),Y.claims.map(e=>{let t=qr[e.kind],n=S===e.id,r=Ue.get(e.id),i=_?.threads.find(t=>t.a===e.id||t.b===e.id),a=r?.citation?d(r.citation.url):null,o=!!i,c=i?i.relation===`agrees`?`var(--insight)`:i.relation===`in-tension`?`var(--warning)`:`var(--danger)`:t.color,l=ke===`contra`&&!o,u=O.has(`${e.source}:${e.page}`),f=!!E&&O.size>0&&!u,p=z.has(e.id),m=Vt&&z.size>0&&!p,h=H&&Zt.has(e.id),g=H&&Zt.size>0&&!h,v=q&&en.has(e.id),y=q&&en.size>0&&!$t.has(e.id),b=ge&&rn.has(e.id),x=ge&&rn.size>0&&!b,w=Te&&sn.has(`${e.source}:${e.page}`),k=Te&&sn.size>0&&!w,A=!!s&&(bt===`gaps`?!0:bt===`contradictions`?!vt.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`:``)+(o?` is-flagged`:``)+(u||p||h||b||w?` is-cited`:``)+(v?` is-objected`:``)+(l||f||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":Fn[r.verdict].token},children:[(0,Q.jsx)(`span`,{className:`prism-seal-dot`,"aria-hidden":`true`}),Fn[r.verdict].label]}),n&&(0,Q.jsxs)(`span`,{className:`prism-claim-body`,children:[(0,Q.jsxs)(`span`,{className:`prism-claim-quote`,children:[`“`,e.quote,`”`]}),i&&(0,Q.jsxs)(`span`,{className:`prism-claim-flag`,children:[$r(i.relation,i.crossDoc),` — follow the thread`]}),r&&(0,Q.jsxs)(`span`,{className:`prism-claim-verdict`,"data-verdict":r.verdict,style:{"--seal-color":Fn[r.verdict].token},children:[(0,Q.jsxs)(`span`,{className:`prism-verdict-head`,children:[(0,Q.jsx)(`span`,{className:`prism-verdict-label`,children:Fn[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":ei(i),children:ti(i)})]},e.id)}),s&&(0,Q.jsxs)(Q.Fragment,{children:[s.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:()=>{X.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)),s.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:()=>{X.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)}),s.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:()=>{X.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:()=>X.zoomBy(1.25),"aria-label":`Zoom in`,children:`+`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>X.zoomBy(1/1.25),"aria-label":`Zoom out`,children:`−`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>X.fit(),"aria-label":`Fit the whole map`,title:`Fit`,children:`⤢`})]}),Z&&ee&&Lt&&(0,Q.jsx)(o,{label:`Document ask`,children:(0,Q.jsx)(Dr,{open:A&&!Vt&&!q&&!ge&&!Te,ctx:Lt,seed:te,onAnswer:It,onFocusSpan:Ft,activeSpan:E,multiDoc:f,docLabel:Mt,onClose:()=>M(!1)},F)}),Z&&L&&(0,Q.jsx)(o,{label:`Briefing`,children:(0,Q.jsx)(Or,{beats:L,onBeat:Wt,onExit:Gt})}),Z&&q&&!Vt&&(0,Q.jsx)(o,{label:`Cross-examination`,children:(0,Q.jsx)(kr,{objections:W??[],busy:G,onFocusObjection:tn,activeId:J,multiDoc:f,docLabel:Mt,onClose:()=>ce(!1)})}),Z&&ge&&!Vt&&(0,Q.jsx)(o,{label:`Forecast review`,children:(0,Q.jsx)(Ar,{grades:fe??[],busy:me,onFocusForecast:an,activeId:ve,onClose:()=>_e(!1)})}),Z&&Te&&!Vt&&(0,Q.jsx)(o,{label:`Live levers`,children:(0,Q.jsx)(jr,{model:xe,busy:Ce,onFocusNode:cn,onClose:()=>Ee(!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:nt,onPointerMove:rt,onPointerUp:it,onPointerCancel:it,onKeyDown:e=>{e.key===`ArrowLeft`?ze(e=>Math.min(100,e+4)):e.key===`ArrowRight`&&ze(e=>Math.max(24,e-4))},children:(0,Q.jsx)(`span`,{className:`prism-divider-grip`,"aria-hidden":`true`})}),$&&Z&&u[$.source]&&(()=>{let e=u[$.source],t=_?.documents[$.source]?.slideImages,n=_?.documents[$.source]?.pageCount??1;return(0,Q.jsxs)(`div`,{className:`prism-page-wrap`,style:{"--pdf-pct":`${Re}%`},children:[(0,Q.jsx)(Pn,{pdf:e,slideImages:t,source:$.source,page:$.page,quote:$.quote,color:$.color,also:$.also,note:$.penExplain,penOn:qe,penColor:$.penColor,penAccent:$.penAccent,onAnnotated:Bt,kindLabel:$.kindLabel,isFigure:$.isFigure,docName:f?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})}}),qe&&!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:()=>Xe(e=>!e),"aria-pressed":Ye,title:Ye?`Mute narration`:`Read it aloud`,children:Ye?`🔊`:`🔇`})]})]})})(),ht&&Z&&s&&(0,Q.jsx)(`div`,{className:`prism-page-wrap syn-detail-panel`,style:{"--pdf-pct":`${Re}%`},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=s.contradictions.find(e=>e.id===ht.id);if(!e)return null;let t=ut.get(e.a),n=ut.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:[s.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),M(!0),P(t=>({id:(t?.id??0)+1,question:e.seedQuestion}))},children:`Interrogate — are these comparable?`})]})})(),ht.kind===`gap`&&(()=>{let e=s.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=s.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=ut.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:[s.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&&!V&&!H&&(Ge||jt)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":Ge?`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:Ge?`Checking the key claims against the public record…`:jt})]}),Z&&(V||H)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":V?`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:V?`Checking the document’s own numbers against each other…`:B&&B.length>0?`${B.length===1?`A number doesn’t`:`${B.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`,` · `,Y?.regions.length??0,` region`,(Y?.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||(U(!1),ce(!1),_e(!1),Ee(!1)),A||N(!0),M(e=>!e)},...i(xr.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,...i(Sr.preload),disabled:!Y||Y.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`+(H?` is-active`:``),onClick:Qt,...i(()=>Rr().then(()=>void 0)),disabled:V||!t||!_||_.claims.length===0,"aria-pressed":H,title:`Check the document's own figures against each other — flags numbers that don't add up, computed in pure code`,children:V?`Checking…`:H?`Hide numbers`:`Check the numbers`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(q?` is-active`:``),onClick:nn,...i(()=>Promise.all([Cr.preload(),zr()]).then(()=>void 0)),disabled:G||!t||!_||_.claims.filter(e=>e.role===`load-bearing`).length===0,"aria-pressed":q,title:`Raise the sharpest objection to each load-bearing claim — and show only the ones the document never answers`,children:G?`Examining…`:q?`Hide objections`:`Cross-examine`}),_&&_.claims.some(e=>e.kind===`forecast`)&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(ge?` is-active`:``),onClick:on,...i(()=>Promise.all([wr.preload(),Br()]).then(()=>void 0)),disabled:me||!t||!n?.enabled,"aria-pressed":ge,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:me?`Grading…`:ge?`Hide forecasts`:`Grade forecasts`}),_&&_.claims.some(e=>/\d/.test(e.quote))&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Te?` is-active`:``),onClick:ln,...i(()=>Promise.all([Tr.preload(),Vr()]).then(()=>void 0)),disabled:Ce||!t||!v,"aria-pressed":Te,title:`Find the model implied under the document and drag its assumptions — every figure traces to a page, the conclusion recomputes live`,children:Ce?`Modeling…`:Te?`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`+(ke===`contra`?` is-active`:``),onClick:()=>Ae(e=>e===`contra`?`map`:`contra`),disabled:!_||_.threads.length===0,title:_&&_.threads.length===0?f?`No links found between these documents`:`No contradictions found in this document`:void 0,children:_&&_.threads.length>0?f?`Show links (${_.threads.length})`:`Find contradictions (${_.threads.length})`:f?`No links`:`No contradictions`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:Rt,...i(()=>Promise.all([Er.preload(),Hr()]).then(()=>void 0)),disabled:!t||!v||Ne!==null,title:`Explode this document into a causal web — every link traces to a page`,children:Ne===`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`+(qe?` is-active`:``),onClick:()=>Je(e=>!e),"aria-pressed":qe,title:`Annotate — Mavéa draws a pen mark over the cited lines and explains, on every question, claim, and briefing beat`,children:qe?`Pen on`:`Annotate`}),_&&(0,Q.jsx)(br,{steps:$e,spec:_,pdfs:u,cfg:t,placed:Y?.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:()=>Ae(`map`),children:`Reset view`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Ie?` is-active`:``),onClick:()=>Le(e=>!e),"aria-pressed":Ie,children:`Legend`})]})]})]}),Z&&Ie&&(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:Xr.map(e=>(0,Q.jsxs)(`li`,{className:`prism-legend-kind`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-kind-dot`,style:{background:qr[e.kind].color},"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-legend-kind-name`,children:qr[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:Zr.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.`})})]}),je&&(0,Q.jsx)(o,{label:`Why map`,overlay:!0,children:(0,Q.jsx)(Mr,{dag:je,onClose:()=>Me(null)})})]})}var ri=[{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{ni as PrismOverlay,Pt as a,He as c,ne as d,ar as i,H as l,gr as n,Et as o,ur as r,Ve as s,pr as t,ue 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-DOpl5xzv.js";import{t as n}from"./LegalMarkdownDocument-B7Yj_aRR.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-DOpl5xzv.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-DOpl5xzv.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-
|
|
2
|
-
import{r as e}from"./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-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-DNpc-U9U.js","assets/chunk-BVpWp9h4.js","assets/index-DOpl5xzv.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ReelJelly-B2JQsaRI.js","assets/geometry-DXAbnb0J.js","assets/registry-BnSnMnyk.js","assets/fit-BtKObM5Q.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-B-MNB16v.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-DOpl5xzv.js";import{n as u}from"./icons-CHVz6kv_.js";import"./ShareModal-DNpc-U9U.js";import"./annotationReel-CdAmTPlv.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-DNpc-U9U.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]))),_=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-CKvJb_8Y.js";import"./canvas-BrUiUI9Q.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};
|