pi-roundtable-web 0.23.1 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +9 -1
- package/dist/{chunk-character-creator-660d2t6p.js → chunk-character-creator-dwk6y4be.js} +1 -1
- package/dist/{chunk-connectors-d19v8cjc.js → chunk-connectors-pk0fh4y6.js} +1 -1
- package/dist/{chunk-conversations-4cmexmqq.js → chunk-conversations-sfsgmsdm.js} +1 -1
- package/dist/{chunk-entry-8xpx35ef.js → chunk-entry-x0j9g57j.js} +1 -1
- package/dist/{chunk-index-9tvf6es7.js → chunk-index-9k42hnam.js} +3 -3
- package/dist/{chunk-index-xw5hhmfq.js → chunk-index-k0z1ykph.js} +1 -1
- package/dist/{chunk-notes-fefwds14.js → chunk-notes-v60aswry.js} +1 -1
- package/dist/{chunk-overview-bxpwpmn6.js → chunk-overview-c1c0ccda.js} +1 -1
- package/dist/{chunk-skills-pce3zgxy.js → chunk-skills-r8rwbc5y.js} +1 -1
- package/dist/{chunk-table-zmpbrfvz.js → chunk-table-pmr7zrgm.js} +1 -1
- package/dist/{chunk-transcript-yhtjp3pd.js → chunk-transcript-wjqk37f5.js} +1 -1
- package/dist/{chunk-zh-tw-anqhqpaz.js → chunk-zh-tw-mtvm7sn7.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +2 -2
- package/src/api-types.ts +9 -0
- package/src/app/app.ts +17 -0
- package/src/app/routes.ts +5 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/options.ts +34 -0
- package/src/push/quiet-hours.ts +60 -0
- package/src/push/triggers.ts +14 -2
- package/src/web-plugin.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
|
|
6
|
+
## [0.23.2] - 2026-10-29
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Quiet hours for Web Push, 23:00 to 08:00 by default. In the window an agent's post and a notice (the `notify` tool, and a notice another channel delivered) are not pushed, so a night report waits in its room; a card (one waiting, or "Long-running cap reached") is still pushed. The window is read on the console's time zone, through `Intl`, and may cross midnight.
|
|
11
|
+
- The option `push.quietHours`: `{ start: "HH:MM", end: "HH:MM" }` (two different times on a 24-hour clock) or `false` for no quiet hours. Anything else stops the start, like the other options.
|
|
12
|
+
- Settings shows the window and its time zone to the owner, read-only, in English and Traditional Chinese (`SessionView.quietHours`).
|
|
13
|
+
|
|
6
14
|
## [0.23.1] - 2026-10-29
|
|
7
15
|
|
|
8
16
|
### Added
|
package/README.md
CHANGED
|
@@ -207,6 +207,13 @@ A push goes out when:
|
|
|
207
207
|
- a notice reaches the owner: `notify` through the app's direct channel writes a line in Home and pushes it, and a notice that Discord (or another channel) delivered is pushed too, through the core's `mirror` hook.
|
|
208
208
|
|
|
209
209
|
Discord's own cards are not pushed.
|
|
210
|
+
|
|
211
|
+
**Quiet hours.** From 23:00 to 08:00 by default, the second and third kinds of push are held back: an agent's post and a notice are not pushed, so a report that arrives at night waits in its room until the owner looks.
|
|
212
|
+
A card (one waiting, or the long-running cap) is still pushed, since work stops until someone answers it.
|
|
213
|
+
The hours are read on the console's time zone (`env.timeZone` of the host, the zone the page shows times in), and a window that ends before it starts crosses midnight.
|
|
214
|
+
`push.quietHours` sets them as `{ start: "22:30", end: "07:00" }` (two different `HH:MM` times on a 24-hour clock), or `false` to push at any hour; anything else stops the start.
|
|
215
|
+
**Settings** shows the window and its time zone to every owner, read-only: only the server sets it.
|
|
216
|
+
|
|
210
217
|
With `push.preview` on (the default) a notification shows the first 120 characters of the message; with `push.preview: false` it says only that something waits and where.
|
|
211
218
|
Tapping a notification focuses the app or opens it at the room.
|
|
212
219
|
|
|
@@ -494,10 +501,11 @@ The `push` keys:
|
|
|
494
501
|
| Key | Default | What it does |
|
|
495
502
|
|---|---|---|
|
|
496
503
|
| `push.preview` | `true` | Whether a notification shows the first 120 characters of the message. With `false` it says only that something waits, and where. |
|
|
504
|
+
| `push.quietHours` | `{ start: "23:00", end: "08:00" }` | The hours when an agent's post and a notice are not pushed, as two different `HH:MM` times on the console's time zone; an `end` before the `start` crosses midnight. Cards are always pushed. `false` turns quiet hours off. |
|
|
497
505
|
| `push.endpointHosts` | none | Push services to post to besides the browsers' own (Google, Mozilla, Apple, Microsoft), as host names; a leading `*.` allows every subdomain. Endpoints must still be `https`. |
|
|
498
506
|
| `push.subject` | `origin`, when it is `https` | The contact a push service may use about this server (the VAPID `sub`): a `mailto:` or `https:` URL. With an `http` origin push stays off until it is set. |
|
|
499
507
|
|
|
500
|
-
The bad settings that stop the host at startup are: no `auth` or `verifier`, both of them, an unknown `auth.mode`, a password shorter than 12 characters, `none` on a listener that reaches beyond the machine, an `origin` with a path, a `mountPath` of `/` or with `..` in it, an unknown or repeated pane, `schedules` or `table` without `rooms`, a `surface` that is not a lower-case word or is `discord`, an empty `ownerId`, a `uploadMaxBytes` out of range, and a `push.subject` that is neither a `mailto:` address nor an `https:` URL.
|
|
508
|
+
The bad settings that stop the host at startup are: no `auth` or `verifier`, both of them, an unknown `auth.mode`, a password shorter than 12 characters, `none` on a listener that reaches beyond the machine, an `origin` with a path, a `mountPath` of `/` or with `..` in it, an unknown or repeated pane, `schedules` or `table` without `rooms`, a `surface` that is not a lower-case word or is `discord`, an empty `ownerId`, a `uploadMaxBytes` out of range, and a `push.subject` that is neither a `mailto:` address nor an `https:` URL, and a `push.quietHours` that is neither `false` nor two different `HH:MM` times.
|
|
501
509
|
|
|
502
510
|
The plugin needs, for the panes you serve: the agent server (`AGENTS`) for Overview and Rooms, the modes service (`MODES`) for Rooms, the schedule store (`SCHEDULES`) for Schedules, and the memory addon for Notes.
|
|
503
511
|
The host refuses to start with a message naming the missing service when one of them is absent.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E,I,c,q,Q}from"./chunk-index-6g69tqt0.js";import{b,J,a,P,_,o,i,t,r,h,e,n,ae,w,R,y,Z,s,d,L,O,U}from"./chunk-index-
|
|
1
|
+
import{E,I,c,q,Q}from"./chunk-index-6g69tqt0.js";import{b,J,a,P,_,o,i,t,r,h,e,n,ae,w,R,y,Z,s,d,L,O,U}from"./chunk-index-9k42hnam.js";var ke={"hat.none":"No hat","hat.goggcap":"Goggle cap","hat.tallcap":"Tall cap","hat.softcap":"Soft cap","hat.hardhat":"Hard hat","hat.fcap":"Flat cap","hat.winghelm":"Winged helm","hat.helm":"Helm","hat.mortar":"Mortarboard","hat.kettle":"Kettle hat","hat.cavalier":"Cavalier hat","hat.toque":"Chef's toque","hair.none":"No hair","beard.none":"No beard","accessory.none":"No accessory","prop.beads":"Prayer beads","prop.marotte":"Marotte","prop.map":"Map","outfit.surplice":"Surplice","outfit.overalls":"Overalls","hair.bob":"Bob","hair.bun":"Bun","hair.ponytail":"Ponytail"},oe=(l)=>l.charAt(0).toUpperCase()+l.slice(1);function A(l,f){let p=`character.${l}.${f}`,k=t(p);if(k!==p)return k;if(l==="class")return c.classes[f]?.label??oe(f);return ke[`${l}.${f}`]??oe(f)}function le(l){let f=`character.jobs.${l}`,p=t(f);return p!==f?p:c.classes[l]?.jobs??""}var X=[{field:"hat",title:r("Hat"),ids:c.hats},{field:"outfit",title:r("Outfit"),ids:c.outfits},{field:"prop",title:r("Prop"),ids:c.props},{field:"hair",title:r("Hair"),ids:c.hair},{field:"beard",title:r("Beard"),ids:["none",...c.beards]},{field:"accessory",title:r("Accessory"),ids:["none",...c.accessories]}],ve=new Set(["class","colors","palette","build","skin","hairColor",...X.map((l)=>l.field)]),fe=Object.keys(c.palettes),ce={idle:r("Idle"),thinking:r("Thinking"),working:r("Working"),waiting:r("Waiting for you"),done:r("Done"),error:r("Error"),sleepy:r("Sleepy")},Ce={slim:r("Slim"),regular:r("Regular"),stout:r("Stout")};function me(l){return{class:l.class,outfit:l.outfit,hat:l.hat,prop:l.prop,hair:l.hair,beard:l.beard,accessory:l.accessory,build:l.build,skin:l.skin,hairColor:l.hairColor,colors:{...l.colors}}}var de=(l)=>JSON.stringify(me(l)),S=(l)=>l[Math.floor(Math.random()*l.length)];function Se(){return{class:S(E),outfit:S(c.outfits),hat:S(c.hats),prop:S(c.props),hair:S(c.hair),beard:S(["none",...c.beards]),accessory:S(["none",...c.accessories]),build:S(["slim","regular","stout"]),skin:S([0,1,2,3,4,5]),hairColor:S(c.hairColors),palette:S(fe)}}var he=b(function(f){return n("button",{type:"button",className:"creator-tile","aria-pressed":f.pressed,title:f.hint?`${f.label} — ${f.hint}`:f.label,onClick:f.onPick,...f.data,children:[e(w,{spec:f.spec,size:f.size,live:!1}),e("span",{children:f.label})]})});function Ne(l,f,p){let k=JSON.stringify({...l,[f]:0});return _(()=>p.map((m)=>({...l,[f]:m})),[k,f,p])}function Le(){let l=o(null),[f,p]=i();return a(()=>{let k=l.current;if(!k)return;let m=()=>{let T=k.scrollLeft>1,F=k.scrollLeft+k.clientWidth<k.scrollWidth-1;p(T&&F?"both":F?"end":T?"start":void 0)};m(),k.addEventListener("scroll",m,{passive:!0});let v=typeof ResizeObserver>"u"?void 0:new ResizeObserver(m);return v?.observe(k),()=>{k.removeEventListener("scroll",m),v?.disconnect()}},[]),[l,f]}function we(l){let{part:f}=l,p=Ne(l.shown,f.field,f.ids),[k,m]=Le();return e("div",{className:"creator-strip",ref:k,"data-more":m,children:f.ids.map((v,T)=>e(he,{data:{[`data-${f.field}`]:v},spec:p[T],size:44,label:A(f.field,v),pressed:l.draft[f.field]===v,onPick:()=>l.onPick(v)},v))})}function j(l){return e("button",{type:"button",className:"creator-swatch","aria-pressed":l.pressed,"aria-label":l.label,title:l.label,style:{background:l.background},onClick:l.onPick,...l.data})}function D(l){return n("div",{className:"creator-field","data-field":l.field,children:[l.title?e("h3",{children:l.title}):null,l.children,l.error?e("p",{className:"field-error",role:"alert",children:l.error}):null]})}function We(l){let[f,p]=i(l.character),k=J(f),[m,v]=i({}),[T,F]=i(!1),[K,be]=i("idle"),[Y,B]=i(),[z,x]=i(),ee=L("(max-width: 719px)"),te=o(null),G=P(),ge=O(f),H=de(f)!==de(l.character);a(()=>p(l.character),[l.character]),a(()=>{if(!H)return;let u=(C)=>C.preventDefault(),g=(C)=>{if(C.button!==0||C.metaKey||C.ctrlKey||C.shiftKey||C.altKey)return;let M=C.target instanceof Element?C.target.closest("a"):null;if(!M||M.target||M.hasAttribute("download"))return;if(te.current?.contains(M))return;C.preventDefault(),C.stopPropagation(),B({kind:"link",anchor:M})},V=ae((C)=>B({kind:"navigate",proceed:C}));return window.addEventListener("beforeunload",u),document.addEventListener("click",g,!0),()=>{V(),window.removeEventListener("beforeunload",u),document.removeEventListener("click",g,!0)}},[H]);let N=(u)=>{v({}),p((g)=>q(u,g))},pe=async()=>{F(!0),v({});try{let u=await s.setCharacter(l.name,me(f));l.onSaved(u),y(t("Saved."))}catch(u){let g=u instanceof Z&&u.field?u.field.split(".")[0]:void 0,V=g&&ve.has(g)?g:"*";v({[V]:d(u)})}finally{F(!1)}},ye=async()=>{let u=Y;if(p(l.character),v({}),u?.kind==="link")setTimeout(()=>u.anchor.click(),0);else if(u?.kind==="navigate")u.proceed()},re=e(D,{field:"class",title:t("Class"),error:m.class,children:e("div",{className:"creator-grid",children:E.map((u)=>e(Pe,{id:u,base:k,pressed:f.class===u,onPick:()=>N({class:u,colors:f.colors})},u))})}),ne=n(D,{field:"colors",title:t("Colors"),error:m.colors??m.palette,children:[n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Palette")}),fe.map((u)=>{let g=c.palettes[u];return e(j,{data:{"data-palette":u},label:A("palette",u),pressed:f.palette===u,background:`linear-gradient(135deg, ${g.primary} 52%, ${g.trim} 52%)`,onPick:()=>N({palette:u})},u)})]}),e("div",{className:"creator-custom",children:["primary","secondary","trim"].map((u)=>n("label",{children:[e("span",{children:u==="primary"?t("Primary (the accent)"):u==="secondary"?t("Secondary"):t("Trim")}),e("input",{type:"color",value:f.colors[u],onChange:(g)=>N({colors:{[u]:g.target.value}})})]},u))})]}),ie=X.map((u)=>e(D,{field:u.field,title:t(u.title),error:m[u.field],children:e(we,{part:u,draft:f,shown:k,onPick:(g)=>N({[u.field]:g})})},u.field)),se=n(h,{children:[e(D,{field:"build",title:t("Build"),error:m.build,children:n("fieldset",{className:"segmented",children:[e("legend",{className:"visually-hidden",children:t("Build")}),["slim","regular","stout"].map((u)=>n("label",{"data-checked":f.build===u,children:[e("input",{type:"radio",name:`${G}-build`,checked:f.build===u,onChange:()=>N({build:u})}),ue(u)]},u))]})}),e(D,{field:"skin",title:t("Skin tone"),error:m.skin,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Skin tone")}),c.skins.map((u,g)=>e(j,{data:{"data-skin":String(g)},label:t("Skin tone {n}",{n:g+1}),pressed:f.skin===g,background:u,onPick:()=>N({skin:g})},u))]})}),e(D,{field:"hairColor",title:t("Hair color"),error:m.hairColor,children:n("fieldset",{className:"creator-swatches",children:[e("legend",{className:"visually-hidden",children:t("Hair color")}),c.hairColors.map((u,g)=>e(j,{data:{"data-hair-color":u},label:t("Hair color {n}",{n:g+1}),pressed:f.hairColor===u,background:u,onPick:()=>N({hairColor:u})},u)),e("input",{type:"color","aria-label":t("Hair color"),value:f.hairColor,onChange:(u)=>N({hairColor:u.target.value})})]})})]}),W=[{id:"class",title:t("Class"),summary:A("class",f.class),error:m.class,node:re},{id:"colors",title:t("Colors"),summary:f.palette?A("palette",f.palette):f.colors.primary,error:m.colors??m.palette,node:ne},...X.map((u,g)=>({id:u.field,title:t(u.title),summary:A(u.field,f[u.field]),error:m[u.field],node:ie[g]})),{id:"body",title:t("Body"),summary:ue(f.build),error:m.build??m.skin??m.hairColor,node:se}];return n("form",{ref:te,className:"creator",style:ge,"aria-labelledby":G,onSubmit:(u)=>{if(u.preventDefault(),H&&!T)pe()},children:[e("h2",{id:G,className:"visually-hidden",children:t("Character of {name}",{name:l.displayName})}),n("div",{className:"creator-preview",children:[e(w,{spec:f,name:l.name,state:K,size:176,label:t("{name}, {state}",{name:l.displayName,state:t(ce[K])})}),e("button",{type:"button",className:"secondary","data-action":"cycle",onClick:()=>be((u)=>I[(I.indexOf(u)+1)%I.length]??"idle"),children:t("Preview states")}),e("span",{className:"meta","aria-live":"polite",children:t(ce[K])})]}),n("div",{className:"creator-body",children:[m["*"]?e("p",{className:"field-error",role:"alert","data-field":"*",children:m["*"]}):null,ee?e("ul",{className:"creator-sections",children:W.map((u)=>e("li",{children:n("button",{type:"button",className:"creator-section secondary",onClick:()=>x(u.id),children:[e("strong",{children:u.title}),e("span",{className:"meta",children:u.summary}),u.error?e("span",{className:"field-error",role:"alert",children:u.error}):null]})},u.id))}):n(h,{children:[re,ne,ie,se]}),n("div",{className:"actions creator-actions",children:[e("button",{type:"button",className:"secondary","data-action":"suggest",onClick:()=>{v({}),p(Q({name:l.name,displayName:l.displayName,prompt:l.prompt}))},children:t("Suggest from role")}),e("button",{type:"button",className:"secondary","data-action":"randomize",onClick:()=>N(Se()),children:t("Randomize")}),e("button",{type:"button",className:"secondary","data-action":"cancel",onClick:()=>{if(H)B({kind:"cancel"})},children:t("Cancel")}),e("button",{type:"submit","data-action":"save",disabled:!H||T,children:T?t("Saving…"):t("Save")})]})]}),e(R,{open:ee&&z!==void 0,title:W.find((u)=>u.id===z)?.title??"",onClose:()=>x(void 0),children:e("div",{className:"stack",children:W.find((u)=>u.id===z)?.node})}),e(U,{open:Y!==void 0,title:t("Discard your changes?"),confirmLabel:t("Discard"),cancelLabel:t("Keep editing"),tone:"danger",onClose:()=>B(void 0),onConfirm:ye,children:e("p",{children:t("The new look for {name} has not been saved.",{name:l.displayName})})})]})}var ue=(l)=>t(Ce[l]);function Pe(l){let f=l.base.colors,p=_(()=>q({class:l.id,colors:f}),[l.id,f]);return e(he,{data:{"data-class":l.id},spec:p,size:56,label:A("class",l.id),hint:le(l.id),pressed:l.pressed,onPick:l.onPick})}export{We as CharacterCreator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,h,e,n,p,l,m,f,s,g,x}from"./chunk-index-
|
|
1
|
+
import{t,h,e,n,p,l,m,f,s,g,x}from"./chunk-index-9k42hnam.js";function N(){let{connectorAdminUrl:c}=g(),{data:r,error:o}=x(()=>s.connectors(),"connectors");return n("section",{className:"stack",children:[n("div",{className:"card-head",children:[n("div",{children:[e("h2",{children:t("Connectors")}),e("p",{className:"hint",children:t("Upstream MCP gateways and virtual servers used by the assistant.")})]}),c?e("a",{href:c,target:"_blank",rel:"noreferrer",children:t("Open connector admin")}):null]}),o?e(l,{message:o}):null,!r&&!o?e(p,{}):null,r?n(h,{children:[e("h3",{children:t("Upstream gateways")}),r.gateways.length===0?e(m,{children:t("No gateways.")}):null,r.gateways.map((a)=>e("article",{className:"card",children:n("div",{className:"card-head",children:[e("strong",{children:a.name}),e(f,{children:a.enabled?t("Enabled"):t("Disabled")}),e(f,{tone:a.reachable?"plain":"warn",children:a.reachable?t("Reachable"):t("Unreachable")}),e(f,{children:t("{count} tools",{count:a.tools})})]})},a.name)),e("h3",{children:t("Virtual servers")}),r.servers.length===0?e(m,{children:t("No virtual servers.")}):null,r.servers.map((a)=>n("article",{className:"card",children:[n("div",{className:"card-head",children:[e("strong",{children:a.name}),e(f,{children:t("{count} tools",{count:a.tools.length})})]}),n("p",{children:[t("Used by"),": ",a.usedBy.join(", ")||t("None")]}),n("details",{children:[e("summary",{children:t("Tool list")}),e("ul",{children:a.tools.map((i)=>e("li",{children:i},i))})]})]},a.name))]}):null]})}export{N as ConnectorsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,r,h,e,n,u,p,l,m,f,s,g,S,C,T,k,z,V,x}from"./chunk-index-
|
|
1
|
+
import{t,r,h,e,n,u,p,l,m,f,s,g,S,C,T,k,z,V,x}from"./chunk-index-9k42hnam.js";var N=[{kind:"owner",title:r("Owner channels"),note:r("Direct messages and channels where the owner talks to the assistant.")},{kind:"agent",title:r("Agent channels"),note:r("The agent server's one-to-one channels.")},{kind:"group",title:r("Group channels"),note:r("The agent server's group channels.")},{kind:"outside",title:r("Outside agents"),note:r("Conversations an agent outside Discord holds over MCP.")},{kind:"plugin",title:r("Plugin conversations"),note:r("Conversations a plugin runs, such as a web chat, as the host recorded them.")}];function D(){let{timeZone:o}=g(),{now:i}=S(),{data:c,error:a}=x(()=>s.conversations(),"conversations"),w=c?.conversations;if(!w)return a?e(l,{message:a}):e(p,{});return n(h,{children:[a?e(l,{message:a}):null,N.map((d)=>{let y=w.filter((v)=>v.kind===d.kind);return n("section",{className:"stack",children:[e("h2",{children:t(d.title)}),e("p",{className:"hint",children:t(d.note)}),y.length===0?e(m,{children:t("None stored.")}):null,y.map((v)=>e(b,{item:v,now:i,timeZone:o},v.key))]},d.kind)})]})}function b(o){let{item:i}=o,c=z(i.channel,i.id),a=V(i);return n("a",{className:"card card-link",href:u("conversations",i.key),children:[n("div",{className:"card-head",children:[e("strong",{children:a}),i.busy>0?e(f,{tone:"busy",children:t("running")}):null,i.liveBytes===0?e(f,{children:t("archived only")}):null]}),n("p",{className:"meta",children:[(i.kind==="outside"||i.kind==="plugin")&&i.startedAt?`${t("Started")} ${T(i.startedAt,o.timeZone)} · `:c.detail?`${c.detail} · `:"",i.principal?`${i.visibility==="private"?t("Private to {name}",{name:i.principal.name}):t("Shared · {name}",{name:i.principal.name})} · `:"",t("Last active")," ",C(i.lastActive,o.now,o.timeZone)," ·"," ",k(i.liveBytes)," ·"," ",t("{count} archived",{count:i.archives})]})]})}export{D as ConversationsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M}from"./chunk-index-
|
|
1
|
+
import{M}from"./chunk-index-9k42hnam.js";import{D}from"./chunk-index-19g8jmr8.js";function w(){try{let i=document.createElement("canvas");return!!(i.getContext("webgl2")||i.getContext("webgl"))}catch{return!1}}function L(i,a){return[i,a.includes("?")?a.slice(a.indexOf("?")):""].some((d)=>{let c=new URLSearchParams(d).get("nogl");return c!==null&&c!=="0"&&c!=="false"})}async function A(i,a,p){let d=a.variant==="compact",c=a.labels??D,s=new Map,v=(e)=>{s.clear();for(let t of e)s.set(t.id,{...t})};v(a.seats);let u={t:a.theme,s:a.scheme},n=null,o=document.createElement("div");o.className="rt-table",o.dataset.variant=d?"compact":"full";let b=document.createElement("div");b.className="rt-table-stage",o.appendChild(b);let r=null,T=!1,y=()=>!d&&(Boolean(a.listBelow)||T);i.appendChild(o);let m=new Map,g=()=>{if(!y()){r?.remove(),r=null,m.clear(),delete o.dataset.list;return}if(!r)r=document.createElement("ul"),r.className="rt-table-list",r.setAttribute("aria-label",c.table),o.appendChild(r),o.dataset.list="";for(let e of[...m.keys()])if(!s.has(e))m.delete(e);for(let e of s.values()){let t=m.get(e.id);if(!t){t=document.createElement("button"),t.type="button";let l=e.id;t.addEventListener("click",()=>{let S=s.get(l);if(S)a.onSeatClick({id:S.id,name:S.name})}),m.set(e.id,t)}t.textContent=c.seat(e.name,e.state??"idle"),t.style.setProperty("--seat",e.color)}r.replaceChildren(...[...s.values()].map((e)=>{let t=document.createElement("li"),l=m.get(e.id);if(l)t.appendChild(l);return t}))};g();let h=(e)=>{T=!e,g(),a.onNames?.(e)},f=async()=>{let{createTable2D:e}=await (M("ac2gez71"),import("./chunk-table2d-ac2gez71.js"));n=e(b,{...a,theme:u.t,scheme:u.s,seats:[...s.values()]}),h(!0)},E=async()=>{let{createTable3D:e}=await (M("g258jemr"),import("./chunk-table3d-g258jemr.js"));n=e(b,{...a,theme:u.t,scheme:u.s,seats:[...s.values()],onNames:h},()=>{n?.dispose(),f()})};if(d||p==="svg"||p!=="webgl"&&(L(location.search,location.hash)||!w()))await f();else try{await E()}catch{await f()}return{get kind(){return n.kind},setTheme(e,t){u={t:e,s:t},n.setTheme(e,t)},setSeats(e){v(e),g(),n.setSeats(e)},setState(e,t){let l=s.get(e);if(l)l.state=t;g(),n.setState(e,t)},setAvatar(e,t){let l=s.get(e);if(l)l.avatarSvg=t;return n.setAvatar(e,t)},setReducedMotion:(e)=>n.setReducedMotion(e),resetCamera:()=>n.resetCamera(),getStats:()=>n.getStats(),dispose(){n?.dispose(),o.remove()}}}export{A as mountRoundTable};
|