pi-roundtable-web 0.29.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/chunk-account-66e6ezdq.js +1 -0
- package/dist/{chunk-action-menu-q5y7xpry.js → chunk-action-menu-ap5xn7bf.js} +1 -1
- package/dist/{chunk-agent-x74xezyt.js → chunk-agent-sapt5qhn.js} +1 -1
- package/dist/chunk-arranged-rooms-n6bk696f.js +1 -0
- package/dist/chunk-attachments-p5v9gqyt.js +102 -0
- package/dist/chunk-bulk-actions-aze4ewc4.js +1 -0
- package/dist/chunk-character-creator-m7tw20ef.js +225 -0
- package/dist/{chunk-codeeditor-239ss6a2.js → chunk-codeeditor-yy6pq8mv.js} +2 -2
- package/dist/chunk-confirm-0cajsfhk.js +1 -0
- package/dist/chunk-connectors-tw0tbm21.js +37 -0
- package/dist/chunk-conversations-wkm23m5r.js +1 -0
- package/dist/{chunk-council-sheet-a5e6tspr.js → chunk-council-sheet-mz7s23nq.js} +2 -2
- package/dist/chunk-council-view-zgvzxtgn.js +1 -0
- package/dist/{chunk-drag-7873fvzw.js → chunk-drag-d1bpy8w6.js} +1 -1
- package/dist/{chunk-entry-5zmjxadx.js → chunk-entry-7zr5b1fp.js} +1 -1
- package/dist/{chunk-folder-list-h9hmbm8e.js → chunk-folder-list-bs4eh3g9.js} +1 -1
- package/dist/chunk-folds-eez1q41c.js +1 -0
- package/dist/{chunk-gate-fa6za28z.js → chunk-gate-dt91egcd.js} +1 -1
- package/dist/chunk-host-icons-nfe2t8tk.js +1 -0
- package/dist/chunk-host-picture-4rtswxwa.js +1 -0
- package/dist/chunk-host-state-1vxzmmq6.js +1 -0
- package/dist/chunk-host-ui-x38bf0et.js +1 -0
- package/dist/{chunk-index-4re5prfp.js → chunk-index-0h99xcs3.js} +2 -2
- package/dist/{chunk-index-5ssncptg.js → chunk-index-1kb8tv4v.js} +2 -2
- package/dist/chunk-index-24cggw6k.js +50 -0
- package/dist/chunk-index-2g8xtwqg.js +2 -0
- package/dist/chunk-index-3n38xe7m.js +2 -0
- package/dist/{chunk-index-en5dm1zv.js → chunk-index-3tksdmx7.js} +2 -2
- package/dist/{chunk-index-rr73h4kc.js → chunk-index-4a1tdadd.js} +3 -3
- package/dist/{chunk-index-f4gqzfkv.js → chunk-index-53fwc7sc.js} +2 -2
- package/dist/chunk-index-55ps4x5n.js +2 -0
- package/dist/{chunk-index-4krm48hm.js → chunk-index-5j1v2q7w.js} +1 -1
- package/dist/chunk-index-5w6tb7p0.js +2 -0
- package/dist/{chunk-index-y6p8j3zv.js → chunk-index-6btdp13p.js} +1 -1
- package/dist/chunk-index-6m7dwsmv.js +1 -0
- package/dist/{chunk-index-7c9fn21n.js → chunk-index-6rdywten.js} +2 -2
- package/dist/{chunk-index-gj3n4dh5.js → chunk-index-6s2pqwna.js} +2 -2
- package/dist/{chunk-index-r0hk9kyd.js → chunk-index-7mrkq793.js} +2 -2
- package/dist/chunk-index-7xcbpeqz.js +2 -0
- package/dist/chunk-index-88wh5eyj.js +2 -0
- package/dist/{chunk-index-ntt3em2k.js → chunk-index-8pbwr3rs.js} +1 -1
- package/dist/{chunk-index-bjeg3e2j.js → chunk-index-8wpvj7k5.js} +2 -2
- package/dist/chunk-index-97dcp1vh.js +1 -0
- package/dist/chunk-index-a7e6rhxy.js +2 -0
- package/dist/{chunk-index-4eag6s50.js → chunk-index-bxf8eq1s.js} +2 -2
- package/dist/chunk-index-c8gm1crh.js +120 -0
- package/dist/{chunk-index-4jnn2g09.js → chunk-index-ce7hsda9.js} +2 -2
- package/dist/chunk-index-cfesmk1f.js +2 -0
- package/dist/{chunk-index-zdzzf3fp.js → chunk-index-cmzvq3nf.js} +1 -1
- package/dist/{chunk-index-35zqk1zr.js → chunk-index-d4mx2vvf.js} +2 -2
- package/dist/chunk-index-d74tpnkd.js +2 -0
- package/dist/chunk-index-d941ae7c.js +2 -0
- package/dist/{chunk-index-rtz4936v.js → chunk-index-dr0jr7d3.js} +3 -3
- package/dist/{chunk-index-pcbkp62w.js → chunk-index-en728705.js} +2 -2
- package/dist/chunk-index-fb3kzyyp.js +2 -0
- package/dist/{chunk-index-a8c0ap8g.js → chunk-index-ffnd0jcj.js} +2 -2
- package/dist/chunk-index-fn6305vn.js +3 -0
- package/dist/{chunk-index-evhaaqzk.js → chunk-index-gdh7wsd5.js} +11 -11
- package/dist/{chunk-index-3tjmyd1h.js → chunk-index-m76gdwnk.js} +1 -1
- package/dist/chunk-index-mr391t49.js +2 -0
- package/dist/chunk-index-n3khm9fq.js +2 -0
- package/dist/{chunk-index-93f3e06v.js → chunk-index-nn4w6a04.js} +2 -2
- package/dist/{chunk-index-hef4gwtb.js → chunk-index-nr275sa7.js} +2 -2
- package/dist/{chunk-index-cttrqfm8.js → chunk-index-prq011b6.js} +1 -1
- package/dist/{chunk-index-h2a42p6s.js → chunk-index-q4k9vk04.js} +17 -1
- package/dist/chunk-index-rgdaec7y.js +2 -0
- package/dist/chunk-index-rjs1can6.js +2 -0
- package/dist/chunk-index-s4a8e4qm.js +2 -0
- package/dist/{chunk-index-q33ppq0j.js → chunk-index-sz381vda.js} +3 -3
- package/dist/{chunk-index-1652v386.css → chunk-index-t7csmbpy.css} +1 -1
- package/dist/{chunk-index-amspdq2j.js → chunk-index-v9jqyr1f.js} +1 -1
- package/dist/{chunk-index-e46652wf.js → chunk-index-vpq2cj14.js} +1 -1
- package/dist/chunk-index-vsaggfns.js +2 -0
- package/dist/{chunk-index-7k5895sn.js → chunk-index-w17wgjby.js} +3 -3
- package/dist/{chunk-index-teyx2hz7.js → chunk-index-wgrx2ybn.js} +2 -2
- package/dist/chunk-index-wsv46y9p.js +2 -0
- package/dist/{chunk-index-v6h43553.js → chunk-index-xbj816p0.js} +2 -2
- package/dist/{chunk-index-aycxt14t.js → chunk-index-yr758n6t.js} +2 -2
- package/dist/{chunk-index-pfs6rm6w.js → chunk-index-ysv36nbk.js} +2 -2
- package/dist/{chunk-index-haac6nbt.js → chunk-index-ze9p4npm.js} +2 -2
- package/dist/chunk-index-zfdvyrjt.js +2 -0
- package/dist/chunk-lang-css-3h22se37.js +1 -0
- package/dist/{chunk-lang-dockerfile-2p7e3ssz.js → chunk-lang-dockerfile-y24eejnh.js} +1 -1
- package/dist/{chunk-lang-go-zxp9k517.js → chunk-lang-go-qzgv1161.js} +2 -2
- package/dist/chunk-lang-html-9rvrmmpg.js +1 -0
- package/dist/chunk-lang-javascript-4kv8s3tk.js +1 -0
- package/dist/{chunk-lang-json-zmym50rg.js → chunk-lang-json-99v80v88.js} +1 -1
- package/dist/{chunk-lang-markdown-ww2kcs85.js → chunk-lang-markdown-gn8he877.js} +4 -4
- package/dist/{chunk-lang-python-ng1zdtd4.js → chunk-lang-python-prsw4p4k.js} +2 -2
- package/dist/{chunk-lang-rust-6ynhxjdd.js → chunk-lang-rust-g6xqta16.js} +1 -1
- package/dist/{chunk-lang-shell-39t9bz2s.js → chunk-lang-shell-dmpnzc6w.js} +1 -1
- package/dist/{chunk-lang-sql-w875ejpg.js → chunk-lang-sql-wz7ca27b.js} +2 -2
- package/dist/{chunk-lang-toml-b8ckgkg5.js → chunk-lang-toml-160prtq4.js} +1 -1
- package/dist/chunk-lang-typescript-mp0yw903.js +1 -0
- package/dist/{chunk-lang-xml-bz91cjp1.js → chunk-lang-xml-9htkz2dd.js} +1 -1
- package/dist/{chunk-lang-yaml-g9zy0tdv.js → chunk-lang-yaml-08749wd5.js} +1 -1
- package/dist/chunk-layout-actions-tdx896xf.js +1 -0
- package/dist/chunk-menu-items-trhybv1g.js +1 -0
- package/dist/chunk-mode-toggle-4dtfphq4.js +1 -0
- package/dist/chunk-note-row-28e5x7n8.js +233 -0
- package/dist/chunk-notes-5nkayhw8.js +1 -0
- package/dist/chunk-notice-bell-xz8a04am.js +1 -0
- package/dist/{chunk-notices-mtn7pg1z.js → chunk-notices-d0cwvk27.js} +1 -1
- package/dist/{chunk-onboarding-f3hhxgg4.js → chunk-onboarding-zs4rtea9.js} +1 -1
- package/dist/{chunk-overview-qmepntrr.js → chunk-overview-9sb3ywa8.js} +1 -1
- package/dist/{chunk-palette-edkn1ypq.js → chunk-palette-5sfhrv4x.js} +1 -1
- package/dist/chunk-placement-items-e2neja55.js +1 -0
- package/dist/{chunk-profile-pwfq0wns.js → chunk-profile-jffhtpqf.js} +1 -1
- package/dist/{chunk-prompt-history-xp9hmeqt.js → chunk-prompt-history-1jz2gk3v.js} +1 -1
- package/dist/{chunk-prompts-a56qvytg.js → chunk-prompts-0t30ttd0.js} +1 -1
- package/dist/chunk-room-confirms-6595921h.js +1 -0
- package/dist/{chunk-room-menu-1m2c2ekt.js → chunk-room-menu-hwkjyxwe.js} +1 -1
- package/dist/chunk-rooms-menu-button-k0eq1tcr.js +1 -0
- package/dist/{chunk-schedules-kwnw7p8v.js → chunk-schedules-e12y8fw2.js} +1 -1
- package/dist/{chunk-seat-menu-m2n9nvv0.js → chunk-seat-menu-n2bcw0mf.js} +1 -1
- package/dist/chunk-sheet-hosts-myvm2vhd.js +29 -0
- package/dist/chunk-shortcut-help-434sqnxc.js +26 -0
- package/dist/chunk-shortcuts-mjxph0g7.js +1 -0
- package/dist/chunk-skill-editor-98492yrt.js +8 -0
- package/dist/chunk-skills-mfv8ppfh.js +1 -0
- package/dist/chunk-start-over-line-m526193z.js +16 -0
- package/dist/{chunk-switcher-list-ehsn2wsk.js → chunk-switcher-list-5ngjar24.js} +1 -1
- package/dist/{chunk-tab-dot-gkpe06q8.js → chunk-tab-dot-tzjkahj5.js} +1 -1
- package/dist/{chunk-table-av3kh3tt.js → chunk-table-xbtbex2z.js} +1 -1
- package/dist/{chunk-table2d-5x3jptp9.js → chunk-table2d-61bvrykm.js} +1 -1
- package/dist/{chunk-table3d-rsvajx7r.js → chunk-table3d-5a7vbgyj.js} +24 -24
- package/dist/chunk-thread-actions-bf6vf2mt.js +1 -0
- package/dist/{chunk-thread-cards-grzszfha.js → chunk-thread-cards-n0n603vf.js} +1 -1
- package/dist/chunk-thread-list-7bkdn51x.js +227 -0
- package/dist/{chunk-transcript-t5szb8r0.js → chunk-transcript-8ztrkt6g.js} +1 -1
- package/dist/chunk-waiting-chip-y83c90v3.js +32 -0
- package/dist/chunk-waiting-s273kcgz.js +1 -0
- package/dist/chunk-where-jr791gzj.js +1 -0
- package/dist/chunk-workspace-dw71mshw.js +586 -0
- package/dist/chunk-zh-tw-vm5d0w6j.js +1 -0
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/src/api-types.ts +12 -0
- package/src/app/app.ts +7 -0
- package/src/app/card-log.ts +10 -2
- package/src/app/protocol.ts +18 -0
- package/src/app/queued-delivery.ts +107 -0
- package/src/app/queued-frames.ts +115 -0
- package/src/app/room-log.ts +39 -7
- package/src/app/routes.ts +97 -5
- package/src/app/socket.ts +12 -2
- package/src/app/surface.ts +37 -6
- package/src/app/zip.ts +124 -0
- package/src/auth/sessions.ts +9 -1
- package/src/host/cards.ts +10 -3
- package/src/host/stored-json.ts +23 -0
- package/src/i18n/zh-tw.ts +14 -0
- package/src/notices/mount.ts +1 -0
- package/src/notices/store.ts +9 -1
- package/src/web-plugin.ts +4 -1
- package/dist/chunk-account-9616x405.js +0 -1
- package/dist/chunk-arranged-rooms-9prq46vh.js +0 -1
- package/dist/chunk-bulk-actions-5dc4m9ad.js +0 -1
- package/dist/chunk-character-creator-wf02eg0h.js +0 -1
- package/dist/chunk-confirm-bhrx9195.js +0 -1
- package/dist/chunk-connectors-k77pd9by.js +0 -37
- package/dist/chunk-conversations-ftcpaqw1.js +0 -1
- package/dist/chunk-council-view-6593rqbr.js +0 -1
- package/dist/chunk-folds-vxq86t1s.js +0 -1
- package/dist/chunk-host-icons-y6frbzqt.js +0 -1
- package/dist/chunk-host-picture-fqg55rbr.js +0 -1
- package/dist/chunk-host-state-65tdhkyq.js +0 -1
- package/dist/chunk-host-ui-233kz7qp.js +0 -1
- package/dist/chunk-index-2c00zf3z.js +0 -2
- package/dist/chunk-index-2dhrqvba.js +0 -2
- package/dist/chunk-index-2s4bkrz3.js +0 -2
- package/dist/chunk-index-2ypaqwjy.js +0 -2
- package/dist/chunk-index-39qq37j5.js +0 -2
- package/dist/chunk-index-57teqgct.js +0 -2
- package/dist/chunk-index-9m9v1p7s.js +0 -2
- package/dist/chunk-index-a8nqn3y0.js +0 -3
- package/dist/chunk-index-am7ghh75.js +0 -120
- package/dist/chunk-index-amxa2bn3.js +0 -2
- package/dist/chunk-index-dajanzxc.js +0 -1
- package/dist/chunk-index-e2eeckhh.js +0 -2
- package/dist/chunk-index-ek98d2rn.js +0 -2
- package/dist/chunk-index-gp4chnp3.js +0 -2
- package/dist/chunk-index-mg96sqpk.js +0 -2
- package/dist/chunk-index-nsya88fn.js +0 -1
- package/dist/chunk-index-smz90j6p.js +0 -2
- package/dist/chunk-index-vzqwn3wp.js +0 -2
- package/dist/chunk-index-wt2asefx.js +0 -50
- package/dist/chunk-index-x4tq9btg.js +0 -2
- package/dist/chunk-index-yvcdg5hh.js +0 -2
- package/dist/chunk-index-zeqfnkty.js +0 -2
- package/dist/chunk-index-zpwb8mkk.js +0 -2
- package/dist/chunk-lang-css-avzhvm72.js +0 -1
- package/dist/chunk-lang-html-red02gep.js +0 -1
- package/dist/chunk-lang-javascript-n33kmjcx.js +0 -1
- package/dist/chunk-lang-typescript-qf8acbb2.js +0 -1
- package/dist/chunk-layout-actions-fyzzzeyp.js +0 -1
- package/dist/chunk-menu-items-yvnk3vds.js +0 -1
- package/dist/chunk-mode-toggle-ccv271hm.js +0 -1
- package/dist/chunk-note-row-314py1pp.js +0 -204
- package/dist/chunk-notes-4rnrddzw.js +0 -1
- package/dist/chunk-notice-bell-z9wgamnz.js +0 -1
- package/dist/chunk-placement-items-trsa5t23.js +0 -1
- package/dist/chunk-room-confirms-gqpkz4h0.js +0 -1
- package/dist/chunk-rooms-menu-button-tcvda1gq.js +0 -1
- package/dist/chunk-sheet-hosts-pr8xktyq.js +0 -29
- package/dist/chunk-shortcut-help-sbvrds1m.js +0 -26
- package/dist/chunk-shortcuts-8705p7q3.js +0 -1
- package/dist/chunk-skill-editor-7xy09sq1.js +0 -8
- package/dist/chunk-skills-cnc25x7q.js +0 -1
- package/dist/chunk-start-over-line-97zdd9pb.js +0 -16
- package/dist/chunk-thread-actions-7xtkegwm.js +0 -1
- package/dist/chunk-thread-list-9bjjac3j.js +0 -217
- package/dist/chunk-waiting-chip-d8b6a0p8.js +0 -28
- package/dist/chunk-waiting-ts3kxjvv.js +0 -1
- package/dist/chunk-where-3d3ncsa5.js +0 -1
- package/dist/chunk-workspace-ct6hvn0z.js +0 -578
- package/dist/chunk-zh-tw-v9v1eerm.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{it,d}from"./chunk-index-wt2asefx.js";import{Pn}from"./chunk-index-zeqfnkty.js";var Jt=Pn,Wn=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 so(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)),gs=()=>it(a,g,()=>{return});function Mi(){return d((n)=>n.order.map((e)=>n.rooms[e]?.view).filter((e)=>e!==void 0&&e.kind==="group"),"councils")}function Os(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 ys(n){return[...n].filter((e)=>e.muted!==!0&&!e.helper).sort((e,r)=>Number(r.home)-Number(e.home)).slice(0,Jt).map((e)=>e.name)}function bs(n,e,r=Jt){if(n.includes(e))return n.filter((t)=>t!==e);return n.length>=r?[...n]:[...n,e]}function vs(n,e){return n.filter(e).slice(0,Jt)}function xs(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 Ss(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{Jt,Wn,so,gs,Mi,Os,ys,bs,vs,xs,Ss};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{O,h,l,f}from"./chunk-index-wt2asefx.js";import{fs}from"./chunk-index-2c00zf3z.js";import{So,Mn}from"./chunk-index-39qq37j5.js";import{et,qs,Bs,Fs,Gs,Zs}from"./chunk-index-9m9v1p7s.js";import{zt}from"./chunk-index-7c9fn21n.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=So();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 us=(e,t,o=null)=>i((r)=>Zs(r,e,t,o),()=>n.pinRoom(e,t,o)),Kt=(e,t,o=null)=>i((r)=>Gs(r,e,t,o),()=>n.placeRoom(e,t,o));function fr(e,t){let o=zt(Mn(),e);if(o.kind==="rest")return;let r=et(o.siblings,e,t);if(!r)return;return o.kind==="pinned"?us(e,!0,r.before):Kt(e,o.folder,r.before)}async function eo(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 to=(e,t,o)=>i((r)=>qs(r,e,t),()=>n.changeFolder(e,{name:t}),o),ea=(e,t)=>i((o)=>Bs(o,e,t),()=>n.changeFolder(e,{before:t}));function ra(e,t){let o=et(So().folders.map((r)=>r.id),e,t);return o?ea(e,o.before):void 0}var no=(e,t)=>i((o)=>Fs(o,e),()=>n.deleteFolder(e),t);async function oa(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 sa(e,t){let o=fs(zt(Mn(),e),e,t);if(!o)return;if(o.kind==="pin")return us(e,!0,o.before);if(o.kind==="folder")return Kt(e,o.folder,o.before);return Kt(e,null)}
|
|
2
|
-
export{us,Kt,fr,eo,to,ea,ra,no,oa,sa};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var tn=Math.PI*2,Pn=8;function Qn(n){let t=((n+Math.PI)%tn+tn)%tn-Math.PI;return t===-Math.PI?Math.PI:t}var Yn=(n,t)=>Qn(t-n);function hr(n){let t=Math.min(Math.max(n,0),8);return{count:1+t,seated:t}}var y=0.62,E=(n)=>Math.min(tn/Math.max(n,1),y),nn=(n,t)=>n===0?0:Qn(Math.PI+(n-t/2)*E(t)),Xt=(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(Yn(n,nn(r,t)));if(u<e-0.000000001)e=u,o=r}return o}var ao=(n,t)=>nn(z(n,t),t);function ks(n,t){if(t.seated===0)return;let o=Qn(n+Math.PI),e,r=Number.POSITIVE_INFINITY;for(let u=1;u<=t.seated;u+=1){let s=Math.abs(Yn(o,nn(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}=lo(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(co(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=Xt(n),o=[];for(let e=1;e<n;e+=1){let r=nn(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 _s(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=Xt(n),o=[];for(let e=1;e<n;e+=1){let r=nn(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 Hn(n,t,o=1.6,e=N){let r=Xt(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 Ts(n,t){let o=Xt(t),e=0.18;return{az:Qn(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 Ps(n,t,o){return{az:Qn(n.az+Yn(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 Ci=(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 Ms(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(Yn(n.az,t.az))/Math.PI;return{ms:Math.round(I+(V-I)*r),cut:!1}}function lo(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 Rs(n,t){let o=nn(n,t),e=Xt(t);return{x:Math.sin(o)*e,z:Math.cos(o)*e,yaw:o+Math.PI}}var Cs=(n,t)=>-n/Math.max(t,1)*(Math.PI/2),Es=(n)=>n<0?-1:1,_=32;function As(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 $s(n,t){if(Math.abs(n)<0.000001)return"none";if(n<0)return t?"none":"in";return t?"out":"none"}function co(n,t){if(!(t>0)||t>=1.2)return n;return Math.min(n*(1+(1.2-t)*0.55),95)}
|
|
2
|
-
export{tn,Pn,Qn,Yn,hr,nn,Xt,ao,ks,yt,_s,Hn,Ts,Ps,Ci,Qs,Ms,lo,Rs,Cs,Es,As,$s,co};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Me,X,O,M}from"./chunk-index-wt2asefx.js";var{emit:i,use:s}=M(),o=!1,n;function cn(t){return t.cardOrder.flatMap((e)=>{let r=t.cards[e];return r&&!r.outcome?[{id:e,card:r}]:[]})}function ia(){let t=cn(O.getState()),[e]=t;if(t.length===1&&e)Zi(e.id);else if(t.length>1)o=!0,i()}function Gi(){if(!o)return;o=!1,i()}var $r=()=>s(()=>o);function Zi(t){let e=O.getState().cards[t];if(!e)return;o=!1,n=t,i(),X("room",e.room)}var Nr=()=>s(()=>n);function Lr(t){if(n!==t)return;n=void 0,i()}var gi=(t,e)=>[...t?.querySelectorAll("[data-card]")??[]].find((r)=>r.dataset.card===e),c=1600;function Wi(t,e){let r=gi(t,e);if(!r)return!1;r.scrollIntoView?.({block:"center",behavior:Me()?"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{cn,ia,Gi,$r,Zi,Nr,Lr,gi,Wi};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-evhaaqzk.js";import"./chunk-index-5ssncptg.js";import{ei}from"./chunk-index-f4gqzfkv.js";var r=()=>ei();export{r as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-evhaaqzk.js";import"./chunk-index-5ssncptg.js";import{Kn}from"./chunk-index-a8c0ap8g.js";import"./chunk-index-f4gqzfkv.js";import"./chunk-index-7k5895sn.js";import"./chunk-index-v6h43553.js";var t=()=>Kn();export{t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-evhaaqzk.js";import"./chunk-index-5ssncptg.js";import{It}from"./chunk-index-7k5895sn.js";import"./chunk-index-v6h43553.js";var t=()=>It({jsx:!0});export{t as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-index-evhaaqzk.js";import"./chunk-index-5ssncptg.js";import{It}from"./chunk-index-7k5895sn.js";import"./chunk-index-v6h43553.js";var r=()=>It({typescript:!0,jsx:!0});export{r as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{us,Kt,fr,eo,to,ea,ra,no,oa,sa}from"./chunk-index-yvcdg5hh.js";import"./chunk-index-39qq37j5.js";import"./chunk-index-7c9fn21n.js";export{eo as createFolder,no as deleteFolder,sa as dropRoom,Kt as moveRoom,oa as muteFolder,ra as nudgeFolder,fr as nudgeRoom,us as pinRoom,ea as placeFolderBefore,to as renameFolderTo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Zn,aa,ta,la,ca,ua,da,na,fa,ha}from"./chunk-index-a8nqn3y0.js";import"./chunk-index-93f3e06v.js";import"./chunk-index-x4tq9btg.js";import"./chunk-index-pcbkp62w.js";import"./chunk-index-smz90j6p.js";import"./chunk-index-zeqfnkty.js";import"./chunk-index-e2eeckhh.js";import"./chunk-index-teyx2hz7.js";import"./chunk-index-gp4chnp3.js";import"./chunk-index-4krm48hm.js";import"./chunk-index-aycxt14t.js";import"./chunk-index-hef4gwtb.js";import"./chunk-index-39qq37j5.js";import"./chunk-index-7c9fn21n.js";export{ta as addMenu,da as avatarMenu,na as cardDetails,fa as cardMenu,Zn as copyText,ha as fileMenu,ua as messageMenu,la as openAddMenu,aa as roomMenu,ca as seatMenu};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Er}from"./chunk-index-rr73h4kc.js";export{Er as ModeToggle};
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import{p,j,r,t,g,e,n,s,xi,d,We,Wt,Nt}from"./chunk-index-wt2asefx.js";import{lt}from"./chunk-index-h2a42p6s.js";var f=!1;function h(){if(f||typeof document>"u")return;if(f=!0,typeof CSSStyleSheet<"u"&&"adoptedStyleSheets"in Document.prototype)try{let a=new CSSStyleSheet;a.replaceSync(`
|
|
2
|
-
/* A note is the room's people talking among themselves: a plain, dashed card, never the accent bubble of a message to the agent. */
|
|
3
|
-
.message[data-note] .bubble,
|
|
4
|
-
.message[data-note][data-mine] .bubble {
|
|
5
|
-
border: 1px dashed var(--control-border);
|
|
6
|
-
background: var(--surface-3);
|
|
7
|
-
color: var(--text);
|
|
8
|
-
box-shadow: none;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.message[data-note][data-mine] .bubble a,
|
|
12
|
-
.message[data-note][data-mine] .bubble code {
|
|
13
|
-
color: var(--accent);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.message[data-note][data-mine] .prose code,
|
|
17
|
-
.message[data-note][data-mine] .prose blockquote {
|
|
18
|
-
background: var(--surface);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.message[data-note][data-mine] .code-block pre {
|
|
22
|
-
background: var(--surface);
|
|
23
|
-
border-color: var(--border);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.message[data-note][data-mine] .file-chip {
|
|
27
|
-
color: var(--text);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.note-chip {
|
|
31
|
-
padding: 0 var(--space-2);
|
|
32
|
-
border-radius: var(--radius-full);
|
|
33
|
-
background: var(--surface-3);
|
|
34
|
-
color: var(--muted);
|
|
35
|
-
font-size: var(--text-xs);
|
|
36
|
-
font-weight: var(--weight-medium);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* A message between agents: one quiet line in the room's flow that opens to the whole text. */
|
|
40
|
-
.line.intercom {
|
|
41
|
-
justify-content: flex-start;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.intercom-card {
|
|
45
|
-
max-width: 100%;
|
|
46
|
-
min-width: 0;
|
|
47
|
-
padding: var(--space-1) var(--space-3);
|
|
48
|
-
border: 1px solid var(--border);
|
|
49
|
-
border-radius: var(--radius);
|
|
50
|
-
background: var(--surface-2);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.intercom-card > summary,
|
|
54
|
-
div.intercom-card {
|
|
55
|
-
display: flex;
|
|
56
|
-
gap: var(--space-2);
|
|
57
|
-
min-width: 0;
|
|
58
|
-
list-style: none;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.intercom-card > summary {
|
|
62
|
-
cursor: pointer;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.intercom-card > summary::-webkit-details-marker {
|
|
66
|
-
display: none;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.intercom-card > summary::after {
|
|
70
|
-
content: "▸";
|
|
71
|
-
margin-left: auto;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.intercom-card[open] > summary::after {
|
|
75
|
-
content: "▾";
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.intercom-card > summary:hover {
|
|
79
|
-
color: var(--text);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.intercom-heading {
|
|
83
|
-
flex: none;
|
|
84
|
-
font-weight: var(--weight-medium);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.line[data-intercom="failed"] .intercom-heading {
|
|
88
|
-
color: var(--danger);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.intercom-summary {
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
text-overflow: ellipsis;
|
|
94
|
-
white-space: nowrap;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.intercom-body {
|
|
98
|
-
margin-top: var(--space-2);
|
|
99
|
-
color: var(--text);
|
|
100
|
-
font-size: var(--text-sm);
|
|
101
|
-
}
|
|
102
|
-
`),document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];return}catch{}let i=document.createElement("style");i.textContent=`
|
|
103
|
-
/* A note is the room's people talking among themselves: a plain, dashed card, never the accent bubble of a message to the agent. */
|
|
104
|
-
.message[data-note] .bubble,
|
|
105
|
-
.message[data-note][data-mine] .bubble {
|
|
106
|
-
border: 1px dashed var(--control-border);
|
|
107
|
-
background: var(--surface-3);
|
|
108
|
-
color: var(--text);
|
|
109
|
-
box-shadow: none;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.message[data-note][data-mine] .bubble a,
|
|
113
|
-
.message[data-note][data-mine] .bubble code {
|
|
114
|
-
color: var(--accent);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.message[data-note][data-mine] .prose code,
|
|
118
|
-
.message[data-note][data-mine] .prose blockquote {
|
|
119
|
-
background: var(--surface);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.message[data-note][data-mine] .code-block pre {
|
|
123
|
-
background: var(--surface);
|
|
124
|
-
border-color: var(--border);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.message[data-note][data-mine] .file-chip {
|
|
128
|
-
color: var(--text);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.note-chip {
|
|
132
|
-
padding: 0 var(--space-2);
|
|
133
|
-
border-radius: var(--radius-full);
|
|
134
|
-
background: var(--surface-3);
|
|
135
|
-
color: var(--muted);
|
|
136
|
-
font-size: var(--text-xs);
|
|
137
|
-
font-weight: var(--weight-medium);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/* A message between agents: one quiet line in the room's flow that opens to the whole text. */
|
|
141
|
-
.line.intercom {
|
|
142
|
-
justify-content: flex-start;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.intercom-card {
|
|
146
|
-
max-width: 100%;
|
|
147
|
-
min-width: 0;
|
|
148
|
-
padding: var(--space-1) var(--space-3);
|
|
149
|
-
border: 1px solid var(--border);
|
|
150
|
-
border-radius: var(--radius);
|
|
151
|
-
background: var(--surface-2);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.intercom-card > summary,
|
|
155
|
-
div.intercom-card {
|
|
156
|
-
display: flex;
|
|
157
|
-
gap: var(--space-2);
|
|
158
|
-
min-width: 0;
|
|
159
|
-
list-style: none;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.intercom-card > summary {
|
|
163
|
-
cursor: pointer;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.intercom-card > summary::-webkit-details-marker {
|
|
167
|
-
display: none;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.intercom-card > summary::after {
|
|
171
|
-
content: "▸";
|
|
172
|
-
margin-left: auto;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.intercom-card[open] > summary::after {
|
|
176
|
-
content: "▾";
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.intercom-card > summary:hover {
|
|
180
|
-
color: var(--text);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.intercom-heading {
|
|
184
|
-
flex: none;
|
|
185
|
-
font-weight: var(--weight-medium);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.line[data-intercom="failed"] .intercom-heading {
|
|
189
|
-
color: var(--danger);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.intercom-summary {
|
|
193
|
-
overflow: hidden;
|
|
194
|
-
text-overflow: ellipsis;
|
|
195
|
-
white-space: nowrap;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.intercom-body {
|
|
199
|
-
margin-top: var(--space-2);
|
|
200
|
-
color: var(--text);
|
|
201
|
-
font-size: var(--text-sm);
|
|
202
|
-
}
|
|
203
|
-
`,document.head.append(i)}function N(i){if(!i.startsWith(xi))return[];try{let a=JSON.parse(i.slice(xi.length));return Array.isArray(a)?a.flatMap((o)=>typeof o?.name==="string"&&typeof o?.displayName==="string"?[{name:o.name,displayName:o.displayName}]:[]):[]}catch{return[]}}function y(i){let a=N(i.message.text),o=d((l)=>l.rooms[i.message.room]?.view?.displayName??""),[m,c]=r(!1),u={name:o,count:a.length,names:a.map((l)=>l.displayName).join(", ")};return n("li",{className:"line","data-enter":i.enter||void 0,children:[e(s,{name:"archive",size:14}),e("span",{children:a.length===1?t("{name} archived {count} temp knight: {names}",u):t("{name} archived {count} temp knights: {names}",u)}),e("button",{type:"button",className:"secondary compact",disabled:m,onClick:()=>{c(!0),(p("5dc4m9ad"),import("./chunk-bulk-actions-5dc4m9ad.js")).then((l)=>l.putBackHelpers(a.map((b)=>b.name)))},children:t("Undo")})]})}var S=120;function w(i,a=S){let m=(i.split(`
|
|
204
|
-
`).map((l)=>l.trim()).find((l)=>l!=="")??"").replace(/^#{1,6}\s+/,"");if(m.length<=a)return m;let c=m.charCodeAt(a-2),u=c>=55296&&c<=56319?a-2:a-1;return`${m.slice(0,u)}…`}function x(i){let a=i.peer.displayName;if(i.kind==="sent")return t("→ To {name}",{name:a});if(i.kind==="answered")return t("← From {name}",{name:a});return t("No answer from {name}",{name:a})}var v=j(function(a){let{message:o}=a,m=w(o.text),c=n(g,{children:[e("span",{className:"intercom-heading",children:x(o.intercom)}),m?e("span",{className:"intercom-summary",children:m}):null]});return e("li",{className:"line intercom","data-mid":o.id,"data-intercom":o.intercom.kind,"data-enter":a.enter||void 0,children:m===o.text.trim()?e("div",{className:"intercom-card",children:c}):n("details",{className:"intercom-card",children:[e("summary",{children:c}),e("div",{className:"intercom-body",children:e(We,{source:o.text})})]})})});h();var k=j(function(a){let{message:o}=a,m=d((u)=>u.principal?.id),c=o.principalId!==void 0&&o.principalId===m;return n("li",{className:"message","data-mid":o.id,"data-note":!0,"data-mine":c||void 0,"data-header":!0,"data-enter":a.enter||void 0,children:[c?null:e("span",{className:"message-avatar",children:e(lt,{picture:o.principalId===void 0?void 0:{principal:o.principalId},name:o.author})}),n("div",{className:"message-main",children:[n("div",{className:"message-meta",children:[e("strong",{children:o.author}),e("span",{className:"note-chip",children:t("Internal note")}),e("time",{dateTime:o.at,children:Wt(o.at,a.timeZone)})]}),n("div",{className:"bubble",children:[o.text?e(We,{source:o.text}):null,e(Nt,{files:o.files})]})]})]})});function R(i){let{intercom:a}=i.message;if(a)return e(v,{message:{...i.message,intercom:a},enter:i.enter});return i.message.kind==="system"?e(y,{message:i.message,enter:i.enter}):e(k,{...i})}export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E,o,L,a,r,t,u,e,n,y,l,v,m,k,T,_,Jo,J}from"./chunk-index-wt2asefx.js";import{xe}from"./chunk-index-ek98d2rn.js";import{Te}from"./chunk-index-rtz4936v.js";import{ne}from"./chunk-index-57teqgct.js";import"./chunk-index-zdzzf3fp.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.")}],H=300;function ie(){let{timeZone:p}=_(),{version:s}=J(),[c,d]=r("core"),[g,D]=r(""),[h,x]=r(),[f,R]=r(),[N,w]=r(),[S,K]=r(),[C,q]=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),H);return()=>clearTimeout(i)},[g,P,s]);let W=(h??[]).filter((i)=>i.kind===c).sort((i,b)=>c==="event"?(i.eventDate??"").localeCompare(b.eventDate??""):i.id-b.id),B=Jo(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),q(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,{}):W.length===0?e(k,{children:g?t("No matching notes."):t("Nothing of this kind yet.")}):W.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<B?e(T,{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(ne,{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(ne,{open:S!==void 0,title:t("Delete this note?"),onClose:()=>K(void 0),children:S?e(Q,{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(Te,{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 Q(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,x}from"./chunk-index-wt2asefx.js";import{Oi}from"./chunk-index-35zqk1zr.js";import"./chunk-index-e46652wf.js";function r({current:a}){let{badge:o}=Oi();return n("a",{className:"icon-button bell",href:x("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{oo,pa}from"./chunk-index-93f3e06v.js";import"./chunk-index-smz90j6p.js";import"./chunk-index-gp4chnp3.js";import"./chunk-index-4krm48hm.js";import"./chunk-index-aycxt14t.js";import"./chunk-index-hef4gwtb.js";import"./chunk-index-39qq37j5.js";import"./chunk-index-7c9fn21n.js";export{pa as folderMenu,oo as placementItems};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{vr}from"./chunk-index-2ypaqwjy.js";import"./chunk-index-57teqgct.js";import"./chunk-index-y6p8j3zv.js";import"./chunk-index-zdzzf3fp.js";import"./chunk-index-yvcdg5hh.js";import"./chunk-index-smz90j6p.js";import"./chunk-index-teyx2hz7.js";import"./chunk-index-4krm48hm.js";import"./chunk-index-39qq37j5.js";import"./chunk-index-7c9fn21n.js";export{vr as RoomConfirmHost};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,e,s,d}from"./chunk-index-wt2asefx.js";import"./chunk-index-4krm48hm.js";import"./chunk-index-hef4gwtb.js";import"./chunk-index-smz90j6p.js";import{ui}from"./chunk-index-vzqwn3wp.js";import"./chunk-index-gp4chnp3.js";import"./chunk-index-aycxt14t.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)=>ui(o.currentTarget),children:e(s,{name:"more",size:18})})}export{r as default};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{p,Q,S,E,o,L,C,a,r,t,u,g,e,n,s,X,d,fe,y,l,f,v,m,k,_,Se,bn,qr,ts,we,_i,rs,he,Ji,J,De,Vn}from"./chunk-index-wt2asefx.js";import{zo}from"./chunk-index-mg96sqpk.js";import{D}from"./chunk-index-y6p8j3zv.js";import{uo,Ls,Xs,fo,Is}from"./chunk-index-e2eeckhh.js";import"./chunk-index-smz90j6p.js";import"./chunk-index-yvcdg5hh.js";import"./chunk-index-4krm48hm.js";import{vr}from"./chunk-index-2ypaqwjy.js";import"./chunk-index-hef4gwtb.js";import"./chunk-index-zeqfnkty.js";import"./chunk-index-93f3e06v.js";import{Zn}from"./chunk-index-a8nqn3y0.js";import{_n}from"./chunk-index-r0hk9kyd.js";import{cn,Gi,$r,Zi}from"./chunk-index-zpwb8mkk.js";import{de}from"./chunk-index-cttrqfm8.js";import{gt}from"./chunk-index-amspdq2j.js";import{Bt}from"./chunk-index-en5dm1zv.js";import{Qt}from"./chunk-index-3tjmyd1h.js";import{Te}from"./chunk-index-rtz4936v.js";import"./chunk-index-57teqgct.js";import{se}from"./chunk-index-amxa2bn3.js";import{R}from"./chunk-index-zdzzf3fp.js";import"./chunk-index-x4tq9btg.js";import{en}from"./chunk-index-pcbkp62w.js";import{ie,Ae}from"./chunk-index-teyx2hz7.js";import"./chunk-index-gp4chnp3.js";import"./chunk-index-aycxt14t.js";import"./chunk-index-39qq37j5.js";import"./chunk-index-7c9fn21n.js";var We=S(()=>(p("xp9hmeqt"),import("./chunk-prompt-history-xp9hmeqt.js")).then((i)=>({default:i.HistorySheet}))),_e=S(()=>(p("wf02eg0h"),import("./chunk-character-creator-wf02eg0h.js")).then((i)=>({default:i.CharacterCreator}))),Ke=["default","off","minimal","low","medium","high","xhigh"],Ne={default:u("Default"),off:u("Off"),minimal:u("Minimal"),low:u("Low"),medium:u("Medium"),high:u("High"),xhigh:u("Very high")},U="default",Ce=(i)=>i.model===void 0?t("Default model ({current})",{current:i.effective.model}):t("Default model (server setting)"),Ue=u("Automatic"),pe=(i)=>i==="auto"?t(Ue):t(Ne[i]??i),ke=(i)=>({displayName:i.displayName,prompt:i.prompt,model:i.model??U,thinking:i.thinking??U});function ye(i,h){return{...h.displayName!==i.displayName?{displayName:h.displayName}:{},...h.prompt!==i.prompt?{prompt:h.prompt}:{},...h.model!==(i.model??U)?{model:h.model}:{},...h.thinking!==(i.thinking??U)?{thinking:h.thinking}:{}}}function Ee(){let i=ts(),h=a(i);if(i)h.current=i;let c=h.current,w=i!==void 0;if(o(()=>{if(!w)return;let M=window.location.href,b=()=>{if(window.location.href!==M)bn()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[w]),!c)return null;return e(R,{open:i!==void 0,title:t("Edit knight"),size:"wide",onClose:bn,children:e(qe,{name:c.name,opened:c.id},c.name)})}function qe({name:i,opened:h}){let[c,w]=r(),[M,b]=r([]),[H,B]=r(),[x,V]=r(),[P,W]=r(!1),[N,A]=r(!1),[F,O]=r(!1),[j,q]=r(!1),ae=Vn(c?.room??""),Y=a(null),ee=c!==void 0,Z=d((I)=>c?I.rooms[c.room]?.view?.muted===!0:!1,c?.room??""),[oe,K]=r(!1),re=d((I)=>c?I.rooms[c.room]?.view?.coordinator===!0:!1,c?.room??""),te=L(),ne=L(),G=L();o(()=>{if(!ee||!qr()?.look)return;Y.current?.scrollIntoView({block:"start"}),Y.current?.focus({preventScroll:!0})},[ee,h]);let T=a({});T.current={profile:c,draft:x},o(()=>{let I=!0;return Promise.all([y.agent(i),y.models()]).then(([me,Be])=>{if(!I)return;let{profile:be,draft:ce}=T.current,je=be&&ce&&Object.keys(ye(be,ce)).length>0;w(me),b(Be.models),V(je?ce:ke(me))},(me)=>I&&B(l(me))),()=>{I=!1}},[i,h]);let z=C(()=>c&&x?ye(c,x):{},[c,x]);if(H)return e(m,{message:H});if(!c||!x)return e(v,{});let ge=Object.keys(z).length>0,Oe=Array.from(new Set([U,...M,x.model])),ze=Ce(c),ve=async()=>{W(!0);try{let I=await y.updateAgent(i,z);w(I),V(ke(I)),A(!1),f(t("Saved."))}catch(I){f(l(I),"danger")}finally{W(!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:ae,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:G,children:[e("span",{className:"menu-icon",children:e(s,{name:Z?"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:G,checked:!Z,label:t("Notifications"),busy:oe,onChange:async(I)=>{K(!0),await en(c.room,!I),K(!1)}})]})})}),N?e(Je,{profile:c,draft:x,saving:P,onBack:()=>A(!1),onSave:ve}):n("form",{className:"stack form",onSubmit:(I)=>{if(I.preventDefault(),!ge)return;if(z.prompt!==void 0)A(!0);else ve()},children:[n("label",{htmlFor:ne,children:[t("Name"),e("input",{id:ne,value:x.displayName,onChange:(I)=>V({...x,displayName:I.target.value})})]}),n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:te,children:t("Prompt")}),n("span",{className:"field-tools",children:[n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>q(!0),children:[e(s,{name:"reset",size:16}),t("History")]}),n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>O(!0),children:[e(Ye,{}),t("Full screen")]})]})]}),e("textarea",{id:te,rows:8,value:x.prompt,onChange:(I)=>V({...x,prompt:I.target.value})})]}),e(Bt,{label:t("Model"),value:x.model,onChange:(I)=>V({...x,model:I}),options:Oe.map((I)=>({value:I,label:I===U?ze:I}))}),e(Bt,{label:t("Thinking level"),value:x.thinking,onChange:(I)=>V({...x,thinking:I}),options:Ke.map((I)=>({value:I,label:t(Ne[I])}))}),e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ge||P,children:P?t("Saving…"):z.prompt!==void 0?t("Review changes"):t("Save")})})]}),e(Ze,{name:i,opened:h}),n("section",{className:"card stack",ref:Y,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(Q,{fallback:e(v,{}),children:e(_e,{name:c.name,displayName:c.displayName,prompt:c.prompt,character:c.character,onSaved:(I)=>w(I)})})]}),re?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:()=>{bn(),we({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive {name}",{name:c.displayName})})})]}),j?e(Q,{fallback:null,children:e(We,{open:j,title:t("History of the prompt"),load:async()=>(await de.agentPromptHistory(i)).versions.map((I)=>({id:I.id,text:I.text,previous:I.previous,by:I.by,at:I.at})),onUse:(I)=>{V({...x,prompt:I}),q(!1)},onClose:()=>q(!1)})}):null,e(R,{open:F,title:t("Prompt"),size:"full",onClose:()=>O(!1),children:e("textarea",{className:"prompt-full","aria-label":t("Prompt"),value:x.prompt,onChange:(I)=>V({...x,prompt:I.target.value})})})]})}function Ze({name:i,opened:h}){let[c,w]=r(),[M,b]=r(),[H,B]=r(),x=L(),V=a(null),P=c!==void 0;if(o(()=>{if(!P||!qr()?.skills)return;V.current?.scrollIntoView({block:"start"}),V.current?.focus({preventScroll:!0})},[P,h]),o(()=>{let A=!0;return ie.skills(i).then((F)=>A&&w(F),(F)=>{if(A&&!(F instanceof fe&&F.status===404))B(l(F))}),()=>{A=!1}},[i,h]),H)return e(m,{message:H});if(!c)return null;let W=()=>ie.skills(i).then(w,(A)=>{f(l(A),"danger")}),N=async(A,F)=>{b(A);try{w(await ie.setSkills(i,F?{add:[A]}:{remove:[A]}))}catch(O){f(l(O),"danger")}finally{b(void 0)}};return n("section",{className:"card stack","aria-label":t("Skills"),ref:V,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,F)=>{let O=`${x}-${F}`;return e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:O,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:O,checked:A.carried,label:A.name,busy:M===A.name,disabled:A.builtin,onChange:(j)=>N(A.name,j)})]})},A.name)})}),e(Xe,{name:i,view:c,onApplied:W})]})}function Xe({name:i,view:h,onApplied:c}){let[w,M]=r(),[b,H]=r(),B=L();if(o(()=>{let N=!0;return de.skillGroups().then((A)=>N&&M(A.groups),()=>{return}),()=>{N=!1}},[]),!w?.length)return null;let x=new Set(h.skills.filter((N)=>N.carried).map((N)=>N.name)),V=new Set(h.skills.filter((N)=>N.builtin).map((N)=>N.name)),P=(N)=>N.skills.filter((A)=>!x.has(A)),W=(N)=>N.skills.filter((A)=>x.has(A)&&!V.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:w.map((N,A)=>{let F=P(N),O=F.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:N.name}),e("span",{className:"meta",children:O?t("Carries all of it."):t("Lacks {count}: {skills}",{count:F.length,skills:F.join(", ")})})]}),e(Qt,{id:`${B}-group-${A}`,checked:O,label:t("Skill group {name}",{name:N.name}),disabled:O&&W(N).length===0,onChange:(j)=>H({group:N,on:j})})]})},N.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:()=>H(void 0),onConfirm:async()=>{if(!b)return;let{added:N,removed:A}=await de.applySkillGroup(b.group.name,i,b.on);f(N.length?t("Switched on: {skills}",{skills:N.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:P(b.group).join(", ")}):t("{agent} will no longer carry: {skills}.",{agent:i,skills:W(b.group).join(", ")}):null})})]})}var Ye=()=>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 Je(i){let{profile:h,draft:c}=i,w=a(null);o(()=>w.current?.focus(),[]);let M=[];if(c.displayName!==h.displayName)M.push({label:t("Name"),before:h.displayName,after:c.displayName});let b=(H)=>H===U?Ce(h):H;if(c.model!==(h.model??U))M.push({label:t("Model"),before:b(h.model??U),after:b(c.model)});if(c.thinking!==(h.thinking??U))M.push({label:t("Thinking level"),before:pe(h.thinking??U),after:pe(c.thinking)});return n("section",{ref:w,className:"stack review",tabIndex:-1,"aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),M.length?e("ul",{className:"review-fields",children:M.map((H)=>n("li",{children:[e("strong",{children:H.label}),e("span",{className:"review-before",children:H.before}),e("span",{"aria-hidden":"true",children:"→"}),e("span",{className:"review-after",children:H.after})]},H.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 Qe=300000;function Me(){let i=Xs(),[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:Ls,children:e(et,{room:h.room,until:h.until},`${h.room}:${h.until}`)})}function et(i){se("archived-log",".archived-log .messages { padding: 0; }");let{timeZone:h}=_(),c=De(),[w,M]=r(),[b,H]=r(!1),[B,x]=r(),[V,P]=r(!1),{room:W,until:N}=i;o(()=>{let F=!0;return uo.page(W,N).then((O)=>{if(!F)return;M(O.messages),H(O.more)},(O)=>{if(F)x(l(O))}),()=>{F=!1}},[W,N]);let A=async()=>{let F=w?.[0];if(!F||V)return;P(!0);try{let O=await uo.page(W,N,F.id);M((j)=>[...O.messages,...j??[]]),H(O.more)}catch(O){x(l(O))}P(!1)};if(B)return e(m,{message:B});if(!w)return e(v,{});if(w.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:V,onClick:A,children:V?t("Loading…"):t("Load earlier messages")}):null,e("ol",{className:"messages",children:w.map((F,O)=>{let j=w[O-1],q=!j||j.kind!==F.kind||j.author!==F.author||Date.parse(F.at)-Date.parse(j.at)>Qe;return e(Ji,{message:F,character:F.agent?c[F.agent]:void 0,header:q,enter:!1,unread:!1,timeZone:h,quotable:!1},F.id)})})]})}var tt=`
|
|
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 xe(){let i=Is(),[h,c]=r(i);if(i&&i!==h)c(i);if(!h)return null;return se("select-text",tt),n(R,{open:i!==void 0,title:t("Select text"),size:"full",onClose:fo,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:fo,children:t("Close")}),e("button",{type:"button",onClick:()=>Zn(h.text),children:t("Copy all")})]})]})}function nt(i){let h=i.filter((M)=>M.parent!==void 0),c=i.filter((M)=>M.parent===void 0),w=new Set(c.map((M)=>M.name));return[...c.flatMap((M)=>[M,...h.filter((b)=>b.parent===M.name)]),...h.filter((M)=>!w.has(M.parent??""))]}function Le(){let[i,h]=r(),[c,w]=r(),[M,b]=r(),[H,B]=r(),x=E(async()=>{try{h((await ie.archive()).entries),w(void 0)}catch(P){w(l(P))}},[]);o(()=>{x()},[x]);let V=async(P)=>{b(P.name);try{if(P.kind==="agent")await ie.restoreAgent(P.name);else await ie.restoreGroup(P.name);await Ae(),f(t("Restored {name}.",{name:P.displayName})),await x()}catch(W){f(l(W),"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:nt(i).map((P)=>n("li",{className:"menu-item","data-helper":P.parent??void 0,style:P.parent?{paddingLeft:"var(--space-6)"}:void 0,children:[e("span",{className:"menu-icon",children:e(s,{name:P.kind==="agent"?"profile":"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:P.displayName}),n("span",{className:"meta",children:[P.parent?t("Temp knight of {name}",{name:P.parent}):P.kind==="agent"?t("Knight"):t("Group")," ","· ",P.name]})]}),e("button",{type:"button",className:"secondary compact",disabled:M===P.name,onClick:()=>V(P),children:t("Restore")}),e("button",{type:"button",className:"compact danger",disabled:M===P.name,onClick:()=>B(P),children:t("Delete")})]},`${P.kind}:${P.name}`))}),e(D,{open:H!==void 0,title:t("Delete {name}?",{name:H?.displayName??""}),confirmLabel:t("Delete"),tone:"danger",onClose:()=>B(void 0),onConfirm:async()=>{if(!H)return;if(H.kind==="agent")await ie.deleteAgent(H.name);else await ie.deleteGroup(H.name);await Ae(),f(t("Deleted {name}.",{name:H.displayName})),await x()},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:H?.displayName??""})})})]})}var Ie=/^[a-z0-9-]{1,32}$/,He=2,Pe=8,le="\x00";function at(){let i=d((h)=>h.order.flatMap((c)=>{let w=h.rooms[c]?.view;return w?.kind==="agent"&&!w.helper?[`${w.name}${le}${w.displayName}`]:[]}).join(`${le}${le}`));return C(()=>i===""?[]:i.split(`${le}${le}`).map((h)=>{let[c="",w=""]=h.split(le);return{name:c,displayName:w}}),[i])}function Re(i){let h=at(),[c,w]=r(),[M,b]=r(),[H,B]=r(""),[x,V]=r(""),[P,W]=r(!1),[N,A]=r([]),[F,O]=r(""),[j,q]=r(!1),[ae,Y]=r(i.name===void 0),ee=L(),Z=L();o(()=>{let G=i.name;if(G===void 0)return;let T=!0;return ie.group(G).then((z)=>{if(!T)return;w(z),B(z.displayName),A(z.members),O(z.host),Y(!0)},(z)=>T&&b(l(z))),()=>{T=!1}},[i.name]);let oe=(G)=>h.find((T)=>T.name===G)?.displayName??G,K=N.includes(F)?F:N[0]??"",re=c===void 0?!0:H.trim()!==c.displayName||N.join(",")!==c.members.join(",")||K!==c.host,te=H.trim()!==""&&N.length>=He&&N.length<=Pe&&(c!==void 0||Ie.test(x));if(M&&!ae)return e(m,{message:M});if(!ae)return e(v,{});let ne=async()=>{q(!0),b(void 0);try{if(c){await ie.updateGroup(c.name,{...H.trim()!==c.displayName?{displayName:H.trim()}:{},...N.join(",")!==c.members.join(",")?{members:N}:{},...K!==c.host?{host:K}:{}}),await Ae(),f(t("Saved.")),i.onDone();return}let G=await ie.createGroup({name:x,displayName:H.trim(),members:N,host:K});await Ae(),f(t("Made {name}.",{name:G.displayName})),i.onDone(),X("room",G.room)}catch(G){b(l(G))}finally{q(!1)}};return n("form",{className:"stack form",onSubmit:(G)=>{if(G.preventDefault(),te&&re&&!j)ne()},children:[n("label",{htmlFor:ee,children:[t("Name"),e("input",{id:ee,value:H,autoComplete:"off",onChange:(G)=>{if(B(G.target.value),!c&&!P)V(G.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32))}})]}),c?null:n("label",{htmlFor:Z,children:[t("Permanent name"),e("input",{id:Z,value:x,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":x!==""&&!Ie.test(x),onChange:(G)=>{W(!0),V(G.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((G)=>{let T=N.includes(G.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:T,disabled:!T&&N.length>=Pe,onChange:()=>A(T?N.filter((z)=>z!==G.name):[...N,G.name])}),e("span",{className:"menu-text",children:e("strong",{children:G.displayName})})]})},G.name)})})]}),N.length>=He?e(Bt,{label:t("Host"),value:K,onChange:O,options:N.map((G)=>({value:G,label:oe(G)}))}):null,M?e(m,{message:M}):null,n("div",{className:"actions",children:[c?e("button",{type:"button",className:"danger",onClick:()=>{i.onDone(),we({kind:"archive",room:c.room,name:c.displayName})},children:t("Archive group")}):null,e("button",{type:"submit",disabled:!te||!re||j,children:j?t("Saving…"):c?t("Save"):t("Make group")})]})]})}var ot=S(()=>(p("wf02eg0h"),import("./chunk-character-creator-wf02eg0h.js")).then((i)=>({default:i.CharacterCreator}))),$e=/^[a-z0-9-]{1,32}$/,ue="default";function st(i){let h=[];for(let c of i){let w=c.indexOf("/"),M=w>0?c.slice(0,w):"",b=h.find((H)=>H.provider===M&&M!=="");if(b)b.models.push(c);else h.push({provider:M,models:[c]})}return h}var rt=(i)=>i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32);function Fe({onDone:i}){let[h,c]=r(""),[w,M]=r(""),[b,H]=r(!1),[B,x]=r(""),[V,P]=r(ue),[W,N]=r(""),[A,F]=r(),[O,j]=r(!1),[q,ae]=r([]),[Y,ee]=r(),[Z,oe]=r(!1),K=[L(),L(),L(),L(),L()];o(()=>{let T=!0;return y.models().then((z)=>T&&ae(z.models),()=>{return}),()=>{T=!1}},[]);let re=C(()=>_n({name:w,displayName:h,prompt:B}),[w,h,B]),te=A?.spec??re,ne=$e.test(w)&&h.trim()!==""&&B.trim()!=="";if(O)return e(Q,{fallback:e(v,{}),children:e(ot,{name:w||"new",displayName:h,prompt:B,character:te,onPick:(T,z)=>{F({input:T,spec:z}),j(!1)},onCancel:()=>j(!1)})});let G=async()=>{oe(!0),ee(void 0);try{let T={name:w,displayName:h.trim(),prompt:B,...V!==ue?{model:V}:{},...W.trim()?{task:W.trim()}:{},...A?{character:A.input}:{}},z=await ie.createAgent(T);await Ae(),f(t("Made {name}.",{name:z.displayName})),i(),X("room",z.room)}catch(T){ee(T instanceof fe&&T.field?`${T.field}: ${l(T)}`:l(T))}finally{oe(!1)}};return n("form",{className:"stack form",onSubmit:(T)=>{if(T.preventDefault(),ne&&!Z)G()},children:[n("label",{htmlFor:K[0],children:[t("Name"),e("input",{id:K[0],value:h,autoComplete:"off",onChange:(T)=>{if(c(T.target.value),!b)M(rt(T.target.value))}})]}),n("label",{htmlFor:K[1],children:[t("Permanent name"),e("input",{id:K[1],value:w,autoComplete:"off",autoCapitalize:"none",spellCheck:!1,"aria-invalid":w!==""&&!$e.test(w),onChange:(T)=>{H(!0),M(T.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:K[2],children:[t("Prompt"),e("textarea",{id:K[2],rows:6,value:B,onChange:(T)=>x(T.target.value)}),e("span",{className:"meta",children:t("Its job, its sources, its limits and how it reports.")})]}),n("label",{htmlFor:K[4],children:[t("Model"),n(Te,{id:K[4],value:V,onChange:(T)=>P(T.target.value),children:[e("option",{value:ue,children:t("Default model")}),st(q).map((T)=>T.provider===""?T.models.map((z)=>e("option",{value:z,children:z},z)):e("optgroup",{label:T.provider,children:T.models.map((z)=>e("option",{value:z,children:z},z))},T.provider))]})]}),n("label",{htmlFor:K[3],children:[t("Opening task"),e("textarea",{id:K[3],rows:3,value:W,onChange:(T)=>N(T.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:te,name:w||"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:()=>j(!0),children:t("Choose a look")})]})]}),Y?e(m,{message:Y}):null,e("div",{className:"actions",children:e("button",{type:"submit",disabled:!ne||Z,children:Z?t("Making…"):t("Make knight")})})]})}var it=(i)=>i.kind==="new-agent"?t("New knight"):i.kind==="archive"?t("Archived"):i.name===void 0?t("New group"):t("Edit group");function Ge(){let i=rs(),h=a(i);if(i)h.current=i;let c=h.current,w=i!==void 0;if(o(()=>{if(!w)return;let M=window.location.href,b=()=>{if(window.location.href!==M)_i()};return window.addEventListener("popstate",b),window.addEventListener("hashchange",b),()=>{window.removeEventListener("popstate",b),window.removeEventListener("hashchange",b)}},[w]),!c)return null;return e(R,{open:i!==void 0,title:it(c),size:"wide",onClose:_i,children:e("div",{className:"stack agent-sheet",children:c.kind==="new-agent"?e(Fe,{onDone:_i}):c.kind==="archive"?e(Le,{}):e(Re,{...c.name===void 0?{}:{name:c.name},onDone:_i})},c.id)})}function Ve(){let i=$r(),h=a(!1);if(i)h.current=!0;return h.current?e(lt,{open:i}):null}function lt({open:i}){let h=_(),{now:c}=J(),w=d((b)=>cn(b).map(({id:H,card:B})=>{let x=b.rooms[B.room]?.view,V=x?.parent?b.rooms[x.parent]?.view:void 0;return{id:H,room:V?`${V.displayName} › ${x?.displayName??""}`:x?.displayName??B.room,title:B.frame.title,at:B.frame.at}})),M=w.length===0;return o(()=>{if(i&&M)Gi()},[i,M]),e(R,{open:i&&!M,title:t("Cards waiting"),onClose:Gi,children:e("ul",{className:"waiting-list",children:w.map((b)=>e("li",{children:n("button",{type:"button",onClick:()=>Zi(b.id),children:[e("strong",{children:b.title}),n("span",{className:"meta",children:[b.room,b.at?` · ${Se(b.at,c,h.timeZone)}`:""]})]})},b.id))})})}var mt=S(()=>(p("sbvrds1m"),import("./chunk-shortcut-help-sbvrds1m.js")));function ct(){let i=zo(),h=a(!1);if(i)h.current=!0;if(!h.current)return null;return e(Q,{fallback:null,children:e(mt,{open:i})})}function ha(){return n(g,{children:[e(vr,{}),e(Ee,{}),e(Ge,{}),e(Me,{}),e(xe,{}),e(Ve,{}),e(ct,{})]})}export{ha as SheetHosts};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{t,e,n}from"./chunk-index-wt2asefx.js";import{si,Do}from"./chunk-index-mg96sqpk.js";import{se}from"./chunk-index-amxa2bn3.js";import{R}from"./chunk-index-zdzzf3fp.js";var l=`
|
|
2
|
-
.shortcut-list {
|
|
3
|
-
display: grid;
|
|
4
|
-
grid-template-columns: max-content minmax(0, 1fr);
|
|
5
|
-
align-items: center;
|
|
6
|
-
gap: var(--space-3) var(--space-4);
|
|
7
|
-
margin: 0;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.shortcut-list dt {
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-wrap: wrap;
|
|
13
|
-
gap: var(--space-1);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.shortcut-list dd {
|
|
17
|
-
margin: 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.shortcut-list kbd {
|
|
21
|
-
display: inline-block;
|
|
22
|
-
min-width: 1.6rem;
|
|
23
|
-
text-align: center;
|
|
24
|
-
font-size: var(--text-sm);
|
|
25
|
-
}
|
|
26
|
-
`;function r(){let o=Do(),s=o?"⌥":"Alt",a=o?"⌘":"Ctrl";return[{keys:[s,"↑"],label:t("Previous room")},{keys:[s,"↓"],label:t("Next room")},{keys:[s,"Shift","↑"],label:t("Previous room with unread messages")},{keys:[s,"Shift","↓"],label:t("Next room with unread messages")},{keys:[a,"K"],label:t("Find a room")},{keys:["Esc"],label:t("Close the open menu or sheet, or leave the message box")},{keys:["?"],label:t("Show these shortcuts")}]}function i({open:o}){return se("shortcut-help",l),e(R,{open:o,title:t("Keyboard shortcuts"),onClose:si,children:n("div",{className:"stack",children:[e("dl",{className:"shortcut-list",children:r().map((s)=>n("div",{style:{display:"contents"},children:[e("dt",{children:s.keys.map((a)=>e("kbd",{children:a},a))}),e("dd",{children:s.label})]},s.label))}),e("p",{className:"meta",children:t("In a message box the arrow shortcuts switch rooms only when it is empty or the caret is at its very start (up) or very end (down).")})]})})}export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bi,x,X,Re,O,ot,wt}from"./chunk-index-wt2asefx.js";import{wr}from"./chunk-index-nsya88fn.js";import{go}from"./chunk-index-hef4gwtb.js";import{Xo,si,Io}from"./chunk-index-mg96sqpk.js";import{st}from"./chunk-index-7c9fn21n.js";function m(e,t){let{collapsed:o,expanded:r,current:s}=t,n=st(e,t.at),a=[],c=(i,d)=>{a.push({key:i,shown:d});let f=n.threads[i];if(!f)return;for(let l of f.open)a.push({key:l,shown:d});for(let l of f.closed)a.push({key:l,shown:d&&(r.has(l)||l===s)})};for(let i of n.home)c(i,!0);for(let i of n.pinned)c(i,!0);for(let i of n.folders){let d=!o.has(i.id)||s!==void 0&&i.rooms.includes(s);for(let f of i.rooms)c(f,d)}let u=n.folders.length>0?n.rest:[...n.restAgents,...n.restGroups];for(let i of u)c(i,!0);let{orphans:p}=n;for(let i of p.open)a.push({key:i,shown:!0});for(let i of p.closed)a.push({key:i,shown:r.has(i)||i===s});return a}function y(e,t,o,r){let s=o===1?-1:e.length;if(t!==void 0){if(s=e.findIndex((n)=>n.key===t),s<0)return}for(let n=s+o;n>=0&&n<e.length;n+=o){let a=e[n];if(a&&r(a))return a.key}return}var g=new Set(["","text","search","url","tel","email","password","number","date","datetime-local","month","time","week"]);function h(e){if(!(e instanceof HTMLElement))return;if(e instanceof HTMLTextAreaElement)return e;if(e instanceof HTMLSelectElement)return e;if(e instanceof HTMLInputElement)return g.has(e.type)?e:void 0;return e.closest('[contenteditable]:not([contenteditable="false"])')?e:void 0}function E(e,t){if(e instanceof HTMLSelectElement)return!1;if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement){if(e.value==="")return!0;let{selectionStart:n,selectionEnd:a}=e;if(n===null||a===null||n!==a)return!1;return t?n===0:n===e.value.length}if((e.textContent??"")==="")return!0;let o=window.getSelection();if(!o||o.rangeCount===0||!o.isCollapsed)return!1;let r=o.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 b(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 o=t==="ArrowUp",r=h(e.target);if(r&&!E(r,o))return;if(e.shiftKey)return o?"previous-unread":"next-unread";return o?"previous":"next"}if(t==="?"&&!e.ctrlKey&&!e.metaKey&&!e.repeat)return h(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 S=()=>document.querySelector('dialog[open], .action-popover, .switcher:not([data-state="closed"])')!==null;function w(e,t=12){let o=x("room",e),r=[...document.querySelectorAll('.room-row[aria-current="page"], .thread-link[aria-current="page"]')].find((s)=>s.getAttribute("href")===o);if(r)r.scrollIntoView?.({block:"nearest"});else if(t>0)requestAnimationFrame(()=>w(e,t-1))}function T(e,t){let o=O.getState(),r=bi(),s=r.pane==="room"?r.key:void 0,n=m(o,{at:(u)=>Re(o,u),collapsed:wr(),expanded:k(),current:s});if(r.pane==="room"&&!n.some((u)=>u.key===s))return;let c=y(n,s,e,t?(u)=>go(u.key)>0:(u)=>u.shown);if(c===void 0)return;X("room",c),w(c)}function v(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&&g.has(t.type))e.preventDefault(),t.blur()}function H(e,t){switch(e){case"escape":v(t);break;case"help":if(t.preventDefault(),Io())si();else if(!S())Xo();break;default:if(S())break;t.preventDefault(),T(e.startsWith("previous")?-1:1,e.endsWith("unread"))}}function U(){let e=(t)=>{let o=b(t);if(o)H(o,t)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}export{U as startShortcuts};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{p,Q,S,o,L,r,t,g,e,n,s,fe,l,f,v,m}from"./chunk-index-wt2asefx.js";import{de}from"./chunk-index-cttrqfm8.js";import{gt}from"./chunk-index-amspdq2j.js";import{R}from"./chunk-index-zdzzf3fp.js";var M=S(()=>(p("xp9hmeqt"),import("./chunk-prompt-history-xp9hmeqt.js")).then((d)=>({default:d.HistorySheet}))),B=`---
|
|
2
|
-
name: my-skill
|
|
3
|
-
description: "Use when "
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# My skill
|
|
7
|
-
|
|
8
|
-
`;function _(d){let{name:u}=d,[i,w]=r(),[h,b]=r(u?"":B),[y,I]=r(),[z,k]=r(!1),[C,x]=r(!1),[A,D]=r(!1),[H,N]=r(!1),T=L();o(()=>{if(!u)return;let a=!0;return de.skillDocument(u).then((c)=>{if(!a)return;w(c),b(c.text)},(c)=>a&&I(l(c))),()=>{a=!1}},[u]);let E=i?.text??"",U=h!==E,F=u!==void 0&&!i&&!y,V=async()=>{x(!0);try{if(i){let a=await de.saveSkillDocument(i.name,{text:h,baseHash:i.hash});w(a),b(a.text),k(!1),D(!1),f(t("Saved.")),d.onSaved()}else await de.createSkillDocument({text:h}),f(t("Skill created.")),d.onSaved(),d.onClose()}catch(a){if(a instanceof fe&&a.status===409){let{current:c}=a.body;w(c),D(!0)}else f(l(a),"danger")}finally{x(!1)}};return n(R,{open:!0,title:u??t("New skill"),size:"full",onClose:d.onClose,children:[y?e(m,{message:y}):null,F?e(v,{}):null,i&&!i.writable?e(m,{message:t("This skill cannot be edited here.")}):null,!F&&!y&&(!i||i.writable)?n("div",{className:"stack",children:[z?n("section",{className:"stack review","aria-label":t("Review changes"),children:[e("h3",{children:t("Review changes")}),A?e(m,{message:t("This skill changed while you were editing it. The changes below are against the version there now; save again to replace it, or go back to edit.")}):null,e(gt,{label:"SKILL.md",before:E,after:h}),n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:C,onClick:()=>k(!1),children:t("Back to editing")}),e("button",{type:"button",disabled:C,onClick:V,children:C?t("Saving…"):i?t("Save"):t("Create skill")})]})]}):n(g,{children:[n("div",{className:"field",children:[n("div",{className:"field-head",children:[e("label",{htmlFor:T,children:"SKILL.md"}),i?e("span",{className:"field-tools",children:n("button",{type:"button",className:"secondary compact","aria-haspopup":"dialog",onClick:()=>N(!0),children:[e(s,{name:"reset",size:16}),t("History")]})}):null]}),e("textarea",{id:T,className:"prompt-full",spellCheck:!1,value:h,onChange:(a)=>b(a.target.value)}),e("p",{className:"meta",children:t("Frontmatter holds the name, which cannot change, and a description that starts with “Use when”. The rest is the skill.")})]}),e("div",{className:"actions",children:e("button",{type:"button",disabled:!U||!h.trim(),onClick:()=>k(!0),children:t("Review changes")})})]}),H&&i?e(Q,{fallback:null,children:e(M,{open:H,title:t("History of {name}",{name:i.name}),load:async()=>{let{versions:a}=await de.skillHistory(i.name);return a.map((c,K)=>({id:c.id,text:c.text,previous:a[K+1]?.text??"",by:c.by,at:c.at}))},onUse:(a)=>{b(a),k(!1),N(!1)},onClose:()=>N(!1)})}):null]}):null]})}export{_ as SkillEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p,Xr,Q,S,o,r,t,g,e,n,s,y,l,f,v,m,k,T,Zt,Et}from"./chunk-index-wt2asefx.js";import{D}from"./chunk-index-y6p8j3zv.js";import{on}from"./chunk-index-2dhrqvba.js";import{xe}from"./chunk-index-ek98d2rn.js";import{de}from"./chunk-index-cttrqfm8.js";import{ne}from"./chunk-index-57teqgct.js";import"./chunk-index-zdzzf3fp.js";function x({source:a}){return e("div",{className:"prose document",children:e(Zt,{remarkPlugins:[Et],components:{a:({href:i,children:d})=>i&&/^https?:\/\//.test(i)?e("a",{href:i,target:"_blank",rel:"noreferrer",children:d}):e("span",{children:d}),img:({alt:i})=>e("span",{children:i}),pre:({children:i})=>e("div",{className:"code-block",children:e("pre",{children:i})}),table:({children:i})=>e("div",{className:"table-wrap",children:e("table",{children:i})})},children:a})})}function B(a){let{data:i,error:d,reload:c}=on(()=>de.skillGroups()),[w,u]=r(),[N,V]=r(),h=()=>{c(),a.onChanged()};return n("section",{className:"stack","aria-label":t("Skill groups"),children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skill groups")}),n("button",{type:"button",className:"secondary",onClick:()=>u({group:void 0}),children:[e(s,{name:"plus",size:16}),t("New group")]})]}),e("p",{className:"hint",children:t("A group lists skills to switch on for a knight in one step, from the knight's sheet. Knights carry the skills, not the group.")}),d?e(m,{message:d}):null,!i&&!d?e(v,{}):null,i?.groups.length===0?e(k,{children:t("No skill groups.")}):null,i?.groups.map((b)=>n("article",{className:"card skill-group",children:[n("div",{className:"card-head",children:[e("strong",{children:b.name}),e("button",{type:"button",className:"secondary",onClick:()=>u({group:b}),children:t("Edit")}),e("button",{type:"button",className:"secondary",onClick:()=>V(b),children:t("Delete")})]}),e("p",{children:b.description}),n("p",{className:"hint",children:[t("Skills"),": ",b.skills.join(", ")||t("None")]})]},b.name)),e(ne,{open:w!==void 0,title:w?.group?t("Edit {name}",{name:w.group.name}):t("New skill group"),onClose:()=>u(void 0),children:w?e(A,{group:w.group,catalog:a.catalog,onCancel:()=>u(void 0),onDone:()=>{u(void 0),h()}},w.group?.name??""):null}),e(D,{open:N!==void 0,title:t("Delete this skill group?"),confirmLabel:t("Delete group"),tone:"danger",onClose:()=>V(void 0),onConfirm:async()=>{if(!N)return;await de.deleteSkillGroup(N.name),f(t("Deleted {name}.",{name:N.name})),h()},children:e("p",{children:t("{name} will be deleted. Its skills stay, and so does every knight that carries them.",{name:N?.name??""})})})]})}function A(a){let[i,d]=r(a.group?.name??""),[c,w]=r(a.group?.description??""),[u,N]=r(a.group?.skills??[]),[V,h]=r(),[b,G]=r(!1);return n("form",{className:"stack",onSubmit:async(E)=>{E.preventDefault(),G(!0),h(void 0);try{let L=a.group?.name;await de.saveSkillGroup(i.trim(),{description:c,skills:[...a.catalog.map((F)=>F.name).filter((F)=>u.includes(F)),...u.filter((F)=>!a.catalog.some((z)=>z.name===F))],...L?{from:L}:{}}),f(t("Saved {name}.",{name:i.trim()})),a.onDone()}catch(L){h(l(L))}finally{G(!1)}},autoComplete:"off",children:[n("label",{children:[t("Name"),e("input",{value:i,maxLength:64,placeholder:"coding",required:!0,onChange:(E)=>d(E.target.value)}),e("span",{className:"meta",children:t("Lowercase letters, digits and single hyphens, up to 64.")})]}),n("label",{children:[t("Description"),e("textarea",{value:c,maxLength:1000,rows:2,required:!0,onChange:(E)=>w(E.target.value)})]}),n("fieldset",{className:"field",children:[e("legend",{children:t("Skills")}),e("ul",{className:"menu",children:a.catalog.map((E)=>{let L=u.includes(E.name);return e("li",{children:n("label",{className:"menu-item menu-toggle",children:[e("input",{type:"checkbox",checked:L,onChange:()=>N(L?u.filter((F)=>F!==E.name):[...u,E.name])}),n("span",{className:"menu-text",children:[e("strong",{children:E.name}),E.description?e("span",{className:"meta",children:E.description}):null]})]})},E.name)})})]}),V?e(m,{message:V}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:b,onClick:a.onCancel,children:t("Cancel")}),e("button",{type:"submit",disabled:b,children:t("Save group")})]})]})}var I=S(()=>(p("7xy09sq1"),import("./chunk-skill-editor-7xy09sq1.js")).then((a)=>({default:a.SkillEditor})));function ye(){let[a,i]=r(0),{data:d,error:c}=xe(()=>y.skills(),`skills:${a}`),[w,u]=r(),[N,V]=r(),[h,b]=r();o(()=>{y.session().then(u,()=>{return})},[]);let G=w?.skillEdit===!0;return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[e("h2",{children:t("Skills")}),G?n("button",{type:"button",className:"secondary",onClick:()=>V({name:void 0}),children:[e(s,{name:"plus",size:16}),t("New skill")]}):null]}),e("p",{className:"hint",children:G?t("Registered skills and their carriers. A skill a knight wrote can be edited here; the others are read-only."):t("Registered skills and their carriers; ask a knight on Discord to edit their contents.")}),c?e(m,{message:c}):null,!d&&!c?e(v,{}):null,d?.length===0?e(k,{children:t("No skills.")}):null,d?.map((C)=>e(R,{skill:C,onEdit:G&&C.source.kind==="written"?()=>V({name:C.name}):void 0,onDelete:G&&C.source.kind==="written"?()=>b(C):void 0},`${C.name}:${a}`)),G?e(B,{catalog:d??[],onChanged:()=>i((C)=>C+1)}):null,N?e(Q,{fallback:null,children:e(I,{name:N.name,onSaved:()=>i((C)=>C+1),onClose:()=>V(void 0)},N.name??"")}):null,e(D,{open:h!==void 0,title:t("Delete this skill?"),confirmLabel:t("Delete skill"),tone:"danger",onClose:()=>b(void 0),onConfirm:async()=>{if(!h)return;await de.deleteSkillDocument(h.name),i((C)=>C+1),f(t("Deleted {name}.",{name:h.name}))},children:h?e(M,{skill:h}):null})]})}function M({skill:a}){return n(g,{children:[e("p",{children:a.carriers.length?t("{name} will be deleted and taken from the knights that carry it: {carriers}.",{name:a.name,carriers:a.carriers.join(", ")}):t("{name} will be deleted. No knight carries it.",{name:a.name})}),a.groups.length?e("p",{children:t("It also leaves the skill groups {groups}.",{groups:a.groups.join(", ")})}):null,e("p",{children:t("This cannot be undone.")})]})}function O(a){switch(a.kind){case"builtin":return t("Built in with the release; it changes with the release.");case"package":return t("From the package {package}; it changes when the package is upgraded.",{package:a.package});case"linked":return t("Linked from {repo}; change it in its repository.",{repo:`${a.repo}:${a.path}`});default:return}}function R({skill:a,onEdit:i,onDelete:d}){let[c,w]=r(!1),[u,N]=r(),[V,h]=r(),b=a.source.kind==="builtin"?t("Built-in"):a.source.kind==="written"?t("Knight-written"):a.source.kind==="package"?a.source.package:`${a.source.repo}:${a.source.path}`;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.name}),e(T,{children:b}),a.missing?e(T,{tone:"warn",children:t("File missing")}):n(g,{children:[i?e("button",{type:"button",className:"secondary",onClick:i,children:t("Edit")}):null,e("button",{type:"button",className:"secondary",onClick:()=>{if(w(!0),!u)h(void 0),y.skill(a.name).then(N).catch((G)=>h(l(G)))},children:"SKILL.md"})]}),d?e("button",{type:"button",className:"secondary",onClick:d,children:t("Delete")}):null]}),e("p",{children:a.missing??a.description}),a.source.kind!=="written"?n("p",{className:"hint skill-lock",children:[e(s,{name:"lock",size:14}),e("span",{children:O(a.source)})]}):null,n("p",{className:"hint",children:[t("Carriers"),":"," ",a.source.kind==="builtin"?t("All knights"):a.carriers.join(", ")||t("None")]}),a.groups.length?n("p",{className:"hint",children:[t("Groups"),": ",a.groups.join(", ")]}):null,e(ne,{open:c,title:a.name,size:"wide",onClose:()=>w(!1),children:V?e(m,{message:V}):!u?e(v,{}):e(K,{title:a.name,detail:u})})]})}function K({title:a,detail:i}){let d=i.metadata.filter((c)=>!(c.key==="name"&&c.value===a));return n("div",{className:"skill-document",children:[d.length?e("dl",{className:"skill-meta",children:d.map((c)=>n(Xr,{children:[e("dt",{children:c.key}),e("dd",{children:c.value})]},c.key))}):null,e(x,{source:i.body})]})}export{ye as SkillsPage};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{t,g,e,n,s,d}from"./chunk-index-wt2asefx.js";import{Ns}from"./chunk-index-e2eeckhh.js";import{se}from"./chunk-index-amxa2bn3.js";var l=`
|
|
2
|
-
.line.start-over {
|
|
3
|
-
flex-wrap: wrap;
|
|
4
|
-
margin-top: var(--space-4);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.line.start-over .link-button {
|
|
8
|
-
min-height: 1.75rem;
|
|
9
|
-
font-size: inherit;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.start-over-empty {
|
|
13
|
-
margin-top: var(--space-6);
|
|
14
|
-
font-size: var(--text-sm);
|
|
15
|
-
}
|
|
16
|
-
`;function p(a){se("start-over",l);let{message:o}=a,i=d((m)=>{let r=m.rooms[o.room];return r?.messages.at(-1)?.id===o.id&&r.pending.length===0&&r.live.length===0});return n(g,{children:[n("li",{className:"line start-over","data-enter":a.enter||void 0,children:[e(s,{name:"reset",size:14}),e("span",{children:t("Conversation started over")}),e("button",{type:"button",className:"link-button",onClick:()=>Ns(o.room,o.id),children:t("View the archived conversation")})]}),i?e("li",{className:"line start-over-empty",children:e("span",{children:t("No messages yet. Say hello.")})}):null]})}export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jr,Kr,Jr}from"./chunk-index-pfs6rm6w.js";import"./chunk-index-aycxt14t.js";export{Kr as clearAcross,Jr as clearFinished,jr as dismissThread};
|