PageSourceSearch

https://www.noeis.io/static/js/7231.5575b991.chunk.js

js noeis.io collected 2026-10-02 01:03:48 UTC 38,192 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunknote_taker_ui=self.webpackChunknote_taker_ui||[]).push([[1971,2233,4646,7231,9632],{750:(e,t,a)=>{a.d(t,{A:()=>o});var s=a(5043),n=a(1045),l=a(579);const i=e=>{let{children:t,collapsed:a}=e;return(0,l.jsx)("aside",{className:"three-pane__left ".concat(a?"is-collapsed":""),children:t})},r=e=>{let{header:t,actions:a,children:s}=e;return(0,l.jsxs)("section",{className:"three-pane__main",children:[(t||a)&&(0,l.jsxs)("div",{className:"three-pane__main-header",children:[(0,l.jsx)("div",{children:t}),a&&(0,l.jsx)("div",{className:"three-pane__main-actions",children:a})]}),s]})};var c=a(8028);const o=e=>{let{left:t,main:a,right:o,className:d="",rightTitle:h="Context",leftOpen:u,rightOpen:m,defaultLeftOpen:p=!1,defaultRightOpen:g=!1,onToggleRight:v,mainHeader:x,mainActions:j,rightToggleLabel:f="Context"}=e;const y=(0,n.zy)(),N=Boolean(t),b=Boolean(o),w="boolean"===typeof u,k="boolean"===typeof m,C=(0,s.useMemo)((()=>"three-pane-left-open:".concat(y.pathname)),[y.pathname]),S=(0,s.useMemo)((()=>"three-pane-right-open:".concat(y.pathname)),[y.pathname]),_=(0,s.useMemo)((()=>{const e=localStorage.getItem(C);return null===e?p:"true"===e}
1),[p,C]),[A,I]=(0,s.useState)((()=>{const e=localStorage.getItem(S);return null===e?g:"true"===e})),T=w?u:_,R=k?m:A,E=e=>{k||I(e),localStorage.setItem(S,String(e)),null===v||void 0===v||v(e)};return(0,l.jsxs)("div",{className:"three-pane ".concat(d," ").concat(N&&T?"":"three-pane--left-collapsed"," ").concat(b&&R?"":"three-pane--right-collapsed"),children:[(0,l.jsx)(i,{collapsed:!N||!T,children:t}),(0,l.jsx)(r,{header:x,actions:j||(b?(0,l.jsx)("button",{type:"button",className:"topbar__button",onClick:()=>E(!R),children:f}):null),children:a}),(0,l.jsx)(c.A,{title:h,open:b&&R,onToggle:E,children:o})]})}},1971:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var s=a(5043),n=a(5063),l=a(5581),i=a(3563),r=a(579);const c=e=>{let{open:t,highlight:a,onClose:c,onCreate:o,onAttach:d}=e;const{concepts:h}=(0,l.A)(),{questions:u,loading:m,error:p}=(0,i.A)({status:"open",enabled:t}),[g,v]=(0,s.useState)(""),[x,j]=(0,s.useState)(""),[f,y]=(0,s.useState)(""),[N,b]=(0,s.useState)("");(0,s.useEffect)((()=>{var e;t&&a&&(v(a.text||""),j((null===(e=a.tags)||void 0===e?void 0:e[0])||""),y(""),b(""))}),[t,a]);const w=(0,s.useMemo)((()=>{const e=f.trim().toLowerCase();return e?u.filter((t=>t.text.toLowerCase().includes(e))):u}),[u,f]);return t&&a?(0,r.jsx)("div",{className:"modal-overlay",children:(0,r.jsxs)("div",{className:"modal-content",style:{maxWidth:520},children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h3",{children:"Add to Question"}),(0,r.jsx)("button",{className:"icon-button",onClick:c,children:"\xd7"})]}),m&&(0,r.jsx)("p",{className:"muted small",children:"Loading questions\u2026"}),p&&(0,r.jsx)("p",{className:"status-message error-message",children:p}),(0,r.jsxs)("label",{className:"feedback-field",children:[(0,r.jsx)("span",{children:"Search questions"}),(0,r.jsx)("input",{type:"text",value:f,onChange:e=>y(e.target.value),placeholder:"Search open questions"})]}),(0,r.jsxs)("div",{className:"library-folder-picker",children:[w.map((e=>(0,r.jsx)(n.$q,{className:N===e._id?"is-active":"",onClick:()=>b(e._id),children:e.text},e._id))),!m&&0===w.length&&(0,r.jsx)("p",{className:"muted small",children:"No open questions yet."})]}),(0,r.jsxs)("div",{className:"modal-actions",style:{justifyContent:"flex-end",gap:8},children:[(0,r.jsx)(n.$n,{variant:"secondary",onClick:c,children:"Cancel"}),(0,r.jsx)(n.$n,{variant:"secondary",onClick:()=>d(a,N),disabled:!N,children:"Add to selected"})]}),(0,r.jsxs)("div",{style:{marginTop:16},children:[(0,r.jsx)("div",{className:"muted small",style:{marginBottom:6},children:"Or create a new question"}),(0,r.jsxs)("label",{className:"feedback-field",children:[(0,r.jsx)("span",{children:"Question"}),(0,r.jsx)("input",{type:"text",value:g,onChange:e=>v(e.target.value)})]}),(0,r.jsxs)("label",{className:"feedback-field",children:[(0,r.jsx)("span",{children:"Concept"}),(0,r.jsxs)("select",{value:x,onChange:e=>j(e.target.value),children:[(0,r.jsx)("option",{value:"",children:"No concept"}),h.map((e=>(0,r.jsx)("option",{value:e.name,children:e.name},e.name)))]})]}),(0,r.jsx)("div",{className:"modal-actions",style:{justifyContent:"flex-end",gap:8},children:(0,r.jsx)(n.$n,{onClick:()=>o(a,x,g||"New question"),children:"Create new"})})]})]})}):null}},2233:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var s=a(5043),n=a(5063),l=a(5581),i=a(579);const r=e=>{let{open:t,highlight:a,onClose:r,onSelect:c}=e;const{concepts:o,loading:d,error:h}=(0,l.A)(),[u,m]=(0,s.useState)("");(0,s.useEffect)((()=>{t&&m("")}),[t]);const p=(0,s.useMemo)((()=>{const e=u.trim().toLowerCase();return e?o.filter((t=>t.name.toLowerCase().includes(e))):o}),[o,u]);return t&&a?(0,i.jsx)("div",{className:"modal-overlay",children:(0,i.jsxs)("div",{className:"modal-content",style:{maxWidth:520},children:[(0,i.jsxs)("div",{className:"modal-header",children:[(0,i.jsx)("h3",{children:"Add to Concept"}),(0,i.jsx)("button",{className:"icon-button",onClick:r,children:"\xd7"})]}),d&&(0,i.jsx)("p",{className:"muted small",children:"Loading concepts\u2026"}),h&&(0,i.jsx)("p",{className:"status-message error-message",children:h}),(0,i.jsxs)("label",{className:"feedback-field",children:[(0,i.jsx)("span",{children:"Search or create"}),(0,i.jsx)("input",{type:"text",value:u,onChange:e=>m(e.target.value),placeholder:"Type a concept name"})]}),(0,i.jsxs)("div",{className:"library-folder-picker",children:[p.map((e=>(0,i.jsx)(n.$q,{onClick:()=>c(a,e.name),children:e.name},e.name))),!d&&0===p.length&&(0,i.jsx)("p",{className:"muted small",children:"No concepts yet."})]}),(0,i.jsxs)("div",{className:"modal-actions",style:{justifyContent:"flex-end",gap:8},children:[(0,i.jsx)(n.$q,{onClick:r,children:"Cancel"}),(0,i.jsx)(n.$q,{onClick:()=>c(a,u.trim()),disabled:!u.trim(),children:"Create new"})]})]})}):null}},3563:(e,t,a)=>{a.d(t,{A:()=>i});var s=a(5043),n=a(7666),l=a(3615);const i=function(){let{status:e="open",tag:t="",conceptName:a="",enabled:i=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};
1const[r,c]=(0,s.useState)([]),[o,d]=(0,s.useState)(!1),[h,u]=(0,s.useState)(!1),[m,p]=(0,s.useState)(""),g=(0,s.useCallback)((async()=>{if(!i)return;const s=(0,l.b$)();d(!0),p("");try{const i=(a?await(0,n.cC)(a,{status:e}):await(0,n.yS)({status:e,tag:t}))||[];c(i),(0,l.s2)("think.questions.load",{mode:a?"concept":"global",count:i.length,durationMs:(0,l.up)(s)})}catch(h){var r,o;p((null===(r=h.response)||void 0===r||null===(o=r.data)||void 0===o?void 0:o.error)||"Failed to load questions.")}finally{d(!1),u(!0)}}),[a,i,e,t]);return(0,s.useEffect)((()=>{g()}),[g]),{questions:r,loading:o,loaded:h,error:m,refresh:g,setQuestions:c}}},3615:(e,t,a)=>{a.d(t,{b$:()=>r,kf:()=>i,s2:()=>l,up:()=>c});const s=()=>"undefined"!==typeof performance&&"function"===typeof performance.now?performance.now():Date.now(),n=e=>Math.round(100*Number(e||0))/100,l=function(e){},i=e=>(e,t,a,s,n,l)=>{},r=()=>s(),c=e=>n(s()-Number(e||0))},4646:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var s=a(5043),n=a(5063),l=a(9225),i=a(2606),r=a(579);const c=e=>{let{open:t,highlight:a,onClose:c,onSend:o}=e;const{entries:d,loading:h,error:u}=(0,l.A)({enabled:t}),[m,p]=(0,s.useState)(""),[g,v]=(0,s.useState)(""),[x,j]=(0,s.useState)(!1);(0,s.useEffect)((()=>{t&&(p(""),v(""))}),[t]);const f=(0,s.useMemo)((()=>{const e=g.trim().toLowerCase();return e?d.filter((t=>(t.title||"").toLowerCase().includes(e))):d}),[d,g]);if(!t)return null;return(0,r.jsx)("div",{className:"modal-overlay",children:(0,r.jsxs)("div",{className:"modal-content",style:{maxWidth:520},children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h3",{children:"Send to Notebook"}),(0,r.jsx)("button",{className:"icon-button",onClick:c,children:"\xd7"})]}),h&&(0,r.jsx)("p",{className:"muted small",children:"Loading notebook\u2026"}),u&&(0,r.jsx)("p",{className:"status-message error-message",children:u}),!h&&0===d.length&&(0,r.jsx)("p",{className:"muted small",children:"No notebook entries yet."}),(0,r.jsxs)("label",{className:"feedback-field",children:[(0,r.jsx)("span",{children:"Search or name a new entry"}),(0,r.jsx)("input",{type:"text",value:g,onChange:e=>v(e.target.value),placeholder:"Search notebook..."})]}),(0,r.jsx)("div",{className:"library-folder-picker",children:f.map((e=>(0,r.jsx)(n.$q,{className:m===e._id?"is-active":"",onClick:()=>p(e._id),children:e.title||"Untitled note"},e._id)))}),(0,r.jsxs)("div",{className:"modal-actions",style:{justifyContent:"flex-end",gap:8},children:[(0,r.jsx)(n.$n,{variant:"secondary",onClick:c,children:"Cancel"}),(0,r.jsx)(n.$n,{variant:"secondary",onClick:async()=>{const e=g.trim()||"Untitled note";j(!0);try{var t;const s=localStorage.getItem("token"),n=await i.Ay.post("/api/notebook",{title:e,content:"",blocks:[]},{headers:{Authorization:"Bearer ".concat(s)}});null!==(t=n.data)&&void 0!==t&&t._id&&await o(a,n.data._id)}catch(s){console.error("Error creating notebook entry:",s)}finally{j(!1)}},disabled:x||!g.trim(),children:x?"Creating\u2026":"Create new"}),(0,r.jsx)(n.$n,{onClick:async()=>{if(m&&!x){j(!0);try{await o(a,m)}finally{j(!1)}}},disabled:!m||x,children:x?"Opening\u2026":"Send and open"})]})]})})}},5581:(e,t,a)=>{a.d(t,{A:()=>i});var s=a(5043),n=a(5810),l=a(3615);const i=function(){let{enabled:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};
1const[t,a]=(0,s.useState)([]),[i,r]=(0,s.useState)(!1),[c,o]=(0,s.useState)(!1),[d,h]=(0,s.useState)(""),u=(0,s.useCallback)((async function(){let{force:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)return;const s=(0,l.b$)();r(!0),h("");try{const e=await(0,n.KD)({force:t})||[];a(e),(0,l.s2)("think.concepts.load",{count:e.length,durationMs:(0,l.up)(s)})}catch(d){var i,c;h((null===(i=d.response)||void 0===i||null===(c=i.data)||void 0===c?void 0:c.error)||"Failed to load concepts.")}finally{r(!1),o(!0)}}),[e]);(0,s.useEffect)((()=>{u()}),[u]);return{concepts:t,loading:i,loaded:c,error:d,refresh:(0,s.useCallback)((()=>u({force:!0})),[u])}}},7231:(e,t,a)=>{a.r(t),a.d(t,{default:()=>N});var s=a(5043),n=a(1045),l=a(7051),i=a(2606),r=a(5063),c=a(579);const o=[{label:"7d",value:"7d"},{label:"30d",value:"30d"},{label:"90d",value:"90d"},{label:"All",value:"all"}],d=e=>{let{embedded:t=!1}=e;const[a,d]=(0,s.useState)([]),[h,u]=(0,s.useState)("30d"),[m,p]=(0,s.useState)(!1),[g,v]=(0,s.useState)("");(0,s.useEffect)((()=>{(async e=>{p(!0),v("");try{const t=localStorage.getItem("token"),a=await i.Ay.get("/api/journey?range=".concat(e),{headers:{Authorization:"Bearer ".concat(t)}});d(a.data||[])}catch(s){var t,a;console.error("Error loading journey:",s),v((null===(t=s.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.error)||"Failed to load journey.")}finally{p(!1)}})(h)}),[h]);const x=s.useMemo((()=>{const e=new Map;return a.forEach((t=>{const a=(t.createdAt?new Date(t.createdAt):new Date).toLocaleString(void 0,{month:"long",year:"numeric"});e.has(a)||e.set(a,{key:a,items:[],highlightCount:0,tagCounts:{}});const s=e.get(a);s.items.push(t),s.highlightCount+=t.highlightCount||0,(t.topTags||[]).forEach((e=>{s.tagCounts[e]=(s.tagCounts[e]||0)+1}))})),Array.from(e.values()).map((e=>{const t=Object.entries(e.tagCounts).sort(((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))).slice(0,4).map((e=>{let[t]=e;return t}));return(0,l.A)((0,l.A)({},e),{},{topTags:t})}))}),[a]),j=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"page-header",children:[(0,c.jsx)("p",{className:"muted-label",children:"Journey"}),(0,c.jsx)("h1",{children:"Your reading trail"}),(0,c.jsx)("p",{className:"muted",children:"Recent articles, their highlights, and the tags that define them."})]}),(0,c.jsxs)(r.Zp,{className:"search-section",children:[(0,c.jsxs)("div",{className:"search-section-header",style:{alignItems:"center"},children:[(0,c.jsx)("span",{className:"eyebrow",children:"Range"}),(0,c.jsx)("div",{style:{display:"flex",gap:8},children:o.map((e=>(0,c.jsx)(r.$n,{variant:h===e.value?"primary":"secondary",onClick:()=>u(e.value),children:e.label},e.value)))})]}),m&&(0,c.jsx)("p",{className:"status-message",children:"Loading\u2026"}),g&&(0,c.jsx)("p",{className:"status-message error-message",children:g}),!m&&!g&&(0,c.jsxs)("div",{className:"journey-group-list",children:[0===a.length&&(0,c.jsx)("p",{className:"muted small",children:"No activity yet."}),x.map((e=>(0,c.jsxs)("div",{className:"journey-group",children:[(0,c.jsxs)("div",{className:"journey-group-header",children:[(0,c.jsx)("div",{className:"journey-group-title",children:e.key}),(0,c.jsxs)("div",{className:"muted small",children:[e.highlightCount," highlights"]})]}),(0,c.jsx)("div",{className:"journey-group-tags",children:e.topTags.length>0?e.topTags.map((t=>(0,c.jsx)(r.Fc,{children:t},"".concat(e.key,"-").concat(t)))):(0,c.jsx)("span",{className:"muted small",children:"No tags"})}),(0,c.jsx)("div",{className:"journey-group-items",children:e.items.map((e=>(0,c.jsxs)("div",{className:"journey-group-row",children:[(0,c.jsx)(n.N_,{to:"/articles/".concat(e._id),className:"article-title-link",children:e.title||"Untitled article"}),(0,c.jsxs)("span",{className:"muted small",children:[e.highlightCount," highlights"]})]},e._id)))})]},e.key)))]})]})]});return t?j:(0,c.jsx)(r.YW,{children:j})};var h=a(1138);const u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{enabled:a=!0}=t,[n,l]=(0,s.useState)({rangeDays:14,activeConcepts:[],notesInProgress:[],openQuestions:{groups:[]},deltaSummary:[]}
1),[r,c]=(0,s.useState)(!1),[o,d]=(0,s.useState)(""),u=(0,s.useCallback)((async()=>{if(a){c(!0),d("");try{const t=await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"14d";return(await i.Ay.get("/api/reflections?range=".concat(encodeURIComponent(e)),(0,h.z)())).data}(e);l(t||{rangeDays:14,activeConcepts:[],notesInProgress:[],openQuestions:{groups:[]},deltaSummary:[]})}catch(n){var t,s;d((null===(t=n.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.error)||"Failed to load reflections.")}finally{c(!1)}}}),[a,e]);return(0,s.useEffect)((()=>{u()}),[u]),{data:n,loading:r,error:o,refresh:u}};var m=a(750),p=a(2233),g=a(4646),v=a(1971),x=a(7666),j=a(9632),f=a(5786),y=a(5943);const N=()=>{var e,t,a,l;const o=(0,s.useMemo)((()=>[{key:"journey",label:"Journey"},{key:"reflections",label:"Reflections"},{key:"resurface",label:"Resurface"},{key:"patterns",label:"Brain / Patterns"}]),[]),[N,b]=(0,s.useState)("journey"),[w,k]=(0,s.useState)("14d"),C=(0,n.zy)(),S=(0,n.Zp)(),[_,A]=(0,s.useState)([]),[I,T]=(0,s.useState)(!1),[R,E]=(0,s.useState)(""),[L,q]=(0,s.useState)(""),[$,M]=(0,s.use
1State)((()=>(0,f.Cs)())),[O,D]=(0,s.useState)({open:!1,highlight:null}),[U,F]=(0,s.useState)({open:!1,highlight:null}),[B,z]=(0,s.useState)({open:!1,highlight:null}),P="reflections"===N,{data:W,loading:Q,error:H,refresh:J}=u(w,{enabled:P}),K=()=>({headers:{Authorization:"Bearer ".concat(localStorage.getItem("token"))}}),Z=(0,s.useMemo)((()=>[{label:"7d",value:"7d"},{label:"14d",value:"14d"},{label:"30d",value:"30d"}]),[]),X=e=>{const t=new URLSearchParams(C.search);Object.entries(e).forEach((e=>{let[a,s]=e;s?t.set(a,s):t.delete(a)})),S({pathname:C.pathname,search:t.toString()},{replace:!1})},V=()=>"undefined"!==typeof crypto&&crypto.randomUUID?crypto.randomUUID():"block-".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2)),Y=function(){return String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")},G=()=>{const e=(new Date).toISOString().slice(0,10);return"resurface.daily:".concat(e)},ee=(0,s.useCallback)((async()=>{T(!0),E("");try{var e;const t=localStorage.getItem(G());if(t){const e=JSON.parse(t);if(Array.isArray(e)&&e.length>0)return A(e),void T(!1)}const a=await i.Ay.get("/api/resurface",K()),s=((null===(e=a.data)||void 0===e?void 0:e.dailyRandomHighlights)||[]).slice(0,5);A(s),localStorage.setItem(G(),JSON.stringify(s))}catch(s){var t,a;console.error("Error loading resurfacing highlights:",s),E((null===(t=s.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.error)||"Failed to load resurfacing highlights.")}finally{T(!1)}}),[]);(0,s.useEffect)((()=>{"resurface"===N&&ee()}),[N,ee]),(0,s.useEffect)((()=>{"resurface"===N&&_.length&&!L&&q(_[0]._id)}),[N,L,_]);const te=(0,s.useMemo)((()=>_.find((e=>e._id===L))||null),[L,_]);(0,s.useEffect)((()=>{const e=new URLSearchParams(C.search),t=e.get("tab"),a=e.get("range");t&&o.some((e=>e.key===t))&&b(t),a&&Z.some((e=>e.value===a))&&k(a)}),[C.search,Z,o]);const ae=(0,c.jsxs)("div",{className:"section-stack review-mode__left-panel",children:[(0,c.jsx)(r.X3,{title:"Review sections",subtitle:"Switch your lens."}),(0,c.jsx)("div",{className:"section-stack",children:o.map((e=>(0,c.jsx)(r.$q,{className:"list-button ".concat(N===e.key?"is-active":""),onClick:()=>{b(e.key),X({tab:e.key})},children:e.label},e.key)))}),"reflections"===N&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r.PJ,{}),(0,c.jsx)(r.X3,{title:"Range",subtitle:"Focus window."}),(0,c.jsx)("div",{className:"section-stack",children:Z.map((e=>(0,c.jsx)(r.$q,{className:"list-button ".concat(w===e.value?"is-active":""),onClick:()=>{k(e.value),X({tab:"reflections",range:e.value})},children:e.label},e.value)))})]}),(0,c.jsx)(r.PJ,{}),(0,c.jsx)("p",{className:"muted small",children:"Review is optional, but it shows you where the patterns live."})]}),se=(0,c.jsx)("div",{className:"section-stack review-mode__main-panel",children:(()=>{switch(N){case"resurface":return(0,c.jsxs)("div",{className:"section-stack",children:[(0,c.jsx)(r.X3,{title:"Daily Resurface",subtitle:"Five highlights, steady and calm."}),I&&(0,c.jsx)("p",{className:"muted small",children:"Loading\u2026"}),R&&(0,c.jsx)("p",{className:"status-message error-message",children:R}),!I&&!R&&(0,c.jsxs)("div",{className:"review-resurface-list",children:[0===_.length&&(0,c.jsx)("p",{className:"muted small",children:"No highlights to resurface yet."}),_.map((e=>(0,c.jsxs)("button",{className:"review-resurface-row ".concat(L===e._id?"is-active":""),onClick:()=>q(e._id),children:[(0,c.jsx)("div",{className:"review-resurface-title",children:e.articleTitle||"Untitled article"}),(0,c.jsx)("div",{className:"review-resurface-text",children:e.text}),(0,c.jsx)("div",{className:"review-resurface-tags",children:(e.tags||[]).length>0?e.tags.map((t=>(0,c.jsx)(r.Fc,{children:t},"".concat(e._id,"-").concat(t)))):(0,c.jsx)("span",{className:"muted small",children:"Untagged"})})]},e._id)))]})]});case"reflections":{var e;const t=W.activeConcepts||[],a=W.notesInProgress||[],s=(null===(e=W.openQuestions)||void 0===e?void 0:e.groups)||[],l=W.deltaSummary||[];return(0,c.jsxs)("div",{className:"section-stack",children:[(0,c.jsxs)(r.Zp,{className:"search-section",children:[(0,c.jsxs)("div",{className:"search-section-header",children:[(0,c.jsx)("span",{className:"eyebrow",children:"Actively thinking about"}),(0,c.jsxs)("span",{className:"muted small",children:["Last ",w]})]}),Q&&(0,c.jsx)("p",{className:"muted small",children:"Loading reflections\u2026"}),H&&(0,c.jsx)("p",{className:"status-message error-message",children:H}),!Q&&!H&&(0,c.jsxs)("div",{className:"reflection-list",children:[0===t.length&&(0,c.jsx)("p",{className:"muted small",children:"No concept activity yet."}),t.map((e=>(0,c.jsxs)("div",{className:"reflection-row",children:[(0,c.jsxs)("div",{className:"reflection-row-title",children:[(0,c.jsx)(n.N_,{to:"/think?tab=concepts&concept=".concat(encodeURIComponent(e.name)),className:"article-title-link",children:e.name}),e.description&&(0,c.jsx)("span",{className:"muted small",children:e.description})]}),(0,c.jsxs)("div",{className:"reflection-row-meta",children:[(0,c.jsxs)("span",{className:"muted small",children:[e.highlightsCount," highlights"]}),(0,c.jsxs)("span",{className:"muted small",children:[e.notesCount," notes"]}),(0,c.jsxs)("span",{className:"muted small",children:[e.questionsOpenCount," open questions"]})]})]},e.name)))]})]}),(0,c.jsxs)(r.Zp,{className:"search-section",children:[(0,c.jsxs)("div",{className:"search-section-header",children:[(0,c.jsx)("span",{className:"eyebrow",children:"Notes in progress"}),(0,c.jsxs)("span",{className:"muted small",children:[a.length," updated"]})]}),!Q&&!H&&(0,c.jsxs)("div",{className:"reflection-list",children:[0===a.length&&(0,c.jsx)("p",{className:"muted small",children:"No notes updated in this range."}),a.map((e=>(0,c.jsxs)("div",{className:"reflection-row",children:[(0,c.jsxs)("div",{className:"reflection-row-title",children:[(0,c.jsx)(n.N_,{to:"/think?tab=notebook&entryId=".concat(e.id),className:"article-title-link",children:e.title}),e.snippet&&(0,c.jsx)("span",{className:"muted small",children:e.snippet})]}),(0,c.jsx)("div",{className:"reflection-row-meta",children:(e.conceptMentions||[]).slice(0,3).map((t=>(0,c.jsx)(r.vu,{children:t},"".concat(e.id,"-").concat(t))))})]},e.id)))]})]}),(0,c.jsxs)(r.Zp,{className:"search-section",children:[(0,c.jsxs)("div",{className:"search-section-header",children:[(0,c.jsx)("span",{className:"eyebrow",children:"Open questions"}),(0,c.jsxs)("span",{className:"muted small",children:[s.reduce(((e,t)=>e+t.questions.length),0)," open"]})]}),!Q&&!H&&(0,c.jsxs)("div",{className:"reflection-list",children:[0===s.length&&(0,c.jsx)("p",{className:"muted small",children:"No open questions right now."}),s.map((e=>(0,c.jsxs)("div",{className:"reflection-group",children:[(0,c.jsx)("div",{className:"reflection-group-title",children:e.concept}),e.questions.map((e=>(0,c.jsxs)("div",{className:"reflection-row",children:[(0,c.jsx)("div",{className:"reflection-row-title",children:(0,c.jsx)("span",{className:"article-title-link",children:e.text})}),e.linkedNotebookEntryId&&(0,c.jsx)("div",{className:"reflection-row-meta",children:(0,c.jsx)(n.N_,{to:"/think?tab=notebook&entryId=".concat(e.linkedNotebookEntryId),className:"muted small",children:"Open note"})})]},e.id)))]},e.concept)))]})]}),(0,c.jsxs)(r.Zp,{className:"search-section",children:[(0,c.jsxs)("div",{className:"search-section-header",children:[(0,c.jsx)("span",{className:"eyebrow",children:"What changed"}),(0,c.jsx)("span",{className:"muted small",children:"Last 7 days vs prior 7"})]}),!Q&&!H&&(0,c.jsxs)("ul",{className:"reflection-list reflection-list--bullets",children:[0===l.length&&(0,c.jsx)("li",{className:"muted small",children:"No changes yet."}),l.map(((e,t)=>(0,c.jsx)("li",{className:"muted small",children:e},"".concat(e,"-").concat(t))))]})]})]})}case"patterns":return(0,c.jsxs)("div",{className:"section-stack",children:[(0,c.jsx)(r.X3,{title:"Patterns",
1subtitle:"Longer arcs and signals."}),(0,c.jsx)("p",{className:"muted",children:"Open the Brain view for trends and pattern summaries."}),(0,c.jsx)(r.$n,{variant:"secondary",onClick:()=>S("/brain"),children:"Open Brain"})]});default:return(0,c.jsx)(d,{embedded:!0})}})()}),ne=(0,c.jsxs)("div",{className:"section-stack review-mode__right-panel",children:[(0,f.j7)($)&&(0,c.jsxs)(r.Zp,{className:"search-section first-insight-card",children:[(0,c.jsx)(r.X3,{title:"First insight",subtitle:"Review is where the loop closes."}),(0,c.jsx)("p",{className:"first-insight-summary",children:(0,f.dJ)($)}),(0,c.jsxs)("div",{className:"capture-actions",children:[(0,c.jsx)(r.$n,{variant:"secondary",onClick:()=>S((0,f.Wd)($)),children:"Open current thread"}),(0,c.jsx)(r.$n,{variant:"secondary",onClick:()=>S("/today"),children:"Open Today"}),(0,c.jsx)(r.$q,{onClick:()=>{(0,f.nz)(),M(null)},children:"Clear"})]})]}),(0,c.jsx)(r.X3,{title:"reflections"===N?"Quick actions":"Review tools",subtitle:"reflections"===N?"Keep momentum.":"Lightweight by design."}),"resurface"===N&&(0,c.jsx)(c.Fragment,{children:te?(0,c.jsxs)("div",{className:"section-stack",children:[(0,c.jsx)("div",{className:"review-resurface-context-title",children:te.articleTitle||"Untitled article"}),(0,c.jsx)("div",{className:"review-resurface-context-text",children:te.text}),(0,c.jsxs)("div",{className:"review-resurface-context-actions",children:[(0,c.jsx)(r.$n,{variant:"secondary",onClick:()=>S((0,y.KO)(te.articleId)),children:"Open Article"}),(0,c.jsx)(r.$n,{variant:"secondary",onClick:()=>F({open:!0,highlight:te}),children:"Send to Notebook"}),(0,c.jsx)(r.$n,{variant:"secondary",onClick:()=>D({open:!0,highlight:te}),children:"Add to Concept"}),(0,c.jsx)(r.$n,{variant:"secondary",onClick:()=>z({open:!0,highlight:te}),children:"Add to Question"})]}),(0,c.jsx)(j.default,{sourceType:"highlight",sourceId:te._id,title:"Related highlights",limit:6,resultTypes:["highlight"],enabled:Boolean(null===te||void 0===te?void 0:te._id)})]}):(0,c.jsx)("p",{className:"muted small",children:"Select a highlight to drill in."})}),"reflections"===N?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r.$n,{variant:"secondary",onClick:J,disabled:Q,children:Q?"Refreshing\u2026":"Refresh reflections"}),(0,c.jsx)(r.$n,{variant:"secondary",onClick:()=>{var e;const t=null===(e=W.notesInProgress)||void 0===e?void 0:e[0];null!==t&&void 0!==t&&t.id&&S("/think?tab=notebook&entryId=".concat(t.id))},disabled:!(null!==(e=W.notesInProgress)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.id),children:"Continue last note"}),(0,c.jsx)(r.$n,{variant:"secondary",onClick:()=>{var e;const t=null===(e=W.activeConcepts)||void 0===e?void 0:e[0];null!==t&&void 0!==t&&t.name&&S("/think?tab=concepts&concept=".concat(encodeURIComponent(t.name)))},disabled:!(null!==(a=W.activeConcepts)&&void 0!==a&&null!==(l=a[
10])&&void 0!==l&&l.name),children:"Open active concept"}),(0,c.jsx)(r.$n,{onClick:async()=>{const e=(new Date).toISOString().slice(0,10),t="Weekly Reflection \u2014 ".concat(e),a=["What did I learn?","What changed my mind?","What needs deeper thought?"],s=[{id:V(),type:"heading",level:2,text:t},...a.map((e=>({id:V(),type:"paragraph",text:e})))],n={title:t,content:["<h2>".concat(Y(t),"</h2>"),...a.map((e=>"<p><strong>".concat(Y(e),"</strong></p>")))].join(""),blocks:s};try{var l;const e=await i.Ay.post("/api/notebook",n,K());null!==(l=e.data)&&void 0!==l&&l._id&&S("/think?tab=notebook&entryId=".concat(e.data._id))}catch(r){console.error("Error creating reflection note:",r)}},children:"Start weekly reflection"}),(0,c.jsx)("p",{className:"muted small",children:"Create a note with prompts and move your thinking forward."})]}):(0,c.jsx)("p",{className:"muted small",children:"Switch to Reflections when you want the editorial snapshot."})]});return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(m.A,{className:"three-pane--editorial three-pane--review",left:ae,main:se,right:ne,rightTitle:"reflections"===N?"Quick actions":"Review tools",defaultRightOpen:!0,mainHeader:(0,c.jsx)(r.sT,{eyebrow:"Mode",title:"Review",subtitle:"Revisit what matters: recent reading, resurfaced highlights, and steady patterns."})}),(0,c.jsx)(p.default,{open:O.open,highlight:O.highlight,onClose:()=>D({open:!1,highlight:null}),onSelect:async(e,t)=>{await i.Ay.post("/api/concepts/".concat(encodeURIComponent(t),"/add-highlight"),{highlightId:e._id},(0,h.z)()),D({open:!1,highlight:null})}}),(0,c.jsx)(g.default,{open:U.open,highlight:U.highlight,onClose:()=>F({open:!1,highlight:null}),onSend:async(e,t)=>{await i.Ay.post("/api/notebook/".concat(t,"/append-highlight"),{highlightId:e._id},(0,h.z)()),F({open:!1,highlight:null})}}),(0,c.jsx)(v.default,{open:B.open,highlight:B.highlight,onClose:()=>z({open:!1,highlight:null}),onCreate:async(e,t,a)=>{const s=await(0,x.hG)({text:a,conceptName:t,blocks:[{id:V(),type:"paragraph",text:a},{id:V(),type:"highlight-ref",highlightId:e._id,text:e.text||""}],linkedHighlightIds:[e._id]});null!==s&&void 0!==s&&s._id&&await i.Ay.post("/api/questions/".concat(s._id,"/add-highlight"),{highlightId:e._id},(0,h.z)()),z({open:!1,highlight:null})},onAttach:async(e,t)=>{await i.Ay.post("/api/questions/".concat(t,"/add-highlight"),{highlightId:e._id},(0,h.z)()),z({open:!1,highlight:null})}})]})}},8028:(e,t,a)=>{a.d(t,{A:()=>c});var s=a(5043),n=a(7950),l=a(579);const i="(max-width: 1240px)",r=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),c=e=>{let{title:t="Context",open:a,onToggle:c,children:o}=e;const d=(()=>{const[e,t]=(0,s.useState)((()=>"undefined"!==typeof window&&"function"===typeof window.matchMedia&&window.matchMedia(i).matches));return(0,s.useEffect)((()=>{var e;if("function"!==typeof window.matchMedia)return;const a=window.matchMedia(i),s=()=>t(a.matches);return s(),null===(e=a.addEventListener)||void 0===e||e.call(a,"change",s),()=>{var e;return null===(e=a.removeEventListener)||void 0===e?void 0:e.call(a,"change",s)}}),[]),e})(),[h,u]=(0,s.useState)(!1),m=(0,s.useRef)(null),p=(0,s.useRef)(null),g=(0,s.useRef)(!1),v=(0,s.useId)(),x=String(t||"Context").trim()||"Context",j=Boolean(d&&h),f=(0,s.useCallback)((()=>{d?u(!1):null===c||void 0===c||c(!1)}),[d,c]);if((0,s.useEffect)((()=>{d||u(!1)}),[d]),(0,s.useEffect)((()=>{var e,t,a;if(!j)return g.current&&(null===(a=m.current)||void 0===a||a.focus()),void(g.current=!1);g.current=!0;const s=document.body.style.overflow;document.body.style.overflow="hidden";null===(t=(null===(e=p.current)||void 0===e?void 0:e.querySelector(r))||p.current)||void 0===t||t.focus();const n=e=>{var t;if("Escape"===e.key)return e.preventDefault(),void f();if("Tab"!==e.key)return;const a=Array.from((null===(t=p.current)||void 0===t?void 0:t.querySelectorAll(r))||[]);var s;if(0===a.length)return e.preventDefault(),void(null===(s=p.current)||void 0===s||s.focus());const n=a[0],l=a[a.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),l.focus()):e.shiftKey||document.activeElement!==l||(e.preventDefault(),n.focus())};return document.addEventListener("keydown",n),()=>{document.body.style.overflow=s,document.removeEventListener("keydown",n)}}),[f,j]),d){const e=(0,l.jsxs)("aside",{className:"right-drawer right-drawer--mobile ".concat(j?"is-open":"is-collapsed"),style:{display:"block",position:"fixed",right:"16px",bottom:"16
1px",zIndex:40},children:[j?null:(0,l.jsxs)("button",{ref:m,type:"button",className:"right-drawer__mobile-trigger",onClick:()=>u(!0),"aria-expanded":"false","aria-haspopup":"dialog","aria-controls":v,"aria-label":"Open ".concat(x),"data-testid":"agent-context-trigger",children:["Open ",x]}),j?(0,l.jsx)("div",{className:"right-drawer__mobile-backdrop",role:"presentation",onMouseDown:e=>{e.target===e.currentTarget&&f()},style:{position:"fixed",inset:0,zIndex:41,background:"rgba(0, 0, 0, 0.45)"},children:(0,l.jsxs)("section",{ref:p,id:v,className:"right-drawer__mobile-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"".concat(v,"-title"),tabIndex:"-1","data-testid":"agent-context-sheet",style:{position:"absolute",right:0,bottom:0,left:0,maxHeight:"min(82vh, 48rem)",overflowY:"auto",background:"var(--vellum-panel, #fff)",padding:"20px"},children:[(0,l.jsxs)("div",{className:"three-pane__right-header",children:[(0,l.jsx)("h2",{id:"".concat(v,"-title"),className:"right-drawer__title",children:x}),(0,l.jsx)("button",{type:"button",className:"right-drawer__header-icon",onClick:f,"aria-label":"Close ".concat(x),children:"Close"})]}),(0,l.jsx)("div",{className:"three-pane__right-body",children:o})]})}):null]});return"undefined"===typeof document?e:(0,n.createPortal)(e,document.body)}return(0,l.jsxs)("aside",{className:"right-drawer ".concat(a?"is-open":"is-collapsed"),children:[(0,l.jsxs)("button",{ref:m,type:"button",className:"right-drawer__edge-toggle",onClick:()=>null===c||void 0===c?void 0:c(!a),"aria-expanded":a,"aria-label":a?"Collapse right panel":"Expand right panel",title:a?"Collapse ".concat(x):"Open ".concat(x),children:[(0,l.jsx)("span",{className:"right-drawer__edge-toggle-icon","aria-hidden":"true",children:a?"\u2039":"\u203a"}),(0,l.jsx)("span",{className:"right-drawer__edge-toggle-label",children:x})]}),a?(0,l.jsxs)("div",{className:"right-drawer__panel",children:[(0,l.jsxs)("div",{className:"three-pane__right-header",children:[(0,l.jsx)("span",{className:"right-drawer__title",children:x}),c?(0,l.jsx)("button",{type:"button",className:"right-drawer__header-icon",onClick:f,"aria-label":"Collapse ".concat(x),title:"Collapse ".concat(x),children:"\u2039"}):null]}),(0,l.jsx)("div",{className:"three-pane__right-body",children:o})]}):null]})}},9225:(e,t,a)=>{a.d(t,{A:()=>l});var s=a(5043),n=a(5886);const l=function(){let{enabled:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};
1const[t,a]=(0,s.useState)([]),[l,i]=(0,s.useState)(!1),[r,c]=(0,s.useState)(""),o=(0,s.useCallback)((async function(){let{force:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e){i(!0),c("");try{const e=await(0,n.K9)({force:t});a(e||[])}catch(r){var s,l;c((null===(s=r.response)||void 0===s||null===(l=s.data)||void 0===l?void 0:l.error)||"That did not load.")}finally{i(!1)}}}),[e]);(0,s.useEffect)((()=>{o()}),[o]);return{entries:t,loading:l,error:r,refresh:(0,s.useCallback)((()=>o({force:!0})),[o])}}},9632:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var s=a(5043),n=a(1045),l=a(9703);const i=new Map,r=e=>{const t=(Array.isArray(e)?e:String(e||"").split(",")).map((e=>String(e||"").trim().toLowerCase())).filter(Boolean);return t.length>0?Array.from(new Set(t)):["highlight"]},c=function(){let{sourceType:e,sourceId:t,limit:a=6,resultTypes:n=["highlight"],enabled:c=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=String(e||"").trim().toLowerCase(),d=String(t||"").trim(),h=r(n).join(","),u=(0,s.useMemo)((()=>h.split(",")),[h]),m=(0,s.useMemo)((()=>(e=>{let{sourceType:t,sourceId:a,resultTypes:s}=e;return"".concat(t,":").concat(a,":").concat(r(s).join(","))})({sourceType:o,sourceId:d,resultTypes:u}
1)),[o,d,u]),[p,g]=(0,s.useState)([]),[v,x]=(0,s.useState)({sourceType:"",sourceId:"",modelAvailable:!0,explanationVersion:"v1"}),[j,f]=(0,s.useState)(!1),[y,N]=(0,s.useState)(""),b=(0,s.useRef)(0),w=(0,s.useCallback)((async function(){let{force:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!c||!o||!d)return g([]),x({sourceType:o,sourceId:d,modelAvailable:!0,explanationVersion:"v1"}),f(!1),void N("");const t=b.current+1;if(b.current=t,N(""),!e){const e=(e=>{const t=i.get(e);return t?Date.now()-t.cachedAt>6e4?(i.delete(e),null):t.value:null})(m);if(e)return g(Array.isArray(e.results)?e.results:[]),x(e.meta||{sourceType:o,sourceId:d,modelAvailable:!0,explanationVersion:"v1"}),void f(!1)}f(!0);try{const e=await(0,l.U6)({sourceType:o,sourceId:d,limit:a,resultTypes:u});if(t!==b.current)return;const s={results:Array.isArray(null===e||void 0===e?void 0:e.results)?e.results:[],meta:(null===e||void 0===e?void 0:e.meta)||{sourceType:o,sourceId:d,modelAvailable:!0,explanationVersion:"v1"}};r=m,h=s,i.set(r,{cachedAt:Date.now(),value:h}),g(s.results),x(s.meta)}catch(p){var s,n;if(t!==b.current)return;N((null===p||void 0===p||null===(s=p.response)||void 0===s||null===(n=s.data)||void 0===n?void 0:n.error)||"That did not load."),g([]),x({sourceType:o,sourceId:d,modelAvailable:!0,explanationVersion:"v1"})}finally{t===b.current&&f(!1)}var r,h}),[m,c,a,d,o,u]);return(0,s.useEffect)((()=>{w({force:!1})}),[w]),{results:p,meta:v,loading:j,error:y,refresh:()=>w({force:!0})}};var o=a(5943),d=a(579);const h=e=>{if(!e)return"/search";if("highlight"===e.objectType){var t;const a=null===(t=e.metadata)||void 0===t?void 0:t.articleId;return a?(0,o.KO)(a):"/library?scope=highlights"}if("concept"===e.objectType){var a;const t=(null===(a=e.metadata)||void 0===a?void 0:a.name)||e.title||"";return t?"/think?tab=concepts&concept=".concat(encodeURIComponent(t)):"/think?tab=concepts"}return"/search"},u=e=>{const t=String(e||"").trim().toLowerCase();return"high"===t?"High":"medium"===t?"Medium":"Low"},m=e=>{let{sourceType:t,sourceId:a,limit:s=6,resultTypes:l=["highlight"],title:i="Related highlights",enabled:r=!0,renderAction:o}=e;const{results:m,meta:p,loading:g,error:v}=c({sourceType:t,sourceId:a,limit:s,resultTypes:l,enabled:r});return r&&String(t||"").trim()&&String(a||"").trim()?(0,d.jsxs)("div",{className:"semantic-related-panel",children:[(0,d.jsx)("div",{className:"semantic-related-header",children:i}),(0,d.jsxs)("div",{className:"semantic-related-explain",children:[(0,d.jsx)("div",{className:"semantic-related-explain-title",children:"How similarity works"}),(0,d.jsx)("p",{className:"semantic-related-explain-body",children:"We convert text into numeric embeddings and compare angle distance (cosine similarity). Higher similarity means ideas are closer, even if wording differs."}),(0,d.jsx)("p",{className:"semantic-related-explain-note",children:"Matches are partner suggestions, not exact duplicates."})]}),g&&(0,d.jsx)("p",{className:"muted small",children:"Finding related highlights..."}),v&&(0,d.jsx)("p",{className:"status-message error-message",children:v}),!g&&!v&&!1===(null===p||void 0===p?void 0:p.modelAvailable)&&(0,d.jsx)("p",{className:"muted small",children:"Partner suggestions unavailable right now."}),!g&&!v&&!1!==(null===p||void 0===p?void 0:p.modelAvailable)&&0===m.length&&(0,d.jsx)("p",{className:"muted small",children:"No semantic matches yet."}),!g&&!v&&!1!==(null===p||void 0===p?void 0:p.modelAvailable)&&m.length>0&&(0,d.jsx)("div",{className:"semantic-related-list",children:m.map((e=>{var t;return(0,d.jsxs)("div",{className:"semantic-related-item",children:[(0,d.jsxs)(n.N_,{to:h(e),className:"semantic-related-item-link",children:[(0,d.jsxs)("div",{className:"semantic-related-item-top",children:[(0,d.jsx)("span",{className:"semantic-related-item-title",children:e.title||"Untitled"}),(0,d.jsx)("span",{className:"semantic-related-band is-".concat(String(e.similarityBand||"Low").toLowerCase()),title:"Similarity band based on cosine similarity.",children:u(e.similarityBand)})]}),(0,d.jsx)("div",{className:"semantic-related-item-subtitle",children:(null===(t=e.metadata)||void 0===t?void 0:t.articleTitle)||e.snippet||""})]}),"function"===typeof o&&(0,d.jsx)("div",{className:"semantic-related-item-action",children:o(e)})]},"".concat(e.objectType,"-").concat(e.objectId))}))})]}):null}}}]);
2//# sourceMappingURL=7231.5575b991.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.