pi-roundtable-web 0.30.1 → 0.30.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/chunk-account-xz99gxg8.js +1 -0
- package/dist/{chunk-action-menu-a1vy1se2.js → chunk-action-menu-fsxjfeaq.js} +1 -1
- package/dist/{chunk-agent-adfz539q.js → chunk-agent-bq536p6g.js} +1 -1
- package/dist/chunk-arranged-rooms-y2q330yg.js +1 -0
- package/dist/{chunk-attachments-hbnh1rvq.js → chunk-attachments-s1z9jggf.js} +2 -2
- package/dist/chunk-bulk-actions-je4qp745.js +1 -0
- package/dist/{chunk-character-creator-26fptwb3.js → chunk-character-creator-x8grfnwr.js} +2 -2
- package/dist/{chunk-codeeditor-429q64dw.js → chunk-codeeditor-3vh4q5af.js} +2 -2
- package/dist/{chunk-command-menu-qfpnv4xs.js → chunk-command-menu-2etjx0c7.js} +2 -2
- package/dist/chunk-confirm-wn14ffh3.js +1 -0
- package/dist/{chunk-connectors-04zaaz71.js → chunk-connectors-zxn3tbnv.js} +2 -2
- package/dist/{chunk-conversations-q87kx9w8.js → chunk-conversations-2w67mmvv.js} +1 -1
- package/dist/{chunk-council-sheet-zt24kn9f.js → chunk-council-sheet-b4b04w9y.js} +2 -2
- package/dist/chunk-council-view-wem4vdqc.js +1 -0
- package/dist/{chunk-drag-2vacsw42.js → chunk-drag-r9x782vs.js} +1 -1
- package/dist/{chunk-entry-71pd652j.js → chunk-entry-bq3j0xby.js} +1 -1
- package/dist/chunk-folder-list-bbn6ctsf.js +1 -0
- package/dist/chunk-folds-55w643e1.js +1 -0
- package/dist/{chunk-gate-2gpw5rte.js → chunk-gate-d8deb600.js} +1 -1
- package/dist/chunk-host-icons-knmx5qa0.js +1 -0
- package/dist/chunk-host-picture-42n2n9gp.js +1 -0
- package/dist/chunk-host-state-az2ka7rs.js +1 -0
- package/dist/chunk-host-ui-1s0xyghd.js +1 -0
- package/dist/chunk-index-0xq8m6nw.js +2 -0
- package/dist/chunk-index-1k6n0hh9.js +2 -0
- package/dist/{chunk-index-04ndj4hg.js → chunk-index-1kvnezap.js} +1 -1
- package/dist/{chunk-index-fq7hgc2n.js → chunk-index-25ewnkkb.js} +1 -1
- package/dist/chunk-index-3c4wvjkj.js +2 -0
- package/dist/chunk-index-4fyrpzwf.js +2 -0
- package/dist/{chunk-index-8d5r201w.js → chunk-index-50r5h98m.js} +1 -1
- package/dist/{chunk-index-0cnvzj8b.js → chunk-index-5j6m33d2.js} +1 -1
- package/dist/chunk-index-5x86qy8d.js +2 -0
- package/dist/{chunk-index-r1g24er0.js → chunk-index-63qqjbs8.js} +2 -2
- package/dist/{chunk-index-g086dss5.js → chunk-index-6btfp80d.js} +3 -3
- package/dist/{chunk-index-dqt0s3cq.js → chunk-index-6r61x1d2.js} +2 -2
- package/dist/{chunk-index-5rv9r0m6.js → chunk-index-711j3dpr.js} +2 -2
- package/dist/{chunk-index-s2ksy9pa.js → chunk-index-7379m5yw.js} +2 -2
- package/dist/{chunk-index-xzey5tdw.js → chunk-index-7wksnc48.js} +2 -2
- package/dist/{chunk-index-ndhwytvz.js → chunk-index-9hb4042t.js} +1 -1
- package/dist/{chunk-index-bz4y6vne.js → chunk-index-9smnxvd0.js} +2 -2
- package/dist/{chunk-index-mec7bz30.js → chunk-index-ab60h2c5.js} +1 -1
- package/dist/{chunk-index-pz6926p5.js → chunk-index-apbknsyg.js} +2 -2
- package/dist/{chunk-index-ne8v2rxx.js → chunk-index-b093s676.js} +12 -12
- package/dist/chunk-index-b5924bb7.js +2 -0
- package/dist/chunk-index-bdf7gs56.js +2 -0
- package/dist/chunk-index-d0vznz2x.js +2 -0
- package/dist/{chunk-index-6e9nmad3.js → chunk-index-de5x85yn.js} +2 -2
- package/dist/chunk-index-e6z5kyz8.js +2 -0
- package/dist/chunk-index-evmzrr8e.js +2 -0
- package/dist/chunk-index-fdv6mepk.js +2 -0
- package/dist/chunk-index-ff8vzfgq.js +2 -0
- package/dist/chunk-index-hd7k712z.js +2 -0
- package/dist/{chunk-index-1pgm1gy4.js → chunk-index-hrpmm09c.js} +2 -2
- package/dist/{chunk-index-st18ee4w.js → chunk-index-htdkpbrd.js} +17 -17
- package/dist/{chunk-index-vxn4zws9.js → chunk-index-jsgs2gmq.js} +3 -3
- package/dist/{chunk-index-1ysj78e4.js → chunk-index-kjxva289.js} +1 -1
- package/dist/{chunk-index-g7w60s9y.js → chunk-index-kkcx4bns.js} +2 -2
- package/dist/{chunk-index-pp00qvdb.js → chunk-index-kvvmxbyh.js} +1 -1
- package/dist/{chunk-index-c035z7b4.js → chunk-index-mcb21c5a.js} +2 -2
- package/dist/chunk-index-n1w5rpxz.js +2 -0
- package/dist/{chunk-index-m7er2xt6.js → chunk-index-n7187vns.js} +2 -2
- package/dist/{chunk-index-435pq3gd.js → chunk-index-nk38jsgf.js} +1 -1
- package/dist/chunk-index-q6txr5q7.js +2 -0
- package/dist/{chunk-index-g1t5rfbe.js → chunk-index-r868k92r.js} +3 -3
- package/dist/{chunk-index-ry2p6s1f.js → chunk-index-rj8cvc66.js} +1 -1
- package/dist/{chunk-index-tn797j5g.js → chunk-index-rny986v2.js} +1 -1
- package/dist/{chunk-index-awc03q99.js → chunk-index-s6a9rvgd.js} +2 -2
- package/dist/{chunk-index-jzkr4hc2.js → chunk-index-sjt00y5k.js} +2 -2
- package/dist/{chunk-index-qzss6deb.js → chunk-index-sp35q2ay.js} +1 -1
- package/dist/{chunk-index-pcb3mskd.js → chunk-index-t9an6yb2.js} +2 -2
- package/dist/{chunk-index-0kwxrths.js → chunk-index-tc8s2rz3.js} +1 -1
- package/dist/chunk-index-tn9qzrj2.js +2 -0
- package/dist/{chunk-index-6y114be2.js → chunk-index-vgn794d7.js} +2 -2
- package/dist/{chunk-index-6gj4xkf7.js → chunk-index-vvxr0vz8.js} +1 -1
- package/dist/{chunk-index-9q2psqsq.js → chunk-index-w0vfwqck.js} +2 -2
- package/dist/{chunk-index-6j75embz.js → chunk-index-w1rarv3r.js} +2 -2
- package/dist/chunk-index-xfr1byr9.js +1 -0
- package/dist/{chunk-index-smvd91qx.js → chunk-index-xj1960qj.js} +2 -2
- package/dist/chunk-index-xwnkf825.js +2 -0
- package/dist/{chunk-index-cx9f5fae.js → chunk-index-y37ffyvy.js} +3 -3
- package/dist/{chunk-index-tqrjr37v.js → chunk-index-yrr5wvja.js} +2 -2
- package/dist/{chunk-index-2k2jvegd.js → chunk-index-z1fvb2kq.js} +3 -3
- package/dist/chunk-index-zwfdwgnb.js +138 -0
- package/dist/chunk-lang-css-nt7ezre4.js +1 -0
- package/dist/{chunk-lang-dockerfile-9rc0adjw.js → chunk-lang-dockerfile-4422dqj4.js} +1 -1
- package/dist/{chunk-lang-go-t47kg9n0.js → chunk-lang-go-1n73q49t.js} +1 -1
- package/dist/chunk-lang-html-p4yg906g.js +1 -0
- package/dist/chunk-lang-javascript-yqkd14sv.js +1 -0
- package/dist/{chunk-lang-json-y33kawwg.js → chunk-lang-json-zm1ts7s7.js} +1 -1
- package/dist/{chunk-lang-markdown-2c2sqc4z.js → chunk-lang-markdown-3cv6a1mc.js} +2 -2
- package/dist/{chunk-lang-python-ymasvj52.js → chunk-lang-python-ba7s8q8w.js} +1 -1
- package/dist/{chunk-lang-rust-qcg53mkn.js → chunk-lang-rust-gx2hj5cw.js} +1 -1
- package/dist/{chunk-lang-shell-996wb0dk.js → chunk-lang-shell-ec7k63jq.js} +1 -1
- package/dist/{chunk-lang-sql-60rh2y3y.js → chunk-lang-sql-svdp20tw.js} +1 -1
- package/dist/{chunk-lang-toml-q1yzt70y.js → chunk-lang-toml-nj3sefw0.js} +1 -1
- package/dist/chunk-lang-typescript-84y9c0f8.js +1 -0
- package/dist/{chunk-lang-xml-k2a92cm3.js → chunk-lang-xml-jzdsx03j.js} +1 -1
- package/dist/{chunk-lang-yaml-qp3asq06.js → chunk-lang-yaml-deh87m32.js} +1 -1
- package/dist/chunk-layout-actions-x0xxb5da.js +1 -0
- package/dist/{chunk-mention-menu-ag4gpcrb.js → chunk-mention-menu-b1k1tm6b.js} +1 -1
- package/dist/chunk-menu-items-2meta18j.js +1 -0
- package/dist/chunk-mode-toggle-7a44994f.js +1 -0
- package/dist/{chunk-note-row-wt0e0xgx.js → chunk-note-row-pab6wtf0.js} +3 -3
- package/dist/{chunk-notes-jd0ftn0y.js → chunk-notes-m0sjp2ct.js} +1 -1
- package/dist/{chunk-notice-bell-b71028rq.js → chunk-notice-bell-s15pgaw3.js} +1 -1
- package/dist/chunk-notices-zs8xg8v8.js +1 -0
- package/dist/{chunk-onboarding-fzz1x8vk.js → chunk-onboarding-sddzxrw5.js} +1 -1
- package/dist/{chunk-overview-whbzyq7x.js → chunk-overview-gkf6vfks.js} +1 -1
- package/dist/chunk-palette-m6bkdz1w.js +1 -0
- package/dist/chunk-placement-items-cb66mx65.js +1 -0
- package/dist/{chunk-profile-t5kyp6dt.js → chunk-profile-mvj96kv6.js} +1 -1
- package/dist/{chunk-prompt-history-cpejc2ce.js → chunk-prompt-history-mffm0c56.js} +1 -1
- package/dist/{chunk-prompts-am1gv3rx.js → chunk-prompts-26ey03ak.js} +1 -1
- package/dist/chunk-room-confirms-1j8qfyj9.js +1 -0
- package/dist/{chunk-room-menu-6swnygxx.js → chunk-room-menu-6myvrac1.js} +1 -1
- package/dist/chunk-rooms-menu-button-3cnm8wdd.js +1 -0
- package/dist/{chunk-schedules-y982gtmy.js → chunk-schedules-gjfm0x30.js} +1 -1
- package/dist/{chunk-seat-menu-2zhkhhav.js → chunk-seat-menu-neps7phz.js} +1 -1
- package/dist/chunk-section-fold-pgrjf74t.js +1 -0
- package/dist/{chunk-settings-p7rnj58y.js → chunk-settings-aa212bna.js} +1 -1
- package/dist/{chunk-sheet-hosts-n4y4b923.js → chunk-sheet-hosts-xwtaf228.js} +2 -2
- package/dist/{chunk-shortcut-help-nsspdnr8.js → chunk-shortcut-help-aaat3wrh.js} +2 -2
- package/dist/{chunk-shortcuts-2jsfcp8d.js → chunk-shortcuts-wt9x6qd6.js} +1 -1
- package/dist/{chunk-skill-editor-641sd772.js → chunk-skill-editor-4jkr948n.js} +2 -2
- package/dist/{chunk-skills-4h0sg7n3.js → chunk-skills-87rvtwt1.js} +1 -1
- package/dist/{chunk-start-over-line-en9pph7r.js → chunk-start-over-line-59zn5ekf.js} +2 -2
- package/dist/chunk-switcher-list-43n1vf29.js +1 -0
- package/dist/{chunk-tab-dot-jrv4g9we.js → chunk-tab-dot-773bfgn1.js} +1 -1
- package/dist/chunk-table-1ghv10s7.js +1 -0
- package/dist/{chunk-table2d-k4z439nt.js → chunk-table2d-4k5n9dxy.js} +1 -1
- package/dist/{chunk-table3d-9d3rwkwv.js → chunk-table3d-cwmxe12d.js} +21 -21
- package/dist/chunk-thread-actions-dd9ah02w.js +1 -0
- package/dist/{chunk-thread-cards-6tftqnrw.js → chunk-thread-cards-qs242xk1.js} +1 -1
- package/dist/{chunk-thread-list-wzwzbxx5.js → chunk-thread-list-qxymkzs9.js} +2 -2
- package/dist/{chunk-transcript-d9sfpsde.js → chunk-transcript-sjra3d3m.js} +1 -1
- package/dist/{chunk-waiting-chip-pq7cgh62.js → chunk-waiting-chip-yq3485cq.js} +2 -2
- package/dist/chunk-waiting-xmy1cyk1.js +1 -0
- package/dist/chunk-where-m6ss9smq.js +1 -0
- package/dist/{chunk-workspace-tb29dr0g.js → chunk-workspace-jt68gwza.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-account-95rkb2fp.js +0 -1
- package/dist/chunk-arranged-rooms-xjpg0rtg.js +0 -1
- package/dist/chunk-bulk-actions-m38vtkan.js +0 -1
- package/dist/chunk-confirm-t08tacqd.js +0 -1
- package/dist/chunk-council-view-m3660jv4.js +0 -1
- package/dist/chunk-folder-list-rpccjz2c.js +0 -1
- package/dist/chunk-folds-qb9a87bf.js +0 -1
- package/dist/chunk-host-icons-vhhks1vc.js +0 -1
- package/dist/chunk-host-picture-b8wne78x.js +0 -1
- package/dist/chunk-host-state-j9d5bfng.js +0 -1
- package/dist/chunk-host-ui-zy96k6pv.js +0 -1
- package/dist/chunk-index-0pghg70x.js +0 -2
- package/dist/chunk-index-20h87yfa.js +0 -2
- package/dist/chunk-index-2srjhjvg.js +0 -2
- package/dist/chunk-index-2ywap2mg.js +0 -2
- package/dist/chunk-index-4e5nhm4v.js +0 -2
- package/dist/chunk-index-4ehy2d04.js +0 -2
- package/dist/chunk-index-5n8npdch.js +0 -2
- package/dist/chunk-index-8k1ccvmx.js +0 -1
- package/dist/chunk-index-90f1mkn7.js +0 -138
- package/dist/chunk-index-90tq8g68.js +0 -2
- package/dist/chunk-index-92p9wmrg.js +0 -2
- package/dist/chunk-index-a36h36x0.js +0 -2
- package/dist/chunk-index-dafr7y87.js +0 -2
- package/dist/chunk-index-fnmtztjx.js +0 -2
- package/dist/chunk-index-pmtgrd3x.js +0 -2
- package/dist/chunk-index-qjqxs7c3.js +0 -2
- package/dist/chunk-index-r9yg1hpr.js +0 -2
- package/dist/chunk-index-w51vgeed.js +0 -2
- package/dist/chunk-index-wk3w90nq.js +0 -2
- package/dist/chunk-lang-css-6t2q4xw4.js +0 -1
- package/dist/chunk-lang-html-c6p22v5m.js +0 -1
- package/dist/chunk-lang-javascript-m57t19pw.js +0 -1
- package/dist/chunk-lang-typescript-7gcbrhbd.js +0 -1
- package/dist/chunk-layout-actions-6vm38ver.js +0 -1
- package/dist/chunk-menu-items-fk3m74y3.js +0 -1
- package/dist/chunk-mode-toggle-zy1wgyc7.js +0 -1
- package/dist/chunk-notices-qhghsyh5.js +0 -1
- package/dist/chunk-palette-dgf96b8y.js +0 -1
- package/dist/chunk-placement-items-e0bfeqj4.js +0 -1
- package/dist/chunk-room-confirms-a3m74jfg.js +0 -1
- package/dist/chunk-rooms-menu-button-ret11jfe.js +0 -1
- package/dist/chunk-section-fold-h1fpkayc.js +0 -1
- package/dist/chunk-switcher-list-pr884et3.js +0 -1
- package/dist/chunk-table-g56wwdmh.js +0 -1
- package/dist/chunk-thread-actions-y30fzpje.js +0 -1
- package/dist/chunk-waiting-emww5evj.js +0 -1
- package/dist/chunk-where-e7we9q52.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{To,Po,Qo}from"./chunk-index-sjt00y5k.js";import"./chunk-index-711j3dpr.js";export{Po as clearAcross,Qo as clearFinished,To as dismissThread};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,_e,Oe,Pn,
|
|
1
|
+
import{t,_e,Oe,Pn,sa,qi,kr}from"./chunk-index-htdkpbrd.js";import{To,Qo}from"./chunk-index-sjt00y5k.js";import{oo}from"./chunk-index-n7187vns.js";import"./chunk-index-711j3dpr.js";var E=12,R=24,y=180,L=150,C=100,w=".thread-card",h=".thread-group",g=(e)=>e instanceof Element?e.closest(w):null,B=(e)=>e.closest("li"),m=(e)=>e.dataset.closed==="",I=(e)=>new Promise((i)=>setTimeout(i,e));function X(e){return[...e.closest(h)?.querySelectorAll(`${w}[data-closed]`)??[]].flatMap((n)=>n.dataset.thread?[n.dataset.thread]:[])}function q(e){let i=B(e);if(delete e.dataset.armed,e.style.transition="",e.style.transform="",e.style.opacity="",i)i.style.transition="",i.style.height="",i.style.marginBottom="",i.style.opacity=""}async function F(e){let i=B(e);if(!i||_e())return;e.dataset.leaving="",e.style.transition=`transform ${y}ms var(--ease-out), opacity ${y}ms var(--ease-out)`,e.style.transform="translate3d(110%, 0, 0)",e.style.opacity="0",await I(y),i.style.height=`${i.offsetHeight}px`,i.getBoundingClientRect(),i.style.transition=`height ${L}ms var(--ease-out), margin-bottom ${L}ms var(--ease-out)`,i.style.height="0px",i.style.marginBottom="calc(var(--space-1) * -1)",await I(L)}function _(e){let i=[...e.closest(h)?.querySelectorAll(`${w} .thread-link`)??[]],n=e.querySelector(".thread-link"),o=n?i.indexOf(n):-1;if(document.activeElement&&!e.contains(document.activeElement))return;(i[o+1]??i[o-1]??e.closest(h)?.querySelector("summary"))?.closest("a, summary")?.focus()}async function T(e){let i=e.dataset.thread;if(!i||!m(e)||e.dataset.leaving!==void 0)return;if(_(e),await F(e),!await To(i))q(e);delete e.dataset.leaving}function M(e,i,n){let o=[];if(m(e))o.push({id:"clear",label:t("Clear this thread"),icon:"trash",tone:"danger",run:()=>T(e)});let l=X(e),f=e.closest(h)?.dataset.parent||void 0;if(l.length>0)o.push({id:"clear-all",label:t("Clear all finished"),icon:"trash",tone:"danger",run:()=>Qo(f,l)});Oe({title:e.querySelector(".thread-title")?.textContent??"",items:o,at:i,via:n,source:e.querySelector(".thread-link")??e})}var O=(e)=>{if(e.cancelable)e.preventDefault()};function W(e,i){let n=e.at(-1);if(!n||i-n.t>C)return 0;let o=e.find((l)=>n.t-l.t<=C);if(!o||n.t<=o.t)return 0;return(n.x-o.x)/(n.t-o.t)}function z(e){let i=oo(),n,o=!1,l=()=>{n?.press.cancel(),window.removeEventListener("touchmove",O),n=void 0},f=(s)=>{if(o=!1,s.pointerType==="mouse"||!s.isPrimary)return;let r=g(s.target);if(!r||s.target.closest(".thread-more"))return;l();let a={x:s.clientX,y:s.clientY},c=new Pn((d)=>{if(o=!0,typeof navigator.vibrate==="function")navigator.vibrate(10);if(n)n.state="reject";v(r),M(r,d,"hold")});c.begin(a.x,a.y),n={id:s.pointerId,card:r,origin:a,press:c,swipes:!qi(a.x,window.innerWidth),state:"wait",offset:0,samples:[{x:a.x,t:s.timeStamp}]}},v=(s)=>{if(s.dataset.leaving!==void 0)return;delete s.dataset.armed,s.style.transition=`transform ${_e()?0:y}ms var(--ease-out)`,s.style.transform=""},x=(s)=>{if(!n||n.id!==s.pointerId)return;let{card:r}=n,a=s.clientX-n.origin.x,c=s.clientY-n.origin.y;if(n.state==="wait"){n.press.move(s.clientX,s.clientY);let p=Math.abs(a);if(!n.swipes)return;if(p>=E&&p>sa*Math.abs(c)){if(n.state=a>0?"drag":"reject",n.state==="drag")n.press.cancel(),r.style.transition="none",window.addEventListener("touchmove",O,{passive:!1})}else if(Math.abs(c)>=E)n.state="reject";if(n.state!=="drag")return}if(n.state!=="drag")return;let d=Math.max(0,a-E),u=r.offsetWidth||1;if(n.offset=m(r)?Math.min(d,u):Math.min(R,d*0.3),n.samples.push({x:s.clientX,t:s.timeStamp}),r.style.transform=`translate3d(${n.offset}px, 0, 0)`,m(r))if(kr(n.offset/u,0))r.dataset.armed="";else delete r.dataset.armed},H=(s)=>{if(!n||n.id!==s.pointerId)return;let{card:r,state:a,offset:c,samples:d}=n,u=n.press.end();if(l(),u)o=!0;if(a!=="drag")return;o=!0;let p=r.offsetWidth||1,A=W(d,s.timeStamp);if(m(r)&&c>E&&kr(c/p,A))T(r);else v(r)},b=(s)=>{if(!n||n.id!==s.pointerId)return;let{card:r,state:a}=n;if(l(),a==="drag")v(r)},S=(s)=>{let r=g(s.target);if(!r)return;if(s.preventDefault(),o)return;n?.press.cancel(),M(r,{x:s.clientX,y:s.clientY},"contextmenu")},P=(s)=>{o=!1;let r=g(s.target);if(!r)return;if(s.key==="Delete"&&m(r))s.preventDefault(),T(r);else if(s.key==="ContextMenu"||s.key==="F10"&&s.shiftKey){s.preventDefault();let a=r.getBoundingClientRect();M(r,{x:a.left+Math.min(a.width/2,48),y:a.top+24},"key")}},k=(s)=>{if(!o)return;o=!1,s.preventDefault(),s.stopPropagation()},D=(s)=>{if(g(s.target))s.preventDefault()};return e.addEventListener("pointerdown",f),e.addEventListener("pointermove",x),e.addEventListener("pointerup",H),e.addEventListener("pointercancel",b),e.addEventListener("contextmenu",S),e.addEventListener("keydown",P),e.addEventListener("click",k,!0),e.addEventListener("dragstart",D),()=>{l(),i(),e.removeEventListener("pointerdown",f),e.removeEventListener("pointermove",x),e.removeEventListener("pointerup",H),e.removeEventListener("pointercancel",b),e.removeEventListener("contextmenu",S),e.removeEventListener("keydown",P),e.removeEventListener("click",k,!0),e.removeEventListener("dragstart",D)}}export{z as attachThreadCards,M as openCardMenu};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p,ee,o,a,t,F,g,e,n,s,x,
|
|
1
|
+
import{p,ee,o,a,t,F,g,e,n,s,x,l,P,_,Te,te,vr,Ne,on,li,$n,Dt}from"./chunk-index-htdkpbrd.js";var C="roundtable-console:helpers-folded";function z(){try{let i=localStorage.getItem(C),r=i?JSON.parse(i):{};if(typeof r!=="object"||r===null||Array.isArray(r))return{};return Object.fromEntries(Object.entries(r).filter((d)=>typeof d[1]==="boolean"))}catch{return{}}}var N,{emit:O,use:I}=P(),H=()=>(N??=z(),N);function E(i,r){return I(H)[i]??!r}function L(i,r){N={...H(),[i]:r};try{localStorage.setItem(C,JSON.stringify(N))}catch{}O()}var T=!1;function D(){if(T||typeof document>"u")return;if(T=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let r=new CSSStyleSheet;r.replaceSync(`
|
|
2
2
|
.helper-group {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -224,4 +224,4 @@ import{p,ee,o,a,t,F,g,e,n,s,x,u,P,_,Te,te,br,$e,on,li,$n,Dt}from"./chunk-index-s
|
|
|
224
224
|
animation: none;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
`,document.head.append(i)}D();var M=ee(function(r){let{view:
|
|
227
|
+
`,document.head.append(i)}D();var M=ee(function(r){let{view:d}=r,m=d.helper?.finished===!0;return e("li",{children:n("a",{className:"helper-link",href:x("room",d.key),"data-helper":d.name,"data-finished":m?"":void 0,"aria-current":r.active?"page":void 0,children:[e(Ne,{view:d,size:20}),e("strong",{children:d.displayName}),e(on,{room:d.key}),n("span",{className:"helper-state",children:[r.waiting?e($n,{count:r.waiting}):null,!m&&!r.waiting?e("span",{className:"helper-dot",role:"img","aria-label":t("Working")}):null,m?e("span",{children:t("Ended")}):null,m&&r.at?e("span",{className:"room-row-time",children:Te(r.at,r.now,r.timeZone)}):null]})]})})});function Z(i){let{now:r}=te(),{timeZone:d}=_(),m=Dt(i.keys),w=m.some((h)=>h.view.helper?.finished!==!0),u=i.parent??"",v=!E(u,w)||m.some((h)=>h.key===i.active)?m:[];if(m.length===0)return null;return n("div",{className:"helper-group","data-parent":i.parent,children:[e("button",{type:"button",className:"helper-head","aria-expanded":v.length>0,onClick:()=>L(u,v.length>0),children:F(m.length,"{count} temp knight","{count} temp knights")}),v.length>0?e("ul",{className:"helper-list",children:v.map(({key:h,...y})=>e(M,{...y,active:h===i.active,now:r,timeZone:d},h))}):null]})}var A=ee(function(r){let{view:d,parent:m}=r,w=vr(d.key),u=Boolean(d.closed);return n("li",{className:"thread-item",children:[u?n("span",{className:"thread-reveal","aria-hidden":"true",children:[e(s,{name:"trash",size:18}),t("Clear")]}):null,n("div",{className:"thread-card","data-hold":"row","data-thread":d.key,"data-closed":u?"":void 0,style:w,children:[n("a",{className:"thread-link",href:x("room",d.key),"aria-current":r.active?"page":void 0,children:[m?e(Ne,{view:m,size:36}):e(s,{name:"conversations",size:20,className:"thread-row-icon"}),n("span",{className:"thread-card-main",children:[n("span",{className:"thread-card-top",children:[e("strong",{className:"thread-title",children:d.displayName}),e(on,{room:d.key})]}),n("span",{className:"thread-card-meta",children:[r.typing?e(li,{}):null,e("span",{className:u?"badge":"badge badge-accent",children:u?t("Finished"):t("In progress")}),r.waiting?e($n,{count:r.waiting}):null,e("span",{className:"room-row-time",children:r.at?Te(r.at,r.now,r.timeZone):""})]})]})]}),u?e("button",{type:"button",className:"thread-more","aria-haspopup":"menu","aria-label":t("More actions for {name}",{name:d.displayName}),onClick:(f)=>{let v=f.currentTarget,h=v.closest(".thread-card"),y=v.getBoundingClientRect();if(h)(p("qs242xk1"),import("./chunk-thread-cards-qs242xk1.js")).then((k)=>k.openCardMenu(h,{x:y.right,y:y.bottom},"key"))},children:e(s,{name:"more",size:18})}):null]})]})});function B(i){let{now:r}=te(),{timeZone:d}=_(),m=Dt(i.open),w=m.filter((c)=>c.view.helper).map((c)=>c.key),u=m.filter((c)=>!c.view.helper),f=Dt(i.closed),v=l((c)=>i.parent?c.rooms[i.parent]?.view:void 0,i.parent??""),h=a(null),y=u.length+f.length>0;if(o(()=>{let c=h.current;if(!y||!c)return;let b=!1,S;return (p("qs242xk1"),import("./chunk-thread-cards-qs242xk1.js")).then((R)=>{if(!b)S=R.attachThreadCards(c)}),()=>{b=!0,S?.()}},[y]),!y&&w.length===0)return null;let k=({key:c,...b})=>e(A,{...b,active:c===i.active,now:r,timeZone:d,parent:v},c);if(!y)return e(Z,{keys:w,parent:i.parent,active:i.active});return n(g,{children:[w.length?e(Z,{keys:w,parent:i.parent,active:i.active}):null,n("div",{className:"thread-group",ref:h,"data-parent":i.parent,children:[u.length?e("ul",{className:"thread-list","aria-label":t("Dispatch threads"),children:u.map(k)}):null,f.length?n("div",{className:"thread-finished",children:[n("details",{className:"thread-closed",...f.some((c)=>c.key===i.active)?{open:!0}:{},children:[e("summary",{children:F(f.length,"{count} finished thread","{count} finished threads")}),e("ul",{className:"thread-list",children:f.map(k)})]}),e("button",{type:"button",className:"thread-clear",onClick:()=>(p("dd9ah02w"),import("./chunk-thread-actions-dd9ah02w.js")).then((c)=>c.clearFinished(i.parent,f.map((b)=>b.key))),children:t("Clear finished")})]}):null]})]})}export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o,R,a,r,t,
|
|
1
|
+
import{o,R,a,r,t,u,g,e,n,x,y,S,m,k,Q,_,oe,Ui}from"./chunk-index-htdkpbrd.js";import{ke}from"./chunk-index-5j6m33d2.js";import{Ae}from"./chunk-index-6btfp80d.js";function P({conversationKey:s}){let[c,v]=r(),p=R(),d=a(!1),{data:i,error:h}=ke(()=>y.transcript(s,c),`${s}|${c??""}`);o(()=>{if(i&&!d.current)d.current=!0,window.scrollTo(0,document.body.scrollHeight)},[i]);let N=n("a",{className:"back",href:x("conversations"),children:["← ",t("Conversations")]});if(!i)return n(g,{children:[N,h?e(m,{message:h}):e(S,{})]});let{conversation:f}=i,T=f.kind==="outside"?t("Outside AI client · {id}",{id:f.id.slice(0,8)}):Ui(f);return n(g,{children:[N,n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:T}),f.busy>0?e(Q,{tone:"busy",children:t("running")}):null]}),i.archives.length>0?n("label",{className:"inline",htmlFor:p,children:[t("Showing")," ",n(Ae,{id:p,value:c??"",onChange:(l)=>{d.current=!1,v(l.target.value||void 0)},children:[e("option",{value:"",children:t("Current conversation")}),i.archives.map((l)=>e("option",{value:l,children:t("Archived {name}",{name:l})},l))]})]}):null,h?e(m,{message:h}):null,i.truncated?e("p",{className:"hint",children:t("This conversation is longer than the console reads; the oldest entries are not shown.")}):null,i.entries.length===0?e(k,{children:t("Nothing to show.")}):null,e("ol",{className:"transcript",children:i.entries.map((l,w)=>e(E,{entry:l},w))})]})]})}function E({entry:s}){let{timeZone:c}=_(),v=s.at?oe(s.at,c):"";if(s.role==="tool")return e("li",{className:"entry entry-tool",children:n("details",{children:[n("summary",{children:[s.failed?t("Tool failed"):t("Tool result"),s.tool?` · ${s.tool}`:""]}),e("pre",{children:s.text||t("(empty)")})]})});return n("li",{className:`entry entry-${s.role}`,children:[n("div",{className:"entry-head",children:[e("span",{className:"role",children:t(b[s.role])}),e("span",{className:"meta",children:v})]}),s.text?e("p",{className:"text",children:s.text}):null,s.calls?.map((p,d)=>n("code",{className:"call",children:[p.name," ",p.preview]},d))]})}var b={user:u("User"),assistant:u("Knight"),tool:u("Tool"),compaction:u("Summary of earlier conversation")};export{P as TranscriptPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o,r,F,e,n,s,
|
|
1
|
+
import{o,r,F,e,n,s,l}from"./chunk-index-htdkpbrd.js";import{pn,Gr,Zr,Ti,ar}from"./chunk-index-1k6n0hh9.js";import{B}from"./chunk-index-fw6kawhw.js";var M=1500,E=`
|
|
2
2
|
.waiting-chip-slot {
|
|
3
3
|
position: relative;
|
|
4
4
|
z-index: 3;
|
|
@@ -29,4 +29,4 @@ import{o,r,F,e,n,s,u}from"./chunk-index-st18ee4w.js";import{pn,Fr,Gr,_i,sr}from"
|
|
|
29
29
|
outline-offset: 3px;
|
|
30
30
|
transition: outline-color var(--dur-slow) var(--ease-out);
|
|
31
31
|
}
|
|
32
|
-
`;function I(S){B("waiting",E);let{roomKey:b,scroller:p,loaded:w}=S,c=
|
|
32
|
+
`;function I(S){B("waiting",E);let{roomKey:b,scroller:p,loaded:w}=S,c=l((t)=>pn(t).filter((a)=>a.card.room===b).map((a)=>a.id).join(" "),b),d=Gr(),[T,y]=r([]);o(()=>{let t=p.current;if(!t||!w||typeof IntersectionObserver>"u")return;let a=new Map,m=new IntersectionObserver((u)=>{for(let i of u){let f=i.target.dataset.card;if(f)a.set(f,i.isIntersecting)}y([...a].flatMap(([i,f])=>f?[]:[i]))},{root:t});for(let u of c.split(" ")){let i=u?Ti(t,u):void 0;if(i)m.observe(i)}return()=>m.disconnect()},[c,p,w]),o(()=>{let t=p.current;if(!t||!w||!d||!c.split(" ").includes(d))return;let a,m=()=>{let g=Ti(t,d);if(!g||g===a)return;a=g,ar(t,d)},u=requestAnimationFrame(m),i=typeof MutationObserver>"u"?void 0:new MutationObserver(m);i?.observe(t,{childList:!0,subtree:!0});let f=setTimeout(()=>Zr(d),M);return()=>{cancelAnimationFrame(u),i?.disconnect(),clearTimeout(f)}},[w,d,c,p]);let h=c?c.split(" ").length:0,[v]=T;return e("div",{className:"waiting-chip-slot",children:v&&h?n("button",{type:"button",className:"waiting-chip",onClick:()=>ar(p.current,v),children:[e(s,{name:"shield",size:16}),F(h,"{count} card waiting for an answer","{count} cards waiting for an answer")]}):null})}export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{pn,Ea,or,Fr,sr,Gr,Zr,Ti,ar}from"./chunk-index-1k6n0hh9.js";export{Ti as cardSlot,or as closeWaitingList,sr as jumpToCard,Ea as openWaiting,ar as showCard,Zr as targetShown,Gr as useTarget,Fr as useWaitingList,pn as waitingList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{qn,Br}from"./chunk-index-t9an6yb2.js";export{qn as currentQuery,Br as followUrl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p,vn,E,Qe,o,R,Se,C,a,r,t,
|
|
1
|
+
import{p,vn,E,Qe,o,R,Se,C,a,r,t,u,g,e,n,s,x,zi,X,pr,fe,h,c,f,S,m,k,Q,_,oe,Pe,Re}from"./chunk-index-htdkpbrd.js";import{D}from"./chunk-index-kjxva289.js";import{Ae}from"./chunk-index-6btfp80d.js";import{H}from"./chunk-index-evmzrr8e.js";import{A}from"./chunk-index-1kvnezap.js";import{B}from"./chunk-index-fw6kawhw.js";function dt(i,d,l){let[v,w]=r();o(()=>{if(!i)return;let N=(b)=>b.preventDefault(),O=(b)=>{if(b.button!==0||b.metaKey||b.ctrlKey||b.shiftKey||b.altKey)return;let W=b.target instanceof Element?b.target.closest("a"):null;if(!W||W.target||W.hasAttribute("download"))return;if(d.current?.contains(W))return;b.preventDefault(),b.stopPropagation(),w({kind:"link",anchor:W})},L=zi((b)=>w({kind:"navigate",proceed:b}));return window.addEventListener("beforeunload",N),document.addEventListener("click",O,!0),()=>{L(),window.removeEventListener("beforeunload",N),document.removeEventListener("click",O,!0)}},[i,d]);let y=E(()=>w(void 0),[]),T=E(()=>{let N=v;if(l(),w(void 0),N?.kind==="link")setTimeout(()=>N.anchor.click(),0);else if(N?.kind==="navigate")N.proceed()},[v,l]);return{leaving:v,stay:y,leave:T}}var de=(i)=>`workspace/${encodeURIComponent(i)}`,xe=(i)=>`path=${encodeURIComponent(i)}`,Ye=(i)=>({body:JSON.stringify(i)});function Ke(i){if(!(i instanceof fe)||i.status!==409)return;let d=i.body;return d?.conflict==="changed"||d?.conflict==="gone"||d?.conflict==="exists"?d:void 0}var q={roots:()=>h("workspace"),list:(i,d)=>h(`${de(i)}/list?${xe(d)}`),file:(i,d)=>h(`${de(i)}/file?${xe(d)}`),save:(i,d,l,v)=>h(`${de(i)}/file?${xe(d)}`,{method:"PUT",...Ye({text:l,baseHash:v})}),create:(i,d,l,v)=>h(`${de(i)}/new?${xe(d)}`,{method:"POST",...Ye({kind:l,...v===void 0?{}:{text:v}})}),rename:(i,d,l)=>h(`${de(i)}/rename`,{method:"POST",...Ye({from:d,to:l})}),remove:(i,d)=>h(`${de(i)}/entry?${xe(d)}`,{method:"DELETE"}),trash:(i)=>h(`${de(i)}/trash`),restore:(i,d)=>h(`${de(i)}/trash/${encodeURIComponent(d)}/restore`,{method:"POST"}),purge:(i,d)=>h(`${de(i)}/trash/${encodeURIComponent(d)}`,{method:"DELETE"})},we=(i,d,l=!1)=>`api/${de(i)}/raw?${xe(d)}${l?"&download=1":""}`;var Le=(i)=>i.split("/").filter(Boolean),ve=(i)=>Le(i).slice(0,-1).join("/"),Ne=(i,d)=>i?`${i}/${d}`:d,We=(i)=>`${i.root}:${i.path}${i.dir&&i.path?"/":""}`;function lt(i){if(!i)return;let d=i.indexOf(":");if(d<1)return;let l=i.slice(d+1);return{root:i.slice(0,d),path:l.replace(/\/+$/,""),dir:l===""||l.endsWith("/")}}var ct=`/*
|
|
2
2
|
* The files pane: roots, a tree, breadcrumbs, a folder's rows, and a file in the editor. Colors
|
|
3
3
|
* are the page's tokens and the --code-* set (tokens.css, styles/camelot.css), so a look or a
|
|
4
4
|
* light/dark switch recolors it with nothing rebuilt. Only transform and opacity ever move.
|
|
@@ -583,4 +583,4 @@ a.ws-row-link:hover {
|
|
|
583
583
|
transition: none;
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
`;var ut={folder:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z","folder-plus":"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7ZM12 10v6M9 13h6","file-plus":"M6 3h9l4 4v14H6zM14 3v5h5M12 12v6M9 15h6"},Ct=(i)=>(i in ut);function be(i){let{name:d,size:u=20,className:v}=i;if(!Ct(d))return e(s,{name:d,size:u,...v?{className:v}:{}});return e("svg",{viewBox:"0 0 24 24",width:u,height:u,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",...v?{className:v}:{},children:e("path",{d:ut[d]})})}function _e(i){return n("div",{className:"ws-media-actions",children:[i.open?e("a",{className:"button-link",href:we(i.root,i.path),target:"_blank",rel:"noopener",children:t("Open")}):null,n("a",{className:"button-link",href:we(i.root,i.path,!0),download:i.name,children:[e(s,{name:"download",size:18}),t("Download")]})]})}function Ze(i){let d=i.name.lastIndexOf("."),u=d>0?i.name.slice(d+1).toUpperCase():"";return n("div",{className:"card ws-card",children:[e("span",{className:"ws-card-icon","aria-hidden":"true",children:e(s,{name:"file",size:32})}),e("strong",{children:i.name}),e("span",{className:"meta",children:[u,Pe(i.bytes)].filter(Boolean).join(" · ")}),e("p",{children:i.message}),e(_e,{root:i.root,path:i.path,name:i.name})]})}var Et=(i)=>!i&&navigator.pdfViewerEnabled!==!1;function mt(i){let{media:d,root:u,path:v,name:w,bytes:y,phone:T,onFacts:N}=i,[O,L]=r(!1),[b,W]=r(!1);o(()=>(L(!1),W(!1),N(void 0),()=>N(void 0)),[u,v]);let P=we(u,v);if(O)return e(Ze,{root:u,path:v,name:w,bytes:y,message:t("This browser cannot show this file.")});switch(d){case"image":return e("div",{className:"ws-media ws-image","data-actual":b||void 0,children:e("button",{type:"button",className:"ws-image-toggle","aria-label":b?t("Fit to window"):t("Show at full size"),title:b?t("Fit to window"):t("Show at full size"),onClick:()=>W((I)=>!I),children:e("img",{src:P,alt:w,onLoad:(I)=>{let{naturalWidth:te,naturalHeight:Y}=I.currentTarget;N(te>0?`${te} × ${Y}`:void 0)},onError:()=>L(!0)})})});case"pdf":return Et(T)?n("div",{className:"ws-media ws-pdf-frame",children:[e("iframe",{className:"ws-pdf",src:P,title:w}),e(_e,{root:u,path:v,name:w,open:!0})]}):e("div",{className:"ws-media",children:n("div",{className:"card ws-card",children:[e("span",{className:"ws-card-icon","aria-hidden":"true",children:e(s,{name:"file",size:32})}),e("strong",{children:w}),n("span",{className:"meta",children:["PDF · ",Pe(y)]}),e(_e,{root:u,path:v,name:w,open:!0})]})});case"audio":return e("div",{className:"ws-media ws-sound",children:e("audio",{controls:!0,preload:"metadata",src:P,onError:()=>L(!0)})});case"video":return e("div",{className:"ws-media ws-film",children:e("video",{controls:!0,playsInline:!0,preload:"metadata",src:P,onLoadedMetadata:(I)=>{let{videoWidth:te,videoHeight:Y}=I.currentTarget;N(te>0?`${te} × ${Y}`:void 0)},onError:()=>L(!0)})})}}var St={"read-only-root":c("this place is read-only"),"git-dir":c("inside .git"),trash:c("in the trash"),symlink:c("a link"),binary:c("binary file"),"too-large":c("too large"),"not-utf8":c("not UTF-8")};function Je(i){if(i.id==="agents")return t("Knights' workspace");if(i.id==="scratch")return t("Scratch");return i.label}var gt=new Set([".git","node_modules"]),Ge=(i)=>`roundtable.workspace.open.${i}`,ft="roundtable.workspace.tree",pt="roundtable.workspace.wrap";function et(i,d){try{let u=localStorage.getItem(i);return u===null?d:JSON.parse(u)}catch{return d}}function Ue(i,d){try{localStorage.setItem(i,JSON.stringify(d))}catch{}}var Me=vn({rev:0,bump:()=>{return}});B("workspace",ct);var Ce=new Map,Rt=200;function Tt(i,d){Ce.delete(i),Ce.set(i,d);let u=Ce.keys().next().value;if(Ce.size>Rt&&u!==void 0)Ce.delete(u)}function ht(i,d,u=!0){let{rev:v}=Qe(Me),[w,y]=r(0),[T,N]=r({key:"",root:i,path:d}),O=`${i}:${d}`;if(o(()=>{let b=()=>y((W)=>W+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),o(()=>{if(!u)return;let b=!0;return q.list(i,d).then((W)=>{if(Tt(O,W),b)N({key:O,root:i,path:d,data:W})},(W)=>b&&N({key:O,root:i,path:d,error:l(W)})),()=>{b=!1}},[i,d,u,v,w]),T.key===O)return{data:T.data,error:T.error,at:T};let L=Ce.get(O);if(L)return{data:L,at:{root:i,path:d}};if(T.data)return{data:T.data,at:T,pending:!0};return{}}var Te=(i)=>x("workspace",ze(i));function tt(i,d,u){let v=Ne(d,u.name);if(u.kind==="dir")return{root:i,path:v,dir:!0};if(u.kind==="file")return{root:i,path:v,dir:!1};if(u.kind==="symlink"&&u.inside)return{root:i,path:v,dir:u.target==="dir"};return}function Lt(i){let d=We(i.path),u=a(null);return o(()=>{u.current?.scrollIntoView?.({inline:"end",block:"nearest"})},[i.path]),n("nav",{className:"ws-crumbs","aria-label":t("Path"),children:[e("a",{ref:d.length===0?u:void 0,href:Te({root:i.root.id,path:"",dir:!0}),"aria-current":d.length===0?"page":void 0,children:Je(i.root)}),d.map((v,w)=>{let y=d.slice(0,w+1).join("/"),T=w===d.length-1;return e("a",{ref:T?u:void 0,href:Te({root:i.root.id,path:y,dir:!0}),"aria-current":T?"page":void 0,children:v},y)})]})}function wt(i){let{data:d,error:u,pending:v}=ht(i.root,i.path);if(u)return e("p",{className:"ws-tree-note",children:u});if(!d||v)return e("p",{className:"ws-tree-note",children:"…"});if(d.entries.length===0)return e("p",{className:"ws-tree-note",children:t("This folder is empty")});return n("ul",{className:"ws-tree-list","data-depth":i.depth,children:[d.entries.map((w)=>{let y=tt(i.root,i.path,w),T=Ne(i.path,w.name),N=y?.dir===!0,O=N&&i.open.has(T),L=i.current?.root===i.root&&i.current.path===T&&i.current.dir===N;return n("li",{children:[n("div",{className:"ws-tree-row","data-selected":L||void 0,"data-quiet":gt.has(w.name)||void 0,style:{paddingLeft:`${0.25+i.depth*0.875}rem`},children:[N?e("button",{type:"button",className:"ws-twist","aria-expanded":O,"aria-label":t("Show or hide {name}",{name:w.name}),onClick:()=>i.toggle(T),children:e(s,{name:"chevron",size:14})}):e("span",{className:"ws-twist"}),y?n("a",{href:Te(y),title:w.name,children:[e(be,{name:N?"folder":"file",size:15}),e("span",{className:"ws-tree-label",children:w.name})]}):n("span",{className:"ws-tree-off",title:w.inside===!1?t("Outside the workspace"):"",children:[e(s,{name:"file",size:15}),e("span",{className:"ws-tree-label",children:w.name})]})]}),O?e(wt,{root:i.root,path:T,depth:i.depth+1,open:i.open,toggle:i.toggle,current:i.current}):null]},w.name)}),d.truncated?e("li",{className:"ws-tree-note",children:t("Only the first 2,000 items are listed")}):null]})}function Wt(i){let{data:d,error:u,at:v,pending:w}=ht(i.root.id,i.path),{timeZone:y}=_(),T=a(null),N=v?.root??i.root.id,O=v?.path??i.path;if(Se(()=>{T.current?.closest(".ws-main")?.scrollTo?.(0,0)},[N,O]),u)return e(m,{message:u});if(!d)return e(S,{});if(d.missing)return e(k,{children:t("No files yet")});if(d.entries.length===0)return e(k,{children:t("This folder is empty")});return n("div",{ref:T,className:"ws-listing","data-pending":w||void 0,"aria-busy":w||void 0,inert:w||void 0,children:[e("ul",{className:"ws-rows",children:d.entries.map((L)=>{let b=tt(N,O,L),W=n(g,{children:[e(be,{name:b?.dir?"folder":"file",size:20,className:"ws-row-icon"}),n("span",{className:"ws-row-main",children:[e("strong",{children:L.name}),e("span",{className:"meta",children:L.kind==="symlink"&&L.inside===!1?t("Outside the workspace"):L.kind==="other"?t("Not a regular file"):[b?.dir?void 0:Pe(L.size),oe(new Date(L.mtimeMs).toISOString(),y)].filter(Boolean).join(" · ")})]})]});return n("li",{className:"ws-row","data-quiet":gt.has(L.name)||void 0,children:[b?e("a",{className:"ws-row-link",href:Te(b),children:W}):e("span",{className:"ws-row-link","data-off":!0,children:W}),i.root.writable||b?e("button",{type:"button",className:"icon-button","aria-label":t("Actions for {name}",{name:L.name}),onClick:()=>i.onMenu(L),children:e(s,{name:"menu"})}):null]},L.name)})}),d.truncated?e("p",{className:"meta",children:t("Only the first 2,000 items are listed")}):null]})}function zt(i){let{timeZone:d}=_(),{bump:u}=Qe(Me),{root:v,path:w}=i,[y,T]=r(),[N,O]=r(),[L,b]=r("read"),[W,P]=r(!1),[I,te]=r(!1),[Y,Be]=r(()=>et(pt,i.phone)),[De,ne]=r(!1),[Le,ke]=r(),[F,V]=r(!1),[Z,ue]=r(!1),[$e,je]=r(!1),[me,le]=r(),[U,pe]=r(),[ye,Oe]=r(),ge=a(null),K=a(void 0),M=a(null),ie=a(y);ie.current=y;let G=a(L);G.current=L;let J=We(w).at(-1)??w,Ie=y?.text!==void 0,Fe=Ie&&(y?.media===void 0||F),nt=E(async()=>{let z=await q.file(v.id,w);return T(z),z},[v.id,w]);o(()=>{let z=!0;return q.file(v.id,w).then((j)=>z&&T(j),(j)=>z&&O(l(j))),()=>{z=!1}},[v.id,w]);let qe=dt(W,M,()=>{let z=ie.current;if(z?.text!==void 0)K.current?.replace(z.text,z.eol);P(!1),b("read")});o(()=>{if(!W)return;let z=document.title;return document.title=`• ${z}`,()=>{document.title=z}},[W]);let Ve=E(async(z,j)=>{let ce=ie.current,ee=K.current;if(!ce||!ee||I)return;let ae=j===void 0?ee.snapshot():void 0,He=j??ee.text();te(!0);try{let re=await q.save(v.id,w,He,z??ce.hash);ee.markSaved(ae),P(ee.dirty()),le(void 0),T({...ce,hash:re.hash,size:re.size,mtimeMs:re.mtimeMs,text:He}),f(t("Saved")),u()}catch(re){let se=Ke(re);if(se)pe({kind:se.conflict==="gone"?"gone":"changed",...se.current?{hash:se.current.hash}:{},text:He});else f(l(re),"danger")}finally{te(!1)}},[v.id,w,I,u]),at=a(Ve);at.current=Ve;let he=E(async()=>{try{let z=await nt();if(z.text!==void 0)K.current?.replace(z.text,z.eol);P(!1),le(void 0),pe(void 0)}catch(z){f(l(z),"danger")}},[nt]),vt=a(he);vt.current=he;let Xe=E(()=>{if(K.current?.dirty()){ot(!0);return}b("read")},[]),[bt,ot]=r(!1),rt=a(Xe);rt.current=Xe,o(()=>{if(!Fe||!ge.current)return;let z=ie.current;if(!z||z.text===void 0)return;let j=!1,ce;return (p("429q64dw"),import("./chunk-codeeditor-429q64dw.js")).then(async({createEditor:ee})=>{if(j||!ge.current)return;let ae=await ee({parent:ge.current,text:z.text??"",eol:z.eol,language:z.language,editable:!1,wrap:Y,phrases:{Find:t("Find"),Replace:t("Replace"),next:t("next"),previous:t("previous"),all:t("all"),"match case":t("match case"),regexp:t("regexp"),"by word":t("by word"),replace:t("replace"),"replace all":t("replace all"),close:t("close")},onChange:()=>P(ae.dirty()),onSave:()=>{if(G.current==="edit"&&ae.dirty())at.current()},onEscape:()=>{if(G.current==="edit")rt.current()}});if(j){ae.destroy();return}ce=ae,K.current=ae,ue(!0)}).catch((ee)=>{if(console.warn("the editor failed to load",ee),!j)je(!0)}),()=>{j=!0,ce?.destroy(),K.current=void 0,ue(!1)}},[Fe,v.id,w]),o(()=>{if(!Z)return;let z=L==="edit"&&y?.editable===!0;if(K.current?.setEditable(z),z)K.current?.focus()},[L,Z,y?.editable]),o(()=>{if(!Z)return;K.current?.setWrap(Y),Ue(pt,Y)},[Y,Z]);let it=y!==void 0;if(o(()=>{if(!it)return;let z=!1,j=async()=>{if(z||document.visibilityState==="hidden")return;let ae=ie.current;if(!ae)return;z=!0;try{let re=(await q.list(v.id,ve(w))).entries.find((xt)=>xt.name===J);if(!re){le("gone");return}if(re.kind==="symlink")return;if(re.size===ae.size&&re.mtimeMs===ae.mtimeMs)return;if(G.current==="edit"&&K.current?.dirty()){le("changed");return}let se=await q.file(v.id,w);if(se.hash!==ae.hash){if(T(se),se.text!==void 0)K.current?.replace(se.text,se.eol)}le(void 0)}catch{}finally{z=!1}},ce=setInterval(()=>void j(),5000),ee=()=>void j();return window.addEventListener("focus",ee),document.addEventListener("visibilitychange",ee),()=>{clearInterval(ce),window.removeEventListener("focus",ee),document.removeEventListener("visibilitychange",ee)}},[it,v.id,w,J]),N)return e("div",{className:"ws-file",children:e(m,{message:N})});if(!y)return e("div",{className:"ws-file",children:e(S,{})});let st=y.reason,kt=!y.editable?e(Q,{tone:"warn",children:t("Read only: {reason}",{reason:st?t(St[st]):""})}):null,Ae=L==="edit",yt=n("div",{className:"ws-actions",children:[y.editable&&!Ae?e("button",{type:"button",onClick:()=>{V(!0),b("edit")},children:t("Edit")}):null,Ae?n(g,{children:[e("button",{type:"button",disabled:I||!W,onClick:()=>void Ve(),children:t("Save")}),e("button",{type:"button",className:"secondary",onClick:Xe,children:t("Cancel")})]}):null,e("button",{type:"button",className:"icon-button","aria-label":t("File menu"),onClick:()=>ne(!0),children:e(s,{name:"menu"})})]});return n("div",{className:"ws-file",ref:M,children:[n("header",{className:"ws-file-head",children:[n("div",{className:"ws-file-title",children:[n("strong",{children:[W?"• ":"",J]}),n("span",{className:"meta",children:[Pe(y.size),Le?` · ${Le}`:""," ·"," ",oe(new Date(y.mtimeMs).toISOString(),d)]})]}),kt,yt]}),me?n("div",{className:"ws-banner",role:"status",children:[e("span",{className:"ws-banner-text",children:me==="gone"?t("This file is gone"):t("A knight is changing this file")}),me==="changed"?n(g,{children:[e("button",{type:"button",className:"secondary",onClick:()=>void he(),children:t("Reload (discard my edits)")}),e("button",{type:"button",className:"secondary",onClick:()=>le(void 0),children:t("Keep editing")})]}):null]}):null,e("div",{className:"ws-view",children:y.media&&!Fe?e(mt,{media:y.media,root:v.id,path:w,name:J,bytes:y.size,phone:i.phone,onFacts:ke}):Fe?e("div",{ref:ge,className:"ws-editor","data-editing":Ae||void 0,children:!Z?e("pre",{className:"ws-plain","aria-busy":!$e,children:y.text}):null}):e(Ze,{root:v.id,path:w,name:J,bytes:y.size,message:y.tooLarge?t("This file is too large to show here."):t("This file is not text, so it cannot be shown here.")})}),i.phone&&Ae?n("div",{className:"ws-editbar",role:"toolbar","aria-label":t("Editing"),children:[e("button",{type:"button",disabled:I||!W,onClick:()=>void Ve(),children:t("Save")}),e("button",{type:"button",className:"secondary",onClick:()=>K.current?.undo(),children:t("Undo")}),e("button",{type:"button",className:"secondary",onClick:()=>K.current?.redo(),children:t("Redo")}),e("button",{type:"button",className:"secondary",onClick:()=>K.current?.find(),children:t("Find")}),e("button",{type:"button",className:"secondary",onClick:()=>K.current?.tab(),children:t("Tab")})]}):null,e(A,{open:De,title:J,onClose:()=>ne(!1),children:e("div",{className:"stack",children:n("ul",{className:"more-list",children:[Ie?e("li",{children:e("button",{type:"button",className:"menu-item",onClick:()=>{Be((z)=>!z),ne(!1)},children:e("span",{className:"menu-text",children:e("strong",{children:Y?t("Do not wrap lines"):t("Wrap lines")})})})}):null,e("li",{children:n("a",{className:"menu-item menu-link",href:we(v.id,w,!0),download:J,onClick:()=>ne(!1),children:[e("span",{className:"menu-icon",children:e(s,{name:"download"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Download")})})]})}),e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{ne(!1),he()},children:[e("span",{className:"menu-icon",children:e(s,{name:"refresh"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Reload")})})]})})]})})}),e(H,{open:U!==void 0,title:U?.kind==="gone"?t("This file is gone"):t("This file changed while you were editing"),onClose:()=>pe(void 0),children:n("div",{className:"stack",children:[e("p",{children:U?.kind==="gone"?t("Someone deleted it. Your text has not been saved."):t("Your text has not been saved. What should happen to it?")}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>{navigator.clipboard?.writeText(U?.text??"").then(()=>f(t("Copied")))},children:t("Copy my text")}),U?.kind==="changed"?e("button",{type:"button",className:"secondary",onClick:()=>void he(),children:t("Reload (discard my edits)")}):null,e("button",{type:"button",className:"danger",onClick:()=>{if(!U)return;if(U.kind==="gone"){let z=U.text;pe(void 0),q.create(v.id,w,"file",z).then(async()=>{await he(),u()}).catch((j)=>f(l(j),"danger"));return}Oe({hash:U.hash??"",text:U.text}),pe(void 0)},children:U?.kind==="gone"?t("Save mine as a new file"):t("Save mine anyway")})]})]})}),e(D,{open:ye!==void 0,title:t("Replace the knight's changes?"),confirmLabel:t("Save mine anyway"),tone:"danger",onClose:()=>Oe(void 0),onConfirm:async()=>{if(!ye)return;await q.save(v.id,w,ye.text,ye.hash),await he(),f(t("Saved")),u()},children:e("p",{children:t("The file has been changed since you opened it. Saving yours writes over those changes.")})}),e(D,{open:bt,title:t("Unsaved changes, leave?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>ot(!1),onConfirm:async()=>{if(y.text!==void 0)K.current?.replace(y.text,y.eol);P(!1),b("read")},children:e("p",{children:t("Your edits to {name} have not been saved.",{name:J})})}),e(D,{open:qe.leaving!==void 0,title:t("Unsaved changes, leave?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:qe.stay,onConfirm:async()=>qe.leave(),children:e("p",{children:t("Your edits to {name} have not been saved.",{name:J})})})]})}function Mt(i){let{ask:d}=i,[u,v]=r(""),[w,y]=r(),[T,N]=r(!1),O=R();o(()=>{v(d?.kind==="rename"?d.name:""),y(void 0)},[d]);let L=d?.kind==="rename"?t("Rename"):d?.kind==="dir"?t("New folder"):t("New file"),b=async(W)=>{if(W.preventDefault(),!d)return;let P=u.trim();if(!P||P.includes("/")){y(t("Use a name without slashes."));return}N(!0),y(void 0);try{if(d.kind==="rename"){let I=Ne(ve(d.path),P);await q.rename(i.root.id,d.path,I),f(t("Renamed")),i.onDone()}else{let I=Ne(d.dir,P);await q.create(i.root.id,I,d.kind),f(t("Created")),i.onDone({root:i.root.id,path:I,dir:d.kind==="dir"})}}catch(I){let te=Ke(I);y(te?.conflict==="exists"?t("Something with that name is already there."):l(I))}finally{N(!1)}};return e(H,{open:d!==void 0,title:L,onClose:i.onClose,children:n("form",{className:"stack",onSubmit:b,children:[e("label",{htmlFor:O,children:t("Name")}),e("input",{id:O,value:u,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,onChange:(W)=>v(W.target.value)}),w?e(m,{message:w}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:T||!u.trim(),children:d?.kind==="rename"?t("Rename"):t("Create")})]})]})})}function Dt(i){let{bump:d,rev:u}=Qe(Me),[v,w]=r(),[y,T]=r(),[N,O]=r(),{timeZone:L}=_();return o(()=>{if(!i.open)return;let b=!0;return q.trash(i.root.id).then((W)=>b&&w(W.items),(W)=>b&&T(l(W))),()=>{b=!1}},[i.open,i.root.id,u]),n(H,{open:i.open,title:t("Trash"),onClose:i.onClose,children:[n("div",{className:"stack",children:[y?e(m,{message:y}):null,!v&&!y?e(S,{}):null,v?.length===0?e(k,{children:t("The trash is empty")}):null,e("ul",{className:"ws-rows",children:v?.map((b)=>n("li",{className:"ws-row",children:[n("span",{className:"ws-row-link","data-off":!0,children:[e(be,{name:b.kind==="dir"?"folder":"file",size:20,className:"ws-row-icon"}),n("span",{className:"ws-row-main",children:[e("strong",{children:b.path}),e("span",{className:"meta",children:oe(b.deletedAt,L)})]})]}),e("button",{type:"button",className:"secondary",onClick:async()=>{try{await q.restore(i.root.id,b.id),f(t("Restored")),d()}catch(W){let P=Ke(W);f(P?P.conflict==="exists"?t("Something with that name is already there."):t("The folder it was in is gone."):l(W),"danger")}},children:t("Restore")}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Delete {name} for good",{name:b.name}),onClick:()=>O(b),children:e(s,{name:"trash"})})]},b.id))})]}),e(D,{open:N!==void 0,title:t("Delete for good?"),confirmLabel:t("Delete for good"),tone:"danger",onClose:()=>O(void 0),onConfirm:async()=>{if(!N)return;await q.purge(i.root.id,N.id),d()},children:e("p",{children:t("“{name}” will be removed and cannot be brought back.",{name:N?.path??""})})})]})}function yn(){let i=hr(),d=!Re("(min-width: 720px)"),[u,v]=r(0),w=E(()=>v((M)=>M+1),[]),y=C(()=>({rev:u,bump:w}),[u,w]),[T,N]=r(),[O,L]=r();o(()=>{q.roots().then((M)=>N(M.roots),(M)=>L(l(M)))},[]);let[b,W]=r(()=>et(ft,280)),[P,I]=r(),[te,Y]=r(),[Be,De]=r(!1),[ne,Le]=r(),ke=lt(i.key),F=T?.find((M)=>M.id===ke?.root)??(d?void 0:T?.[0]),V=F?ke&&ke.root===F.id?ke:{root:F.id,path:"",dir:!0}:void 0,Z=F?.id,ue=V?.path,$e=V?.dir,[je,me]=r(new Set);o(()=>{if(!Z)return;me(new Set(et(Ge(Z),[])))},[Z]);let le=E((M)=>{if(!Z)return;me((ie)=>{let G=new Set(ie);if(G.has(M))G.delete(M);else G.add(M);return Ue(Ge(Z),[...G]),G})},[Z]);if(o(()=>{if(!Z||ue===void 0||d)return;let M=We($e?ue:ve(ue)),ie=M.map((G,J)=>M.slice(0,J+1).join("/"));me((G)=>{if(ie.every((Ie)=>G.has(Ie)))return G;let J=new Set([...G,...ie]);return Ue(Ge(Z),[...J]),J})},[Z,ue,$e,d]),O)return e(m,{message:O});if(!T)return e(S,{});if(T.length===0)return e(k,{children:t("No files yet")});if(!F||!V)return e(Me.Provider,{value:y,children:n("div",{className:"page ws-page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Files")})}),e("ul",{className:"more-list",children:T.map((M)=>e("li",{children:n("a",{className:"menu-item menu-link",href:Te({root:M.id,path:"",dir:!0}),children:[e("span",{className:"menu-icon",children:e(be,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:Je(M)}),M.writable?null:e("span",{className:"meta",children:t("Read only")})]}),e(s,{name:"chevron",size:16})]})},M.id))})]})});let U=V.dir?V.path:ve(V.path),pe=V.path===""?{root:F.id,path:"",dir:!0}:{root:F.id,path:ve(V.path),dir:!0},ye=n("header",{className:"ws-head",children:[d?e("a",{className:"icon-button","aria-label":t("Back"),href:V.path===""?x("workspace"):Te(pe),children:e(s,{name:"back"})}):e(Ee,{chip:!0,className:"ws-root-picker","aria-label":t("Place"),value:F.id,onChange:(M)=>X("workspace",ze({root:M.target.value,path:"",dir:!0})),children:T.map((M)=>e("option",{value:M.id,children:Je(M)},M.id))}),e(Lt,{root:F,path:V.path}),F.writable?n("div",{className:"ws-head-actions",children:[e("button",{type:"button",className:"icon-button","aria-label":t("New file"),title:t("New file"),onClick:()=>Y({kind:"file",dir:U}),children:e(be,{name:"file-plus"})}),e("button",{type:"button",className:"icon-button","aria-label":t("New folder"),title:t("New folder"),onClick:()=>Y({kind:"dir",dir:U}),children:e(be,{name:"folder-plus"})}),e("button",{type:"button",className:"icon-button","aria-label":t("Trash"),title:t("Trash"),onClick:()=>De(!0),children:e(s,{name:"trash"})})]}):null]}),Oe=V.dir?e("div",{className:"ws-dir",children:e(Wt,{root:F,path:V.path,onMenu:(M)=>I(M)})}):e(zt,{root:F,path:V.path,phone:d},`${F.id}:${V.path}`),ge=P?tt(F.id,U,P):void 0,K=P?Ne(U,P.name):"";return n(Me.Provider,{value:y,children:[n("div",{className:"ws-page ws","data-wide":!d||void 0,style:{"--ws-tree":`${b}px`},children:[ye,n("div",{className:"ws-body",children:[!d?n(g,{children:[e("aside",{className:"ws-tree","aria-label":t("Folders"),children:e(wt,{root:F.id,path:"",depth:0,open:je,toggle:le,current:V})}),e($t,{width:b,onChange:(M)=>{W(M),Ue(ft,M)}})]}):null,e("section",{className:"ws-main",children:Oe})]})]}),e(A,{open:P!==void 0,title:P?.name??"",onClose:()=>I(void 0),children:n("ul",{className:"more-list",children:[ge&&!ge.dir?e("li",{children:n("a",{className:"menu-item menu-link",href:we(F.id,K,!0),download:P?.name,onClick:()=>I(void 0),children:[e("span",{className:"menu-icon",children:e(s,{name:"download"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Download")})})]})}):null,F.writable&&P?n(g,{children:[e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{Y({kind:"rename",path:K,name:P.name}),I(void 0)},children:[e("span",{className:"menu-icon",children:e(s,{name:"notes"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Rename")})})]})}),e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{Le({path:K,name:P.name}),I(void 0)},children:[e("span",{className:"menu-icon",children:e(s,{name:"trash"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Delete")})})]})})]}):null]})}),e(Mt,{root:F,ask:te,onClose:()=>Y(void 0),onDone:(M)=>{if(Y(void 0),w(),M)X("workspace",ze(M))}}),e(Dt,{root:F,open:Be,onClose:()=>De(!1)}),e(D,{open:ne!==void 0,title:t("Move to the trash?"),confirmLabel:t("Delete"),tone:"danger",onClose:()=>Le(void 0),onConfirm:async()=>{if(!ne)return;if(await q.remove(F.id,ne.path),f(t("Moved to the trash")),w(),!V.dir&&(V.path===ne.path||V.path.startsWith(`${ne.path}/`)))X("workspace",ze({root:F.id,path:ve(V.path),dir:!0}))},children:e("p",{children:t("“{name}” goes to the trash, where you can bring it back.",{name:ne?.name??""})})})]})}function $t(i){let v=(w)=>Math.min(560,Math.max(180,w));return e("div",{className:"ws-resizer",role:"separator","aria-orientation":"vertical","aria-valuenow":i.width,"aria-valuemin":180,"aria-valuemax":560,"aria-label":t("Resize the folder list"),tabIndex:0,onKeyDown:(w)=>{if(w.key==="ArrowLeft")i.onChange(v(i.width-16));if(w.key==="ArrowRight")i.onChange(v(i.width+16))},onPointerDown:(w)=>{let y=w.clientX,T=i.width,N=w.currentTarget;N.setPointerCapture(w.pointerId);let O=(b)=>i.onChange(v(T+b.clientX-y)),L=()=>{N.removeEventListener("pointermove",O),N.removeEventListener("pointerup",L)};N.addEventListener("pointermove",O),N.addEventListener("pointerup",L)}})}export{yn as WorkspacePage};
|
|
586
|
+
`;var ut={folder:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z","folder-plus":"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7ZM12 10v6M9 13h6","file-plus":"M6 3h9l4 4v14H6zM14 3v5h5M12 12v6M9 15h6"},Ct=(i)=>(i in ut);function be(i){let{name:d,size:l=20,className:v}=i;if(!Ct(d))return e(s,{name:d,size:l,...v?{className:v}:{}});return e("svg",{viewBox:"0 0 24 24",width:l,height:l,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",...v?{className:v}:{},children:e("path",{d:ut[d]})})}function _e(i){return n("div",{className:"ws-media-actions",children:[i.open?e("a",{className:"button-link",href:we(i.root,i.path),target:"_blank",rel:"noopener",children:t("Open")}):null,n("a",{className:"button-link",href:we(i.root,i.path,!0),download:i.name,children:[e(s,{name:"download",size:18}),t("Download")]})]})}function Ze(i){let d=i.name.lastIndexOf("."),l=d>0?i.name.slice(d+1).toUpperCase():"";return n("div",{className:"card ws-card",children:[e("span",{className:"ws-card-icon","aria-hidden":"true",children:e(s,{name:"file",size:32})}),e("strong",{children:i.name}),e("span",{className:"meta",children:[l,Pe(i.bytes)].filter(Boolean).join(" · ")}),e("p",{children:i.message}),e(_e,{root:i.root,path:i.path,name:i.name})]})}var Et=(i)=>!i&&navigator.pdfViewerEnabled!==!1;function mt(i){let{media:d,root:l,path:v,name:w,bytes:y,phone:T,onFacts:N}=i,[O,L]=r(!1),[b,W]=r(!1);o(()=>(L(!1),W(!1),N(void 0),()=>N(void 0)),[l,v]);let P=we(l,v);if(O)return e(Ze,{root:l,path:v,name:w,bytes:y,message:t("This browser cannot show this file.")});switch(d){case"image":return e("div",{className:"ws-media ws-image","data-actual":b||void 0,children:e("button",{type:"button",className:"ws-image-toggle","aria-label":b?t("Fit to window"):t("Show at full size"),title:b?t("Fit to window"):t("Show at full size"),onClick:()=>W((I)=>!I),children:e("img",{src:P,alt:w,onLoad:(I)=>{let{naturalWidth:te,naturalHeight:Y}=I.currentTarget;N(te>0?`${te} × ${Y}`:void 0)},onError:()=>L(!0)})})});case"pdf":return Et(T)?n("div",{className:"ws-media ws-pdf-frame",children:[e("iframe",{className:"ws-pdf",src:P,title:w}),e(_e,{root:l,path:v,name:w,open:!0})]}):e("div",{className:"ws-media",children:n("div",{className:"card ws-card",children:[e("span",{className:"ws-card-icon","aria-hidden":"true",children:e(s,{name:"file",size:32})}),e("strong",{children:w}),n("span",{className:"meta",children:["PDF · ",Pe(y)]}),e(_e,{root:l,path:v,name:w,open:!0})]})});case"audio":return e("div",{className:"ws-media ws-sound",children:e("audio",{controls:!0,preload:"metadata",src:P,onError:()=>L(!0)})});case"video":return e("div",{className:"ws-media ws-film",children:e("video",{controls:!0,playsInline:!0,preload:"metadata",src:P,onLoadedMetadata:(I)=>{let{videoWidth:te,videoHeight:Y}=I.currentTarget;N(te>0?`${te} × ${Y}`:void 0)},onError:()=>L(!0)})})}}var St={"read-only-root":u("this place is read-only"),"git-dir":u("inside .git"),trash:u("in the trash"),symlink:u("a link"),binary:u("binary file"),"too-large":u("too large"),"not-utf8":u("not UTF-8")};function Je(i){if(i.id==="agents")return t("Knights' workspace");if(i.id==="scratch")return t("Scratch");return i.label}var gt=new Set([".git","node_modules"]),Ge=(i)=>`roundtable.workspace.open.${i}`,ft="roundtable.workspace.tree",pt="roundtable.workspace.wrap";function et(i,d){try{let l=localStorage.getItem(i);return l===null?d:JSON.parse(l)}catch{return d}}function Ue(i,d){try{localStorage.setItem(i,JSON.stringify(d))}catch{}}var ze=vn({rev:0,bump:()=>{return}});B("workspace",ct);var Ce=new Map,Rt=200;function Tt(i,d){Ce.delete(i),Ce.set(i,d);let l=Ce.keys().next().value;if(Ce.size>Rt&&l!==void 0)Ce.delete(l)}function ht(i,d,l=!0){let{rev:v}=Qe(ze),[w,y]=r(0),[T,N]=r({key:"",root:i,path:d}),O=`${i}:${d}`;if(o(()=>{let b=()=>y((W)=>W+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),o(()=>{if(!l)return;let b=!0;return q.list(i,d).then((W)=>{if(Tt(O,W),b)N({key:O,root:i,path:d,data:W})},(W)=>b&&N({key:O,root:i,path:d,error:c(W)})),()=>{b=!1}},[i,d,l,v,w]),T.key===O)return{data:T.data,error:T.error,at:T};let L=Ce.get(O);if(L)return{data:L,at:{root:i,path:d}};if(T.data)return{data:T.data,at:T,pending:!0};return{}}var Ee=(i)=>x("workspace",We(i));function tt(i,d,l){let v=Ne(d,l.name);if(l.kind==="dir")return{root:i,path:v,dir:!0};if(l.kind==="file")return{root:i,path:v,dir:!1};if(l.kind==="symlink"&&l.inside)return{root:i,path:v,dir:l.target==="dir"};return}function Lt(i){let d=Le(i.path),l=a(null);return o(()=>{l.current?.scrollIntoView?.({inline:"end",block:"nearest"})},[i.path]),n("nav",{className:"ws-crumbs","aria-label":t("Path"),children:[e("a",{ref:d.length===0?l:void 0,href:Ee({root:i.root.id,path:"",dir:!0}),"aria-current":d.length===0?"page":void 0,children:Je(i.root)}),d.map((v,w)=>{let y=d.slice(0,w+1).join("/"),T=w===d.length-1;return e("a",{ref:T?l:void 0,href:Ee({root:i.root.id,path:y,dir:!0}),"aria-current":T?"page":void 0,children:v},y)})]})}function wt(i){let{data:d,error:l,pending:v}=ht(i.root,i.path);if(l)return e("p",{className:"ws-tree-note",children:l});if(!d||v)return e("p",{className:"ws-tree-note",children:"…"});if(d.entries.length===0)return e("p",{className:"ws-tree-note",children:t("This folder is empty")});return n("ul",{className:"ws-tree-list","data-depth":i.depth,children:[d.entries.map((w)=>{let y=tt(i.root,i.path,w),T=Ne(i.path,w.name),N=y?.dir===!0,O=N&&i.open.has(T),L=i.current?.root===i.root&&i.current.path===T&&i.current.dir===N;return n("li",{children:[n("div",{className:"ws-tree-row","data-selected":L||void 0,"data-quiet":gt.has(w.name)||void 0,style:{paddingLeft:`${0.25+i.depth*0.875}rem`},children:[N?e("button",{type:"button",className:"ws-twist","aria-expanded":O,"aria-label":t("Show or hide {name}",{name:w.name}),onClick:()=>i.toggle(T),children:e(s,{name:"chevron",size:14})}):e("span",{className:"ws-twist"}),y?n("a",{href:Ee(y),title:w.name,children:[e(be,{name:N?"folder":"file",size:15}),e("span",{className:"ws-tree-label",children:w.name})]}):n("span",{className:"ws-tree-off",title:w.inside===!1?t("Outside the workspace"):"",children:[e(s,{name:"file",size:15}),e("span",{className:"ws-tree-label",children:w.name})]})]}),O?e(wt,{root:i.root,path:T,depth:i.depth+1,open:i.open,toggle:i.toggle,current:i.current}):null]},w.name)}),d.truncated?e("li",{className:"ws-tree-note",children:t("Only the first 2,000 items are listed")}):null]})}function Wt(i){let{data:d,error:l,at:v,pending:w}=ht(i.root.id,i.path),{timeZone:y}=_(),T=a(null),N=v?.root??i.root.id,O=v?.path??i.path;if(Se(()=>{T.current?.closest(".ws-main")?.scrollTo?.(0,0)},[N,O]),l)return e(m,{message:l});if(!d)return e(S,{});if(d.missing)return e(k,{children:t("No files yet")});if(d.entries.length===0)return e(k,{children:t("This folder is empty")});return n("div",{ref:T,className:"ws-listing","data-pending":w||void 0,"aria-busy":w||void 0,inert:w||void 0,children:[e("ul",{className:"ws-rows",children:d.entries.map((L)=>{let b=tt(N,O,L),W=n(g,{children:[e(be,{name:b?.dir?"folder":"file",size:20,className:"ws-row-icon"}),n("span",{className:"ws-row-main",children:[e("strong",{children:L.name}),e("span",{className:"meta",children:L.kind==="symlink"&&L.inside===!1?t("Outside the workspace"):L.kind==="other"?t("Not a regular file"):[b?.dir?void 0:Pe(L.size),oe(new Date(L.mtimeMs).toISOString(),y)].filter(Boolean).join(" · ")})]})]});return n("li",{className:"ws-row","data-quiet":gt.has(L.name)||void 0,children:[b?e("a",{className:"ws-row-link",href:Ee(b),children:W}):e("span",{className:"ws-row-link","data-off":!0,children:W}),i.root.writable||b?e("button",{type:"button",className:"icon-button","aria-label":t("Actions for {name}",{name:L.name}),onClick:()=>i.onMenu(L),children:e(s,{name:"menu"})}):null]},L.name)})}),d.truncated?e("p",{className:"meta",children:t("Only the first 2,000 items are listed")}):null]})}function zt(i){let{timeZone:d}=_(),{bump:l}=Qe(ze),{root:v,path:w}=i,[y,T]=r(),[N,O]=r(),[L,b]=r("read"),[W,P]=r(!1),[I,te]=r(!1),[Y,Be]=r(()=>et(pt,i.phone)),[Me,ne]=r(!1),[Te,ke]=r(),[F,V]=r(!1),[Z,ue]=r(!1),[De,je]=r(!1),[me,le]=r(),[U,pe]=r(),[ye,$e]=r(),ge=a(null),K=a(void 0),M=a(null),ie=a(y);ie.current=y;let G=a(L);G.current=L;let J=Le(w).at(-1)??w,Oe=y?.text!==void 0,Ie=Oe&&(y?.media===void 0||F),nt=E(async()=>{let z=await q.file(v.id,w);return T(z),z},[v.id,w]);o(()=>{let z=!0;return q.file(v.id,w).then((j)=>z&&T(j),(j)=>z&&O(c(j))),()=>{z=!1}},[v.id,w]);let qe=dt(W,M,()=>{let z=ie.current;if(z?.text!==void 0)K.current?.replace(z.text,z.eol);P(!1),b("read")});o(()=>{if(!W)return;let z=document.title;return document.title=`• ${z}`,()=>{document.title=z}},[W]);let Fe=E(async(z,j)=>{let ce=ie.current,ee=K.current;if(!ce||!ee||I)return;let ae=j===void 0?ee.snapshot():void 0,He=j??ee.text();te(!0);try{let re=await q.save(v.id,w,He,z??ce.hash);ee.markSaved(ae),P(ee.dirty()),le(void 0),T({...ce,hash:re.hash,size:re.size,mtimeMs:re.mtimeMs,text:He}),f(t("Saved")),l()}catch(re){let se=Ke(re);if(se)pe({kind:se.conflict==="gone"?"gone":"changed",...se.current?{hash:se.current.hash}:{},text:He});else f(c(re),"danger")}finally{te(!1)}},[v.id,w,I,l]),at=a(Fe);at.current=Fe;let he=E(async()=>{try{let z=await nt();if(z.text!==void 0)K.current?.replace(z.text,z.eol);P(!1),le(void 0),pe(void 0)}catch(z){f(c(z),"danger")}},[nt]),vt=a(he);vt.current=he;let Xe=E(()=>{if(K.current?.dirty()){ot(!0);return}b("read")},[]),[bt,ot]=r(!1),rt=a(Xe);rt.current=Xe,o(()=>{if(!Ie||!ge.current)return;let z=ie.current;if(!z||z.text===void 0)return;let j=!1,ce;return (p("3vh4q5af"),import("./chunk-codeeditor-3vh4q5af.js")).then(async({createEditor:ee})=>{if(j||!ge.current)return;let ae=await ee({parent:ge.current,text:z.text??"",eol:z.eol,language:z.language,editable:!1,wrap:Y,phrases:{Find:t("Find"),Replace:t("Replace"),next:t("next"),previous:t("previous"),all:t("all"),"match case":t("match case"),regexp:t("regexp"),"by word":t("by word"),replace:t("replace"),"replace all":t("replace all"),close:t("close")},onChange:()=>P(ae.dirty()),onSave:()=>{if(G.current==="edit"&&ae.dirty())at.current()},onEscape:()=>{if(G.current==="edit")rt.current()}});if(j){ae.destroy();return}ce=ae,K.current=ae,ue(!0)}).catch((ee)=>{if(console.warn("the editor failed to load",ee),!j)je(!0)}),()=>{j=!0,ce?.destroy(),K.current=void 0,ue(!1)}},[Ie,v.id,w]),o(()=>{if(!Z)return;let z=L==="edit"&&y?.editable===!0;if(K.current?.setEditable(z),z)K.current?.focus()},[L,Z,y?.editable]),o(()=>{if(!Z)return;K.current?.setWrap(Y),Ue(pt,Y)},[Y,Z]);let it=y!==void 0;if(o(()=>{if(!it)return;let z=!1,j=async()=>{if(z||document.visibilityState==="hidden")return;let ae=ie.current;if(!ae)return;z=!0;try{let re=(await q.list(v.id,ve(w))).entries.find((xt)=>xt.name===J);if(!re){le("gone");return}if(re.kind==="symlink")return;if(re.size===ae.size&&re.mtimeMs===ae.mtimeMs)return;if(G.current==="edit"&&K.current?.dirty()){le("changed");return}let se=await q.file(v.id,w);if(se.hash!==ae.hash){if(T(se),se.text!==void 0)K.current?.replace(se.text,se.eol)}le(void 0)}catch{}finally{z=!1}},ce=setInterval(()=>void j(),5000),ee=()=>void j();return window.addEventListener("focus",ee),document.addEventListener("visibilitychange",ee),()=>{clearInterval(ce),window.removeEventListener("focus",ee),document.removeEventListener("visibilitychange",ee)}},[it,v.id,w,J]),N)return e("div",{className:"ws-file",children:e(m,{message:N})});if(!y)return e("div",{className:"ws-file",children:e(S,{})});let st=y.reason,kt=!y.editable?e(Q,{tone:"warn",children:t("Read only: {reason}",{reason:st?t(St[st]):""})}):null,Ve=L==="edit",yt=n("div",{className:"ws-actions",children:[y.editable&&!Ve?e("button",{type:"button",onClick:()=>{V(!0),b("edit")},children:t("Edit")}):null,Ve?n(g,{children:[e("button",{type:"button",disabled:I||!W,onClick:()=>void Fe(),children:t("Save")}),e("button",{type:"button",className:"secondary",onClick:Xe,children:t("Cancel")})]}):null,e("button",{type:"button",className:"icon-button","aria-label":t("File menu"),onClick:()=>ne(!0),children:e(s,{name:"menu"})})]});return n("div",{className:"ws-file",ref:M,children:[n("header",{className:"ws-file-head",children:[n("div",{className:"ws-file-title",children:[n("strong",{children:[W?"• ":"",J]}),n("span",{className:"meta",children:[Pe(y.size),Te?` · ${Te}`:""," ·"," ",oe(new Date(y.mtimeMs).toISOString(),d)]})]}),kt,yt]}),me?n("div",{className:"ws-banner",role:"status",children:[e("span",{className:"ws-banner-text",children:me==="gone"?t("This file is gone"):t("A knight is changing this file")}),me==="changed"?n(g,{children:[e("button",{type:"button",className:"secondary",onClick:()=>void he(),children:t("Reload (discard my edits)")}),e("button",{type:"button",className:"secondary",onClick:()=>le(void 0),children:t("Keep editing")})]}):null]}):null,e("div",{className:"ws-view",children:y.media&&!Ie?e(mt,{media:y.media,root:v.id,path:w,name:J,bytes:y.size,phone:i.phone,onFacts:ke}):Ie?e("div",{ref:ge,className:"ws-editor","data-editing":Ve||void 0,children:!Z?e("pre",{className:"ws-plain","aria-busy":!De,children:y.text}):null}):e(Ze,{root:v.id,path:w,name:J,bytes:y.size,message:y.tooLarge?t("This file is too large to show here."):t("This file is not text, so it cannot be shown here.")})}),i.phone&&Ve?n("div",{className:"ws-editbar",role:"toolbar","aria-label":t("Editing"),children:[e("button",{type:"button",disabled:I||!W,onClick:()=>void Fe(),children:t("Save")}),e("button",{type:"button",className:"secondary",onClick:()=>K.current?.undo(),children:t("Undo")}),e("button",{type:"button",className:"secondary",onClick:()=>K.current?.redo(),children:t("Redo")}),e("button",{type:"button",className:"secondary",onClick:()=>K.current?.find(),children:t("Find")}),e("button",{type:"button",className:"secondary",onClick:()=>K.current?.tab(),children:t("Tab")})]}):null,e(A,{open:Me,title:J,onClose:()=>ne(!1),children:e("div",{className:"stack",children:n("ul",{className:"more-list",children:[Oe?e("li",{children:e("button",{type:"button",className:"menu-item",onClick:()=>{Be((z)=>!z),ne(!1)},children:e("span",{className:"menu-text",children:e("strong",{children:Y?t("Do not wrap lines"):t("Wrap lines")})})})}):null,e("li",{children:n("a",{className:"menu-item menu-link",href:we(v.id,w,!0),download:J,onClick:()=>ne(!1),children:[e("span",{className:"menu-icon",children:e(s,{name:"download"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Download")})})]})}),e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{ne(!1),he()},children:[e("span",{className:"menu-icon",children:e(s,{name:"refresh"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Reload")})})]})})]})})}),e(H,{open:U!==void 0,title:U?.kind==="gone"?t("This file is gone"):t("This file changed while you were editing"),onClose:()=>pe(void 0),children:n("div",{className:"stack",children:[e("p",{children:U?.kind==="gone"?t("Someone deleted it. Your text has not been saved."):t("Your text has not been saved. What should happen to it?")}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>{navigator.clipboard?.writeText(U?.text??"").then(()=>f(t("Copied")))},children:t("Copy my text")}),U?.kind==="changed"?e("button",{type:"button",className:"secondary",onClick:()=>void he(),children:t("Reload (discard my edits)")}):null,e("button",{type:"button",className:"danger",onClick:()=>{if(!U)return;if(U.kind==="gone"){let z=U.text;pe(void 0),q.create(v.id,w,"file",z).then(async()=>{await he(),l()}).catch((j)=>f(c(j),"danger"));return}$e({hash:U.hash??"",text:U.text}),pe(void 0)},children:U?.kind==="gone"?t("Save mine as a new file"):t("Save mine anyway")})]})]})}),e(D,{open:ye!==void 0,title:t("Replace the knight's changes?"),confirmLabel:t("Save mine anyway"),tone:"danger",onClose:()=>$e(void 0),onConfirm:async()=>{if(!ye)return;await q.save(v.id,w,ye.text,ye.hash),await he(),f(t("Saved")),l()},children:e("p",{children:t("The file has been changed since you opened it. Saving yours writes over those changes.")})}),e(D,{open:bt,title:t("Unsaved changes, leave?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>ot(!1),onConfirm:async()=>{if(y.text!==void 0)K.current?.replace(y.text,y.eol);P(!1),b("read")},children:e("p",{children:t("Your edits to {name} have not been saved.",{name:J})})}),e(D,{open:qe.leaving!==void 0,title:t("Unsaved changes, leave?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:qe.stay,onConfirm:async()=>qe.leave(),children:e("p",{children:t("Your edits to {name} have not been saved.",{name:J})})})]})}function Mt(i){let{ask:d}=i,[l,v]=r(""),[w,y]=r(),[T,N]=r(!1),O=R();o(()=>{v(d?.kind==="rename"?d.name:""),y(void 0)},[d]);let L=d?.kind==="rename"?t("Rename"):d?.kind==="dir"?t("New folder"):t("New file"),b=async(W)=>{if(W.preventDefault(),!d)return;let P=l.trim();if(!P||P.includes("/")){y(t("Use a name without slashes."));return}N(!0),y(void 0);try{if(d.kind==="rename"){let I=Ne(ve(d.path),P);await q.rename(i.root.id,d.path,I),f(t("Renamed")),i.onDone()}else{let I=Ne(d.dir,P);await q.create(i.root.id,I,d.kind),f(t("Created")),i.onDone({root:i.root.id,path:I,dir:d.kind==="dir"})}}catch(I){let te=Ke(I);y(te?.conflict==="exists"?t("Something with that name is already there."):c(I))}finally{N(!1)}};return e(H,{open:d!==void 0,title:L,onClose:i.onClose,children:n("form",{className:"stack",onSubmit:b,children:[e("label",{htmlFor:O,children:t("Name")}),e("input",{id:O,value:l,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,onChange:(W)=>v(W.target.value)}),w?e(m,{message:w}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:T||!l.trim(),children:d?.kind==="rename"?t("Rename"):t("Create")})]})]})})}function Dt(i){let{bump:d,rev:l}=Qe(ze),[v,w]=r(),[y,T]=r(),[N,O]=r(),{timeZone:L}=_();return o(()=>{if(!i.open)return;let b=!0;return q.trash(i.root.id).then((W)=>b&&w(W.items),(W)=>b&&T(c(W))),()=>{b=!1}},[i.open,i.root.id,l]),n(H,{open:i.open,title:t("Trash"),onClose:i.onClose,children:[n("div",{className:"stack",children:[y?e(m,{message:y}):null,!v&&!y?e(S,{}):null,v?.length===0?e(k,{children:t("The trash is empty")}):null,e("ul",{className:"ws-rows",children:v?.map((b)=>n("li",{className:"ws-row",children:[n("span",{className:"ws-row-link","data-off":!0,children:[e(be,{name:b.kind==="dir"?"folder":"file",size:20,className:"ws-row-icon"}),n("span",{className:"ws-row-main",children:[e("strong",{children:b.path}),e("span",{className:"meta",children:oe(b.deletedAt,L)})]})]}),e("button",{type:"button",className:"secondary",onClick:async()=>{try{await q.restore(i.root.id,b.id),f(t("Restored")),d()}catch(W){let P=Ke(W);f(P?P.conflict==="exists"?t("Something with that name is already there."):t("The folder it was in is gone."):c(W),"danger")}},children:t("Restore")}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Delete {name} for good",{name:b.name}),onClick:()=>O(b),children:e(s,{name:"trash"})})]},b.id))})]}),e(D,{open:N!==void 0,title:t("Delete for good?"),confirmLabel:t("Delete for good"),tone:"danger",onClose:()=>O(void 0),onConfirm:async()=>{if(!N)return;await q.purge(i.root.id,N.id),d()},children:e("p",{children:t("“{name}” will be removed and cannot be brought back.",{name:N?.path??""})})})]})}function yn(){let i=pr(),d=!Re("(min-width: 720px)"),[l,v]=r(0),w=E(()=>v((M)=>M+1),[]),y=C(()=>({rev:l,bump:w}),[l,w]),[T,N]=r(),[O,L]=r();o(()=>{q.roots().then((M)=>N(M.roots),(M)=>L(c(M)))},[]);let[b,W]=r(()=>et(ft,280)),[P,I]=r(),[te,Y]=r(),[Be,Me]=r(!1),[ne,Te]=r(),ke=lt(i.key),F=T?.find((M)=>M.id===ke?.root)??(d?void 0:T?.[0]),V=F?ke&&ke.root===F.id?ke:{root:F.id,path:"",dir:!0}:void 0,Z=F?.id,ue=V?.path,De=V?.dir,[je,me]=r(new Set);o(()=>{if(!Z)return;me(new Set(et(Ge(Z),[])))},[Z]);let le=E((M)=>{if(!Z)return;me((ie)=>{let G=new Set(ie);if(G.has(M))G.delete(M);else G.add(M);return Ue(Ge(Z),[...G]),G})},[Z]);if(o(()=>{if(!Z||ue===void 0||d)return;let M=Le(De?ue:ve(ue)),ie=M.map((G,J)=>M.slice(0,J+1).join("/"));me((G)=>{if(ie.every((Oe)=>G.has(Oe)))return G;let J=new Set([...G,...ie]);return Ue(Ge(Z),[...J]),J})},[Z,ue,De,d]),O)return e(m,{message:O});if(!T)return e(S,{});if(T.length===0)return e(k,{children:t("No files yet")});if(!F||!V)return e(ze.Provider,{value:y,children:n("div",{className:"page ws-page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Files")})}),e("ul",{className:"more-list",children:T.map((M)=>e("li",{children:n("a",{className:"menu-item menu-link",href:Ee({root:M.id,path:"",dir:!0}),children:[e("span",{className:"menu-icon",children:e(be,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:Je(M)}),M.writable?null:e("span",{className:"meta",children:t("Read only")})]}),e(s,{name:"chevron",size:16})]})},M.id))})]})});let U=V.dir?V.path:ve(V.path),pe=V.path===""?{root:F.id,path:"",dir:!0}:{root:F.id,path:ve(V.path),dir:!0},ye=n("header",{className:"ws-head",children:[d?e("a",{className:"icon-button","aria-label":t("Back"),href:V.path===""?x("workspace"):Ee(pe),children:e(s,{name:"back"})}):e(Ae,{chip:!0,className:"ws-root-picker","aria-label":t("Place"),value:F.id,onChange:(M)=>X("workspace",We({root:M.target.value,path:"",dir:!0})),children:T.map((M)=>e("option",{value:M.id,children:Je(M)},M.id))}),e(Lt,{root:F,path:V.path}),F.writable?n("div",{className:"ws-head-actions",children:[e("button",{type:"button",className:"icon-button","aria-label":t("New file"),title:t("New file"),onClick:()=>Y({kind:"file",dir:U}),children:e(be,{name:"file-plus"})}),e("button",{type:"button",className:"icon-button","aria-label":t("New folder"),title:t("New folder"),onClick:()=>Y({kind:"dir",dir:U}),children:e(be,{name:"folder-plus"})}),e("button",{type:"button",className:"icon-button","aria-label":t("Trash"),title:t("Trash"),onClick:()=>Me(!0),children:e(s,{name:"trash"})})]}):null]}),$e=V.dir?e("div",{className:"ws-dir",children:e(Wt,{root:F,path:V.path,onMenu:(M)=>I(M)})}):e(zt,{root:F,path:V.path,phone:d},`${F.id}:${V.path}`),ge=P?tt(F.id,U,P):void 0,K=P?Ne(U,P.name):"";return n(ze.Provider,{value:y,children:[n("div",{className:"ws-page ws","data-wide":!d||void 0,style:{"--ws-tree":`${b}px`},children:[ye,n("div",{className:"ws-body",children:[!d?n(g,{children:[e("aside",{className:"ws-tree","aria-label":t("Folders"),children:e(wt,{root:F.id,path:"",depth:0,open:je,toggle:le,current:V})}),e($t,{width:b,onChange:(M)=>{W(M),Ue(ft,M)}})]}):null,e("section",{className:"ws-main",children:$e})]})]}),e(A,{open:P!==void 0,title:P?.name??"",onClose:()=>I(void 0),children:n("ul",{className:"more-list",children:[ge&&!ge.dir?e("li",{children:n("a",{className:"menu-item menu-link",href:we(F.id,K,!0),download:P?.name,onClick:()=>I(void 0),children:[e("span",{className:"menu-icon",children:e(s,{name:"download"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Download")})})]})}):null,F.writable&&P?n(g,{children:[e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{Y({kind:"rename",path:K,name:P.name}),I(void 0)},children:[e("span",{className:"menu-icon",children:e(s,{name:"notes"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Rename")})})]})}),e("li",{children:n("button",{type:"button",className:"menu-item",onClick:()=>{Te({path:K,name:P.name}),I(void 0)},children:[e("span",{className:"menu-icon",children:e(s,{name:"trash"})}),e("span",{className:"menu-text",children:e("strong",{children:t("Delete")})})]})})]}):null]})}),e(Mt,{root:F,ask:te,onClose:()=>Y(void 0),onDone:(M)=>{if(Y(void 0),w(),M)X("workspace",We(M))}}),e(Dt,{root:F,open:Be,onClose:()=>Me(!1)}),e(D,{open:ne!==void 0,title:t("Move to the trash?"),confirmLabel:t("Delete"),tone:"danger",onClose:()=>Te(void 0),onConfirm:async()=>{if(!ne)return;if(await q.remove(F.id,ne.path),f(t("Moved to the trash")),w(),!V.dir&&(V.path===ne.path||V.path.startsWith(`${ne.path}/`)))X("workspace",We({root:F.id,path:ve(V.path),dir:!0}))},children:e("p",{children:t("“{name}” goes to the trash, where you can bring it back.",{name:ne?.name??""})})})]})}function $t(i){let v=(w)=>Math.min(560,Math.max(180,w));return e("div",{className:"ws-resizer",role:"separator","aria-orientation":"vertical","aria-valuenow":i.width,"aria-valuemin":180,"aria-valuemax":560,"aria-label":t("Resize the folder list"),tabIndex:0,onKeyDown:(w)=>{if(w.key==="ArrowLeft")i.onChange(v(i.width-16));if(w.key==="ArrowRight")i.onChange(v(i.width+16))},onPointerDown:(w)=>{let y=w.clientX,T=i.width,N=w.currentTarget;N.setPointerCapture(w.pointerId);let O=(b)=>i.onChange(v(T+b.clientX-y)),L=()=>{N.removeEventListener("pointermove",O),N.removeEventListener("pointerup",L)};N.addEventListener("pointermove",O),N.addEventListener("pointerup",L)}})}export{yn as WorkspacePage};
|
package/dist/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
<link rel="stylesheet" crossorigin href="./chunk-index-t7csmbpy.css"><script type="module" crossorigin src="./chunk-index-
|
|
12
|
+
<link rel="stylesheet" crossorigin href="./chunk-index-t7csmbpy.css"><script type="module" crossorigin src="./chunk-index-htdkpbrd.js"></script></head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="root"></div>
|
|
15
15
|
|
package/dist/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=self,i=new URL(o.registration.scope);var d=new URL("index.html",i).href,h=new Set(["index.html","account-zk4efb87.css","chunk-account-
|
|
1
|
+
var o=self,i=new URL(o.registration.scope);var d=new URL("index.html",i).href,h=new Set(["index.html","account-zk4efb87.css","chunk-account-xz99gxg8.js","chunk-action-menu-fsxjfeaq.js","chunk-agent-bq536p6g.js","chunk-arranged-rooms-y2q330yg.js","chunk-attachments-s1z9jggf.js","chunk-bulk-actions-je4qp745.js","chunk-character-creator-x8grfnwr.js","chunk-command-menu-2etjx0c7.js","chunk-confirm-wn14ffh3.js","chunk-connectors-zxn3tbnv.js","chunk-conversations-2w67mmvv.js","chunk-council-sheet-b4b04w9y.js","chunk-council-view-wem4vdqc.js","chunk-drag-r9x782vs.js","chunk-entry-bq3j0xby.js","chunk-folder-list-bbn6ctsf.js","chunk-folds-55w643e1.js","chunk-gate-d8deb600.js","chunk-host-icons-knmx5qa0.js","chunk-host-picture-42n2n9gp.js","chunk-host-state-az2ka7rs.js","chunk-host-ui-1s0xyghd.js","chunk-index-0q15ysrb.js","chunk-index-0xdptr30.js","chunk-index-0xq8m6nw.js","chunk-index-1k6n0hh9.js","chunk-index-1kvnezap.js","chunk-index-25ewnkkb.js","chunk-index-3c4wvjkj.js","chunk-index-4fyrpzwf.js","chunk-index-50r5h98m.js","chunk-index-5j6m33d2.js","chunk-index-5x86qy8d.js","chunk-index-63qqjbs8.js","chunk-index-6btfp80d.js","chunk-index-6r61x1d2.js","chunk-index-711j3dpr.js","chunk-index-7379m5yw.js","chunk-index-7wksnc48.js","chunk-index-9hb4042t.js","chunk-index-9smnxvd0.js","chunk-index-ab60h2c5.js","chunk-index-apbknsyg.js","chunk-index-b5924bb7.js","chunk-index-bdf7gs56.js","chunk-index-d0vznz2x.js","chunk-index-de5x85yn.js","chunk-index-e6z5kyz8.js","chunk-index-evmzrr8e.js","chunk-index-fdv6mepk.js","chunk-index-ff8vzfgq.js","chunk-index-fw6kawhw.js","chunk-index-hd7k712z.js","chunk-index-hrpmm09c.js","chunk-index-htdkpbrd.js","chunk-index-jsgs2gmq.js","chunk-index-kjxva289.js","chunk-index-kkcx4bns.js","chunk-index-kvvmxbyh.js","chunk-index-mcb21c5a.js","chunk-index-n1w5rpxz.js","chunk-index-n7187vns.js","chunk-index-nk38jsgf.js","chunk-index-q6txr5q7.js","chunk-index-r868k92r.js","chunk-index-rj8cvc66.js","chunk-index-rny986v2.js","chunk-index-s6a9rvgd.js","chunk-index-sjt00y5k.js","chunk-index-sp35q2ay.js","chunk-index-t7csmbpy.css","chunk-index-t9an6yb2.js","chunk-index-tc8s2rz3.js","chunk-index-tn9qzrj2.js","chunk-index-vgn794d7.js","chunk-index-vvxr0vz8.js","chunk-index-w0vfwqck.js","chunk-index-w1rarv3r.js","chunk-index-xfr1byr9.js","chunk-index-xj1960qj.js","chunk-index-xwnkf825.js","chunk-index-y37ffyvy.js","chunk-index-yrr5wvja.js","chunk-index-z1fvb2kq.js","chunk-index-zwfdwgnb.js","chunk-layout-actions-x0xxb5da.js","chunk-mention-menu-b1k1tm6b.js","chunk-menu-items-2meta18j.js","chunk-mode-toggle-7a44994f.js","chunk-note-row-pab6wtf0.js","chunk-notes-m0sjp2ct.js","chunk-notice-bell-s15pgaw3.js","chunk-notices-zs8xg8v8.js","chunk-onboarding-sddzxrw5.js","chunk-overview-gkf6vfks.js","chunk-palette-m6bkdz1w.js","chunk-placement-items-cb66mx65.js","chunk-profile-mvj96kv6.js","chunk-prompt-history-mffm0c56.js","chunk-prompts-26ey03ak.js","chunk-room-confirms-1j8qfyj9.js","chunk-room-menu-6myvrac1.js","chunk-rooms-menu-button-3cnm8wdd.js","chunk-schedules-gjfm0x30.js","chunk-seat-menu-neps7phz.js","chunk-section-fold-pgrjf74t.js","chunk-settings-aa212bna.js","chunk-sheet-hosts-xwtaf228.js","chunk-shortcut-help-aaat3wrh.js","chunk-shortcuts-wt9x6qd6.js","chunk-skill-editor-4jkr948n.js","chunk-skills-87rvtwt1.js","chunk-start-over-line-59zn5ekf.js","chunk-switcher-list-43n1vf29.js","chunk-tab-dot-773bfgn1.js","chunk-table-1ghv10s7.js","chunk-table2d-4k5n9dxy.js","chunk-thread-actions-dd9ah02w.js","chunk-thread-cards-qs242xk1.js","chunk-thread-list-qxymkzs9.js","chunk-transcript-sjra3d3m.js","chunk-waiting-chip-yq3485cq.js","chunk-waiting-xmy1cyk1.js","chunk-where-m6ss9smq.js","chunk-workspace-jt68gwza.js","chunk-zh-tw-m2yyg5ty.js"].map((e)=>new URL(e,i).href)),w=/\/chunk-table3d-[a-z0-9]+\.js$/,g=/\/chunk-(?:codeeditor|lang-[a-z]+)-[a-z0-9]+\.js$/,k=["api/","auth/","login","files/","avatars/"],m=(e)=>{let n=e.pathname.slice(i.pathname.length);return k.some((t)=>n.startsWith(t))};async function v(e){let n=await caches.open("roundtable-web-b480fcf3aefe");try{let t=await fetch(e);if(t.ok&&new URL(e.url).href===i.href)await n.put(d,t.clone());return t}catch{let t=await n.match(d);if(t)return t;throw Error("offline and the shell is not cached")}}async function W(e){let n=await caches.open("roundtable-web-b480fcf3aefe"),t=await n.match(e);if(t)return t;let a=await fetch(e);if(a.ok)await n.put(e,a.clone());return a}var r=(e,n)=>typeof e==="string"&&e?e.slice(0,n):void 0;function l(e){if(typeof e!=="string")return i.href;let n=URL.parse(e,i);return n&&n.origin===i.origin&&n.pathname.startsWith(i.pathname)?n.href:i.href}var E=new Set(["notice","test"]);async function u(e,n){if(!e?.tag||!e.kind||!E.has(e.kind))return;try{await fetch(new URL("api/push/receipts",i),{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({tag:e.tag,event:n})})}catch{}}async function y(e){if(typeof e!=="number"||!Number.isSafeInteger(e)||e<0)return;try{if(e>0)await o.navigator.setAppBadge?.(e);else await o.navigator.clearAppBadge?.()}catch{}}async function P(e){let n={};try{let s=e.data?.json();if(typeof s==="object"&&s!==null)n=s}catch{}let t=r(n.tag,200),a=r(n.kind,16);if(await y(n.badge),a==="clear"){if(t)for(let s of await o.registration.getNotifications({tag:t}))s.close();return}await o.registration.showNotification(r(n.title,120)??"Roundtable",{body:r(n.body,240),icon:new URL("icons/192.png",i).href,badge:new URL("icons/badge-96.png",i).href,...t?{tag:t,renotify:!0}:{},...n.urgency==="high"?{requireInteraction:!0}:{},data:{url:l(n.url),...t?{tag:t}:{},...a?{kind:a}:{}}}),await u({...t?{tag:t}:{},...a?{kind:a}:{}},"received")}async function b(e){e.notification.close();let n=e.notification.data,t=l(n?.url),a=r(n?.tag,200),s=r(n?.kind,16),f=u({...a?{tag:a}:{},...s?{kind:s}:{}},"opened"),c=(await o.clients.matchAll({type:"window",includeUncontrolled:!0})).find((p)=>p.url.startsWith(i.href));if(c)await c.focus(),c.postMessage({type:"roundtable:open",url:t});else await o.clients.openWindow(t);await f}o.addEventListener("install",(e)=>{e.waitUntil(caches.open("roundtable-web-b480fcf3aefe").then((n)=>n.addAll([...h])).then(()=>o.skipWaiting()))});o.addEventListener("activate",(e)=>{e.waitUntil(caches.keys().then((n)=>Promise.all(n.filter((t)=>t.startsWith("roundtable-web-")&&t!=="roundtable-web-b480fcf3aefe").map((t)=>caches.delete(t)))).then(()=>o.clients.claim()))});o.addEventListener("fetch",(e)=>{let{request:n}=e;if(n.method!=="GET")return;let t=new URL(n.url);if(t.origin!==i.origin||!t.pathname.startsWith(i.pathname))return;if(m(t))return;if(n.mode==="navigate")e.respondWith(v(n));else if(h.has(t.origin+t.pathname)||w.test(t.pathname)||g.test(t.pathname))e.respondWith(W(n))});o.addEventListener("push",(e)=>{e.waitUntil(P(e))});o.addEventListener("notificationclick",(e)=>{e.waitUntil(b(e))});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-roundtable-web",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.3",
|
|
4
4
|
"description": "A web console for the owners of a pi-roundtable host: conversations, transcripts, and memory notes, with live updates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@types/react": "19.3.0",
|
|
71
71
|
"@types/react-dom": "19.3.0",
|
|
72
72
|
"@types/three": "0.186.0",
|
|
73
|
-
"pi-roundtable": "0.30.
|
|
73
|
+
"pi-roundtable": "0.30.3",
|
|
74
74
|
"react": "19.3.0",
|
|
75
75
|
"react-dom": "19.3.0",
|
|
76
76
|
"react-markdown": "10.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p,T,b,e,S}from"./chunk-index-st18ee4w.js";var a={profile:b(()=>(p("t5kyp6dt"),import("./chunk-profile-t5kyp6dt.js")).then((o)=>({default:o.ProfilePage}))),notices:b(()=>(p("qhghsyh5"),import("./chunk-notices-qhghsyh5.js")).then((o)=>({default:o.NoticesPage}))),onboarding:b(()=>(p("fzz1x8vk"),import("./chunk-onboarding-fzz1x8vk.js")).then((o)=>({default:o.OnboardingPage})))};function n({pane:o}){let t=a[o];return t?e(T,{fallback:e(S,{}),children:e(t,{})}):null}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p,T,b,ee,C,a,t,g,e,n,s,Xe,u,k,_,Oe,rn,Mn,te,Ae,Cr,qi,bo,Dt,Bi,vo}from"./chunk-index-st18ee4w.js";import"./chunk-index-8d5r201w.js";import"./chunk-index-1pgm1gy4.js";import{bn,fr}from"./chunk-index-cx9f5fae.js";import{Ue}from"./chunk-index-pmtgrd3x.js";import{Ni}from"./chunk-index-r9yg1hpr.js";import{bi}from"./chunk-index-qjqxs7c3.js";import{$i}from"./chunk-index-wk3w90nq.js";import{Jt}from"./chunk-index-m7er2xt6.js";import"./chunk-index-dafr7y87.js";import"./chunk-index-5rv9r0m6.js";import{ut}from"./chunk-index-9q2psqsq.js";bn();var O=b(()=>(p("rpccjz2c"),import("./chunk-folder-list-rpccjz2c.js")).then((o)=>({default:o.FolderList}))),Z=ee(function(m){let{view:i}=m,h=Jt(()=>rn(i.key),i.home?void 0:$i(i.key));return e(bo,{...m,press:h,item:{...i.home?{}:{"data-drop-item":"","data-key":i.key},...m.arranging?{"data-arranging":""}:{}},after:m.arranging?e("button",{type:"button",className:"icon-button row-more","aria-haspopup":"menu","aria-label":t("Room menu"),onClick:(r)=>{let c=r.currentTarget;rn(i.key).then((l)=>{if(!l)return;let N=c.getBoundingClientRect();Oe({...l,at:{x:N.left,y:N.bottom},via:"key",source:c})},()=>{return})},children:e(s,{name:"more",size:18})}):null})});function L(o){let{now:m}=te(),{timeZone:i}=_(),h=Dt(o.rooms);return e("ul",{className:"room-list",children:h.map(({key:r,...c})=>{let l=o.threads[r];return e(Z,{...c,active:r===o.active,now:m,timeZone:i,arranging:o.arranging,...l?{threads:e(Bi,{open:l.open,closed:l.closed,active:o.active,parent:r})}:{}},r)})})}function y(o){let i=Dt(o.rooms).length===0;if(i&&o.zone?.kind!=="pinned")return null;let h=o.zone?{"data-drop-zone":o.zone.kind,"data-zone-id":o.zone.id}:{},r=(c)=>e(L,{rooms:c,threads:o.threads,active:o.active,arranging:o.arranging});if(o.fold&&!i)return e(fr,{id:o.fold,title:o.title,rooms:o.rooms,active:o.active,attrs:h,children:r});return n("section",{className:"stack",...i?{"data-empty":""}:{},...h,children:[e("h2",{className:"section-title",children:o.title}),i?null:r(o.rooms)]})}function le(o){let m=Boolean(_().kinds?.length),i=u((d)=>JSON.stringify({listed:d.listed,...ut(d,(M)=>Xe(d,M))})),h=Ni(),r=a(i);if(!h)r.current=i;let c=r.current,{listed:l,...N}=C(()=>JSON.parse(c),[c]),{home:z,pinned:S,folders:R,restAgents:P,restGroups:D,rest:A,threads:F,orphans:f}=N,w=Cr(),K=z.length+S.length+A.length===0&&R.every((d)=>d.rooms.length===0)&&f.open.length+f.closed.length===0,v={threads:F,active:o.active,arranging:w};return n("div",{className:"page","data-column":o.active?"":void 0,"data-drop-root":"",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Rooms")}),n("div",{className:"actions",children:[n("button",{type:"button",className:"header-button search-button",onClick:o.onSearch,children:[e(s,{name:"search",size:16}),e("span",{children:t("Find a room")}),e("kbd",{children:"⌘K"})]}),l?e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(d)=>bi(d.currentTarget),children:e(s,{name:"more",size:18})}):null,e("button",{type:"button",className:"header-button icon-button","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(d)=>Mn(d.currentTarget),children:e(s,{name:"plus"})})]})]}),w?n("div",{className:"arrange-bar",children:[n("button",{type:"button",className:"secondary",onClick:()=>Ue({kind:"new"}),children:[e(s,{name:"plus",size:16}),e("span",{children:t("Add a folder")})]}),e("button",{type:"button",onClick:()=>qi(!1),children:t("Done")})]}):null,l&&K&&!m?e(k,{children:t("No rooms yet. Rooms appear when the team has a knight.")}):null,!l?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,e(y,{title:t("Home"),rooms:z,...v}),e(y,{title:t("Pinned"),rooms:S,zone:{kind:"pinned",id:"pinned"},fold:Ae("pinned"),...v}),R.length>0?e("div",{className:"stack folder-list","data-folder-list":"",children:e(T,{fallback:e("div",{className:"skeleton","aria-busy":"true"}),children:e(O,{folders:R,active:o.active,listed:l,rooms:(d)=>e(L,{rooms:d,threads:F,active:o.active,arranging:w})})})}):null,R.length>0?e(y,{title:t("Ungrouped"),rooms:A,zone:{kind:"rest",id:"rest"},fold:Ae("rest"),...v}):n(g,{children:[e(y,{title:t("Knights"),rooms:P,zone:{kind:"rest",id:"rest-agents"},fold:Ae("agents"),...v}),e(y,{title:t("Groups"),rooms:D,zone:{kind:"rest",id:"rest-groups"},fold:Ae("groups"),...v})]}),f.open.length+f.closed.length>0?n("section",{className:"stack",children:[e("h2",{className:"section-title",children:t("Dispatch threads")}),e(Bi,{open:f.open,closed:f.closed,active:o.active})]}):null,e(vo,{active:o.active})]})}export{le as ArrangedRoomsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,F,O,l,f}from"./chunk-index-st18ee4w.js";import{an}from"./chunk-index-1pgm1gy4.js";import"./chunk-index-8d5r201w.js";import{Ln,To}from"./chunk-index-jzkr4hc2.js";import{Qo}from"./chunk-index-dafr7y87.js";import{re}from"./chunk-index-pp00qvdb.js";import"./chunk-index-5rv9r0m6.js";var s=500,c=(n)=>{let r=[];for(let e=0;e<n.length;e+=s)r.push(n.slice(e,e+s));return r},i=()=>O.dispatch({type:"changed"});async function w(n){let r=Qo(n),e=Object.keys(r);if(e.length===0)return;let a=[];try{for(let o of c(e))a.push(...(await Ln.readAll(o)).moved)}catch(o){f(l(o),"danger"),i();return}an(Object.fromEntries(e.map((o)=>[o,0]))),f(F(e.length,"Marked {count} room as read","Marked {count} rooms as read"),"info",a.length?{label:t("Undo"),run:()=>void m(a,r)}:void 0)}async function m(n,r){try{for(let e of c(n)){let{restored:a}=await Ln.unreadAll(e);an(Object.fromEntries(a.map((o)=>[o,r[o]??0])))}}catch(e){f(l(e),"danger")}i()}var P=(n)=>To(n);async function d(n){try{await Ln.restoreHelpers(n)}catch(r){f(l(r),"danger")}i()}async function R(n){let r;try{r=(await Ln.archiveFinishedHelpers(n)).archived.flatMap((a)=>a.names)}catch(e){f(l(e),"danger"),i();return}if(i(),r.length===0)return;f(F(r.length,"Archived {count} temp knight","Archived {count} temp knights"),"info",{label:t("Undo"),run:()=>void d(r)})}async function T(n,r){try{await re.archiveAgent(n)}catch(e){f(l(e),"danger"),i();return}i(),f(t("Archived {name}",{name:r}),"info",{label:t("Undo"),run:()=>void d([n])})}export{T as archiveHelper,P as clearAllFinished,R as clearFinishedHelpers,w as markAllRead,d as putBackHelpers};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D}from"./chunk-index-1ysj78e4.js";import"./chunk-index-04ndj4hg.js";export{D as Confirm};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{er,Ur}from"./chunk-index-90f1mkn7.js";import"./chunk-index-4e5nhm4v.js";import"./chunk-index-pcb3mskd.js";import"./chunk-index-04ndj4hg.js";import"./chunk-index-90tq8g68.js";import"./chunk-index-r1g24er0.js";import"./chunk-index-1pgm1gy4.js";export{Ur as CouncilView,er as useCouncilSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p,o,R,t,F,g,e,n,s,Me,u,Oe,It,oi,go,Oo,$e,li,$n}from"./chunk-index-st18ee4w.js";import"./chunk-index-1pgm1gy4.js";import"./chunk-index-8d5r201w.js";import{ur}from"./chunk-index-cx9f5fae.js";import{Jt}from"./chunk-index-m7er2xt6.js";import{Wi}from"./chunk-index-9q2psqsq.js";var N=()=>(p("6vm38ver"),import("./chunk-layout-actions-6vm38ver.js")),b=(a)=>(p("e0bfeqj4"),import("./chunk-placement-items-e0bfeqj4.js")).then((r)=>r.folderMenu(a)),w=(a)=>({mode:"folder",key:a,item:(r)=>r.closest("[data-folder-block]"),root:(r)=>r.closest("[data-folder-block]")?.parentElement??null,onDrop:(r)=>{if(r.type==="folder")N().then((l)=>l.placeFolderBefore(a,r.before))},open:go});function k(a){let{id:r,name:l}=a,i=!a.folded,d=R(),m=Jt(()=>b(r),w(r)),f=(c)=>{b(r).then((y)=>{if(!y)return;let h=c.getBoundingClientRect();Oe({...y,at:{x:h.left,y:h.bottom},via:"key",source:c})},()=>{return})};return n("section",{className:"folder","aria-label":l,"data-folder-block":"","data-key":r,"data-drop-zone":"folder","data-zone-id":r,"data-folder":r,"data-collapsed":i?void 0:"",children:[n("header",{className:"folder-head","data-folder-head":"",...m,children:[n("button",{type:"button",className:"folder-toggle","aria-expanded":i,"aria-controls":d,"aria-label":i?t("Collapse {name}",{name:l}):t("Expand {name}",{name:l}),onClick:()=>oi(r),children:[e(s,{name:"chevron",size:16,className:"folder-chevron","data-open":i||void 0}),e("strong",{children:l}),e("span",{className:"meta",children:F(a.count,"{count} room","{count} rooms")}),i?null:a.stack]}),a.muted==="none"?null:e(s,{name:"bell-off",size:14,className:"muted-mark","data-partial":a.muted==="some"||void 0,role:"img","aria-hidden":!1,"aria-label":a.muted==="all"?t("Notifications are off"):t("Some notifications are off")}),i?null:a.summary,e("button",{type:"button",className:"icon-button folder-more","aria-haspopup":"menu","aria-label":t("Folder menu"),onClick:(c)=>f(c.currentTarget),children:e(s,{name:"more",size:18})})]}),e("div",{id:d,className:"folder-body",hidden:!i&&a.shown===0,children:i&&a.count===0?e("p",{className:"meta folder-empty",children:t("No rooms in this folder yet.")}):a.shown>0?a.children:null})]})}var S=4;function v(a){let r=a.rooms.slice(0,S),l=u((d)=>r.map((m)=>d.rooms[m]?.view),r.join(",")),i=a.rooms.length-r.length;return n("span",{className:"folder-stack","aria-hidden":"true",children:[l.map((d)=>d?e("span",{className:"folder-stack-item",children:e($e,{view:d,size:28})},d.key):null),i>0?n("span",{className:"folder-stack-more",children:["+",i]}):null]})}function M(a){let r=u((l)=>({waiting:a.rooms.reduce((i,d)=>i+Me(l,d),0),typing:a.rooms.some((i)=>l.rooms[i]?.typing)}),a.rooms.join(","));return n(g,{children:[r.typing?e(li,{}):null,r.waiting?e($n,{count:r.waiting}):null]})}function C(a){return u((r)=>Wi(a,(l)=>r.rooms[l]?.view?.muted===!0),a.join(","))}function U(a){let r=a.folders.map((l)=>l.id).join(",");return o(()=>{if(a.listed)Oo(r?r.split(","):[])},[a.listed,r]),e(g,{children:a.folders.map((l)=>e(B,{folder:l,...a},l.id))})}function B(a){let{folder:r}=a,l=C(r.rooms),i=It().has(r.id),d=ur(r.rooms,a.active),m=i?d:r.rooms,f=i?r.rooms.filter((c)=>!d.includes(c)):[];return e(k,{id:r.id,name:r.name,count:r.rooms.length,folded:i,shown:m.length,muted:l,summary:e(M,{rooms:f}),stack:f.length>0?e(v,{rooms:f}):null,children:a.rooms(m)})}export{U as FolderList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ae,It,mo,oi,go,Oo}from"./chunk-index-st18ee4w.js";export{mo as collapsedNow,go as expandFolder,Oo as pruneCollapsed,Ae as sectionFold,oi as toggleCollapsed,It as useCollapsed};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-mec7bz30.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{st}from"./chunk-index-qzss6deb.js";export{st as HostPicture};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ro,me,Er,Co,Eo,Ao,$o,an,Ar,No,Ia}from"./chunk-index-1pgm1gy4.js";export{No as keepCards,Ar as keepReads,$o as noCards,Ao as noReads,Ia as onFrame,an as seedUnread,Ro as subscribeHost,Co as totalUnread,Eo as unreadCounts,Er as unreadOf,me as useHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ee,E,o,R,Se,C,a,r,t,F,g,e,n,s,x,xn,O,u,fe,l,f,S,m,k,Q,tn,ei,$t,_,co,Te,nn,kn,Nt,_n,Re,Tn,zt,po,te,En,kr,_r,Tr,ze}from"./chunk-index-st18ee4w.js";import{qn}from"./chunk-index-pcb3mskd.js";import{tr,as,He,nr}from"./chunk-index-4e5nhm4v.js";import{D}from"./chunk-index-1ysj78e4.js";import{me,Ao,$o,an,Ar,No}from"./chunk-index-1pgm1gy4.js";import{ot,st}from"./chunk-index-qzss6deb.js";import{Vr}from"./chunk-index-2k2jvegd.js";import"./chunk-index-mec7bz30.js";import{Ee}from"./chunk-index-g086dss5.js";import{H}from"./chunk-index-a36h36x0.js";import"./chunk-index-04ndj4hg.js";function Ke(c){let i={};for(let d of c)if(d.type==="multiselect")i[d.name]=[...Oe(d.initial)];else i[d.name]=Oe(d.initial)[0]??"";return i}var Oe=(c)=>c===void 0?[]:typeof c==="string"?[c]:[...c];function et(c,i){let d={};for(let p of c){let y=i[p.name];if(y===void 0||y===""||y.length===0)continue;d[p.name]=y}return d}function tt(c){let{field:i,value:d}=c,[p,y]=r(""),w=i.search?i.options.filter((h)=>h.label.toLowerCase().includes(p.trim().toLowerCase())):i.options,N=i.search?e("input",{type:"search",value:p,placeholder:t("Search…"),"aria-label":t("Search {name}",{name:i.label}),onChange:(h)=>y(h.target.value)}):null;if(i.type==="select")return n(g,{children:[N,n(Ee,{id:c.id,value:String(d),required:i.required===!0,"aria-describedby":c.described,...i.search?{size:6}:{},onChange:(h)=>c.onChange(h.target.value),children:[i.required?null:e("option",{value:"",children:t("None")}),w.map((h)=>e("option",{value:h.value,children:h.label},h.value))]})]});let b=new Set(Array.isArray(d)?d:[]);return n(g,{children:[N,e("fieldset",{"aria-describedby":c.described,children:w.map((h)=>n("label",{children:[e("input",{type:"checkbox",checked:b.has(h.value),onChange:(T)=>{let v=new Set(b);if(T.target.checked)v.add(h.value);else v.delete(h.value);c.onChange(i.options.filter((P)=>v.has(P.value)).map((P)=>P.value))}}),h.label]},h.value))})]})}function nt(c){let{field:i,value:d}=c,p=R(),y="hint"in i?i.hint:void 0,w=c.error||y?`${p}-note`:void 0,N;if("options"in i)N=e(tt,{field:i,id:p,value:d,described:w,onChange:c.onChange});else if(i.type==="textarea")N=e("textarea",{id:p,rows:5,value:String(d),maxLength:i.max??8000,required:i.required===!0,"aria-describedby":w,onChange:(b)=>c.onChange(b.target.value)});else N=e("input",{id:p,type:i.type==="url"?"url":"text",value:String(d),maxLength:i.max??500,required:i.required===!0,"aria-describedby":w,onChange:(b)=>c.onChange(b.target.value)});return n("div",{className:"host-field",children:[i.type==="multiselect"?e("span",{className:"field-label",children:i.label}):e("label",{htmlFor:p,children:i.label}),N,c.error||y?e("span",{id:`${p}-note`,className:c.error?"field-error":"hint",role:c.error?"alert":void 0,children:c.error??y}):null]})}function pe(c){let{spec:i}=c,[d,p]=r(()=>Ke(i.fields)),[y,w]=r(!1),[N,b]=r();return n("form",{className:"host-form",onSubmit:async(T)=>{if(T.preventDefault(),y)return;w(!0),b(void 0);try{b(await c.onSubmit(et(i.fields,d)))}catch(v){b({error:l(v)})}finally{w(!1)}},children:[i.fields.map((T)=>e(nt,{field:T,value:d[T.name]??"",error:N?.field===T.name?N.error:void 0,onChange:(v)=>p((P)=>({...P,[T.name]:v}))},T.name)),N&&!i.fields.some((T)=>T.name===N.field)?e(m,{message:N.error}):null,n("div",{className:"actions",children:[c.onCancel?e("button",{type:"button",className:"secondary",disabled:y,onClick:c.onCancel,children:t("Cancel")}):null,e("button",{type:"submit",disabled:y,children:i.submit})]})]})}function rt(c){if(!c.ok)return{error:tr(c.error),...c.field?{field:c.field}:{}};if(c.notice)f(c.notice);if(c.open)nr(c.open);return}function oe(c){let[i,d]=r(),[p,y]=r(!1),w=async(b,h)=>rt(await c.run(b,h)),N=async(b)=>{if(b.form||b.confirm){d(b);return}y(!0);try{let h=await w(b,{});if(h)f(h.error,"danger")}catch(h){f(l(h),"danger")}finally{y(!1)}};if(c.actions.length===0)return null;return n("div",{className:c.className??"host-actions",children:[c.actions.map((b)=>e("button",{type:"button",className:b.style==="danger"?"danger":b.style==="secondary"?"secondary":"",disabled:p,onClick:()=>N(b),children:b.label},b.id)),i?.form?e(H,{open:!0,title:i.form.title,onClose:()=>d(void 0),children:e(pe,{spec:i.form,onCancel:()=>d(void 0),onSubmit:async(b)=>{let h=await w(i,b);if(!h)d(void 0);return h}})}):i?e(D,{open:!0,title:i.label,confirmLabel:i.label,tone:i.style==="danger"?"danger":"primary",onConfirm:async()=>{let b=await w(i,{});if(b)throw Error(b.error)},onClose:()=>d(void 0),children:e("p",{children:i.confirm})}):null]})}var _e=/^file:([A-Za-z0-9_-]{1,64})$/;function qe(c){let i=URL.parse(c,document.baseURI);return i!==null&&i.origin===window.location.origin}function it({id:c,alt:i}){return e("img",{className:"file-image",src:`api/files/${encodeURIComponent(c)}`,alt:i,loading:"lazy",decoding:"async",onError:(d)=>{let p=document.createElement("span");p.textContent=i||t("Image"),d.currentTarget.replaceWith(p)}})}var re=ee(function({source:i}){return e("div",{className:"prose",children:e(tn,{remarkPlugins:[$t],urlTransform:(d)=>_e.test(d)?d:ei(d),components:{a:({href:d,children:p})=>d&&/^https?:\/\//.test(d)&&!qe(d)?e("a",{href:d,target:"_blank",rel:"noreferrer noopener",children:p}):d&&qe(d)?e("a",{href:d,children:p}):e("span",{children:p}),img:({src:d,alt:p})=>{let y=typeof d==="string"?_e.exec(d):null;return y?.[1]?e(it,{id:y[1],alt:p??""}):e("span",{children:p})},pre:co,table:({children:d})=>e("div",{className:"table-wrap",children:e("table",{children:d})})},children:i})})});function at(c){switch(c??"open"){case"working":return t("Working…");case"done":return t("Done");case"superseded":return t("Replaced");case"expired":return t("Expired");default:return""}}var Ne=(c)=>(c.state??"open")==="open";function ae(c){let{card:i}=c,d=at(i.state);return n("article",{className:"host-card","data-tone":i.tone??"note","data-state":i.state??"open",children:[n("header",{children:[e("h3",{children:i.title}),d?e(Q,{tone:i.state==="working"?"busy":"plain",children:d}):null]}),i.body?e(re,{source:i.body}):null,i.links?.length?e("div",{className:"host-card-links",children:i.links.map((p)=>e("a",{href:p.url,...p.url.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:p.label},`${p.url}`))}):null,Ne(i)&&i.buttons?.length?e(oe,{actions:i.buttons,run:c.run}):null]})}ot();function lt(){let[c,i]=r(()=>qn().toString());return o(()=>{let d=()=>i(qn().toString());return window.addEventListener("popstate",d),window.addEventListener("hashchange",d),()=>{window.removeEventListener("popstate",d),window.removeEventListener("hashchange",d)}},[]),c}function ct(c){if(!c.ok)return{error:tr(c.error),...c.field?{field:c.field}:{}};if(c.notice)f(c.notice);if(c.open)nr(c.open);return}function dt(c){let{section:i}=c;switch(i.kind){case"markdown":return e(re,{source:i.text});case"card":return e(ae,{card:i.card,run:c.run});case"form":return n("section",{className:"stack",children:[e("h2",{className:"section-title",children:i.form.title}),e(pe,{spec:i.form,onSubmit:(d)=>c.submit(i.action,d)})]});case"list":return n("section",{className:"stack",children:[i.title?e("h2",{className:"section-title",children:i.title}):null,i.rows.length===0?e(k,{children:t("Nothing here.")}):null,e("ul",{className:"host-list",children:mt(i.rows).map(([d,p])=>n("li",{children:[p.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null,n("div",{className:"host-list-main",children:[p.open?e("a",{href:p.open,...p.open.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:p.title}):e("strong",{children:p.title}),p.subtitle?e("span",{children:p.subtitle}):null]}),p.actions?.length?e(oe,{actions:p.actions,run:c.run}):null]},d))})]})}}function ut({routeKey:c}){let i=c??"",d=lt(),p=me((v)=>v.pages[i]??0),[y,w]=r(0),[N,b]=r({});o(()=>{let v=!0;return He.page(i,Object.fromEntries(new URLSearchParams(d))).then((P)=>v&&b({page:P}),(P)=>{if(!v)return;let q=P instanceof fe&&P.status===404;b((z)=>({...q||!z.page?{}:{page:z.page},error:l(P),gone:q}))}),()=>{v=!1}},[i,d,p,y]);let h=async(v,P)=>{let q=await He.pageAct(i,{action:v,input:P}),z=ct(q);if(!z)w((V)=>V+1);return z},T=async(v,P)=>{let q=await He.pageAct(i,{action:v.id,input:P});if(q.ok)w((z)=>z+1);return q};if(N.gone)return e("div",{className:"page",children:e(k,{children:t("This page is not available.")})});if(!N.page)return e("div",{className:"page",children:N.error?e(m,{message:N.error}):e(S,{})});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:N.page.title})}),N.error?e(m,{message:N.error}):null,N.page.sections.map((v,P)=>e(dt,{section:v,run:T,submit:h},P))]})}function mt(c){let i=new Map;return c.map((d)=>{let p=i.get(d.title)??0;return i.set(d.title,p+1),[`${d.title}:${p}`,d]})}function De(c){let i=me((T)=>T.cards[c.room]??$o),d=Re("(min-width: 720px) and (min-height: 760px)"),[p,y]=r();if(i.length===0)return null;let w=i.filter((T)=>Ne(T)||T.state==="working"),N=i.filter((T)=>!w.includes(T)),b=p??(d&&w.length>0),h=w[0];return n("div",{className:"host-cards","data-open":b||void 0,children:[n("button",{type:"button",className:"host-cards-toggle","aria-expanded":b,onClick:()=>y(!b),children:[e(s,{name:"chevron",size:14}),h?n("span",{children:[e("strong",{children:F(w.length,"{count} card waiting","{count} cards waiting")}),`: ${h.title}`]}):e("span",{children:t("Earlier cards ({count})",{count:N.length})})]}),b?n("div",{className:"host-cards-body",children:[w.map((T)=>e(ae,{card:T,run:c.run(T.id)},T.id)),N.length?n("details",{className:"host-cards-older",children:[e("summary",{children:t("Earlier cards ({count})",{count:N.length})}),N.map((T)=>e(ae,{card:T,run:c.run(T.id)},T.id))]}):null]}):null]})}var ft=/https?:\/\/[^\s<>"']+/g,pt=/[.,;:!?)\]}\u3001\u3002\uff0c\uff1b\uff1a\uff01\uff1f\uff09\u300d\u300f]+$/;function gt(c){let i=c.replace(pt,""),d=URL.parse(i);return d&&(d.protocol==="https:"||d.protocol==="http:")?i:""}function Ue({text:c}){let i=[],d=0;for(let p of c.matchAll(ft)){let y=gt(p[0]);if(y==="")continue;let w=p.index;if(w>d)i.push(c.slice(d,w));i.push(e("a",{href:y,target:"_blank",rel:"noreferrer noopener",children:y},`${w}`)),d=w+y.length}if(d<c.length)i.push(c.slice(d));return e("span",{className:"plain",children:i})}var $e=ee(function(i){let{message:d}=i,p=d.authorKind??"external";if(p==="notice")return n("li",{className:"host-notice","data-mid":d.id,"data-highlight":i.highlighted||void 0,"data-enter":i.enter||void 0,children:[e(s,{name:"bell",size:14}),e(re,{source:d.text}),e("time",{dateTime:d.at,children:nn(d.at,i.timeZone)})]});let y=p==="member"&&d.principalId!==void 0&&d.principalId===i.me;return n("li",{className:"message","data-mid":d.id,"data-author":p,"data-mine":y||void 0,"data-header":i.header||void 0,"data-enter":i.enter||void 0,"data-unread":i.unread||void 0,"data-highlight":i.highlighted||void 0,children:[y?null:e("span",{className:"message-avatar",children:i.header?e(st,{picture:d.picture,name:d.author}):null}),n("div",{className:"message-main",children:[i.header?n("div",{className:"message-meta",children:[e("strong",{children:d.author}),d.authorLabel?e("span",{className:"label-chip",children:d.authorLabel}):null,e("time",{dateTime:d.at,children:nn(d.at,i.timeZone)})]}):null,n("div",{className:"bubble",children:[e(po,{files:d.files}),d.text?p==="assistant"?e(re,{source:d.text}):e(Ue,{text:d.text}):null,e(zt,{files:d.files,message:d}),d.expiredFiles?e("p",{className:"message-expired",children:F(d.expiredFiles,"{count} file was removed","{count} files were removed")}):null]}),d.edited?e("span",{className:"message-edited",children:t("edited")}):null]})]})});var ht=1500,bt=96,ge=new Set,Ae=new Map;function yt(c){if(document.visibilityState!=="visible")return!1;return!c||c.scrollHeight-c.scrollTop-c.clientHeight<bt}function Be(c){if(!(c instanceof Element))return;let i=c.closest("[data-unread][data-mid]");return i?Number(i.dataset.mid):void 0}function Ge(c){let{room:i,scroller:d,messages:p,began:y,enterAfter:w,me:N,shared:b}=c,h=a({seen:void 0,watched:new Set}),[,T]=r(0),v=Ae.get(i)??ge;if(w!==void 0&&p){let M=h.current;M.seen??=w;let I=yt(d.current),W=M.seen;for(let L of p){if(L.id<=M.seen)continue;if(I)M.watched.add(L.id);W=Math.max(W,L.id)}M.seen=W}let P=C(()=>{if(y===void 0||w===void 0||!p)return ge;let M=new Set;for(let I of p){if(I.id===0||I.id<=y)continue;if(I.kind==="system"||I.note)continue;if(I.authorKind==="notice")continue;if(I.principalId===void 0?I.kind==="owner"&&!b:I.principalId===N)continue;if(h.current.watched.has(I.id)||v.has(I.id))continue;M.add(I.id)}return M.size===0?ge:M},[p,y,w,N,b,v]),q=E((M)=>{let I=Ae.get(i)??ge;if(I.has(M))return;Ae.set(i,new Set(I).add(M)),T((W)=>W+1)},[i]),z=P.size>0;o(()=>{let M=d.current;if(!M||!z)return;let I=(L)=>{if(L.pointerType==="touch")return;let G=Be(L.target);if(G!==void 0)q(G)},W=(L)=>{let G=Be(L.target);if(G!==void 0)q(G)};return M.addEventListener("pointerover",I,{passive:!0}),M.addEventListener("focusin",W,{passive:!0}),M.addEventListener("click",W,{passive:!0}),()=>{M.removeEventListener("pointerover",I),M.removeEventListener("focusin",W),M.removeEventListener("click",W)}},[d,q,z]);let V=a(new Map),B=[...P].join(",");return o(()=>{let M=d.current,I=V.current;for(let[Z,Y]of I)if(!P.has(Z))clearTimeout(Y),I.delete(Z);if(!M||!z||typeof IntersectionObserver!=="function"||!matchMedia("(pointer: coarse)").matches)return;let W=(Z)=>{let Y=I.get(Z);if(Y===void 0)return;clearTimeout(Y),I.delete(Z)},L=new IntersectionObserver((Z)=>{for(let Y of Z){let ne=Number(Y.target.dataset.mid),le=Y.rootBounds;if(!(Y.isIntersecting&&(Y.intersectionRatio>=0.5||le!==null&&Y.intersectionRect.height>=le.height*0.5))){W(ne);continue}if(I.has(ne))continue;I.set(ne,setTimeout(()=>{if(I.delete(ne),document.visibilityState==="visible")q(ne)},ht))}},{root:M,threshold:[0,0.25,0.5,0.75,1]}),G=[...M.querySelectorAll("[data-unread][data-mid]")];for(let Z of G)L.observe(Z);let j=()=>{if(document.visibilityState!=="visible")return;for(let Z of G)L.unobserve(Z),L.observe(Z)};return document.addEventListener("visibilitychange",j),()=>{document.removeEventListener("visibilitychange",j),L.disconnect()}},[d,q,z,B]),o(()=>{let M=V.current;return()=>{for(let I of M.values())clearTimeout(I);M.clear()}},[]),P}ot();var vt=3;function wt({marks:c}){let[i,d]=r(!1);return n("li",{className:"seen",children:[n("button",{type:"button",className:"seen-toggle","aria-expanded":i,onClick:()=>d((p)=>!p),children:[c.slice(0,vt).map((p)=>e(st,{picture:{principal:p.principal},name:p.name,size:16},p.principal)),e("span",{children:t("Seen by {count}",{count:c.length})})]}),i?e("span",{className:"seen-names",children:c.map((p)=>p.name).join(t(", "))}):null]})}function kt(c,i){let d=ze(),p=u((y)=>y.connects);o(()=>{let y=i.current;if(!y)return;let w=0,N=0,b,h,T=()=>{if(h=void 0,document.visibilityState!=="visible")return;let q=y.getBoundingClientRect(),z=0;for(let B of y.querySelectorAll("[data-mid]")){let M=B.getBoundingClientRect();if(M.bottom>q.top&&M.top<q.bottom-4)z=Math.max(z,Number(B.dataset.mid))}if(z<=w)return;let V=N+1000-Date.now();if(V>0){clearTimeout(b),b=setTimeout(v,V);return}if(d.send({type:"read",room:c,upTo:z}))w=z,N=Date.now()},v=()=>{if(h===void 0)h=requestAnimationFrame(T)};y.addEventListener("scroll",v,{passive:!0}),document.addEventListener("visibilitychange",v),window.addEventListener("resize",v);let P=new MutationObserver(v);return P.observe(y,{childList:!0,subtree:!0}),v(),()=>{if(y.removeEventListener("scroll",v),document.removeEventListener("visibilitychange",v),window.removeEventListener("resize",v),P.disconnect(),clearTimeout(b),h!==void 0)cancelAnimationFrame(h)}},[d,c,i,p])}function he(c){let{roomKey:i}=c;kt(i,c.scroller);let d=u((v)=>v.principal?.id),p=u((v)=>v.rooms[i]?.messages),y=me((v)=>v.reads[i]??Ao),w=me((v)=>v.cursor[i]),N=a(void 0);if(N.current===void 0&&w!==void 0)N.current=w;let b=u((v)=>v.rooms[i]?.view?.notes===!0),h=Ge({room:i,scroller:c.scroller,messages:p,began:N.current,enterAfter:c.enterAfter,me:d,shared:c.host===!0||b}),T=C(()=>{let P=(p??[]).filter((V)=>V.kind!=="system"),q=N.current===void 0?void 0:P.find((V)=>V.id>(N.current??0)&&(V.principalId===void 0||V.principalId!==d))?.id,z=new Map;for(let V of y){if(V.principal===d)continue;let B=P.findLast((M)=>M.id<=V.upTo);if(B)z.set(B.id,[...z.get(B.id)??[],V])}return{before:(V)=>V.id===q?e("li",{className:"new-divider",children:e("span",{children:t("New messages")})}):null,after:(V)=>{let B=z.get(V.id);return B?e(wt,{marks:B}):null},unread:(V)=>h.has(V.id),...c.host?{message:(V,B)=>V.kind==="system"&&V.authorKind===void 0?void 0:e($e,{message:V,header:B.header,enter:B.enter,unread:B.unread,timeZone:B.timeZone,me:d,highlighted:c.highlight===V.id})}:{}}},[p,y,d,c.host,c.highlight,h]);return e(En,{roomKey:i,enterAfter:c.enterAfter,quotable:c.quotable,decor:T})}ot();var Ht=20,Rt=2600,We;function St(c,i,d){let p=u((b)=>b.connects),y=me((b)=>b.rooms[c]??0),[w,N]=r({view:void 0,error:void 0,gone:!1});return o(()=>{let b=!0;return He.open(i,d).then((h)=>{if(!b)return;O.dispatch({type:"history_loaded",room:c,messages:h.messages,more:h.more,older:!1}),Ar(c,h.reads,h.cursor),No(c,h.cards),N({view:h,error:void 0,gone:!1})},(h)=>{if(!b)return;let T=h instanceof fe&&h.status===404;N((v)=>({view:T?void 0:v.view,error:l(h),gone:T}))}),()=>{b=!1}},[c,i,d,p,y]),w}function At(c){let{header:i}=c;return n(g,{children:[i.banner?e("p",{className:"host-banner","data-tone":i.banner.tone,role:"status",children:i.banner.text}):null,i.fields.length?e("dl",{className:"host-head-fields",children:i.fields.map((d)=>n("div",{children:[e("dt",{children:d.label}),e("dd",{children:d.link?e("a",{href:d.link,...d.link.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:d.value}):d.value})]},`${d.label}:${d.value}`))}):null,e(oe,{className:"host-actions bar",actions:i.actions,run:c.run})]})}function Et({roomKey:c}){let i=ze(),d=as(c),p=d?.kind??"",y=d?.id??"",{view:w,error:N,gone:b}=St(c,p,y),h=u((A)=>A.rooms[c]),T=u((A)=>A.limits),v=u((A)=>A.connects),P=u((A)=>A.connection==="open"),q=a(null),z=a(null),{away:V,onScroll:B,onGrow:M,toEnd:I}=Tr(q),[W,L]=r(!1),[G,j]=r(),[Z,Y]=r(We),[ne,le]=r(!1),[Le,Me]=r(),ye=a(void 0),se=a(void 0),J=w!==void 0,ce=kr(!Re("(min-width: 1024px)"));if(o(()=>{if(!d||b||!J)return;return i.send({type:"subscribe",room:c}),i.focus(c),()=>{i.focus(void 0),i.send({type:"unsubscribe",room:c})}},[i,c,v,b,J]),J&&ye.current===void 0)ye.current=h?.messages.at(-1)?.id??0;Se(()=>{if(J)I(!1)},[J]),Se(()=>{let A=q.current;if(A&&se.current!==void 0)A.scrollTop+=A.scrollHeight-se.current,se.current=void 0},[h?.messages[0]?.id]),o(()=>{let A=z.current;if(!A||typeof ResizeObserver>"u")return;let U=new ResizeObserver(M);return U.observe(A),()=>U.disconnect()},[M]);let ve=E(async()=>{let A=O.getState().rooms[c]?.messages[0];if(!A)return!1;let U=await He.older(p,y,A.id,xn);return O.dispatch({type:"history_loaded",room:c,messages:U.messages,more:U.more,older:!0}),Ar(c,U.reads,void 0),U.more},[c,p,y]),de=a(void 0);o(()=>{let A=()=>{let U=Number(qn().get("message"));de.current=Number.isSafeInteger(U)&&U>0?U:void 0};return A(),window.addEventListener("popstate",A),()=>window.removeEventListener("popstate",A)},[]);let we=h?.messages[0]?.id,Fe=h?.more===!0;o(()=>{let A=de.current,U=q.current;if(!J||A===void 0||!U)return;let X=U.querySelector(`[data-mid="${A}"]`);if(X){de.current=void 0,X.scrollIntoView({block:"center"}),Me(A),requestAnimationFrame(()=>U.dispatchEvent(new Event("scroll"))),setTimeout(()=>Me(void 0),Rt);return}if(we!==void 0&&A<we&&Fe){let ie=0;(async()=>{if(ie+=1,!await ve().catch(()=>!1)||ie>=Ht)de.current=void 0})()}},[J,we,Fe,h?.messages.length,ve]);let xe=(A,U={},X)=>He.act(p,y,{action:A.id,...X===void 0?{}:{card:X},input:U}),Ye=(A,U)=>xe(A,U),Je=(A)=>(U,X)=>xe(U,X,A);if(b||!J&&!N&&!d)return e("section",{className:"room",children:n("div",{className:"page",children:[e(k,{children:t("This room is not available.")}),e("a",{className:"back",href:x("rooms"),children:t("Back to rooms")})]})});let K=w?.access.send??[],ke=K.length>1,Ie=ke&&ne,Ve=Z&&K.includes(Z)?Z:K.includes("turn")?"turn":K[0],Pe=Ie||Ve==="turn",Xe=Pe?w?.wording?.turn?.placeholder??t("Ask AI…"):w?.wording?.note?.placeholder??t("Write an internal note…"),ue=w?.header.title??c,je=h?.messages??[];return n("section",{className:"room",...ce.surface,onDragOver:(A)=>{if(K.length&&A.dataTransfer.types.includes("Files"))A.preventDefault()},onDrop:(A)=>{if(!K.length||!A.dataTransfer.files.length)return;A.preventDefault(),j([...A.dataTransfer.files])},children:[n("header",{className:"room-head",children:[e("a",{className:"icon-button room-back",href:x("rooms"),"aria-label":t("Back to rooms"),children:e(s,{name:"back"})}),e(_n,{open:ce.enabled?ce.show:void 0,children:e(st,{name:ue,size:40})}),n("div",{className:"room-title",children:[e("h1",{children:ue}),e("span",{className:"room-status","data-working":h?.typing||void 0,children:h?.typing?t("Working…"):t("Host room")})]})]}),!P?n("div",{className:"offline-banner",role:"status",children:[e("span",{className:"spinner","aria-hidden":"true"}),t("Reconnecting… messages wait here until it is back.")]}):null,w?e(At,{header:w.header,run:Ye}):null,e("div",{className:"room-scroll",ref:q,onScroll:B,children:n("div",{className:"room-content",ref:z,children:[N?e(m,{message:N}):null,!J&&!N?e(S,{}):null,h?.more?e("button",{type:"button",className:"secondary older",disabled:W,onClick:async()=>{L(!0),se.current=q.current?.scrollHeight;try{await ve()}catch(A){se.current=void 0,f(l(A),"danger")}finally{L(!1)}},children:W?t("Loading…"):t("Load earlier messages")}):null,J&&je.length===0?e(k,{children:t("No messages yet.")}):null,e(he,{roomKey:c,enterAfter:ye.current,quotable:!1,scroller:q,host:!0,highlight:Le}),h?.typing?e(Tn,{name:ue,progress:h.progress}):null]})}),V?n("button",{type:"button",className:"to-end",onClick:()=>I(!0),children:[e(s,{name:"send",size:16,style:{transform:"rotate(180deg)"}}),t("Latest")]}):null,w?e(De,{room:c,run:Je}):null,w&&K.length===0?e("p",{className:"room-note",children:t("You can read this room but not write in it.")}):null,w&&K.length>0?e(Nt,{draftKey:c,name:ue,placeholder:Xe,onAddressed:le,...ke?{above:e(Vr,{on:Pe,label:w?.wording?.turn?.label??t("@AI"),...Ie?{locked:t("The message starts with @AI, so the knight answers.")}:{},onChange:(A)=>{let U=A?"turn":"note";We=U,Y(U)}})}:{},limits:T,stoppable:Boolean(h?.stoppable),onSend:(A,U,X)=>{if(ke&&X){let ie=kn(A);i.say(c,ie===""&&U.length===0?A:ie,U,"turn")}else i.say(c,A,U,Ve);I(!0)},onStop:()=>i.send({type:"stop",room:c}),...G?{incoming:G,onIncomingTaken:()=>j(void 0)}:{}},c):null,e(_r,{...ce.drawer,current:c})]})}ot();function be({room:c}){let i=me((d)=>d.unread[c]??0);if(i<=0)return null;return e("span",{className:"unread-mark",role:"img","aria-label":F(i,"{count} unread message","{count} unread messages"),children:i>99?"99+":i})}ot();var Ct=6,Lt=250;function Ce(c){let{kind:i}=c,{timeZone:d}=_(),{now:p}=te(),y=u((L)=>L.connects),w=me((L)=>L.lists[i]??0),[N,b]=r(""),[h,T]=r(""),[v,P]=r(),[q,z]=r(),[V,B]=r(),[M,I]=r(!1);o(()=>{let L=setTimeout(()=>T(N.trim()),Lt);return()=>clearTimeout(L)},[N]),o(()=>{let L=!0;return He.list(i,h||void 0).then((G)=>{if(!L)return;an(Object.fromEntries(G.rooms.map((j)=>[j.key,j.unread??0]))),P(G.rooms),z(G.cursor),B(void 0)},(G)=>L&&B(l(G))),()=>{L=!1}},[i,h,y,w]);let W=async()=>{if(!q||M)return;I(!0);try{let L=await He.list(i,h||void 0,q);an(Object.fromEntries(L.rooms.map((G)=>[G.key,G.unread??0]))),P((G)=>[...G??[],...L.rooms]),z(L.cursor)}catch(L){B(l(L))}finally{I(!1)}};return n("section",{className:"stack",children:[n("h2",{className:"section-title",children:[c.icon?e(s,{name:c.icon,size:14,className:"section-icon"}):null,c.label]}),v&&(v.length>=Ct||h||N)?e("input",{type:"search",className:"kind-filter",value:N,placeholder:t("Search {name}",{name:c.label}),"aria-label":t("Search {name}",{name:c.label}),onChange:(L)=>b(L.target.value)}):null,V?e(m,{message:V}):null,!v&&!V?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,v&&v.length===0?e(k,{children:h?t("Nothing matches."):t("No rooms yet.")}):null,v&&v.length>0?e("ul",{className:"room-list",children:v.map((L)=>e("li",{children:n("a",{className:"room-row",href:x("room",L.key),"aria-current":L.key===c.active?"page":void 0,children:[n("span",{className:"kind-row-picture",children:[e(st,{picture:L.picture,name:L.title,size:44}),L.attention?e("span",{className:"attention-dot",role:"img","aria-label":t("Needs attention")}):null]}),n("span",{className:"room-row-main",children:[n("span",{className:"room-row-top",children:[e("strong",{children:L.title}),e(be,{room:L.key}),e("span",{className:"room-row-time",children:L.lastAt?Te(L.lastAt,p,d):""})]}),e("span",{className:"room-row-preview",children:e("span",{children:L.subtitle??""})})]}),e(s,{name:"chevron",size:16,className:"room-row-chevron"})]})},L.key))}):null,q?e("button",{type:"button",className:"secondary",disabled:M,onClick:W,children:M?t("Loading…"):t("Show more")}):null]})}function Ze(c){return c.kinds.map((i)=>e(Ce,{kind:i.kind,label:i.label,...i.icon?{icon:i.icon}:{},active:c.active},i.kind))}function Qe(){let c=(_().pages??[]).filter((i)=>i.place==="settings");if(c.length===0)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("More settings")}),c.map((i)=>n("a",{className:"menu-item menu-link",href:x("p",i.id),children:[e("span",{className:"menu-text",children:e("strong",{children:i.label})}),e(s,{name:"chevron",size:16})]},i.id))]})}export{Ze as HostKinds,ut as HostPage,Et as HostRoomPage,Qe as HostSettingsPages,he as ReadLog,be as UnreadMark};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Gs,O,P,Qr}from"./chunk-index-st18ee4w.js";var t=()=>Qr(Gs);function Pi(e){return e.kind==="owner"&&e.delivery==="queued"&&e.principalId!==void 0&&e.principalId===O.getState().principal?.id}function ys(e){t().send({type:"cancel_queued",room:e.room,message:e.id})}function bs(e,i){t().send({type:"edit_queued",room:e.room,message:e.id,text:i})}var o,{emit:n,use:r}=P();function Qi(e){o=e,n()}function Hr(){if(!o)return;o=void 0,n()}var vs=()=>r(()=>o);
|
|
2
|
-
export{Pi,ys,bs,Qi,Hr,vs};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t,c,x,h}from"./chunk-index-st18ee4w.js";import{qr}from"./chunk-index-pcb3mskd.js";var n=encodeURIComponent,a=new Set([c("This action takes no form."),c("The form has no such field."),c("This field is required."),c("Choose from the list."),c("This field takes one value."),c("This field is too long."),c("Give a web address."),c("The action could not be done.")]),tr=(e)=>a.has(e)?t(e):e;function as(e){let s=e.indexOf(":"),o=e.lastIndexOf(".");if(s<0||o<s+2||o===e.length-1)return;return{kind:e.slice(s+1,o),id:e.slice(o+1)}}var He={list:(e,s,o)=>{let i=new URLSearchParams;if(s)i.set("filter",s);if(o)i.set("cursor",o);let r=i.toString();return h(`host/${n(e)}${r?`?${r}`:""}`)},open:(e,s)=>h(`host/${n(e)}/${n(s)}`),older:(e,s,o,i)=>h(`host/${n(e)}/${n(s)}/messages?before=${o}&limit=${i}`),act:(e,s,o)=>h(`host/${n(e)}/${n(s)}/act`,{method:"POST",body:JSON.stringify(o)}),page:(e,s)=>{let o=new URLSearchParams(s).toString();return h(`pages/${n(e)}${o?`?${o}`:""}`)},pageAct:(e,s)=>h(`pages/${n(e)}/act`,{method:"POST",body:JSON.stringify(s)})};function g(e){if("room"in e){let o=e.message===void 0?"":`?message=${e.message}`;return`${x("room",e.room)}${o}`}let s=new URLSearchParams(e.query??{}).toString();return`${x("p",e.page)}${s?`?${s}`:""}`}function nr(e){qr(new URL(g(e),document.baseURI))}
|
|
2
|
-
export{tr,as,He,nr};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{P,h}from"./chunk-index-st18ee4w.js";var no={page:(e,t,o,c=50)=>h(`rooms/${encodeURIComponent(e)}/messages?archive=${t}&limit=${c}${o===void 0?"":`&before=${o}`}`)},n,{emit:r,use:s}=P();function Us(e,t){n={room:e,until:t},r()}function Vs(){if(!n)return;n=void 0,r()}var qs=()=>s(()=>n),i;function Bs(e,t){i={author:e,text:t},r()}function io(){if(!i)return;i=void 0,r()}var Fs=()=>s(()=>i);
|
|
2
|
-
export{no,Us,Vs,qs,Bs,io,Fs};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E,o,r,l,te}from"./chunk-index-st18ee4w.js";function cn(s){let{version:i}=te(),[a,u]=r(0),[f,d]=r(),[c,n]=r();o(()=>{let e=!0;return s().then((t)=>{if(!e)return;d(t),n(void 0)},(t)=>{if(e)n(l(t))}),()=>{e=!1}},[a,i]);let m=E(()=>u((e)=>e+1),[]);return{data:f,error:c,reload:m}}
|
|
2
|
-
export{cn};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Je,xo,sn,So,Y,ae,Fi,wo,ka,_a,ko,Ta,Pa,Qa,Nn}from"./chunk-index-s2ksy9pa.js";export{sn as AVATAR_STATES,Y as CATALOG,Je as CLASS_IDS,ae as CharacterError,_a as EAST_ASIAN_SKINS,xo as EXPRESSIONS,So as STATE_EXPRESSION,Pa as accentOf,Qa as characterCss,ko as checkSkins,Ta as composeSvg,wo as parseCharacter,ka as readCharacter,Fi as resolveCharacter,Nn as suggestCharacter};
|