pi-roundtable-web 0.28.0 → 0.29.1
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 +46 -0
- package/README.md +4 -4
- package/dist/chunk-account-66e6ezdq.js +1 -0
- package/dist/{chunk-action-menu-qpp9bdxh.js → chunk-action-menu-ap5xn7bf.js} +1 -1
- package/dist/chunk-agent-sapt5qhn.js +1 -0
- package/dist/chunk-arranged-rooms-n6bk696f.js +1 -0
- package/dist/chunk-attachments-p5v9gqyt.js +102 -0
- package/dist/chunk-bulk-actions-aze4ewc4.js +1 -0
- package/dist/chunk-character-creator-m7tw20ef.js +225 -0
- package/dist/{chunk-codeeditor-jgj32247.js → chunk-codeeditor-yy6pq8mv.js} +2 -2
- package/dist/chunk-confirm-0cajsfhk.js +1 -0
- package/dist/chunk-connectors-tw0tbm21.js +37 -0
- package/dist/chunk-conversations-wkm23m5r.js +1 -0
- package/dist/chunk-council-sheet-mz7s23nq.js +2 -0
- package/dist/chunk-council-view-zgvzxtgn.js +1 -0
- package/dist/{chunk-drag-04qfef58.js → chunk-drag-d1bpy8w6.js} +1 -1
- package/dist/{chunk-entry-mws704mc.js → chunk-entry-7zr5b1fp.js} +1 -1
- package/dist/chunk-folder-list-bs4eh3g9.js +1 -0
- package/dist/chunk-folds-eez1q41c.js +1 -0
- package/dist/{chunk-gate-vxetvn8t.js → chunk-gate-dt91egcd.js} +1 -1
- package/dist/chunk-host-icons-nfe2t8tk.js +1 -0
- package/dist/chunk-host-picture-4rtswxwa.js +1 -0
- package/dist/chunk-host-state-1vxzmmq6.js +1 -0
- package/dist/chunk-host-ui-x38bf0et.js +1 -0
- package/dist/{chunk-index-zj0gjcvr.js → chunk-index-0h99xcs3.js} +2 -2
- package/dist/{chunk-index-e2gy763y.js → chunk-index-1kb8tv4v.js} +2 -2
- package/dist/chunk-index-24cggw6k.js +50 -0
- package/dist/chunk-index-2g8xtwqg.js +2 -0
- package/dist/chunk-index-3n38xe7m.js +2 -0
- package/dist/{chunk-index-n0cmnwd2.js → chunk-index-3tksdmx7.js} +2 -2
- package/dist/{chunk-index-2822z600.js → chunk-index-4a1tdadd.js} +3 -3
- package/dist/{chunk-index-2syyyjnq.js → chunk-index-53fwc7sc.js} +2 -2
- package/dist/chunk-index-55ps4x5n.js +2 -0
- package/dist/{chunk-index-q5fyrtx4.js → chunk-index-5j1v2q7w.js} +1 -1
- package/dist/chunk-index-5w6tb7p0.js +2 -0
- package/dist/chunk-index-6btdp13p.js +2 -0
- package/dist/chunk-index-6m7dwsmv.js +1 -0
- package/dist/{chunk-index-20xgx0k2.js → chunk-index-6rdywten.js} +2 -2
- package/dist/{chunk-index-3gfbhmpb.js → chunk-index-6s2pqwna.js} +2 -2
- package/dist/{chunk-index-fepsbhr6.js → chunk-index-7mrkq793.js} +2 -2
- package/dist/chunk-index-7xcbpeqz.js +2 -0
- package/dist/chunk-index-88wh5eyj.js +2 -0
- package/dist/{chunk-index-6cg8xp1c.js → chunk-index-8pbwr3rs.js} +1 -1
- package/dist/{chunk-index-jc3r4qam.js → chunk-index-8wpvj7k5.js} +2 -2
- package/dist/chunk-index-97dcp1vh.js +1 -0
- package/dist/chunk-index-a7e6rhxy.js +2 -0
- package/dist/{chunk-index-2tr41qht.js → chunk-index-bxf8eq1s.js} +2 -2
- package/dist/chunk-index-c8gm1crh.js +120 -0
- package/dist/{chunk-index-2y8r4s4f.js → chunk-index-ce7hsda9.js} +2 -2
- package/dist/chunk-index-cfesmk1f.js +2 -0
- package/dist/{chunk-index-m81362sc.js → chunk-index-cmzvq3nf.js} +1 -1
- package/dist/{chunk-index-7qd604rq.js → chunk-index-d4mx2vvf.js} +1 -1
- package/dist/chunk-index-d74tpnkd.js +2 -0
- package/dist/chunk-index-d941ae7c.js +2 -0
- package/dist/{chunk-index-e35v554x.js → chunk-index-dr0jr7d3.js} +3 -3
- package/dist/chunk-index-en728705.js +2 -0
- package/dist/chunk-index-fb3kzyyp.js +2 -0
- package/dist/{chunk-index-3yy10a5h.js → chunk-index-ffnd0jcj.js} +2 -2
- package/dist/chunk-index-fn6305vn.js +3 -0
- package/dist/{chunk-index-zcfr8jdv.js → chunk-index-gdh7wsd5.js} +12 -12
- package/dist/{chunk-index-2hvn2kte.js → chunk-index-m76gdwnk.js} +2 -2
- package/dist/chunk-index-mr391t49.js +2 -0
- package/dist/chunk-index-n3khm9fq.js +2 -0
- package/dist/{chunk-index-sm7kfb07.js → chunk-index-nn4w6a04.js} +2 -2
- package/dist/{chunk-index-gwkhs8s3.js → chunk-index-nr275sa7.js} +2 -2
- package/dist/{chunk-index-x60n1me6.js → chunk-index-pgxgq61x.js} +2 -2
- package/dist/chunk-index-prq011b6.js +2 -0
- package/dist/{chunk-index-v9gbt5tz.js → chunk-index-q4k9vk04.js} +19 -3
- package/dist/chunk-index-rgdaec7y.js +2 -0
- package/dist/chunk-index-rjs1can6.js +2 -0
- package/dist/chunk-index-s4a8e4qm.js +2 -0
- package/dist/{chunk-index-s9p27f9b.js → chunk-index-sz381vda.js} +3 -3
- package/dist/{chunk-index-5hbq6g2e.css → chunk-index-t7csmbpy.css} +1 -1
- package/dist/{chunk-index-rgf4rvns.js → chunk-index-v9jqyr1f.js} +3 -3
- package/dist/{chunk-index-rsd8rftk.js → chunk-index-vpq2cj14.js} +2 -2
- package/dist/chunk-index-vsaggfns.js +2 -0
- package/dist/{chunk-index-p7jkr7gv.js → chunk-index-w17wgjby.js} +5 -5
- package/dist/{chunk-index-c7dbvkrq.js → chunk-index-wgrx2ybn.js} +2 -2
- package/dist/chunk-index-wsv46y9p.js +2 -0
- package/dist/{chunk-index-4t6vnwap.js → chunk-index-xbj816p0.js} +2 -2
- package/dist/{chunk-index-s53bxwkk.js → chunk-index-yr758n6t.js} +2 -2
- package/dist/{chunk-index-5t2jkecy.js → chunk-index-ysv36nbk.js} +2 -2
- package/dist/{chunk-index-zt19fdmc.js → chunk-index-ze9p4npm.js} +2 -2
- package/dist/chunk-index-zfdvyrjt.js +2 -0
- package/dist/chunk-lang-css-3h22se37.js +1 -0
- package/dist/{chunk-lang-dockerfile-n4bt8jbt.js → chunk-lang-dockerfile-y24eejnh.js} +1 -1
- package/dist/{chunk-lang-go-9k4y107e.js → chunk-lang-go-qzgv1161.js} +3 -3
- package/dist/chunk-lang-html-9rvrmmpg.js +1 -0
- package/dist/chunk-lang-javascript-4kv8s3tk.js +1 -0
- package/dist/{chunk-lang-json-hr12bzs1.js → chunk-lang-json-99v80v88.js} +1 -1
- package/dist/{chunk-lang-markdown-ttzcpgkg.js → chunk-lang-markdown-gn8he877.js} +4 -4
- package/dist/{chunk-lang-python-ntj8maem.js → chunk-lang-python-prsw4p4k.js} +2 -2
- package/dist/{chunk-lang-rust-gv8y859d.js → chunk-lang-rust-g6xqta16.js} +1 -1
- package/dist/{chunk-lang-shell-5zzs09b7.js → chunk-lang-shell-dmpnzc6w.js} +1 -1
- package/dist/{chunk-lang-sql-6vmze4pg.js → chunk-lang-sql-wz7ca27b.js} +2 -2
- package/dist/{chunk-lang-toml-tt0d4rw9.js → chunk-lang-toml-160prtq4.js} +1 -1
- package/dist/chunk-lang-typescript-mp0yw903.js +1 -0
- package/dist/{chunk-lang-xml-r2sbqnjv.js → chunk-lang-xml-9htkz2dd.js} +1 -1
- package/dist/{chunk-lang-yaml-ex31qbph.js → chunk-lang-yaml-08749wd5.js} +1 -1
- package/dist/chunk-layout-actions-tdx896xf.js +1 -0
- package/dist/chunk-menu-items-trhybv1g.js +1 -0
- package/dist/chunk-mode-toggle-4dtfphq4.js +1 -0
- package/dist/{chunk-note-row-40ypghn9.js → chunk-note-row-28e5x7n8.js} +33 -4
- package/dist/chunk-notes-5nkayhw8.js +1 -0
- package/dist/chunk-notice-bell-xz8a04am.js +1 -0
- package/dist/{chunk-notices-tefx93s6.js → chunk-notices-d0cwvk27.js} +1 -1
- package/dist/chunk-onboarding-zs4rtea9.js +1 -0
- package/dist/{chunk-overview-zrx3bpwf.js → chunk-overview-9sb3ywa8.js} +1 -1
- package/dist/chunk-palette-5sfhrv4x.js +1 -0
- package/dist/chunk-placement-items-e2neja55.js +1 -0
- package/dist/{chunk-profile-tyb48b79.js → chunk-profile-jffhtpqf.js} +1 -1
- package/dist/chunk-prompt-history-1jz2gk3v.js +1 -0
- package/dist/chunk-prompts-0t30ttd0.js +1 -0
- package/dist/chunk-room-confirms-6595921h.js +1 -0
- package/dist/{chunk-room-menu-ha1evv71.js → chunk-room-menu-hwkjyxwe.js} +1 -1
- package/dist/chunk-rooms-menu-button-k0eq1tcr.js +1 -0
- package/dist/{chunk-schedules-a5pewkhd.js → chunk-schedules-e12y8fw2.js} +1 -1
- package/dist/{chunk-seat-menu-eh3ymmks.js → chunk-seat-menu-n2bcw0mf.js} +1 -1
- package/dist/chunk-sheet-hosts-myvm2vhd.js +29 -0
- package/dist/chunk-shortcut-help-434sqnxc.js +26 -0
- package/dist/chunk-shortcuts-mjxph0g7.js +1 -0
- package/dist/chunk-skill-editor-98492yrt.js +8 -0
- package/dist/chunk-skills-mfv8ppfh.js +1 -0
- package/dist/chunk-start-over-line-m526193z.js +16 -0
- package/dist/{chunk-switcher-list-dtfh87zy.js → chunk-switcher-list-5ngjar24.js} +1 -1
- package/dist/{chunk-tab-dot-qd640mjr.js → chunk-tab-dot-tzjkahj5.js} +1 -1
- package/dist/chunk-table-xbtbex2z.js +1 -0
- package/dist/{chunk-table2d-5nrhfwft.js → chunk-table2d-61bvrykm.js} +1 -1
- package/dist/{chunk-table3d-5cb66d99.js → chunk-table3d-5a7vbgyj.js} +172 -172
- package/dist/chunk-thread-actions-bf6vf2mt.js +1 -0
- package/dist/{chunk-thread-cards-kgt22sbp.js → chunk-thread-cards-n0n603vf.js} +1 -1
- package/dist/chunk-thread-list-7bkdn51x.js +227 -0
- package/dist/{chunk-transcript-a0p3vwh6.js → chunk-transcript-8ztrkt6g.js} +1 -1
- package/dist/chunk-waiting-chip-y83c90v3.js +32 -0
- package/dist/chunk-waiting-s273kcgz.js +1 -0
- package/dist/chunk-where-jr791gzj.js +1 -0
- package/dist/chunk-workspace-dw71mshw.js +586 -0
- package/dist/chunk-zh-tw-vm5d0w6j.js +1 -0
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +3 -3
- package/src/api-types.ts +51 -0
- package/src/app/app.ts +7 -0
- package/src/app/card-log.ts +10 -2
- package/src/app/protocol.ts +18 -0
- package/src/app/queued-delivery.ts +107 -0
- package/src/app/queued-frames.ts +115 -0
- package/src/app/room-log.ts +39 -7
- package/src/app/rooms.ts +30 -2
- package/src/app/routes.ts +123 -7
- package/src/app/skill-group-routes.ts +126 -0
- package/src/app/socket.ts +12 -2
- package/src/app/surface.ts +37 -6
- package/src/app/zip.ts +124 -0
- package/src/auth/sessions.ts +9 -1
- package/src/authz.ts +1 -0
- package/src/host/cards.ts +10 -3
- package/src/host/stored-json.ts +23 -0
- package/src/i18n/zh-tw.ts +45 -2
- package/src/notices/mount.ts +1 -0
- package/src/notices/store.ts +9 -1
- package/src/push/channel.ts +1 -0
- package/src/web-plugin.ts +5 -1
- package/dist/chunk-account-678dgbww.js +0 -1
- package/dist/chunk-agent-x0yvvdq2.js +0 -1
- package/dist/chunk-arranged-rooms-6rdkk8t1.js +0 -1
- package/dist/chunk-bulk-actions-zbwdaxtc.js +0 -1
- package/dist/chunk-character-creator-215psy17.js +0 -1
- package/dist/chunk-confirm-2pzrt272.js +0 -1
- package/dist/chunk-connectors-zha2d834.js +0 -37
- package/dist/chunk-conversations-fb071rez.js +0 -1
- package/dist/chunk-council-sheet-k5fycefd.js +0 -2
- package/dist/chunk-folder-list-qxhmczwv.js +0 -1
- package/dist/chunk-folds-b7asegfs.js +0 -1
- package/dist/chunk-group-scene-63yhh1mh.js +0 -1
- package/dist/chunk-group-table-zy4hmgk3.js +0 -1
- package/dist/chunk-host-icons-tyktazzz.js +0 -1
- package/dist/chunk-host-picture-ebhejn2k.js +0 -1
- package/dist/chunk-host-state-wajep0yr.js +0 -1
- package/dist/chunk-host-ui-pc9r24e3.js +0 -1
- package/dist/chunk-index-1af8vsyb.js +0 -2
- package/dist/chunk-index-254701sm.js +0 -3
- package/dist/chunk-index-31m1b2f5.js +0 -2
- package/dist/chunk-index-5vatmakn.js +0 -2
- package/dist/chunk-index-6yra9kdq.js +0 -2
- package/dist/chunk-index-9bdstf8t.js +0 -2
- package/dist/chunk-index-acj4xxgq.js +0 -100
- package/dist/chunk-index-aexy023z.js +0 -2
- package/dist/chunk-index-amxa2bn3.js +0 -2
- package/dist/chunk-index-bef0fc2m.js +0 -2
- package/dist/chunk-index-c6tphrjr.js +0 -1
- package/dist/chunk-index-cn49mawx.js +0 -50
- package/dist/chunk-index-gcmmwh8t.js +0 -2
- package/dist/chunk-index-h2vhv4kh.js +0 -2
- package/dist/chunk-index-h9ccz1r3.js +0 -2
- package/dist/chunk-index-n0ejy0wd.js +0 -2
- package/dist/chunk-index-nkdg1dfz.js +0 -7
- package/dist/chunk-index-qxynr1hf.js +0 -2
- package/dist/chunk-index-r7fdgzy1.js +0 -2
- package/dist/chunk-index-sdcpf5dp.js +0 -2
- package/dist/chunk-index-sw9r4aa4.js +0 -2
- package/dist/chunk-index-t5bmsqqd.js +0 -1
- package/dist/chunk-index-v8mma5np.js +0 -2
- package/dist/chunk-index-vsfsv8hd.js +0 -2
- package/dist/chunk-index-wxft0aqb.js +0 -2
- package/dist/chunk-index-zvvwxkev.js +0 -2
- package/dist/chunk-lang-css-7q1dtpgm.js +0 -1
- package/dist/chunk-lang-html-xgvba8rn.js +0 -1
- package/dist/chunk-lang-javascript-vgxmgd0a.js +0 -1
- package/dist/chunk-lang-typescript-2v652sh5.js +0 -1
- package/dist/chunk-layout-actions-bfqtg71d.js +0 -1
- package/dist/chunk-menu-items-rztgekfj.js +0 -1
- package/dist/chunk-mode-toggle-m5kgb7c7.js +0 -1
- package/dist/chunk-notes-a8nqffbf.js +0 -1
- package/dist/chunk-notice-bell-rdnfmtf2.js +0 -1
- package/dist/chunk-onboarding-wvh0s3vg.js +0 -1
- package/dist/chunk-palette-5xtdvy9a.js +0 -1
- package/dist/chunk-placement-items-rgyrktvy.js +0 -1
- package/dist/chunk-prompt-history-wv0vdsjv.js +0 -1
- package/dist/chunk-prompts-75hgb0t0.js +0 -1
- package/dist/chunk-room-confirms-bcvhpcry.js +0 -1
- package/dist/chunk-rooms-menu-button-ej3a2hyc.js +0 -1
- package/dist/chunk-sheet-hosts-d5zbwbbr.js +0 -29
- package/dist/chunk-shortcut-help-bh9ntk9s.js +0 -26
- package/dist/chunk-shortcuts-6em0atk9.js +0 -1
- package/dist/chunk-skill-editor-e43mwz01.js +0 -8
- package/dist/chunk-skills-vp107wrp.js +0 -1
- package/dist/chunk-start-over-line-xd1v2p0g.js +0 -16
- package/dist/chunk-table-svb2xhfd.js +0 -1
- package/dist/chunk-thread-actions-926eab0w.js +0 -1
- package/dist/chunk-thread-list-j2v1pqkz.js +0 -217
- package/dist/chunk-waiting-cdyz7r1g.js +0 -1
- package/dist/chunk-waiting-chip-58ttx9av.js +0 -28
- package/dist/chunk-where-9jp6g029.js +0 -1
- package/dist/chunk-workspace-d34njy4p.js +0 -578
- package/dist/chunk-zh-tw-y3jb20wc.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o,z,C,r,t,g,e,n,I,d,f,m,Ue}from"./chunk-index-cn49mawx.js";import"./chunk-index-r7fdgzy1.js";import"./chunk-index-zt19fdmc.js";import"./chunk-index-2y8r4s4f.js";import"./chunk-index-gwkhs8s3.js";import{oi}from"./chunk-index-nkdg1dfz.js";import{qt}from"./chunk-index-n0cmnwd2.js";import{R}from"./chunk-index-m81362sc.js";import{en,Fn,io,Ti,vs,xs,Ss,ws,ks}from"./chunk-index-9bdstf8t.js";import{ne,Ee}from"./chunk-index-c7dbvkrq.js";function Q(i){let{view:a}=i;return e("li",{children:n("button",{type:"button",className:"menu-item council-row","aria-current":i.current||void 0,onClick:i.onPick,children:[e(Ue,{view:a,size:40}),n("span",{className:"menu-text",children:[e("strong",{children:a.displayName}),e("span",{className:"meta",children:t("{count} knights",{count:a.members?.length??0})})]})]})})}function W(i){let{council:a}=i,w=Ti(),u=oi(),[v,M]=r([]),[y,O]=r(),[L,S]=r(""),[G,j]=r(!1),[P,E]=r(""),[p,k]=r(!1),[F,x]=r(),B=z(),V=a?.name,T=a?.members?.join(`
|
|
2
|
-
`);o(()=>{if(!i.open)return;if(x(void 0),j(a===void 0),E(""),k(!1),O(void 0),S(""),M(a?[...a.members??[]]:vs(u)),!V)return;let s=!0;return ne.group(V).then((l)=>{if(!s)return;O(l),S(l.host)},()=>{return}),()=>{s=!1}},[i.open,V,T]);let U=C(()=>new Set(u.map((s)=>s.name)),[u]),_=u.find((s)=>s.home)?.name,c=Ss(v,(s)=>U.has(s)),b=ws(c,L||void 0,_),X=(s)=>u.find((l)=>l.name===s)?.displayName??s,D=c.length>=en,N=c.length>=Fn,q=a===void 0||c.join(",")!==(a.members??[]).join(",")||y!==void 0&&b!==y.host,H=async(s)=>{k(!0),x(void 0);try{await s(),await Ee()}catch(l){return x(d(l)),k(!1),!1}return k(!1),!0},J=async()=>{if(!a)return;if(!await H(async()=>{await ne.updateGroup(a.name,{...c.join(",")!==(a.members??[]).join(",")?{members:c}:{},...y&&b!==y.host?{host:b}:{}})}))return;f(t("Saved.")),i.onClose()},K=async()=>{let s=P.trim();if(s==="")return;let l=new Set([...u.map((A)=>A.name),...w.map((A)=>A.name)]),h;if(!await H(async()=>{h=await ne.createGroup({name:ks(s,l),displayName:s,members:c,host:b})})||!h)return;io(h.room),I("table",h.name,{replace:!0}),f(t("Made {name}.",{name:h.displayName})),i.onClose()};return n("div",{className:"stack council-sheet",children:[w.length>0?n("section",{className:"stack","aria-label":t("Councils"),children:[e("h3",{children:t("Councils")}),e("ul",{className:"menu",children:w.map((s)=>e(Q,{view:s,current:s.key===a?.key,onPick:()=>{io(s.key),I("table",s.name,{replace:!0}),i.onClose()}},s.key))})]}):null,n("fieldset",{className:"field council-pick",children:[e("legend",{children:a?t("Edit this council"):t("Pick who sits")}),n("span",{className:"meta council-count","aria-live":"polite",children:[t("{count} of {max} picked",{count:c.length,max:en}),D?` · ${t("At most {max} knights",{max:en})}`:""]}),e("ul",{className:"menu",children:u.map((s)=>{let l=v.includes(s.name);return e("li",{children:n("label",{className:"menu-item menu-toggle seat-row",children:[e("input",{type:"checkbox",checked:l,disabled:!l&&D,onChange:()=>M(xs(v,s.name,en))}),e(Ue,{view:s,size:32}),e("span",{className:"menu-text",children:e("strong",{children:s.displayName})})]})},s.key)})})]}),N?e(qt,{label:t("Host"),value:b,onChange:S,options:c.map((s)=>({value:s,label:X(s)}))}):e("span",{className:"meta",children:t("A council needs at least {min} knights.",{min:Fn})}),G?n("label",{htmlFor:B,children:[t("Council name"),e("input",{id:B,value:P,autoComplete:"off",onChange:(s)=>E(s.target.value)})]}):null,F?e(m,{message:F}):null,e("div",{className:"actions",children:a&&!G?n(g,{children:[e("button",{type:"button",className:"secondary",disabled:!N||p,onClick:()=>j(!0),children:t("Save as a new council")}),e("button",{type:"button",disabled:!N||!q||p,onClick:J,children:p?t("Saving…"):t("Done")})]}):e("button",{type:"button",disabled:!N||P.trim()===""||p,onClick:K,children:p?t("Saving…"):a?t("Save as a new council"):t("Make council")})})]})}function de(i){return e(R,{open:i.open,title:t("Council"),onClose:i.onClose,size:"default",children:e(W,{open:i.open,council:i.council,onClose:i.onClose})})}export{de as CouncilSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p,o,z,t,K,g,e,n,s,Je,l,me,Ue,qn,Sn}from"./chunk-index-cn49mawx.js";import{yr,vr,xr,Sr}from"./chunk-index-t5bmsqqd.js";import"./chunk-index-q5fyrtx4.js";import{Gt}from"./chunk-index-2tr41qht.js";import{Ci}from"./chunk-index-20xgx0k2.js";var v=()=>(p("bfqtg71d"),import("./chunk-layout-actions-bfqtg71d.js")),k=(a)=>(p("rgyrktvy"),import("./chunk-placement-items-rgyrktvy.js")).then((r)=>r.folderMenu(a)),F=(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")v().then((i)=>i.placeFolderBefore(a,r.before))},open:xr});function b(a){let{id:r,name:i}=a,m=yr().has(r),d=a.holdsActive||!m,c=z(),h=Gt(()=>k(r),F(r)),N=(u)=>{k(r).then((f)=>{if(!f)return;let y=u.getBoundingClientRect();me({...f,at:{x:y.left,y:y.bottom},via:"key",source:u})},()=>{return})};return n("section",{className:"folder","aria-label":i,"data-folder-block":"","data-key":r,"data-drop-zone":"folder","data-zone-id":r,"data-folder":r,"data-collapsed":d?void 0:"",children:[n("header",{className:"folder-head","data-folder-head":"",...h,children:[n("button",{type:"button",className:"folder-toggle","aria-expanded":d,"aria-controls":c,"aria-label":d?t("Collapse {name}",{name:i}):t("Expand {name}",{name:i}),onClick:()=>vr(r),children:[e(s,{name:"chevron",size:16,className:"folder-chevron","data-open":d||void 0}),e("strong",{children:i}),e("span",{className:"meta",children:K(a.count,"{count} room","{count} rooms")}),d?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")}),d?null:a.summary,e("button",{type:"button",className:"icon-button folder-more","aria-haspopup":"menu","aria-label":t("Folder menu"),onClick:(u)=>N(u.currentTarget),children:e(s,{name:"more",size:18})})]}),e("div",{id:c,className:"folder-body",hidden:!d,children:d?a.count===0?e("p",{className:"meta folder-empty",children:t("No rooms in this folder yet.")}):a.children:null})]})}var R=4;function S(a){let r=a.rooms.slice(0,R),i=l((d)=>r.map((c)=>d.rooms[c]?.view),r.join(",")),m=a.rooms.length-r.length;return n("span",{className:"folder-stack","aria-hidden":"true",children:[i.map((d)=>d?e("span",{className:"folder-stack-item",children:e(Ue,{view:d,size:28})},d.key):null),m>0?n("span",{className:"folder-stack-more",children:["+",m]}):null]})}function M(a){let r=l((i)=>({waiting:a.rooms.reduce((m,d)=>m+Je(i,d),0),typing:a.rooms.some((m)=>i.rooms[m]?.typing)}),a.rooms.join(","));return n(g,{children:[r.typing?e(qn,{}):null,r.waiting?e(Sn,{count:r.waiting}):null]})}function w(a){return l((r)=>Ci(a,(i)=>r.rooms[i]?.view?.muted===!0),a.join(","))}function U(a){let r=a.folders.map((i)=>i.id).join(",");return o(()=>{if(a.listed)Sr(r?r.split(","):[])},[a.listed,r]),e(g,{children:a.folders.map((i)=>e(C,{folder:i,...a},i.id))})}function C(a){let{folder:r}=a,i=w(r.rooms);return e(b,{id:r.id,name:r.name,count:r.rooms.length,holdsActive:a.active!==void 0&&r.rooms.includes(a.active),muted:i,summary:e(M,{rooms:r.rooms}),stack:e(S,{rooms:r.rooms}),children:a.rooms(r.rooms)})}export{U as FolderList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{yr,br,vr,xr,Sr}from"./chunk-index-t5bmsqqd.js";export{br as collapsedNow,xr as expandFolder,Sr as pruneCollapsed,vr as toggleCollapsed,yr as useCollapsed};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Li,Xi,ra}from"./chunk-index-acj4xxgq.js";import"./chunk-index-nkdg1dfz.js";import"./chunk-index-2y8r4s4f.js";import"./chunk-index-zt19fdmc.js";import"./chunk-index-m81362sc.js";import"./chunk-index-r7fdgzy1.js";import"./chunk-index-gwkhs8s3.js";export{ra as GroupScene,Xi as GroupStage,Li as useGroupFocus};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Nr,t,g,e,n,s,l,st}from"./chunk-index-cn49mawx.js";import"./chunk-index-zt19fdmc.js";import"./chunk-index-2y8r4s4f.js";import"./chunk-index-gwkhs8s3.js";import{Bt}from"./chunk-index-nkdg1dfz.js";import"./chunk-index-r7fdgzy1.js";var i=(o,a)=>a?Nr(o,a):o;function T(o){let a=l((c)=>c.rooms[o.roomKey]?.view),r=st();if(!a||a.kind!=="group")return null;let m=a.members??[];return n(g,{children:[n("button",{type:"button",className:"icon-button group-table-button","aria-label":t("Table"),"aria-pressed":o.scene,onClick:()=>o.onScene(!o.scene),children:[e(s,{name:"table"}),e("span",{className:"group-table-label",children:t("Table")})]}),r==="camelot"&&!o.scene?i(e("div",{className:"group-strip",children:e(Bt,{members:m,groupRoom:o.roomKey,variant:"compact"})}),o.slot):null]})}export{T as GroupTable};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-6cg8xp1c.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ct}from"./chunk-index-v9gbt5tz.js";export{ct as HostPicture};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ho,Ie,po,mo,go,Oo,yo,on,ur,bo,Oa}from"./chunk-index-gwkhs8s3.js";export{bo as keepCards,ur as keepReads,yo as noCards,Oo as noReads,Oa as onFrame,on as seedUnread,ho as subscribeHost,mo as totalUnread,go as unreadCounts,po as unreadOf,Ie as useHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j,A,o,z,$e,C,a,r,t,K,g,e,n,s,x,fn,O,l,de,d,f,v,m,k,T,Wt,Xn,Et,_,Xr,xe,Yt,Yi,wt,gn,$t,J,xn,Ur,Ce,we}from"./chunk-index-cn49mawx.js";import{$n}from"./chunk-index-zt19fdmc.js";import{Ui,Ho,Ze,Vi}from"./chunk-index-2y8r4s4f.js";import{q}from"./chunk-index-qxynr1hf.js";import{Ie,Oo,yo,on,ur,bo}from"./chunk-index-gwkhs8s3.js";import{lt,ct}from"./chunk-index-v9gbt5tz.js";import{Mr}from"./chunk-index-2822z600.js";import"./chunk-index-6cg8xp1c.js";import{Te}from"./chunk-index-e35v554x.js";import{ie}from"./chunk-index-sw9r4aa4.js";import"./chunk-index-m81362sc.js";function Je(c){let i={};for(let u of c)if(u.type==="multiselect")i[u.name]=[...Ve(u.initial)];else i[u.name]=Ve(u.initial)[0]??"";return i}var Ve=(c)=>c===void 0?[]:typeof c==="string"?[c]:[...c];function je(c,i){let u={};for(let p of c){let y=i[p.name];if(y===void 0||y===""||y.length===0)continue;u[p.name]=y}return u}function Ke(c){let{field:i,value:u}=c,[p,y]=r(""),N=i.search?i.options.filter((h)=>h.label.toLowerCase().includes(p.trim().toLowerCase())):i.options,H=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:[H,n(Te,{id:c.id,value:String(u),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")}),N.map((h)=>e("option",{value:h.value,children:h.label},h.value))]})]});let b=new Set(Array.isArray(u)?u:[]);return n(g,{children:[H,e("fieldset",{"aria-describedby":c.described,children:N.map((h)=>n("label",{children:[e("input",{type:"checkbox",checked:b.has(h.value),onChange:(S)=>{let w=new Set(b);if(S.target.checked)w.add(h.value);else w.delete(h.value);c.onChange(i.options.filter((I)=>w.has(I.value)).map((I)=>I.value))}}),h.label]},h.value))})]})}function et(c){let{field:i,value:u}=c,p=z(),y="hint"in i?i.hint:void 0,N=c.error||y?`${p}-note`:void 0,H;if("options"in i)H=e(Ke,{field:i,id:p,value:u,described:N,onChange:c.onChange});else if(i.type==="textarea")H=e("textarea",{id:p,rows:5,value:String(u),maxLength:i.max??8000,required:i.required===!0,"aria-describedby":N,onChange:(b)=>c.onChange(b.target.value)});else H=e("input",{id:p,type:i.type==="url"?"url":"text",value:String(u),maxLength:i.max??500,required:i.required===!0,"aria-describedby":N,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}),H,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 me(c){let{spec:i}=c,[u,p]=r(()=>Je(i.fields)),[y,N]=r(!1),[H,b]=r();return n("form",{className:"host-form",onSubmit:async(S)=>{if(S.preventDefault(),y)return;N(!0),b(void 0);try{b(await c.onSubmit(je(i.fields,u)))}catch(w){b({error:d(w)})}finally{N(!1)}},children:[i.fields.map((S)=>e(et,{field:S,value:u[S.name]??"",error:H?.field===S.name?H.error:void 0,onChange:(w)=>p((I)=>({...I,[S.name]:w}))},S.name)),H&&!i.fields.some((S)=>S.name===H.field)?e(m,{message:H.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 tt(c){if(!c.ok)return{error:Ui(c.error),...c.field?{field:c.field}:{}};if(c.notice)f(c.notice);if(c.open)Vi(c.open);return}function re(c){let[i,u]=r(),[p,y]=r(!1),N=async(b,h)=>tt(await c.run(b,h)),H=async(b)=>{if(b.form||b.confirm){u(b);return}y(!0);try{let h=await N(b,{});if(h)f(h.error,"danger")}catch(h){f(d(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:()=>H(b),children:b.label},b.id)),i?.form?e(ie,{open:!0,title:i.form.title,onClose:()=>u(void 0),children:e(me,{spec:i.form,onCancel:()=>u(void 0),onSubmit:async(b)=>{let h=await N(i,b);if(!h)u(void 0);return h}})}):i?e(q,{open:!0,title:i.label,confirmLabel:i.label,tone:i.style==="danger"?"danger":"primary",onConfirm:async()=>{let b=await N(i,{});if(b)throw Error(b.error)},onClose:()=>u(void 0),children:e("p",{children:i.confirm})}):null]})}var Oe=/^file:([A-Za-z0-9_-]{1,64})$/;function Pe(c){let i=URL.parse(c,document.baseURI);return i!==null&&i.origin===window.location.origin}function nt({id:c,alt:i}){return e("img",{className:"file-image",src:`api/files/${encodeURIComponent(c)}`,alt:i,loading:"lazy",decoding:"async",onError:(u)=>{let p=document.createElement("span");p.textContent=i||t("Image"),u.currentTarget.replaceWith(p)}})}var ne=j(function({source:i}){return e("div",{className:"prose",children:e(Wt,{remarkPlugins:[Et],urlTransform:(u)=>Oe.test(u)?u:Xn(u),components:{a:({href:u,children:p})=>u&&/^https?:\/\//.test(u)&&!Pe(u)?e("a",{href:u,target:"_blank",rel:"noreferrer noopener",children:p}):u&&Pe(u)?e("a",{href:u,children:p}):e("span",{children:p}),img:({src:u,alt:p})=>{let y=typeof u==="string"?Oe.exec(u):null;return y?.[1]?e(nt,{id:y[1],alt:p??""}):e("span",{children:p})},pre:Xr,table:({children:u})=>e("div",{className:"table-wrap",children:e("table",{children:u})})},children:i})})});function rt(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 ke=(c)=>(c.state??"open")==="open";function ae(c){let{card:i}=c,u=rt(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}),u?e(T,{tone:i.state==="working"?"busy":"plain",children:u}):null]}),i.body?e(ne,{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,ke(i)&&i.buttons?.length?e(re,{actions:i.buttons,run:c.run}):null]})}lt();function ot(){let[c,i]=r(()=>$n().toString());return o(()=>{let u=()=>i($n().toString());return window.addEventListener("popstate",u),window.addEventListener("hashchange",u),()=>{window.removeEventListener("popstate",u),window.removeEventListener("hashchange",u)}},[]),c}function st(c){if(!c.ok)return{error:Ui(c.error),...c.field?{field:c.field}:{}};if(c.notice)f(c.notice);if(c.open)Vi(c.open);return}function it(c){let{section:i}=c;switch(i.kind){case"markdown":return e(ne,{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(me,{spec:i.form,onSubmit:(u)=>c.submit(i.action,u)})]});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:dt(i.rows).map(([u,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(re,{actions:p.actions,run:c.run}):null]},u))})]})}}function at({routeKey:c}){let i=c??"",u=ot(),p=Ie((w)=>w.pages[i]??0),[y,N]=r(0),[H,b]=r({});o(()=>{let w=!0;return Ze.page(i,Object.fromEntries(new URLSearchParams(u))).then((I)=>w&&b({page:I}),(I)=>{if(!w)return;let V=I instanceof de&&I.status===404;b((P)=>({...V||!P.page?{}:{page:P.page},error:d(I),gone:V}))}),()=>{w=!1}},[i,u,p,y]);let h=async(w,I)=>{let V=await Ze.pageAct(i,{action:w,input:I}),P=st(V);if(!P)N((F)=>F+1);return P},S=async(w,I)=>{let V=await Ze.pageAct(i,{action:w.id,input:I});if(V.ok)N((P)=>P+1);return V};if(H.gone)return e("div",{className:"page",children:e(k,{children:t("This page is not available.")})});if(!H.page)return e("div",{className:"page",children:H.error?e(m,{message:H.error}):e(v,{})});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:H.page.title})}),H.error?e(m,{message:H.error}):null,H.page.sections.map((w,I)=>e(it,{section:w,run:S,submit:h},I))]})}function dt(c){let i=new Map;return c.map((u)=>{let p=i.get(u.title)??0;return i.set(u.title,p+1),[`${u.title}:${p}`,u]})}var ut=/https?:\/\/[^\s<>"']+/g,mt=/[.,;:!?)\]}\u3001\u3002\uff0c\uff1b\uff1a\uff01\uff1f\uff09\u300d\u300f]+$/;function ft(c){let i=c.replace(mt,""),u=URL.parse(i);return u&&(u.protocol==="https:"||u.protocol==="http:")?i:""}function _e({text:c}){let i=[],u=0;for(let p of c.matchAll(ut)){let y=ft(p[0]);if(y==="")continue;let N=p.index;if(N>u)i.push(c.slice(u,N));i.push(e("a",{href:y,target:"_blank",rel:"noreferrer noopener",children:y},`${N}`)),u=N+y.length}if(u<c.length)i.push(c.slice(u));return e("span",{className:"plain",children:i})}var qe=j(function(i){let{message:u}=i,p=u.authorKind??"external";if(p==="notice")return n("li",{className:"host-notice","data-mid":u.id,"data-highlight":i.highlighted||void 0,"data-enter":i.enter||void 0,children:[e(s,{name:"bell",size:14}),e(ne,{source:u.text}),e("time",{dateTime:u.at,children:Yt(u.at,i.timeZone)})]});let y=p==="member"&&u.principalId!==void 0&&u.principalId===i.me;return n("li",{className:"message","data-mid":u.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(ct,{picture:u.picture,name:u.author}):null}),n("div",{className:"message-main",children:[i.header?n("div",{className:"message-meta",children:[e("strong",{children:u.author}),u.authorLabel?e("span",{className:"label-chip",children:u.authorLabel}):null,e("time",{dateTime:u.at,children:Yt(u.at,i.timeZone)})]}):null,n("div",{className:"bubble",children:[u.text?p==="assistant"?e(ne,{source:u.text}):e(_e,{text:u.text}):null,e($t,{files:u.files}),u.expiredFiles?e("p",{className:"message-expired",children:K(u.expiredFiles,"{count} file was removed","{count} files were removed")}):null]}),u.edited?e("span",{className:"message-edited",children:t("edited")}):null]})]})});var pt=1500,gt=96,fe=new Set,Ne=new Map;function ht(c){if(document.visibilityState!=="visible")return!1;return!c||c.scrollHeight-c.scrollTop-c.clientHeight<gt}function ze(c){if(!(c instanceof Element))return;let i=c.closest("[data-unread][data-mid]");return i?Number(i.dataset.mid):void 0}function De(c){let{room:i,scroller:u,messages:p,began:y,enterAfter:N,me:H,shared:b}=c,h=a({seen:void 0,watched:new Set}),[,S]=r(0),w=Ne.get(i)??fe;if(N!==void 0&&p){let L=h.current;L.seen??=N;let M=ht(u.current),G=L.seen;for(let E of p){if(E.id<=L.seen)continue;if(M)L.watched.add(E.id);G=Math.max(G,E.id)}L.seen=G}let I=C(()=>{if(y===void 0||N===void 0||!p)return fe;let L=new Set;for(let M of p){if(M.id===0||M.id<=y)continue;if(M.kind==="system"||M.note)continue;if(M.authorKind==="notice")continue;if(M.principalId===void 0?M.kind==="owner"&&!b:M.principalId===H)continue;if(h.current.watched.has(M.id)||w.has(M.id))continue;L.add(M.id)}return L.size===0?fe:L},[p,y,N,H,b,w]),V=A((L)=>{let M=Ne.get(i)??fe;if(M.has(L))return;Ne.set(i,new Set(M).add(L)),S((G)=>G+1)},[i]),P=I.size>0;o(()=>{let L=u.current;if(!L||!P)return;let M=(E)=>{if(E.pointerType==="touch")return;let B=ze(E.target);if(B!==void 0)V(B)},G=(E)=>{let B=ze(E.target);if(B!==void 0)V(B)};return L.addEventListener("pointerover",M,{passive:!0}),L.addEventListener("focusin",G,{passive:!0}),L.addEventListener("click",G,{passive:!0}),()=>{L.removeEventListener("pointerover",M),L.removeEventListener("focusin",G),L.removeEventListener("click",G)}},[u,V,P]);let F=a(new Map),U=[...I].join(",");return o(()=>{let L=u.current,M=F.current;for(let[W,Z]of M)if(!I.has(W))clearTimeout(Z),M.delete(W);if(!L||!P||typeof IntersectionObserver!=="function"||!matchMedia("(pointer: coarse)").matches)return;let G=(W)=>{let Z=M.get(W);if(Z===void 0)return;clearTimeout(Z),M.delete(W)},E=new IntersectionObserver((W)=>{for(let Z of W){let te=Number(Z.target.dataset.mid),le=Z.rootBounds;if(!(Z.isIntersecting&&(Z.intersectionRatio>=0.5||le!==null&&Z.intersectionRect.height>=le.height*0.5))){G(te);continue}if(M.has(te))continue;M.set(te,setTimeout(()=>{if(M.delete(te),document.visibilityState==="visible")V(te)},pt))}},{root:L,threshold:[0,0.25,0.5,0.75,1]}),B=[...L.querySelectorAll("[data-unread][data-mid]")];for(let W of B)E.observe(W);let X=()=>{if(document.visibilityState!=="visible")return;for(let W of B)E.unobserve(W),E.observe(W)};return document.addEventListener("visibilitychange",X),()=>{document.removeEventListener("visibilitychange",X),E.disconnect()}},[u,V,P,U]),o(()=>{let L=F.current;return()=>{for(let M of L.values())clearTimeout(M);L.clear()}},[]),I}lt();var bt=3;function yt({marks:c}){let[i,u]=r(!1);return n("li",{className:"seen",children:[n("button",{type:"button",className:"seen-toggle","aria-expanded":i,onClick:()=>u((p)=>!p),children:[c.slice(0,bt).map((p)=>e(ct,{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 vt(c,i){let u=we(),p=l((y)=>y.connects);o(()=>{let y=i.current;if(!y)return;let N=0,H=0,b,h,S=()=>{if(h=void 0,document.visibilityState!=="visible")return;let V=y.getBoundingClientRect(),P=0;for(let U of y.querySelectorAll("[data-mid]")){let L=U.getBoundingClientRect();if(L.bottom>V.top&&L.top<V.bottom-4)P=Math.max(P,Number(U.dataset.mid))}if(P<=N)return;let F=H+1000-Date.now();if(F>0){clearTimeout(b),b=setTimeout(w,F);return}if(u.send({type:"read",room:c,upTo:P}))N=P,H=Date.now()},w=()=>{if(h===void 0)h=requestAnimationFrame(S)};y.addEventListener("scroll",w,{passive:!0}),document.addEventListener("visibilitychange",w),window.addEventListener("resize",w);let I=new MutationObserver(w);return I.observe(y,{childList:!0,subtree:!0}),w(),()=>{if(y.removeEventListener("scroll",w),document.removeEventListener("visibilitychange",w),window.removeEventListener("resize",w),I.disconnect(),clearTimeout(b),h!==void 0)cancelAnimationFrame(h)}},[u,c,i,p])}function pe(c){let{roomKey:i}=c;vt(i,c.scroller);let u=l((w)=>w.principal?.id),p=l((w)=>w.rooms[i]?.messages),y=Ie((w)=>w.reads[i]??Oo),N=Ie((w)=>w.cursor[i]),H=a(void 0);if(H.current===void 0&&N!==void 0)H.current=N;let b=l((w)=>w.rooms[i]?.view?.notes===!0),h=De({room:i,scroller:c.scroller,messages:p,began:H.current,enterAfter:c.enterAfter,me:u,shared:c.host===!0||b}),S=C(()=>{let I=(p??[]).filter((F)=>F.kind!=="system"),V=H.current===void 0?void 0:I.find((F)=>F.id>(H.current??0)&&(F.principalId===void 0||F.principalId!==u))?.id,P=new Map;for(let F of y){if(F.principal===u)continue;let U=I.findLast((L)=>L.id<=F.upTo);if(U)P.set(U.id,[...P.get(U.id)??[],F])}return{before:(F)=>F.id===V?e("li",{className:"new-divider",children:e("span",{children:t("New messages")})}):null,after:(F)=>{let U=P.get(F.id);return U?e(yt,{marks:U}):null},unread:(F)=>h.has(F.id),...c.host?{message:(F,U)=>F.kind==="system"&&F.authorKind===void 0?void 0:e(qe,{message:F,header:U.header,enter:U.enter,unread:U.unread,timeZone:U.timeZone,me:u,highlighted:c.highlight===F.id})}:{}}},[p,y,u,c.host,c.highlight,h]);return e(xn,{roomKey:i,enterAfter:c.enterAfter,quotable:c.quotable,decor:S})}lt();var kt=20,Nt=2600,Ue;function Ht(c,i,u){let p=l((b)=>b.connects),y=Ie((b)=>b.rooms[c]??0),[N,H]=r({view:void 0,error:void 0,gone:!1});return o(()=>{let b=!0;return Ze.open(i,u).then((h)=>{if(!b)return;O.dispatch({type:"history_loaded",room:c,messages:h.messages,more:h.more,older:!1}),ur(c,h.reads,h.cursor),bo(c,h.cards),H({view:h,error:void 0,gone:!1})},(h)=>{if(!b)return;let S=h instanceof de&&h.status===404;H((w)=>({view:S?void 0:w.view,error:d(h),gone:S}))}),()=>{b=!1}},[c,i,u,p,y]),N}function Rt(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((u)=>n("div",{children:[e("dt",{children:u.label}),e("dd",{children:u.link?e("a",{href:u.link,...u.link.startsWith("/")?{}:{target:"_blank",rel:"noreferrer noopener"},children:u.value}):u.value})]},`${u.label}:${u.value}`))}):null,e(re,{className:"host-actions bar",actions:i.actions,run:c.run})]})}function At(c){let i=Ie((S)=>S.cards[c.room]??yo),u=Ce("(min-width: 720px) and (min-height: 760px)"),[p,y]=r();if(i.length===0)return null;let N=i.filter((S)=>ke(S)||S.state==="working"),H=i.filter((S)=>!N.includes(S)),b=p??(u&&N.length>0),h=N[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:K(N.length,"{count} card waiting","{count} cards waiting")}),`: ${h.title}`]}):e("span",{children:t("Earlier cards ({count})",{count:H.length})})]}),b?n("div",{className:"host-cards-body",children:[N.map((S)=>e(ae,{card:S,run:c.run(S.id)},S.id)),H.length?n("details",{className:"host-cards-older",children:[e("summary",{children:t("Earlier cards ({count})",{count:H.length})}),H.map((S)=>e(ae,{card:S,run:c.run(S.id)},S.id))]}):null]}):null]})}function St({roomKey:c}){let i=we(),u=Ho(c),p=u?.kind??"",y=u?.id??"",{view:N,error:H,gone:b}=Ht(c,p,y),h=l((R)=>R.rooms[c]),S=l((R)=>R.limits),w=l((R)=>R.connects),I=l((R)=>R.connection==="open"),V=a(null),P=a(null),{away:F,onScroll:U,onGrow:L,toEnd:M}=Ur(V),[G,E]=r(!1),[B,X]=r(),[W,Z]=r(Ue),[te,le]=r(!1),[Re,Ae]=r(),he=a(void 0),oe=a(void 0),Q=N!==void 0;if(o(()=>{if(!u||b||!Q)return;return i.send({type:"subscribe",room:c}),i.focus(c),()=>{i.focus(void 0),i.send({type:"unsubscribe",room:c})}},[i,c,w,b,Q]),Q&&he.current===void 0)he.current=h?.messages.at(-1)?.id??0;$e(()=>{if(Q)M(!1)},[Q]),$e(()=>{let R=V.current;if(R&&oe.current!==void 0)R.scrollTop+=R.scrollHeight-oe.current,oe.current=void 0},[h?.messages[0]?.id]),o(()=>{let R=P.current;if(!R||typeof ResizeObserver>"u")return;let D=new ResizeObserver(L);return D.observe(R),()=>D.disconnect()},[L]);let be=A(async()=>{let R=O.getState().rooms[c]?.messages[0];if(!R)return!1;let D=await Ze.older(p,y,R.id,fn);return O.dispatch({type:"history_loaded",room:c,messages:D.messages,more:D.more,older:!0}),ur(c,D.reads,void 0),D.more},[c,p,y]),ce=a(void 0);o(()=>{let R=()=>{let D=Number($n().get("message"));ce.current=Number.isSafeInteger(D)&&D>0?D:void 0};return R(),window.addEventListener("popstate",R),()=>window.removeEventListener("popstate",R)},[]);let ye=h?.messages[0]?.id,Ee=h?.more===!0;o(()=>{let R=ce.current,D=V.current;if(!Q||R===void 0||!D)return;let Y=D.querySelector(`[data-mid="${R}"]`);if(Y){ce.current=void 0,Y.scrollIntoView({block:"center"}),Ae(R),requestAnimationFrame(()=>D.dispatchEvent(new Event("scroll"))),setTimeout(()=>Ae(void 0),Nt);return}if(ye!==void 0&&R<ye&&Ee){let se=0;(async()=>{if(se+=1,!await be().catch(()=>!1)||se>=kt)ce.current=void 0})()}},[Q,ye,Ee,h?.messages.length,be]);let Se=(R,D={},Y)=>Ze.act(p,y,{action:R.id,...Y===void 0?{}:{card:Y},input:D}),We=(R,D)=>Se(R,D),Qe=(R)=>(D,Y)=>Se(D,Y,R);if(b||!Q&&!H&&!u)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 ee=N?.access.send??[],ve=ee.length>1,Le=ve&&te,Me=W&&ee.includes(W)?W:ee.includes("turn")?"turn":ee[0],Fe=Le||Me==="turn",Ye=Fe?N?.wording?.turn?.placeholder??t("Ask AI…"):N?.wording?.note?.placeholder??t("Write an internal note…"),ue=N?.header.title??c,Xe=h?.messages??[];return n("section",{className:"room",onDragOver:(R)=>{if(ee.length&&R.dataTransfer.types.includes("Files"))R.preventDefault()},onDrop:(R)=>{if(!ee.length||!R.dataTransfer.files.length)return;R.preventDefault(),X([...R.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(ct,{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")})]})]}),!I?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,N?e(Rt,{header:N.header,run:We}):null,e("div",{className:"room-scroll",ref:V,onScroll:U,children:n("div",{className:"room-content",ref:P,children:[H?e(m,{message:H}):null,!Q&&!H?e(v,{}):null,h?.more?e("button",{type:"button",className:"secondary older",disabled:G,onClick:async()=>{E(!0),oe.current=V.current?.scrollHeight;try{await be()}catch(R){oe.current=void 0,f(d(R),"danger")}finally{E(!1)}},children:G?t("Loading…"):t("Load earlier messages")}):null,Q&&Xe.length===0?e(k,{children:t("No messages yet.")}):null,e(pe,{roomKey:c,enterAfter:he.current,quotable:!1,scroller:V,host:!0,highlight:Re}),h?.typing?e(gn,{name:ue,progress:h.progress}):null]})}),F?n("button",{type:"button",className:"to-end",onClick:()=>M(!0),children:[e(s,{name:"send",size:16,style:{transform:"rotate(180deg)"}}),t("Latest")]}):null,N?e(At,{room:c,run:Qe}):null,N&&ee.length===0?e("p",{className:"room-note",children:t("You can read this room but not write in it.")}):null,N&&ee.length>0?e(g,{children:e(wt,{draftKey:c,name:ue,placeholder:Ye,onAddressed:le,...ve?{above:e(Mr,{on:Fe,label:N?.wording?.turn?.label??t("@AI"),...Le?{locked:t("The message starts with @AI, so the knight answers.")}:{},onChange:(R)=>{let D=R?"turn":"note";Ue=D,Z(D)}})}:{},limits:S,stoppable:Boolean(h?.stoppable),onSend:(R,D,Y)=>{if(ve&&Y){let se=Yi(R);i.say(c,se===""&&D.length===0?R:se,D,"turn")}else i.say(c,R,D,Me);M(!0)},onStop:()=>i.send({type:"stop",room:c}),...B?{incoming:B,onIncomingTaken:()=>X(void 0)}:{}},c)}):null]})}lt();function ge({room:c}){let i=Ie((u)=>u.unread[c]??0);if(i<=0)return null;return e("span",{className:"unread-mark",role:"img","aria-label":K(i,"{count} unread message","{count} unread messages"),children:i>99?"99+":i})}lt();var Lt=6,Ct=250;function He(c){let{kind:i}=c,{timeZone:u}=_(),{now:p}=J(),y=l((E)=>E.connects),N=Ie((E)=>E.lists[i]??0),[H,b]=r(""),[h,S]=r(""),[w,I]=r(),[V,P]=r(),[F,U]=r(),[L,M]=r(!1);o(()=>{let E=setTimeout(()=>S(H.trim()),Ct);return()=>clearTimeout(E)},[H]),o(()=>{let E=!0;return Ze.list(i,h||void 0).then((B)=>{if(!E)return;on(Object.fromEntries(B.rooms.map((X)=>[X.key,X.unread??0]))),I(B.rooms),P(B.cursor),U(void 0)},(B)=>E&&U(d(B))),()=>{E=!1}},[i,h,y,N]);let G=async()=>{if(!V||L)return;M(!0);try{let E=await Ze.list(i,h||void 0,V);on(Object.fromEntries(E.rooms.map((B)=>[B.key,B.unread??0]))),I((B)=>[...B??[],...E.rooms]),P(E.cursor)}catch(E){U(d(E))}finally{M(!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]}),w&&(w.length>=Lt||h||H)?e("input",{type:"search",className:"kind-filter",value:H,placeholder:t("Search {name}",{name:c.label}),"aria-label":t("Search {name}",{name:c.label}),onChange:(E)=>b(E.target.value)}):null,F?e(m,{message:F}):null,!w&&!F?n("div",{className:"stack","aria-busy":"true",children:[e("div",{className:"skeleton"}),e("div",{className:"skeleton"})]}):null,w&&w.length===0?e(k,{children:h?t("Nothing matches."):t("No rooms yet.")}):null,w&&w.length>0?e("ul",{className:"room-list",children:w.map((E)=>e("li",{children:n("a",{className:"room-row",href:x("room",E.key),"aria-current":E.key===c.active?"page":void 0,children:[n("span",{className:"kind-row-picture",children:[e(ct,{picture:E.picture,name:E.title,size:44}),E.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:E.title}),e(ge,{room:E.key}),e("span",{className:"room-row-time",children:E.lastAt?xe(E.lastAt,p,u):""})]}),e("span",{className:"room-row-preview",children:e("span",{children:E.subtitle??""})})]}),e(s,{name:"chevron",size:16,className:"room-row-chevron"})]})},E.key))}):null,V?e("button",{type:"button",className:"secondary",disabled:L,onClick:G,children:L?t("Loading…"):t("Show more")}):null]})}function Be(c){return c.kinds.map((i)=>e(He,{kind:i.kind,label:i.label,...i.icon?{icon:i.icon}:{},active:c.active},i.kind))}function Ge(){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{Be as HostKinds,at as HostPage,St as HostRoomPage,Ge as HostSettingsPages,pe as ReadLog,ge as UnreadMark};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var qs=40;class l extends Error{code;constructor(e){super(e);this.code=e;this.name="LayoutError"}}function Wn(e,n,r){if(r===n&&e.includes(n))return[...e];let t=e.filter((o)=>o!==n),i=r===null||r===void 0?-1:t.indexOf(r);if(i<0)return[...t,n];return[...t.slice(0,i),n,...t.slice(i)]}function tt(e,n,r){let t=e.indexOf(n);if(t<0)return;if(r==="up")return t===0?void 0:{before:e[t-1]??null};return t===e.length-1?void 0:{before:e[t+2]??null}}function xo(e){let n=e.trim(),r=Array.from(n).length;if(r<1||r>40||/\p{Cc}/u.test(n))throw new l("bad-name");return n}var c=(e,n)=>e.toLocaleLowerCase()===n.toLocaleLowerCase();function u(e,n){let r=e.folders.findIndex((t)=>t.id===n);if(r<0)throw new l("no-folder");return r}var f=(e,n)=>({pins:e.pins,folders:n});function Bs(e,n,r){let t=u(e,n),i=xo(r);if(e.folders.some((o)=>o.id!==n&&c(o.name,i)))throw new l("duplicate");return f(e,e.folders.map((o,s)=>s===t?{...o,name:i}:o))}function Fs(e,n,r){let t=u(e,n),i=e.folders[t],o=Wn(e.folders.map((s)=>s.id),n,r);return f(e,o.map((s)=>s===n?i:e.folders.find((a)=>a.id===s)))}function Gs(e,n){return u(e,n),f(e,e.folders.filter((r)=>r.id!==n))}var d=(e,n)=>({pins:e.pins.filter((r)=>r!==n),folders:e.folders.map((r)=>r.rooms.includes(n)?{...r,rooms:r.rooms.filter((t)=>t!==n)}:r)});function Zs(e,n,r,t){if(r!==null)u(e,r);let i=d(e,n);if(r===null)return i;return f(i,i.folders.map((o)=>o.id===r?{...o,rooms:Wn(o.rooms,n,t)}:o))}function Ws(e,n,r,t){let i=d(e,n);if(!r)return i;return{pins:Wn(e.pins.filter((o)=>o!==n),n,t),folders:i.folders}}
|
|
2
|
-
export{qs,Wn,tt,xo,Bs,Fs,Gs,Zs,Ws};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{p,t,I,hn,O,d,f,es,me,He,At,Le,_t}from"./chunk-index-cn49mawx.js";import{Is}from"./chunk-index-wxft0aqb.js";import{ro}from"./chunk-index-sm7kfb07.js";import{Fn}from"./chunk-index-9bdstf8t.js";import{tn}from"./chunk-index-aexy023z.js";import{ne,Ee}from"./chunk-index-c7dbvkrq.js";import{fo}from"./chunk-index-vsfsv8hd.js";var m=(e)=>e();async function Bn(e){try{await navigator.clipboard.writeText(e),f(t("Copied"))}catch{f(t("Could not copy."),"danger")}}async function s(e){try{await navigator.share(e)}catch(o){if(o instanceof DOMException&&o.name==="AbortError")return;f(t("Could not share."),"danger")}}var b=()=>(p("zbwdaxtc"),import("./chunk-bulk-actions-zbwdaxtc.js")),h=()=>typeof navigator.share==="function";function ca(e,o=m){let i=O.getState().rooms[e],n=i?.view;if(!n||n.kind==="thread")return;let l=i.mode,a=n.home||n.helper?[]:ro(e,o);if(n.kind==="agent"){let r=n.name;a.push({id:"edit",label:t("Edit knight"),icon:"profile",run:()=>o(()=>He(r))},{id:"look",label:t("Change look"),icon:"sparkle",run:()=>o(()=>He(r,{look:!0}))},{id:"skills",label:t("Skills"),icon:"skills",run:()=>o(()=>He(r,{skills:!0}))})}if(n.kind==="group"){let r=n.name;a.push({id:"edit-group",label:t("Edit group"),icon:"profile",run:()=>o(()=>_t({kind:"group",name:r}))})}if(n.kind==="agent")a.push(...fo([e]));if(!n.helper)a.push({id:"notifications",label:t("Notifications"),icon:n.muted?"bell-off":"bell",checked:!n.muted,run:async()=>{let r=n.muted!==!0;if(!await tn(e,r))return;f(r?t("Notifications are off for {name}",{name:n.displayName}):t("Notifications are on for {name}",{name:n.displayName}))}});if(!n.readOnly)a.push({id:"yolo",label:t("Yolo mode"),icon:"bolt",tone:"yolo",checked:l.yolo,run:()=>{if(l.yolo)return At(e,{yolo:!1});Le({kind:"yolo",room:e,name:n.displayName})}},{id:"long",label:t("Long-running mode"),icon:"timer",tone:"long",checked:l.longRunning,run:()=>At(e,{longRunning:!l.longRunning})},{id:"start-over",label:t("Start over"),icon:"reset",tone:"danger",run:()=>Le({kind:"start-over",room:e,name:n.displayName})});if(n.helper){let{name:r,displayName:g}=n;a.push({id:"archive-helper",label:t("Archive this temp knight"),icon:"archive",tone:"danger",run:()=>b().then((v)=>v.archiveHelper(r,g))})}else if(!n.readOnly&&!n.coordinator)a.push({id:"archive",label:n.kind==="group"?t("Archive group"):t("Archive knight"),icon:"archive",tone:"danger",run:()=>Le({kind:"archive",room:e,name:n.displayName})});return{title:n.displayName,items:a}}function na(e=m){return{title:t("Add"),items:[{id:"new-agent",label:t("New knight"),icon:"profile",run:()=>e(()=>_t({kind:"new-agent"}))},{id:"new-group",label:t("New group"),icon:"rooms",run:()=>e(()=>_t({kind:"group"}))},{id:"archive-list",label:t("Archived"),icon:"archive",run:()=>e(()=>_t({kind:"archive"}))}]}}function ua(e,o){let i=e.getBoundingClientRect();me({...na(o),at:{x:i.left,y:i.bottom},via:"key",source:e})}function da(e,o){let{rooms:i}=O.getState(),n=i[e]?.view,l=i[o]?.view;if(n?.kind!=="agent"||l?.kind!=="group")return;return{title:n.displayName,items:[{id:"chat",label:t("Private chat"),icon:"conversations",run:()=>I("room",e)},{id:"leave",label:t("Remove from the council"),icon:"close",run:()=>y(l,n)}]}}async function y(e,o){let i=(e.members??[]).filter((n)=>n!==o.name);if(i.length<Fn){Le({kind:"archive",room:e.key,name:e.displayName});return}try{let n=await ne.group(e.name);await ne.updateGroup(e.name,{members:i,...n.host===o.name?{host:i[0]??""}:{}}),await Ee(),f(t("{name} left the council",{name:o.displayName}))}catch(n){f(d(n),"danger")}}function c(e,o){let i=e.querySelector(".bubble > .prose");if(!i)return o;return(i.innerText||i.textContent||o).trim()}function w(e){let o=window.getSelection();if(!o||o.isCollapsed)return"";return(o.anchorNode&&e.contains(o.anchorNode)?o.toString():"").trim()}function fa(e,o,i){let n=[{id:"copy",label:t("Copy"),icon:"copy",run:()=>Bn(w(o)||c(o,e.text))},{id:"copy-markdown",label:t("Copy as Markdown"),icon:"notes",run:()=>Bn(e.text)}];if(i)n.push({id:"quote",label:t("Quote reply"),icon:"conversations",run:()=>es(e.room,e.text)});if(n.push({id:"select",label:t("Select text"),icon:"list",run:()=>Is(e.author,e.text)}),h())n.push({id:"share",label:t("Share"),icon:"send",run:()=>s({text:c(o,e.text)})});return{title:e.author,items:n}}function ha(e,o){return{title:o,items:[{id:"profile",label:t("Knight profile"),icon:"profile",run:()=>He(e)}]}}var u=(e)=>[e.header?`${e.header}: ${e.question}`:e.question,...e.options.map((o)=>o.description?`- ${o.label}: ${o.description}`:`- ${o.label}`)];function ia(e){let o=[e.title];switch(e.kind){case"approval":{o.push("",e.message);let{approval:i}=e;if(i){if(o.push("",`${t("Tool")}: ${i.tool}`,`${t("Action")}: ${i.action}`),Object.keys(i.input).length)o.push(JSON.stringify(i.input,null,2));for(let n of i.files??[])o.push(n.path)}break}case"ask":o.push("",...u({question:e.question,options:e.options,multi:e.multi,allowOther:e.allowOther}));break;case"questionnaire":for(let i of e.questions)o.push("",...u(i));break}return o.join(`
|
|
2
|
-
`)}function pa(e){return{title:e.title,items:[{id:"copy-details",label:t("Copy details"),icon:"copy",run:()=>Bn(ia(e))}]}}function k(e){let o=document.createElement("a");o.href=hn(e),o.download=e.name,o.hidden=!0,document.body.append(o),o.click(),o.remove()}async function M(e){let o=new URL(hn(e),window.location.href).href;if(typeof navigator.canShare==="function")try{let i=await fetch(o);if(i.ok){let n=new File([await i.blob()],e.name,{type:e.type});if(navigator.canShare({files:[n]})){await s({files:[n],title:e.name});return}}}catch{}await s({title:e.name,url:o})}function ma(e){let o=[{id:"download",label:t("Download"),icon:"download",run:()=>k(e)}];if(h())o.push({id:"share",label:t("Share"),icon:"send",run:()=>M(e)});return{title:e.name,items:o}}
|
|
3
|
-
export{Bn,ca,na,ua,da,fa,ha,ia,pa,ma};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t,me,ds,wi}from"./chunk-index-cn49mawx.js";import{ze}from"./chunk-index-6yra9kdq.js";import{Mi}from"./chunk-index-vsfsv8hd.js";function si(e){let r=e.getBoundingClientRect(),o=ds();me({title:t("Rooms"),items:[...Mi(),{id:"new-folder",label:t("Add a folder"),icon:"plus",run:()=>ze({kind:"new"})},{id:"arrange",label:o?t("Done"):t("Arrange"),icon:o?"check":"list",run:()=>wi(!o)}],at:{x:r.left,y:r.bottom},via:"key",source:e})}
|
|
2
|
-
export{si};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{We,l}from"./chunk-index-cn49mawx.js";import{_n}from"./chunk-index-r7fdgzy1.js";var en=_n,Fn=2,d="rt-table-council",i,s=!1,u=new Set;function c(){try{return globalThis.localStorage?.getItem(d)??void 0}catch{return}}function g(){if(!s)i=c(),s=!0;return i}function io(n){i=n,s=!0;try{globalThis.localStorage?.setItem(d,n)}catch{}for(let e of u)e()}var a=(n)=>(u.add(n),()=>u.delete(n)),ys=()=>We(a,g,()=>{return});function Ti(){return l((n)=>n.order.map((e)=>n.rooms[e]?.view).filter((e)=>e!==void 0&&e.kind==="group"),"councils")}function bs(n,e,r){let t=(o)=>o===void 0?void 0:n.find((f)=>f.key===o||f.name===o);return t(r)??t(e)??n[0]}function vs(n){return[...n].filter((e)=>e.muted!==!0&&!e.helper).sort((e,r)=>Number(r.home)-Number(e.home)).slice(0,en).map((e)=>e.name)}function xs(n,e,r=en){if(n.includes(e))return n.filter((t)=>t!==e);return n.length>=r?[...n]:[...n,e]}function Ss(n,e){return n.filter(e).slice(0,en)}function ws(n,e,r){if(e!==void 0&&n.includes(e))return e;if(r!==void 0&&n.includes(r))return r;return n[0]??""}function ks(n,e){let r=n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,28)||"council";if(!e.has(r))return r;for(let t=2;;t+=1){let o=`${r}-${t}`;if(!e.has(o))return o}}
|
|
2
|
-
export{en,Fn,io,ys,Ti,bs,vs,xs,Ss,ws,ks};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import{o,$e,pi,a,r,t,g,e,n,s,Pe,l,M,_,Ye,wt,gn,fe,$t,et,Xe,Ji,er,tr,xn,we}from"./chunk-index-cn49mawx.js";import{Vo,En,qo,Or,Bt}from"./chunk-index-nkdg1dfz.js";import{se}from"./chunk-index-amxa2bn3.js";import{R}from"./chunk-index-m81362sc.js";function z(i,d,c,f){if(!i)return;let u=i.pending.at(-1);if(u&&!u.failed)return{id:`p${u.id}`,who:"owner",author:d,text:u.text,files:[],live:!1,pending:!0};if(i.typing&&i.progress.text!==""){let m=i.agent??f;return{id:`s${i.messages.at(-1)?.id??0}`,who:"agent",agent:m,author:c(m),text:i.progress.text,files:[],live:!0,pending:!1}}let h=i.live.at(-1);if(h)return{id:`l${h.live??h.id}`,who:"agent",agent:h.agent,author:h.author,text:h.text,files:h.files,live:!0,pending:!1};for(let m=i.messages.length-1;m>=0;m-=1){let p=i.messages[m];if(!p||p.kind==="system")continue;return{id:`m${p.id}`,who:p.kind==="owner"?"owner":"agent",agent:p.agent,author:p.author,text:p.text,files:p.files,live:!1,pending:!1}}return}function G(i,d,c){return i.cardOrder.map((u)=>({id:u,card:i.cards[u]})).filter((u)=>u.card?.room===d).filter((u)=>u.card.outcome===void 0||c===void 0||u.card.after>=c)}var he=90;function be(i,d,c,f={}){if(f.instant)return d;let u=i+c/1000*(f.cps??he);return Math.min(d,Math.max(i,u))}function j(){let i,d="",c=0,f=0;return{get shown(){return Math.floor(f)},get done(){return Math.floor(f)>=c},feed(u,h){if(u!==i){let m=d!==""&&(h.startsWith(d)||d.startsWith(h));if(i=u,!m)f=0}if(d=h,c=Array.from(h).length,f>c)f=c},step(u,h){f=be(f,c,u,{instant:h})},finish(){f=c}}}function Y(i,d,c){if(i?.who!=="agent")return;if(i.live&&c!==void 0)return c;return d?i.agent:void 0}function W(i,d=80){let c=i.split(`
|
|
2
|
-
`).map((u)=>u.replace(/^\s*(?:#{1,6}\s|>\s?|[-*+]\s|\d+\.\s)+/,"").replace(/[*_`~]/g,"").replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\s+/g," ").trim()).find((u)=>u!=="")??"",f=Array.from(c);return f.length>d?`${f.slice(0,d-1).join("")}…`:c}var U=(i,d)=>Array.from(i).slice(0,d).join("");function Z(i,d){if(!i||i.who!=="agent"||i.agent===void 0)return null;return d.includes(i.agent)?i.agent:null}function J(i,d,c){return c&&c.lineId===d?c.member:i}var Q="roundtable-console:dialogue-folded",X="roundtable-console:table-mode",P=new Map,{emit:ve,use:ee}=M();function ne(i){let d=P.get(i);if(d!==void 0)return d;try{let c=globalThis.localStorage?.getItem(i)??void 0;if(c!==void 0)P.set(i,c);return c}catch{return}}function te(i,d){P.set(i,d);try{globalThis.localStorage?.setItem(i,d)}catch{}ve()}var ye=()=>ne(Q)==="1";function xe(i){te(Q,i?"1":"0")}var ke=()=>ne(X)==="chat"?"chat":"scene";function Se(i){te(X,i)}function T(){return[ee(ye),xe]}function Io(){return[ee(ke),Se]}var Ne=24;function oe(i,d,c){let f=a(!0);o(()=>{let u=i.current;if(!u)return;let h=()=>{f.current=u.scrollHeight-u.scrollTop-u.clientHeight<=Ne};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[i]),$e(()=>{let u=i.current;if(!d){f.current=!0;return}if(u&&f.current)u.scrollTop=u.scrollHeight},[i,d,c])}var Re=`
|
|
3
|
-
/* The box's fold button says what it does, in words beside its chevron. */
|
|
4
|
-
.scene-collapse {
|
|
5
|
-
width: auto;
|
|
6
|
-
flex: none;
|
|
7
|
-
gap: var(--space-1);
|
|
8
|
-
padding-inline: var(--space-2);
|
|
9
|
-
font-size: var(--text-xs);
|
|
10
|
-
}
|
|
11
|
-
.scene-collapse span {
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
}
|
|
14
|
-
/* Folded, the box is one bar: who speaks, the start of their newest line, and the button that opens it. */
|
|
15
|
-
.scene-bar {
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
gap: var(--space-2);
|
|
19
|
-
min-height: var(--touch);
|
|
20
|
-
padding: var(--space-1) var(--space-1) var(--space-1) var(--space-2);
|
|
21
|
-
cursor: pointer;
|
|
22
|
-
}
|
|
23
|
-
.scene-bar .scene-chip {
|
|
24
|
-
width: 2rem;
|
|
25
|
-
height: 2rem;
|
|
26
|
-
margin: 0;
|
|
27
|
-
border-width: 2px;
|
|
28
|
-
flex: none;
|
|
29
|
-
}
|
|
30
|
-
.scene-bar-name {
|
|
31
|
-
flex: 0 1 auto;
|
|
32
|
-
min-width: 3ch;
|
|
33
|
-
max-width: 35%;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
text-overflow: ellipsis;
|
|
36
|
-
white-space: nowrap;
|
|
37
|
-
}
|
|
38
|
-
.scene-bar-preview {
|
|
39
|
-
flex: 1 1 0;
|
|
40
|
-
min-width: 0;
|
|
41
|
-
overflow: hidden;
|
|
42
|
-
text-overflow: ellipsis;
|
|
43
|
-
white-space: nowrap;
|
|
44
|
-
color: var(--muted);
|
|
45
|
-
font-size: var(--text-sm);
|
|
46
|
-
}
|
|
47
|
-
.scene-bar-asking {
|
|
48
|
-
flex: none;
|
|
49
|
-
padding: 0 var(--space-2);
|
|
50
|
-
border-radius: var(--radius-full);
|
|
51
|
-
background: color-mix(in srgb, var(--accent) 16%, transparent);
|
|
52
|
-
font-size: var(--text-xs);
|
|
53
|
-
white-space: nowrap;
|
|
54
|
-
}
|
|
55
|
-
.scene-composer[hidden] {
|
|
56
|
-
display: none;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* On a phone the tab's tools are narrow, but the fold button keeps its words. */
|
|
60
|
-
@media (max-width: 719px) {
|
|
61
|
-
.scene-tools .scene-collapse,
|
|
62
|
-
.scene-bar .scene-collapse {
|
|
63
|
-
width: auto;
|
|
64
|
-
min-width: 0;
|
|
65
|
-
padding-inline: var(--space-1);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
/* Phones held upright: folded, the box is only its bar and the scene takes the rest. */
|
|
69
|
-
@media (max-width: 719px) and (orientation: portrait) {
|
|
70
|
-
.table-frame[data-focused][data-folded] {
|
|
71
|
-
grid-template-rows: minmax(0, 1fr) auto;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
`,Le=`
|
|
75
|
-
/* The header's tools wrap under the title on a narrow screen rather than overflow it. */
|
|
76
|
-
.table-tools {
|
|
77
|
-
flex-wrap: wrap;
|
|
78
|
-
justify-content: flex-end;
|
|
79
|
-
}
|
|
80
|
-
/* The switch between the scene and the chat: two short choices that sit beside the council chip. */
|
|
81
|
-
.table-mode {
|
|
82
|
-
flex: none;
|
|
83
|
-
margin: 0;
|
|
84
|
-
}
|
|
85
|
-
.table-mode label {
|
|
86
|
-
min-height: 2rem;
|
|
87
|
-
padding: 0 var(--space-2);
|
|
88
|
-
font-size: var(--text-sm);
|
|
89
|
-
white-space: nowrap;
|
|
90
|
-
}
|
|
91
|
-
/* The council's messages as a chat fill the page under its header, like a room's own list. */
|
|
92
|
-
.table-chat {
|
|
93
|
-
position: relative;
|
|
94
|
-
flex: 1;
|
|
95
|
-
min-height: 0;
|
|
96
|
-
display: flex;
|
|
97
|
-
flex-direction: column;
|
|
98
|
-
}
|
|
99
|
-
`,re=()=>se("dialogue-fold",Re),Do=()=>se("table-page",Le);function Ce(i){if(i.ended==="limit")return t("Limit reached");if(i.ended==="stopped")return t("Round stopped");if(i.ended==="done")return t("{count} of {limit} replies",{count:i.replies,limit:i.limit});return t("Reply {n} of {limit}",{n:i.n,limit:i.limit})}var E=(i)=>Ce({...i,n:qo(i)});function ae(i){let d=l((m)=>m.rooms[i.roomKey]?.round),c=l((m)=>{let p={};for(let y of Object.values(m.rooms))if(y.view?.kind==="agent")p[y.view.name]=y.view.displayName;return p}),f=Xe();if(!d)return null;let u=Vo(d),h=(m)=>c[m]??m;return n("div",{className:"order-strip","data-state":d.state,children:[e("ol",{className:"order-faces","aria-label":t("Speaking order"),children:u.map((m,p)=>n("li",{className:"order-face","data-place":m.place,title:h(m.name),children:[e(fe,{spec:f[m.name],name:m.name,size:m.place==="current"?36:26,live:!1}),e("span",{className:"order-badge","aria-hidden":"true",children:m.place==="spoken"?"✓":m.place==="next"?m.order:null}),e("span",{className:"visually-hidden",children:`${h(m.name)}, ${m.place==="spoken"?t("has spoken"):m.place==="current"?t("speaking"):t("next")}`})]},`${m.name}:${p}`))}),e("span",{className:"order-chip","aria-live":"polite",children:E(d)}),d.state==="running"&&(d.queued??0)>0?e("span",{className:"order-queued",children:t("Your message waits for the next round")}):null]})}re();function Me(i){let d=a(j()),[,c]=pi((m)=>m+1,0),f=Pe();d.current.feed(i?.id??"",i?.text??"");let u=i?.text??"",h=i?.id;return o(()=>{let m=d.current;if(f||u===""||h===void 0){m.finish(),c();return}let p=performance.now(),y=0,w=()=>{let x=performance.now();if(m.step(x-p,!1),p=x,c(),!m.done)y=requestAnimationFrame(w)};if(!m.done)y=requestAnimationFrame(w);return()=>cancelAnimationFrame(y)},[f,h,u]),{shown:d.current.shown,done:d.current.done,finish(){d.current.finish(),c()}}}function A(i){let d=l((p)=>p.rooms[i]),c=l((p)=>p.principal?.name)??t("You"),f=l((p)=>{let y={};for(let w of Object.values(p.rooms))if(w.view?.kind==="agent")y[w.view.name]=w.view.displayName;return y}),u=d?.view,m=z(d,c,(p)=>(p===void 0?void 0:f[p])??p??u?.displayName??i,u?.kind==="agent"?u.name:void 0);return{room:d,view:u,line:m}}function Te(i){let{loaded:d,error:c}=i,f=l((p)=>p.rooms[i.roomKey]),[u,h]=r(!1),m=a(null);return o(()=>{if(i.open&&d)m.current?.scrollTo({top:m.current.scrollHeight})},[i.open,d]),e(R,{open:i.open,title:`${i.name} · ${t("Log")}`,onClose:i.onClose,children:n("div",{className:"scene-log",ref:m,children:[c?e("p",{className:"failure-text",children:c}):null,f?.more?e("button",{type:"button",className:"secondary older",disabled:u,onClick:async()=>{h(!0),await tr(i.roomKey),h(!1)},children:u?t("Loading…"):t("Load earlier messages")}):null,e(xn,{roomKey:i.roomKey,enterAfter:void 0,quotable:!0})]})})}function ie(i){let{roomKey:d}=i,c=we(),f=_(),u=er(d),h=i.streams!==!1;o(()=>{if(!h)return;return c.focus(d),()=>c.focus(void 0)},[c,d,h]);let m=l((v)=>v.limits),p=l((v)=>G(v,d,v.rooms[d]?.messages.at(-1)?.id)),y=Xe(),{room:w,view:x,line:b}=A(d),S=x?.kind==="agent"?x:void 0,N=S?S.name:b?.who==="agent"?b.agent:void 0,le=et(N?y[N]:void 0),L=S?S.displayName:b?b.author:x?.displayName??d,{shown:F,done:C,finish:K}=Me(b),de=Boolean(w?.typing&&w.progress.text!==""),D=Y(b,!C,de?En(w?.round)??b?.agent:void 0);o(()=>{Or(d,D)},[d,D]),o(()=>()=>Or(d,void 0),[d]);let H=a(null);oe(H,!C,F);let[ce,B]=r(!1),[k,I]=T(),ue=b?.who==="owner"&&!S?{["--agent-accent"]:"var(--accent)"}:le,me=Boolean(w?.typing)&&(!b||b.who==="owner"),pe=b?U(b.text,F):"",q=S||b?.who==="agent"?e("span",{className:"scene-chip",children:e(fe,{spec:N?y[N]:void 0,name:N??L,size:34,live:!1})}):null,ge=p.some(({card:v})=>v.outcome===void 0),V=n("button",{type:"button",className:"icon-button scene-collapse","aria-expanded":!k,onClick:(v)=>{v.stopPropagation(),I(!k)},children:[e(s,{name:"chevron",style:{rotate:k?"-90deg":"90deg"}}),e("span",{children:k?t("Expand dialogue"):t("Collapse dialogue")})]});return n("section",{className:"scene-box","data-open":i.open||void 0,"data-collapsed":k||void 0,"data-who":b?.who,style:ue,"aria-label":t("Log"),children:[k?n("div",{className:"scene-bar",onClick:()=>I(!1),children:[q,e("strong",{className:"scene-bar-name",children:L}),e("span",{className:"scene-bar-preview",children:b?W(b.text):w?.round?E(w.round):""}),ge?e("span",{className:"scene-bar-asking",children:t("Waiting for your answer")}):null,V]}):n("header",{className:"scene-tab",children:[q,e("strong",{className:"scene-name",children:L}),n("span",{className:"scene-tools",children:[i.onBack?e("button",{type:"button",className:"icon-button","aria-label":t("Back to the whole table"),onClick:i.onBack,children:e(s,{name:"back"})}):null,i.onMenu?e("button",{type:"button",className:"icon-button scene-more","aria-label":t("More"),"aria-haspopup":"menu",onClick:(v)=>i.onMenu?.(v.currentTarget),children:e(s,{name:"more"})}):null,n("button",{type:"button",className:"icon-button scene-log-button","aria-label":t("Log"),"aria-haspopup":"dialog",onClick:()=>B(!0),children:[e(s,{name:"conversations"}),e("span",{children:t("Log")})]}),V]})]}),k?null:i.strip,k?null:n("div",{className:"scene-body",ref:H,children:[e("div",{className:"scene-line","data-live":b?.live||void 0,"aria-live":"polite",...C?{}:{role:"button",tabIndex:0,title:t("Tap to show the whole message"),onClick:K,onKeyDown:(v)=>{if(v.key==="Enter"||v.key===" ")v.preventDefault(),K()}},children:b?n(g,{children:[S&&b.who==="owner"?e("span",{className:"scene-from",children:b.author}):null,e(Ye,{source:pe}),C?e($t,{files:b.files}):null]}):null}),me&&w?e(gn,{name:L,progress:w.progress}):null,p.map(({id:v,card:O})=>e("div",{className:"scene-card",children:e(Ji,{card:O,timeZone:f.timeZone})},v))]}),x?.readOnly?null:e("div",{className:"scene-composer",hidden:k,children:e(wt,{draftKey:d,name:x?.displayName??d,limits:m,stoppable:Boolean(w?.stoppable),blurAfterSend:i.blurAfterSend===!0,...x?.kind==="group"?{stopLabel:t("Stop the round")}:{},onSend:(v,O)=>c.say(d,v,O),onStop:()=>c.send({type:"stop",room:d})},d)}),e(Te,{roomKey:d,open:ce,loaded:u.loaded,error:u.error,name:x?.displayName??d,onClose:()=>B(!1)})]})}function Li(i,d){let{line:c}=A(i),f=l((x)=>En(x.rooms[i]?.round)),[u,h]=r(),m=`${c?.id??""}|${f??""}`,p=f!==void 0&&d.includes(f)?f:Z(c,d);return{focus:J(p,m,u),look:(x)=>h({lineId:m,member:x})}}function Xi(i){let{roomKey:d,members:c}=i,[f]=T();return n("div",{className:"table-frame room-scene","data-focused":"","data-folded":f||void 0,children:[e(Bt,{members:c,groupRoom:d,variant:"full",focus:i.focus,onFocus:i.onLook,onSeat:i.onLook,...i.onHandle?{onHandle:i.onHandle}:{},...i.onSeatMenu?{onSeatMenu:i.onSeatMenu}:{}}),e(ie,{roomKey:d,open:!0,streams:i.streams??!1,blurAfterSend:i.blurAfterSend===!0,strip:e(ae,{roomKey:d})})]})}function ra(i){let{focus:d,look:c}=Li(i.roomKey,i.members);return e(Xi,{roomKey:i.roomKey,members:i.members,focus:d,onLook:c})}
|
|
100
|
-
export{Io,Do,Li,Xi,ra};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var c=new WeakMap;function se(e,t){if(typeof document>"u")return;let n=c.get(document)??new Set;if(n.has(e))return;if(c.set(document,n.add(e)),typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let d=new CSSStyleSheet;d.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,d];return}catch{}let o=document.createElement("style");o.textContent=t,document.head.append(o)}
|
|
2
|
-
export{se};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ke,Fr,Kt,Gr,Z,ae,_i,Zr,Hs,js,Wr,Ks,Js,ea,wn}from"./chunk-index-fepsbhr6.js";export{Kt as AVATAR_STATES,Z as CATALOG,Ke as CLASS_IDS,ae as CharacterError,js as EAST_ASIAN_SKINS,Fr as EXPRESSIONS,Gr as STATE_EXPRESSION,Js as accentOf,ea as characterCss,Wr as checkSkins,Ks as composeSvg,Zr as parseCharacter,Hs as readCharacter,_i as resolveCharacter,wn as suggestCharacter};
|