pi-roundtable-web 0.29.1 → 0.29.2
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 +15 -0
- package/dist/chunk-account-dq0nhfvj.js +1 -0
- package/dist/{chunk-action-menu-ap5xn7bf.js → chunk-action-menu-37zgbhje.js} +1 -1
- package/dist/chunk-agent-yqe6reej.js +1 -0
- package/dist/chunk-arranged-rooms-sx6xg9df.js +1 -0
- package/dist/{chunk-attachments-p5v9gqyt.js → chunk-attachments-3vbj05g5.js} +2 -2
- package/dist/chunk-bulk-actions-6pehrsgb.js +1 -0
- package/dist/{chunk-character-creator-m7tw20ef.js → chunk-character-creator-bg3tdc8p.js} +2 -2
- package/dist/chunk-codeeditor-102wa9bj.js +2 -0
- package/dist/chunk-confirm-ghxga720.js +1 -0
- package/dist/chunk-connectors-0jzzren3.js +37 -0
- package/dist/chunk-conversations-3276jq4q.js +1 -0
- package/dist/chunk-council-sheet-7m884s44.js +2 -0
- package/dist/chunk-council-view-rkzcxeg8.js +1 -0
- package/dist/{chunk-drag-d1bpy8w6.js → chunk-drag-sw692nr3.js} +1 -1
- package/dist/chunk-entry-mb6jd983.js +1 -0
- package/dist/chunk-folder-list-g7st6p1e.js +1 -0
- package/dist/chunk-folds-rb1b069h.js +1 -0
- package/dist/{chunk-gate-dt91egcd.js → chunk-gate-3rxxyfev.js} +1 -1
- package/dist/chunk-host-icons-cyj62pwp.js +1 -0
- package/dist/chunk-host-picture-9wnhqckv.js +1 -0
- package/dist/chunk-host-state-b858k3p8.js +1 -0
- package/dist/chunk-host-ui-j6wvj0pe.js +1 -0
- package/dist/{chunk-index-6s2pqwna.js → chunk-index-0qzqzp6t.js} +2 -2
- package/dist/{chunk-index-w17wgjby.js → chunk-index-0t68az7d.js} +3 -3
- package/dist/chunk-index-0xdptr30.js +2 -0
- package/dist/{chunk-index-8wpvj7k5.js → chunk-index-1tkzdy4s.js} +2 -2
- package/dist/chunk-index-2s48qyrs.js +2 -0
- package/dist/chunk-index-33cqx9v2.js +2 -0
- package/dist/chunk-index-36m3knsk.js +2 -0
- package/dist/{chunk-index-7mrkq793.js → chunk-index-50syrmaq.js} +2 -2
- package/dist/{chunk-index-5j1v2q7w.js → chunk-index-50w6yq2d.js} +1 -1
- package/dist/{chunk-index-ce7hsda9.js → chunk-index-5fyqxh0r.js} +2 -2
- package/dist/chunk-index-5x3h176v.js +2 -0
- package/dist/{chunk-index-6btdp13p.js → chunk-index-6cs1wvhy.js} +1 -1
- package/dist/{chunk-index-yr758n6t.js → chunk-index-6m25qpa7.js} +2 -2
- package/dist/{chunk-index-d4mx2vvf.js → chunk-index-6nja2vd8.js} +2 -2
- package/dist/{chunk-index-wgrx2ybn.js → chunk-index-6q3dx093.js} +2 -2
- package/dist/{chunk-index-6rdywten.js → chunk-index-6ycrvwzs.js} +2 -2
- package/dist/{chunk-index-1kb8tv4v.js → chunk-index-6yfcfcc8.js} +2 -2
- package/dist/{chunk-index-4a1tdadd.js → chunk-index-7gk2sdf4.js} +3 -3
- package/dist/{chunk-index-q4k9vk04.js → chunk-index-7p31pda8.js} +3 -3
- package/dist/chunk-index-91wnf1k9.js +1 -0
- package/dist/chunk-index-9ehqccfe.js +2 -0
- package/dist/chunk-index-ar1x9fhw.js +2 -0
- package/dist/chunk-index-axw4wkqq.js +2 -0
- package/dist/chunk-index-b5patef1.js +2 -0
- package/dist/chunk-index-dagc92hw.js +2 -0
- package/dist/chunk-index-ddssgba9.js +2 -0
- package/dist/chunk-index-dpgn7kzp.js +2 -0
- package/dist/{chunk-index-cmzvq3nf.js → chunk-index-e8535c4h.js} +2 -2
- package/dist/{chunk-index-vpq2cj14.js → chunk-index-edjyj761.js} +1 -1
- package/dist/chunk-index-eez0kbk4.js +2 -0
- package/dist/chunk-index-ekp5mmvp.js +2 -0
- package/dist/{chunk-index-en728705.js → chunk-index-eyythjdx.js} +2 -2
- package/dist/chunk-index-fdg2qd3f.js +2 -0
- package/dist/chunk-index-g0sdxjxr.js +2 -0
- package/dist/{chunk-index-prq011b6.js → chunk-index-gmbk3sra.js} +1 -1
- package/dist/chunk-index-hsc9yz2x.js +2 -0
- package/dist/{chunk-index-ffnd0jcj.js → chunk-index-jrj09r5c.js} +2 -2
- package/dist/chunk-index-kvztbfqj.js +2 -0
- package/dist/{chunk-index-53fwc7sc.js → chunk-index-m7wzrmcd.js} +2 -2
- package/dist/{chunk-index-cfesmk1f.js → chunk-index-m8bv51r9.js} +2 -2
- package/dist/{chunk-index-v9jqyr1f.js → chunk-index-mey1p7h8.js} +3 -3
- package/dist/{chunk-index-0h99xcs3.js → chunk-index-mzw7nmkc.js} +2 -2
- package/dist/{chunk-index-3tksdmx7.js → chunk-index-n2v2bz8d.js} +2 -2
- package/dist/chunk-index-nncy9wxw.js +2 -0
- package/dist/chunk-index-p2e7rwac.js +2 -0
- package/dist/chunk-index-p98tt12y.js +2 -0
- package/dist/chunk-index-qdtmetsy.js +120 -0
- package/dist/{chunk-index-ysv36nbk.js → chunk-index-qedt9szy.js} +2 -2
- package/dist/{chunk-index-gdh7wsd5.js → chunk-index-qk7rp7fk.js} +11 -11
- package/dist/{chunk-index-nr275sa7.js → chunk-index-qq86fxda.js} +2 -2
- package/dist/{chunk-index-xbj816p0.js → chunk-index-qw9a7ken.js} +2 -2
- package/dist/chunk-index-s356ybxk.js +50 -0
- package/dist/{chunk-index-dr0jr7d3.js → chunk-index-sk8cvb4e.js} +3 -3
- package/dist/{chunk-index-m76gdwnk.js → chunk-index-syxwqhry.js} +2 -2
- package/dist/{chunk-index-ze9p4npm.js → chunk-index-tasbd41t.js} +2 -2
- package/dist/chunk-index-vxqzavgz.js +2 -0
- package/dist/{chunk-index-fn6305vn.js → chunk-index-x5xq9g9a.js} +3 -3
- package/dist/chunk-index-xx0kecz9.js +2 -0
- package/dist/{chunk-index-sz381vda.js → chunk-index-y1xv3dxs.js} +100 -4
- package/dist/{chunk-index-8pbwr3rs.js → chunk-index-yn1vvxj2.js} +1 -1
- package/dist/chunk-lang-css-rwkzd784.js +1 -0
- package/dist/{chunk-lang-dockerfile-y24eejnh.js → chunk-lang-dockerfile-e87ssppx.js} +1 -1
- package/dist/{chunk-lang-go-qzgv1161.js → chunk-lang-go-kbcbn346.js} +2 -2
- package/dist/chunk-lang-html-zhngbs9v.js +1 -0
- package/dist/chunk-lang-javascript-bk2s6a56.js +1 -0
- package/dist/{chunk-lang-json-99v80v88.js → chunk-lang-json-4pe1fv7e.js} +1 -1
- package/dist/{chunk-lang-markdown-gn8he877.js → chunk-lang-markdown-67cm3tjx.js} +5 -5
- package/dist/{chunk-lang-python-prsw4p4k.js → chunk-lang-python-mnfhcvww.js} +2 -2
- package/dist/{chunk-lang-rust-g6xqta16.js → chunk-lang-rust-e4a9s76x.js} +1 -1
- package/dist/{chunk-lang-shell-dmpnzc6w.js → chunk-lang-shell-43nea8tq.js} +1 -1
- package/dist/{chunk-lang-sql-wz7ca27b.js → chunk-lang-sql-28364npv.js} +2 -2
- package/dist/{chunk-lang-toml-160prtq4.js → chunk-lang-toml-a83hr7bw.js} +1 -1
- package/dist/chunk-lang-typescript-r5npc6zf.js +1 -0
- package/dist/{chunk-lang-xml-9htkz2dd.js → chunk-lang-xml-2hv5xc8n.js} +1 -1
- package/dist/{chunk-lang-yaml-08749wd5.js → chunk-lang-yaml-vw22drt8.js} +1 -1
- package/dist/chunk-layout-actions-rw5myg2t.js +1 -0
- package/dist/chunk-menu-items-q0hy5kzd.js +1 -0
- package/dist/chunk-mode-toggle-yk2t0tcy.js +1 -0
- package/dist/{chunk-note-row-28e5x7n8.js → chunk-note-row-c0trzayj.js} +3 -3
- package/dist/chunk-notes-0xcmm938.js +1 -0
- package/dist/chunk-notice-bell-f9nhxg71.js +1 -0
- package/dist/{chunk-notices-d0cwvk27.js → chunk-notices-gkaqncqz.js} +1 -1
- package/dist/chunk-onboarding-fkq9ptcw.js +1 -0
- package/dist/{chunk-overview-9sb3ywa8.js → chunk-overview-yssxbg0d.js} +1 -1
- package/dist/{chunk-palette-5sfhrv4x.js → chunk-palette-w6qbr7zp.js} +1 -1
- package/dist/chunk-placement-items-wcwy91mp.js +1 -0
- package/dist/chunk-profile-9sjgayrx.js +1 -0
- package/dist/chunk-prompt-history-kn42sf8y.js +1 -0
- package/dist/chunk-prompts-824fwgvh.js +1 -0
- package/dist/chunk-room-confirms-hvs9tra4.js +1 -0
- package/dist/{chunk-room-menu-hwkjyxwe.js → chunk-room-menu-pkd0487m.js} +1 -1
- package/dist/chunk-rooms-menu-button-w5hfhsfv.js +1 -0
- package/dist/chunk-schedules-m9mn68gt.js +1 -0
- package/dist/{chunk-seat-menu-n2bcw0mf.js → chunk-seat-menu-3tdcr44t.js} +1 -1
- package/dist/chunk-section-fold-g0tx68cj.js +1 -0
- package/dist/chunk-settings-18qmhcyr.js +1 -0
- package/dist/chunk-sheet-hosts-tsppnmvv.js +29 -0
- package/dist/{chunk-shortcut-help-434sqnxc.js → chunk-shortcut-help-wnm0cm8n.js} +2 -2
- package/dist/chunk-shortcuts-qee393s5.js +1 -0
- package/dist/{chunk-skill-editor-98492yrt.js → chunk-skill-editor-pryntvpr.js} +2 -2
- package/dist/{chunk-skills-mfv8ppfh.js → chunk-skills-sap3rysr.js} +1 -1
- package/dist/{chunk-start-over-line-m526193z.js → chunk-start-over-line-azexcxj1.js} +2 -2
- package/dist/chunk-switcher-list-6hacxjfe.js +1 -0
- package/dist/{chunk-tab-dot-tzjkahj5.js → chunk-tab-dot-h0eskhrt.js} +1 -1
- package/dist/{chunk-table-xbtbex2z.js → chunk-table-jtn49c2m.js} +1 -1
- package/dist/chunk-table2d-vy4w4r5k.js +1 -0
- package/dist/{chunk-table3d-5a7vbgyj.js → chunk-table3d-0a62jerb.js} +24 -24
- package/dist/chunk-thread-actions-31scmndt.js +1 -0
- package/dist/{chunk-thread-cards-n0n603vf.js → chunk-thread-cards-mwxzy02t.js} +1 -1
- package/dist/{chunk-thread-list-7bkdn51x.js → chunk-thread-list-52mx2m9p.js} +2 -2
- package/dist/chunk-transcript-p5q2m795.js +1 -0
- package/dist/{chunk-waiting-chip-y83c90v3.js → chunk-waiting-chip-wvkbsnw5.js} +2 -2
- package/dist/chunk-waiting-s7nm3q0p.js +1 -0
- package/dist/chunk-where-j99f8pb8.js +1 -0
- package/dist/{chunk-workspace-dw71mshw.js → chunk-workspace-ne2nkf4h.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-account-66e6ezdq.js +0 -1
- package/dist/chunk-agent-sapt5qhn.js +0 -1
- package/dist/chunk-arranged-rooms-n6bk696f.js +0 -1
- package/dist/chunk-bulk-actions-aze4ewc4.js +0 -1
- package/dist/chunk-codeeditor-yy6pq8mv.js +0 -2
- package/dist/chunk-confirm-0cajsfhk.js +0 -1
- package/dist/chunk-connectors-tw0tbm21.js +0 -37
- package/dist/chunk-conversations-wkm23m5r.js +0 -1
- package/dist/chunk-council-sheet-mz7s23nq.js +0 -2
- package/dist/chunk-council-view-zgvzxtgn.js +0 -1
- package/dist/chunk-entry-7zr5b1fp.js +0 -1
- package/dist/chunk-folder-list-bs4eh3g9.js +0 -1
- package/dist/chunk-folds-eez1q41c.js +0 -1
- package/dist/chunk-host-icons-nfe2t8tk.js +0 -1
- package/dist/chunk-host-picture-4rtswxwa.js +0 -1
- package/dist/chunk-host-state-1vxzmmq6.js +0 -1
- package/dist/chunk-host-ui-x38bf0et.js +0 -1
- package/dist/chunk-index-24cggw6k.js +0 -50
- package/dist/chunk-index-2g8xtwqg.js +0 -2
- package/dist/chunk-index-3n38xe7m.js +0 -2
- package/dist/chunk-index-55ps4x5n.js +0 -2
- package/dist/chunk-index-5w6tb7p0.js +0 -2
- package/dist/chunk-index-6m7dwsmv.js +0 -1
- package/dist/chunk-index-7xcbpeqz.js +0 -2
- package/dist/chunk-index-88wh5eyj.js +0 -2
- package/dist/chunk-index-97dcp1vh.js +0 -1
- package/dist/chunk-index-a7e6rhxy.js +0 -2
- package/dist/chunk-index-bxf8eq1s.js +0 -2
- package/dist/chunk-index-c8gm1crh.js +0 -120
- package/dist/chunk-index-d74tpnkd.js +0 -2
- package/dist/chunk-index-fb3kzyyp.js +0 -2
- package/dist/chunk-index-mr391t49.js +0 -2
- package/dist/chunk-index-n3khm9fq.js +0 -2
- package/dist/chunk-index-nn4w6a04.js +0 -2
- package/dist/chunk-index-pgxgq61x.js +0 -2
- package/dist/chunk-index-rgdaec7y.js +0 -2
- package/dist/chunk-index-rjs1can6.js +0 -2
- package/dist/chunk-index-s4a8e4qm.js +0 -2
- package/dist/chunk-index-vsaggfns.js +0 -2
- package/dist/chunk-index-wsv46y9p.js +0 -2
- package/dist/chunk-index-zfdvyrjt.js +0 -2
- package/dist/chunk-lang-css-3h22se37.js +0 -1
- package/dist/chunk-lang-html-9rvrmmpg.js +0 -1
- package/dist/chunk-lang-javascript-4kv8s3tk.js +0 -1
- package/dist/chunk-lang-typescript-mp0yw903.js +0 -1
- package/dist/chunk-layout-actions-tdx896xf.js +0 -1
- package/dist/chunk-menu-items-trhybv1g.js +0 -1
- package/dist/chunk-mode-toggle-4dtfphq4.js +0 -1
- package/dist/chunk-notes-5nkayhw8.js +0 -1
- package/dist/chunk-notice-bell-xz8a04am.js +0 -1
- package/dist/chunk-onboarding-zs4rtea9.js +0 -1
- package/dist/chunk-placement-items-e2neja55.js +0 -1
- package/dist/chunk-profile-jffhtpqf.js +0 -1
- package/dist/chunk-prompt-history-1jz2gk3v.js +0 -1
- package/dist/chunk-prompts-0t30ttd0.js +0 -1
- package/dist/chunk-room-confirms-6595921h.js +0 -1
- package/dist/chunk-rooms-menu-button-k0eq1tcr.js +0 -1
- package/dist/chunk-schedules-e12y8fw2.js +0 -1
- package/dist/chunk-sheet-hosts-myvm2vhd.js +0 -29
- package/dist/chunk-shortcuts-mjxph0g7.js +0 -1
- package/dist/chunk-switcher-list-5ngjar24.js +0 -1
- package/dist/chunk-table2d-61bvrykm.js +0 -1
- package/dist/chunk-thread-actions-bf6vf2mt.js +0 -1
- package/dist/chunk-transcript-8ztrkt6g.js +0 -1
- package/dist/chunk-waiting-s273kcgz.js +0 -1
- package/dist/chunk-where-jr791gzj.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E,o,r,l,te}from"./chunk-index-24cggw6k.js";function ln(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{ln};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o,r,l,te}from"./chunk-index-24cggw6k.js";function xe(f,e){let{version:u}=te(),[t,a]=r({data:void 0,error:void 0,subject:e});return o(()=>{let n=!0;return f().then((d)=>{if(n)a({data:d,error:void 0,subject:e})},(d)=>{if(n)a((i)=>({data:i.subject===e?i.data:void 0,error:l(d),subject:e}))}),()=>{n=!1}},[e,u]),t.subject===e?{data:t.data,error:t.error}:{data:void 0,error:void 0}}
|
|
2
|
-
export{xe};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p,t}from"./chunk-index-24cggw6k.js";import{Po}from"./chunk-index-nr275sa7.js";import{Xi,ta,na}from"./chunk-index-yr758n6t.js";function So(e){let n=Po();if(!e)return n;let r=new Set([...e,...ta(e)]);return Object.fromEntries(Object.entries(n).filter(([s])=>r.has(s)))}var i=()=>(p("aze4ewc4"),import("./chunk-bulk-actions-aze4ewc4.js"));function Li(e){let n=[];if(Object.keys(So(e)).length>0)n.push({id:"read-all",label:t("Mark all as read"),icon:"check",run:()=>{i().then((r)=>r.markAllRead(e))}});if(Xi(e).size>0)n.push({id:"clear-finished",label:t("Clear all finished threads"),icon:"trash",tone:"danger",run:()=>{i().then((r)=>r.clearAllFinished(e))}});return n.push(...wo(e)),n}function wo(e){if(na(e).size===0)return[];return[{id:"clear-helpers",label:t("Clear finished temp knights"),icon:"trash",tone:"danger",run:()=>{i().then((n)=>n.clearFinishedHelpers(e))}}]}
|
|
2
|
-
export{So,Li,wo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{je,to,Jt,no,W,ae,Ri,io,ua,da,ro,fa,ha,pa,Pn}from"./chunk-index-7mrkq793.js";export{Jt as AVATAR_STATES,W as CATALOG,je as CLASS_IDS,ae as CharacterError,da as EAST_ASIAN_SKINS,to as EXPRESSIONS,no as STATE_EXPRESSION,ha as accentOf,pa as characterCss,ro as checkSkins,fa as composeSvg,io as parseCharacter,ua as readCharacter,Ri as resolveCharacter,Pn as suggestCharacter};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P}from"./chunk-index-24cggw6k.js";var a="roundtable-console:folders-collapsed";function i(){try{let e=localStorage.getItem(a),t=e?JSON.parse(e):[];return new Set(Array.isArray(t)?t.filter((o)=>typeof o==="string"):[])}catch{return new Set}}var l,{emit:d,use:c}=P(),n=()=>(l??=i(),l);function s(e){l=e;try{localStorage.setItem(a,JSON.stringify([...e]))}catch{}d()}var Er=()=>c(n),Ar=()=>n();function $r(e){let t=new Set(n());if(!t.delete(e))t.add(e);s(t)}function Nr(e){if(!n().has(e))return;let t=new Set(n());t.delete(e),s(t)}function Lr(e){let t=new Set(e),o=n();if([...o].every((r)=>t.has(r)))return;s(new Set([...o].filter((r)=>t.has(r))))}export{Er,Ar,$r,Nr,Lr};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Se,X,O,P}from"./chunk-index-24cggw6k.js";var{emit:i,use:s}=P(),o=!1,n;function fn(t){return t.cardOrder.flatMap((e)=>{let r=t.cards[e];return r&&!r.outcome?[{id:e,card:r}]:[]})}function ya(){let t=fn(O.getState()),[e]=t;if(t.length===1&&e)Ki(e.id);else if(t.length>1)o=!0,i()}function ji(){if(!o)return;o=!1,i()}var Ur=()=>s(()=>o);function Ki(t){let e=O.getState().cards[t];if(!e)return;o=!1,n=t,i(),X("room",e.room)}var Vr=()=>s(()=>n);function qr(t){if(n!==t)return;n=void 0,i()}var bi=(t,e)=>[...t?.querySelectorAll("[data-card]")??[]].find((r)=>r.dataset.card===e),c=1600;function Ji(t,e){let r=bi(t,e);if(!r)return!1;r.scrollIntoView?.({block:"center",behavior:Se()?"auto":"smooth"});let a=r.querySelector(".prompt")??r;return a.tabIndex=-1,a.focus({preventScroll:!0}),r.dataset.lit="",setTimeout(()=>delete r.dataset.lit,c),!0}
|
|
2
|
-
export{fn,ya,ji,Ur,Ki,Vr,qr,bi,Ji};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p,o,a,ge,ir,Pi}from"./chunk-index-24cggw6k.js";var D=6,g=()=>(p("d1bpy8w6"),import("./chunk-drag-d1bpy8w6.js"));var h=()=>{return},L=0;function Xr(){if(L++===0)window.addEventListener("touchmove",h,{passive:!1});return()=>{if(--L===0)window.removeEventListener("touchmove",h)}}function Zt(T,m){let s=a(m);s.current=m;let E=m!==void 0;o(()=>E?Xr():void 0,[E]);let t=a(void 0),f=a(void 0),d=a(!1),v=(e,n,i)=>T(e).then((u)=>{if(u)ge({...u,at:n,via:i,source:e})},()=>{return}),y=(e,n,i,u)=>{let c=s.current,M=c?.item(e),P=c?.root(e);if(!c||!M||!P)return!1;return f.current??=g(),f.current.then(({lift:x})=>{if(t.current?.id!==n)return u();x({mode:c.mode,key:c.key,item:M,root:P,pointerId:n,y:i(),open:c.open,done:(l)=>{if(l.type==="tap")u();else if(l.type!=="cancel")c.onDrop(l)}})},u),!0},r=ir((e)=>{let n=()=>v(e.source,e.at,e.via),i=t.current;if(!(e.via==="hold"||e.via==="contextmenu"&&i?.touch)||!i)return void n();if(!y(e.source,i.id,()=>i.y,n))return void n();if(e.via==="contextmenu")d.current=!0});return{...r,onPointerDown(e){if(d.current=!1,t.current={id:e.pointerId,x:e.clientX,y:e.clientY,touch:e.pointerType!=="mouse"},e.pointerType!=="mouse"&&Pi(e.clientX,window.innerWidth))t.current=void 0;else if(s.current)f.current??=g();r.onPointerDown(e)},onPointerMove(e){let n=t.current;if(n?.id===e.pointerId){if(e.pointerType==="mouse"&&e.buttons===1&&!d.current&&s.current&&Math.hypot(e.clientX-n.x,e.clientY-n.y)>D)d.current=y(e.currentTarget,e.pointerId,()=>e.clientY,()=>{return});n.y=e.clientY}r.onPointerMove(e)},onPointerUp(e){if(t.current?.id===e.pointerId)t.current=void 0;r.onPointerUp(e)},onPointerCancel(e){if(t.current?.id===e.pointerId)t.current=void 0;r.onPointerCancel(e)},onContextMenu:r.onContextMenu,onKeyDown:r.onKeyDown,onClickCapture(e){if(d.current){d.current=!1,e.preventDefault(),e.stopPropagation();return}r.onClickCapture(e)},onDragStart(e){e.preventDefault()}}}
|
|
2
|
-
export{Xr,Zt};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import{p,T,x,_e,o,Te,C,Dn,a,r,t,u,g,e,n,s,Se,X,d,P,mn,Vn,rt,_,We,On,At,Qe,Ot,Bn,yn,ge,ke,gs,Sn,he,Lt,Je,De,ys,or,sr,ar,kn,He,$e,_n,gr,Or}from"./chunk-index-24cggw6k.js";import{Ze}from"./chunk-index-ce7hsda9.js";import{Le}from"./chunk-index-nr275sa7.js";import{Mn}from"./chunk-index-rjs1can6.js";import{R}from"./chunk-index-cmzvq3nf.js";import{Y}from"./chunk-index-d941ae7c.js";var Me=(i)=>`roundtable-console:council-mode:${i}`,Ge=(i)=>`rt-table-mode:${i}`,qe="roundtable-console:table-mode",Re=new Map,{emit:An,use:Hn}=P(),Ce=(i)=>i==="scene"||i==="chat"?i:void 0;function be(i){try{return globalThis.localStorage?.getItem(i)??void 0}catch{return}}function Ee(i,c){try{if(c===void 0)globalThis.localStorage?.removeItem(i);else globalThis.localStorage?.setItem(i,c)}catch{}}function Pn(i){let c=be(Ge(i)),m=c==="1"?"scene":c==="0"?"chat":void 0,h=m??Ce(be(qe))??"scene";if(m!==void 0||Ce(be(qe)))Ee(Me(i),h),Ee(Ge(i),void 0);return h}function Fn(i){let c=Re.get(i);if(c!==void 0)return c;let m=Ce(be(Me(i)))??Pn(i);return Re.set(i,m),m}function In(i,c){Re.set(i,c),Ee(Me(i),c),An()}function ze(i){return[Hn(()=>Fn(i)),(c)=>In(i,c)]}var Kn=`
|
|
2
|
-
/* The box's fold button says what it does, in words beside its chevron. */
|
|
3
|
-
.scene-collapse {
|
|
4
|
-
width: auto;
|
|
5
|
-
flex: none;
|
|
6
|
-
gap: var(--space-1);
|
|
7
|
-
padding-inline: var(--space-2);
|
|
8
|
-
font-size: var(--text-xs);
|
|
9
|
-
}
|
|
10
|
-
.scene-collapse span {
|
|
11
|
-
white-space: nowrap;
|
|
12
|
-
}
|
|
13
|
-
/* Folded, the box is one bar: who speaks, the start of their newest line, and the button that opens it. */
|
|
14
|
-
.scene-bar {
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
gap: var(--space-2);
|
|
18
|
-
min-height: var(--touch);
|
|
19
|
-
padding: var(--space-1) var(--space-1) var(--space-1) var(--space-2);
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
}
|
|
22
|
-
.scene-bar .scene-chip {
|
|
23
|
-
width: 2rem;
|
|
24
|
-
height: 2rem;
|
|
25
|
-
margin: 0;
|
|
26
|
-
border-width: 2px;
|
|
27
|
-
flex: none;
|
|
28
|
-
}
|
|
29
|
-
.scene-bar-name {
|
|
30
|
-
flex: 0 1 auto;
|
|
31
|
-
min-width: 3ch;
|
|
32
|
-
max-width: 35%;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
text-overflow: ellipsis;
|
|
35
|
-
white-space: nowrap;
|
|
36
|
-
}
|
|
37
|
-
.scene-bar-preview {
|
|
38
|
-
flex: 1 1 0;
|
|
39
|
-
min-width: 0;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
text-overflow: ellipsis;
|
|
42
|
-
white-space: nowrap;
|
|
43
|
-
color: var(--muted);
|
|
44
|
-
font-size: var(--text-sm);
|
|
45
|
-
}
|
|
46
|
-
.scene-bar-asking {
|
|
47
|
-
flex: none;
|
|
48
|
-
padding: 0 var(--space-2);
|
|
49
|
-
border-radius: var(--radius-full);
|
|
50
|
-
background: color-mix(in srgb, var(--accent) 16%, transparent);
|
|
51
|
-
font-size: var(--text-xs);
|
|
52
|
-
white-space: nowrap;
|
|
53
|
-
}
|
|
54
|
-
.scene-composer[hidden] {
|
|
55
|
-
display: none;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/* On a phone the tab's tools are narrow, but the fold button keeps its words. */
|
|
59
|
-
@media (max-width: 719px) {
|
|
60
|
-
.scene-tools .scene-collapse,
|
|
61
|
-
.scene-bar .scene-collapse {
|
|
62
|
-
width: auto;
|
|
63
|
-
min-width: 0;
|
|
64
|
-
padding-inline: var(--space-1);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/* Phones held upright: folded, the box is only its bar and the scene takes the rest. */
|
|
68
|
-
@media (max-width: 719px) and (orientation: portrait) {
|
|
69
|
-
.table-frame[data-focused][data-folded] {
|
|
70
|
-
grid-template-rows: minmax(0, 1fr) auto;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`,$n=`
|
|
74
|
-
/* The header's tools wrap under the title on a narrow screen rather than overflow it. */
|
|
75
|
-
.table-tools {
|
|
76
|
-
flex-wrap: wrap;
|
|
77
|
-
justify-content: flex-end;
|
|
78
|
-
}
|
|
79
|
-
/* The switch between the scene and the chat: two short choices that sit beside the council chip. */
|
|
80
|
-
.table-mode {
|
|
81
|
-
flex: none;
|
|
82
|
-
margin: 0;
|
|
83
|
-
}
|
|
84
|
-
.table-mode label {
|
|
85
|
-
min-height: 2rem;
|
|
86
|
-
padding: 0 var(--space-2);
|
|
87
|
-
font-size: var(--text-sm);
|
|
88
|
-
white-space: nowrap;
|
|
89
|
-
}
|
|
90
|
-
/* A council's header: on a phone its tools take a row of their own under the title. */
|
|
91
|
-
@media (max-width: 719px) {
|
|
92
|
-
.council-head {
|
|
93
|
-
flex-wrap: wrap;
|
|
94
|
-
}
|
|
95
|
-
.council-head .table-tools {
|
|
96
|
-
order: 3;
|
|
97
|
-
flex-basis: 100%;
|
|
98
|
-
min-width: 0;
|
|
99
|
-
}
|
|
100
|
-
.council-head .council-chip {
|
|
101
|
-
flex: 1 1 0;
|
|
102
|
-
min-width: 0;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
/* The council's messages as a chat fill the view under its header, like a room's own list. */
|
|
106
|
-
.table-chat {
|
|
107
|
-
position: relative;
|
|
108
|
-
flex: 1;
|
|
109
|
-
min-height: 0;
|
|
110
|
-
display: flex;
|
|
111
|
-
flex-direction: column;
|
|
112
|
-
}
|
|
113
|
-
`,je=()=>Y("dialogue-fold",Kn),qi=()=>Y("table-page",$n);function Ye(i,c,m,h){if(!i)return;let l=i.pending.at(-1);if(l&&!l.failed)return{id:`p${l.id}`,who:"owner",author:c,text:l.text,files:[],live:!1,pending:!0};if(i.typing&&i.progress.text!==""){let f=i.agent??h;return{id:`s${i.messages.at(-1)?.id??0}`,who:"agent",agent:f,author:m(f),text:i.progress.text,files:[],live:!0,pending:!1}}let b=i.live.at(-1);if(b)return{id:`l${b.live??b.id}`,who:"agent",agent:b.agent,author:b.author,text:b.text,files:b.files,live:!0,pending:!1};for(let f=i.messages.length-1;f>=0;f-=1){let y=i.messages[f];if(!y||y.kind==="system")continue;return Ue(y)}return}function Ue(i){return{id:`m${i.id}`,who:i.kind==="owner"?"owner":"agent",agent:i.agent,author:i.author,text:i.text,files:i.files,live:!1,pending:!1}}var Gn=(i,c)=>i.id===c.id||i.who===c.who&&i.agent===c.agent&&i.text!==""&&c.text!==""&&(c.text.startsWith(i.text)||i.text.startsWith(c.text));function Xe(){let i=[],c,m=(h)=>{let l=i.length-1,b=i[l];if(b&&Gn(b,h))i[l]=h;else i.push(h)};return{get line(){return i[0]},get waiting(){return Math.max(0,i.length-1)},feed(h,l){let b=h.at(-1)?.id??0;if(!c){c=b,i=l?[l]:[];return}if(!l){c=Math.max(c,b),i=[];return}for(let f of h)if(f.id>c&&f.kind!=="system")m(Ue(f));if(c=Math.max(c,b),l&&!l.id.startsWith("m"))m(l)},advance(){if(i.length<2)return!1;return i=i.slice(1),!0}}}function en(i,c,m){if(i!==void 0&&m.includes(i))return i;return Wn(c,m)}function nn(i,c,m){return i.cardOrder.map((l)=>({id:l,card:i.cards[l]})).filter((l)=>l.card?.room===c).filter((l)=>l.card.outcome===void 0||m===void 0||l.card.after>=m)}var qn=90;function zn(i,c,m,h={}){if(h.instant)return c;let l=i+m/1000*(h.cps??qn);return Math.min(c,Math.max(i,l))}function tn(){let i,c="",m=0,h=0;return{get shown(){return Math.floor(h)},get done(){return Math.floor(h)>=m},feed(l,b){if(l!==i){let f=c!==""&&(b.startsWith(c)||c.startsWith(b));if(i=l,!f)h=0}if(c=b,m=Array.from(b).length,h>m)h=m},step(l,b){h=zn(h,m,l,{instant:b})},finish(){h=m}}}function on(i,c,m){if(i?.who!=="agent")return;if(i.live&&m!==void 0)return m;return c?i.agent:void 0}function rn(i,c=80){let m=i.split(`
|
|
114
|
-
`).map((l)=>l.replace(/^\s*(?:#{1,6}\s|>\s?|[-*+]\s|\d+\.\s)+/,"").replace(/[*_`~]/g,"").replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\s+/g," ").trim()).find((l)=>l!=="")??"",h=Array.from(m);return h.length>c?`${h.slice(0,c-1).join("")}…`:m}var sn=(i,c)=>Array.from(i).slice(0,c).join("");function Wn(i,c){if(!i||i.who!=="agent"||i.agent===void 0)return null;return c.includes(i.agent)?i.agent:null}function an(i,c,m){return m&&m.lineId===c?m.member:i}var cn="roundtable-console:dialogue-folded",Ne=new Map,{emit:jn,use:Yn}=P();function Un(i){let c=Ne.get(i);if(c!==void 0)return c;try{let m=globalThis.localStorage?.getItem(i)??void 0;if(m!==void 0)Ne.set(i,m);return m}catch{return}}function Xn(i,c){Ne.set(i,c);try{globalThis.localStorage?.setItem(i,c)}catch{}jn()}var Zn=()=>Un(cn)==="1";function Jn(i){Xn(cn,i?"1":"0")}function ye(){return[Yn(Zn),Jn]}var ve={},{emit:Qn,use:et}=P();function Ae(i,c){if(ve[i]===c)return;let m={...ve};if(c===void 0)delete m[i];else m[i]=c;ve=m,Qn()}var nt=()=>ve;function we(){return et(nt)}var tt=24;function dn(i,c,m){let h=a(!0);o(()=>{let l=i.current;if(!l)return;let b=()=>{h.current=l.scrollHeight-l.scrollTop-l.clientHeight<=tt};return l.addEventListener("scroll",b,{passive:!0}),()=>l.removeEventListener("scroll",b)},[i]),Te(()=>{let l=i.current;if(!c){h.current=!0;return}if(l&&h.current)l.scrollTop=l.scrollHeight},[i,c,m])}var ot=["①","②","③","④","⑤","⑥","⑦","⑧"];function ln(i){if(!i)return[];return[...i.spoken.map((c)=>({name:c,place:"spoken"})),...i.current===void 0?[]:[{name:i.current,place:"current"}],...i.next.map((c,m)=>({name:c,place:"next",order:m+1}))]}function un(i){let c={};if(i?.state!=="running")return c;for(let h of i.spoken)c[h]="✓";let m=new Set;if(i.next.forEach((h,l)=>{let b=ot[l];if(b===void 0||m.has(h))return;m.add(h),c[h]=b}),i.current!==void 0)delete c[i.current];return c}var xe=(i)=>i?.state==="running"?i.current:void 0;function fn(i){let c=i.current===void 0?i.replies:i.replies+1;return Math.min(Math.max(c,0),i.limit)}function st(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 Oe=(i)=>st({...i,n:fn(i)});function pn(i){let c=d((f)=>f.rooms[i.roomKey]?.round),m=d((f)=>{let y={};for(let v of Object.values(f.rooms))if(v.view?.kind==="agent")y[v.view.name]=v.view.displayName;return y}),h=De();if(!c)return null;let l=ln(c),b=(f)=>m[f]??f;return n("div",{className:"order-strip","data-state":c.state,children:[e("ol",{className:"order-faces","aria-label":t("Speaking order"),children:l.map((f,y)=>n("li",{className:"order-face","data-place":f.place,title:b(f.name),children:[e(he,{spec:h[f.name],name:f.name,size:f.place==="current"?36:26,live:!1}),e("span",{className:"order-badge","aria-hidden":"true",children:f.place==="spoken"?"✓":f.place==="next"?f.order:null}),e("span",{className:"visually-hidden",children:`${b(f.name)}, ${f.place==="spoken"?t("has spoken"):f.place==="current"?t("speaking"):t("next")}`})]},`${f.name}:${y}`))}),e("span",{className:"order-chip","aria-live":"polite",children:Oe(c)}),c.state==="running"&&(c.queued??0)>0?e("span",{className:"order-queued",children:t("Your message waits for the next round")}):null]})}je();function it(i){let c=a(tn()),[,m]=Dn((f)=>f+1,0),h=Se();c.current.feed(i?.id??"",i?.text??"");let l=i?.text??"",b=i?.id;return o(()=>{let f=c.current;if(h||l===""||b===void 0){f.finish(),m();return}let y=performance.now(),v=0,S=()=>{let M=performance.now();if(f.step(M-y,!1),y=M,m(),!f.done)v=requestAnimationFrame(S)};if(!f.done)v=requestAnimationFrame(S);return()=>cancelAnimationFrame(v)},[h,b,l]),{shown:c.current.shown,done:c.current.done,finish(){c.current.finish(),m()}}}function Ve(i){let c=d((y)=>y.rooms[i]),m=d((y)=>y.principal?.name)??t("You"),h=d((y)=>{let v={};for(let S of Object.values(y.rooms))if(S.view?.kind==="agent")v[S.view.name]=S.view.displayName;return v}),l=c?.view,b=(y)=>(y===void 0?void 0:h[y])??y??l?.displayName??i,f=Ye(c,m,b,l?.kind==="agent"?l.name:void 0);return{room:c,view:l,line:f,displayOf:b}}function at(i){let{loaded:c,error:m}=i,h=d((y)=>y.rooms[i.roomKey]),[l,b]=r(!1),f=a(null);return o(()=>{if(i.open&&c)f.current?.scrollTo({top:f.current.scrollHeight})},[i.open,c]),e(R,{open:i.open,title:`${i.name} · ${t("Log")}`,onClose:i.onClose,children:n("div",{className:"scene-log",ref:f,children:[m?e("p",{className:"failure-text",children:m}):null,h?.more?e("button",{type:"button",className:"secondary older",disabled:l,onClick:async()=>{b(!0),await ar(i.roomKey),b(!1)},children:l?t("Loading…"):t("Load earlier messages")}):null,e(kn,{roomKey:i.roomKey,enterAfter:void 0,quotable:!0})]})})}function gn(i){let{roomKey:c}=i,m=$e(),h=_(),l=sr(c),b=i.streams!==!1;o(()=>{if(!b)return;return m.focus(c),()=>m.focus(void 0)},[m,c,b]);let f=d((L)=>L.limits),y=d((L)=>nn(L,c,L.rooms[c]?.messages.at(-1)?.id)),v=De(),{room:S,view:M,line:V,displayOf:Q}=Ve(c),z=a(void 0);if(z.current?.room!==c)z.current={room:c,stage:Xe()};let{stage:O}=z.current;O.feed(S?.messages??[],V);let{line:k,waiting:D}=O,F=M?.kind==="agent"?M:void 0,I=F?F.name:k?.who==="agent"?k.agent:void 0,te=Je(I?v[I]:void 0),G=F?F.displayName:k?k.author:M?.displayName??c,{shown:oe,done:q,finish:B}=it(k),[,ee]=Dn((L)=>L+1,0);o(()=>{if(q&&D>0&&O.advance())ee()},[q,D,O]);let re=xe(S?.round),se=Boolean(S?.typing&&S.progress.text!==""&&D===0),ae=on(k,!q,se?re??k?.agent:void 0);o(()=>{Ae(c,ae)},[c,ae]),o(()=>()=>Ae(c,void 0),[c]);let W=a(null);dn(W,!q,oe);let[U,Z]=r(!1),[H,K]=ye(),ce=k?.who==="owner"&&!F?{["--agent-accent"]:"var(--accent)"}:te,ne=Boolean(S?.typing),w=q&&D===0&&k?.who==="agent"&&re!==void 0&&re!==k.agent,E=ne&&(!k||k.who==="owner"||w),N=k?sn(k.text,oe):"",ie=F||k?.who==="agent"?e("span",{className:"scene-chip",children:e(he,{spec:I?v[I]:void 0,name:I??G,size:34,live:!1})}):null,j=y.some(({card:L})=>L.outcome===void 0),de=n("button",{type:"button",className:"icon-button scene-collapse","aria-expanded":!H,onClick:(L)=>{L.stopPropagation(),K(!H)},children:[e(s,{name:"chevron",style:{rotate:H?"-90deg":"90deg"}}),e("span",{children:H?t("Expand dialogue"):t("Collapse dialogue")})]});return n("section",{className:"scene-box","data-open":i.open||void 0,"data-collapsed":H||void 0,"data-who":k?.who,style:ce,"aria-label":t("Log"),children:[H?n("div",{className:"scene-bar",onClick:()=>K(!1),children:[ie,e("strong",{className:"scene-bar-name",children:G}),e("span",{className:"scene-bar-preview",children:k?rn(k.text):S?.round?Oe(S.round):""}),j?e("span",{className:"scene-bar-asking",children:t("Waiting for your answer")}):null,de]}):n("header",{className:"scene-tab",children:[ie,e("strong",{className:"scene-name",children:G}),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:(L)=>i.onMenu?.(L.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:()=>Z(!0),children:[e(s,{name:"conversations"}),e("span",{children:t("Log")})]}),de]})]}),H?null:i.strip,H?null:n("div",{className:"scene-body",ref:W,children:[e("div",{className:"scene-line","data-live":k?.live||void 0,"aria-live":"polite",...q?{}:{role:"button",tabIndex:0,title:t("Tap to show the whole message"),onClick:B,onKeyDown:(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),B()}},children:k?n(g,{children:[F&&k.who==="owner"?e("span",{className:"scene-from",children:k.author}):null,e(We,{source:N}),q?e(Lt,{files:k.files}):null]}):null}),E&&S?e(yn,{name:w?Q(re):G,progress:S.progress}):null,y.map(({id:L,card:A})=>e("div",{className:"scene-card",children:e(or,{card:A,timeZone:h.timeZone})},L))]}),M?.readOnly?null:e("div",{className:"scene-composer",hidden:H,children:e(At,{draftKey:c,name:M?.displayName??c,limits:f,stoppable:Boolean(S?.stoppable),blurAfterSend:i.blurAfterSend===!0,...M?.kind==="group"?{stopLabel:t("Stop the round")}:{},onSend:(L,A)=>m.say(c,L,A),onStop:()=>m.send({type:"stop",room:c})},c)}),e(at,{roomKey:c,open:U,loaded:l.loaded,error:l.error,name:M?.displayName??c,onClose:()=>Z(!1)})]})}var ct=8,dt={views:[],attention:{},loaded:!1},hn=dt,{emit:lt,use:ut}=P(),Nn=()=>ut(()=>hn);function ui(){let i=_e(rt)?.tier;return i!==void 0&&i!=="owner"}function mt(i,c){return{key:i.key,kind:"agent",name:`${c}.${i.id}`,displayName:i.title,home:!1,readOnly:!1,mode:{yolo:!1,longRunning:!1},typing:!1,stoppable:!1}}var ft=(i)=>i.attention===!0,pt=(i,c)=>(c.lastAt??"").localeCompare(i.lastAt??"");async function gt(i){let c=await Promise.allSettled(i.map((l)=>Ze.list(l))),m=[];c.forEach((l,b)=>{let f=i[b];if(l.status!=="fulfilled"||f===void 0)return;for(let y of l.value.rooms)m.push({room:y,kind:f})}),m.sort((l,b)=>pt(l.room,b.room));let h={};for(let{room:l}of m)if(ft(l))h[l.key]=!0;return{views:m.map(({room:l,kind:b})=>mt(l,b)),attention:h,loaded:!0}}function Ho(i){let c=$e(),m=d((S)=>S.connects),h=Le((S)=>S.lists),l=a(0),b=a(0),f=i.join(`
|
|
115
|
-
`),{views:y}=Nn();o(()=>{l.current+=1;let S=l.current,M=!0;return gt(f===""?[]:f.split(`
|
|
116
|
-
`)).then((V)=>{if(!M||S<b.current)return;b.current=S,hn=V,lt()}),()=>{M=!1}},[f,m,h]);let v=y.slice(0,ct).map((S)=>S.key).join(`
|
|
117
|
-
`);o(()=>{let S=v===""?[]:v.split(`
|
|
118
|
-
`);for(let M of S)c.send({type:"subscribe",room:M});return()=>{for(let M of S)c.send({type:"unsubscribe",room:M})}},[c,v,m])}var ht=380,bt="cubic-bezier(0.7, 0, 0.84, 0)",yt=2.4,bn=0.35,vt=260,wt="cubic-bezier(0.2, 0.8, 0.2, 1)",St=1.06,xt=700,J;function vn(i){if(J?.host===i&&J.phase==="diving")J.abort()}var kt=(i)=>{if(!i||typeof i.animate!=="function")return;i.animate([{transform:`scale(${St})`,opacity:bn},{transform:"scale(1)",opacity:1}],{duration:vt,easing:wt})};function wn(i,c,m,h){if(J)return;let l=i.closest("main.route")??i;if(Se()||typeof l.animate!=="function"){m();return}h?.();let b=l.getBoundingClientRect(),f=`${c.x-b.left}px ${c.y-b.top}px`,y={overflow:l.style.overflow,events:l.style.pointerEvents};l.style.overflow="hidden",l.style.pointerEvents="none";let v=l.animate([{transformOrigin:f,transform:"scale(1)",opacity:1},{transformOrigin:f,transform:`scale(${yt})`,opacity:bn}],{duration:ht,easing:bt,fill:"forwards"}),S=document.documentElement,M,V,Q=()=>{l.style.overflow=y.overflow,l.style.pointerEvents=y.events,v.cancel()},z=()=>{window.removeEventListener("popstate",k),window.removeEventListener("hashchange",k)},O={host:i,phase:"diving",abort:k};function k(){if(J!==O||O.phase!=="diving")return;z(),Q(),J=void 0}let D=(F)=>{if(J!==O)return;if(V?.disconnect(),clearTimeout(M),S.removeAttribute("data-dive"),Q(),J=void 0,F)kt(document.querySelector("main.route"))};J=O,window.addEventListener("popstate",k),window.addEventListener("hashchange",k),v.finished.then(()=>{if(J!==O||O.phase!=="diving")return;if(O.phase="committing",z(),S.setAttribute("data-dive",""),m(),!i.isConnected){D(!0);return}V=new MutationObserver(()=>{if(!i.isConnected)D(!0)}),V.observe(l.parentElement??document.body,{childList:!0,subtree:!0}),M=setTimeout(()=>D(!i.isConnected),xt)},()=>{return})}var Rt=(i)=>i==="sleepy"?"idle":i;function xn(i,c){let m={};for(let[l,b]of Object.entries(i))m[l]=Rt(b);let h=(l)=>l!==void 0&&(l in m)&&m[l]!=="waiting"&&m[l]!=="error";for(let l of c){let b=l.agent;if(l.typing&&h(b)){let f=m[b];if(f!=="thinking"&&f!=="working")m[b]="thinking"}}for(let l of c)if(h(l.voice))m[l.voice]="speaking";return m}function Fe(i,c){if(i==="speaking")return"happy";return(c?.STATE_EXPRESSION??Ct)[i]}var Ct={idle:"neutral",thinking:"thinking",working:"determined",waiting:"curious",done:"proud",error:"apologetic",sleepy:"sleepy"};function Ie(i,c){return`s${i}${c.toLowerCase().replace(/[^a-z0-9]/g,"")}`.slice(0,16)}var Et={x:-7,y:-3,w:114,h:100},ue=256;function Pe(i,c,m,h,l,b,f){let y=i.composeSvg(c,{bare:!0,look:m,expr:Fe(h,i),...f?{mouth:f}:{},state:"idle",still:!0,size:ue,uid:l,skins:b}),{x:v,y:S,w:M,h:V}=Et;return y.replace('viewBox="0 0 100 100"',`viewBox="${v} ${S} ${M} ${V}"`).replace(`width="${ue}" height="${ue}"`,`width="${ue}" height="${Math.round(ue*V/M)}"`)}function Ke(i,c,m,h,l,b){if(h!=="speaking")return{avatarSvg:Pe(i,c,m,h,l,b)};return{avatarSvg:Pe(i,c,m,h,l,b,"closed"),talkSvg:Pe(i,c,m,h,l,b,"open")}}function Rn(i){let c=i.delayMs??300,m=i.timers??{set:(f,y)=>setTimeout(f,y),clear:(f)=>clearTimeout(f)},h=new Map,l=new Map,b=(f)=>{let y=l.get(f);if(y===void 0)return;m.clear(y),l.delete(f)};return{seed(f,y){b(f),h.set(f,Fe(y))},update(f,y){let v=Fe(y);if(!h.has(f)){h.set(f,v);return}if(b(f),h.get(f)===v)return;l.set(f,m.set(()=>{l.delete(f),h.set(f,v),i.setAvatar(f,y)},c))},forget(f){b(f),h.delete(f)},dispose(){for(let f of[...l.keys()])b(f);h.clear()}}}var Mt={idle:u("idle"),thinking:u("thinking"),working:u("working"),waiting:u("waiting"),speaking:u("speaking"),done:u("done"),error:u("error")},Tt=()=>({table:t("Round table"),seat:(i,c)=>t("{name} ({state})",{name:i,state:t(Mt[c])})}),Nt=()=>{He().catch(()=>{return})};function di(i){let c=ui(),{views:m}=Nn(),h=d((l)=>{let b=l.order.map((y)=>l.rooms[y]?.view).filter((y)=>y!==void 0&&y.kind==="agent"&&!y.helper);return[...i?i.slice(0,Mn).map((y)=>b.find((v)=>v.name===y)).filter((y)=>y!==void 0):b].sort((y,v)=>Number(v.home)-Number(y.home)).slice(0,Mn)},i?.join(`
|
|
119
|
-
`)??"");return c?m.slice(0,Mn):h}function fi(){return d((i)=>i.order.map((c)=>i.rooms[c]?.view).filter((c)=>c!==void 0&&c.kind==="agent"&&!c.helper),"agents")}function Ht(i){let c=we(),m=d((h)=>Object.values(h.rooms).filter((l)=>i?l.key===i:l.view?.kind==="group").map((l)=>{let b=xe(l.round),f=b??l.agent,y=l.typing&&l.progress.text!=="";return{key:l.key,typing:l.typing||b!==void 0,...f===void 0?{}:{agent:f},...y&&f!==void 0?{streamer:f}:{}}}),i??"");return C(()=>m.map(({key:h,streamer:l,...b})=>{let f=c[h]??l;return f===void 0?b:{...b,voice:f}}),[m,c])}function Vt(i){return d((c)=>un(i?c.rooms[i]?.round:void 0),i??"")}function Ln(i){let{variant:c="full",onHandle:m}=i,h=Vn(),l=Ot(),b=Bn(),f=Sn(),y=De(),v=di(i.members),S=ys(v.map((w)=>w.key)),M=Ht(i.groupRoom),V=Vt(i.groupRoom),Q=Nn().attention,z=ui(),O=a(z);O.current=z;let k=c==="full"&&i.list===!0,D=C(()=>xn(Object.fromEntries(v.map((w)=>{let E=S[w.key]??"idle";return[w.name,Q[w.key]&&(E==="idle"||E==="sleepy")?"waiting":E]})),M),[v,S,M,Q]),F=a(D);F.current=D;let I=C(()=>{if(!h)return[];return v.map((w,E)=>{let N=y[w.name]??w.character??mn(h,w);return{id:w.name,name:w.displayName,color:h.accentOf(N,b.look),...Ke(h,N,b.look,F.current[w.name]??"idle",Ie(E,w.name),f)}})},[h,v,y,b.look,f]),te=a(I);te.current=I;let G=a(v);G.current=v;let oe=a({look:l,scheme:b.scheme});oe.current={look:l,scheme:b.scheme};let q=a(null),B=a(void 0),[ee,re]=r(0),se=a(void 0),ae=a(()=>{return});ae.current=(w)=>{let E=v.find((N)=>N.name===w);if(!h||!E)return;return y[w]??E.character??mn(h,E)};let W=a(b);W.current=b;let U=a(f);U.current=f;let Z=a(h);Z.current=h;let H=a(m);H.current=m;let K=a(i);K.current=i;let ce=h!==void 0&&I.length>0;o(()=>{let w=q.current;if(!ce||!w)return;let E=!0,N,ie=Rn({setAvatar:(j,de)=>{let L=ae.current(j),A=Z.current,le=G.current.findIndex((pe)=>pe.name===j);if(!L||!A||le<0)return;let{avatarSvg:me,talkSvg:fe}=Ke(A,L,W.current.look,de,Ie(le,j),U.current);N?.setAvatar(j,me,fe)}});return se.current=ie,(async()=>{let{mountRoundTable:j}=await (p("7zr5b1fp"),import("./chunk-entry-7zr5b1fp.js")),de=te.current.map((A)=>({...A,state:F.current[A.id]??"idle"})),L=await j(w,{theme:oe.current.look,scheme:oe.current.scheme,seats:de,onSeatClick:({id:A,at:le})=>{let me=K.current.onSeat;if(me){me(A);return}let fe=G.current.find((Tn)=>Tn.name===A);if(!fe)return;let pe=()=>X("room",fe.key),Be=q.current;if(le&&Be)wn(Be,le,pe,O.current?Nt:void 0);else pe()},...K.current.onSeatMenu?{onSeatMenu:(A)=>K.current.onSeatMenu?.(A)}:{},ownerName:K.current.ownerName??t("You"),focus:K.current.focus??null,onFocus:(A)=>K.current.onFocus?.(A),reducedMotion:"auto",lowPower:"auto",variant:c,listBelow:k,labels:Tt()});if(!E){L.dispose();return}N=L,B.current=L;for(let A of de)ie.seed(A.id,A.state??"idle");H.current?.(L),re((A)=>A+1)})(),()=>{E=!1,vn(w),ie.dispose(),se.current=void 0,B.current=void 0,H.current?.(void 0),N?.dispose()}},[ce,c,k]);let ne=i.focus??null;if(o(()=>{let w=B.current;if(w&&w.focused()!==ne)w.focus(ne)},[ne,ee]),o(()=>{let w=B.current;if(!w||I.length===0)return;let E=F.current;w.setSeats(I.map((N)=>({...N,state:E[N.id]??"idle"})));for(let N of I)se.current?.seed(N.id,E[N.id]??"idle")},[I,ee]),o(()=>{let w=B.current;if(!w)return;for(let E of te.current)w.setMark(E.id,V[E.id]??null)},[V,I,ee]),o(()=>{let w=B.current;if(w)w.setTheme(l,b.scheme)},[l,b.scheme,ee]),o(()=>{let w=B.current;if(!w)return;for(let E of te.current){let N=D[E.id]??"idle";w.setState(E.id,N),se.current?.update(E.id,N)}},[D,ee]),v.length===0)return e("p",{className:"table-empty",children:t("No knights are seated yet.")});return e("section",{className:"table-host",ref:q,"aria-label":t("Round table")})}function Cn(i,c){let{line:m}=Ve(i),h=we()[i],[l,b]=r(),f=en(h,m,c),y=`${m?.id??""}|${f??""}`;return{focus:an(f,y,l),look:(M)=>b({lineId:y,member:M})}}function En(i){let{roomKey:c,members:m}=i,[h]=ye();return n("div",{className:"table-frame room-scene","data-focused":"","data-folded":h||void 0,children:[e(Ln,{members:m,groupRoom:c,variant:"full",focus:i.focus,onFocus:i.onLook,onSeat:i.onLook,...i.onHandle?{onHandle:i.onHandle}:{},...i.onSeatMenu?{onSeatMenu:i.onSeatMenu}:{}}),e(gn,{roomKey:c,open:!0,streams:i.streams??!1,blurAfterSend:i.blurAfterSend===!0,strip:e(pn,{roomKey:c})})]})}qi();var Dt=x(()=>(p("mz7s23nq"),import("./chunk-council-sheet-mz7s23nq.js")).then((i)=>({default:i.CouncilSheet}))),Pt=x(()=>(p("4dtfphq4"),import("./chunk-mode-toggle-4dtfphq4.js")).then((i)=>({default:i.ModeToggle}))),Ft=x(()=>(p("hwkjyxwe"),import("./chunk-room-menu-hwkjyxwe.js")).then((i)=>({default:i.RoomMenu})));function It(i,c,m,h,l){gs(i,c).then((b)=>{if(b)ge({...b,at:m,via:h,source:l})},()=>{return})}function Kt(){let i=Qe("(max-width: 719px)"),c=Qe("(pointer: coarse)");return i||c}function Bi(i){return e("button",{type:"button",className:"secondary council-chip","aria-haspopup":"dialog",onClick:i.onOpen,children:i.council?t("Council: {name} ▾",{name:i.council.displayName}):t("Pick who sits")})}function Fi(i,c){let[m,h]=r(!1),[l,b]=r(!1),f=()=>{h(!0),b(!0)},y=m?e(T,{fallback:null,children:e(Dt,{open:l,onClose:()=>b(!1),council:i,...c?{go:c}:{}})}):null;return{ask:f,sheet:y}}function _t(i){let c=(m,h)=>n("label",{"data-checked":i.mode===m,children:[e("input",{type:"radio",name:"table-mode",value:m,checked:i.mode===m,onChange:()=>i.onMode(m)}),h]});return n("fieldset",{className:"segmented table-mode",children:[e("legend",{className:"visually-hidden",children:t("Show the council as")}),c("scene",t("Animation mode")),c("chat",t("Chat mode"))]})}function Qr(i){let{roomKey:c}=i,m=$e(),h=d((w)=>w.rooms[c]),l=d((w)=>w.connection==="open"),b=d((w)=>w.limits),f=Ot(),y=Kt(),v=h?.view,S=v?.members??[],M=di(S),[V,Q]=ze(c),[z,O]=r(),{focus:k,look:D}=Cn(c,S),{ask:F,sheet:I}=Fi(v,i.go),[te,G]=r(!1),[oe,q]=r(!1),B=a(null),[ee,re]=r(),[se,ae]=r(!1);o(()=>(m.focus(c),()=>m.focus(void 0)),[m,c]);let W=v?.displayName??c,U=h?.mode,Z=M.length>0||i.empty===void 0,H=Z&&V==="scene",K=v?.notes===!0,ce=K&&se,ne=K&&ee===c&&!ce;return n(g,{children:[n("header",{className:"room-head council-head",children:[i.lead,n("div",{className:"table-tools",children:[H&&z?.kind==="webgl"?e("button",{type:"button",className:"icon-button","aria-label":t("Reset view"),title:t("Reset view"),onClick:()=>D(null),children:e(s,{name:"reset"})}):null,Z?e(_t,{mode:V,onMode:Q}):null,e(Bi,{council:v,onOpen:F})]}),e(_n,{}),e("button",{ref:B,type:"button",className:"icon-button","aria-label":t("Room menu"),"aria-haspopup":"dialog",onClick:()=>{q(!0),G(!0)},children:e(s,{name:"menu"})})]}),f==="camelot"&&Z&&!H?e("div",{className:"group-strip",children:e(Ln,{members:S,groupRoom:c,variant:"compact"})}):null,!l?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,e(gr,{room:c,mode:U&&(U.yolo||U.longRunning)?U:void 0,approved:h?.autoApproved??0}),!Z?e("div",{className:"table-frame",children:i.empty}):H?e(En,{roomKey:c,members:S,focus:k,onLook:D,blurAfterSend:y,onHandle:O,onSeatMenu:(w)=>{let E=M.find((N)=>N.name===w.id);if(E)It(E.key,c,w.at,w.via,w.source)}}):e("div",{className:"table-chat",children:e(Or,{roomKey:c,name:W,composer:(w)=>v?.readOnly?null:e(At,{draftKey:c,name:W,onAddressed:ae,...K?{placeholder:ne?t("Write an internal note…"):t("Ask AI…"),above:e(T,{fallback:null,children:e(Pt,{on:!ne,label:t("@AI"),...ce?{locked:t("The message starts with @AI, so the knight answers.")}:{},onChange:(E)=>re(E?void 0:c)})})}:{},limits:b,stoppable:Boolean(h?.stoppable),stopLabel:t("Stop the round"),blurAfterSend:y,onSend:(E,N,ie)=>{if(K&&ie){let j=On(E);m.say(c,j===""&&N.length===0?E:j,N,"turn")}else m.say(c,E,N,ne?"note":void 0);w(!0)},onStop:()=>m.send({type:"stop",room:c}),...i.incoming&&i.onIncomingTaken?{incoming:i.incoming,onIncomingTaken:i.onIncomingTaken}:{}},c)})}),I,oe?e(T,{fallback:null,children:e(Ft,{open:te,room:c,mode:U,muted:v?.muted===!0,agent:void 0,group:v?.name,coordinator:v?.coordinator===!0,displayName:W,readOnly:v?.readOnly??!1,parent:void 0,onClose:()=>G(!1),onAskYolo:()=>{G(!1),ke({kind:"yolo",room:c,name:W,restoreFocus:()=>B.current})},onAskStartOver:()=>{G(!1),ke({kind:"start-over",room:c,name:W,restoreFocus:()=>B.current})}})}):null]})}
|
|
120
|
-
export{qi,Nn,ui,Ho,di,fi,Ln,Bi,Fi,Qr};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t,ge,xs,Qi}from"./chunk-index-24cggw6k.js";import{ze}from"./chunk-index-3n38xe7m.js";import{Li}from"./chunk-index-5w6tb7p0.js";function ci(e){let r=e.getBoundingClientRect(),o=xs();ge({title:t("Rooms"),items:[...Li(),{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:()=>Qi(!o)}],at:{x:r.left,y:r.bottom},via:"key",source:e})}
|
|
2
|
-
export{ci};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{as,O,P,hr}from"./chunk-index-24cggw6k.js";var t=()=>hr(as);function Ci(e){return e.kind==="owner"&&e.delivery==="queued"&&e.principalId!==void 0&&e.principalId===O.getState().principal?.id}function Qs(e){t().send({type:"cancel_queued",room:e.room,message:e.id})}function Ms(e,i){t().send({type:"edit_queued",room:e.room,message:e.id,text:i})}var o,{emit:n,use:r}=P();function Ei(e){o=e,n()}function po(){if(!o)return;o=void 0,n()}var Rs=()=>r(()=>o);
|
|
2
|
-
export{Ci,Qs,Ms,Ei,po,Rs};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{P,h}from"./chunk-index-24cggw6k.js";var vo={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 Hs(e,t){n={room:e,until:t},r()}function js(){if(!n)return;n=void 0,r()}var Ks=()=>s(()=>n),i;function Js(e,t){i={author:e,text:t},r()}function xo(){if(!i)return;i=void 0,r()}var ea=()=>s(()=>i);
|
|
2
|
-
export{vo,Hs,js,Ks,Js,xo,ea};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p,t,O}from"./chunk-index-24cggw6k.js";import{ze}from"./chunk-index-3n38xe7m.js";import{Li}from"./chunk-index-5w6tb7p0.js";import{Cn}from"./chunk-index-88wh5eyj.js";import{et}from"./chunk-index-zfdvyrjt.js";import{It,zi}from"./chunk-index-6rdywten.js";var s=(e)=>e(),m=()=>(p("tdx896xf"),import("./chunk-layout-actions-tdx896xf.js"));function mo(e,l=s){let o=It(Cn(),e),d=o.kind==="pinned",i=[{id:"pin",label:d?t("Unpin"):t("Pin"),icon:"pin",run:()=>{m().then((r)=>r.pinRoom(e,!d))}},{id:"move",label:t("Move to folder…"),icon:"folder",run:()=>l(()=>ze({kind:"move",room:e}))}];if(o.kind==="rest")return i;if(et(o.siblings,e,"up"))i.push({id:"up",label:t("Move up"),icon:"up",run:()=>{m().then((r)=>r.nudgeRoom(e,"up"))}});if(et(o.siblings,e,"down"))i.push({id:"down",label:t("Move down"),icon:"down",run:()=>{m().then((r)=>r.nudgeRoom(e,"down"))}});return i}function Ma(e){let l=O.getState(),o=l.folders.find((n)=>n.id===e);if(!o)return;let d=Cn().folders.find((n)=>n.id===e)?.rooms??[],i=zi(d,(n)=>l.rooms[n]?.view?.muted===!0)==="all",r=l.folders.map((n)=>n.id),u=[{id:"rename",label:t("Rename"),icon:"edit",run:()=>ze({kind:"rename",id:e,name:o.name})}];if(d.length>0)u.push({id:"mute",label:i?t("Unmute the whole folder"):t("Mute the whole folder"),icon:i?"bell":"bell-off",run:()=>{m().then((n)=>n.muteFolder(e,!i))}});if(u.push(...Li(d)),et(r,e,"up"))u.push({id:"up",label:t("Move up"),icon:"up",run:()=>{m().then((n)=>n.nudgeFolder(e,"up"))}});if(et(r,e,"down"))u.push({id:"down",label:t("Move down"),icon:"down",run:()=>{m().then((n)=>n.nudgeFolder(e,"down"))}});return u.push({id:"delete",label:t("Delete folder"),icon:"trash",tone:"danger",run:()=>ze({kind:"delete",id:e,name:o.name})}),{title:o.name,items:u}}
|
|
2
|
-
export{mo,Ma};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Jn}from"./chunk-index-zfdvyrjt.js";var f=12;function m(r,e){let t=r.find((u)=>e>=u.top&&e<=u.bottom);if(t)return t;let n,o=f+1;for(let u of r){let i=e<u.top?u.top-e:e-u.bottom;if(i<o)n=u,o=i}return n}function d(r,e,t){for(let n of r)if(n.key!==e&&n.top+n.height/2>t)return n.key;return null}function ws(r,e,t){let n=m(r,t);return n?{zone:n,before:d(n.items,e,t)}:void 0}function ks(r,e,t){let{zone:n,before:o}=t;if(n.kind==="rest")return r.kind==="rest"?void 0:{kind:"unplace"};if(n.kind==="pinned"&&r.kind==="pinned"||n.kind==="folder"&&r.kind==="folder"&&r.folder===n.folder){let i=r.siblings;if(Jn(i,e,o).every((s,l)=>s===i[l]))return}return n.kind==="pinned"?{kind:"pin",before:o}:{kind:"folder",folder:n.folder,before:o}}function _s(r,e,t,n){if(n<e.top-f*3||n>e.bottom+f*3)return;return{before:d(r,t,n)}}function fo(r,e,t,n=0){let o=(r[e]?.height??0)+n;return r.map((u,i)=>{if(i===e)return 0;if(e<t&&i>e&&i<=t)return-o;if(e>t&&i>=t&&i<e)return o;return 0})}function ho(r,e,t){return Jn(r,e,t).indexOf(e)}function Ts(r,e,t,n=64,o=18){if(r<e+n)return-Math.min(1,(e+n-r)/n)*o;if(r>t-n)return Math.min(1,(r-(t-n))/n)*o;return 0}var Ps=600;
|
|
2
|
-
export{ws,ks,_s,fo,ho,Ts,Ps};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var rn=Math.PI*2,Mn=8;function Rn(n){let t=((n+Math.PI)%rn+rn)%rn-Math.PI;return t===-Math.PI?Math.PI:t}var jn=(n,t)=>Rn(t-n);function vr(n){let t=Math.min(Math.max(n,0),8);return{count:1+t,seated:t}}var y=0.62,E=(n)=>Math.min(rn/Math.max(n,1),y),on=(n,t)=>n===0?0:Rn(Math.PI+(n-t/2)*E(t)),zt=(n)=>Math.max(4.2,2.6/(2*Math.sin(E(n)/2)));function z(n,t){let o=0,e=Number.POSITIVE_INFINITY;for(let r=0;r<t;r+=1){let u=Math.abs(jn(n,on(r,t)));if(u<e-0.000000001)e=u,o=r}return o}var Oo=(n,t)=>on(z(n,t),t);function Is(n,t){if(t.seated===0)return;let o=Rn(n+Math.PI),e,r=Number.POSITIVE_INFINITY;for(let u=1;u<=t.seated;u+=1){let s=Math.abs(jn(o,on(u,t.count)));if(s<r-0.000000001)r=s,e=u}return e}var x=1.65,R=1.06,T=44,N=390,v=4.8,p=0.07,d=3;function H(n,t,o){let{position:e,target:r}=yo(n),u=S([r[0]-e[0],r[1]-e[1],r[2]-e[2]]),s=S(P(u,[0,1,0])),i=P(s,u),m=[o[0]-e[0],o[1]-e[1],o[2]-e[2]],a=h(m,u),c=Math.tan(bo(n.fov,t)*Math.PI/360),l=a>0.000001?a:Number.NaN;return{x:h(m,s)/(l*c*t),y:h(m,i)/(l*c),depth:a}}var h=(n,t)=>n[0]*t[0]+n[1]*t[1]+n[2]*t[2],P=(n,t)=>[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]],S=(n)=>{let t=Math.hypot(n[0],n[1],n[2])||1;return[n[0]/t,n[1]/t,n[2]/t]};function Y(n){let t=zt(n),o=[];for(let e=1;e<n;e+=1){let r=on(e,n),u=Math.cos(r),s=-Math.sin(r);for(let i of[-1,1])for(let m of[0,v])o.push([Math.sin(r)*t+u*i*x,m,Math.cos(r)*t+s*i*x])}return o}function A(n,t,o,e=p,r=e){let u=1-r,s=1-e;return o.every((i)=>{let m=H(n,t,i);return Math.abs(m.x)<=u&&Math.abs(m.y)<=s})}var yt=2.9,D=0.7,X=0.2,w=0.8;function Ds(n,t,o){let e=o[0]-n[0],r=o[2]-n[2],u=Math.hypot(e,r)||1,s=r/u,i=-e/u,m=yt*D/2,a=yt*t,c=n[1]+a/2-a*X,l=n[1]+a/2-a*w,M=[];for(let f of[-1,1])for(let k of[c,l])M.push([n[0]+s*f*m,k,n[2]+i*f*m]);return M}function O(n){let t=zt(n),o=[];for(let e=1;e<n;e+=1){let r=on(e,n);o.push([Math.sin(r)*t,R,Math.cos(r)*t])}return o}function g(n,t){return{...n,r:n.lookR+(n.r-n.lookR)*t,y:n.lookY+(n.y-n.lookY)*t}}function Kn(n,t,o=1.6,e=N){let r=zt(t),u={az:n,r:r+4.4,y:4.4+r*0.1,aim:0,lookR:-1.6,lookY:2.5,roll:0,fov:46};if(!(o>0))return u;let s=Y(t),i=O(t),m=p+T/(Math.max(e,1)/2);for(let a=1;a<=d;a+=0.02){let c=g(u,a);if(A(c,o,s)&&A(c,o,i,p,m))return c}return g(u,d)}function Us(n,t){let o=zt(t),e=0.18;return{az:Rn(n+0.18),r:Math.max(o-3.9,0.5),y:1.8,aim:-0.18,lookR:o+0.1,lookY:1.7,roll:-0.16,fov:58}}var b=(n,t,o)=>n+(t-n)*o;function Vs(n,t,o){return{az:Rn(n.az+jn(n.az,t.az)*o),r:b(n.r,t.r,o),y:b(n.y,t.y,o),aim:b(n.aim,t.aim,o),lookR:b(n.lookR,t.lookR,o),lookY:b(n.lookY,t.lookY,o),roll:b(n.roll,t.roll,o),fov:b(n.fov,t.fov,o)}}var Ni=(n)=>{let t=Math.min(1,Math.max(0,n));return t<0.5?4*t*t*t:1-(-2*t+2)**3/2},qs=(n)=>{let t=Math.min(1,Math.max(0,n)),o=(u,s,i)=>3*(1-u)*(1-u)*u*s+3*(1-u)*u*u*i+u*u*u,e=0,r=1;for(let u=0;u<24;u++){let s=(e+r)/2;if(o(s,0.7,0.84)<t)e=s;else r=s}return o((e+r)/2,0,0)},F=420,I=450,V=650;function Bs(n,t,o,e=!1){if(o)return{ms:0,cut:!0};if(e)return{ms:F,cut:!1,dive:!0};let r=Math.abs(jn(n.az,t.az))/Math.PI;return{ms:Math.round(I+(V-I)*r),cut:!1}}function yo(n){let t=n.az+n.aim;return{position:[Math.sin(n.az)*n.r,n.y,Math.cos(n.az)*n.r],target:[Math.sin(t)*n.lookR,n.lookY,Math.cos(t)*n.lookR]}}function Fs(n,t){let o=on(n,t),e=zt(t);return{x:Math.sin(o)*e,z:Math.cos(o)*e,yaw:o+Math.PI}}var Gs=(n,t)=>-n/Math.max(t,1)*(Math.PI/2),Zs=(n)=>n<0?-1:1,_=32;function Ws(n,t,o,e){let r=(u,s,i)=>u-s<_||i-u<_;return r(n,0,e.width)||r(t,0,e.height)||r(n,o.left,o.left+o.width)||r(t,o.top,o.top+o.height)}function Ys(n,t){if(Math.abs(n)<0.000001)return"none";if(n<0)return t?"none":"in";return t?"out":"none"}function bo(n,t){if(!(t>0)||t>=1.2)return n;return Math.min(n*(1+(1.2-t)*0.55),95)}
|
|
2
|
-
export{rn,Mn,Rn,jn,vr,on,zt,Oo,Is,yt,Ds,Kn,Us,Vs,Ni,qs,Bs,yo,Fs,Gs,Zs,Ws,Ys,bo};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{O,h,l,f}from"./chunk-index-24cggw6k.js";import{ks}from"./chunk-index-rgdaec7y.js";import{Co,Cn}from"./chunk-index-88wh5eyj.js";import{et,ra,oa,sa,aa,la}from"./chunk-index-zfdvyrjt.js";import{It}from"./chunk-index-6rdywten.js";var n={createFolder:(e)=>h("folders",{method:"POST",body:JSON.stringify({name:e})}),changeFolder:(e,t)=>h(`folders/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}),deleteFolder:(e)=>h(`folders/${encodeURIComponent(e)}`,{method:"DELETE"}),muteFolder:(e,t)=>h(`folders/${encodeURIComponent(e)}/mute`,{method:"PUT",body:JSON.stringify({muted:t})}),placeRoom:(e,t,o)=>h(`rooms/${encodeURIComponent(e)}/folder`,{method:"PUT",body:JSON.stringify({folder:t,before:o})}),pinRoom:(e,t,o)=>h(`rooms/${encodeURIComponent(e)}/pin`,{method:"PUT",body:JSON.stringify({pinned:t,before:o})})};var a=(e)=>f(e,"danger"),d=(e)=>O.dispatch({type:"layout_loaded",pins:e.pins,folders:e.folders});async function i(e,t,o=a){let r=Co();try{d(e(r))}catch{}try{let s=await t();return d(s),s}catch(s){d(r),O.dispatch({type:"changed"}),o(l(s));return}}var Ss=(e,t,o=null)=>i((r)=>la(r,e,t,o),()=>n.pinRoom(e,t,o)),en=(e,t,o=null)=>i((r)=>aa(r,e,t,o),()=>n.placeRoom(e,t,o));function br(e,t){let o=It(Cn(),e);if(o.kind==="rest")return;let r=et(o.siblings,e,t);if(!r)return;return o.kind==="pinned"?Ss(e,!0,r.before):en(e,o.folder,r.before)}async function lo(e,t=a){try{let o=await n.createFolder(e);return d(o),o.folders.at(-1)?.id}catch(o){t(l(o));return}}var co=(e,t,o)=>i((r)=>ra(r,e,t),()=>n.changeFolder(e,{name:t}),o),ma=(e,t)=>i((o)=>oa(o,e,t),()=>n.changeFolder(e,{before:t}));function ba(e,t){let o=et(Co().folders.map((r)=>r.id),e,t);return o?ma(e,o.before):void 0}var uo=(e,t)=>i((o)=>sa(o,e),()=>n.deleteFolder(e),t);async function va(e,t){try{let o=await n.muteFolder(e,t);for(let r of o.rooms)O.dispatch({type:"room_muted",room:r,muted:o.muted});return!0}catch(o){return a(l(o)),!1}}function xa(e,t){let o=ks(It(Cn(),e),e,t);if(!o)return;if(o.kind==="pin")return Ss(e,!0,o.before);if(o.kind==="folder")return en(e,o.folder,o.before);return en(e,null)}
|
|
2
|
-
export{Ss,en,br,lo,co,ma,ba,uo,va,xa};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{it,d}from"./chunk-index-24cggw6k.js";import{Mn}from"./chunk-index-rjs1can6.js";var tn=Mn,Hn=2,l="rt-table-council",i,s=!1,u=new Set;function c(){try{return globalThis.localStorage?.getItem(l)??void 0}catch{return}}function g(){if(!s)i=c(),s=!0;return i}function go(n){i=n,s=!0;try{globalThis.localStorage?.setItem(l,n)}catch{}for(let e of u)e()}var a=(n)=>(u.add(n),()=>u.delete(n)),Cs=()=>it(a,g,()=>{return});function Ai(){return d((n)=>n.order.map((e)=>n.rooms[e]?.view).filter((e)=>e!==void 0&&e.kind==="group"),"councils")}function Es(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 As(n){return[...n].filter((e)=>e.muted!==!0&&!e.helper).sort((e,r)=>Number(r.home)-Number(e.home)).slice(0,tn).map((e)=>e.name)}function $s(n,e,r=tn){if(n.includes(e))return n.filter((t)=>t!==e);return n.length>=r?[...n]:[...n,e]}function Ns(n,e){return n.filter(e).slice(0,tn)}function Ls(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 Xs(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{tn,Hn,go,Cs,Ai,Es,As,$s,Ns,Ls,Xs};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var ia=40;class l extends Error{code;constructor(e){super(e);this.code=e;this.name="LayoutError"}}function Jn(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 et(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 Eo(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 ra(e,n,r){let t=u(e,n),i=Eo(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 oa(e,n,r){let t=u(e,n),i=e.folders[t],o=Jn(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 sa(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 aa(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:Jn(o.rooms,n,t)}:o))}function la(e,n,r,t){let i=d(e,n);if(!r)return i;return{pins:Jn(e.pins.filter((o)=>o!==n),n,t),folders:i.folders}}
|
|
2
|
-
export{ia,Jn,et,Eo,ra,oa,sa,aa,la};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-gdh7wsd5.js";import"./chunk-index-1kb8tv4v.js";import{ni}from"./chunk-index-53fwc7sc.js";var r=()=>ni();export{r as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-gdh7wsd5.js";import"./chunk-index-1kb8tv4v.js";import{ei}from"./chunk-index-ffnd0jcj.js";import"./chunk-index-53fwc7sc.js";import"./chunk-index-w17wgjby.js";import"./chunk-index-xbj816p0.js";var t=()=>ei();export{t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-gdh7wsd5.js";import"./chunk-index-1kb8tv4v.js";import{Dt}from"./chunk-index-w17wgjby.js";import"./chunk-index-xbj816p0.js";var t=()=>Dt({jsx:!0});export{t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-gdh7wsd5.js";import"./chunk-index-1kb8tv4v.js";import{Dt}from"./chunk-index-w17wgjby.js";import"./chunk-index-xbj816p0.js";var r=()=>Dt({typescript:!0,jsx:!0});export{r as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ss,en,br,lo,co,ma,ba,uo,va,xa}from"./chunk-index-vsaggfns.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";export{lo as createFolder,uo as deleteFolder,xa as dropRoom,en as moveRoom,va as muteFolder,ba as nudgeFolder,br as nudgeRoom,Ss as pinRoom,ma as placeFolderBefore,co as renameFolderTo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Yn,Sa,ga,wa,ka,_a,Ta,Oa,Pa,Qa}from"./chunk-index-fn6305vn.js";import"./chunk-index-mr391t49.js";import"./chunk-index-nn4w6a04.js";import"./chunk-index-wsv46y9p.js";import"./chunk-index-en728705.js";import"./chunk-index-3n38xe7m.js";import"./chunk-index-rjs1can6.js";import"./chunk-index-n3khm9fq.js";import"./chunk-index-5w6tb7p0.js";import"./chunk-index-wgrx2ybn.js";import"./chunk-index-5j1v2q7w.js";import"./chunk-index-yr758n6t.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";export{ga as addMenu,Ta as avatarMenu,Oa as cardDetails,Pa as cardMenu,Yn as copyText,Qa as fileMenu,_a as messageMenu,wa as openAddMenu,Sa as roomMenu,ka as seatMenu};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ir}from"./chunk-index-4a1tdadd.js";export{Ir as ModeToggle};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E,o,L,a,r,t,u,e,n,y,l,v,m,k,Q,_,us,te}from"./chunk-index-24cggw6k.js";import{xe}from"./chunk-index-55ps4x5n.js";import{Re}from"./chunk-index-dr0jr7d3.js";import{H}from"./chunk-index-s4a8e4qm.js";import"./chunk-index-cmzvq3nf.js";var F=[{kind:"core",label:u("Core"),hint:u("Carried into every turn.")},{kind:"note",label:u("Note"),hint:u("Searched when a knight needs them.")},{kind:"event",label:u("Events"),hint:u("Carried into every turn until their date.")}],B=300;function ie(){let{timeZone:p}=_(),{version:s}=te(),[c,d]=r("core"),[g,D]=r(""),[h,x]=r(),[f,R]=r(),[N,w]=r(),[S,K]=r(),[C,W]=r(),V=xe(()=>y.principals(),"principals").data,A=a(0),P=E(async(i)=>{let b=++A.current;try{let I=await y.notes(i.trim(),C);if(b!==A.current)return;x(I),R(void 0)}catch(I){if(b===A.current)R(l(I))}},[C]);o(()=>{let i=setTimeout(()=>void P(g),B);return()=>clearTimeout(i)},[g,P,s]);let T=(h??[]).filter((i)=>i.kind===c).sort((i,b)=>c==="event"?(i.eventDate??"").localeCompare(b.eventDate??""):i.id-b.id),q=us(p);return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h2",{children:t("Notes")}),e("p",{className:"hint",children:t("What a knight remembers. A change applies from the next turn.")})]}),e("button",{type:"button",onClick:()=>w({draft:{kind:c,fact:"",eventDate:""}}),children:t("Add")})]}),V&&V.principals.length>1?e(M,{people:V,shown:C,choose:(i)=>{x(void 0),W(i)}}):null,n("div",{className:"toolbar",children:[e("div",{className:"tabs",role:"tablist",children:F.map((i)=>n("button",{type:"button",role:"tab","aria-selected":c===i.kind,onClick:()=>d(i.kind),children:[t(i.label),h?` ${h.filter((b)=>b.kind===i.kind).length}`:""]},i.kind))}),e("input",{type:"search",placeholder:t("Search (words separated by spaces)"),"aria-label":t("Search notes"),value:g,onChange:(i)=>D(i.target.value)})]}),e("p",{className:"hint",children:t(F.find((i)=>i.kind===c)?.hint??"")}),f?e(m,{message:f}):null,!h?e(v,{}):T.length===0?e(k,{children:g?t("No matching notes."):t("Nothing of this kind yet.")}):T.map((i)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[n("div",{children:[i.eventDate?n("p",{className:"meta",children:[i.eventDate," ",i.eventDate<q?e(Q,{children:t("past")}):null]}):null,e("p",{className:"text",children:i.fact})]}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>w({note:i,draft:{kind:i.kind,fact:i.fact,eventDate:i.eventDate??""}}),children:t("Edit")}),e("button",{type:"button",className:"danger",onClick:()=>K(i),children:t("Delete")})]})]})},i.id)),e(H,{open:N!==void 0,title:N?.note?t("Edit note"):t("Add note"),onClose:()=>w(void 0),children:N?e(O,{initial:N.draft,save:async(i)=>{if(N.note)await y.updateNote(N.note.id,i,C);else await y.addNote(i,C);w((b)=>b===N?void 0:b),await P(g)},cancel:()=>w(void 0)}):null}),e(H,{open:S!==void 0,title:t("Delete this note?"),onClose:()=>K(void 0),children:S?e(Y,{text:S.fact,run:async()=>{await y.deleteNote(S.id,C),K((i)=>i===S?void 0:i),await P(g)},cancel:()=>K(void 0)}):null})]})}function M(p){let{people:s}=p,c=L();return n("label",{className:"inline",htmlFor:c,children:[t("Whose notes")," ",e(Re,{id:c,value:p.shown??s.self,onChange:(d)=>p.choose(d.target.value===s.self?void 0:d.target.value),children:s.principals.map((d)=>e("option",{value:d.id,children:d.id===s.self?t("{name} (you)",{name:d.name}):d.disabled?t("{name} (disabled)",{name:d.name}):d.name},d.id))})]})}function O(p){let[s,c]=r(p.initial),[d,g]=r(!1),[D,h]=r(),x=async()=>{g(!0),h(void 0);try{await p.save({kind:s.kind,fact:s.fact,...s.kind==="event"&&s.eventDate?{eventDate:s.eventDate}:{}})}catch(f){h(l(f)),g(!1)}};return n("form",{className:"stack",onSubmit:(f)=>{f.preventDefault(),x()},children:[n("fieldset",{children:[e("legend",{children:t("Kind")}),e("div",{className:"tabs",children:F.map((f)=>e("button",{type:"button","aria-pressed":s.kind===f.kind,onClick:()=>c({...s,kind:f.kind}),children:t(f.label)},f.kind))})]}),s.kind==="event"?n("label",{children:[t("Date"),e("input",{type:"date",value:s.eventDate,onChange:(f)=>c({...s,eventDate:f.target.value})})]}):null,n("label",{children:[t("Text"),e("textarea",{rows:4,value:s.fact,onChange:(f)=>c({...s,fact:f.target.value})})]}),D?e(m,{message:D}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:p.cancel,children:t("Cancel")}),e("button",{type:"submit",disabled:d,children:d?t("Saving…"):t("Save")})]})]})}function Y(p){let[s,c]=r(!1),[d,g]=r();return n("div",{className:"stack",children:[e("p",{className:"text",children:p.text}),d?e(m,{message:d}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:p.cancel,children:t("Cancel")}),e("button",{type:"button",className:"danger",disabled:s,onClick:()=>{c(!0),p.run().catch((D)=>{g(l(D)),c(!1)})},children:s?t("Deleting…"):t("Delete")})]})]})}export{ie as NotesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-0q15ysrb.js";import{t,e,n,s,S}from"./chunk-index-24cggw6k.js";import{hi}from"./chunk-index-d4mx2vvf.js";import"./chunk-index-vpq2cj14.js";function r({current:a}){let{badge:o}=hi();return n("a",{className:"icon-button bell",href:S("notices"),"aria-current":a?"page":void 0,"aria-label":o>0?t("Notices, {count} waiting",{count:o}):t("Notices"),children:[e(s,{name:"bell"}),o>0?e("span",{className:"bell-count","aria-hidden":"true",children:o>99?"99+":o}):null]})}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E,o,a,r,t,g,e,n,s,S,l,v,m,Zn,pr}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import"./chunk-index-0q15ysrb.js";import{Xn,cn}from"./chunk-index-8wpvj7k5.js";import{pe}from"./chunk-index-vpq2cj14.js";import"./chunk-index-cmzvq3nf.js";var z=90000,C=2000,V=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),H=()=>/iPhone|iPad/.test(navigator.userAgent);function R({step:i,view:w,refresh:p}){let[c,u]=r(),[d,h]=r(i.done?"arrived":"idle"),[k,b]=r(),[T,y]=r(!1),[I,O]=r(!1),N=a(void 0);o(()=>(Zn().then(u,()=>u("unsupported")),()=>clearTimeout(N.current)),[]),o(()=>{if(i.done)h("arrived")},[i.done]);let L=E((f)=>{let A=async()=>{if((await p())?.steps.find((F)=>F.id===i.id)?.done){h("arrived");return}if(Date.now()-f>z){h("late");return}N.current=setTimeout(A,C)};N.current=setTimeout(A,C)},[p,i.id]),M=async()=>{y(!0),b(void 0),h("sending");try{await pe.pushTest(),h("waiting"),L(Date.now())}catch(f){h("idle"),b(l(f))}finally{y(!1)}},_=async()=>{y(!0),b(void 0);try{await pr(),u(await Zn()),await p()}catch(f){b(f instanceof Error&&f.message==="permission"?t("Notifications were not allowed. Allow them in the browser's site settings."):l(f)),u(await Zn().catch(()=>"unsupported"))}finally{y(!1)}},P=c==="unsupported"&&H()&&!V();return n("section",{className:"card stack","aria-labelledby":`step-${i.id}`,children:[n("div",{className:"card-head",children:[e("h2",{id:`step-${i.id}`,children:Xn(i)}),i.done?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Done")]}):null]}),e("p",{className:"meta",children:cn(i)}),n("ol",{className:"steps",children:[n("li",{"data-done":c==="on"||P===!1||void 0,children:[e("strong",{children:t("Put the app on your phone")}),e("span",{className:"meta",children:P?t("On iPhone and iPad, open this page in Safari, tap Share, then Add to Home Screen, and open the app from there."):V()?t("This page is installed on this device."):t("On a phone, add it to the home screen from the browser's menu so notifications reach you when it is closed.")})]}),n("li",{"data-done":c==="on"||void 0,children:[e("strong",{children:t("Allow notifications")}),c==="blocked"?e("span",{className:"meta",children:t("Notifications are blocked for this site. Allow them in the browser's site settings.")}):c==="unsupported"?e("span",{className:"meta",children:t("This browser cannot get push notifications.")}):c==="on"?e("span",{className:"meta",children:t("Allowed on this device.")}):e("button",{type:"button",disabled:T||c===void 0,onClick:_,children:t("Allow notifications")})]}),n("li",{"data-done":i.done||void 0,children:[e("strong",{children:t("Send a test")}),d==="arrived"?e("span",{className:"meta",children:t("It arrived. Notifications work on this device.")}):n(g,{children:[e("button",{type:"button",className:"secondary",disabled:T||c!=="on"||d==="waiting",onClick:M,children:d==="waiting"?t("Waiting for it…"):t("Send a test notification")}),d==="late"?e("span",{className:"meta",children:t("It has not arrived. Check that notifications are allowed for this app, then send another.")}):null]})]})]}),k?e(m,{message:k}):null,i.waiver&&!i.done&&!i.waived?n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>O(!0),children:t(i.waiver.label)}),e(D,{open:I,title:t(i.waiver.label),confirmLabel:t("Skip"),onClose:()=>O(!1),onConfirm:async()=>{await pe.waive(i.id),await p()},children:e("p",{children:t(i.waiver.confirm)})})]}):null,w.push.devices>0&&!i.done?e("p",{className:"meta",children:t("{count} device(s) will get notifications.",{count:w.push.devices})}):null]})}function j(){let[i,w]=r(),[p,c]=r(),u=E(async()=>{try{let d=await pe.onboarding();return w(d),d}catch(d){c(l(d));return}},[]);if(o(()=>{u()},[u]),p&&!i)return e(m,{message:p});if(!i)return e(v,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Finish setting up")})}),i.steps.map((d)=>d.builtin==="push"?e(R,{step:d,view:i,refresh:u},d.id):n("section",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:Xn(d)}),d.done||d.waived?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",d.done?t("Done"):t("Skipped")]}):e("a",{className:"button-link",href:S(d.open.page),children:t("Open")})]}),e("p",{className:"meta",children:cn(d)})]},d.id)),i.steps.length===0?e("p",{className:"empty",children:t("There is nothing left to set up.")}):null]})}export{j as OnboardingPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mo,Ma}from"./chunk-index-nn4w6a04.js";import"./chunk-index-3n38xe7m.js";import"./chunk-index-5w6tb7p0.js";import"./chunk-index-5j1v2q7w.js";import"./chunk-index-yr758n6t.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";export{Ma as folderMenu,mo as placementItems};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E,o,a,r,t,u,g,e,n,s,y,l,v,m,Q,mr}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import"./chunk-index-0q15ysrb.js";import{pe}from"./chunk-index-vpq2cj14.js";import"./chunk-index-cmzvq3nf.js";var T=3000;function B({profile:i}){return n("div",{className:"who",children:[i.picture?e("img",{className:"who-picture",src:`api/people/${encodeURIComponent(i.principal)}/picture`,alt:""}):e("span",{className:"who-initial","aria-hidden":"true",children:Array.from(i.name)[0]??"?"}),n("div",{className:"stack",children:[e("strong",{children:i.name}),i.tier?n("span",{className:"meta",children:[e(s,{name:"shield",size:14})," ",t(F[i.tier])]}):null]})]})}function R({link:i,labels:P,changed:d}){let[c,p]=r(),[f,N]=r(!1),[C,V]=r(),[w,k]=r(!1),L=i.pending!==void 0||c!==void 0,q=a(void 0);o(()=>{if(!L||i.linked)return;return q.current=setInterval(()=>{pe.links().then((b)=>{let I=b.links.find((A)=>A.provider===i.provider);if(I)d(I)},()=>{return})},T),()=>clearInterval(q.current)},[L,i.linked,i.provider,d]);let S=async(b)=>{N(!0),V(void 0);try{await b()}catch(I){V(l(I))}finally{N(!1)}},h=i.blockedBy.length>0;return n("li",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:i.label}),i.linked?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Linked"),i.linked.displayName?` · ${i.linked.displayName}`:""]}):i.step==="required"?e(Q,{tone:"warn",children:t("Required")}):i.step==="nudge"?e(Q,{children:t("Recommended")}):null]}),C?e(m,{message:C}):null,i.linked?i.linked.locked?e("p",{className:"meta",children:t("The server's configuration links this account.")}):n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:f,onClick:()=>k(!0),children:t("Unlink")}),e(D,{open:w,title:t("Unlink {name}?",{name:i.label}),confirmLabel:t("Unlink"),tone:"danger",onClose:()=>k(!1),onConfirm:async()=>{d(await pe.unlink(i.provider)),p(void 0)},children:e("p",{children:t("The app will no longer know this account is yours. You can link it again later.")})})]}):L?n("div",{className:"stack",children:[c?n(g,{children:[e("p",{children:c.instructions}),e("p",{className:"meta",children:t("Your code")}),e("code",{className:"link-code",children:c.code}),e("p",{className:"meta",children:t("The code works until {time}.",{time:new Date(c.expiresAt).toLocaleTimeString()})})]}):e("p",{className:"meta",children:t("A code is waiting to be used.")}),i.pending?.redeemedBy?n("p",{children:[e(s,{name:"check",size:14})," ",t("{name} used the code. Confirm that this is you.",{name:i.pending.redeemedBy.displayName})]}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:f,onClick:()=>S(async()=>{d(await pe.cancelLink(i.provider)),p(void 0)}),children:t("Cancel")}),e("button",{type:"button",disabled:f,onClick:()=>S(async()=>{let b=c?.request??i.pending?.request;if(!b)return;d(await pe.confirmLink(i.provider,b)),p(void 0)}),children:t("I did it")})]})]}):n("div",{className:"stack",children:[h?e("p",{className:"meta",children:t("Link {name} first.",{name:i.blockedBy.map((b)=>P[b]??b).join(", ")})}):null,e("div",{className:"actions",children:e("button",{type:"button",disabled:f||h,onClick:()=>S(async()=>{p(await pe.issueLink(i.provider)),d((await pe.links()).links.find((b)=>b.provider===i.provider)??i)}),children:t("Link")})})]})]})}function O(){let i=Intl.DateTimeFormat().resolvedOptions().timeZone,[P,d]=r(),[c,p]=r({start:"22:00",end:"07:00"}),[f,N]=r(!1),[C,V]=r(!1),[w,k]=r(),[L,q]=r();o(()=>{pe.pushPrefs().then((h)=>{if(d(h.quiet),h.quiet)p(h.quiet);N(!0)},()=>N(!0))},[]);let S=async(h)=>{V(!0),q(void 0),k(void 0);try{await h()}catch(b){q(l(b))}finally{V(!1)}};if(!f)return null;return n("section",{className:"card stack",children:[e("h2",{children:t("Notifications")}),e("p",{className:"meta",children:t("In your quiet hours a normal notice waits in the bell instead of ringing your phone. An urgent one still rings.")}),n("div",{className:"quiet-row",children:[n("label",{children:[t("From")," ",e("input",{type:"time",value:c.start,onChange:(h)=>p({...c,start:h.target.value})})]}),n("label",{children:[t("To")," ",e("input",{type:"time",value:c.end,onChange:(h)=>p({...c,end:h.target.value})})]}),e("span",{className:"meta",children:i})]}),L?e(m,{message:L}):null,w?e("p",{className:"meta",children:w}):null,n("div",{className:"actions",children:[P?e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>S(async()=>{await pe.setPushPrefs(null),d(void 0)}),children:t("Turn off quiet hours")}):null,e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>S(async()=>{await pe.pushTest(),k(t("A test notification is on its way."))}),children:t("Send a test notification")}),e("button",{type:"button",disabled:C||c.start===c.end,onClick:()=>S(async()=>{let h=await pe.setPushPrefs({...c,timeZone:i});d(h.quiet)}),children:t("Save")})]})]})}function z({profile:i,changed:P}){let[d,c]=r();if(i.sources.length===0)return null;let p=async(f)=>{c(void 0);try{P(await pe.chooseSource(f))}catch(N){c(l(N))}};return n("section",{className:"card stack",children:[e("h2",{children:t("Shown as")}),e("p",{className:"meta",children:t("The name and picture of this account are what others see in the app.")}),n("fieldset",{className:"choice",children:[e("legend",{className:"visually-hidden",children:t("Shown as")}),n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===void 0,onChange:()=>p(null)}),t("Automatic")]}),i.sources.map((f)=>n("label",{children:[e("input",{type:"radio",name:"shown-as",checked:i.source===f.provider,onChange:()=>p(f.provider)}),t(f.label)]},f.provider))]}),d?e(m,{message:d}):null]})}function H(){let[i,P]=r(),[d,c]=r(),[p,f]=r(),[N,C]=r();o(()=>{y.session().then(P,(w)=>C(l(w))),pe.profile().then(c,()=>{return}),pe.links().then(f,()=>{return})},[]);let V=E((w)=>{f((k)=>k?{links:k.links.map((L)=>L.provider===w.provider?w:L)}:k),pe.profile().then(c,()=>{return})},[]);if(N)return e(m,{message:N});if(!i)return e(v,{});return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Profile")})}),n("section",{className:"card stack",children:[e("h2",{children:t("Account")}),d?e(B,{profile:d}):e("p",{className:"meta",children:t("Signed in as {name}.",{name:i.principal.name})}),e(mr,{auth:i.auth})]}),p&&p.links.length>0?n("section",{className:"stack",children:[e("h2",{children:t("Your accounts")}),e("ul",{className:"stack notices",children:p.links.map((w)=>e(R,{link:w,labels:Object.fromEntries(p.links.map((k)=>[k.provider,k.label])),changed:V},w.provider))})]}):null,d?e(z,{profile:d,changed:c}):null,i.push?e(O,{}):null]})}var F={owner:u("Owner"),admin:u("Admin"),member:u("Member")};export{H as ProfilePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o,r,t,e,n,l,v,m,k,Q,_,oe}from"./chunk-index-24cggw6k.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{R}from"./chunk-index-cmzvq3nf.js";function T(a){let{open:c,load:y}=a,{timeZone:N}=_(),[i,p]=r(),[d,g]=r(),[h,b]=r();o(()=>{if(!c)return;let s=!0;return p(void 0),g(void 0),b(void 0),y().then((f)=>s&&p(f),(f)=>s&&g(l(f))),()=>{s=!1}},[c]);let u=i?.find((s)=>s.id===h);return e(R,{open:c,title:a.title,size:"wide",onClose:a.onClose,children:n("div",{className:"stack history",children:[d?e(m,{message:d}):null,!i&&!d?e(v,{}):null,i?.length===0?e(k,{children:t("No changes have been kept yet.")}):null,i&&i.length>0?e("ul",{className:"menu",children:i.map((s)=>e("li",{children:n("button",{type:"button",className:"menu-item","aria-pressed":s.id===h,onClick:()=>b(s.id),children:[n("span",{className:"menu-text",children:[e("strong",{children:s.by}),e("span",{className:"meta",children:oe(s.at,N)})]}),s.revert?e(Q,{children:t("Back to the file version")}):null]})},s.id))}):null,u?n("section",{className:"stack","aria-label":t("This change"),children:[e(gt,{label:t("This change"),before:u.previous,after:u.text}),e("p",{className:"meta",children:t("It goes into the editor, where you read it over and save it to put it in force.")}),e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>a.onUse(u.text),children:t("Use this text")})})]}):null]})})}export{T as HistorySheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p,T,x,E,o,L,r,t,u,g,e,n,s,fe,l,f,v,m,k,Q,_,oe}from"./chunk-index-24cggw6k.js";import{de}from"./chunk-index-prq011b6.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{R}from"./chunk-index-cmzvq3nf.js";var M={"Shared prompt":u("Shared prompt"),"Guest prompt":u("Guest prompt"),"The base every knight's prompt starts with, the main knight's included.":u("The base every knight's prompt starts with, the main knight's included."),"Used instead of the shared prompt when the person speaking is not the owner.":u("Used instead of the shared prompt when the person speaking is not the owner.")},N=(c)=>t(M[c]??c);var O=x(()=>(p("1jz2gk3v"),import("./chunk-prompt-history-1jz2gk3v.js")).then((c)=>({default:c.HistorySheet}))),Z=x(()=>(p("0cajsfhk"),import("./chunk-confirm-0cajsfhk.js")).then((c)=>({default:c.Confirm})));function pe(){let{timeZone:c}=_(),[S,i]=r(),[h,w]=r(),[b,C]=r(),P=E(()=>{de.prompts().then((d)=>i(d.documents),(d)=>w(l(d)))},[]);return o(P,[P]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Main prompts")})}),e("p",{className:"hint",children:t("The texts the main knight and the other knights start from. A text you save here replaces the one from the file from the next turn on, until you go back to the file's.")}),h?e(m,{message:h}):null,!S&&!h?e(v,{}):null,S?.length===0?e(k,{children:t("No prompts to edit.")}):null,S?.map((d)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:N(d.label)}),d.differs?e(Q,{tone:"warn",children:t("Differs from the file version")}):null,d.broken?e(Q,{tone:"warn",children:t("File version cannot be read")}):null]}),d.description?e("p",{children:N(d.description)}):null,d.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:d.override.by,time:oe(d.override.at,c)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>C(d.id),children:t("Edit")})})]},d.id)),b?e(q,{id:b,onClose:()=>{C(void 0),P()}}):null]})}function q({id:c,onClose:S}){let[i,h]=r(),[w,b]=r(""),[C,P]=r(),[d,B]=r(!1),[H,V]=r(!1),[F,D]=r(!1),[z,A]=r(!1),I=L();o(()=>{let a=!0;return de.prompt(c).then((y)=>{if(!a)return;h(y),b(y.text)},(y)=>a&&P(l(y))),()=>{a=!1}},[c]);let U=async()=>{if(!i)return;V(!0);try{let a=await de.savePrompt(c,{text:w,base:i.text});h(a),b(a.text),B(!1),f(t("Saved."))}catch(a){if(a instanceof fe&&a.status===409){let{current:y}=a.body;h(y),f(a.message,"danger")}else f(l(a),"danger")}finally{V(!1)}},G=i!==void 0&&w!==i.text;return n(R,{open:!0,title:i?N(i.label):t("Main prompts"),size:"full",onClose:S,children:[C?e(m,{message:C}):null,!i&&!C?e(v,{}):null,i?.broken?e(m,{message:t("The file version of this prompt cannot be read, so it cannot be changed here until it can: {reason}",{reason:i.broken})}):null,i&&!i.broken?n("div",{className:"stack",children:[i.differs?e("p",{className:"hint",children:e(Q,{tone:"warn",children:t("Differs from the file version")})}):null,d?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),e(gt,{label:t("Prompt"),before:i.text,after:w}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:H,onClick:()=>B(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:H,onClick:U,children:H?t("Saving…"):t("Save")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:I,children:t("Prompt")}),e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>D(!0),children:[e(s,{name:"reset",size:16}),t("History")]})})]}),e("textarea",{id:I,className:"prompt-full",value:w,maxLength:i.maxChars,onChange:(a)=>b(a.target.value)})]}),n("div",{className:"actions",children:[i.override?e("button",{type:"button",className:"secondary",onClick:()=>A(!0),children:t("Revert to the file version")}):null,e("button",{type:"button",disabled:!G||!w.trim(),onClick:()=>B(!0),children:t("Review changes")})]})]}),F?e(T,{fallback:null,children:e(O,{open:F,title:t("History of {name}",{name:N(i.label)}),load:async()=>(await de.promptHistory(c)).versions.map((a)=>({id:a.id,text:a.text,previous:a.previous,by:a.by,at:a.at,revert:a.action==="revert"})),onUse:(a)=>{b(a),B(!1),D(!1)},onClose:()=>D(!1)})}):null,z?e(T,{fallback:null,children:e(Z,{open:z,title:t("Revert {name} to the file version?",{name:N(i.label)}),confirmLabel:t("Revert to the file version"),tone:"danger",onConfirm:async()=>{try{let a=await de.revertPrompt(c,{base:i.text});h(a),b(a.text),B(!1),f(t("Back to the file version."))}catch(a){if(!(a instanceof fe&&a.status===409))throw a;let{current:y}=a.body;h(y),f(a.message,"danger")}},onClose:()=>A(!1),children:e("p",{children:t("The text you saved is dropped and the text from the file applies from the next turn. It stays in the history, so you can bring it back.")})})}):null]}):null]})}export{pe as PromptsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Pr}from"./chunk-index-cfesmk1f.js";import"./chunk-index-s4a8e4qm.js";import"./chunk-index-6btdp13p.js";import"./chunk-index-cmzvq3nf.js";import"./chunk-index-vsaggfns.js";import"./chunk-index-3n38xe7m.js";import"./chunk-index-wgrx2ybn.js";import"./chunk-index-5j1v2q7w.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";export{Pr as RoomConfirmHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,e,s,d}from"./chunk-index-24cggw6k.js";import"./chunk-index-5j1v2q7w.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-3n38xe7m.js";import{ci}from"./chunk-index-fb3kzyyp.js";import"./chunk-index-5w6tb7p0.js";import"./chunk-index-yr758n6t.js";function r(){if(!d((o)=>o.listed))return null;return e("button",{type:"button",className:"header-button icon-button","aria-haspopup":"menu","aria-label":t("Folders and order"),onClick:(o)=>ci(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,t,u,e,n,s,S,y,f,v,m,k,Q,_,oe}from"./chunk-index-24cggw6k.js";import{D}from"./chunk-index-6btdp13p.js";import{xe}from"./chunk-index-55ps4x5n.js";import"./chunk-index-cmzvq3nf.js";var h={mon:u("Mon"),tue:u("Tue"),wed:u("Wed"),thu:u("Thu"),fri:u("Fri"),sat:u("Sat"),sun:u("Sun")};function w(c){if(typeof c!=="object"||c===null)return"";let o=c,i=typeof o.time==="string"?o.time:"";switch(o.kind){case"once":return t("Once on {date} at {time}",{date:String(o.date??""),time:i});case"every":return Number(o.everyDays)===1?t("Every day at {time}",{time:i}):t("Every {count} days at {time}",{count:Number(o.everyDays),time:i});case"weekly":{let l=Array.isArray(o.weekdays)?o.weekdays.map((d)=>t(h[String(d)]??String(d))).join(t(", ")):"";return t("{days} at {time}",{days:l,time:i})}default:return""}}function V(){let{timeZone:c}=_(),[o,i]=r(0),[l,d]=r(),{data:p,error:g}=xe(()=>y.schedules(),`schedules:${o}`);return n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Schedules")})}),g?e(m,{message:g}):null,!p&&!g?e(v,{}):null,p&&p.schedules.length===0?e(k,{children:t("Nothing is scheduled. Ask a knight to remind you or to run something later.")}):null,e("ul",{className:"schedule-list",children:p?.schedules.map((a)=>n("li",{className:"card schedule",children:[n("div",{className:"schedule-main",children:[n("div",{className:"card-head",children:[e("strong",{children:a.title}),a.lastStatus?e(Q,{children:a.lastStatus}):null]}),n("p",{className:"meta",children:[w(a.recurrence)," ·"," ",t("next {when}",{when:oe(a.nextRun,c)})]}),e("p",{className:"schedule-prompt",children:a.prompt}),n("p",{className:"meta",children:[a.room?e("a",{href:S("room",a.room),children:a.label}):a.label," ","· ",t("set by {name}",{name:a.createdBy})]})]}),e("button",{type:"button",className:"icon-button danger-icon","aria-label":t("Cancel {title}",{title:a.title}),onClick:()=>d(a),children:e(s,{name:"trash"})})]},a.id))}),e(D,{open:l!==void 0,title:t("Cancel this schedule?"),confirmLabel:t("Cancel schedule"),tone:"danger",onClose:()=>d(void 0),onConfirm:async()=>{if(!l)return;await y.cancelSchedule(l.id),i((a)=>a+1),f(t("Schedule cancelled."))},children:e("p",{children:t("“{title}” will not run again. Runs that already happened stay in the conversation.",{title:l?.title??""})})})]})}export{V as SchedulesPage};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{p,T,x,E,o,L,C,a,r,t,u,g,e,n,s,X,d,fe,y,l,f,v,m,k,_,we,vn,Hr,fs,ke,Ti,ms,he,wn,te,De,Fn}from"./chunk-index-24cggw6k.js";import{Zo}from"./chunk-index-7xcbpeqz.js";import{D}from"./chunk-index-6btdp13p.js";import{vo,js,Ks,xo,ea}from"./chunk-index-n3khm9fq.js";import{Ms,po,Rs}from"./chunk-index-mr391t49.js";import"./chunk-index-3n38xe7m.js";import"./chunk-index-vsaggfns.js";import"./chunk-index-5j1v2q7w.js";import{Pr}from"./chunk-index-cfesmk1f.js";import"./chunk-index-nr275sa7.js";import"./chunk-index-rjs1can6.js";import"./chunk-index-nn4w6a04.js";import{Yn}from"./chunk-index-fn6305vn.js";import{Pn}from"./chunk-index-7mrkq793.js";import{fn,ji,Ur,Ki}from"./chunk-index-a7e6rhxy.js";import{de}from"./chunk-index-prq011b6.js";import{gt}from"./chunk-index-v9jqyr1f.js";import{Ft}from"./chunk-index-3tksdmx7.js";import{Qt}from"./chunk-index-m76gdwnk.js";import{Re}from"./chunk-index-dr0jr7d3.js";import{H}from"./chunk-index-s4a8e4qm.js";import{R}from"./chunk-index-cmzvq3nf.js";import"./chunk-index-wsv46y9p.js";import{nn}from"./chunk-index-en728705.js";import"./chunk-index-5w6tb7p0.js";import{re,Ne}from"./chunk-index-wgrx2ybn.js";import"./chunk-index-yr758n6t.js";import"./chunk-index-88wh5eyj.js";import"./chunk-index-6rdywten.js";import{Y}from"./chunk-index-d941ae7c.js";var Ke=x(()=>(p("1jz2gk3v"),import("./chunk-prompt-history-1jz2gk3v.js")).then((i)=>({default:i.HistorySheet}))),Qe=x(()=>(p("m7tw20ef"),import("./chunk-character-creator-m7tw20ef.js")).then((i)=>({default:i.CharacterCreator}))),Ue=["default","off","minimal","low","medium","high","xhigh"],Ae={default:u("Default"),off:u("Off"),minimal:u("Minimal"),low:u("Low"),medium:u("Medium"),high:u("High"),xhigh:u("Very high")},q="default",Ee=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),qe=u("Automatic"),pe=(i)=>i==="auto"?t(qe):t(Ae[i]??i),Se=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??q,thinking:i.thinking??q});function Ce(i,h){return{...h.displayName!==i.displayName?{displayName:h.displayName}:{},...h.prompt!==i.prompt?{prompt:h.prompt}:{},...h.model!==(i.model??q)?{model:h.model}:{},...h.thinking!==(i.thinking??q)?{thinking:h.thinking}:{}}}function xe(){let i=fs(),h=a(i);if(i)h.current=i;let c=h.current,N=i!==void 0;if(o(()=>{if(!N)return;let w=window.location.href,b=()=>{if(window.location.href!==w)vn()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[N]),!c)return null;return e(R,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:vn,children:e(Ze,{name:c.name,opened:c.id},c.name)})}function Ze({name:i,opened:h}){let[c,N]=r(),[w,b]=r([]),[I,B]=r(),[M,z]=r(),[G,Q]=r(!1),[S,A]=r(!1),[V,W]=r(!1),[K,Z]=r(!1),se=Fn(c?.room??""),ee=a(null),ne=c!==void 0,J=d((F)=>c?F.rooms[c.room]?.view?.muted===!0:!1,c?.room??""),[ie,U]=r(!1),le=d((F)=>c?F.rooms[c.room]?.view?.coordinator===!0:!1,c?.room??""),oe=L(),ae=L(),O=L();o(()=>{if(!ne||!Hr()?.look)return;ee.current?.scrollIntoView({block:"start"}),ee.current?.focus({preventScroll:!0})},[ne,h]);let P=a({});P.current={profile:c,draft:M},o(()=>{let F=!0;return Promise.all([y.agent(i),y.models()]).then(([ce,_e])=>{if(!F)return;let{profile:ye,draft:ue}=P.current,je=ye&&ue&&Object.keys(Ce(ye,ue)).length>0;N(ce),b(_e.models),z(je?ue:Se(ce))},(ce)=>F&&B(l(ce))),()=>{F=!1}},[i,h]);let j=C(()=>c&&M?Ce(c,M):{},[c,M]);if(I)return e(m,{message:I});if(!c||!M)return e(v,{});let ve=Object.keys(j).length>0,Be=Array.from(new Set([q,...w,M.model])),We=Ee(c),be=async()=>{Q(!0);try{let F=await y.updateAgent(i,j);N(F),z(Se(F)),A(!1),f(t("Saved."))}catch(F){f(l(F),"danger")}finally{Q(!1)}};return n("div",{className:"stack agent-sheet",children:[n("header",{className:"profile-head",children:[e(he,{spec:c.character,name:c.name,size:72,state:se,label:c.displayName}),n("div",{children:[e("h3",{children:c.displayName}),e("p",{className:"meta",children:t("Runs on {model}, thinking {thinking}",{model:c.effective.model,thinking:pe(c.effective.thinking)})})]})]}),e("ul",{className:"menu",children:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:O,children:[e("span",{className:"menu-icon",children:e(s,{name:J?"bell-off":"bell"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Notifications")}),e("span",{className:"meta",children:t("Push this room's posts to every owner's devices. A card that waits for you is always pushed.")})]}),e(Qt,{id:O,checked:!J,label:t("Notifications"),busy:ie,onChange:async(F)=>{U(!0),await nn(c.room,!F),U(!1)}})]})})}),S?e(et,{profile:c,draft:M,saving:G,onBack:()=>A(!1),onSave:be}):n("form",{className:"stack form",onSubmit:(F)=>{if(F.preventDefault(),!ve)return;if(j.prompt!==void 0)A(!0);else be()},children:[n("label",{htmlFor:ae,children:[t("Name"),e("input",{id:ae,value:M.displayName,onChange:(F)=>z({...M,displayName:F.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:oe,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>Z(!0),children:[e(s,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>W(!0),children:[e(Je,{}),t("Full screen")]})]})]}),e("textarea",{id:oe,rows:8,value:M.prompt,onChange:(F)=>z({...M,prompt:F.target.value})})]}),e(Ft,{label:t("Model"),value:M.model,onChange:(F)=>z({...M,model:F}),options:Be.map((F)=>({value:F,label:F===q?We:F}))}),e(Ft,{label:t("Thinking level"),value:M.thinking,onChange:(F)=>z({...M,thinking:F}),options:Ue.map((F)=>({value:F,label:t(Ae[F])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ve||G,children:G?t("Saving…"):j.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(Xe,{name:i,opened:h}),n("section",{className:"card stack",ref:ee,tabIndex:-1,children:[e("h3",{children:t("Look")}),e("p",{className:"meta",children:t("Class, colors and parts. The picture here, in the rooms and in Discord all follow it.")}),e(T,{fallback:e(v,{}),children:e(Qe,{name:c.name,displayName:c.displayName,prompt:c.prompt,character:c.character,onSaved:(F)=>N(F)})})]}),le?null:n("section",{className:"card stack",children:[e("h3",{children:t("Archive")}),e("p",{className:"meta",children:t("An archived knight stops answering and its schedules are cancelled. Its history is kept, and you can restore it from Archived.")}),e("div",{className:"actions",children:e("button",{type:"button",className:"danger",onClick:()=>{vn(),ke({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive {name}",{name:c.displayName})})})]}),K?e(T,{fallback:null,children:e(Ke,{open:K,title:t("History of the prompt"),load:async()=>(await de.agentPromptHistory(i)).versions.map((F)=>({id:F.id,text:F.text,previous:F.previous,by:F.by,at:F.at})),onUse:(F)=>{z({...M,prompt:F}),Z(!1)},onClose:()=>Z(!1)})}):null,e(R,{open:V,title:t("Prompt"),size:"full",onClose:()=>W(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:M.prompt,onChange:(F)=>z({...M,prompt:F.target.value})})})]})}function Xe({name:i,opened:h}){let[c,N]=r(),[w,b]=r(),[I,B]=r(),M=L(),z=a(null),G=c!==void 0;if(o(()=>{if(!G||!Hr()?.skills)return;z.current?.scrollIntoView({block:"start"}),z.current?.focus({preventScroll:!0})},[G,h]),o(()=>{let A=!0;return re.skills(i).then((V)=>A&&N(V),(V)=>{if(A&&!(V instanceof fe&&V.status===404))B(l(V))}),()=>{A=!1}},[i,h]),I)return e(m,{message:I});if(!c)return null;let Q=()=>re.skills(i).then(N,(A)=>{f(l(A),"danger")}),S=async(A,V)=>{b(A);try{N(await re.setSkills(i,V?{add:[A]}:{remove:[A]}))}catch(W){f(l(W),"danger")}finally{b(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),ref:z,tabIndex:-1,children:[e("h3",{children:t("Skills ({count})",{count:c.skills.filter((A)=>A.carried).length})}),e("p",{className:"meta",children:t("What the knight can load when a task calls for it. It applies from its next turn.")}),e("ul",{className:"menu",children:c.skills.map((A,V)=>{let W=`${M}-${V}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:W,children:[n("span",{className:"menu-text",children:[e("strong",{children:A.name}),e("span",{className:"meta",children:A.missing?t("Its file cannot be read."):A.builtin?t("Built in: every knight carries it."):A.description??""})]}),e(Qt,{id:W,checked:A.carried,label:A.name,busy:w===A.name,disabled:A.builtin,onChange:(K)=>S(A.name,K)})]})},A.name)})}),e(Ye,{name:i,view:c,onApplied:Q})]})}function Ye({name:i,view:h,onApplied:c}){let[N,w]=r(),[b,I]=r(),B=L();if(o(()=>{let S=!0;return de.skillGroups().then((A)=>S&&w(A.groups),()=>{return}),()=>{S=!1}},[]),!N?.length)return null;let M=new Set(h.skills.filter((S)=>S.carried).map((S)=>S.name)),z=new Set(h.skills.filter((S)=>S.builtin).map((S)=>S.name)),G=(S)=>S.skills.filter((A)=>!M.has(A)),Q=(S)=>S.skills.filter((A)=>M.has(A)&&!z.has(A));return n("div",{className:"stack skill-apply",children:[e("h4",{children:t("Skill groups")}),e("p",{className:"meta",children:t("Switching a group on switches on its skills this knight lacks; switching it off switches off its skills, built-in ones excepted.")}),e("ul",{className:"menu",children:N.map((S,A)=>{let V=G(S),W=V.length===0;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:`${B}-group-${A}`,children:[n("span",{className:"menu-text",children:[e("strong",{children:S.name}),e("span",{className:"meta",children:W?t("Carries all of it."):t("Lacks {count}: {skills}",{count:V.length,skills:V.join(", ")})})]}),e(Qt,{id:`${B}-group-${A}`,checked:W,label:t("Skill group {name}",{name:S.name}),disabled:W&&Q(S).length===0,onChange:(K)=>I({group:S,on:K})})]})},S.name)})}),e(D,{open:b!==void 0,title:b?.on?t("Switch this skill group on?"):t("Switch this skill group off?"),confirmLabel:b?.on?t("Switch on"):t("Switch off"),tone:b?.on?"primary":"danger",onClose:()=>I(void 0),onConfirm:async()=>{if(!b)return;let{added:S,removed:A}=await de.applySkillGroup(b.group.name,i,b.on);f(S.length?t("Switched on: {skills}",{skills:S.join(", ")}):A.length?t("Switched off: {skills}",{skills:A.join(", ")}):t("Nothing changed for {name}.",{name:b.group.name})),c()},children:e("p",{children:b?b.on?t("{agent} will also carry: {skills}.",{agent:i,skills:G(b.group).join(", ")}):t("{agent} will no longer carry: {skills}.",{agent:i,skills:Q(b.group).join(", ")}):null})})]})}var Je=()=>e("svg",{viewBox:"0 0 24 24",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e("path",{d:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"})});function et(i){let{profile:h,draft:c}=i,N=a(null);o(()=>N.current?.focus(),[]);let w=[];if(c.displayName!==h.displayName)w.push({label:t("Name"),before:h.displayName,after:c.displayName});let b=(I)=>I===q?Ee(h):I;if(c.model!==(h.model??q))w.push({label:t("Model"),before:b(h.model??q),after:b(c.model)});if(c.thinking!==(h.thinking??q))w.push({label:t("Thinking level"),before:pe(h.thinking??q),after:pe(c.thinking)});return n("section",{ref:N,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),w.length?e("ul",{className:"review-fields",children:w.map((I)=>n("li",{children:[e("strong",{children:I.label}),e("span",{className:"review-before",children:I.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:I.after})]},I.label))}):null,e(gt,{label:t("Prompt"),before:h.prompt,after:c.prompt}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:i.saving,onClick:i.onBack,children:t("Back to editing")}),e("button",{type:"button",disabled:i.saving,onClick:i.onSave,children:i.saving?t("Saving…"):t("Save")})]})]})}var tt=300000;function Me(){let i=Ks(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return e(R,{open:i!==void 0,title:t("Archived conversation"),size:"wide",onClose:js,children:e(nt,{room:h.room,until:h.until},`${h.room}:${h.until}`)})}function nt(i){Y("archived-log",".archived-log .messages { padding: 0; }");let{timeZone:h}=_(),c=De(),[N,w]=r(),[b,I]=r(!1),[B,M]=r(),[z,G]=r(!1),{room:Q,until:S}=i;o(()=>{let V=!0;return vo.page(Q,S).then((W)=>{if(!V)return;w(W.messages),I(W.more)},(W)=>{if(V)M(l(W))}),()=>{V=!1}},[Q,S]);let A=async()=>{let V=N?.[0];if(!V||z)return;G(!0);try{let W=await vo.page(Q,S,V.id);w((K)=>[...W.messages,...K??[]]),I(W.more)}catch(W){M(l(W))}G(!1)};if(B)return e(m,{message:B});if(!N)return e(v,{});if(N.length===0)return e(k,{children:t("The archived conversation has no messages.")});return n("div",{className:"archived-log",children:[b?e("button",{type:"button",className:"secondary older",disabled:z,onClick:A,children:z?t("Loading…"):t("Load earlier messages")}):null,e("ol",{className:"messages",children:N.map((V,W)=>{let K=N[W-1],Z=!K||K.kind!==V.kind||K.author!==V.author||Date.parse(V.at)-Date.parse(K.at)>tt;return e(wn,{message:V,character:V.agent?c[V.agent]:void 0,header:Z,enter:!1,unread:!1,timeZone:h,quotable:!1},V.id)})})]})}function ot(i){let{message:h}=i,[c,N]=r(h.text),w=a(null);o(()=>{w.current?.focus(),w.current?.setSelectionRange(c.length,c.length)},[c.length]);let b=c.trim(),I=b===""&&h.files.length===0;return n("form",{className:"stack",onSubmit:(M)=>{if(M.preventDefault(),I)return;if(b!==h.text)Ms(h,b);i.onClose()},children:[e("div",{className:"field",children:e("textarea",{ref:w,className:"queued-edit-text",rows:6,value:c,"aria-label":t("Edit"),onChange:(M)=>N(M.target.value)})}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:i.onClose,children:t("Cancel")}),e("button",{type:"submit",disabled:I,children:t("Save")})]})]})}function Le(){let i=Rs(),h=a(void 0);if(i)h.current=i;let c=h.current;if(!c)return null;return e(H,{open:i!==void 0,title:t("Edit"),onClose:po,children:e(ot,{message:c,onClose:po},c.id)})}var at=`
|
|
2
|
-
.sheet:has(.select-text) {
|
|
3
|
-
-webkit-user-select: none;
|
|
4
|
-
user-select: none;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.select-text {
|
|
8
|
-
flex: 1;
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: var(--space-3);
|
|
11
|
-
overflow-wrap: anywhere;
|
|
12
|
-
white-space: pre-wrap;
|
|
13
|
-
border: 1px solid var(--border);
|
|
14
|
-
border-radius: var(--radius-md);
|
|
15
|
-
background: var(--surface-2);
|
|
16
|
-
font: inherit;
|
|
17
|
-
line-height: 1.6;
|
|
18
|
-
-webkit-touch-callout: default;
|
|
19
|
-
-webkit-user-select: text;
|
|
20
|
-
user-select: text;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.select-text-actions {
|
|
24
|
-
display: flex;
|
|
25
|
-
justify-content: flex-end;
|
|
26
|
-
gap: var(--space-2);
|
|
27
|
-
margin-top: var(--space-3);
|
|
28
|
-
}
|
|
29
|
-
`;function Te(){let i=ea(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return Y("select-text",at),n(R,{open:i!==void 0,title:t("Select text"),size:"full",onClose:xo,children:[e("p",{className:"hint",children:h.author}),e("pre",{className:"select-text",children:h.text}),n("div",{className:"select-text-actions",children:[e("button",{type:"button",className:"secondary",onClick:xo,children:t("Close")}),e("button",{type:"button",onClick:()=>Yn(h.text),children:t("Copy all")})]})]})}function st(i){let h=i.filter((w)=>w.parent!==void 0),c=i.filter((w)=>w.parent===void 0),N=new Set(c.map((w)=>w.name));return[...c.flatMap((w)=>[w,...h.filter((b)=>b.parent===w.name)]),...h.filter((w)=>!N.has(w.parent??""))]}function He(){let[i,h]=r(),[c,N]=r(),[w,b]=r(),[I,B]=r(),M=E(async()=>{try{h((await re.archive()).entries),N(void 0)}catch(G){N(l(G))}},[]);o(()=>{M()},[M]);let z=async(G)=>{b(G.name);try{if(G.kind==="agent")await re.restoreAgent(G.name);else await re.restoreGroup(G.name);await Ne(),f(t("Restored {name}.",{name:G.displayName})),await M()}catch(Q){f(l(Q),"danger")}finally{b(void 0)}};if(c&&!i)return e(m,{message:c});if(!i)return e(v,{});return n("div",{className:"stack",children:[e("p",{className:"meta",children:t("Archived knights and groups no longer answer. Their history is kept until you delete them.")}),i.length===0?e(k,{children:t("Nothing is archived.")}):null,e("ul",{className:"menu",children:st(i).map((G)=>n("li",{className:"menu-item","data-helper":G.parent??void 0,style:G.parent?{paddingLeft:"var(--space-6)"}:void 0,children:[e("span",{className:"menu-icon",children:e(s,{name:G.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:G.displayName}),n("span",{className:"meta",children:[G.parent?t("Temp knight of {name}",{name:G.parent}):G.kind==="agent"?t("Knight"):t("Group")," ","· ",G.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:w===G.name,onClick:()=>z(G),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:w===G.name,onClick:()=>B(G),children:t("Delete")})]},`${G.kind}:${G.name}`))}),e(D,{open:I!==void 0,title:t("Delete {name}?",{name:I?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>B(void 0),onConfirm:async()=>{if(!I)return;if(I.kind==="agent")await re.deleteAgent(I.name);else await re.deleteGroup(I.name);await Ne(),f(t("Deleted {name}.",{name:I.displayName})),await M()},children:e("p",{children:t("{name} and its messages in this app are deleted for good, and the name can be used again. This cannot be undone.",{name:I?.displayName??""})})})]})}var Ie=/^[a-z0-9-]{1,32}$/,Pe=2,$e=8,me="\x00";function rt(){let i=d((h)=>h.order.flatMap((c)=>{let N=h.rooms[c]?.view;return N?.kind==="agent"&&!N.helper?[`${N.name}${me}${N.displayName}`]:[]}).join(`${me}${me}`));return C(()=>i===""?[]:i.split(`${me}${me}`).map((h)=>{let[c="",N=""]=h.split(me);return{name:c,displayName:N}}),[i])}function Fe(i){let h=rt(),[c,N]=r(),[w,b]=r(),[I,B]=r(""),[M,z]=r(""),[G,Q]=r(!1),[S,A]=r([]),[V,W]=r(""),[K,Z]=r(!1),[se,ee]=r(i.name===void 0),ne=L(),J=L();o(()=>{let O=i.name;if(O===void 0)return;let P=!0;return re.group(O).then((j)=>{if(!P)return;N(j),B(j.displayName),A(j.members),W(j.host),ee(!0)},(j)=>P&&b(l(j))),()=>{P=!1}},[i.name]);let ie=(O)=>h.find((P)=>P.name===O)?.displayName??O,U=S.includes(V)?V:S[0]??"",le=c===void 0?!0:I.trim()!==c.displayName||S.join(",")!==c.members.join(",")||U!==c.host,oe=I.trim()!==""&&S.length>=Pe&&S.length<=$e&&(c!==void 0||Ie.test(M));if(w&&!se)return e(m,{message:w});if(!se)return e(v,{});let ae=async()=>{Z(!0),b(void 0);try{if(c){await re.updateGroup(c.name,{...I.trim()!==c.displayName?{displayName:I.trim()}:{},...S.join(",")!==c.members.join(",")?{members:S}:{},...U!==c.host?{host:U}:{}}),await Ne(),f(t("Saved.")),i.onDone();return}let O=await re.createGroup({name:M,displayName:I.trim(),members:S,host:U});await Ne(),f(t("Made {name}.",{name:O.displayName})),i.onDone(),X("room",O.room)}catch(O){b(l(O))}finally{Z(!1)}};return n("form",{className:"stack form",onSubmit:(O)=>{if(O.preventDefault(),oe&&le&&!K)ae()},children:[n("label",{htmlFor:ne,children:[t("Name"),e("input",{id:ne,value:I,autoComplete:"off",onChange:(O)=>{if(B(O.target.value),!c&&!G)z(O.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),c?null:n("label",{htmlFor:J,children:[t("Permanent name"),e("input",{id:J,value:M,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":M!==""&&!Ie.test(M),onChange:(O)=>{Q(!0),z(O.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Members")}),e("span",{className:"meta",children:t("Pick 2 to 8 knights. They take turns in the order picked.")}),e("ul",{className:"menu",children:h.map((O)=>{let P=S.includes(O.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:P,disabled:!P&&S.length>=$e,onChange:()=>A(P?S.filter((j)=>j!==O.name):[...S,O.name])}),e("span",{className:"menu-text",children:e("strong",{children:O.displayName})})]})},O.name)})})]}),S.length>=Pe?e(Ft,{label:t("Host"),value:U,onChange:W,options:S.map((O)=>({value:O,label:ie(O)}))}):null,w?e(m,{message:w}):null,n("div",{className:"actions",children:[c?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),ke({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!oe||!le||K,children:K?t("Saving…"):c?t("Save"):t("Make group")})]})]})}var it=x(()=>(p("m7tw20ef"),import("./chunk-character-creator-m7tw20ef.js")).then((i)=>({default:i.CharacterCreator}))),Ge=/^[a-z0-9-]{1,32}$/,ge="default";function lt(i){let h=[];for(let c of i){let N=c.indexOf("/"),w=N>0?c.slice(0,N):"",b=h.find((I)=>I.provider===w&&w!=="");if(b)b.models.push(c);else h.push({provider:w,models:[c]})}return h}var mt=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Ve({onDone:i}){let[h,c]=r(""),[N,w]=r(""),[b,I]=r(!1),[B,M]=r(""),[z,G]=r(ge),[Q,S]=r(""),[A,V]=r(),[W,K]=r(!1),[Z,se]=r([]),[ee,ne]=r(),[J,ie]=r(!1),U=[L(),L(),L(),L(),L()];o(()=>{let P=!0;return y.models().then((j)=>P&&se(j.models),()=>{return}),()=>{P=!1}},[]);let le=C(()=>Pn({name:N,displayName:h,prompt:B}),[N,h,B]),oe=A?.spec??le,ae=Ge.test(N)&&h.trim()!==""&&B.trim()!=="";if(W)return e(T,{fallback:e(v,{}),children:e(it,{name:N||"new",displayName:h,prompt:B,character:oe,onPick:(P,j)=>{V({input:P,spec:j}),K(!1)},onCancel:()=>K(!1)})});let O=async()=>{ie(!0),ne(void 0);try{let P={name:N,displayName:h.trim(),prompt:B,...z!==ge?{model:z}:{},...Q.trim()?{task:Q.trim()}:{},...A?{character:A.input}:{}},j=await re.createAgent(P);await Ne(),f(t("Made {name}.",{name:j.displayName})),i(),X("room",j.room)}catch(P){ne(P instanceof fe&&P.field?`${P.field}: ${l(P)}`:l(P))}finally{ie(!1)}};return n("form",{className:"stack form",onSubmit:(P)=>{if(P.preventDefault(),ae&&!J)O()},children:[n("label",{htmlFor:U[0],children:[t("Name"),e("input",{id:U[0],value:h,autoComplete:"off",onChange:(P)=>{if(c(P.target.value),!b)w(mt(P.target.value))}})]}),n("label",{htmlFor:U[1],children:[t("Permanent name"),e("input",{id:U[1],value:N,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":N!==""&&!Ge.test(N),onChange:(P)=>{I(!0),w(P.target.value)}}),e("span",{className:"meta",children:t("Lowercase letters, digits and dashes, up to 32. It names the room and cannot be changed.")})]}),n("label",{htmlFor:U[2],children:[t("Prompt"),e("textarea",{id:U[2],rows:6,value:B,onChange:(P)=>M(P.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:U[4],children:[t("Model"),n(Re,{id:U[4],value:z,onChange:(P)=>G(P.target.value),children:[e("option",{value:ge,children:t("Default model")}),lt(Z).map((P)=>P.provider===""?P.models.map((j)=>e("option",{value:j,children:j},j)):e("optgroup",{label:P.provider,children:P.models.map((j)=>e("option",{value:j,children:j},j))},P.provider))]})]}),n("label",{htmlFor:U[3],children:[t("Opening task"),e("textarea",{id:U[3],rows:3,value:Q,onChange:(P)=>S(P.target.value)}),e("span",{className:"meta",children:t("Optional. The knight starts on it as soon as it is made.")})]}),n("div",{className:"profile-head",children:[e(he,{spec:oe,name:N||"new",size:72,label:h}),n("div",{children:[e("strong",{children:t("Look")}),e("span",{className:"meta",children:A?t("Your look"):t("Suggested from its role")}),e("button",{type:"button",className:"secondary compact",onClick:()=>K(!0),children:t("Choose a look")})]})]}),ee?e(m,{message:ee}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ae||J,children:J?t("Making…"):t("Make knight")})})]})}var ct=(i)=>i.kind==="new-agent"?t("New knight"):i.kind==="archive"?t("Archived"):i.name===void 0?t("New group"):t("Edit group");function Oe(){let i=ms(),h=a(i);if(i)h.current=i;let c=h.current,N=i!==void 0;if(o(()=>{if(!N)return;let w=window.location.href,b=()=>{if(window.location.href!==w)Ti()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[N]),!c)return null;return e(R,{open:i!==void 0,title:ct(c),size:"wide",onClose:Ti,children:e("div",{className:"stack agent-sheet",children:c.kind==="new-agent"?e(Ve,{onDone:Ti}):c.kind==="archive"?e(He,{}):e(Fe,{...c.name===void 0?{}:{name:c.name},onDone:Ti})},c.id)})}function ze(){let i=Ur(),h=a(!1);if(i)h.current=!0;return h.current?e(ut,{open:i}):null}function ut({open:i}){let h=_(),{now:c}=te(),N=d((b)=>fn(b).map(({id:I,card:B})=>{let M=b.rooms[B.room]?.view,z=M?.parent?b.rooms[M.parent]?.view:void 0;return{id:I,room:z?`${z.displayName} › ${M?.displayName??""}`:M?.displayName??B.room,title:B.frame.title,at:B.frame.at}})),w=N.length===0;return o(()=>{if(i&&w)ji()},[i,w]),e(R,{open:i&&!w,title:t("Cards waiting"),onClose:ji,children:e("ul",{className:"waiting-list",children:N.map((b)=>e("li",{children:n("button",{type:"button",onClick:()=>Ki(b.id),children:[e("strong",{children:b.title}),n("span",{className:"meta",children:[b.room,b.at?` · ${we(b.at,c,h.timeZone)}`:""]})]})},b.id))})})}var dt=x(()=>(p("434sqnxc"),import("./chunk-shortcut-help-434sqnxc.js")));function pt(){let i=Zo(),h=a(!1);if(i)h.current=!0;if(!h.current)return null;return e(T,{fallback:null,children:e(dt,{open:i})})}function Do(){return n(g,{children:[e(Pr,{}),e(Le,{}),e(xe,{}),e(Oe,{}),e(Me,{}),e(Te,{}),e(ze,{}),e(pt,{})]})}export{Do as SheetHosts};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Un,S,X,Ae,O,ot,wt}from"./chunk-index-24cggw6k.js";import{Ar}from"./chunk-index-97dcp1vh.js";import{_o}from"./chunk-index-nr275sa7.js";import{Ci,Ei}from"./chunk-index-mr391t49.js";import{Go,li,Wo}from"./chunk-index-7xcbpeqz.js";import{st}from"./chunk-index-6rdywten.js";function y(e,t){let{collapsed:n,expanded:r,current:s}=t,o=st(e,t.at),a=[],d=(i,c)=>{a.push({key:i,shown:c});let f=o.threads[i];if(!f)return;for(let l of f.open)a.push({key:l,shown:c});for(let l of f.closed)a.push({key:l,shown:c&&(r.has(l)||l===s)})};for(let i of o.home)d(i,!0);for(let i of o.pinned)d(i,!0);for(let i of o.folders){let c=!n.has(i.id)||s!==void 0&&i.rooms.includes(s);for(let f of i.rooms)d(f,c)}let u=o.folders.length>0?o.rest:[...o.restAgents,...o.restGroups];for(let i of u)d(i,!0);let{orphans:m}=o;for(let i of m.open)a.push({key:i,shown:!0});for(let i of m.closed)a.push({key:i,shown:r.has(i)||i===s});return a}function h(e,t,n,r){let s=n===1?-1:e.length;if(t!==void 0){if(s=e.findIndex((o)=>o.key===t),s<0)return}for(let o=s+n;o>=0&&o<e.length;o+=n){let a=e[o];if(a&&r(a))return a.key}return}var k=new Set(["","text","search","url","tel","email","password","number","date","datetime-local","month","time","week"]);function g(e){if(!(e instanceof HTMLElement))return;if(e instanceof HTMLTextAreaElement)return e;if(e instanceof HTMLSelectElement)return e;if(e instanceof HTMLInputElement)return k.has(e.type)?e:void 0;return e.closest('[contenteditable]:not([contenteditable="false"])')?e:void 0}function w(e,t){if(e instanceof HTMLSelectElement)return!1;if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){if(e.value==="")return!0;let{selectionStart:o,selectionEnd:a}=e;if(o===null||a===null||o!==a)return!1;return t?o===0:o===e.value.length}if((e.textContent??"")==="")return!0;let n=window.getSelection();if(!n||n.rangeCount===0||!n.isCollapsed)return!1;let r=n.getRangeAt(0),s=document.createRange();if(s.selectNodeContents(e),t)s.setEnd(r.startContainer,r.startOffset);else s.setStart(r.endContainer,r.endOffset);return s.toString()===""}function E(){let e=Un();if(e.pane!=="room"||e.key===void 0)return;return(O.getState().rooms[e.key]?.messages??[]).findLast(Ci)}var x=(e)=>e instanceof HTMLTextAreaElement&&e.closest(".composer")!==null&&e.value===""&&!e.readOnly;function T(e){if(e.defaultPrevented||ot(e))return;let{key:t}=e;if(t==="Escape")return e.altKey||e.ctrlKey||e.metaKey?void 0:"escape";if(e.altKey&&!e.ctrlKey&&!e.metaKey){if(t!=="ArrowUp"&&t!=="ArrowDown")return;let n=t==="ArrowUp",r=g(e.target);if(r&&!w(r,n))return;if(e.shiftKey)return n?"previous-unread":"next-unread";return n?"previous":"next"}if(t==="ArrowUp"&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.repeat)return x(e.target)&&E()?"edit-queued":void 0;if(t==="?"&&!e.ctrlKey&&!e.metaKey&&!e.repeat)return g(e.target)?void 0:"help";return}function K(){let e=new Set;for(let t of document.querySelectorAll("details.thread-closed[open] [data-thread]"))if(t.dataset.thread)e.add(t.dataset.thread);return e}var p=()=>document.querySelector('dialog[open], .action-popover, .switcher:not([data-state="closed"])')!==null;function b(e,t=12){let n=S("room",e),r=[...document.querySelectorAll('.room-row[aria-current="page"], .thread-link[aria-current="page"]')].find((s)=>s.getAttribute("href")===n);if(r)r.scrollIntoView?.({block:"nearest"});else if(t>0)requestAnimationFrame(()=>b(e,t-1))}function H(e,t){let n=O.getState(),r=Un(),s=r.pane==="room"?r.key:void 0,o=y(n,{at:(u)=>Ae(n,u),collapsed:Ar(),expanded:K(),current:s});if(r.pane==="room"&&!o.some((u)=>u.key===s))return;let d=h(o,s,e,t?(u)=>_o(u.key)>0:(u)=>u.shown);if(d===void 0)return;X("room",d),b(d)}function L(e){if(document.querySelector(".action-popover")){e.preventDefault(),wt();return}if(document.querySelector("dialog[open]"))return;let t=document.activeElement;if(t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&k.has(t.type))e.preventDefault(),t.blur()}function A(e,t){switch(e){case"escape":L(t);break;case"help":if(t.preventDefault(),Wo())li();else if(!p())Go();break;case"edit-queued":{if(p())break;let n=E();if(!n)break;t.preventDefault(),Ei(n);break}default:if(p())break;t.preventDefault(),H(e.startsWith("previous")?-1:1,e.endsWith("unread"))}}function G(){let e=(t)=>{let n=T(t);if(n)A(n,t)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}export{G as startShortcuts};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C,a,r,t,G,g,e,n,s,S,X,Ke,Ae,d,ot,jt,xn,Je,Ue,Kt}from"./chunk-index-24cggw6k.js";import{yi}from"./chunk-index-d74tpnkd.js";import{mi,gi}from"./chunk-index-sz381vda.js";import{Oi}from"./chunk-index-6s2pqwna.js";import{Zt}from"./chunk-index-bxf8eq1s.js";import{ca}from"./chunk-index-6rdywten.js";mi();function v(){let l=d((c)=>JSON.stringify(ca(c,(o)=>Ae(c,o),(o)=>Ke(c,o)>0,!0).map((o)=>({id:o.id,...o.title===void 0?{}:{title:o.title},entries:o.keys.map((u)=>({key:u,name:c.rooms[u]?.view?.displayName??u,waiting:Ke(c,u)>0}))})))),m=yi(),p=a(l);if(!m)p.current=l;let f=p.current;return C(()=>JSON.parse(f),[f])}function b(l){let{key:m,name:p}=l.entry,f=d((i)=>i.rooms[m]),c=d((i)=>Ke(i,m)),o=f?.view,u=Je(o?.character),w=Zt(()=>jt(m,l.onLeave),l.liftable&&!o?.home?gi(m):void 0);if(!o)return null;return e("li",{...l.liftable&&!o.home?{"data-drop-item":"","data-key":m}:{},children:n("a",{className:"switcher-row",...w,href:S("room",m),"aria-current":m===l.current?"page":void 0,style:u,onClick:(i)=>{if(i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;i.preventDefault(),l.onPick(m)},children:[n("span",{className:"switcher-picture",children:[e(Ue,{view:o,size:40}),c?e("span",{className:"switcher-dot","aria-hidden":"true"}):null]}),n("span",{className:"switcher-name",children:[e("strong",{children:p}),f?.typing?n("span",{className:"switcher-working",children:[n("span",{className:"typing","aria-hidden":"true",children:[e("i",{}),e("i",{}),e("i",{})]}),t("Working")]}):null]}),e(Kt,{room:m}),c?e("span",{className:"badge badge-warn",children:G(c,"{count} card waiting","{count} cards waiting")}):null,o.muted?n("span",{className:"switcher-mode","data-mode":"muted",title:t("Notifications are off"),children:[e(s,{name:"bell-off",size:14}),e("span",{className:"visually-hidden",children:t("Notifications are off")})]}):null,f?.mode.yolo?n("span",{className:"switcher-mode","data-mode":"yolo",title:t("Yolo"),children:[e(s,{name:"bolt",size:14}),e("span",{className:"visually-hidden",children:t("Yolo")})]}):null,f?.mode.longRunning?n("span",{className:"switcher-mode","data-mode":"long",title:t("Long-running"),children:[e(s,{name:"timer",size:14}),e("span",{className:"visually-hidden",children:t("Long-running")})]}):null]})})}function Y(l){let[m,p]=r(""),f=v(),c=f.map((i)=>({...i,entries:i.entries.filter((h)=>Oi(m,h.name)!==void 0)})).filter((i)=>i.entries.length>0||m===""),o=(i)=>l.close(i===l.current?void 0:()=>X("room",i)),u=f.some((i)=>i.id!=="waiting"&&i.id!=="home"&&i.id!=="rest"&&(i.id!=="pinned"||i.entries.length>0))?t("Ungrouped"):t("Rooms"),w=c.filter((i)=>i.entries.length>0).length>1;return n(g,{children:[n("div",{className:"switcher-search",children:[e(s,{name:"search",size:16}),e("input",{type:"search",value:m,placeholder:t("Find a room"),"aria-label":t("Find a room"),enterKeyHint:"go",autoComplete:"off",onChange:(i)=>p(i.target.value),onKeyDown:(i)=>{let h=c.flatMap((y)=>y.entries)[0];if(i.key==="Enter"&&h&&!ot(i.nativeEvent))o(h.key)}}),e("button",{type:"button",className:"icon-button switcher-add","aria-label":t("Add"),"aria-haspopup":"menu",onClick:(i)=>xn(i.currentTarget,l.close),children:e(s,{name:"plus"})})]}),e("div",{className:"switcher-scroll","data-drop-root":"",children:c.map((i)=>{let h=i.id==="waiting",y=i.id==="pinned"?"pinned":i.id==="rest"?"rest":h||i.id==="home"?void 0:"folder";return n("section",{"aria-label":h?t("Waiting for you"):i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?u:i.title??t("Rooms"),...i.entries.length===0?{"data-empty":""}:{},...y?{"data-drop-zone":y,"data-zone-id":i.id,...y==="folder"?{"data-folder":i.id}:{}}:{},children:[h?e("h2",{className:"switcher-heading","data-waiting":"",children:t("Waiting for you")}):w||i.entries.length===0?e("h2",{className:"switcher-heading",children:i.id==="home"?t("Home"):i.id==="pinned"?t("Pinned"):i.id==="rest"?u:i.title}):null,e("ul",{className:"switcher-list",children:i.entries.map((N)=>e(b,{entry:N,current:l.current,onPick:o,onLeave:l.close,liftable:!h&&i.id!=="home"},N.key))})]},i.id)})})]})}export{Y as SwitcherList};
|