studiograph 1.3.48-next.39 → 1.3.48-next.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp/tools.js +106 -0
- package/dist/mcp/tools.js.map +1 -1
- package/dist/server/routes/auth-api.js +6 -1
- package/dist/server/routes/auth-api.js.map +1 -1
- package/dist/server/routes/permissions-api.d.ts +6 -3
- package/dist/server/routes/permissions-api.js +11 -9
- package/dist/server/routes/permissions-api.js.map +1 -1
- package/dist/services/access-control.d.ts +4 -1
- package/dist/services/access-control.js +7 -2
- package/dist/services/access-control.js.map +1 -1
- package/dist/services/auth-service.d.ts +12 -0
- package/dist/services/auth-service.js +33 -0
- package/dist/services/auth-service.js.map +1 -1
- package/dist/web/_app/immutable/assets/0.tt36wGs6.css +1 -0
- package/dist/web/_app/immutable/assets/2.cj3pVppF.css +1 -0
- package/dist/web/_app/immutable/assets/{3.jprGvDSF.css → 3.DSua86Zq.css} +1 -1
- package/dist/web/_app/immutable/assets/{ChevronLeft.D7vOtKrc.css → ChevronLeft.DiKBNVgX.css} +1 -1
- package/dist/web/_app/immutable/assets/{WorkspaceView.CNUBJMNi.css → WorkspaceView.BMPu-4Wa.css} +1 -1
- package/dist/web/_app/immutable/chunks/{CToHYjcL.js → BCm_7Inl.js} +1 -1
- package/dist/web/_app/immutable/chunks/{inRnuvZm.js → BHbfAzRO.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DQO1YURa.js → BLPw0UPc.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Dwi13G_M.js → BQ3iDzHp.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DiG3Ahs1.js → BSpviSWs.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Dmj5X8vc.js → BUV6mcOy.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BwtrEg3l.js → BocnTYM0.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BWoDznmJ.js → BulV8KzX.js} +1 -1
- package/dist/web/_app/immutable/chunks/Bx3N1DIh.js +1 -0
- package/dist/web/_app/immutable/chunks/{CKhbOUJD.js → CnvQx_FH.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DCuYbn_z.js → CqACN7PV.js} +1 -1
- package/dist/web/_app/immutable/chunks/{IOusrodm.js → Ct8o3lkT.js} +1 -1
- package/dist/web/_app/immutable/chunks/DAWhepJ2.js +2 -0
- package/dist/web/_app/immutable/chunks/{CNh6J1Ak.js → hUJ5IAUm.js} +1 -1
- package/dist/web/_app/immutable/chunks/{FND3XtE8.js → kA7K83A6.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.BmHy7hX4.js → app.NXOEob17.js} +2 -2
- package/dist/web/_app/immutable/entry/start.CfmBqwCz.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.BwaB_3ig.js → 0.BVgKNTrB.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.DY7-i0Xl.js → 1.CRf0E_7L.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.DLrd00N4.js → 10.CihhxpE1.js} +1 -1
- package/dist/web/_app/immutable/nodes/{11.UaG0a37J.js → 11.FnZkZKxR.js} +1 -1
- package/dist/web/_app/immutable/nodes/{12.CCwhofBP.js → 12.DMHpM_q0.js} +1 -1
- package/dist/web/_app/immutable/nodes/2.BGOOcSyM.js +271 -0
- package/dist/web/_app/immutable/nodes/{3.DvdE-O2F.js → 3.CuzG6oIP.js} +3 -3
- package/dist/web/_app/immutable/nodes/4.C7V72ICK.js +11 -0
- package/dist/web/_app/immutable/nodes/{5.D1QntrJI.js → 5.BNtaLkbW.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.jMj4Us97.js → 6.BViNLvc6.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.BHJU2gyP.js → 7.9KnGMlt0.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.Ca1dI4sz.js → 8.Cn7NGGVZ.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.oR-pKeyV.js → 9.zX-fDTGl.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +1 -1
- package/dist/web/_app/immutable/assets/0.lKU4zpOl.css +0 -1
- package/dist/web/_app/immutable/assets/2.D77cn8ik.css +0 -1
- package/dist/web/_app/immutable/chunks/DAsetsxE.js +0 -1
- package/dist/web/_app/immutable/chunks/DgzlPw1e.js +0 -2
- package/dist/web/_app/immutable/entry/start.B04ltWzB.js +0 -1
- package/dist/web/_app/immutable/nodes/2.BE_WzycC.js +0 -271
- package/dist/web/_app/immutable/nodes/4.DVvnNLgA.js +0 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/
|
|
2
|
-
import{_ as pe}from"../chunks/PPVm8Dsz.js";import"../chunks/DsnmJJEf.js";import{a3 as Et,P as Vt,p as se,t as E,b as ne,c as o,g as e,r as s,h as T,e as oe,s as x,n as ce,f as ge,bp as Rt,u as Z,V as ct,l as X,d as F,a as xe,m as Q,aE as gt,i as Ke}from"../chunks/txOdadJq.js";import{d as Ee,e as Xe,a as u,b as I,g as ve,c as _t,s as R,f as te,t as Fe}from"../chunks/9gtwoV4P.js";import{p as K,i as S,l as ee}from"../chunks/BCLL87Av.js";import{e as Pe,c as St,i as dt}from"../chunks/IOusrodm.js";import{c as Me}from"../chunks/DerefRkG.js";import{b as je,c as Ot,a as ke,d as pt}from"../chunks/ypcxmEdT.js";import{g as tt}from"../chunks/DAsetsxE.js";import{V as Lt}from"../chunks/Dwi13G_M.js";import{B as vt,b as Nt}from"../chunks/BnuL1eJn.js";import{A as Ft}from"../chunks/gYOvQJjM.js";import{A as jt,F as Bt}from"../chunks/Bpy-hqIj.js";import{U as qt,D as Zt,C as Ut}from"../chunks/BtjbqM0h.js";import{k as Yt,u as Gt,l as Wt,t as Jt,m as Kt}from"../chunks/CoIXzWkc.js";import{a as yt}from"../chunks/BbSP3Sm9.js";import{q as Xt,r as Qt,T as ea}from"../chunks/BWrcBDa3.js";import{i as ye}from"../chunks/DpgUPK2a.js";import{w as de}from"../chunks/-wxjF91G.js";import{n as ta}from"../chunks/BwrgIV17.js";import{insightsStore as he}from"../chunks/DsoI6Vso.js";import{u as ut}from"../chunks/ClUQT4C1.js";import{R as aa}from"../chunks/BYjwobCP.js";import{apiFetch as Qe}from"../chunks/DFYOFE3o.js";import{e as ra,f as et}from"../chunks/DD_IjhIj.js";import{A as sa}from"../chunks/RsJJ4HLq.js";import{T as ft,C as mt,R as ht}from"../chunks/BbbskiWe.js";function na(b,n,r){Et(()=>{var f=Vt(()=>n(b,r?.())||{});if(f?.destroy)return()=>f.destroy()})}var ia=I('<div class="home-drop-indicator svelte-1anss1t"><!> <span>Drop files to import</span></div>'),oa=I('<textarea class="home-input-field svelte-1anss1t" rows="4"></textarea> <div class="home-input-actions svelte-1anss1t"><!> <!></div>',1),la=I('<input id="home-file-input" type="file" multiple="" accept=".md,.txt,.csv,.pdf,.docx,.html" style="display:none"/>'),ca=I('<div class="home-input-wrap svelte-1anss1t"><div><!></div> <!></div>');function da(b,n){se(n,!0);let r=K(n,"placeholder",3,"Ask anything about your knowledge graph..."),f=oe(""),c=oe(!1);function d(){const v=e(f).trim();v&&(n.onsubmit(v),x(f,""))}function y(v){v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),d())}function l(v){const k=v.target;k.files?.length&&n.onfiles&&n.onfiles(k.files),k.value=""}function i(v){v.preventDefault(),v.dataTransfer&&(v.dataTransfer.dropEffect="copy"),x(c,!0)}function A(v){const k=v.relatedTarget;k&&v.currentTarget?.contains(k)||x(c,!1)}function m(v){v.preventDefault(),x(c,!1),v.dataTransfer&&n.ondrop&&n.ondrop(v.dataTransfer)}var g=ca(),p=o(g);let M;var G=o(p);{var ie=v=>{var k=ia(),U=o(k);qt(U,{size:20}),ce(2),s(k),u(v,k)},ue=v=>{var k=oa(),U=ge(k);Rt(U);var le=T(U,2),W=o(le);{var J=z=>{vt(z,{variant:"ghost",size:"icon",class:"size-7 home-attach-btn",onclick:()=>document.getElementById("home-file-input")?.click(),children:(re,Te)=>{jt(re,{size:16})},$$slots:{default:!0}})};S(W,z=>{n.onfiles&&z(J)})}var q=T(W,2);{let z=Z(()=>e(f).trim()?"home-send-active":"");vt(q,{variant:"ghost",size:"icon",get class(){return`size-7 home-send-btn ${e(z)??""}`},onclick:d,children:(re,Te)=>{Ft(re,{size:14})},$$slots:{default:!0}})}s(le),E(()=>Ot(U,"placeholder",r())),ve("keydown",U,y),Nt(U,()=>e(f),z=>x(f,z)),u(v,k)};S(G,v=>{e(c)?v(ie):v(ue,!1)})}s(p);var D=T(p,2);{var V=v=>{var k=la();ve("change",k,l),u(v,k)};S(D,v=>{n.onfiles&&v(V)})}s(g),E(()=>M=je(p,1,"home-input svelte-1anss1t",null,M,{"home-input-dragover":e(c)})),Xe("dragover",p,i),Xe("dragleave",p,A),Xe("drop",p,m),u(b,g),ne()}Ee(["keydown","change"]);function pa(){let b=oe(ct([])),n=oe(ct([])),r=oe(!1),f=oe(!1);async function c(){x(r,!0);try{const y=await Yt();x(b,y.openTasks,!0),x(n,y.todaysMeetings,!0),x(f,!0)}catch(y){console.error("Failed to load home data:",y),x(f,!0)}finally{x(r,!1)}}function d(y,l){x(b,e(b).filter(i=>!(i.repo===y&&i.id===l)),!0)}return{get openTasks(){return e(b)},get todaysMeetings(){return e(n)},get loading(){return e(r)},get loaded(){return e(f)},load:c,removeTask:d}}const _e=pa();var va=I('<span class="tasks-count svelte-q21uam"> </span>'),ua=I("<span> </span>"),fa=I('<div class="task-row svelte-q21uam"><!> <button class="task-name svelte-q21uam"> </button> <!></div>'),ma=I('<div class="tasks-section svelte-q21uam"><div class="tasks-header svelte-q21uam"><span class="tasks-title svelte-q21uam"> </span> <!></div> <div class="tasks-list svelte-q21uam"></div></div>');function ha(b,n){se(n,!0);const r={urgent:0,high:1,medium:2,low:3},f=5,c=Z(()=>yt.user?.displayName?.toLowerCase().replace(/\s+/g,"-")??null),d=Z(()=>_e.openTasks),y=Z(()=>e(c)?e(d).filter(D=>D.assignee?.replace(/\[\[|\]\]/g,"")===e(c)):[]),l=Z(()=>e(y).length>0),i=Z(()=>e(l)?e(y):e(d)),A=Z(()=>[...e(i)].sort((D,V)=>{const v=r[D.priority??""]??4,k=r[V.priority??""]??4;return v!==k?v-k:D.dueDate&&V.dueDate?D.dueDate.localeCompare(V.dueDate):D.dueDate?-1:V.dueDate?1:0}).slice(0,f)),m=Z(()=>e(d).length>0);function g(D){if(!D)return"";const V=new Date;V.setHours(0,0,0,0);const v=new Date(D+"T00:00:00"),k=Math.round((v.getTime()-V.getTime())/864e5);return k<0?`${Math.abs(k)}d overdue`:k===0?"Today":k===1?"Tomorrow":`in ${k}d`}function p(D){if(!D)return!1;const V=new Date;return V.setHours(0,0,0,0),new Date(D+"T00:00:00")<V}async function M(D){const V=D.repo;_e.removeTask(V,D.id);try{await Gt(V,"task",D.id,{data:{status:"done"}});const{toast:v}=await pe(async()=>{const{toast:k}=await import("../chunks/DCuYbn_z.js");return{toast:k}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);v.success("Task completed")}catch(v){const{toast:k}=await pe(async()=>{const{toast:U}=await import("../chunks/DCuYbn_z.js");return{toast:U}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);k.error(v.message??"Failed to update task"),_e.load()}}var G=_t(),ie=ge(G);{var ue=D=>{var V=ma(),v=o(V),k=o(v),U=o(k,!0);s(k);var le=T(k,2);{var W=q=>{var z=va(),re=o(z);s(z),E(()=>R(re,`${e(i).length??""} total`)),u(q,z)};S(le,q=>{e(i).length>f&&q(W)})}s(v);var J=T(v,2);Pe(J,21,()=>e(A),q=>q.repo+"/"+q.id,(q,z)=>{var re=fa(),Te=o(re);Xt(Te,{checked:!1,onCheckedChange:()=>M(e(z))});var be=T(Te,2),Ve=o(be,!0);s(be);var He=T(be,2);{var Be=ze=>{var Ae=ua();let Re;var qe=o(Ae,!0);s(Ae),E((t,a)=>{Re=je(Ae,1,"task-due svelte-q21uam",null,Re,t),R(qe,a)},[()=>({overdue:p(e(z).dueDate)}),()=>g(e(z).dueDate)]),u(ze,Ae)};S(He,ze=>{e(z).dueDate&&ze(Be)})}s(re),E(()=>R(Ve,e(z).title)),ve("click",be,()=>tt(`/${e(z).repo}/task/${e(z).id}`)),u(q,re)}),s(J),s(V),E(()=>R(U,e(l)?"Here’s what’s on your plate":"Tasks across your workspace")),u(D,V)};S(ie,D=>{e(m)&&D(ue)})}u(b,G),ne()}Ee(["click"]);var ga=I('<span class="meeting-time svelte-1q98wxk"> </span>'),_a=I('<span class="meeting-attendees svelte-1q98wxk"> </span>'),ya=I('<button class="meeting-row svelte-1q98wxk"><!> <span class="meeting-name svelte-1q98wxk"> </span> <!></button>'),ba=I('<div class="meetings-section svelte-1q98wxk"><div class="meetings-header svelte-1q98wxk"><span class="meetings-title svelte-1q98wxk">Today’s meetings</span></div> <div class="meetings-list svelte-1q98wxk"></div></div>');function wa(b,n){se(n,!0);const r=Z(()=>_e.todaysMeetings),f=Z(()=>e(r).length>0);function c(m){if(!m||m.length<=10)return"";try{return new Date(m).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}catch{return""}}function d(m){function g(){m.classList.toggle("is-overflowing",m.scrollWidth>m.clientWidth)}g();const p=new ResizeObserver(g);return p.observe(m),{destroy:()=>p.disconnect()}}function y(m){return m?(Array.isArray(m)?m:[m]).map(p=>String(p).replace(/\[\[|\]\]/g,"").replace(/-/g," ").replace(/\b\w/g,M=>M.toUpperCase())).join(", "):""}var l=_t(),i=ge(l);{var A=m=>{var g=ba(),p=T(o(g),2);Pe(p,21,()=>e(r),M=>M.repo+"/"+M.id,(M,G)=>{var ie=ya(),ue=o(ie);{var D=W=>{var J=ga(),q=o(J,!0);s(J),E(z=>R(q,z),[()=>c(e(G).date)]),u(W,J)},V=Z(()=>c(e(G).date));S(ue,W=>{e(V)&&W(D)})}var v=T(ue,2),k=o(v,!0);s(v);var U=T(v,2);{var le=W=>{var J=_a(),q=o(J,!0);s(J),na(J,z=>d?.(z)),E(z=>R(q,z),[()=>y(e(G).attendees)]),u(W,J)};S(U,W=>{e(G).attendees&&W(le)})}s(ie),E(()=>R(k,e(G).title)),ve("click",ie,()=>tt(`/${e(G).repo}/meeting/${e(G).id}`)),u(M,ie)}),s(p),s(g),u(m,g)};S(i,m=>{e(f)&&m(A)})}u(b,l),ne()}Ee(["click"]);var $a=te("<title> </title>"),xa=te('<svg><!><path d="M15 10H17V18H15z"></path><path d="M20 14H22V18H20z"></path><path d="M10 12H12V18H10z"></path><path d="M25,4H17V2H15V4H7A2,2,0,0,0,5,6V20a2,2,0,0,0,2,2h8v6H11v2H21V28H17V22h8a2,2,0,0,0,2-2V6A2,2,0,0,0,25,4Zm0,16H7V6H25Z"></path></svg>');function ka(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=xa();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=$a(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(4),s(i),u(b,i),ne()}var Ta=te("<title> </title>"),Aa=te('<svg><!><path d="M26,14H24v2h2a3.0033,3.0033,0,0,1,3,3v4h2V19A5.0058,5.0058,0,0,0,26,14Z"></path><path d="M24,4a3,3,0,1,1-3,3,3,3,0,0,1,3-3m0-2a5,5,0,1,0,5,5A5,5,0,0,0,24,2Z"></path><path d="M23,30H21V28a3.0033,3.0033,0,0,0-3-3H14a3.0033,3.0033,0,0,0-3,3v2H9V28a5.0059,5.0059,0,0,1,5-5h4a5.0059,5.0059,0,0,1,5,5Z"></path><path d="M16,13a3,3,0,1,1-3,3,3,3,0,0,1,3-3m0-2a5,5,0,1,0,5,5A5,5,0,0,0,16,11Z"></path><path d="M8,14H6a5.0059,5.0059,0,0,0-5,5v4H3V19a3.0033,3.0033,0,0,1,3-3H8Z"></path><path d="M8,4A3,3,0,1,1,5,7,3,3,0,0,1,8,4M8,2a5,5,0,1,0,5,5A5,5,0,0,0,8,2Z"></path></svg>');function Ia(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Aa();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Ta(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(6),s(i),u(b,i),ne()}var Ma=te("<title> </title>"),Ha=te('<svg><!><path d="M22 27.18 19.41 24.59 18 26 22 30 30 22 28.59 20.59 22 27.18z"></path><path d="M15,28H8V4h8v6a2.0058,2.0058,0,0,0,2,2h6v6h2V10a.9092.9092,0,0,0-.3-.7l-7-7A.9087.9087,0,0,0,18,2H8A2.0058,2.0058,0,0,0,6,4V28a2.0058,2.0058,0,0,0,2,2h7ZM18,4.4,23.6,10H18Z"></path></svg>');function za(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Ha();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Ma(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(2),s(i),u(b,i),ne()}var Ca=te("<title> </title>"),Da=te('<svg><!><path d="M30,28.5859l-4.6885-4.6884a8.028,8.028,0,1,0-1.414,1.414L28.5859,30ZM19,25a6,6,0,1,1,6-6A6.0066,6.0066,0,0,1,19,25Z"></path><path d="M2 12H10V14H2z"></path><path d="M2 2H18V4H2z"></path><path d="M2 7H18V9H2z"></path></svg>');function Pa(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Da();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Ca(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(4),s(i),u(b,i),ne()}var Ea=te("<title> </title>"),Va=te('<svg><!><path d="M28,6H4A2,2,0,0,0,2,8V24a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V8A2,2,0,0,0,28,6ZM25.8,8,16,14.78,6.2,8ZM4,24V8.91l11.43,7.91a1,1,0,0,0,1.14,0L28,8.91V24Z"></path></svg>');function Ra(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Va();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Ea(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(),s(i),u(b,i),ne()}var Sa=te("<title> </title>"),Oa=te('<svg><!><path d="M24.5857,6.5859A1.9865,1.9865,0,0,0,23.1714,6H16V2H14V6H6A2.0025,2.0025,0,0,0,4,8v6a2.0025,2.0025,0,0,0,2,2h8V30h2V16h7.1714a1.9865,1.9865,0,0,0,1.4143-.5859L29,11ZM23.1714,14H6V8H23.1716l3,3Z"></path></svg>');function La(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Oa();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Sa(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(),s(i),u(b,i),ne()}var Na=I('<button class="starter-card svelte-efacsa"><span class="starter-icon svelte-efacsa"><!></span> <span class="starter-title svelte-efacsa"> </span></button>'),Fa=I('<div class="starters-section svelte-efacsa"><div class="starters-header svelte-efacsa"><span class="starters-title svelte-efacsa">Quick actions</span></div> <div class="starters-grid svelte-efacsa"></div></div>');function ja(b,n){se(n,!1);const r=gt("chat"),f=[{title:"Write a proposal",Icon:Zt,prompt:"Help me write a proposal. Ask me about the client and scope, then scaffold it as a document entry."},{title:"Build a presentation",Icon:ka,prompt:"Help me build a presentation. Ask me about the audience and key messages, then scaffold it."},{title:"Create a project brief",Icon:Bt,prompt:"Help me create a project brief. Ask about the client, goals, and timeline, then create a project entry."},{title:"Prepare for a meeting",Icon:Ia,prompt:"Help me prepare for a meeting. Ask who I’m meeting and the goal, then draft an agenda as a meeting entry."},{title:"Summarize a meeting",Icon:za,prompt:"Help me summarize a meeting. Ask me to share the notes or transcript, then create a note with key points and action items."},{title:"Find relevant past work",Icon:Pa,prompt:"Help me find relevant past work. Ask what I’m looking for, then search the workspace and suggest the most relevant entries."},{title:"Pull project references",Icon:Ut,prompt:"Help me pull references for a project. Ask what the project is and what kind of references I’m looking for, then search the workspace and suggest relevant materials."},{title:"Draft an email",Icon:Ra,prompt:"Help me draft an email. Ask who I’m writing to and the purpose, then scaffold the email as a document entry."},{title:"Capture a decision",Icon:La,prompt:"Help me capture a decision. Ask what was decided and the context, then create a decision entry."}];function c(l){r.sendPrompt(l.prompt)}ye();var d=Fa(),y=T(o(d),2);Pe(y,5,()=>f,l=>l.title,(l,i)=>{var A=Na(),m=o(A),g=o(m);e(i).Icon(g,{size:16}),s(m);var p=T(m,2),M=o(p,!0);s(p),s(A),E(()=>R(M,e(i).title)),ve("click",A,()=>c(e(i))),u(l,A)}),s(y),s(d),u(b,d),ne()}Ee(["click"]);function Ba(){let b=oe(null),n=oe(!1),r=oe(!1),f=oe(null);function c(d,y,l,i){return d.repo===y&&d.entityType===l&&d.entityId===i}return{get result(){return e(b)},get capturing(){return e(n)},get importing(){return e(r)},get progress(){return e(f)},set(d){x(b,d,!0)},clear(){x(b,null)},setCapturing(d){x(n,d,!0),d?(x(b,null),x(f,{label:"Sending…",count:0},!0)):x(f,null)},setImporting(d){x(r,d,!0),d&&x(b,null)},setStage(d){e(f)&&x(f,{...e(f),label:d},!0)},bumpCount(){e(f)&&x(f,{...e(f),count:e(f).count+1},!0)},remove(d,y,l){if(!e(b))return;const i=e(b).entities.filter(A=>!c(A,d,y,l));x(b,{...e(b),entities:i},!0)},reassign(d,y,l,i){if(!e(b))return;const A=e(b).entities.map(m=>c(m,d,y,l)?{...m,repo:i}:m);x(b,{...e(b),entities:A},!0)}}}const B=Ba();var qa=te("<title> </title>"),Za=te('<svg><!><path d="M25 11 23.59 12.41 26.17 15 17 15 17 5.83 19.59 8.41 21 7 16 2 11 7 12.41 8.41 15 5.83 15 15 5.83 15 8.41 12.41 7 11 2 16 7 21 8.41 19.59 5.83 17 15 17 15 26.17 12.41 23.59 11 25 16 30 21 25 19.59 23.59 17 26.17 17 17 26.17 17 23.59 19.59 25 21 30 16 25 11z"></path></svg>');function Ua(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Za();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=qa(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(),s(i),u(b,i),ne()}var Ya=I("<!> <!>",1),Ga=I('<div class="filetypes-list svelte-h7bcrl"><span class="filetype-item svelte-h7bcrl">.md</span> <span class="filetype-label svelte-h7bcrl">Markdown</span> <span class="filetype-item svelte-h7bcrl">.txt</span> <span class="filetype-label svelte-h7bcrl">Plain text</span> <span class="filetype-item svelte-h7bcrl">.csv</span> <span class="filetype-label svelte-h7bcrl">CSV datasets</span> <span class="filetype-item svelte-h7bcrl">.pdf</span> <span class="filetype-label svelte-h7bcrl">PDF documents</span> <span class="filetype-item svelte-h7bcrl">.docx</span> <span class="filetype-label svelte-h7bcrl">Word documents</span> <span class="filetype-item svelte-h7bcrl">.html</span> <span class="filetype-label svelte-h7bcrl">Browser bookmarks</span></div>'),Wa=I("<!> <!>",1),Ja=I('<div class="capture-progress-fill svelte-h7bcrl"></div>'),Ka=I('<span class="capture-progress-count svelte-h7bcrl"> </span>'),Xa=I('<div class="capture-progress svelte-h7bcrl"><div><!></div> <div class="capture-progress-label svelte-h7bcrl"><span class="svelte-h7bcrl"> </span> <!></div></div>'),Qa=I('<div class="capture-loading svelte-h7bcrl"><!> <span class="svelte-h7bcrl">Importing files…</span></div>'),er=I('<div class="capture-empty-message svelte-h7bcrl"> </div>'),tr=I('<button class="capture-reassign-option svelte-h7bcrl"><span class="svelte-h7bcrl"> </span></button>'),ar=I('<div class="capture-reassign-empty svelte-h7bcrl">No other folders</div>'),rr=I('<div class="capture-reassign-label svelte-h7bcrl">Move to…</div> <!>',1),sr=I("<!> <!>",1),nr=I('<div class="capture-entity-actions svelte-h7bcrl"><!> <button class="capture-action-btn capture-action-reject svelte-h7bcrl" title="Reject — delete this entry"><!></button></div>'),ir=I('<div class="capture-entity-card svelte-h7bcrl"><button class="capture-entity-main svelte-h7bcrl"><span class="capture-entity-dot svelte-h7bcrl"></span> <span class="capture-entity-name svelte-h7bcrl"> </span> <span> </span> <!></button> <!></div>'),or=I('<div class="capture-confirmation svelte-h7bcrl"><div class="capture-header svelte-h7bcrl"><span class="capture-check svelte-h7bcrl"><!></span> <button class="capture-dismiss svelte-h7bcrl"><!></button></div> <!> <!></div>'),lr=I('<!> <div class="home svelte-h7bcrl"><div class="home-flow svelte-h7bcrl"><div class="section-greeting svelte-h7bcrl"><h1 class="greeting svelte-h7bcrl"> </h1></div> <!> <!> <div class="section-capture svelte-h7bcrl"><h2 class="section-label svelte-h7bcrl">Add to your workspace</h2> <!> <div class="capture-meta svelte-h7bcrl"><!></div> <!></div></div></div>',1);function Sr(b,n){se(n,!0);const r=gt("chat");ta.showEntity(),Ke(()=>{de.nameLoaded&&!he.loaded&&he.load()}),Ke(()=>{de.nameLoaded&&!_e.loaded&&!_e.loading&&_e.load()});let f=!1;Ke(()=>{if(f||!he.loaded||!de.nameLoaded||St.messages.length>0||he.onboarded&&!he.briefingText)return;f=!0;const t=he.onboarded?"new-day-briefing":"new-user-onboarding";console.debug(`[auto-greet] firing (${t})`,{onboarded:he.onboarded,hasBriefing:!!he.briefingText,greeting:c()}),r.sendPrompt(c(),{silent:!0})});function c(){const t=new Date().getHours(),a=yt.user?.displayName?.split(" ")[0]??"",_=a?`, ${a}`:"";return t<12?`Good morning${_}`:t<17?`Good afternoon${_}`:`Good evening${_}`}let d=oe("");const y=/^https?:\/\/\S+$/i;async function l(){const t=e(d).trim();if(!(!t||B.capturing)){B.setCapturing(!0);try{let a=t;if(y.test(t)){const{apiFetch:w}=await pe(async()=>{const{apiFetch:j}=await import("../chunks/DFYOFE3o.js");return{apiFetch:j}},[],import.meta.url),H=await w("/api/fetch-url",{method:"POST",body:JSON.stringify({url:t})});a=`[Imported from ${H.url}]
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/CqACN7PV.js","../chunks/DsnmJJEf.js","../chunks/txOdadJq.js","../chunks/9gtwoV4P.js","../chunks/BCLL87Av.js","../chunks/BUhjenaJ.js","../chunks/CnvQx_FH.js","../chunks/Ct8o3lkT.js","../chunks/Bx3N1DIh.js","../chunks/BwrgIV17.js","../chunks/CoIXzWkc.js","../chunks/DFYOFE3o.js","../chunks/-wxjF91G.js","../chunks/BbSP3Sm9.js","../chunks/ypcxmEdT.js","../chunks/QFQ05a0D.js","../chunks/DerefRkG.js","../chunks/DpgUPK2a.js","../assets/Toaster.rN8r_Hzv.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as pe}from"../chunks/PPVm8Dsz.js";import"../chunks/DsnmJJEf.js";import{a3 as Et,P as Vt,p as se,t as E,b as ne,c as o,g as e,r as s,h as T,e as oe,s as x,n as ce,f as ge,bp as Rt,u as Z,V as ct,l as X,d as F,a as xe,m as Q,aE as gt,i as Ke}from"../chunks/txOdadJq.js";import{d as Ee,e as Xe,a as u,b as I,g as ve,c as _t,s as R,f as te,t as Fe}from"../chunks/9gtwoV4P.js";import{p as K,i as S,l as ee}from"../chunks/BCLL87Av.js";import{e as Pe,c as St,i as dt}from"../chunks/Ct8o3lkT.js";import{c as Me}from"../chunks/DerefRkG.js";import{b as je,c as Ot,a as ke,d as pt}from"../chunks/ypcxmEdT.js";import{g as tt}from"../chunks/Bx3N1DIh.js";import{V as Lt}from"../chunks/BQ3iDzHp.js";import{B as vt,b as Nt}from"../chunks/BnuL1eJn.js";import{A as Ft}from"../chunks/gYOvQJjM.js";import{A as jt,F as Bt}from"../chunks/Bpy-hqIj.js";import{U as qt,D as Zt,C as Ut}from"../chunks/BtjbqM0h.js";import{k as Yt,u as Gt,l as Wt,t as Jt,m as Kt}from"../chunks/CoIXzWkc.js";import{a as yt}from"../chunks/BbSP3Sm9.js";import{q as Xt,r as Qt,T as ea}from"../chunks/BWrcBDa3.js";import{i as ye}from"../chunks/DpgUPK2a.js";import{w as de}from"../chunks/-wxjF91G.js";import{n as ta}from"../chunks/BwrgIV17.js";import{insightsStore as he}from"../chunks/DsoI6Vso.js";import{u as ut}from"../chunks/ClUQT4C1.js";import{R as aa}from"../chunks/BYjwobCP.js";import{apiFetch as Qe}from"../chunks/DFYOFE3o.js";import{e as ra,f as et}from"../chunks/DD_IjhIj.js";import{A as sa}from"../chunks/RsJJ4HLq.js";import{T as ft,C as mt,R as ht}from"../chunks/BbbskiWe.js";function na(b,n,r){Et(()=>{var f=Vt(()=>n(b,r?.())||{});if(f?.destroy)return()=>f.destroy()})}var ia=I('<div class="home-drop-indicator svelte-1anss1t"><!> <span>Drop files to import</span></div>'),oa=I('<textarea class="home-input-field svelte-1anss1t" rows="4"></textarea> <div class="home-input-actions svelte-1anss1t"><!> <!></div>',1),la=I('<input id="home-file-input" type="file" multiple="" accept=".md,.txt,.csv,.pdf,.docx,.html" style="display:none"/>'),ca=I('<div class="home-input-wrap svelte-1anss1t"><div><!></div> <!></div>');function da(b,n){se(n,!0);let r=K(n,"placeholder",3,"Ask anything about your knowledge graph..."),f=oe(""),c=oe(!1);function d(){const v=e(f).trim();v&&(n.onsubmit(v),x(f,""))}function y(v){v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),d())}function l(v){const k=v.target;k.files?.length&&n.onfiles&&n.onfiles(k.files),k.value=""}function i(v){v.preventDefault(),v.dataTransfer&&(v.dataTransfer.dropEffect="copy"),x(c,!0)}function A(v){const k=v.relatedTarget;k&&v.currentTarget?.contains(k)||x(c,!1)}function m(v){v.preventDefault(),x(c,!1),v.dataTransfer&&n.ondrop&&n.ondrop(v.dataTransfer)}var g=ca(),p=o(g);let M;var G=o(p);{var ie=v=>{var k=ia(),U=o(k);qt(U,{size:20}),ce(2),s(k),u(v,k)},ue=v=>{var k=oa(),U=ge(k);Rt(U);var le=T(U,2),W=o(le);{var J=z=>{vt(z,{variant:"ghost",size:"icon",class:"size-7 home-attach-btn",onclick:()=>document.getElementById("home-file-input")?.click(),children:(re,Te)=>{jt(re,{size:16})},$$slots:{default:!0}})};S(W,z=>{n.onfiles&&z(J)})}var q=T(W,2);{let z=Z(()=>e(f).trim()?"home-send-active":"");vt(q,{variant:"ghost",size:"icon",get class(){return`size-7 home-send-btn ${e(z)??""}`},onclick:d,children:(re,Te)=>{Ft(re,{size:14})},$$slots:{default:!0}})}s(le),E(()=>Ot(U,"placeholder",r())),ve("keydown",U,y),Nt(U,()=>e(f),z=>x(f,z)),u(v,k)};S(G,v=>{e(c)?v(ie):v(ue,!1)})}s(p);var D=T(p,2);{var V=v=>{var k=la();ve("change",k,l),u(v,k)};S(D,v=>{n.onfiles&&v(V)})}s(g),E(()=>M=je(p,1,"home-input svelte-1anss1t",null,M,{"home-input-dragover":e(c)})),Xe("dragover",p,i),Xe("dragleave",p,A),Xe("drop",p,m),u(b,g),ne()}Ee(["keydown","change"]);function pa(){let b=oe(ct([])),n=oe(ct([])),r=oe(!1),f=oe(!1);async function c(){x(r,!0);try{const y=await Yt();x(b,y.openTasks,!0),x(n,y.todaysMeetings,!0),x(f,!0)}catch(y){console.error("Failed to load home data:",y),x(f,!0)}finally{x(r,!1)}}function d(y,l){x(b,e(b).filter(i=>!(i.repo===y&&i.id===l)),!0)}return{get openTasks(){return e(b)},get todaysMeetings(){return e(n)},get loading(){return e(r)},get loaded(){return e(f)},load:c,removeTask:d}}const _e=pa();var va=I('<span class="tasks-count svelte-q21uam"> </span>'),ua=I("<span> </span>"),fa=I('<div class="task-row svelte-q21uam"><!> <button class="task-name svelte-q21uam"> </button> <!></div>'),ma=I('<div class="tasks-section svelte-q21uam"><div class="tasks-header svelte-q21uam"><span class="tasks-title svelte-q21uam"> </span> <!></div> <div class="tasks-list svelte-q21uam"></div></div>');function ha(b,n){se(n,!0);const r={urgent:0,high:1,medium:2,low:3},f=5,c=Z(()=>yt.user?.displayName?.toLowerCase().replace(/\s+/g,"-")??null),d=Z(()=>_e.openTasks),y=Z(()=>e(c)?e(d).filter(D=>D.assignee?.replace(/\[\[|\]\]/g,"")===e(c)):[]),l=Z(()=>e(y).length>0),i=Z(()=>e(l)?e(y):e(d)),A=Z(()=>[...e(i)].sort((D,V)=>{const v=r[D.priority??""]??4,k=r[V.priority??""]??4;return v!==k?v-k:D.dueDate&&V.dueDate?D.dueDate.localeCompare(V.dueDate):D.dueDate?-1:V.dueDate?1:0}).slice(0,f)),m=Z(()=>e(d).length>0);function g(D){if(!D)return"";const V=new Date;V.setHours(0,0,0,0);const v=new Date(D+"T00:00:00"),k=Math.round((v.getTime()-V.getTime())/864e5);return k<0?`${Math.abs(k)}d overdue`:k===0?"Today":k===1?"Tomorrow":`in ${k}d`}function p(D){if(!D)return!1;const V=new Date;return V.setHours(0,0,0,0),new Date(D+"T00:00:00")<V}async function M(D){const V=D.repo;_e.removeTask(V,D.id);try{await Gt(V,"task",D.id,{data:{status:"done"}});const{toast:v}=await pe(async()=>{const{toast:k}=await import("../chunks/CqACN7PV.js");return{toast:k}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);v.success("Task completed")}catch(v){const{toast:k}=await pe(async()=>{const{toast:U}=await import("../chunks/CqACN7PV.js");return{toast:U}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);k.error(v.message??"Failed to update task"),_e.load()}}var G=_t(),ie=ge(G);{var ue=D=>{var V=ma(),v=o(V),k=o(v),U=o(k,!0);s(k);var le=T(k,2);{var W=q=>{var z=va(),re=o(z);s(z),E(()=>R(re,`${e(i).length??""} total`)),u(q,z)};S(le,q=>{e(i).length>f&&q(W)})}s(v);var J=T(v,2);Pe(J,21,()=>e(A),q=>q.repo+"/"+q.id,(q,z)=>{var re=fa(),Te=o(re);Xt(Te,{checked:!1,onCheckedChange:()=>M(e(z))});var be=T(Te,2),Ve=o(be,!0);s(be);var He=T(be,2);{var Be=ze=>{var Ae=ua();let Re;var qe=o(Ae,!0);s(Ae),E((t,a)=>{Re=je(Ae,1,"task-due svelte-q21uam",null,Re,t),R(qe,a)},[()=>({overdue:p(e(z).dueDate)}),()=>g(e(z).dueDate)]),u(ze,Ae)};S(He,ze=>{e(z).dueDate&&ze(Be)})}s(re),E(()=>R(Ve,e(z).title)),ve("click",be,()=>tt(`/${e(z).repo}/task/${e(z).id}`)),u(q,re)}),s(J),s(V),E(()=>R(U,e(l)?"Here’s what’s on your plate":"Tasks across your workspace")),u(D,V)};S(ie,D=>{e(m)&&D(ue)})}u(b,G),ne()}Ee(["click"]);var ga=I('<span class="meeting-time svelte-1q98wxk"> </span>'),_a=I('<span class="meeting-attendees svelte-1q98wxk"> </span>'),ya=I('<button class="meeting-row svelte-1q98wxk"><!> <span class="meeting-name svelte-1q98wxk"> </span> <!></button>'),ba=I('<div class="meetings-section svelte-1q98wxk"><div class="meetings-header svelte-1q98wxk"><span class="meetings-title svelte-1q98wxk">Today’s meetings</span></div> <div class="meetings-list svelte-1q98wxk"></div></div>');function wa(b,n){se(n,!0);const r=Z(()=>_e.todaysMeetings),f=Z(()=>e(r).length>0);function c(m){if(!m||m.length<=10)return"";try{return new Date(m).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}catch{return""}}function d(m){function g(){m.classList.toggle("is-overflowing",m.scrollWidth>m.clientWidth)}g();const p=new ResizeObserver(g);return p.observe(m),{destroy:()=>p.disconnect()}}function y(m){return m?(Array.isArray(m)?m:[m]).map(p=>String(p).replace(/\[\[|\]\]/g,"").replace(/-/g," ").replace(/\b\w/g,M=>M.toUpperCase())).join(", "):""}var l=_t(),i=ge(l);{var A=m=>{var g=ba(),p=T(o(g),2);Pe(p,21,()=>e(r),M=>M.repo+"/"+M.id,(M,G)=>{var ie=ya(),ue=o(ie);{var D=W=>{var J=ga(),q=o(J,!0);s(J),E(z=>R(q,z),[()=>c(e(G).date)]),u(W,J)},V=Z(()=>c(e(G).date));S(ue,W=>{e(V)&&W(D)})}var v=T(ue,2),k=o(v,!0);s(v);var U=T(v,2);{var le=W=>{var J=_a(),q=o(J,!0);s(J),na(J,z=>d?.(z)),E(z=>R(q,z),[()=>y(e(G).attendees)]),u(W,J)};S(U,W=>{e(G).attendees&&W(le)})}s(ie),E(()=>R(k,e(G).title)),ve("click",ie,()=>tt(`/${e(G).repo}/meeting/${e(G).id}`)),u(M,ie)}),s(p),s(g),u(m,g)};S(i,m=>{e(f)&&m(A)})}u(b,l),ne()}Ee(["click"]);var $a=te("<title> </title>"),xa=te('<svg><!><path d="M15 10H17V18H15z"></path><path d="M20 14H22V18H20z"></path><path d="M10 12H12V18H10z"></path><path d="M25,4H17V2H15V4H7A2,2,0,0,0,5,6V20a2,2,0,0,0,2,2h8v6H11v2H21V28H17V22h8a2,2,0,0,0,2-2V6A2,2,0,0,0,25,4Zm0,16H7V6H25Z"></path></svg>');function ka(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=xa();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=$a(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(4),s(i),u(b,i),ne()}var Ta=te("<title> </title>"),Aa=te('<svg><!><path d="M26,14H24v2h2a3.0033,3.0033,0,0,1,3,3v4h2V19A5.0058,5.0058,0,0,0,26,14Z"></path><path d="M24,4a3,3,0,1,1-3,3,3,3,0,0,1,3-3m0-2a5,5,0,1,0,5,5A5,5,0,0,0,24,2Z"></path><path d="M23,30H21V28a3.0033,3.0033,0,0,0-3-3H14a3.0033,3.0033,0,0,0-3,3v2H9V28a5.0059,5.0059,0,0,1,5-5h4a5.0059,5.0059,0,0,1,5,5Z"></path><path d="M16,13a3,3,0,1,1-3,3,3,3,0,0,1,3-3m0-2a5,5,0,1,0,5,5A5,5,0,0,0,16,11Z"></path><path d="M8,14H6a5.0059,5.0059,0,0,0-5,5v4H3V19a3.0033,3.0033,0,0,1,3-3H8Z"></path><path d="M8,4A3,3,0,1,1,5,7,3,3,0,0,1,8,4M8,2a5,5,0,1,0,5,5A5,5,0,0,0,8,2Z"></path></svg>');function Ia(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Aa();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Ta(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(6),s(i),u(b,i),ne()}var Ma=te("<title> </title>"),Ha=te('<svg><!><path d="M22 27.18 19.41 24.59 18 26 22 30 30 22 28.59 20.59 22 27.18z"></path><path d="M15,28H8V4h8v6a2.0058,2.0058,0,0,0,2,2h6v6h2V10a.9092.9092,0,0,0-.3-.7l-7-7A.9087.9087,0,0,0,18,2H8A2.0058,2.0058,0,0,0,6,4V28a2.0058,2.0058,0,0,0,2,2h7ZM18,4.4,23.6,10H18Z"></path></svg>');function za(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Ha();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Ma(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(2),s(i),u(b,i),ne()}var Ca=te("<title> </title>"),Da=te('<svg><!><path d="M30,28.5859l-4.6885-4.6884a8.028,8.028,0,1,0-1.414,1.414L28.5859,30ZM19,25a6,6,0,1,1,6-6A6.0066,6.0066,0,0,1,19,25Z"></path><path d="M2 12H10V14H2z"></path><path d="M2 2H18V4H2z"></path><path d="M2 7H18V9H2z"></path></svg>');function Pa(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Da();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Ca(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(4),s(i),u(b,i),ne()}var Ea=te("<title> </title>"),Va=te('<svg><!><path d="M28,6H4A2,2,0,0,0,2,8V24a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V8A2,2,0,0,0,28,6ZM25.8,8,16,14.78,6.2,8ZM4,24V8.91l11.43,7.91a1,1,0,0,0,1.14,0L28,8.91V24Z"></path></svg>');function Ra(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Va();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Ea(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(),s(i),u(b,i),ne()}var Sa=te("<title> </title>"),Oa=te('<svg><!><path d="M24.5857,6.5859A1.9865,1.9865,0,0,0,23.1714,6H16V2H14V6H6A2.0025,2.0025,0,0,0,4,8v6a2.0025,2.0025,0,0,0,2,2h8V30h2V16h7.1714a1.9865,1.9865,0,0,0,1.4143-.5859L29,11ZM23.1714,14H6V8H23.1716l3,3Z"></path></svg>');function La(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Oa();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=Sa(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(),s(i),u(b,i),ne()}var Na=I('<button class="starter-card svelte-efacsa"><span class="starter-icon svelte-efacsa"><!></span> <span class="starter-title svelte-efacsa"> </span></button>'),Fa=I('<div class="starters-section svelte-efacsa"><div class="starters-header svelte-efacsa"><span class="starters-title svelte-efacsa">Quick actions</span></div> <div class="starters-grid svelte-efacsa"></div></div>');function ja(b,n){se(n,!1);const r=gt("chat"),f=[{title:"Write a proposal",Icon:Zt,prompt:"Help me write a proposal. Ask me about the client and scope, then scaffold it as a document entry."},{title:"Build a presentation",Icon:ka,prompt:"Help me build a presentation. Ask me about the audience and key messages, then scaffold it."},{title:"Create a project brief",Icon:Bt,prompt:"Help me create a project brief. Ask about the client, goals, and timeline, then create a project entry."},{title:"Prepare for a meeting",Icon:Ia,prompt:"Help me prepare for a meeting. Ask who I’m meeting and the goal, then draft an agenda as a meeting entry."},{title:"Summarize a meeting",Icon:za,prompt:"Help me summarize a meeting. Ask me to share the notes or transcript, then create a note with key points and action items."},{title:"Find relevant past work",Icon:Pa,prompt:"Help me find relevant past work. Ask what I’m looking for, then search the workspace and suggest the most relevant entries."},{title:"Pull project references",Icon:Ut,prompt:"Help me pull references for a project. Ask what the project is and what kind of references I’m looking for, then search the workspace and suggest relevant materials."},{title:"Draft an email",Icon:Ra,prompt:"Help me draft an email. Ask who I’m writing to and the purpose, then scaffold the email as a document entry."},{title:"Capture a decision",Icon:La,prompt:"Help me capture a decision. Ask what was decided and the context, then create a decision entry."}];function c(l){r.sendPrompt(l.prompt)}ye();var d=Fa(),y=T(o(d),2);Pe(y,5,()=>f,l=>l.title,(l,i)=>{var A=Na(),m=o(A),g=o(m);e(i).Icon(g,{size:16}),s(m);var p=T(m,2),M=o(p,!0);s(p),s(A),E(()=>R(M,e(i).title)),ve("click",A,()=>c(e(i))),u(l,A)}),s(y),s(d),u(b,d),ne()}Ee(["click"]);function Ba(){let b=oe(null),n=oe(!1),r=oe(!1),f=oe(null);function c(d,y,l,i){return d.repo===y&&d.entityType===l&&d.entityId===i}return{get result(){return e(b)},get capturing(){return e(n)},get importing(){return e(r)},get progress(){return e(f)},set(d){x(b,d,!0)},clear(){x(b,null)},setCapturing(d){x(n,d,!0),d?(x(b,null),x(f,{label:"Sending…",count:0},!0)):x(f,null)},setImporting(d){x(r,d,!0),d&&x(b,null)},setStage(d){e(f)&&x(f,{...e(f),label:d},!0)},bumpCount(){e(f)&&x(f,{...e(f),count:e(f).count+1},!0)},remove(d,y,l){if(!e(b))return;const i=e(b).entities.filter(A=>!c(A,d,y,l));x(b,{...e(b),entities:i},!0)},reassign(d,y,l,i){if(!e(b))return;const A=e(b).entities.map(m=>c(m,d,y,l)?{...m,repo:i}:m);x(b,{...e(b),entities:A},!0)}}}const B=Ba();var qa=te("<title> </title>"),Za=te('<svg><!><path d="M25 11 23.59 12.41 26.17 15 17 15 17 5.83 19.59 8.41 21 7 16 2 11 7 12.41 8.41 15 5.83 15 15 5.83 15 8.41 12.41 7 11 2 16 7 21 8.41 19.59 5.83 17 15 17 15 26.17 12.41 23.59 11 25 16 30 21 25 19.59 23.59 17 26.17 17 17 26.17 17 23.59 19.59 25 21 30 16 25 11z"></path></svg>');function Ua(b,n){const r=ee(n,["children","$$slots","$$events","$$legacy"]),f=ee(r,["size","title"]);se(n,!1);const c=Q(),d=Q();let y=K(n,"size",8,16),l=K(n,"title",8,void 0);X(()=>(F(r),F(l())),()=>{x(c,r["aria-label"]||r["aria-labelledby"]||l())}),X(()=>(e(c),F(r)),()=>{x(d,{"aria-hidden":e(c)?void 0:!0,role:e(c)?"img":void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),xe(),ye();var i=Za();ke(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:y(),height:y(),...e(d),...f}));var A=o(i);{var m=g=>{var p=qa(),M=o(p,!0);s(p),E(()=>R(M,l())),u(g,p)};S(A,g=>{l()&&g(m)})}ce(),s(i),u(b,i),ne()}var Ya=I("<!> <!>",1),Ga=I('<div class="filetypes-list svelte-h7bcrl"><span class="filetype-item svelte-h7bcrl">.md</span> <span class="filetype-label svelte-h7bcrl">Markdown</span> <span class="filetype-item svelte-h7bcrl">.txt</span> <span class="filetype-label svelte-h7bcrl">Plain text</span> <span class="filetype-item svelte-h7bcrl">.csv</span> <span class="filetype-label svelte-h7bcrl">CSV datasets</span> <span class="filetype-item svelte-h7bcrl">.pdf</span> <span class="filetype-label svelte-h7bcrl">PDF documents</span> <span class="filetype-item svelte-h7bcrl">.docx</span> <span class="filetype-label svelte-h7bcrl">Word documents</span> <span class="filetype-item svelte-h7bcrl">.html</span> <span class="filetype-label svelte-h7bcrl">Browser bookmarks</span></div>'),Wa=I("<!> <!>",1),Ja=I('<div class="capture-progress-fill svelte-h7bcrl"></div>'),Ka=I('<span class="capture-progress-count svelte-h7bcrl"> </span>'),Xa=I('<div class="capture-progress svelte-h7bcrl"><div><!></div> <div class="capture-progress-label svelte-h7bcrl"><span class="svelte-h7bcrl"> </span> <!></div></div>'),Qa=I('<div class="capture-loading svelte-h7bcrl"><!> <span class="svelte-h7bcrl">Importing files…</span></div>'),er=I('<div class="capture-empty-message svelte-h7bcrl"> </div>'),tr=I('<button class="capture-reassign-option svelte-h7bcrl"><span class="svelte-h7bcrl"> </span></button>'),ar=I('<div class="capture-reassign-empty svelte-h7bcrl">No other folders</div>'),rr=I('<div class="capture-reassign-label svelte-h7bcrl">Move to…</div> <!>',1),sr=I("<!> <!>",1),nr=I('<div class="capture-entity-actions svelte-h7bcrl"><!> <button class="capture-action-btn capture-action-reject svelte-h7bcrl" title="Reject — delete this entry"><!></button></div>'),ir=I('<div class="capture-entity-card svelte-h7bcrl"><button class="capture-entity-main svelte-h7bcrl"><span class="capture-entity-dot svelte-h7bcrl"></span> <span class="capture-entity-name svelte-h7bcrl"> </span> <span> </span> <!></button> <!></div>'),or=I('<div class="capture-confirmation svelte-h7bcrl"><div class="capture-header svelte-h7bcrl"><span class="capture-check svelte-h7bcrl"><!></span> <button class="capture-dismiss svelte-h7bcrl"><!></button></div> <!> <!></div>'),lr=I('<!> <div class="home svelte-h7bcrl"><div class="home-flow svelte-h7bcrl"><div class="section-greeting svelte-h7bcrl"><h1 class="greeting svelte-h7bcrl"> </h1></div> <!> <!> <div class="section-capture svelte-h7bcrl"><h2 class="section-label svelte-h7bcrl">Add to your workspace</h2> <!> <div class="capture-meta svelte-h7bcrl"><!></div> <!></div></div></div>',1);function Sr(b,n){se(n,!0);const r=gt("chat");ta.showEntity(),Ke(()=>{de.nameLoaded&&!he.loaded&&he.load()}),Ke(()=>{de.nameLoaded&&!_e.loaded&&!_e.loading&&_e.load()});let f=!1;Ke(()=>{if(f||!he.loaded||!de.nameLoaded||St.messages.length>0||he.onboarded&&!he.briefingText)return;f=!0;const t=he.onboarded?"new-day-briefing":"new-user-onboarding";console.debug(`[auto-greet] firing (${t})`,{onboarded:he.onboarded,hasBriefing:!!he.briefingText,greeting:c()}),r.sendPrompt(c(),{silent:!0})});function c(){const t=new Date().getHours(),a=yt.user?.displayName?.split(" ")[0]??"",_=a?`, ${a}`:"";return t<12?`Good morning${_}`:t<17?`Good afternoon${_}`:`Good evening${_}`}let d=oe("");const y=/^https?:\/\/\S+$/i;async function l(){const t=e(d).trim();if(!(!t||B.capturing)){B.setCapturing(!0);try{let a=t;if(y.test(t)){const{apiFetch:w}=await pe(async()=>{const{apiFetch:j}=await import("../chunks/DFYOFE3o.js");return{apiFetch:j}},[],import.meta.url),H=await w("/api/fetch-url",{method:"POST",body:JSON.stringify({url:t})});a=`[Imported from ${H.url}]
|
|
3
3
|
Title: ${H.title}
|
|
4
4
|
|
|
5
|
-
${H.text}`}let _="",h=[];for await(const w of Wt(a))if(w.type==="stage")B.setStage(w.label);else if(w.type==="mutation")B.bumpCount();else if(w.type==="done")_=w.message,h=w.mutations;else if(w.type==="error")throw new Error(w.error);B.set({kind:"capture",entities:h,message:_}),x(d,""),await de.load()}catch(a){const{toast:_}=await pe(async()=>{const{toast:h}=await import("../chunks/
|
|
5
|
+
${H.text}`}let _="",h=[];for await(const w of Wt(a))if(w.type==="stage")B.setStage(w.label);else if(w.type==="mutation")B.bumpCount();else if(w.type==="done")_=w.message,h=w.mutations;else if(w.type==="error")throw new Error(w.error);B.set({kind:"capture",entities:h,message:_}),x(d,""),await de.load()}catch(a){const{toast:_}=await pe(async()=>{const{toast:h}=await import("../chunks/CqACN7PV.js");return{toast:h}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);_.error(a.message??"Capture failed")}finally{B.setCapturing(!1)}}}const i=new Set([".md",".txt",".csv",".pdf",".docx",".html",".jpg",".jpeg",".png",".gif",".webp",".svg"]),A=new Set([".pdf",".docx",".jpg",".jpeg",".png",".gif",".webp",".svg"]);async function m(t){const a="."+t.name.split(".").pop()?.toLowerCase();if(A.has(a)){const _=await t.arrayBuffer(),h=new Uint8Array(_);let w="";for(let H=0;H<h.length;H++)w+=String.fromCharCode(h[H]);return btoa(w)}return t.text()}async function g(t){const a=[];for(const _ of Array.from(t)){const h="."+_.name.split(".").pop()?.toLowerCase();if(!i.has(h))continue;const w=await m(_);a.push({filename:_.name,content:w})}a.length>0&&await ie(a)}async function p(t){if(!t.items?.length&&!t.files?.length)return;const a=await M(t);a.length!==0&&await ie(a)}async function M(t){const a=[],_=[];for(let h=0;h<t.items.length;h++){const w=t.items[h].webkitGetAsEntry?.();w&&_.push(w)}if(_.length>0)await G(_,"",a);else for(const h of Array.from(t.files)){const w="."+h.name.split(".").pop()?.toLowerCase();if(!i.has(w))continue;const H=await m(h);a.push({filename:h.name,content:H})}return a}async function G(t,a,_){for(const h of t){const w=a?`${a}/${h.name}`:h.name;if(h.isDirectory){const H=h.createReader(),j=[];let C;do C=await new Promise(Y=>{H.readEntries(Y)}),j.push(...C);while(C.length>0);await G(j,w,_)}else if(h.isFile){const H="."+h.name.split(".").pop()?.toLowerCase();if(!i.has(H))continue;const j=await new Promise(Y=>{h.file(Y)}),C=await m(j);_.push({filename:w,content:C})}}}async function ie(t){B.setImporting(!0);const a=de.repos[0]?.name;if(!a){const{toast:_}=await pe(async()=>{const{toast:h}=await import("../chunks/CqACN7PV.js");return{toast:h}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);_.error("No folders available"),B.setImporting(!1);return}try{const _=/\.(jpg|jpeg|png|gif|webp|svg)$/i,h=t.filter($=>$.filename.toLowerCase().endsWith(".html")),w=t.filter($=>_.test($.filename)),H=t.filter($=>!$.filename.toLowerCase().endsWith(".html")&&!_.test($.filename));let j=0,C=0,Y=[],L;for(const $ of h)try{const O=await Qe(`/api/repos/${encodeURIComponent(a)}/import-bookmarks`,{method:"POST",body:JSON.stringify({content:$.content})});O.created>0&&(j++,C+=O.created),!L&&O.errors?.length>0&&(L=O.errors[0])}catch(O){L||(L=O.message??"Bookmark import failed")}if(w.length>0)try{const $=await Qe(`/api/repos/${encodeURIComponent(a)}/import-images`,{method:"POST",body:JSON.stringify({files:w})});j+=$.created,C+=$.created,!L&&$.errors?.length>0&&(L=$.errors[0])}catch($){L||(L=$.message??"Image import failed")}if(H.length>0){const $=await Qe(`/api/repos/${encodeURIComponent(a)}/import`,{method:"POST",body:JSON.stringify({files:H,agentDecides:!0})});j+=$.imported,C+=$.entityCount,Y=$.results.map(O=>({...O,repo:a})),!L&&$.errors?.length>0&&(L=$.errors[0])}B.set({kind:"import",entities:Y.filter($=>$.status==="created").map($=>({action:"created",repo:$.repo??a,entityType:$.entityType,entityId:$.entityId})),importedFiles:j,errors:L?[L]:[]}),await de.load();const{toast:fe}=await pe(async()=>{const{toast:$}=await import("../chunks/CqACN7PV.js");return{toast:$}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);if(C>0){const $=h.length>0,O=w.length>0;let ae;$&&!O&&H.length===0?ae=`${C} bookmark${C!==1?"s":""}`:O&&!$&&H.length===0?ae=`${C} image${C!==1?"s":""}`:ae=`${C} ${C===1?"entry":"entries"}`,fe.success(`Imported ${ae}`)}L&&fe.error(L)}catch(_){const{toast:h}=await pe(async()=>{const{toast:w}=await import("../chunks/CqACN7PV.js");return{toast:w}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);h.error(_.message??"Import failed")}finally{B.setImporting(!1)}}async function ue(t){B.remove(t.repo,t.entityType,t.entityId);try{await Kt(t.repo,t.entityType,t.entityId),await de.load()}catch(a){const{toast:_}=await pe(async()=>{const{toast:h}=await import("../chunks/CqACN7PV.js");return{toast:h}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);_.error(a.message??"Could not reject entry")}}async function D(t,a){if(a===t.repo)return;const _=t.repo;B.reassign(t.repo,t.entityType,t.entityId,a);try{await Jt(t.repo,t.entityType,t.entityId,a,"move"),await de.load()}catch(h){B.reassign(a,t.entityType,t.entityId,_);const{toast:w}=await pe(async()=>{const{toast:H}=await import("../chunks/CqACN7PV.js");return{toast:H}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);w.error(h.message??"Could not reassign entry")}}var V=lr(),v=ge(V);Lt(v,{activeView:"home"});var k=T(v,2),U=o(k),le=o(U),W=o(le),J=o(W,!0);s(W),s(le);var q=T(le,2);{var z=t=>{ja(t,{})};S(q,t=>{ut.loaded&&!ut.hideHomeStarters&&t(z)})}var re=T(q,2);{var Te=t=>{var a=Ya(),_=ge(a);wa(_,{});var h=T(_,2);ha(h,{}),u(t,a)};S(re,t=>{_e.loaded&&t(Te)})}var be=T(re,2),Ve=T(o(be),2);da(Ve,{onsubmit:t=>{x(d,t,!0),l()},onfiles:g,ondrop:p,placeholder:"Type a note, paste a URL, or drop a file…"});var He=T(Ve,2),Be=o(He);Me(Be,()=>ht,(t,a)=>{a(t,{children:(_,h)=>{var w=Wa(),H=ge(w);Me(H,()=>ft,(C,Y)=>{Y(C,{class:"filetypes-link",children:(L,fe)=>{ce();var $=Fe("Supported file types");u(L,$)},$$slots:{default:!0}})});var j=T(H,2);Me(j,()=>mt,(C,Y)=>{Y(C,{class:"filetypes-popover",sideOffset:4,align:"start",children:(L,fe)=>{var $=Ga();u(L,$)},$$slots:{default:!0}})}),u(_,w)},$$slots:{default:!0}})}),s(He);var ze=T(He,2);{var Ae=t=>{const a=Z(()=>B.progress);var _=Xa(),h=o(_);let w;var H=o(h);{var j=O=>{var ae=Ja();let we;E(Ze=>we=pt(ae,"",we,Ze),[()=>({width:`${Math.min(100,e(a).count*20)}%`})]),u(O,ae)};S(H,O=>{e(a)&&e(a).count>0&&O(j)})}s(h);var C=T(h,2),Y=o(C),L=o(Y,!0);s(Y);var fe=T(Y,2);{var $=O=>{var ae=Ka(),we=o(ae);s(ae),E(()=>R(we,`· ${e(a).count??""} ${e(a).count===1?"entry":"entries"}`)),u(O,ae)};S(fe,O=>{e(a)&&e(a).count>0&&O($)})}s(C),s(_),E(()=>{w=je(h,1,"capture-progress-bar svelte-h7bcrl",null,w,{indeterminate:!e(a)||e(a).count===0}),R(L,e(a)?.label??"Processing capture…")}),u(t,_)},Re=t=>{var a=Qa(),_=o(a);aa(_,{size:14,class:"animate-spin"}),ce(2),s(a),u(t,a)},qe=t=>{const a=Z(()=>B.result),_=Z(()=>e(a).entities.filter(N=>N.action==="created")),h=Z(()=>e(a).entities.filter(N=>N.action==="updated")),w=Z(()=>e(a).entities.filter(N=>N.action==="deleted"));var H=or(),j=o(H),C=o(j),Y=o(C);{var L=N=>{var P=Fe();E(()=>R(P,`Imported ${e(a).importedFiles??""} ${e(a).importedFiles===1?"file":"files"}`)),u(N,P)},fe=N=>{var P=Fe("Nothing changed");u(N,P)},$=N=>{const P=Z(()=>[e(_).length?`Created ${e(_).length}`:"",e(h).length?`Updated ${e(h).length}`:"",e(w).length?`Deleted ${e(w).length}`:""].filter(Boolean));var me=Fe();E(Ie=>R(me,Ie),[()=>e(P).join(" · ")]),u(N,me)};S(Y,N=>{e(a).kind==="import"?N(L):e(a).entities.length===0?N(fe,1):N($,!1)})}s(C);var O=T(C,2),ae=o(O);Qt(ae,{size:12}),s(O),s(j);var we=T(j,2);{var Ze=N=>{var P=er(),me=o(P,!0);s(P),E(()=>R(me,e(a).message)),u(N,P)};S(we,N=>{e(a).entities.length===0&&e(a).message&&N(Ze)})}var bt=T(we,2);Pe(bt,17,()=>e(a).entities,dt,(N,P)=>{var me=ir(),Ie=o(me),at=o(Ie);let rt;var Ue=T(at,2),wt=o(Ue,!0);s(Ue);var Se=T(Ue,2);let st;var $t=o(Se,!0);s(Se);var xt=T(Se,2);sa(xt,{size:12}),s(Ie);var kt=T(Ie,2);{var Tt=$e=>{var Ce=nr(),Oe=o(Ce);Me(Oe,()=>ht,(It,Mt)=>{Mt(It,{children:(Ht,cr)=>{var nt=sr(),it=ge(nt);Me(it,()=>ft,(Ge,We)=>{We(Ge,{class:"capture-action-btn",title:"Reassign to another folder",children:(Je,Ct)=>{Ua(Je,{size:12})},$$slots:{default:!0}})});var zt=T(it,2);Me(zt,()=>mt,(Ge,We)=>{We(Ge,{class:"capture-reassign-popover",sideOffset:4,align:"end",children:(Je,Ct)=>{var ot=rr(),Dt=T(ge(ot),2);Pe(Dt,17,()=>de.repos.filter(De=>De.name!==e(P).repo),dt,(De,Le)=>{var Ne=tr(),lt=o(Ne),Pt=o(lt,!0);s(lt),s(Ne),E(()=>R(Pt,e(Le).displayName)),ve("click",Ne,()=>D(e(P),e(Le).name)),u(De,Ne)},De=>{var Le=ar();u(De,Le)}),u(Je,ot)},$$slots:{default:!0}})}),u(Ht,nt)},$$slots:{default:!0}})});var Ye=T(Oe,2),At=o(Ye);ea(At,{size:12}),s(Ye),s(Ce),ve("click",Ye,()=>ue(e(P))),u($e,Ce)};S(kt,$e=>{e(P).action!=="deleted"&&$e(Tt)})}s(me),E(($e,Ce,Oe)=>{rt=pt(at,"",rt,$e),R(wt,Ce),st=je(Se,1,"capture-entity-action svelte-h7bcrl",null,st,{amended:e(P).action!=="created"}),R($t,Oe)},[()=>({background:ra(e(P).entityType)}),()=>e(P).entityId.replace(/-/g," ").replace(/\b\w/g,$e=>$e.toUpperCase()),()=>e(P).action==="created"?et(e(P).entityType):e(P).action==="updated"?`Amended · ${et(e(P).entityType)}`:`Deleted · ${et(e(P).entityType)}`]),ve("click",Ie,()=>tt(`/${e(P).repo}/${e(P).entityType}/${e(P).entityId}`)),u(N,me)}),s(H),ve("click",O,()=>B.clear()),u(t,H)};S(ze,t=>{B.capturing?t(Ae):B.importing?t(Re,1):B.result&&t(qe,2)})}s(be),s(U),s(k),E(t=>R(J,t),[c]),u(b,V),ne()}Ee(["click"]);export{Sr as component};
|