PageSourceSearch

https://www.noeis.io/static/js/9116.3832c944.chunk.js

js noeis.io collected 2026-09-24 14:23:20 UTC 44,097 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunknote_taker_ui=self.webpackChunknote_taker_ui||[]).push([[9116],{606:(e,t,n)=>{n.d(t,{P$:()=>r,Zx:()=>i,i5:()=>l,jK:()=>c,md:()=>s});var o=n(2606),a=n(1138);const i=async e=>(await o.Ay.get("/api/notebook/".concat(e,"/claim"),(0,a.z)())).data,r=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=new URLSearchParams;e&&t.set("q",e);const n=t.toString(),i=await o.Ay.get("/api/notebook/organize/claims".concat(n?"?".concat(n):""),(0,a.z)());return Array.isArray(i.data)?i.data:[]},c=async(e,t)=>(await o.Ay.patch("/api/highlights/".concat(e,"/organize"),t,(0,a.z)())).data,s=async e=>(await o.Ay.get("/api/highlights/".concat(e,"/claim"),(0,a.z)())).data,l=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=new URLSearchParams;e&&t.set("q",e);const n=t.toString(),i=await o.Ay.get("/api/highlights/organize/claims".concat(n?"?".concat(n):""),(0,a.z)());return Array.isArray(i.data)?i.data:[]}},1094:(e,t,n)=>{n.d(t,{F1:()=>p,WJ:()=>u,js:()=>s,mV:()=>l,oP:()=>d});var o=n(2606),a=n(1138),i=n(8320);const r="highlights.all",c=()=>(0,i.Sm)(r),s=async function(){let{force:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,i.ZF)(r,(async()=>(await o.Ay.get("/api/highlights/all",(0,a.z)())).data||[]),{force:e,ttlMs:3e4})},l=async function(){let{folderId:e,tag:t,articleId:n,q:i,cursor:r,limit:c}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=new URLSearchParams;e&&s.set("folderId",e),t&&s.set("tag",t),n&&s.set("articleId",n),i&&s.set("q",i),r&&s.set("cursor",r),c&&s.set("limit",String(c));const l=s.toString();return(await o.Ay.get("/api/highlights".concat(l?"?".concat(l):""),(0,a.z)())).data||[]},d=async e=>{var t;let{articleId:n,highlightId:i,payload:r={}}=e;const s=await o.Ay.patch("/articles/".concat(n,"/highlights/").concat(i),r,(0,a.z)());return c(),(null===(t=s.data)||void 0===t?void 0:t.highlight)||s.data},u=async e=>{let{articleId:t,highlightId:n}=e;const i=await o.Ay.delete("/articles/".concat(t,"/highlights/").concat(n),(0,a.z)());return c(),i.data},p=async e=>{var t,n;let{articleId:i,text:r,tags:s=[],note:l="",anchor:d,color:u}=e;const p=await o.Ay.post("/articles/".concat(i,"/highlights"),{text:r,tags:s,note:l,anchor:d,color:u},(0,a.z)());return c(),(null===(t=p.data)||void 0===t?void 0:t.highlight)||(null===(n=p.data)||void 0===n?void 0:n.createdHighlight)||p.data}},2209:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(5043),a=n(1094),i=n(3615);const r=function(){let{enabled:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,o.useState)([]),[r,c]=(0,o.useState)(!1),[s,l]=(0,o.useState)(""),d=(0,o.useCallback)((async function(){let{force:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)return;const o=(0,i.b$)();c(!0),l("");try{const e=await(0,a.js)({force:t});n(e),(0,i.s2)("think.highlights.load",{count:e.length,durationMs:(0,i.up)(o)})}catch(d){var r,s;l((null===(r=d.response)||void 0===r||null===(s=r.data)||void 0===s?void 0:s.error)||"Failed to load highlights.")}finally{c(!1)}}),[e]);(0,o.useEffect)((()=>{d()}),[d]);const u=(0,o.useMemo)((()=>{const e=new Map;return t.forEach((t=>{e.set(String(t._id),t)})),e}),[t]),p=(0,o.useCallback)((()=>d({force:!0})),[d]);return{highlights:t,highlightMap:u,loading:r,error:s,refresh:p}}},2404:(e,t,n)=>{n.d(t,{GE:()=>c,Iu:()=>l,S7:()=>u,p5:()=>s,qn:()=>d});var o=n(7051),a=n(2606),i=n(1138),r=n(8320);const c=async function(){let{scope:e="all",folderId:t="",query:n="",sort:o="recent",cursor:c,limit:s,includeSuppressed:l=!1,includePreview:d=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=new URLSearchParams;e&&u.set("scope",e),t&&u.set("folderId",t),n&&u.set("query",n),o&&u.set("sort",o),c&&u.set("cursor",c),s&&u.set("limit",String(s)),l&&u.set("includeSuppressed","true"),d&&u.set("includePreview","true");const p=u.toString(),h="/api/articles".concat(p?"?".concat(p):"");return(0,r.ZF)("articles:".concat(h),(async()=>(await a.Ay.get(h,(0,i.z)())).data||[]),{ttlMs:3e4})},s=async(e,t)=>{const n=await a.Ay.patch("/articles/".concat(e,"/move"),{folderId:t||"uncategorized"}
1,(0,i.z)());return(0,r.iq)("articles:"),n.data},l=async e=>(await a.Ay.get("/articles/".concat(e,"/evergreen"),(0,i.z)())).data||null,d=async(e,t)=>{const n=await a.Ay.patch("/articles/".concat(e,"/evergreen"),{evergreen:Boolean(t)},(0,i.z)());return(0,r.iq)("articles:"),(0,r.iq)("library-room:"),(0,r.iq)("library-relevance:"),n.data},u=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const c=await a.Ay.patch("/articles/".concat(e,"/placement"),(0,o.A)({placement:t},n?{reason:n}:{}),(0,i.z)());return(0,r.iq)("articles:"),(0,r.iq)("library-room:"),(0,r.iq)("library-relevance:"),c.data}},3265:(e,t,n)=>{n.d(t,{A:()=>c});var o=n(5043),a=n(3325),i=n(579);const r=e=>{let{status:t="idle",title:n=a.Z7,subtitle:o="",actionLabel:r="",actionDisabled:c=!1,onAction:s,className:l="",actionTestId:d=""}=e;return(0,i.jsxs)("div",{className:"agent-presence wiki-agent-presence ".concat(l).trim(),"data-status":t,role:"status","aria-live":"polite","aria-label":a.or,children:[(0,i.jsx)("span",{className:"agent-presence__dot wiki-agent-presence__dot","aria-hidden":"true",children:(0,i.jsx)("span",{className:"agent-presence__dot-inner wiki-agent-presence__dot-inner"})}),(0,i.jsxs)("div",{className:"agent-presence__copy wiki-agent-presence__copy",children:[(0,i.jsx)("div",{className:"agent-presence__text wiki-agent-presence__text",children:n}),o?(0,i.jsx)("div",{className:"agent-presence__sub wiki-agent-presence__sub",children:o}):null]}),r?(0,i.jsx)("button",{type:"button",className:"agent-presence__action wiki-agent-presence__action",onClick:s,disabled:c,"data-testid":d||void 0,children:r}):null]})},c=o.memo(r)},3452:(e,t,n)=>{n.d(t,{G:()=>r});const o=e=>String(e||"").trim(),a={summary_brief:"Return a compact brief with the core claim, strongest support, tensions, and what to do next.",critique_brief:"Return the main weak spots, hidden assumptions, counterarguments, and what evidence would change your mind.",question_set:"Return 3 to 7 concrete follow-up questions ordered by leverage.",connection_map:"Return the most relevant related concepts, notes, questions, or tensions and explain why each connection matters.",note_draft:"Return a draft note with a clear title and a structured body that is ready for a human to refine.",concept_draft:"Return a draft concept with a name, one-sentence thesis, why it matters, and the best starting evidence.",handoff_draft:"Return a draft handoff with objective, success criteria, checklist, suggested actor, and what the receiving agent should produce.",research_brief_draft:"Return a research brief with an executive frame, strongest evidence, tensions, and the next questions to investigate.",synthesis_doc_draft:"Return a synthesis document with a core thesis, supporting signals, tensions, and the next actions needed to strengthen it.",slide_outline_draft:"Return a slide-ready outline with a title, narrative arc, and a clear purpose for each slide.",gap_report:"Return the biggest missing concepts, missing evidence, contradictions, and the next highest-value work.",duplicate_report:"Return the overlapping notes, concepts, or questions that look duplicated, and say whether they should be merged, linked, or left separate.",stale_summary_report:"Return the summaries or descriptions that look stale, why they no longer match the evidence, and what should replace them.",contradiction_report:"Return the strongest contradictions or tensions, what is conflicting, and the next work needed to resolve each one.",concept_candidate_report:"Return the most compelling next concept candidates, why each matters, and the evidence that justifies creating them.",missing_link_report:"Return the most important missing links in the workspace, why each link matters, and the concrete linking actions to take next.",concept_health_report:"Return a concept health scan covering what is strong, what is fragile, what lacks evidence or links, and the repairs to prioritize.",workspace_hygiene_report:"Return a workspace hygiene summary with overall state, cleanup priorities, drift risks, and the next maintenance pass to run.",concept_network_report:"Return a concept network scan covering isolated nodes, overloaded hubs, weak bridges, and the structural repairs to prioritize.",recurring_hygiene_report:"Return a recurring hygiene summary with cadence, focus areas, maintenance sequence, and the next recurring pass to run."},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{contextType:t="",contextTitle:n="",selectionText:i=""}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let{contextType:e="",contextTitle:t="",selectionText:n=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=o(t),i=o(e)||"workspace";return o(n)?a?"the selected passage from ".concat(a):"the selected passage":a||"this ".concat(i)}({contextType:t,contextTitle:n,selectionText:i}),c=[o(null===e||void 0===e?void 0:e.instruction),"","Work against ".concat(r,". Keep the result draft-first, explicit, and useful."),a[o(null===e||void 0===e?void 0:e.outputType)]||"Return a crisp draft that a human can refine or promote."].filter(
1Boolean);return o(n)&&c.push("","Context title: ".concat(o(n))),o(t)&&c.push("Context type: ".concat(o(t))),o(i)&&c.push("","Selected text:",'"""'.concat(o(i).slice(0,1400),'"""')),c.join("\n")},r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{contextType:t="",contextId:n="",contextTitle:a="",selectionText:r="",mode:c="submit"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:"".concat(o(null===e||void 0===e?void 0:e.id)||"skill","-").concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),prompt:i(e,{contextType:t,contextTitle:a,selectionText:r}),mode:c,contextType:o(t),contextId:o(n),skillId:o(null===e||void 0===e?void 0:e.id),skillTitle:o(null===e||void 0===e?void 0:e.title),outputType:o(null===e||void 0===e?void 0:e.outputType),workerRole:o(null===e||void 0===e?void 0:e.workerRole),workflow:null!==e&&void 0!==e&&e.workflow&&"object"===typeof e.workflow?{id:o(e.workflow.id),label:o(e.workflow.label),track:o(e.workflow.track),cadence:o(e.workflow.cadence),loop:Boolean(e.workflow.loop),steps:Array.isArray(e.workflow.steps)?e.workflow.steps.map((e=>o(e))).filter(Boolean):[],nextSkills:Array.isArray(e.workflow.nextSkills)?e.workflow.nextSkills.map((e=>({id:o(null===e||void 0===e?void 0:e.id),title:o(null===e||void 0===e?void 0:e.title),workerRole:o(null===e||void 0===e?void 0:e.workerRole),outputType:o(null===e||void 0===e?void 0:e.outputType),instruction:o(null===e||void 0===e?void 0:e.instruction)}))).filter((e=>e.id&&e.title)):[]}:null}}},3563:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(5043),a=n(7666),i=n(3615);const r=function(){let{status:e="open",tag:t="",conceptName:n="",enabled:r=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[c,s]=(0,o.useState)([]),[l,d]=(0,o.useState)(!1),[u,p]=(0,o.useState)(!1),[h,g]=(0,o.useState)(""),m=(0,o.useCallback)((async()=>{if(!r)return;const o=(0,i.b$)();d(!0),g("");try{const r=(n?await(0,a.cC)(n,{status:e}):await(0,a.yS)({status:e,tag:t}))||[];s(r),(0,i.s2)("think.questions.load",{mode:n?"concept":"global",count:r.length,durationMs:(0,i.up)(o)})}catch(u){var c,l;g((null===(c=u.response)||void 0===c||null===(l=c.data)||void 0===l?void 0:l.error)||"Failed to load questions.")}finally{d(!1),p(!0)}}),[n,r,e,t]);return(0,o.useEffect)((()=>{m()}),[m]),{questions:c,loading:l,loaded:u,error:h,refresh:m,setQuestions:s}}},3615:(e,t,n)=>{n.d(t,{b$:()=>c,kf:()=>r,s2:()=>i,up:()=>s});const o=()=>"undefined"!==typeof performance&&"function"===typeof performance.now?performance.now():Date.now(),a=e=>Math.round(100*Number(e||0))/100,i=function(e){},r=e=>(e,t,n,o,a,i)=>{},c=()=>o(),s=e=>a(o()-Number(e||0))},5581:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(5043),a=n(5810),i=n(3615);const r=function(){let{enabled:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,o.useState)([]),[r,c]=(0,o.useState)(!1),[s,l]=(0,o.useState)(!1),[d,u]=(0,o.useState)(""),p=(0,o.useCallback)((async function(){let{force:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)return;const o=(0,i.b$)();c(!0),u("");try{const e=await(0,a.KD)({force:t})||[];n(e),(0,i.s2)("think.concepts.load",{count:e.length,durationMs:(0,i.up)(o)})}catch(d){var r,s;u((null===(r=d.response)||void 0===r||null===(s=r.data)||void 0===s?void 0:s.error)||"Failed to load concepts.")}finally{c(!1),l(!0)}}),[e]);(0,o.useEffect)((()=>{p()}),[p]);return{concepts:t,loading:r,loaded:s,error:d,refresh:(0,o.useCallback)((()=>p({force:!0})),[p])}}},5787:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(5043),a=n(5063),i=n(7198),r=n(579);const c=e=>new Date(Date.now()+24*e*60*60*1e3).toISOString(),s=e=>{let{itemType:t,itemId:n,defaultReason:s="",onCreated:l,buttonLabel:d="Return later"}=e;const[u,p]=(0,o.useState)(!1),[h,g]=(0,o.useState)("tomorrow"),[m,v]=(0,o.useState)(""),[y,w]=(0,o.useState)(s||""),[f,k]=(0,o.useState)(!1),[x,b]=(0,o.useState)(""),[S,A]=(0,o.useState)(""),I=(0,o.useMemo)((()=>"tomorrow"===h?c(1):"three-days"===h?c(3):"one-week"===h?c(7):(e=>{if(!e)return"";const t=new Date("".concat(e,"T09:00:00"));return Number.isNaN(t.getTime())?"":t.toISOString()})(m)),[h,m]),_=!t||!n||f||"custom"===h&&!m;return t&&n?(0,r.jsxs)("div",{className:"return-later-control",children:[(0,r.jsx)(a.$q,{onClick:()=>p((e=>!e)),children:S||d}),u&&(0,r.jsxs)("div",{className:"return-later-popover",children:[(0,r.jsx)("div",{className:"return-later-title",children:"Return later"}),(0,r.jsxs)("label",{className:"return-later-option",children:[(0,r.jsx)("input",{type:"radio",checked:"tomorrow"===h,onChange:()=>g("tomorrow")}),(0,r.jsx)("span",{children:"Tomorrow"})]}),(0,r.jsxs)("label",{className:"return-later-option",children:[(0,r.jsx)("input",{type:"radio",checked:"three-days"===h,onChange:()=>g("three-days")}),(0,r.jsx)("span",{children:"3 days"})]}),(0,r.jsxs)("label",{className:"return-later-option",children:[(0,r.jsx)("input",{type:"radio",checked:"one-week"===h,onChange:()=>g("one-week")}),(0,r.jsx)("span",{children:"1 week"})]}),(0,r.jsxs)("label",{className:"return-later-option",children:[(0,r.jsx)("input",{type:"radio",checked:"custom"===h,onChange:()=>g("custom")}),(0,r.jsx)("span",{children:"Custom date"})]}),"custom"===h&&(0,r.jsx)("input",{className:"return-later-date",type:"date",value:m,onChange:e=>v(e.target.value)}),(0,r.jsx)("textarea",{className:"return-later-reason",rows:2,maxLength:280,value:y,onChange:e=>w(e.target.value),placeholder:"Optional reason"}),x&&(0,r.jsx)("p",{className:"status-message error-message",children:x}),(0,r.jsxs)("div",{className:"return-later-actions",children:[(0,r.jsx)(a.$n,{variant:"secondary",onClick:()=>p(!1),children:"Cancel"}),(0,r.jsx)(a.$n,{onClick:async()=>
1{if(!_){k(!0),b("");try{const e=await(0,i.I4)({itemType:t,itemId:n,dueAt:I,reason:y.trim()});null===l||void 0===l||l(e),A("Queued"),p(!1),setTimeout((()=>A("")),1600)}catch(a){var e,o;b((null===(e=a.response)||void 0===e||null===(o=e.data)||void 0===o?void 0:o.error)||"Failed to queue item.")}finally{k(!1)}}},disabled:_,children:f?"Saving...":"Add"})]})]})]}):null}},5810:(e,t,n)=>{n.d(t,{A8:()=>g,BI:()=>z,DV:()=>h,Gz:()=>w,IC:()=>N,IJ:()=>I,Iz:()=>m,KD:()=>u,L0:()=>_,Mn:()=>C,P$:()=>p,PW:()=>S,Qu:()=>f,Wr:()=>b,XA:()=>A,Xm:()=>L,_y:()=>T,ad:()=>E,ct:()=>U,ee:()=>k,i1:()=>x,iO:()=>M,iQ:()=>v,mF:()=>j,q1:()=>R,ue:()=>y,wW:()=>P,wX:()=>q});var o=n(7051),a=n(2606),i=n(1138),r=n(8320);const c="concepts.list",s=/^[a-f\d]{24}$/i,l=new Map,d=()=>(0,r.Sm)(c),u=async function(){let{force:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.ZF)(c,(async()=>(await a.Ay.get("/api/concepts",(0,i.z)())).data||[]),{force:e,ttlMs:3e4})},p=async e=>(await a.Ay.get("/api/concepts/".concat(encodeURIComponent(e)),(0,i.z)())).data,h=async e=>{let{conceptId:t,wikiPageId:n,revisionId:o="",claimId:r=""}=e;const c=String(t||"").trim(),l=String(n||"").trim(),d=String(o||"").trim();if(!s.test(c))throw new Error("Concept id must be a valid object id.");if(!s.test(l))throw new Error("Wiki page id must be a valid object id.");if(d&&!s.test(d))throw new Error("Revision id must be a valid object id.");const u=encodeURIComponent(c),p=new URLSearchParams({wikiPageId:l}),h=void 0!==r&&null!==r&&""!==r;if(h&&"string"!==typeof r)throw new Error("Claim id must be a string.");const g=String(r||"").trim();if(h&&(!g||g.length>240))throw new Error("Claim id must contain 1 to 240 characters.");d&&p.set("revisionId",d),g&&p.set("claimId",g);const m=await a.Ay.get("/api/concepts/".concat(u,"/investigation?").concat(p.toString()),(0,i.z)());if(!m.data||!m.data.investigation||"object"!==typeof m.data.investigation||"string"!==typeof m.data.generatedAt||!m.data.generatedAt.trim())throw new Error("Concept investigation response is malformed.");return m.data},g=async function(e){let{sourcePageId:t,decisionId:n,lessonId:o,role:r,requestId:c,expectedDecisionHash:l,expectedOutcomeHash:d}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const u=e=>Boolean(e)&&"object"===typeof e&&!Array.isArray(e),p=(e,t,n)=>{if("string"!==typeof e)throw new Error("".concat(t," must be a string."));const o=e.trim();if(!o||o.length>n)throw new Error("".concat(t," must contain 1 to ").concat(n," characters."));return o},h=(e,t)=>{const n=p(e,t,24);if(!s.test(n))throw new Error("".concat(t," must be a valid object id."));return n.toLowerCase()},g=h(e,"Concept id"),m=h(t,"Source page id"),v=p(n,"Decision id",180),y=p(o,"Lesson id",180),w=p(c,"Request id",180),f=p(l,"Expected decision hash",128),k=p(d,"Expected outcome hash",128);if("string"!==typeof r)throw new Error("Evidence role must be a string.");const x=r.trim().toLowerCase();if(!["support","tension","context"].includes(x))throw new Error("Evidence role must be support, tension, or context.");const b={sourcePageId:m,decisionId:v,lessonId:y,role:x,requestId:w,expectedDecisionHash:f,expectedOutcomeHash:k},S=await a.Ay.post("/api/concepts/".concat(g,"/evidence/decision-lessons"),b,(0,i.z)()),A=null===S||void 0===S?void 0:S.data,I=null===A||void 0===A?void 0:A.adoption,_=null===I||void 0===I?void 0:I.provenance,C=null===A||void 0===A?void 0:A.receipt,j=null===C||void 0===C?void 0:C.provenance,R="string"===typeof(null===C||void 0===C?void 0:C.completedAt)?new Date(C.completedAt):null;if(!u(A)||"boolean"!==typeof A.idempotent||!u(I)||!p(I.id,"Adoption id",180)||"decision_lesson"!==I.kind||"accepted"!==I.status||!0!==I.acceptedIntoConcept||I.role!==x||String(I.targetConceptId||"").toLowerCase()!==g||String(I.sourcePageId||"").toLowerCase()!==m||I.decisionId!==v||I.lessonId!==y||!u(_)||!p(_.adoptionReceiptId,"Adoption receipt id",300)||_.decisionSnapshotHash!==f||_.outcomeRecordHash!==k||!u(C)||C.id!==_.adoptionReceiptId||"concept_decision_lesson_adopted"!==C.kind||"concept"!==C.source||"completed"!==C.status||!R||Number.isNaN(R.getTime())||!u(j)||1!==j.version||"adopt_decision_lesson"!==j.action||"user"!==j.actorType||j.requestId!==w||j.adoptionId!==I.id||String(j.targetConceptId||"").toLowerCase()!==g||String(j.sourcePageId||"").toLowerCase()!==m||j.decisionId!==v||j.lessonId!==y||j.role!==x||j.decisionSnapshotHash!==f||j.outcomeRecordHash!==k)throw new Error("Decision lesson adoption response is malformed or mismatched.");return A},m=async(e,t)=>{const n=await a.Ay.put("/api/concepts/".concat(encodeURIComponent(e)),t,(0,i.z)());return d(),n.data},v=async(e,t)=>{const n=await a.Ay.put("/api/concepts/".concat(encodeURIComponent(e),"/pins"),t,(0,i.z)());return d(),n.data},y=async function(e){let{limit:t=20,offset:n=0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=new URLSearchParams;o.set("limit",String(t)),o.set("offset",String(n));return(await a.Ay.get("/api/concepts/".concat(encodeURIComponent(e),"/related?").concat(o.toString()),(0,i.z)())).data},w=async e=>{const t=encodeURIComponent(String(e||"").trim());return(await a.Ay.get("/api/concepts/".concat(t,"/workspace"),(0,i.z)())).data||{conceptId:"",conceptName:"",workspace:null}},f=async(e,t)=>{const n=encodeURIComponent(String(e||"").trim());return(await a.Ay.put("/api/concepts/".concat(n,"/workspace"),{workspace:t},(0,i.z)())).data||{conceptId:"",conceptName:"",workspace:null}},k=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=encodeURIComponent(String(e||"").trim());return(await a.Ay.patch("/api/concepts/".concat(o,"/workspace"),{op:t,payload:n},(0,i.z)())).data||{conceptId:"",conceptName:"",workspace:null}},x=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=encodeURIComponent(String(e||"").trim());return(await a.Ay.post("/api/concepts/".concat(n,"/workspace/blocks/attach"),t,(0,i.z)())).data||{conceptId:"",conceptName:"",block:null,workspace:null}},b=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=encodeURIComponent(String(e||"").trim()),r=encodeURIComponent(String(t||"").trim());return(await a.Ay.patch("/api/concepts/".concat(o,"/workspace/blocks/").concat(r),n,(0,i.z)())).data||{conceptId:"",conceptName:"",block:null,workspace:null}},S=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=encodeURIComponent(String(e||"").trim()),r=(0,o.A)({mode:"library_only",maxLoops:2},t&&"object"===typeof t?t:{});return(await a.Ay.post("/api/concepts/".concat(n,"/agent/suggest"),r,(0,i.z)())).data||{ok:!1,conceptId:"",draftId:"",summary:{itemSuggestions:0,conceptSuggestions:0}}},A=async e=>{const t=encodeURIComponent(String(e||"").trim());return(await a.Ay.get("/api/concepts/".concat(t,"/agent/suggestions"),(0,i.z)())).data||{ok:!0,conceptId:"",drafts:[]}},I=async e=>{const t=encodeURIComponent(String(e||"").trim());return(await a.Ay.get("/api/concepts/".concat(t,"/material"),(0,i.z)())).data||{pinnedHighlights:[],recentHighlights:[],linkedArticles:[],linkedNotes:[]}},_=async e=>{const t=encodeURIComponent(String(e||"").trim());return(await a.Ay.get("/api/concepts/".concat(t,"/idea-workbench"),(0,i.z)())).data||{conceptId:"",conceptName:"",ideaWorkbench:null,ideaWorkbenchMeta:null,revision:0,events:[]}},C=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=encodeURIComponent(String(e||"").trim()),c=(0,o.A)({ideaWorkbench:t},n&&"object"===typeof n?n:{});return(await a.Ay.put("/api/concepts/".concat(r,"/idea-workbench"),c,(0,i.z)())).data||{conceptId:"",conceptName:"",ideaWorkbench:null,ideaWorkbenchMeta:null,revision:0,events:[]}},j=async(e,t)=>{const n=encodeURIComponent(String(e||"").trim()),o=encodeURIComponent(String(t||"").trim());return(await a.Ay.post("/api/concepts/".concat(n,"/idea-workbench/change-drafts/").concat(o,"/apply"),{},(0,i.z)())).data||{conceptId:"",conceptName:"",ideaWorkbench:null,ideaWorkbenchMeta:null,revision:0,events:[]}},R=async(e,t)=>{const n=encodeURIComponent(String(e||"").trim()),o=encodeURIComponent(String(t||"").trim());return(await a.Ay.post("/api/concepts/".concat(n,"/idea-workbench/change-drafts/").concat(o,"/dismiss"),{},(0,i.z)())).data||{conceptId:"",conceptName:"",ideaWorkbench:null,ideaWorkbenchMeta:null,revision:0,events:[]}},N=async(e,t)=>{const n=encodeURIComponent(String(e||"").trim()),o=encodeURIComponent(String(t||"").trim());return(await a.Ay.post("/api/concepts/".concat(n,"/idea-workbench/comments/").concat(o,"/accept"),{},(0,i.z)())).data||{conceptId:"",conceptName:"",ideaWorkbench:null,ideaWorkbenchMeta:null,revision:0,events:[]}},T=async(e,t)=>{const n=encodeURIComponent(String(e||"").trim()),o=encodeURIComponent(String(t||"").trim());return(await a.Ay.post("/api/concepts/".concat(n,"/idea-workbench/comments/").concat(o,"/dismiss"),{},(0,i.z)())).data||{conceptId:"",conceptName:"",ideaWorkbench:null,ideaWorkbenchMeta:null,revision:0,events:[]}},z=async e=>{const t=encodeURIComponent(String(e||"").trim());return(await a.Ay.post("/api/concepts/".concat(t,"/idea-workbench/mark-reviewed"),{},(0,i.z)())).data||{conceptId:"",conceptName:"",ideaWorkbench:null,ideaWorkbenchMeta:null,revision:0,events:[]}},U=async(e,t)=>{const n=encodeURIComponent(String(e||"").trim()),o=Array.isArray(t)?{events:t}:{event:t},r=(l.get(n)||Promise.resolve()).catch((()=>{})).then((async()=>(await a.Ay.post("/api/concepts/".concat(n,"/idea-workbench/events"),o,(0,i.z)())).data||{conceptId:"",conceptName:"",events:[]}));l.set(n,r);try{return await r}finally{l.get(n)===r&&l.delete(n)}},q=async e=>(await a.Ay.get("/api/concepts/".concat(encodeURIComponent(e),"/share"),
1(0,i.z)())).data||{shared:!1},E=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await a.Ay.post("/api/concepts/".concat(encodeURIComponent(e),"/share"),t,(0,i.z)())).data||{}},L=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await a.Ay.put("/api/concepts/".concat(encodeURIComponent(e),"/share"),t,(0,i.z)())).data||{}},M=async e=>(await a.Ay.delete("/api/concepts/".concat(encodeURIComponent(e),"/share"),(0,i.z)())).data||{revoked:!0},P=async e=>(await a.Ay.get("/api/public/concepts/".concat(encodeURIComponent(e)))).data},7198:(e,t,n)=>{n.d(t,{I4:()=>r,II:()=>i,d1:()=>c});var o=n(2606),a=n(1138);const i=async function(){let{filter:e="all",itemType:t="",itemId:n=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=new URLSearchParams;i.set("filter",e||"all"),t&&i.set("itemType",t),n&&i.set("itemId",n);const r=await o.Ay.get("/api/return-queue?".concat(i.toString()),(0,a.z)());return Array.isArray(r.data)?r.data:[]},r=async e=>(await o.Ay.post("/api/return-queue",e,(0,a.z)())).data,c=async(e,t)=>(await o.Ay.patch("/api/return-queue/".concat(e),t,(0,a.z)())).data},7222:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(5043),a=n(4126);const i=function(){let{initialStatus:e="pending",limit:t=20,threadId:n="",handoffId:i="",op:r="",autoLoad:c=!0,onChanged:s=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[l,d]=(0,o.useState)([]),[u,p]=(0,o.useState)(!1),[h,g]=(0,o.useState)(""),[m,v]=(0,o.useState)(""),y=(0,o.useCallback)((async()=>{p(!0),g("");try{const o=await(0,a.yB)({status:e,limit:t,threadId:n,handoffId:i,op:r});d(Array.isArray(null===o||void 0===o?void 0:o.approvals)?o.approvals:[])}catch(s){var o,c;d([]),g((null===(o=s.response)||void 0===o||null===(c=o.data)||void 0===c?void 0:c.error)||"Failed to load protocol approvals.")}finally{p(!1)}}),[i,e,t,r,n]),w=(0,o.useCallback)((async e=>{const t=String(e||"").trim();if(!t||m)return null;v(t),g("");try{const e=await(0,a.A5)(t);return await y(),"function"===typeof s&&await s(e||null),e||null}catch(i){var n,o;return g((null===(n=i.response)||void 0===n||null===(o=n.data)||void 0===o?void 0:o.error)||"Failed to approve protocol action."),null}finally{v("")}}),[y,s,m]),f=(0,o.useCallback)((async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=String(e||"").trim();if(!n||m)return null;v(n),g("");try{const e=await(0,a.CO)(n,t);return await y(),"function"===typeof s&&await s(e||null),e||null}catch(r){var o,i;return g((null===(o=r.response)||void 0===o||null===(i=o.data)||void 0===i?void 0:i.error)||"Failed to reject protocol action."),null}finally{v("")}}),[y,s,m]);return(0,o.useEffect)((()=>{c&&y()}),[c,y]),{protocolApprovals:l,protocolApprovalsLoading:u,protocolApprovalsError:h,protocolApprovalBusyId:m,loadProtocolApprovals:y,handleApproveProtocolApproval:w,handleRejectProtocolApproval:f}}},8430:(e,t,n)=>{n.r(t),n.d(t,{default:()=>k});var o=n(7051),a=n(5043),i=n(1045),r=n(2606),c=n(8939),s=n(1138),l=n(5886),d=n(3586),u=n(1531),p=n(4890),h=n(5024),g=n(8355),m=n(8501),v=n(8377),y=n(1128),w=n(579);const f=e=>{let{item:t}=e;const n=t.excerpt||"",o=Math.max(0,Math.min(n.length,t.matchStart||0)),a=Math.min(n.length,o+(t.matchLength||0));return(0,w.jsxs)(w.Fragment,{children:[n.slice(0,o),(0,w.jsx)("mark",{children:n.slice(o,a)}),n.slice(a)]})},k=()=>{const[e,t]=(0,i.ok)(),n=e.get("entryId")||"",[k,x]=(0,a.useState)([]),[b,S]=(0,a.useState)(""),A=n||b,I=(0,a.useRef)(A);I.current=A;const _=(0,a.useRef)(null),C=(0,a.useRef)(null),j=(0,a.useRef)(null),R=(0,a.useRef)(!1),[N,T]=(0,a.useState)(!1),[z,U]=(0,a.useState)(""),[q,E]=(0,a.useState)(""),L=(0,a.useRef)(A),[M,P]=(0,a.useState)(null),[W,D]=(0,a.useState)(!0),[F,O]=(0,a.useState)(!1),[B,K]=(0,a.useState)(!1),[$,H]=(0,a.useState)(""),Q=e.get("find")||"",V=Q.trim().replace(/\s+/g," "),[Y,Z]=(0,a.useState)(null),J=(0,i.Zp)(),X=n=>{const o=new URLSearchParams(e);n?o.set("find",n):o.delete("find"),t(o,{replace:!0})},[G,ee]=(0,a.useState)(!1),[te,ne]=(0,a.useState)(null),[oe,ae]=(0,a.useState)({}),[ie,re]=(0,a.useState)(null),[ce,se]=(0,a.useState)(null),le=(0,a.useCallback)((e=>se((()=>e))),[]),[de,ue]=(0,a.useState)(!1),[pe,he]=(0,a.useState)([]),[ge,me]=(0,a.useState)(""),ve=(0,a.useMemo)((()=>(0,g.Ko)("think-notes")),[]),ye=oe[A]||null,we=(0,a.useCallback)((e=>{A&&ae((t=>(0,o.A)((0,o.A)({},t),{},{[A]:e})))}),[A]),fe=(0,a.useCallback)((()=>{A&&ae((e=>(0,o.A)((0,o.A)({},e),{},{[A]:null})))}),[A]),ke=(0,a.useCallback)((e=>{we("partner"),ne(e)}),[we]);(0,a.useEffect)((()=>{var e,t,n;const o=null===(e=(t=window).matchMedia)||void 0===e?void 0:e.call(t,"(max-width: 1180px)");if(!o)return;const a=()=>ue(o.matches);return a(),null===(n=o.addEventListener)||void 0===n||n.call(o,"change",a),()=>{var e;return null===(e=o.removeEventListener)||void 0===e?void 0:e.call(o,"change",a)}}),[]);const xe=Boolean(ye&&de);(0,a.useEffect)((()=>
1{if(!ye)return;const e=e=>{var t,n;if("Escape"!==e.key||e.defaultPrevented||e.isComposing)return;e.preventDefault();const o=ye;fe(),null===(t=(n=window).requestAnimationFrame)||void 0===t||t.call(n,(()=>{var e,t,n;return null===(e=j.current)||void 0===e||null===(t=e.querySelector('[data-context-trigger="'.concat(o,'"]')))||void 0===t||null===(n=t.focus)||void 0===n?void 0:n.call(t)}))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[ye,fe]),(0,a.useEffect)((()=>{let e=!1;return(async()=>{try{const t=await(0,l.E8)();if(e)return;const n=Array.isArray(t)?t:[];x(n),S((0,v.Qk)({notes:n,recentIds:(0,v.Wg)()}))}catch(o){var t,n;e||H((null===o||void 0===o||null===(t=o.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Could not open your notes.")}finally{e||D(!1)}})(),()=>{e=!0}}),[]),(0,a.useEffect)((()=>{let e=!1;return c.Ay.list().then((t=>{e||he((0,v.$Y)(t))})).catch((()=>{e||me("Your saved writing could not be loaded. Reload to try again.")})),()=>{e=!0}}),[]),(0,a.useEffect)((()=>{if(!A||String((null===M||void 0===M?void 0:M._id)||"")===A)return;let e=!1;return O(!0),H(""),(async()=>{try{const t=await r.Ay.get("/api/notebook/".concat(A),(0,s.z)());e||P(t.data||null)}catch(o){var t,n;if(!e)P(null),H((null===o||void 0===o||null===(t=o.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Could not open that note.")}finally{e||O(!1)}})(),()=>{e=!0}}),[A]),(0,a.useEffect)((()=>{L.current===q&&A!==q&&E(""),L.current=A}),[q,A]),(0,a.useEffect)((()=>{if(!A||n)return;const o=new URLSearchParams(e);o.set("tab","notebook"),o.set("entryId",A),t(o,{replace:!0})}),[A,n,e,t]),(0,a.useEffect)((()=>{if(Z(null),V.length<2||V.length>160)return;const e=new AbortController,t=window.setTimeout((()=>{c.Ay.search(V,{signal:e.signal}).then((t=>{e.signal.aborted||Z((0,o.A)({phrase:V},t))})).catch((()=>{e.signal.aborted||Z({phrase:V,error:"Your writing could not be searched. Change the phrase or clear it to return to recent work."})}))}),220);return()=>{window.clearTimeout(t),e.abort()}}),[V]);const be=(null===Y||void 0===Y?void 0:Y.phrase)===V?Y:null,Se=(0,v.Vk)(null===be||void 0===be?void 0:be.results,Q),Ae=V.length>160?"Keep the phrase under 161 characters.":V.length<2?"Add one more character to look through your writing.":be?be.error||(Se.length?"".concat(Se.length," ").concat(1===Se.length?"match":"matches"," \xb7 most recently edited first"):be.limited?"No available matches in this batch. Try a more specific phrase.":"No saved writing matches these words."):"Looking through your writing\u2026",Ie=(0,a.useMemo)((()=>(0,v.LV)({notes:k,openId:A,expanded:G})),[k,A,G]),_e=!G&&k.length>Ie.length,Ce=Boolean((null===M||void 0===M?void 0:M._id)&&A&&String(M._id)===String(A)),je=(0,a.useMemo)((()=>(Array.isArray(null===M||void 0===M?void 0:M.blocks)?M.blocks.map((e=>String((null===e||void 0===e?void 0:e.text)||"").trim())).filter(Boolean).join(" "):"")||(0,y.Ul)(null===M||void 0===M?void 0:M.content)),[M]),Re=(0,a.useCallback)((async e=>{if(null!==e&&void 0!==e&&e.id){K(!0),H("");try{const t=await r.Ay.put("/api/notebook/".concat(e.id),e,(0,s.z)());return I.current===String(e.id)&&P(t.data||null),x((n=>n.map((n=>String(null===n||void 0===n?void 0:n._id)===String(e.id)?(0,o.A)((0,o.A)({},n),t.data):n)))),(0,l.hD)(),t.data}catch(a){var t,n;throw I.current===String(e.id)&&H((null===a||void 0===a||null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"That did not save."),a}finally{K(!1)}}}),[]),Ne=(0,a.useCallback)((e=>{_.current=e}),[]),Te=async e=>{var n;!1!==await(null===(n=_.current)||void 0===n?void 0:n.call(_))&&t({tab:e})},ze=async(e,t)=>{var n,o,a;0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),!1!==await(null===(n=_.current)||void 0===n?void 0:n.call(_))&&(J(t),t.startsWith("/think?")&&(null===(o=j.current)||void 0===o||null===(a=o.scrollIntoView)||void 0===a||a.call(o,{block:"start"}))))};(0,m.fF)({room:"think",objectType:"notebook",objectId:A,title:(null===M||void 0===M?void 0:M.title)||"",orientation:M?"An unfinished note. The agent may retrieve; only you can add what it finds.":"Open a note and keep the thought moving."});const Ue=e=>ve?"wfp-anim wfp-anim--".concat(e):"think-notes__return";return(0,w.jsxs)("div",{className:"think-notes".concat(ye?" has-context":""),children:[(0,w.jsxs)("aside",{className:"think-notes__shelf","aria-label":"Think navigation",inert:xe?"":void 0,"aria-hidden":xe||void 0,children:[(0,w.jsx)(u.Ay,{inRail:!0}),(0,w.jsxs)(h.cY,{as:"div",className:Ue(1),"data-writing-rail":"left","data-writing-rail-label":"Notes",label:"Think",count:W?void 0:k.length,search:Q,searchLabel:"Find your writing",searchPlaceholder:"A phrase you remember\u2026",searchMaxLength:160,searchInputRef:C,onSearchKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),X(""))},onSearchChange:X,children:[(0,w.jsxs)(h.i3,{className:"think-notes__spaces",children:[(0,w.jsx)("li",{children:(0,w.jsxs)(h.wy,{active:!0,onClick:()=>Te("notebook"),children:[(0,w.jsx)("span",{children:"Notebook"}),W?null:(0,w.jsx)(h.Xg,{children:k.length})]})}),(0,w.jsx)("li",{children:(0,w.jsx)(h.wy,{onClick:()=>Te("concepts"),children:(0,w.jsx)("span",{children:"Concepts"})})}),(0,w.jsx)("li",{children:(0,w.jsx)(h.wy,{onClick:()=>Te("questions"),children:(0,w.jsx)("span",{children:"Questions"})})})]}),(0,w.jsx)("button",{type:"button",className:"think-notes__new",onClick:async()=>
1{if(!R.current){R.current=!0,T(!0),U("");try{var e;if(!1===await(null===(e=_.current)||void 0===e?void 0:e.call(_)))return;const{data:n}=await r.Ay.post("/api/notebook",{title:"",content:"",blocks:[],type:"note",source:"think"},(0,s.z)());if(null===n||void 0===n||!n._id)throw new Error("Missing note identity");(0,l.hD)(),x((e=>[n,...e])),P(n),E(String(n._id)),t({tab:"notebook",entryId:String(n._id)})}catch(n){(0,l.hD)(),U("Could not confirm the new note. Reload Think to check your recent notes before trying again.")}finally{R.current=!1,T(!1)}}},disabled:N||W||F,children:N?"Opening\u2026":"+ New note"}),z?(0,w.jsx)("p",{role:"status",className:"room-shelf__description",children:z}):null,V?(0,w.jsxs)(h.TJ,{label:"Found in your writing",children:[(0,w.jsx)("p",{className:"room-shelf__description",children:"Notes and private explorations"}),(0,w.jsx)("p",{role:"status",className:"room-shelf__description",children:Ae}),(0,w.jsx)(h.i3,{children:Se.map((e=>(0,w.jsx)("li",{children:(0,w.jsxs)(i.N_,{to:e.href,onClick:t=>ze(t,e.href),className:(0,h.TU)({nested:!0,className:"think-notes__continuation"}),children:[(0,w.jsx)("span",{children:e.excerpt===e.title?(0,w.jsx)(f,{item:e}):e.title}),(0,w.jsxs)("span",{className:"think-notes__writing-origin",children:["notebook"===e.kind?"Note":"Private writing \xb7 ".concat(e.label),e.pageTitle?" \xb7 ".concat(e.pageTitle):"",e.sourceUnavailable?" \xb7 Recorded context":e.originMissing?" \xb7 Earlier passage":""]}),e.excerpt!==e.title?(0,w.jsx)("span",{className:"think-notes__match-excerpt",children:(0,w.jsx)(f,{item:e})}):null]})},"".concat(e.kind,":").concat(e.id))))}),null!==be&&void 0!==be&&be.limited?(0,w.jsx)("p",{className:"room-shelf__description",children:"More matches may be available. Add a few words to narrow them."}):null,(0,w.jsx)("button",{type:"button",className:"think-notes__shelf-more",onClick:()=>X(""),children:"Back to recent work"})]}):(0,w.jsxs)(w.Fragment,{children:[ge?(0,w.jsx)("p",{role:"status",className:"room-shelf__description",children:ge}):null,pe.length?(0,w.jsx)(h.TJ,{label:"Your writing",className:"think-notes__writing",children:(0,w.jsx)(h.i3,{children:pe.map((e=>(0,w.jsx)("li",{children:(0,w.jsxs)(i.N_,{to:e.href,onClick:t=>ze(t,e.href),className:(0,h.TU)({nested:!0,className:"think-notes__continuation"}),children:[(0,w.jsx)("span",{children:e.title}),e.returnNote?(0,w.jsx)("span",{className:"think-notes__return-note",children:e.returnNote}):null,e.pageTitle?(0,w.jsxs)("span",{className:"think-notes__writing-origin",children:["From ",e.pageTitle,e.sourceUnavailable?" \xb7 Recorded context":e.originMissing?" \xb7 Earlier passage":""]}):null]})},e.id)))})}):null,(0,w.jsxs)(h.TJ,{label:"Recent notes",children:[(0,w.jsx)(h.i3,{children:Ie.map((e=>(0,w.jsx)("li",{children:(0,w.jsxs)(h.wy,{active:e.isOpen,nested:!0,className:"think-notes__note-link",onClick:()=>(async e=>{var n;!1!==await(null===(n=_.current)||void 0===n?void 0:n.call(_))&&t({tab:"notebook",entryId:e})})(e.id),children:[(0,w.jsx)("span",{children:e.title}),e.nextTimeLine?(0,w.jsx)("span",{className:"think-notes__return-note",children:e.nextTimeLine}):null]})},e.id)))}),_e?(0,w.jsx)("button",{type:"button",className:"think-notes__shelf-more",onClick:()=>ee(!0),children:"Show all recent notes"}):null]})]})]})]}),(0,w.jsx)("main",{ref:j,className:"think-notes__note".concat(F?" is-loading":""),"aria-labelledby":"think-note-title","aria-busy":F?"true":void 0,inert:xe?"":void 0,"aria-hidden":xe||void 0,children:Ce?(0,w.jsx)("div",{className:Ue(2),children:(0,w.jsx)(d.A,{entry:M,metaLine:(0,v.oe)(M),metaId:"think-note-title",saving:B,error:$,onSave:Re,onRegisterSave:Ne,startWriting:q===A,onInvokeAgentSkill:ke,showInlineAgentDock:!1,agentContextType:"notebook",agentContextId:A,agentContextTitle:M.title||"Note",activeContext:ye,onOpenContext:we,contextPortal:ie,quietWorkspace:!0,onWorkingStateChange:e=>{P((t=>t?(0,o.A)((0,o.A)({},t),{},{workingState:e}):t)),x((t=>t.map((t=>String(null===t||void 0===t?void 0:t._id)===A?(0,o.A)((0,o.A)({},t),{},{workingState:e}):t))))},onRegisterPartnerTrial:le,onSourceCorrectionSettled:e=>{null!==e&&void 0!==e&&e.entry?P(e.entry):null!==e&&void 0!==e&&e.sourceCorrection&&P((t=>t?(0,o.A)((0,o.A)({},t),{},{sourceCorrection:e.sourceCorrection}):t))}})}):(0,w.jsx)("p",{className:"think-notes__quiet ".concat(Ue(2)),role:"status",children:W?"Opening your last note\u2026":$||"A thought does not need a source to begin. Start a note and see where it takes you."})}),(0,w.jsxs)("aside",{className:"think-notes__partner","aria-label":"Note context",hidden:!ye,children:[(0,w.jsxs)("div",{className:"think-notes__context-head",children:[(0,w.jsxs)("div",{role:"tablist","aria-label":"Note context",children:[(0,w.jsx)("button",{type:"button",role:"tab","aria-selected":"material"===ye,onClick:()=>we("material"),children:"Material"}),(0,w.jsx)("button",{type:"button",role:"tab","aria-selected":"partner"===ye,onClick:()=>we("partner"),children:"Partner"})]}),(0,w.jsx)("button",{type:"button",className:"think-notes__context-close",onClick:fe,"aria-label":"Close note context",children:"Close"})]}),(0,w.jsx)("div",{ref:re,hidden:"material"!==ye}),(0,w.jsx)("div",{hidden:"partner"!==ye,children:(0,w.jsx)(p.default,{variant:"stream",contextType:"notebook",contextId:Ce?A:"",contextTitle:Ce?(null===M||void 0===M?void 0:M.title)||"
1Note":"Think",contextMetadata:Ce?{primaryText:je}:null,queuedPrompt:te,title:"Thought partner",subtitle:"This note, when you ask",placeholder:"Ask about this note or selected words\u2026",promptTemplates:[],passiveStatusText:"Keep writing. The partner will stay quiet until you ask.",emptyStateText:"Ask when you want another mind in the room.",submitLabel:"\u2197",onTryWording:ce})})]})]})}},8939:(e,t,n)=>{n.d(t,{Ay:()=>s,oy:()=>c,sp:()=>i});var o=n(7051),a=n(2606);const i=function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Your words are here. Saving could not finish.";return(null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||!(null!==e&&void 0!==e&&e.isAxiosError)&&(null===e||void 0===e?void 0:e.message)||o},r=(e,t)=>({async load(t){const{data:n}=await a.Ay.get(e(t));return n},async save(e,n,o){const{data:i}=await a.Ay.put(t(e,n),o);return i.exploration},async keep(e,n,o){const{data:i}=await a.Ay.post("".concat(t(e,n),"/keep"),o);return i},async discard(e,n,o){await a.Ay.delete(t(e,n),{data:{expectedRevision:o}})}}),c=r((e=>"/api/library/articles/".concat(encodeURIComponent(e),"/explorations")),((e,t)=>"/api/library/articles/".concat(encodeURIComponent(e),"/highlights/").concat(encodeURIComponent(t),"/exploration"))),s=(0,o.A)((0,o.A)({},r((e=>"/api/wiki/pages/".concat(encodeURIComponent(e),"/explorations")),((e,t)=>"/api/wiki/pages/".concat(encodeURIComponent(e),"/claims/").concat(encodeURIComponent(t),"/exploration")))),{},{async read(e){const{data:t}=await a.Ay.get("/api/authored-explorations/".concat(encodeURIComponent(e)));return t},async saveVersion(e,t){const{data:n}=await a.Ay.post("/api/authored-explorations/".concat(encodeURIComponent(e),"/versions"),{expectedRevision:t});return n.versions},async search(e){let{signal:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{data:n}=await a.Ay.get("/api/authored-work/search",{params:{q:e},signal:t});return n},async list(){const{data:e}=await a.Ay.get("/api/authored-explorations");return e.explorations},async disposeSourceCorrection(e,t){let{eventId:n,action:o}=t;const{data:i}=await a.Ay.post("/api/authored-explorations/".concat(encodeURIComponent(e),"/source-correction"),{eventId:n,action:o});return i}})},9845:(e,t,n)=>{n.d(t,{A:()=>c});n(5043);var o=n(1045),a=n(5063),i=n(5943),r=n(579);const c=e=>{let{highlight:t,onOpenArticle:n,onRemove:c,removeLabel:s="Remove",compact:l=!1}=e;const d=t._id||t.id||"",u=Boolean(t.articleId||t.articleTitle),p=()=>{n&&n(t)};return(0,r.jsxs)("div",{className:"highlight-block ".concat(l?"highlight-block--compact":""),children:[(0,r.jsxs)("div",{className:"highlight-block-quote",children:["\u201c",t.text,"\u201d"]}),u&&(0,r.jsxs)("div",{className:"highlight-block-meta",children:[t.articleId?(0,r.jsx)(o.N_,{className:"highlight-block-title",to:(0,i.KO)(t.articleId),onClick:p,children:t.articleTitle||"Open article"}):(0,r.jsx)("span",{className:"highlight-block-title",children:t.articleTitle}),t.createdAt&&(0,r.jsx)("span",{className:"muted small",children:new Date(t.createdAt).toLocaleDateString()})]}),(t.tags||[]).length>0&&(0,r.jsx)("div",{className:"highlight-block-tags",children:t.tags.map((e=>(0,r.jsx)(a.Fc,{to:"/think?tab=concepts&concept=".concat(encodeURIComponent(e)),children:e},"".concat(d,"-").concat(e))))}),(c||n)&&(0,r.jsxs)("div",{className:"highlight-block-actions",children:[n&&t.articleId&&(0,r.jsx)(a.$q,{onClick:p,children:"Open article"}),c&&d&&(0,r.jsx)(a.$q,{onClick:()=>c(d),children:s})]})]})}}}]);
2//# sourceMappingURL=9116.3832c944.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.