pi-roundtable-web 0.27.1 → 0.29.0
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 +53 -0
- package/README.md +25 -9
- package/dist/chunk-account-9616x405.js +1 -0
- package/dist/chunk-action-menu-q5y7xpry.js +1 -0
- package/dist/chunk-agent-x74xezyt.js +1 -0
- package/dist/chunk-arranged-rooms-9prq46vh.js +1 -0
- package/dist/chunk-bulk-actions-5dc4m9ad.js +1 -0
- package/dist/chunk-character-creator-wf02eg0h.js +1 -0
- package/dist/chunk-codeeditor-239ss6a2.js +2 -0
- package/dist/chunk-confirm-bhrx9195.js +1 -0
- package/dist/chunk-connectors-k77pd9by.js +37 -0
- package/dist/chunk-conversations-ftcpaqw1.js +1 -0
- package/dist/chunk-council-sheet-a5e6tspr.js +2 -0
- package/dist/chunk-council-view-6593rqbr.js +1 -0
- package/dist/chunk-drag-7873fvzw.js +1 -0
- package/dist/chunk-entry-5zmjxadx.js +1 -0
- package/dist/chunk-folder-list-h9hmbm8e.js +1 -0
- package/dist/chunk-folds-vxq86t1s.js +1 -0
- package/dist/chunk-gate-fa6za28z.js +1 -0
- package/dist/chunk-host-icons-y6frbzqt.js +1 -0
- package/dist/chunk-host-picture-fqg55rbr.js +1 -0
- package/dist/chunk-host-state-65tdhkyq.js +1 -0
- package/dist/chunk-host-ui-233kz7qp.js +1 -0
- package/dist/{chunk-index-j4x9dq30.css → chunk-index-1652v386.css} +1 -1
- package/dist/chunk-index-2c00zf3z.js +2 -0
- package/dist/chunk-index-2dhrqvba.js +2 -0
- package/dist/chunk-index-2s4bkrz3.js +2 -0
- package/dist/chunk-index-2ypaqwjy.js +2 -0
- package/dist/{chunk-index-k0z507h3.js → chunk-index-35zqk1zr.js} +2 -2
- package/dist/chunk-index-39qq37j5.js +2 -0
- package/dist/{chunk-index-j7pgphx3.js → chunk-index-3tjmyd1h.js} +2 -2
- package/dist/chunk-index-4eag6s50.js +2 -0
- package/dist/chunk-index-4jnn2g09.js +2 -0
- package/dist/{chunk-index-y60x5jbh.js → chunk-index-4krm48hm.js} +1 -1
- package/dist/{chunk-index-w42rcbx1.js → chunk-index-4re5prfp.js} +2 -2
- package/dist/chunk-index-57teqgct.js +2 -0
- package/dist/{chunk-index-3d8s3565.js → chunk-index-5ssncptg.js} +2 -2
- package/dist/{chunk-index-yrmqcay4.js → chunk-index-7c9fn21n.js} +2 -2
- package/dist/chunk-index-7k5895sn.js +14 -0
- package/dist/chunk-index-93f3e06v.js +2 -0
- package/dist/chunk-index-9m9v1p7s.js +2 -0
- package/dist/chunk-index-a8c0ap8g.js +2 -0
- package/dist/chunk-index-a8nqn3y0.js +3 -0
- package/dist/chunk-index-am7ghh75.js +120 -0
- package/dist/chunk-index-amspdq2j.js +4 -0
- package/dist/chunk-index-amxa2bn3.js +2 -0
- package/dist/{chunk-index-nsvwbjfe.js → chunk-index-aycxt14t.js} +2 -2
- package/dist/{chunk-index-n05yw5wd.js → chunk-index-bjeg3e2j.js} +2 -2
- package/dist/chunk-index-cttrqfm8.js +2 -0
- package/dist/chunk-index-dajanzxc.js +1 -0
- package/dist/chunk-index-e2eeckhh.js +2 -0
- package/dist/chunk-index-e46652wf.js +2 -0
- package/dist/chunk-index-ek98d2rn.js +2 -0
- package/dist/{chunk-index-f500nw4w.js → chunk-index-en5dm1zv.js} +2 -2
- package/dist/chunk-index-evhaaqzk.js +13 -0
- package/dist/chunk-index-f4gqzfkv.js +2 -0
- package/dist/{chunk-index-ak6ecqy3.js → chunk-index-gj3n4dh5.js} +2 -2
- package/dist/chunk-index-gp4chnp3.js +2 -0
- package/dist/{chunk-index-af4ebmkr.js → chunk-index-h2a42p6s.js} +3 -3
- package/dist/{chunk-index-4z4chg7v.js → chunk-index-haac6nbt.js} +2 -2
- package/dist/{chunk-index-3pnvpppa.js → chunk-index-hef4gwtb.js} +2 -2
- package/dist/chunk-index-mg96sqpk.js +2 -0
- package/dist/chunk-index-nsya88fn.js +1 -0
- package/dist/{chunk-index-ben4gv45.js → chunk-index-ntt3em2k.js} +1 -1
- package/dist/chunk-index-pcbkp62w.js +2 -0
- package/dist/chunk-index-pfs6rm6w.js +2 -0
- package/dist/chunk-index-pgxgq61x.js +2 -0
- package/dist/{chunk-index-9z13jw6q.js → chunk-index-q33ppq0j.js} +3 -3
- package/dist/chunk-index-r0hk9kyd.js +47 -0
- package/dist/{chunk-index-0ye10vk3.js → chunk-index-rr73h4kc.js} +3 -3
- package/dist/{chunk-index-983dmeaa.js → chunk-index-rtz4936v.js} +3 -3
- package/dist/chunk-index-smz90j6p.js +2 -0
- package/dist/chunk-index-teyx2hz7.js +2 -0
- package/dist/{chunk-index-sm7m4fej.js → chunk-index-v6h43553.js} +2 -2
- package/dist/chunk-index-vzqwn3wp.js +2 -0
- package/dist/chunk-index-wt2asefx.js +50 -0
- package/dist/chunk-index-x4tq9btg.js +2 -0
- package/dist/chunk-index-y6p8j3zv.js +2 -0
- package/dist/chunk-index-yvcdg5hh.js +2 -0
- package/dist/{chunk-index-afrhnrxj.js → chunk-index-zdzzf3fp.js} +2 -2
- package/dist/chunk-index-zeqfnkty.js +2 -0
- package/dist/chunk-index-zpwb8mkk.js +2 -0
- package/dist/chunk-lang-css-avzhvm72.js +1 -0
- package/dist/{chunk-lang-dockerfile-cnwqn660.js → chunk-lang-dockerfile-2p7e3ssz.js} +1 -1
- package/dist/{chunk-lang-go-yy6kgsxv.js → chunk-lang-go-zxp9k517.js} +3 -3
- package/dist/chunk-lang-html-red02gep.js +1 -0
- package/dist/chunk-lang-javascript-n33kmjcx.js +1 -0
- package/dist/chunk-lang-json-zmym50rg.js +1 -0
- package/dist/chunk-lang-markdown-ww2kcs85.js +6 -0
- package/dist/chunk-lang-python-ng1zdtd4.js +3 -0
- package/dist/chunk-lang-rust-6ynhxjdd.js +1 -0
- package/dist/{chunk-lang-shell-1rpgtepw.js → chunk-lang-shell-39t9bz2s.js} +1 -1
- package/dist/chunk-lang-sql-w875ejpg.js +2 -0
- package/dist/{chunk-lang-toml-tbj7467c.js → chunk-lang-toml-b8ckgkg5.js} +1 -1
- package/dist/chunk-lang-typescript-qf8acbb2.js +1 -0
- package/dist/chunk-lang-xml-bz91cjp1.js +1 -0
- package/dist/chunk-lang-yaml-g9zy0tdv.js +1 -0
- package/dist/chunk-layout-actions-fyzzzeyp.js +1 -0
- package/dist/chunk-menu-items-yvnk3vds.js +1 -0
- package/dist/chunk-mode-toggle-ccv271hm.js +1 -0
- package/dist/chunk-note-row-314py1pp.js +204 -0
- package/dist/chunk-notes-4rnrddzw.js +1 -0
- package/dist/chunk-notice-bell-z9wgamnz.js +1 -0
- package/dist/chunk-notices-mtn7pg1z.js +1 -0
- package/dist/chunk-onboarding-f3hhxgg4.js +1 -0
- package/dist/chunk-overview-qmepntrr.js +1 -0
- package/dist/chunk-palette-edkn1ypq.js +1 -0
- package/dist/chunk-placement-items-trsa5t23.js +1 -0
- package/dist/chunk-profile-pwfq0wns.js +1 -0
- package/dist/chunk-prompt-history-xp9hmeqt.js +1 -0
- package/dist/chunk-prompts-a56qvytg.js +1 -0
- package/dist/chunk-room-confirms-gqpkz4h0.js +1 -0
- package/dist/chunk-room-menu-1m2c2ekt.js +1 -0
- package/dist/chunk-rooms-menu-button-tcvda1gq.js +1 -0
- package/dist/chunk-schedules-kwnw7p8v.js +1 -0
- package/dist/{chunk-seat-menu-kwtjnpjj.js → chunk-seat-menu-m2n9nvv0.js} +1 -1
- package/dist/chunk-sheet-hosts-pr8xktyq.js +29 -0
- package/dist/{chunk-shortcut-help-g5cpqjjj.js → chunk-shortcut-help-sbvrds1m.js} +2 -2
- package/dist/chunk-shortcuts-8705p7q3.js +1 -0
- package/dist/chunk-skill-editor-7xy09sq1.js +8 -0
- package/dist/chunk-skills-cnc25x7q.js +1 -0
- package/dist/chunk-start-over-line-97zdd9pb.js +16 -0
- package/dist/chunk-switcher-list-ehsn2wsk.js +1 -0
- package/dist/{chunk-tab-dot-yse6wcfp.js → chunk-tab-dot-gkpe06q8.js} +1 -1
- package/dist/chunk-table-av3kh3tt.js +1 -0
- package/dist/chunk-table2d-5x3jptp9.js +1 -0
- package/dist/chunk-table3d-rsvajx7r.js +4220 -0
- package/dist/chunk-thread-actions-7xtkegwm.js +1 -0
- package/dist/{chunk-thread-cards-36rckyg7.js → chunk-thread-cards-grzszfha.js} +1 -1
- package/dist/chunk-thread-list-9bjjac3j.js +217 -0
- package/dist/chunk-transcript-t5szb8r0.js +1 -0
- package/dist/chunk-waiting-chip-d8b6a0p8.js +28 -0
- package/dist/chunk-waiting-ts3kxjvv.js +1 -0
- package/dist/chunk-where-3d3ncsa5.js +1 -0
- package/dist/chunk-workspace-ct6hvn0z.js +578 -0
- package/dist/chunk-zh-tw-v9v1eerm.js +1 -0
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +3 -3
- package/src/api-types.ts +137 -1
- package/src/app/app.ts +4 -7
- package/src/app/desk.ts +19 -4
- package/src/app/room-log.ts +66 -18
- package/src/app/rooms.ts +45 -7
- package/src/app/routes.ts +86 -11
- package/src/app/skill-doc-routes.ts +12 -2
- package/src/app/skill-group-routes.ts +126 -0
- package/src/app/surface.ts +26 -2
- package/src/app/team-routes.ts +3 -7
- package/src/authz.ts +2 -0
- package/src/cleanup-api.ts +9 -2
- package/src/connector-manage-api.ts +257 -0
- package/src/console-api.ts +60 -2
- package/src/features.ts +91 -0
- package/src/host/reads.ts +10 -1
- package/src/i18n/zh-tw.ts +137 -5
- package/src/push/channel.ts +1 -0
- package/src/web-plugin.ts +8 -1
- package/dist/chunk-account-83crfbn4.js +0 -1
- package/dist/chunk-action-menu-qw7h03x0.js +0 -1
- package/dist/chunk-agent-t1632ktv.js +0 -1
- package/dist/chunk-arranged-rooms-sb6tbsxw.js +0 -1
- package/dist/chunk-bulk-actions-v1g2bzk7.js +0 -1
- package/dist/chunk-character-creator-ye69w0kx.js +0 -1
- package/dist/chunk-codeeditor-5j6abj8k.js +0 -2
- package/dist/chunk-confirm-x8w877bz.js +0 -1
- package/dist/chunk-connectors-t7qbc6nk.js +0 -1
- package/dist/chunk-conversations-kmt6qzym.js +0 -1
- package/dist/chunk-council-sheet-bxvn7vza.js +0 -2
- package/dist/chunk-drag-03zgvd66.js +0 -1
- package/dist/chunk-entry-y5vwp5e5.js +0 -1
- package/dist/chunk-folder-list-h3vnjzpb.js +0 -1
- package/dist/chunk-folds-a3e22m7x.js +0 -1
- package/dist/chunk-gate-qzephvdv.js +0 -1
- package/dist/chunk-group-scene-w1ycabrm.js +0 -1
- package/dist/chunk-group-table-9nvmja8w.js +0 -1
- package/dist/chunk-host-icons-fccg3b2d.js +0 -1
- package/dist/chunk-host-picture-jaqz127q.js +0 -1
- package/dist/chunk-host-state-r01v1ywg.js +0 -1
- package/dist/chunk-host-ui-n54mh5af.js +0 -1
- package/dist/chunk-index-0a81da8z.js +0 -2
- package/dist/chunk-index-1kwp3spy.js +0 -2
- package/dist/chunk-index-47vq85ye.js +0 -2
- package/dist/chunk-index-5zmswz4s.js +0 -2
- package/dist/chunk-index-64rsz6pf.js +0 -2
- package/dist/chunk-index-6vcs0h0m.js +0 -2
- package/dist/chunk-index-6xqz6mg2.js +0 -2
- package/dist/chunk-index-83v0c9x6.js +0 -2
- package/dist/chunk-index-8xd6anam.js +0 -2
- package/dist/chunk-index-b73y2gc0.js +0 -47
- package/dist/chunk-index-bhqczxr3.js +0 -2
- package/dist/chunk-index-c44p8q87.js +0 -2
- package/dist/chunk-index-cbqhzf40.js +0 -13
- package/dist/chunk-index-db8zh8e6.js +0 -2
- package/dist/chunk-index-dvfkb699.js +0 -2
- package/dist/chunk-index-e02ddp46.js +0 -1
- package/dist/chunk-index-ebg48jgy.js +0 -2
- package/dist/chunk-index-ek5mek4j.js +0 -14
- package/dist/chunk-index-em7vndrb.js +0 -2
- package/dist/chunk-index-eq161yvp.js +0 -4
- package/dist/chunk-index-f5x2srr0.js +0 -2
- package/dist/chunk-index-fg42egv9.js +0 -50
- package/dist/chunk-index-h3v1d3nt.js +0 -2
- package/dist/chunk-index-kbgykazq.js +0 -2
- package/dist/chunk-index-n8ghdvxb.js +0 -2
- package/dist/chunk-index-p5jcwjx8.js +0 -2
- package/dist/chunk-index-qfgkfq86.js +0 -2
- package/dist/chunk-index-rcwdqn50.js +0 -7
- package/dist/chunk-index-s72hmse6.js +0 -2
- package/dist/chunk-index-sv9qpmhv.js +0 -1
- package/dist/chunk-index-x4enmj72.js +0 -2
- package/dist/chunk-index-xevnf9ew.js +0 -2
- package/dist/chunk-index-xx8jq73q.js +0 -2
- package/dist/chunk-index-ypkgw7gq.js +0 -2
- package/dist/chunk-lang-css-y9133ktr.js +0 -1
- package/dist/chunk-lang-html-r2xmryek.js +0 -1
- package/dist/chunk-lang-javascript-1r6wd177.js +0 -1
- package/dist/chunk-lang-json-dx56g11y.js +0 -1
- package/dist/chunk-lang-markdown-fpcf2dfq.js +0 -6
- package/dist/chunk-lang-python-zzp95955.js +0 -3
- package/dist/chunk-lang-rust-214fh7sp.js +0 -1
- package/dist/chunk-lang-sql-vvp46hpj.js +0 -2
- package/dist/chunk-lang-typescript-y5w4tt4g.js +0 -1
- package/dist/chunk-lang-xml-tbcqmedk.js +0 -1
- package/dist/chunk-lang-yaml-jh56t3sv.js +0 -1
- package/dist/chunk-layout-actions-8dzvysym.js +0 -1
- package/dist/chunk-menu-items-3jhya205.js +0 -2
- package/dist/chunk-mode-toggle-js49gvpd.js +0 -1
- package/dist/chunk-note-row-kv061030.js +0 -75
- package/dist/chunk-notes-sdkqz5hr.js +0 -1
- package/dist/chunk-notice-bell-r012f2zy.js +0 -1
- package/dist/chunk-notices-h4rk1zxc.js +0 -1
- package/dist/chunk-onboarding-a18cvkph.js +0 -1
- package/dist/chunk-overview-ynaqn4fp.js +0 -1
- package/dist/chunk-palette-jm79gb5q.js +0 -1
- package/dist/chunk-placement-items-mwm9q1zn.js +0 -1
- package/dist/chunk-profile-ajw6pp4r.js +0 -1
- package/dist/chunk-prompt-history-zcfvr3r8.js +0 -1
- package/dist/chunk-prompts-m5rzdk24.js +0 -1
- package/dist/chunk-room-confirms-ftsj15ja.js +0 -1
- package/dist/chunk-room-menu-b9ktw9pw.js +0 -1
- package/dist/chunk-rooms-menu-button-qe62t6nx.js +0 -1
- package/dist/chunk-schedules-t8yxnf8q.js +0 -1
- package/dist/chunk-sheet-hosts-yj5wszgj.js +0 -1
- package/dist/chunk-shortcuts-9ft5sqdw.js +0 -1
- package/dist/chunk-skill-editor-xdfq2708.js +0 -8
- package/dist/chunk-skills-9wa4mwdc.js +0 -1
- package/dist/chunk-switcher-list-vpg6wvtw.js +0 -1
- package/dist/chunk-table-1y76m54h.js +0 -1
- package/dist/chunk-table2d-g57vr6h0.js +0 -1
- package/dist/chunk-table3d-cv6069hy.js +0 -4220
- package/dist/chunk-thread-actions-xjhpdjk7.js +0 -1
- package/dist/chunk-thread-list-fd6agz77.js +0 -217
- package/dist/chunk-transcript-5nfn3r35.js +0 -1
- package/dist/chunk-where-ha8pc3cg.js +0 -1
- package/dist/chunk-workspace-e85twv32.js +0 -578
- package/dist/chunk-zh-tw-z5p5mpph.js +0 -1
|
@@ -0,0 +1,204 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,r,t,e,n,s,l,m,k,T}from"./chunk-index-wt2asefx.js";import"./chunk-index-0q15ysrb.js";import{Oi,Ho,jo}from"./chunk-index-35zqk1zr.js";import"./chunk-index-e46652wf.js";function g(a,u){let i=Math.max(0,Math.round((u-Date.parse(a))/60000));if(i<1)return t("just now");if(i<60)return t("{count} min ago",{count:i});let c=Math.round(i/60);if(c<24)return t("{count} h ago",{count:c});return t("{count} d ago",{count:Math.round(c/24)})}function f({notice:a}){let[u,i]=r(!1),[c,d]=r();return n("li",{className:"card stack notice","data-urgent":a.urgency==="high"||void 0,children:[n("div",{className:"card-head",children:[e("strong",{children:a.title}),a.urgency==="high"?e(T,{tone:"warn",children:t("Urgent")}):null]}),a.body?e("p",{children:a.body}):null,e("p",{className:"meta",children:g(a.raisedAt,Date.now())}),c?e(m,{message:c}):null,n("div",{className:"actions",children:[a.open?e("a",{className:"button",href:jo(a.open),children:t("Open")}):null,a.ackable?a.acked?n("span",{className:"meta",children:[e(s,{name:"check",size:14})," ",t("Handled")]}):e("button",{type:"button",className:"secondary",disabled:u,onClick:async()=>{i(!0),d(void 0);try{await Ho(a.tag)}catch(p){d(l(p))}finally{i(!1)}},children:t("Handled")}):null]})]})}function M(){let{notices:a,known:u}=Oi(),[,i]=r(0);return o(()=>{let c=setInterval(()=>i((d)=>d+1),60000);return()=>clearInterval(c)},[]),n("div",{className:"page",children:[e("header",{className:"page-head",children:e("h1",{children:t("Notices")})}),a.length===0?e(k,{children:u?t("Nothing needs you."):t("Loading…")}):e("ul",{className:"stack notices",children:a.map((c)=>e(f,{notice:c},c.tag))})]})}export{M as NoticesPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E,o,a,r,t,g,e,n,s,x,l,v,m,Bn,sr}from"./chunk-index-wt2asefx.js";import{D}from"./chunk-index-y6p8j3zv.js";import"./chunk-index-0q15ysrb.js";import{Xn,un}from"./chunk-index-bjeg3e2j.js";import"./chunk-index-zdzzf3fp.js";import{pe}from"./chunk-index-e46652wf.js";var F=90000,A=2000,C=()=>typeof matchMedia==="function"&&(matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0),z=()=>/iPhone|iPad/.test(navigator.userAgent);function H({step:i,view:w,refresh:p}){let[c,u]=r(),[d,h]=r(i.done?"arrived":"idle"),[k,b]=r(),[S,y]=r(!1),[V,T]=r(!1),N=a(void 0);o(()=>(Bn().then(u,()=>u("unsupported")),()=>clearTimeout(N.current)),[]),o(()=>{if(i.done)h("arrived")},[i.done]);let I=E((f)=>{let P=async()=>{if((await p())?.steps.find((_)=>_.id===i.id)?.done){h("arrived");return}if(Date.now()-f>F){h("late");return}N.current=setTimeout(P,A)};N.current=setTimeout(P,A)},[p,i.id]),L=async()=>{y(!0),b(void 0),h("sending");try{await pe.pushTest(),h("waiting"),I(Date.now())}catch(f){h("idle"),b(l(f))}finally{y(!1)}},M=async()=>{y(!0),b(void 0);try{await sr(),u(await Bn()),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 Bn().catch(()=>"unsupported"))}finally{y(!1)}},O=c==="unsupported"&&z()&&!C();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:un(i)}),n("ol",{className:"steps",children:[n("li",{"data-done":c==="on"||O===!1||void 0,children:[e("strong",{children:t("Put the app on your phone")}),e("span",{className:"meta",children:O?t("On iPhone and iPad, open this page in Safari, tap Share, then Add to Home Screen, and open the app from there."):C()?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:S||c===void 0,onClick:M,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:S||c!=="on"||d==="waiting",onClick:L,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:()=>T(!0),children:t(i.waiver.label)}),e(D,{open:V,title:t(i.waiver.label),confirmLabel:t("Skip"),onClose:()=>T(!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(H,{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:x(d.open.page),children:t("Open")})]}),e("p",{className:"meta",children:un(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,t,u,g,e,n,x,y,l,v,m,k,T,_,Se,re,Le,ji,mn,Si,J}from"./chunk-index-wt2asefx.js";import{xe}from"./chunk-index-ek98d2rn.js";import{ne}from"./chunk-index-57teqgct.js";import"./chunk-index-zdzzf3fp.js";function f(a){let{cleanup:i}=_(),[c,p]=r(),[d,o]=r(!1),[h,s]=r();if(!i)return null;let b=()=>{if(!d)p(void 0),s(void 0)};return n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",onClick:()=>p("start-over"),children:t("Start over")}),a.deletable?e("button",{type:"button",className:"danger",onClick:()=>p("delete"),children:t("Delete")}):null,n(ne,{open:c!==void 0,title:c==="delete"?t("Permanently delete {name}?",{name:a.title}):t("Start over {name}?",{name:a.title}),onClose:b,children:[e("p",{children:c==="delete"?t("The live conversation and all archives will be permanently deleted. Memory and schedules are preserved."):t("The current conversation will be archived; the next message starts a new one. Long-term memory is preserved. Active turns finish first.")}),h?e(m,{message:h}):null,n("div",{className:"actions",children:[e("button",{type:"button",className:"secondary",disabled:d,onClick:b,children:t("Cancel")}),e("button",{type:"button",className:c==="delete"?"danger":"",disabled:d,onClick:async()=>{if(!c)return;o(!0),s(void 0);try{if(c==="delete")await y.deleteConversation(a.channel);else await y.startOver(a.channel);p(void 0),a.refresh()}catch(I){s(l(I))}finally{o(!1)}},children:d?c==="delete"?t("Deleting…"):a.busy?t("Waiting for this turn…"):t("Starting over…"):c==="delete"?t("Delete permanently"):t("Start over")})]})]})]})}function Q(){let a=_(),{now:i}=J(),[c,p]=r(0),d=()=>p((s)=>s+1),{data:o,error:h}=xe(()=>y.overview(),`overview:${c}`);if(!o)return h?e(m,{message:h}):e(v,{});return n(g,{children:[h?e(m,{message:h}):null,n("section",{className:"stack",children:[e("h2",{children:t("Bot server")}),e("p",{className:"hint",children:t("Knight and group status; starting over archives the conversation and preserves memory.")}),o.agents.length+o.groups.length===0?e(k,{children:t("No knights.")}):null,o.agents.map((s)=>e(A,{agent:s,groups:o.groups,agents:o.agents,guildId:o.guildId,now:i,refresh:d},s.name)),o.groups.map((s)=>e(C,{group:s,guildId:o.guildId,now:i,timeZone:a.timeZone,refresh:d},s.name))]}),n("section",{className:"stack",children:[e("h2",{children:t("My workspaces")}),e("p",{className:"hint",children:t("Direct messages and channels where you mention a knight. Start over archives; delete removes every archive permanently.")}),o.workspaces?.length?o.workspaces.map((s)=>e(N,{conversation:s,schedules:s.schedules,now:i,refresh:d},s.key)):e(k,{children:t("No workspaces.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Outside AI client conversations")}),e("p",{className:"hint",children:t("Conversations opened through remote MCP; after deletion the session ID cannot be resumed.")}),o.outside?.length?o.outside.map((s)=>e(N,{conversation:s,now:i,refresh:d},s.key)):e(k,{children:t("No outside AI client conversations.")})]}),n("section",{className:"stack",children:[e("h2",{children:t("Party channels")}),e("p",{className:"hint",children:t("Starting over stops the container and archives role conversations; each speaker's memory is preserved.")}),o.party?.length?o.party.map((s)=>e(B,{party:s,now:i,refresh:d},s.key)):e(k,{children:t("No party channels.")})]})]})}function w({busy:a}){return e(T,{tone:a?"busy":"plain",children:a===0?t("idle"):a===1?t("Working"):t("Working, {count} waiting",{count:a-1})})}function C(a){let{group:i,now:c,timeZone:p}=a;return n("article",{className:"card",children:[n("div",{className:"card-head",children:[i.channelId?e("a",{href:Si(i.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:i.displayName}):e("strong",{children:i.displayName}),e(T,{children:t("Group")}),e(w,{busy:i.busy})]}),e("p",{children:t("Members: {members} | Host: {host}",{members:i.members.join(", "),host:i.host})}),n("p",{className:"hint",children:[t("Last active")," ",Se(i.lastActive,c,p)]}),i.room||i.channelId?e(f,{channel:i.room??`discord:${i.channelId}`,title:i.displayName,busy:i.busy>0,refresh:a.refresh}):null]})}function A(a){let{agent:i}=a,{timeZone:c,panes:p}=_(),d=a.groups.find((s)=>s.channelId===i.workingIn),o=a.agents.find((s)=>s.channelId===i.workingIn),h=!i.workingIn?void 0:i.workingIn===i.channelId?t("Working in own channel"):d?t("Working in group {name}",{name:d.displayName}):o?t("Replying in {name}'s channel",{name:o.displayName}):t("Replying in another channel");return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:i.channelId?e("a",{href:Si(i.channelId,a.guildId),target:"_blank",rel:"noreferrer",children:i.displayName}):i.displayName}),e(T,{children:"agent"}),i.workingIn?e(w,{busy:1+i.waiting}):i.waiting>0?e(T,{tone:"busy",children:t("{count} waiting",{count:i.waiting})}):e(T,{children:t("idle")})]}),h?e("p",{children:h}):null,n("dl",{className:"facts",children:[n("div",{children:[e("dt",{children:t("Model")}),n("dd",{children:[i.model," · thinking ",i.thinking]})]}),n("div",{children:[e("dt",{children:t("Context")}),e("dd",{children:i.context?i.context.tokens===null?t("Just compacted (limit {limit})",{limit:ji(i.context.contextWindow)}):`${ji(i.context.tokens)} / ${ji(i.context.contextWindow)} (${Math.round(i.context.tokens/i.context.contextWindow*100)}%)`:"—"})]}),n("div",{children:[e("dt",{children:t("Schedules")}),e("dd",{children:i.schedules})]}),n("div",{children:[e("dt",{children:t("Last active")}),e("dd",{children:Se(i.lastActive,a.now,c)})]})]}),i.room||i.channelId?e(f,{channel:i.room??`discord:${i.channelId}`,title:i.displayName,busy:!!i.workingIn||i.waiting>0,refresh:a.refresh}):null,i.channelId&&p.includes("conversations")?e("a",{href:x("conversations",`discord:${i.channelId}`),children:t("transcript")}):null]})}function N({conversation:a,schedules:i,now:c,refresh:p}){let{timeZone:d,panes:o}=_(),{title:h,detail:s}=a.kind==="outside"?{title:a.firstMessage||t("(No messages)"),detail:a.id}:mn(a.channel,a.id);return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel&&a.channel.kind!=="gone"?e("a",{href:Si(a.id,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:h}):h}),e(w,{busy:a.busy})]}),s?e("p",{className:"hint",children:s}):null,e("p",{children:a.liveBytes>0?t("Conversation {size} · Archives {count}",{size:Le(a.liveBytes),count:a.archives}):t("No live conversation · Archives {count}",{count:a.archives})}),a.startedAt?n("p",{children:[t("Started")," ",re(a.startedAt,d)]}):null,n("p",{className:"hint",children:[i!==void 0?`${t("Schedules")} ${i} · `:"",t("Last active")," ",Se(a.lastActive,c,d)]}),e(f,{channel:a.key,title:h,busy:a.busy>0,deletable:!0,refresh:p}),o.includes("conversations")?e("a",{href:x("conversations",a.key),children:t("transcript")}):null]})}function B({party:a,now:i,refresh:c}){let{timeZone:p}=_(),{title:d,detail:o}=mn(a.channel,a.channelId),h={running:u("Container running"),stopped:u("Container stopped"),missing:u("No container yet"),unknown:u("Container status unknown")};return n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.channel.kind!=="gone"?e("a",{href:Si(a.channelId,a.channel.kind==="guild"?a.channel.guildId:void 0),target:"_blank",rel:"noreferrer",children:d}):d}),e(T,{children:a.profile}),e(T,{children:t(h[a.container])}),e(w,{busy:a.busy})]}),o?e("p",{className:"hint",children:o}):null,e("p",{children:t("Enabled by {name} at {time}",{name:a.enabledBy,time:re(a.enabledAt,p)})}),n("p",{className:"hint",children:[t("Last active")," ",Se(a.lastActive,i,p)]}),e(f,{channel:a.key,title:d,busy:a.busy>0,refresh:c})]})}export{Q as OverviewPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,C,a,r,t,e,n,s,x,X,d,ot,he}from"./chunk-index-wt2asefx.js";import{hi}from"./chunk-index-gj3n4dh5.js";import{R}from"./chunk-index-zdzzf3fp.js";function I(m){let[f,v]=r(""),[p,h]=r(0),g=a(null),b=d((l)=>l.order.flatMap((i)=>{let c=l.rooms[i]?.view;return c?[{key:i,name:c.displayName,agent:c.name,character:c.character,kind:c.kind}]:[]})),u=C(()=>[...b.map((i)=>({id:i.key,label:i.name,hint:i.kind==="agent"?t("Knight"):i.kind==="group"?t("Group"):t("Thread"),room:!0,...i.kind==="agent"?{avatar:{name:i.agent,character:i.character}}:{icon:"conversations"},go:()=>X("room",i.key)})),...m.pages.map((i)=>({id:i.pane,label:i.label,hint:t("Page"),icon:i.icon,go:()=>X(i.pane)}))].flatMap((i)=>{let c=hi(f,i.label);return c===void 0?[]:[{target:i,score:c}]}).sort((i,c)=>c.score-i.score).map((i)=>i.target).slice(0,12),[b,m.pages,f]);o(()=>h(0),[f]),o(()=>{if(m.open)v(""),requestAnimationFrame(()=>g.current?.focus())},[m.open]);let y=(l)=>{if(!l)return;m.onClose(),l.go()};return e(R,{open:m.open,title:t("Find a room"),onClose:m.onClose,variant:"palette",children:n("div",{className:"palette-box",children:[n("div",{className:"palette-input",children:[e(s,{name:"search",size:18}),e("input",{ref:g,value:f,placeholder:t("Find a room or page"),"aria-label":t("Find a room or page"),role:"combobox","aria-expanded":"true","aria-controls":"palette-list","aria-activedescendant":u[p]?`palette-${p}`:void 0,onChange:(l)=>v(l.target.value),onKeyDown:(l)=>{if(ot(l.nativeEvent))return;if(l.key==="ArrowDown")l.preventDefault(),h((i)=>Math.min(u.length-1,i+1));else if(l.key==="ArrowUp")l.preventDefault(),h((i)=>Math.max(0,i-1));else if(l.key==="Enter")l.preventDefault(),y(u[p])}}),e("kbd",{children:"Esc"})]}),n("ul",{className:"palette-list",children:[u.length===0?e("li",{className:"palette-empty",children:t("Nothing matches.")}):null,u.map((l,i)=>e("li",{"data-active":i===p||void 0,children:n("a",{href:l.room?x("room",l.id):x(l.id),onClick:(c)=>{c.preventDefault(),y(l)},onMouseMove:()=>h(i),"aria-current":i===p?"true":void 0,children:[l.avatar?e(he,{spec:l.avatar.character,name:l.avatar.name,size:28,live:!1}):e("span",{className:"palette-icon",children:e(s,{name:l.icon??"list",size:16})}),e("span",{className:"palette-label",children:l.label}),e("span",{className:"meta",children:l.hint})]})},l.id))]})]})})}export{I as Palette};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E,o,a,r,t,u,g,e,n,s,y,l,v,m,T,ar}from"./chunk-index-wt2asefx.js";import{D}from"./chunk-index-y6p8j3zv.js";import"./chunk-index-0q15ysrb.js";import"./chunk-index-zdzzf3fp.js";import{pe}from"./chunk-index-e46652wf.js";var B=3000;function R({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(U[i.tier])]}):null]})]})}function O({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})},B),()=>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(T,{tone:"warn",children:t("Required")}):i.step==="nudge"?e(T,{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 z(){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 F({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(R,{profile:d}):e("p",{className:"meta",children:t("Signed in as {name}.",{name:i.principal.name})}),e(ar,{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(O,{link:w,labels:Object.fromEntries(p.links.map((k)=>[k.provider,k.label])),changed:V},w.provider))})]}):null,d?e(F,{profile:d,changed:c}):null,i.push?e(z,{}):null]})}var U={owner:u("Owner"),admin:u("Admin"),member:u("Member")};export{H as ProfilePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,r,t,e,n,l,v,m,k,T,_,re}from"./chunk-index-wt2asefx.js";import{gt}from"./chunk-index-amspdq2j.js";import{R}from"./chunk-index-zdzzf3fp.js";function U(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:re(s.at,N)})]}),s.revert?e(T,{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{U as HistorySheet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,Q,S,E,o,L,r,t,u,g,e,n,s,fe,l,f,v,m,k,T,_,re}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={"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.")},C=(c)=>t(M[c]??c);var O=S(()=>(p("xp9hmeqt"),import("./chunk-prompt-history-xp9hmeqt.js")).then((c)=>({default:c.HistorySheet}))),Z=S(()=>(p("bhrx9195"),import("./chunk-confirm-bhrx9195.js")).then((c)=>({default:c.Confirm})));function pe(){let{timeZone:c}=_(),[N,i]=r(),[h,w]=r(),[b,x]=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,!N&&!h?e(v,{}):null,N?.length===0?e(k,{children:t("No prompts to edit.")}):null,N?.map((d)=>n("article",{className:"card stack",children:[n("div",{className:"card-head",children:[e("strong",{children:C(d.label)}),d.differs?e(T,{tone:"warn",children:t("Differs from the file version")}):null,d.broken?e(T,{tone:"warn",children:t("File version cannot be read")}):null]}),d.description?e("p",{children:C(d.description)}):null,d.override?e("p",{className:"hint",children:t("Set by {name}, {time}",{name:d.override.by,time:re(d.override.at,c)})}):null,e("div",{className:"actions",children:e("button",{type:"button",onClick:()=>x(d.id),children:t("Edit")})})]},d.id)),b?e(q,{id:b,onClose:()=>{x(void 0),P()}}):null]})}function q({id:c,onClose:N}){let[i,h]=r(),[w,b]=r(""),[x,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?C(i.label):t("Main prompts"),size:"full",onClose:N,children:[x?e(m,{message:x}):null,!i&&!x?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(T,{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(Q,{fallback:null,children:e(O,{open:F,title:t("History of {name}",{name:C(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(Q,{fallback:null,children:e(Z,{open:z,title:t("Revert {name} to the file version?",{name:C(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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,r,t,g,e,n,s,x,d,_,Ye,$t,we,kt}from"./chunk-index-wt2asefx.js";import{Xe}from"./chunk-index-smz90j6p.js";import"./chunk-index-4krm48hm.js";import{Qt}from"./chunk-index-3tjmyd1h.js";import{R}from"./chunk-index-zdzzf3fp.js";import{en}from"./chunk-index-pcbkp62w.js";var h="room-menu-yolo",N="room-menu-long",b="room-menu-mute";function P(a){let[l,m]=r(!1),i=_().app?.modes!==!1,f=d((o)=>o.rooms[a.room]?.view?.home===!1,a.room),u=d((o)=>o.pins.includes(a.room),a.room),c=a.mode??{yolo:!1,longRunning:!1},k=async(o)=>{m(!0),await $t(a.room,{longRunning:o}),m(!1)};return e(R,{open:a.open,title:t("Room menu"),onClose:a.onClose,children:n("ul",{className:"menu",children:[a.readOnly?e("li",{children:a.parent?n("a",{className:"menu-item menu-link",href:x("room",a.parent),onClick:a.onClose,children:[e("span",{className:"menu-icon",children:e(s,{name:"rooms"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Open the parent room")}),e("span",{className:"meta",children:t("Reply to the knight that started this thread.")})]}),e(s,{name:"chevron",size:16})]}):e("p",{className:"meta",children:t("A thread has no settings.")})}):null,a.readOnly?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:b,children:[e("span",{className:"menu-icon",children:e(s,{name:a.muted?"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:b,checked:!a.muted,label:t("Notifications"),onChange:async(o)=>{m(!0),await en(a.room,!o),m(!1)},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:h,children:[e("span",{className:"menu-icon","data-tone":"yolo",children:e(s,{name:"bolt"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Yolo mode")}),e("span",{className:"meta",children:t("Approve held actions in this room without asking. Risky ones still ask.")})]}),e(Qt,{id:h,checked:c.yolo,label:t("Yolo mode"),onChange:(o)=>{if(o)a.onAskYolo();else m(!0),$t(a.room,{yolo:!1}).then(()=>m(!1))},busy:l})]})}),a.readOnly||!i?null:e("li",{children:n("label",{className:"menu-item menu-toggle",htmlFor:N,children:[e("span",{className:"menu-icon","data-tone":"long",children:e(s,{name:"timer"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Long-running mode")}),e("span",{className:"meta",children:t("Let turns go on past their time limit, up to the host's cap. Questions still wait for you.")})]}),e(Qt,{id:N,checked:c.longRunning,label:t("Long-running mode"),onChange:k,busy:l})]})}),a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Ye(a.agent)},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit knight")}),e("span",{className:"meta",children:t("Name, prompt, model and picture")})]}),e(s,{name:"chevron",size:16})]})}):null,a.agent?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Ye(a.agent,{skills:!0})},children:[e("span",{className:"menu-icon",children:e(s,{name:"skills"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Skills")}),e("span",{className:"meta",children:t("Choose the skills this knight carries.")})]}),e(s,{name:"chevron",size:16})]})}):null,a.group?e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),kt({kind:"group",name:a.group})},children:[e("span",{className:"menu-icon",children:e(s,{name:"profile"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Edit group")}),e("span",{className:"meta",children:t("Name, members and host")})]}),e(s,{name:"chevron",size:16})]})}):null,a.readOnly||!f?null:n(g,{children:[e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),(p("fyzzzeyp"),import("./chunk-layout-actions-fyzzzeyp.js")).then((o)=>o.pinRoom(a.room,!u))},children:[e("span",{className:"menu-icon",children:e(s,{name:"pin"})}),n("span",{className:"menu-text",children:[e("strong",{children:u?t("Unpin"):t("Pin")}),e("span",{className:"meta",children:t("Keep this room at the top of the list.")})]})]})}),e("li",{children:n("button",{type:"button",className:"menu-item menu-link","aria-haspopup":"dialog",onClick:()=>{a.onClose(),Xe({kind:"move",room:a.room})},children:[e("span",{className:"menu-icon",children:e(s,{name:"folder"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Move to folder…")}),e("span",{className:"meta",children:t("Put this room in a folder, or take it out.")})]}),e(s,{name:"chevron",size:16})]})})]}),a.readOnly?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:a.onAskStartOver,children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"reset"})}),n("span",{className:"menu-text",children:[e("strong",{children:t("Start over")}),e("span",{className:"meta",children:t("Archive this conversation and begin a new one. Memory stays.")})]})]})}),a.readOnly||a.coordinator?null:e("li",{children:n("button",{type:"button",className:"menu-item menu-link",onClick:()=>{a.onClose(),we({kind:"archive",room:a.room,name:a.displayName??""})},children:[e("span",{className:"menu-icon","data-tone":"danger",children:e(s,{name:"archive"})}),n("span",{className:"menu-text",children:[e("strong",{children:a.group?t("Archive group"):t("Archive knight")}),e("span",{className:"meta",children:t("It stops answering. The history is kept and it can be restored.")})]})]})})]})})}export{P as RoomMenu};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,t,u,e,n,s,x,y,f,v,m,k,T,_,re}from"./chunk-index-wt2asefx.js";import{D}from"./chunk-index-y6p8j3zv.js";import{xe}from"./chunk-index-ek98d2rn.js";import"./chunk-index-zdzzf3fp.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 W(){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(T,{children:a.lastStatus}):null]}),n("p",{className:"meta",children:[w(a.recurrence)," ·"," ",t("next {when}",{when:re(a.nextRun,c)})]}),e("p",{className:"schedule-prompt",children:a.prompt}),n("p",{className:"meta",children:[a.room?e("a",{href:x("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{W as SchedulesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{yn}from"./chunk-index-wt2asefx.js";function M(t,l,d,g){let r,a=-1,i=!1,f=(e)=>e instanceof Element?e.closest("button, [data-seat]")??t:t,o=()=>{r?.cancel(),r=void 0,a=-1},p=(e)=>{if(i=!1,e.pointerType==="mouse"||!e.isPrimary)return;o();let n=l(e.target,e.clientX,e.clientY);if(!n)return;let u=f(e.target);a=e.pointerId,r=new yn((s)=>{if(i=!0,typeof navigator.vibrate==="function")navigator.vibrate(10);d({...n,at:s,via:"hold",source:u})},g),r.begin(e.clientX,e.clientY)},m=(e)=>{if(e.pointerId===a&&r&&!i){if(!r.move(e.clientX,e.clientY))o()}},c=(e)=>{if(e.pointerId===a)o()},E=(e)=>{let n=l(e.target,e.clientX,e.clientY);if(!n)return;if(e.preventDefault(),i)return;o(),d({...n,at:{x:e.clientX,y:e.clientY},via:"contextmenu",source:f(e.target)})},v=(e)=>{if(i=!1,e.key!=="ContextMenu"&&!(e.key==="F10"&&e.shiftKey))return;let n=l(e.target,-1,-1);if(!n)return;e.preventDefault();let u=f(e.target),s=u.getBoundingClientRect();d({...n,at:{x:s.left+Math.min(s.width/2,48),y:s.top+24},via:"key",source:u})},L=(e)=>{if(!i)return;i=!1,e.preventDefault(),e.stopPropagation()};return t.addEventListener("pointerdown",p),t.addEventListener("pointermove",m),t.addEventListener("pointerup",c),t.addEventListener("pointercancel",c),t.addEventListener("contextmenu",E),t.addEventListener("keydown",v),t.addEventListener("click",L,!0),()=>{o(),t.removeEventListener("pointerdown",p),t.removeEventListener("pointermove",m),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",c),t.removeEventListener("contextmenu",E),t.removeEventListener("keydown",v),t.removeEventListener("click",L,!0)}}export{M as attachSeatMenu};
|
|
@@ -0,0 +1,29 @@
|
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import{t,e,n}from"./chunk-index-
|
|
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
2
|
.shortcut-list {
|
|
3
3
|
display: grid;
|
|
4
4
|
grid-template-columns: max-content minmax(0, 1fr);
|
|
@@ -23,4 +23,4 @@ import{t,e,n}from"./chunk-index-fg42egv9.js";import{Kn,So}from"./chunk-index-ypk
|
|
|
23
23
|
text-align: center;
|
|
24
24
|
font-size: var(--text-sm);
|
|
25
25
|
}
|
|
26
|
-
`;function r(){let o=
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1,8 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1,16 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C,a,r,t,K,g,e,n,s,x,X,Ke,Re,d,ot,Yt,vn,Je,Ue,Ht}from"./chunk-index-wt2asefx.js";import{pi}from"./chunk-index-2s4bkrz3.js";import{di,fi}from"./chunk-index-q33ppq0j.js";import{hi}from"./chunk-index-gj3n4dh5.js";import{Ft}from"./chunk-index-4eag6s50.js";import{Ws}from"./chunk-index-7c9fn21n.js";di();function v(){let l=d((c)=>JSON.stringify(Ws(c,(o)=>Re(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=pi(),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=Ft(()=>Yt(m,l.onLeave),l.liftable&&!o?.home?fi(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:x("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(Ht,{room:m}),c?e("span",{className:"badge badge-warn",children:K(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 U(l){let[m,p]=r(""),f=v(),c=f.map((i)=>({...i,entries:i.entries.filter((h)=>hi(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)=>vn(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{U as SwitcherList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O,as,qn}from"./chunk-index-wt2asefx.js";import{mo,Oo}from"./chunk-index-hef4gwtb.js";import{Yi,Yo}from"./chunk-index-35zqk1zr.js";import"./chunk-index-e46652wf.js";var c=64;async function m(s){let a=new Image;a.src=s,await a.decode();let r=document.createElement("canvas");r.width=r.height=c;let t=r.getContext("2d");if(!t)throw Error("the page has no 2d canvas");t.drawImage(a,0,0,c,c);let i=c*0.175,o=c-i-2,e=i+2;return t.fillStyle="#ffffff",t.beginPath(),t.arc(o,e,i+2.5,0,Math.PI*2),t.fill(),t.fillStyle="#ef4444",t.beginPath(),t.arc(o,e,i,0,Math.PI*2),t.fill(),r.toDataURL("image/png")}var u=()=>[...document.head.querySelectorAll('link[rel~="icon"]')];function g(s){let a=new Map,r=!1,t=0,i=(e)=>{if(e.dataset.plainHref===void 0)return;if(e.setAttribute("href",e.dataset.plainHref),e.dataset.plainType)e.type=e.dataset.plainType;else e.removeAttribute("type");if(e.dataset.plainSizes)e.setAttribute("sizes",e.dataset.plainSizes);else e.removeAttribute("sizes");delete e.dataset.plainHref,delete e.dataset.plainType,delete e.dataset.plainSizes},o=async()=>{let e=++t,p=s.count()>0;if(p===r)return;if(!p){for(let n of u())i(n);r=!1;return}let l=u(),d=(l.find((n)=>n.dataset.plainHref===void 0&&n.type==="image/png")??l[0])?.href;if(!d)return;let f=a.get(d);if(!f)f=s.render(d),a.set(d,f);let b=await f.catch((n)=>{a.delete(d),console.warn("the tab icon's dot failed to draw",n);return});if(!b||e!==t)return;for(let n of u()){if(n.dataset.plainHref===void 0)n.dataset.plainHref=n.getAttribute("href")??"",n.dataset.plainType=n.type,n.dataset.plainSizes=n.getAttribute("sizes")??"";n.href=b,n.type="image/png",n.removeAttribute("sizes")}r=!0};s.subscribe(()=>void o()),o()}function T(){let s=()=>Yi().badge+Oo(),a=()=>as(s());g({count:()=>qn(O.getState())+s(),subscribe:(r)=>{let t=()=>{a(),r()};O.subscribe(t),Yo(t),mo(t)},render:m}),a()}export{T as startPageTabDot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ke,o,r,t,e,n,s,X,d,rt}from"./chunk-index-wt2asefx.js";import{Ii,An,ai,Uo,li,ci,$n,Di,Ui,xr}from"./chunk-index-am7ghh75.js";import"./chunk-index-haac6nbt.js";import"./chunk-index-4jnn2g09.js";import"./chunk-index-hef4gwtb.js";import"./chunk-index-zeqfnkty.js";import"./chunk-index-zdzzf3fp.js";import{gs,Mi,Os}from"./chunk-index-x4tq9btg.js";Ii();function v(){return Uo((ke(rt)?.kinds??[]).map((a)=>a.kind)),null}function N({focus:a}){let[l,b]=r(),u=li(void 0),i=An(),p=i.loaded&&u.length===0;return o(()=>{if(a&&i.loaded)X("table",void 0,{replace:!0})},[a,i.loaded]),n("div",{className:"table-page",children:[n("header",{className:"page-head",children:[e("h1",{children:t("Round table")}),n("div",{className:"table-tools",children:[l?.kind==="webgl"?e("button",{type:"button",className:"icon-button","aria-label":t("Reset view"),title:t("Reset view"),onClick:()=>l.focus(null),children:e(s,{name:"reset"})}):null,e("button",{type:"button",className:"secondary",onClick:()=>X("rooms"),children:t("All rooms")})]})]}),n("div",{className:"table-frame",children:[p?n("div",{className:"table-empty-state",children:[e("strong",{children:t("The table is empty")}),e("p",{className:"meta",children:t("There are no rooms to seat yet.")})]}):e($n,{onHandle:b,onSeat:(m)=>{let c=u.find((f)=>f.name===m);if(c)X("room",c.key)},onFocus:(m)=>{let c=u.find((f)=>f.name===m);if(c)X("room",c.key)}}),e(v,{})]})]})}function C({named:a}){let l=Mi(),b=gs(),u=d((y)=>y.listed),i=Os(l,b,a),p=ci(),{ask:m,sheet:c}=Ui(i),f=a===void 0||l.some(k(a));o(()=>{if(a!==void 0&&u&&!f)X("table",void 0,{replace:!0})},[a,u,f]);let h=e("div",{className:"room-title",children:e("h1",{children:t("Round table")})}),g=n("div",{className:"table-empty-state",children:[e("strong",{children:i?t("The council is empty"):t("No council yet")}),e("p",{className:"meta",children:i?t("Every member of this council is gone. Edit who sits."):t("A council is a group of up to {max} knights who answer in turn.",{max:8})}),p.length>0?e("button",{type:"button",onClick:m,children:i?t("Edit this council"):t("Pick who sits")}):null]});if(i)return n("section",{className:"room council-page",children:[e(xr,{roomKey:i.key,lead:h,empty:g}),c]});return n("div",{className:"table-page",children:[n("header",{className:"page-head",children:[h,p.length>0?e("div",{className:"table-tools",children:e(Di,{council:void 0,onOpen:m})}):null]}),e("div",{className:"table-frame",children:g}),c]})}var k=(a)=>(l)=>l.key===a||l.name===a;function F({focus:a}){return ai()?e(N,{focus:a}):e(C,{named:a})}export{F as TablePage};
|