droidsembly 0.0.0-stage β 0.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.it.md +184 -0
- package/README.md +184 -3
- package/bin/cubefarm.js +297 -0
- package/bin/distribution.d.ts +3 -0
- package/bin/distribution.js +48 -0
- package/dist/THIRD_PARTY_LICENSES.txt +2542 -0
- package/dist/assets/AccessibilitySettings-DSmFk9JC.js +30 -0
- package/dist/assets/AccessibilitySettings-HrzBDUTN.css +1 -0
- package/dist/assets/AppViewer-alNn4TBB.js +5 -0
- package/dist/assets/Balloon-UTs7npGo.js +1 -0
- package/dist/assets/Batched-BOgjreKO.js +45 -0
- package/dist/assets/Birds-BA2HM-AD.js +1 -0
- package/dist/assets/Blimp-CTykuz6B.js +1 -0
- package/dist/assets/BufferGeometryUtils-BsmWvcA2.js +1 -0
- package/dist/assets/Duck-DH63jUrP.js +1 -0
- package/dist/assets/Effects-CNyhhFkE.js +65 -0
- package/dist/assets/Fireworks-CJfDJOeb.js +33 -0
- package/dist/assets/Helicopter-CW_SP7xP.js +1 -0
- package/dist/assets/Hurricane-9WqZGyZg.js +33 -0
- package/dist/assets/Kaiju-SpSi_jBg.js +1 -0
- package/dist/assets/Meteors-DvjhLfbF.js +1 -0
- package/dist/assets/MissionConsole-BEP5CdC8.js +1 -0
- package/dist/assets/Office-BBnd6tyn.js +563 -0
- package/dist/assets/Office-DMOP02gg.css +1 -0
- package/dist/assets/PhotoPanel-DehErnsv.js +1 -0
- package/dist/assets/PhotoPanel-v4ANHBsO.css +1 -0
- package/dist/assets/PhotoScene-Ce-dzToM.js +115 -0
- package/dist/assets/Plane-0nfvzL_c.js +1 -0
- package/dist/assets/Pocket-CBoyL0ra.js +2 -0
- package/dist/assets/Rainbow-CdcWsmW8.js +28 -0
- package/dist/assets/Roof-mkMKniSZ.js +34 -0
- package/dist/assets/Shell-BmnZn4UL.js +13 -0
- package/dist/assets/Skywriting-06dZPAfg.js +1 -0
- package/dist/assets/TerminalView-BrP-ENHg.css +1 -0
- package/dist/assets/TerminalView-wlhSixSH.js +17 -0
- package/dist/assets/ToyWorld-Cuu9aW-K.js +1 -0
- package/dist/assets/Ufo-iHaoe5t1.js +1 -0
- package/dist/assets/Whale-DZg88zIX.js +1 -0
- package/dist/assets/all-CYErCTCA.js +11 -0
- package/dist/assets/billboardLayout-DSKGXPIM.js +1 -0
- package/dist/assets/bloomMarks-DariC6lY.js +4231 -0
- package/dist/assets/cheerRules-CZGSrxOB.js +1 -0
- package/dist/assets/cityLayout-7ckfe3wf.js +1 -0
- package/dist/assets/director-CrzFgnoP.js +1 -0
- package/dist/assets/dogState-DiOvoobI.js +1 -0
- package/dist/assets/doors-BHKj8tkO.js +1 -0
- package/dist/assets/gallery-ColCPQQE.js +1 -0
- package/dist/assets/gate-BplJKcLG.js +2 -0
- package/dist/assets/index-B6qvKFYN.js +10 -0
- package/dist/assets/index-COpmc42S.css +1 -0
- package/dist/assets/instantReplay-DGiLgvkQ.js +1 -0
- package/dist/assets/interact-0qw7BGhL.js +1 -0
- package/dist/assets/jsx-runtime-BFUkm7bt.js +1 -0
- package/dist/assets/jukeboxSongs-CjbAzAeb.js +1 -0
- package/dist/assets/kit-C6ByUQ-Y.js +2 -0
- package/dist/assets/mic-B316hcCe.js +1 -0
- package/dist/assets/news-CrPol-gz.js +1 -0
- package/dist/assets/paint.worker-D95XJ3xX.js +1 -0
- package/dist/assets/photoMode-CYxQfgUF.js +1 -0
- package/dist/assets/pipeline-BOTOZ69L.js +1215 -0
- package/dist/assets/rapier-CXAOW8OC.js +1 -0
- package/dist/assets/rig-wAyl3G1G.js +1 -0
- package/dist/assets/speechLanguage-BtfdhZNI.js +1 -0
- package/dist/assets/store-FA83kfnc.js +5 -0
- package/dist/assets/useDayTime-0XsqM14Q.js +1 -0
- package/dist/assets/useGraphics-Cif18p7Q.js +1 -0
- package/dist/assets/voiceMessages-DtNmUazr.js +1 -0
- package/dist/assets/weatherState-ExG1doW-.js +1 -0
- package/dist/icons/Sora-OFL.txt +93 -0
- package/dist/icons/apple-touch-icon.png +0 -0
- package/dist/icons/badge-96.png +0 -0
- package/dist/icons/badge.svg +1 -0
- package/dist/icons/droid-antenna.svg +29 -0
- package/dist/icons/droid-eyes.svg +29 -0
- package/dist/icons/droid-shell.svg +29 -0
- package/dist/icons/droid-spark.svg +29 -0
- package/dist/icons/droid-wire.svg +29 -0
- package/dist/icons/favicon-16.png +0 -0
- package/dist/icons/favicon-32.png +0 -0
- package/dist/icons/favicon.svg +1 -0
- package/dist/icons/icon-192.png +0 -0
- package/dist/icons/icon-512.png +0 -0
- package/dist/icons/icon-maskable-512.png +0 -0
- package/dist/icons/icon.svg +29 -0
- package/dist/icons/logo-dark.svg +29 -0
- package/dist/icons/logo-light.svg +29 -0
- package/dist/icons/sora-400.ttf +0 -0
- package/dist/icons/sora-700.ttf +0 -0
- package/dist/index.html +26 -0
- package/dist/manifest.webmanifest +19 -0
- package/dist/third-party-licenses.json +1106 -0
- package/dist-server/browser-init.js +24 -0
- package/dist-server/index.js +20049 -0
- package/dist-server/index.js.map +7 -0
- package/dist-server/ptyHost.js +234 -0
- package/dist-server/ptyHost.js.map +7 -0
- package/package.json +98 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pill-replay{background:#ff8fa3}.tl-since{background:#fff5f7;border-color:#ef476f}.tl-day .row{margin:0}.tl-speeds{flex-direction:column;gap:6px;margin-bottom:8px;display:flex}.tl-track{border:2px solid var(--ink);background:#ece7dc;border-radius:999px;height:12px;position:relative}.tl-track-mini{border-width:1.5px;height:10px;margin-top:4px}.tl-mark{pointer-events:auto;cursor:default;filter:drop-shadow(0 1px #00000059);font-size:11px;line-height:1;position:absolute;top:50%;transform:translate(-50%,-50%)}.tl-track-mini .tl-mark{font-size:9px}.tl-mark-issue{opacity:.8;font-size:8px}.tl-scrub{cursor:pointer;touch-action:none;flex:1;min-width:120px;height:18px}.tl-scrub:focus-visible{outline:3px solid var(--accent);outline-offset:2px}.tl-fill{pointer-events:none;background:#ffc2d1;border-radius:999px;position:absolute;inset:0 auto 0 0}.tl-head{border:2px solid var(--ink);pointer-events:none;background:#ef476f;border-radius:3px;width:6px;margin-left:-3px;position:absolute;top:-5px;bottom:-5px}.tl-tip{background:var(--ink);color:#fff;white-space:nowrap;border-radius:8px;padding:2px 8px;font-size:.8rem;font-weight:600;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%)}.replay{z-index:11;pointer-events:none;position:fixed;inset:0}.replay>:not(.replay-frame){pointer-events:auto}.replay-frame{border:5px solid #ef476fd9;position:absolute;inset:0;box-shadow:inset 0 0 40px #ef476f59}.replay-badge{border:3px solid var(--ink);box-shadow:0 4px 0 var(--ink);color:#fff;letter-spacing:.04em;text-shadow:0 2px #00000040;white-space:nowrap;background:#ef476f;border-radius:14px;align-items:baseline;gap:10px;padding:6px 16px;font-size:1.35rem;font-weight:700;display:flex;position:absolute;top:84px;left:50%;transform:translate(-50%)}.replay-sub{letter-spacing:0;opacity:.92;font-size:.85rem;font-weight:600}.replay-bar{background:var(--paper);border:3px solid var(--ink);width:min(860px,100vw - 32px);box-shadow:0 4px 0 var(--ink);border-radius:18px;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 14px;display:flex;position:absolute;bottom:56px;left:50%;transform:translate(-50%)}.replay-play{min-width:38px}.replay-time{color:var(--muted);font-weight:600}.replay-speeds{gap:4px;display:flex}.replay-note{color:var(--muted);flex-basis:100%}.replay-note-bad{color:#c9184a}@media (width<=1100px){.replay-bar{bottom:76px}}@media (width<=700px){.replay-badge{font-size:1.05rem;top:76px}.replay-sub{display:none}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{en as r,l as i,p as a}from"./store-FA83kfnc.js";import{o,s}from"./index-B6qvKFYN.js";import{c,u as l}from"./gate-BplJKcLG.js";import{M as u,j as d}from"./AccessibilitySettings-DSmFk9JC.js";import{s as f}from"./useDayTime-0XsqM14Q.js";import{a as p,c as m,d as h,i as g,o as _,r as v,u as y}from"./gallery-ColCPQQE.js";import{CLIP_SECONDS as b,GOLDEN_HOUR as x,cam as S,d as C,focusCenter as w,leave as T,n as E,overlayOptions as D,requestFrame as O,setDaytime as k,setFrozen as A,t as j,takeShot as M,toggleRecording as N,u as P,update as F,usePhoto as I}from"./photoMode-CYxQfgUF.js";var L=n(e(),1),R=t();function z(){let e=(0,L.useRef)(null),t=I(),n=a(e=>e.floor),[r,i]=(0,L.useState)({w:window.innerWidth,h:window.innerHeight});return(0,L.useEffect)(()=>{let e=()=>i({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let t=e.current;if(!t)return;let n=window.devicePixelRatio||1;t.width=Math.round(r.w*n),t.height=Math.round(r.h*n);let i=t.getContext(`2d`);i&&(i.clearRect(0,0,t.width,t.height),j(i,t.width,t.height,D(!0)))},[t.filter,t.stamp,t.caption,t.guides,r,n]),(0,R.jsx)(`canvas`,{ref:e,className:`photo-preview`,"aria-hidden":`true`})}function B(){let e=I(e=>e.recording),[,t]=(0,L.useState)(0);if((0,L.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),250);return()=>clearInterval(n)},[e]),!e)return null;let n=Math.min(e.limit,(performance.now()-e.started)/1e3),r=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`;return(0,R.jsxs)(`div`,{className:`photo-rec`,role:`status`,children:[(0,R.jsx)(`span`,{className:`photo-rec-dot`}),` REC `,r(n),` / `,r(e.limit),(0,R.jsxs)(`button`,{className:`btn btn-small`,onClick:()=>void N(),children:[(0,R.jsx)(o,{children:`β Stop`}),` `,(0,R.jsx)(`kbd`,{children:`V`})]})]})}function V({item:e}){return e.kind===`shot`?(0,R.jsx)(`img`,{src:e.thumb??e.url,alt:``}):(0,R.jsx)(`video`,{src:e.url,muted:!0,preload:`metadata`})}function H(){let e=s(),t=p(e=>e.items),n=t.reduce((e,t)=>e+t.bytes,0);return(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsxs)(`h4`,{children:[(0,R.jsx)(o,{children:`Gallery`}),` `,(0,R.jsx)(`span`,{className:`muted small`,children:t.length?e(`{count} Β· {size} Β· this tab only`,{count:t.length,size:y(n)}):e(`empty`)})]}),t.length>0&&(0,R.jsx)(`ul`,{className:`photo-gallery`,children:[...t].reverse().map(t=>(0,R.jsxs)(`li`,{title:t.name,children:[(0,R.jsx)(V,{item:t}),(0,R.jsxs)(`div`,{className:`photo-gallery-meta`,children:[(0,R.jsx)(`span`,{children:t.kind===`shot`?`πΈ ${t.width}Γ${t.height}`:`${t.kind===`replay`?`βͺ`:`π¬`} ${Math.round(t.seconds??0)} s`}),(0,R.jsx)(`span`,{className:`muted`,children:y(t.bytes)})]}),(0,R.jsxs)(`div`,{className:`photo-gallery-actions`,children:[(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>g(t),"aria-label":e(`Download {name}`,{name:t.name}),children:`β¬`}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>v(t.id),"aria-label":e(`Delete {name}`,{name:t.name}),children:`π`})]})]},t.id))})]})}function U(){let[e,t]=(0,L.useState)({fov:S.fov,roll:S.roll});return(0,L.useEffect)(()=>{let e=setInterval(()=>t(e=>e.fov===S.fov&&e.roll===S.roll?e:{fov:S.fov,roll:S.roll}),150);return()=>clearInterval(e)},[]),e}function W(){let e=s(),t=I(),n=l(e=>e.frozen),p=l(e=>e.replay),g=a(e=>e.toasts),v=a(e=>e.dismissToast),y=a(e=>e.floor),D=a(e=>e.floor===0?null:i(e.repos,e.floor)),j=a(e=>e.agents),{fov:L,roll:V}=U(),W=Object.values(j).filter(e=>(D?e.repoId===D.id:e.role===`ceo`)&&r(e.id)),G=h(window.innerWidth,window.innerHeight,window.devicePixelRatio||1,t.scale),K=f().t,q=t.daytime??K;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z,{}),(0,R.jsx)(B,{}),t.panel?(0,R.jsxs)(`aside`,{className:`photo-panel`,"aria-label":e(`Photo mode`),children:[(0,R.jsxs)(`header`,{className:`photo-head`,children:[(0,R.jsx)(`b`,{children:(0,R.jsx)(o,{children:`π· Photo mode`})}),(0,R.jsxs)(`button`,{className:`btn btn-small`,onClick:T,title:e(`Back to the office (or Esc with the mouse free)`),children:[(0,R.jsx)(o,{children:`Leave`}),` `,(0,R.jsx)(d,{action:`photo`})]})]}),t.note&&(0,R.jsx)(`p`,{className:`photo-note ${t.note.level===`error`?`photo-note-bad`:``}`,role:`status`,onClick:()=>F({note:null}),children:t.note.message?t.note.message.map(t=>e(t.key,t.values)).join(``):t.note.text}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>A(e.target.checked)}),` `,(0,R.jsx)(o,{children:`β Freeze the office`}),` `,(0,R.jsx)(`kbd`,{children:`F`})]}),(0,R.jsx)(`p`,{className:`muted small`,children:e(n?`Everyone holds still; the work carries on and catches up when you thaw.`:`Live: people, toys and the sky move. Good for clips.`)})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Camera`})}),(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Zoom`})}),(0,R.jsx)(`input`,{type:`range`,min:15,max:110,step:1,value:Math.round(L),onChange:e=>(S.fov=Number(e.target.value),O()),"aria-label":e(`Field of view`)}),(0,R.jsxs)(`b`,{children:[Math.round(L),`Β°`]})]}),(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Roll`})}),(0,R.jsx)(`input`,{type:`range`,min:-45,max:45,step:1,value:Math.round(V*180/Math.PI),onChange:e=>(S.roll=Math.max(-E,Math.min(E,Number(e.target.value)*Math.PI/180)),O()),"aria-label":e(`Roll`)}),(0,R.jsxs)(`b`,{children:[Math.round(V*180/Math.PI),`Β°`]})]}),(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t.dof,onChange:e=>F({dof:e.target.checked})}),` `,(0,R.jsx)(o,{children:`Depth of field`})]}),t.dof&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Focus`})}),(0,R.jsx)(`input`,{type:`range`,min:.3,max:40,step:.1,value:t.focus,onChange:e=>F({focus:Number(e.target.value)}),"aria-label":e(`Focus distance`)}),(0,R.jsxs)(`b`,{children:[t.focus.toFixed(1),` m`]})]}),(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Blur`})}),(0,R.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:t.blur,onChange:e=>F({blur:Number(e.target.value)}),"aria-label":e(`Blur strength`)}),(0,R.jsxs)(`b`,{children:[Math.round(t.blur*100),`%`]})]})]}),(0,R.jsxs)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>w(),children:[(0,R.jsx)(o,{children:`β Focus on the middle`}),` `,(0,R.jsx)(`kbd`,{children:`T`})]})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Filter`})}),(0,R.jsx)(`div`,{className:`photo-chips`,role:`radiogroup`,"aria-label":e(`Filter`),children:P.map(n=>(0,R.jsx)(`button`,{role:`radio`,"aria-checked":t.filter===n,className:`photo-chip ${t.filter===n?`on`:``}`,onClick:()=>F({filter:n}),children:e(C[n])},n))}),(0,R.jsxs)(`div`,{className:`photo-checks`,children:[(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t.stamp,onChange:e=>F({stamp:e.target.checked})}),` `,(0,R.jsx)(o,{children:`Logo stamp`})]}),(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t.caption,onChange:e=>F({caption:e.target.checked})}),` `,(0,R.jsx)(o,{children:`Floor and date`})]}),(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:t.guides,onChange:e=>F({guides:e.target.checked})}),` `,(0,R.jsx)(o,{children:`Thirds guides`})]})]})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsxs)(`h4`,{children:[(0,R.jsx)(o,{children:`Time of day`}),` `,(0,R.jsx)(`span`,{className:`muted small`,children:m(q)})]}),(0,R.jsx)(`input`,{type:`range`,min:0,max:1,step:.002,value:q,onChange:e=>k(Number(e.target.value)),"aria-label":e(`Time of day`),"aria-valuetext":m(q)}),(0,R.jsxs)(`div`,{className:`row wrap`,children:[(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>k(x),children:(0,R.jsx)(o,{children:`π Golden hour`})}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>k(.5),children:(0,R.jsx)(o,{children:`βοΈ Noon`})}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>k(.79),children:(0,R.jsx)(o,{children:`π Blue hour`})}),(0,R.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:()=>k(null),disabled:t.daytime===null,children:(0,R.jsx)(o,{children:`βΊ As it is`})})]})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Shot`})}),(0,R.jsxs)(`div`,{className:`photo-chips`,role:`radiogroup`,"aria-label":e(`Shot size`),children:[_.map(e=>(0,R.jsxs)(`button`,{role:`radio`,"aria-checked":t.scale===e,className:`photo-chip ${t.scale===e?`on`:``}`,onClick:()=>F({scale:e}),children:[e,`Γ`]},e)),(0,R.jsxs)(`span`,{className:`muted small`,children:[G.width,`Γ`,G.height]})]}),(0,R.jsxs)(`button`,{className:`btn photo-big`,disabled:!!t.busy,onClick:()=>void M(),children:[`πΈ `,e(t.busy===`Developingβ¦`?`Developingβ¦`:`Take the shot`),` `,(0,R.jsx)(`kbd`,{children:`Enter`})]}),(0,R.jsx)(`p`,{className:`muted small`,children:(0,R.jsx)(o,{children:`Saves a PNG to your downloads and copies it.`})})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Clip`})}),(0,R.jsxs)(`div`,{className:`photo-chips`,children:[b.map(e=>(0,R.jsxs)(`button`,{className:`photo-chip ${t.clipSeconds===e?`on`:``}`,"aria-pressed":t.clipSeconds===e,onClick:()=>F({clipSeconds:e}),children:[e,` s`]},e)),[30,60].map(e=>(0,R.jsxs)(`button`,{className:`photo-chip ${t.fps===e?`on`:``}`,"aria-pressed":t.fps===e,onClick:()=>F({fps:e}),children:[e,` fps`]},e))]}),(0,R.jsxs)(`label`,{className:`photo-row`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Camera`})}),(0,R.jsxs)(`select`,{value:t.orbit,onChange:e=>F({orbit:e.target.value}),"aria-label":e(`Cinematic orbit`),children:[(0,R.jsx)(`option`,{value:`free`,children:e(`Free (fly it yourself)`)}),y!==0&&(0,R.jsx)(`option`,{value:`gong`,children:e(`Orbit the gong`)}),y!==0&&(0,R.jsx)(`option`,{value:`board`,children:e(`Orbit the whiteboard`)}),W.map(t=>(0,R.jsx)(`option`,{value:`person:${t.id}`,children:e(`Orbit {name}`,{name:t.name})},t.id))]})]}),(0,R.jsxs)(`button`,{className:`btn photo-big ${t.recording?`photo-recording`:``}`,disabled:!t.recording&&!!t.busy,onClick:()=>void N(),children:[e(t.recording?`β Stop recording`:t.busy===`Saving the clipβ¦`?`Saving the clipβ¦`:`βΊ Record`),` `,(0,R.jsx)(`kbd`,{children:`V`})]}),(0,R.jsxs)(`p`,{className:`muted small`,children:[(0,R.jsx)(o,{children:`A WebM with the officeβs sound, up to a minute`}),n?e(` (frozen: a still scene, unless the camera moves)`):``,`.`]})]}),(0,R.jsxs)(`section`,{className:`photo-section`,children:[(0,R.jsx)(`h4`,{children:(0,R.jsx)(o,{children:`Instant replay`})}),(0,R.jsxs)(`label`,{className:`toggle`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>c(e.target.checked)}),` `,(0,R.jsx)(o,{children:`Keep the last 15 s, any time`})]}),(0,R.jsxs)(`p`,{className:`muted small`,children:[(0,R.jsx)(o,{children:`Press`}),` `,(0,R.jsx)(d,{action:`saveReplay`}),` `,(0,R.jsx)(o,{children:`to save them. Off by default: it records all the time, which takes memory.`})]})]}),(0,R.jsx)(H,{}),(0,R.jsxs)(`p`,{className:`photo-keys muted small`,children:[(0,R.jsx)(o,{children:`Click the view to steer Β·`}),` `,(0,R.jsx)(u,{joined:!0}),` `,(0,R.jsx)(o,{children:`fly`}),` Β· `,(0,R.jsx)(`kbd`,{children:`Space`}),`/`,(0,R.jsx)(`kbd`,{children:`C`}),` `,(0,R.jsx)(o,{children:`up/down`}),` Β· `,(0,R.jsx)(d,{action:`run`}),` `,(0,R.jsx)(o,{children:`faster`}),` Β· `,(0,R.jsx)(d,{action:`rotateLeft`}),`/`,(0,R.jsx)(d,{action:`rotateRight`}),` `,(0,R.jsx)(o,{children:`roll Β· wheel zoom Β·`}),` `,(0,R.jsx)(`kbd`,{children:`R`}),` `,(0,R.jsx)(o,{children:`reset`}),` Β· `,(0,R.jsx)(`kbd`,{children:`H`}),` `,(0,R.jsx)(o,{children:`hide panel`}),` Β· `,(0,R.jsx)(`kbd`,{children:`Esc`}),` `,(0,R.jsx)(o,{children:`frees the mouse, then leaves`})]})]}):(0,R.jsxs)(`button`,{className:`photo-show`,onClick:()=>F({panel:!0}),children:[`π· `,(0,R.jsx)(`kbd`,{children:`H`}),` `,(0,R.jsx)(o,{children:`show the panel`})]}),(0,R.jsx)(`div`,{className:`toasts photo-toasts`,children:g.map(e=>(0,R.jsx)(`div`,{className:`toast toast-${e.level}`,onClick:()=>v(e.id),children:e.text},e.id))})]})}export{W as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.photo-preview{pointer-events:none;z-index:5;width:100vw;height:100vh;position:fixed;inset:0}.photo-panel{z-index:30;background:var(--paper);border:3px solid var(--ink);width:min(320px,100vw - 24px);max-height:calc(100vh - 24px);box-shadow:0 5px 0 var(--ink);border-radius:18px;padding:0 14px 12px;font-size:.9rem;animation:.2s ease-out pop;position:fixed;top:12px;right:12px;overflow-y:auto}.photo-head{z-index:1;background:var(--accent);border-bottom:3px solid var(--ink);justify-content:space-between;align-items:center;gap:8px;margin:0 -14px;padding:10px 14px;font-size:1.05rem;display:flex;position:sticky;top:0}.photo-section{border-bottom:2px dashed #1f1d2b26;flex-direction:column;gap:6px;padding:10px 0;display:flex}.photo-section h4{justify-content:space-between;align-items:baseline;margin:0;font-size:.95rem;display:flex}.photo-section p{margin:0}.photo-section input[type=range]{width:100%;accent-color:var(--accent)}.photo-row{grid-template-columns:54px 1fr auto;align-items:center;gap:8px;display:grid}.photo-row b{text-align:right;min-width:3.4em;font-size:.85rem}.photo-row select{font:inherit;border:2px solid var(--ink);background:#fff;border-radius:8px;grid-column:2/4;padding:3px 6px}.photo-chips{flex-wrap:wrap;align-items:center;gap:5px;display:flex}.photo-chip{font:inherit;border:2px solid var(--ink);color:var(--ink);cursor:pointer;background:#fff;border-radius:999px;padding:3px 9px;font-size:.82rem;font-weight:600}.photo-chip.on{background:var(--accent);color:#fff}.photo-checks{flex-wrap:wrap;gap:4px 12px;display:flex}.photo-big{background:var(--accent);color:#fff;box-shadow:0 3px 0 var(--ink)}.photo-big.photo-recording{background:#e63946}.photo-big kbd{color:var(--ink)}.photo-keys{margin:10px 0 0;line-height:1.9}.photo-note{border:2px solid var(--ink);overflow-wrap:anywhere;cursor:pointer;background:#d8f9df;border-radius:10px;margin:10px 0 0;padding:8px 10px;font-size:.85rem}.photo-note-bad{background:#ffd6dc}.photo-gallery{grid-template-columns:1fr 1fr;gap:8px;margin:0;padding:0;list-style:none;display:grid}.photo-gallery li{border:2px solid var(--ink);background:#fff;border-radius:10px;position:relative;overflow:hidden}.photo-gallery img,.photo-gallery video{aspect-ratio:16/9;object-fit:cover;background:#222;width:100%;display:block}.photo-gallery-meta{justify-content:space-between;gap:4px;padding:2px 6px;font-size:.72rem;display:flex}.photo-gallery-actions{gap:3px;display:flex;position:absolute;top:4px;right:4px}.photo-gallery-actions .btn{background:#fffdf6e6;padding:0 5px}.photo-rec{z-index:31;background:var(--paper);border:3px solid var(--ink);box-shadow:0 4px 0 var(--ink);font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:10px;padding:6px 8px 6px 14px;font-weight:700;display:flex;position:fixed;top:14px;left:50%;transform:translate(-50%)}.photo-rec-dot{background:#e63946;border-radius:50%;width:12px;height:12px;animation:1s steps(2,start) infinite photo-blink}@keyframes photo-blink{to{visibility:hidden}}.photo-show{z-index:30;font:inherit;border:2px solid var(--ink);cursor:pointer;background:#fffdf6d9;border-radius:12px;padding:6px 12px;font-weight:600;position:fixed;top:12px;right:12px}.toasts.photo-toasts{align-items:flex-start;position:fixed;bottom:16px;left:16px;right:auto}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pipeline-BOTOZ69L.js","assets/bloomMarks-DariC6lY.js","assets/jsx-runtime-BFUkm7bt.js","assets/index-B6qvKFYN.js","assets/store-FA83kfnc.js","assets/index-COpmc42S.css","assets/useDayTime-0XsqM14Q.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{s as e,u as t}from"./jsx-runtime-BFUkm7bt.js";import{Ra as n,en as r,m as i,wa as a}from"./store-FA83kfnc.js";import{Bt as o,F as s,Ht as c,O as l,Tt as u,V as d,X as f,_t as p,ct as m,dt as h,f as g,g as _,gt as v,it as y,nt as b,pt as x,ut as ee,wt as te,yt as ne,zt as S}from"./bloomMarks-DariC6lY.js";import{l as C,t as w}from"./useGraphics-Cif18p7Q.js";import{G as T,H as E,k as D}from"./mic-B316hcCe.js";import{u as O}from"./gate-BplJKcLG.js";import{r as re}from"./useDayTime-0XsqM14Q.js";import{Ar as ie,Mr as ae,Or as oe,jr as se,kr as ce}from"./Office-BBnd6tyn.js";import{_ as le,d as k,f as A,p as j}from"./gallery-ColCPQQE.js";import{a as M,activeClip as N,c as P,cam as F,f as I,focusCenter as L,i as R,l as z,leave as B,o as V,overlayOptions as H,p as U,r as W,requestFrame as G,s as ue,setBridge as K,setFrozen as de,t as fe,takeRedraw as pe,takeShot as me,toggleRecording as he,update as q,usePhoto as J}from"./photoMode-CYxQfgUF.js";var Y=t(e(),1),X=.014,ge=`
|
|
3
|
+
varying vec2 vUv;
|
|
4
|
+
void main() {
|
|
5
|
+
vUv = uv;
|
|
6
|
+
gl_Position = vec4(position.xy, 0.0, 1.0);
|
|
7
|
+
}`,_e=`
|
|
8
|
+
#include <packing>
|
|
9
|
+
uniform sampler2D tColor;
|
|
10
|
+
uniform sampler2D tDepth;
|
|
11
|
+
uniform vec2 uSize;
|
|
12
|
+
uniform vec2 uOrigin;
|
|
13
|
+
uniform vec2 uFull;
|
|
14
|
+
uniform float uPx;
|
|
15
|
+
uniform float uSeed;
|
|
16
|
+
uniform float uDof;
|
|
17
|
+
uniform float uFocus;
|
|
18
|
+
uniform float uBlur;
|
|
19
|
+
uniform float uNear;
|
|
20
|
+
uniform float uFar;
|
|
21
|
+
uniform float uSaturation;
|
|
22
|
+
uniform float uContrast;
|
|
23
|
+
uniform vec3 uGain;
|
|
24
|
+
uniform vec3 uLift;
|
|
25
|
+
uniform float uVignette;
|
|
26
|
+
uniform float uGrain;
|
|
27
|
+
uniform float uPosterize;
|
|
28
|
+
uniform float uInk;
|
|
29
|
+
varying vec2 vUv;
|
|
30
|
+
|
|
31
|
+
float distanceAt(vec2 uv) {
|
|
32
|
+
float d = unpackRGBAToDepth(texture2D(tDepth, uv));
|
|
33
|
+
return -perspectiveDepthToViewZ(d, uNear, uFar);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// How blurred a point at this distance is, 0..1 (thin-lens-like: grows with distance from the focus plane).
|
|
37
|
+
float coc(float dist) {
|
|
38
|
+
return clamp(abs(dist - uFocus) / max(dist, 0.05) * 1.6, 0.0, 1.0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
float luma(vec3 c) { return dot(c, vec3(0.2126, 0.7152, 0.0722)); }
|
|
42
|
+
|
|
43
|
+
// Flat bands of light and shade, as printed: the brightness is stepped, the hue kept (stepping each channel
|
|
44
|
+
// would turn smooth lighting into stripes of other colours), and each step is softened a little so faint noise in
|
|
45
|
+
// the lighting doesn't turn into ragged edges.
|
|
46
|
+
vec3 posterize(vec3 c) {
|
|
47
|
+
if (uPosterize < 2.0) return c;
|
|
48
|
+
float y = luma(c) * uPosterize;
|
|
49
|
+
float stepped = (floor(y) + smoothstep(0.3, 0.7, fract(y))) / uPosterize;
|
|
50
|
+
return c * (stepped / max(luma(c), 0.004));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
float hash(vec2 p) {
|
|
54
|
+
p = fract(p * vec2(123.34, 456.21));
|
|
55
|
+
p += dot(p, p + 45.32 + uSeed);
|
|
56
|
+
return fract(p.x * p.y);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
void main() {
|
|
60
|
+
vec3 c = texture2D(tColor, vUv).rgb;
|
|
61
|
+
|
|
62
|
+
if (uDof > 0.5) {
|
|
63
|
+
// Gathering what spills onto this pixel: each sample reaches as far as its own blur, and one behind this pixel
|
|
64
|
+
// only as far as this pixel is blurred itself (a sharp face keeps its edge against a soft background).
|
|
65
|
+
float d0 = distanceAt(vUv);
|
|
66
|
+
float r0 = coc(d0) * uBlur;
|
|
67
|
+
vec3 sum = c;
|
|
68
|
+
float total = 1.0;
|
|
69
|
+
for (int i = 1; i < 32; i++) {
|
|
70
|
+
float rs = sqrt(float(i) / 31.0) * uBlur;
|
|
71
|
+
float a = float(i) * 2.39996;
|
|
72
|
+
vec2 uv = vUv + vec2(cos(a), sin(a)) * rs / uSize;
|
|
73
|
+
float d = distanceAt(uv);
|
|
74
|
+
float r = coc(d) * uBlur;
|
|
75
|
+
float reach = d > d0 ? min(r, r0) : r;
|
|
76
|
+
float w = clamp(reach - rs + 1.0, 0.0, 1.0);
|
|
77
|
+
sum += texture2D(tColor, uv).rgb * w;
|
|
78
|
+
total += w;
|
|
79
|
+
}
|
|
80
|
+
c = sum / total;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (uInk > 0.0) {
|
|
84
|
+
vec2 s = vec2(max(1.0, uPx)) / uSize;
|
|
85
|
+
float tl = luma(texture2D(tColor, vUv + vec2(-s.x, s.y)).rgb);
|
|
86
|
+
float t = luma(texture2D(tColor, vUv + vec2(0.0, s.y)).rgb);
|
|
87
|
+
float tr = luma(texture2D(tColor, vUv + vec2(s.x, s.y)).rgb);
|
|
88
|
+
float l = luma(texture2D(tColor, vUv + vec2(-s.x, 0.0)).rgb);
|
|
89
|
+
float r = luma(texture2D(tColor, vUv + vec2(s.x, 0.0)).rgb);
|
|
90
|
+
float bl = luma(texture2D(tColor, vUv + vec2(-s.x, -s.y)).rgb);
|
|
91
|
+
float b = luma(texture2D(tColor, vUv + vec2(0.0, -s.y)).rgb);
|
|
92
|
+
float br = luma(texture2D(tColor, vUv + vec2(s.x, -s.y)).rgb);
|
|
93
|
+
float gx = -tl - 2.0 * l - bl + tr + 2.0 * r + br;
|
|
94
|
+
float gy = -tl - 2.0 * t - tr + bl + 2.0 * b + br;
|
|
95
|
+
float edge = smoothstep(0.18, 0.5, length(vec2(gx, gy)));
|
|
96
|
+
c = posterize(c);
|
|
97
|
+
c = mix(c, vec3(0.06, 0.05, 0.08), edge * uInk);
|
|
98
|
+
} else {
|
|
99
|
+
c = posterize(c);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
float y = luma(c);
|
|
103
|
+
c = mix(vec3(y), c, uSaturation);
|
|
104
|
+
c = (c - 0.5) * uContrast + 0.5;
|
|
105
|
+
c = c * uGain + uLift;
|
|
106
|
+
|
|
107
|
+
vec2 full = uOrigin + gl_FragCoord.xy;
|
|
108
|
+
if (uVignette > 0.0) {
|
|
109
|
+
vec2 p = (full / uFull - 0.5) * vec2(uFull.x / uFull.y, 1.0);
|
|
110
|
+
c *= 1.0 - uVignette * smoothstep(0.35, 1.05, length(p));
|
|
111
|
+
}
|
|
112
|
+
if (uGrain > 0.0) c += (hash(floor(full / max(1.0, uPx * 0.75))) - 0.5) * uGrain;
|
|
113
|
+
|
|
114
|
+
gl_FragColor = vec4(clamp(c, 0.0, 1.0), 1.0);
|
|
115
|
+
}`,ve=class{gl;color=null;depth=new c(1,1,{minFilter:m,magFilter:m,depthBuffer:!0});depthMaterial=new y({depthPacking:p});material;quad;quadScene=new te;quadCamera=new ee(-1,1,1,-1,0,1);size=new S;clear=new l;shown=[];supported=!0;constructor(e){this.gl=e,this.depthMaterial.blending=0,this.material=new u({vertexShader:ge,fragmentShader:_e,depthTest:!1,depthWrite:!1,toneMapped:!1,uniforms:{tColor:{value:null},tDepth:{value:this.depth.texture},uSize:{value:new S(1,1)},uOrigin:{value:new S},uFull:{value:new S(1,1)},uPx:{value:1},uSeed:{value:0},uDof:{value:0},uFocus:{value:5},uBlur:{value:0},uNear:{value:.05},uFar:{value:500},uSaturation:{value:1},uContrast:{value:1},uGain:{value:new o(1,1,1)},uLift:{value:new o},uVignette:{value:0},uGrain:{value:0},uPosterize:{value:0},uInk:{value:0}}}),this.quad=new b(new x(2,2),this.material),this.quad.frustumCulled=!1,this.quadScene.add(this.quad)}margin(e){let t=e.grade.ink>0?Math.ceil(e.px)+2:0;return e.dof&&(t=Math.max(t,Math.ceil(e.dof.blur*X*e.full[1])+2)),t}render(e,t,n,r,i){let a=this.gl;if(a.setRenderTarget(null),n)n.render(r);else{let n=a.autoClear;a.autoClear=!0,a.render(e,t),a.autoClear=n}if(!this.supported||!i.dof&&!U(i.grade))return;a.getDrawingBufferSize(this.size);let o=this.size.x,s=this.size.y;(!this.color||this.color.image.width!==o||this.color.image.height!==s)&&(this.color?.dispose(),this.color=new d(o,s),this.color.minFilter=f,this.color.magFilter=f);try{a.copyFramebufferToTexture(this.color)}catch{this.supported=!1;return}let c=this.material.uniforms;i.dof&&((this.depth.width!==o||this.depth.height!==s)&&this.depth.setSize(o,s),this.depthPass(e,t,i.seeThrough)),c.tColor.value=this.color,c.uSize.value.set(o,s),c.uOrigin.value.set(i.origin[0],i.origin[1]),c.uFull.value.set(i.full[0],i.full[1]),c.uPx.value=i.px,c.uSeed.value=i.seed,c.uDof.value=+!!i.dof,c.uFocus.value=i.dof?.focus??5,c.uBlur.value=i.dof?i.dof.blur*X*i.full[1]:0,c.uNear.value=t.near,c.uFar.value=t.far;let l=i.grade;c.uSaturation.value=l.saturation,c.uContrast.value=l.contrast,c.uGain.value.set(l.gain[0],l.gain[1],l.gain[2]),c.uLift.value.set(l.lift[0],l.lift[1],l.lift[2]),c.uVignette.value=l.vignette,c.uGrain.value=l.grain,c.uPosterize.value=l.posterize,c.uInk.value=l.ink,a.render(this.quadScene,this.quadCamera)}depthPass(e,t,n){let r=this.gl,i=e.background,a=r.shadowMap.autoUpdate,o=r.getClearAlpha();r.getClearColor(this.clear),this.shown.length=0;for(let e=0;e<n.length;e++)this.shown.push(n[e].visible),n[e].visible=!1;e.background=null,e.overrideMaterial=this.depthMaterial,r.shadowMap.autoUpdate=!1,r.setClearColor(16777215,1),r.setRenderTarget(this.depth),r.clear(),r.render(e,t),r.setRenderTarget(null),r.setClearColor(this.clear,o),r.shadowMap.autoUpdate=a,e.overrideMaterial=null,e.background=i;for(let e=0;e<n.length;e++)n[e].visible=this.shown[e]}dispose(){this.color?.dispose(),this.depth.dispose(),this.depthMaterial.dispose(),this.material.dispose(),this.quad.geometry.dispose()}},Z=[`forward`,`back`,`left`,`right`,`run`,`rotateLeft`,`rotateRight`],Q=`Space`,$=`KeyC`;function ye(e){let t=e.target;return!t||t===document.body?`view`:t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable?`text`:t.tagName===`INPUT`?[`range`,`checkbox`,`radio`,`button`].includes(t.type)?`control`:`text`:t.tagName===`BUTTON`?`control`:`view`}function be(e,t){if(e===`gong`)t.set(n.x,n.y,n.z);else if(e===`board`)t.set(0,a.y+a.h/2,a.z);else if(e.startsWith(`person:`)){let n=r(e.slice(7));if(!n)return!1;n.stage===`seated`?t.set(n.seatX,1.1,n.seatZ):t.set(n.x,1.35,n.z)}else return!1;return!0}function xe(e){for(;e;e=e.parent)if(!e.visible&&!e.userData.standIn)return!1;return!0}function Se(e){for(let t=0;e&&t<6;e=e.parent,t++){let t=e.userData;if(t.billboard||t.facesCamera)return!0}return!1}function Ce(e){for(;e;e=e.parent)if(e.userData.firstPerson)return!0;return!1}function we(){let e=_(e=>e.gl),t=_(e=>e.scene),n=_(e=>e.camera),r=_(e=>e.size),a=_(e=>e.get),c=O(e=>e.frozen),l=(0,Y.useMemo)(()=>new h(n.fov,1,n.near,n.far),[n]),u=(0,Y.useMemo)(()=>new ve(e),[e]);(0,Y.useEffect)(()=>()=>u.dispose(),[u]);let d=C(w),[f,p]=(0,Y.useState)(null),m=(0,Y.useMemo)(()=>{let e={keys:new Set,input:{forward:0,right:0,up:0,roll:0,fast:!1},orbit:null,orbitKey:`free`,target:new o,facing:[],firstPerson:[],seeThrough:[],hidden:[],fogBack:0,scanAt:-1/0,frames:0,seed:0,q:new v,buf:new S,ray:new ne,center:new S,unlockedAt:-1/0,lookFilter:ce(),width:1,height:1,pipe:null,delta:0,post:{grade:I.none,dof:null,seed:0,origin:[0,0],full:[1,1],px:1,seeThrough:[]},dof:{focus:4,blur:.5},visit:t=>{let n=t.userData;n.billboard&&t.children[0]&&e.facing.push(t.children[0]),n.facesCamera&&e.facing.push(t),n.firstPerson&&e.firstPerson.push(t);let r=t;r.isMesh&&!Array.isArray(r.material)&&r.material.transparent&&!Se(t)&&e.seeThrough.push(t)}};return e.post.seeThrough=e.seeThrough,e},[]);(0,Y.useLayoutEffect)(()=>{m.width=Math.max(1,r.width),m.height=Math.max(1,r.height),f?.setSize(m.width,m.height),G()},[m,r,f]),(0,Y.useEffect)(()=>{if(d===`low`)return;let n=!0,r=null;return i(async()=>{let{createPipeline:e}=await import(`./pipeline-BOTOZ69L.js`);return{createPipeline:e}},__vite__mapDeps([0,1,2,3,4,5,6])).then(({createPipeline:i})=>{if(n)try{r=i(e,t,l,d),r.setSize(m.width,m.height),m.pipe=r,p(r),G()}catch{}}),()=>{n=!1,m.pipe=null,r?.dispose(),p(null)}},[e,t,l,m,d]),(0,Y.useLayoutEffect)(()=>{let e=new s().setFromQuaternion(n.quaternion,`YXZ`);Object.assign(F,M(n.position.x,n.position.y,n.position.z,e.y,e.x,n.fov)),G()},[n]);let{prepare:y,putBack:b,frame:x}=(0,Y.useMemo)(()=>{let r=()=>{m.facing.length=0,m.firstPerson.length=0,m.seeThrough.length=0,t.traverse(m.visit),m.scanAt=m.frames},i=()=>{l.position.set(F.x,F.y,F.z),l.rotation.set(F.pitch,F.yaw,F.roll,`YXZ`);let e=m.width/m.height;(l.fov!==F.fov||l.aspect!==e)&&(l.fov=F.fov,l.aspect=e,l.updateProjectionMatrix()),l.updateMatrixWorld(),m.frames-m.scanAt>30&&r();for(let e=0;e<m.facing.length;e++){let t=m.facing[e];t.parent&&(t.parent.getWorldQuaternion(m.q),t.quaternion.copy(l.quaternion).premultiply(m.q.invert()))}m.hidden.length=0;for(let e=0;e<m.firstPerson.length;e++)m.hidden.push(m.firstPerson[e].visible),m.firstPerson[e].visible=!1;let i=t.fog;m.fogBack=i?.isFog?l.position.distanceTo(n.position):0,i&&m.fogBack&&(i.near+=m.fogBack,i.far+=m.fogBack);let a=J.getState(),o=m.post;o.grade=I[a.filter],m.dof.focus=a.focus,m.dof.blur=a.blur,o.dof=a.dof&&a.blur>0?m.dof:null},a=()=>{for(let e=0;e<m.firstPerson.length;e++)m.firstPerson[e].visible=m.hidden[e];let e=t.fog;e&&m.fogBack&&(e.near-=m.fogBack,e.far-=m.fogBack),m.fogBack=0},o=()=>{i(),e.getDrawingBufferSize(m.buf);let n=m.post;n.origin[0]=0,n.origin[1]=0,n.full[0]=m.buf.x,n.full[1]=m.buf.y,n.px=e.getPixelRatio(),n.seed=m.seed,u.render(t,l,m.pipe,m.delta,n),a(),N()?.draw(),m.frames++};return{prepare:i,putBack:a,frame:(e,t)=>{m.delta=e;let n=m.keys,r=m.input,i=D();r.forward=+!!E(i,`forward`,n)-!!E(i,`back`,n),r.right=+!!E(i,`right`,n)-!!E(i,`left`,n),r.up=+!!n.has(Q)-!!n.has($),r.roll=+!!E(i,`rotateRight`,n)-!!E(i,`rotateLeft`,n),r.fast=E(i,`run`,n);let a=J.getState().orbit,s=!1;if(a!==`free`&&be(a,m.target)){let t=m.target;(m.orbitKey!==a||!m.orbit)&&(m.orbit=V(F,t.x,t.y,t.z)),m.orbitKey=a,m.orbit.cx=t.x,m.orbit.cy=t.y,m.orbit.cz=t.z,ue(m.orbit,F,e),P(F,r.roll,e),s=!0}else a!==`free`&&q({orbit:`free`}),m.orbitKey=`free`,W(F,r,e),s=r.forward!==0||r.right!==0||r.up!==0||r.roll!==0||Math.abs(F.vx)+Math.abs(F.vy)+Math.abs(F.vz)>1e-4;let c=N()!==null;c&&(m.seed=(m.seed+.618)%64),(pe()||s||t||c)&&o()}}},[e,t,l,n,u,m]);return(0,Y.useEffect)(()=>{if(!c)return;let e=0,t=performance.now(),n=r=>{x(Math.min(.1,Math.max(0,(r-t)/1e3)),!1),t=r,e=requestAnimationFrame(n)};return G(),e=requestAnimationFrame(n),()=>cancelAnimationFrame(e)},[c,x]),g((e,t)=>{O.getState().frozen||x(Math.min(t,.1),!0)},1),(0,Y.useEffect)(()=>J.subscribe((e,t)=>{e.daytime!==t.daytime&&O.getState().frozen&&re(a()),G()}),[a]),(0,Y.useEffect)(()=>{let t=e.domElement,r=m.keys,i=e=>{let t=ye(e);if(t===`text`||e.ctrlKey||e.metaKey||e.altKey)return;let i=e.code;if(i===`Escape`){!document.pointerLockElement&&performance.now()-m.unlockedAt>400&&B();return}let a=D();if(i===Q||i===$||Z.some(e=>T(a,e,i))){if(t===`control`&&(i.startsWith(`Arrow`)||i===Q))return;e.preventDefault(),r.add(i);return}if(!e.repeat){if(i===`Enter`&&t===`view`)me();else if(i===`KeyF`)de(!O.getState().frozen);else if(i===`KeyH`)q({panel:!J.getState().panel});else if(i===`KeyT`)L();else if(i===`KeyV`)he();else if(i===`KeyR`)F.roll=0,F.fov=n.fov,G();else return;e.preventDefault()}},a=e=>void r.delete(e.code),o=()=>r.clear(),s=e=>{if(e.button===0&&document.pointerLockElement!==t)try{t.requestPointerLock?.()?.catch?.(()=>void 0)}catch{}},c=e=>{if(document.pointerLockElement!==t||J.getState().orbit!==`free`)return;let n=ie(m.lookFilter,e.movementX,e.movementY,e.timeStamp);if(!n)return;let{sensitivity:r,invertY:i}=ae.getState(),a=oe*r*Math.min(1,F.fov/72);R(F,n[0]*a,n[1]*a*(i?-1:1)),G()},l=e=>{e.target?.closest?.(`.photo-panel`)||(F.fov=z(F.fov,e.deltaMode===1?e.deltaY*40:e.deltaY),G())},u=()=>{se(m.lookFilter),document.pointerLockElement||(m.unlockedAt=performance.now())};return window.addEventListener(`keydown`,i),window.addEventListener(`keyup`,a),window.addEventListener(`blur`,o),t.addEventListener(`mousedown`,s),document.addEventListener(`mousemove`,c),window.addEventListener(`wheel`,l,{passive:!0}),document.addEventListener(`pointerlockchange`,u),()=>{window.removeEventListener(`keydown`,i),window.removeEventListener(`keyup`,a),window.removeEventListener(`blur`,o),t.removeEventListener(`mousedown`,s),document.removeEventListener(`mousemove`,c),window.removeEventListener(`wheel`,l),document.removeEventListener(`pointerlockchange`,u)}},[e,m,n]),(0,Y.useEffect)(()=>(K({frames:()=>m.frames,focusCenter(){y(),b(),m.ray.setFromCamera(m.center,l);for(let e of m.ray.intersectObjects(t.children,!0)){let t=e.object;if(t.isMesh&&t.frustumCulled&&xe(t)&&!Ce(t)&&(Array.isArray(t.material)||!t.material.transparent))return e.distance}return null},async shot(n){let{width:r,height:i,scale:a}=k(m.width,m.height,window.devicePixelRatio||1,n),o=document.createElement(`canvas`);o.width=r,o.height=i;let s=o.getContext(`2d`);if(!s)throw Error(`the browser could not make a canvas that big`);y(),e.getDrawingBufferSize(m.buf);let c=m.buf.x,d=m.buf.y,f=m.post;f.full[0]=r,f.full[1]=i,f.px=r/m.width;let p=f.dof!==null||U(f.grade),h=Math.max(p?u.margin(f):0,m.pipe?Math.round(Math.min(c,d)*.08):0);for(let n of A(r,i,c,d,h))l.setViewOffset(r,i,n.viewX,n.viewY,c,d),f.origin[0]=n.viewX,f.origin[1]=i-(n.viewY+d),u.render(t,l,m.pipe,0,f),s.drawImage(e.domElement,n.x-n.viewX,n.y-n.viewY,n.w,n.h,n.x,n.y,n.w,n.h);l.clearViewOffset(),l.aspect=m.width/m.height,l.updateProjectionMatrix(),b(),G(),fe(s,r,i,H(!1));let g=await j(o,`image/png`),_=await le(o,r,i);return o.width=0,{png:g,thumb:_,width:r,height:i,scale:a}}}),()=>K(null)),[e,t,l,u,m,y,b]),null}export{we as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{Bt as r,f as i,gt as a,tt as o}from"./bloomMarks-DariC6lY.js";import{a as s}from"./director-CrzFgnoP.js";import{n as c,r as l}from"./Office-BBnd6tyn.js";import{a as u,i as d,l as f,n as p,o as m}from"./kit-C6ByUQ-Y.js";var h=n(e(),1),g=t(),_=44,v=260,y=_/(v/2),b=26;function x({run:e,elevation:t}){let n=(0,h.useRef)(null),x=(0,h.useRef)(null),S=m(e.side),C=(0,h.useMemo)(()=>{let n=s(e.seed),r=n()<.5?1:-1;return{dir:r,x:S*(290+n()*50),y:p(t)+70+n()*20,z0:-r*430,z1:r*430,livery:[`#e63946`,`#1d3557`,`#2a9d8f`,`#f4a261`][Math.floor(n()*4)]}},[e.seed,S,t]),w=(0,h.useMemo)(()=>({m:new o,q:new a,v:new r,sc:new r,born:new Float32Array(v).fill(-1),pos:new Float32Array(v*3),next:0}),[]);(0,h.useLayoutEffect)(()=>{let e=x.current;if(e){w.m.makeScale(0,0,0);for(let t=0;t<v;t++)e.setMatrixAt(t,w.m);e.instanceMatrix.needsUpdate=!0}},[w]);let T=(0,h.useMemo)(()=>({jet:null}),[]);(0,h.useEffect)(()=>(T.jet=c(`jet`),()=>T.jet?.stop(1.5)),[T]),i(()=>{let r=e.t,i=Math.min(1,r/_),a=u(C.z0,C.z1,i),o=n.current;o&&(o.visible=r<_,o.position.set(C.x,C.y,a),o.rotation.y=C.dir>0?0:Math.PI);let s=x.current;if(!s)return;for(;r<_&&w.next*y<=r&&w.next<v/2;){let e=u(C.z0,C.z1,Math.min(1,w.next*y/_))-C.dir*14;for(let t of[0,1]){let n=w.next*2+t;w.born[n]=w.next*y,w.pos[n*3]=C.x+(t?7:-7),w.pos[n*3+1]=C.y-1,w.pos[n*3+2]=e}w.next++}for(let e=0;e<v;e++){let t=w.born[e];if(t<0)continue;let n=r-t,i=n>b?0:(2.2+n*.25)*Math.min(1,(b-n)/6)*Math.min(1,n*3+.3);w.v.set(w.pos[e*3],w.pos[e*3+1]-n*.15,w.pos[e*3+2]),w.sc.set(i,i*.8,i*1.6),s.setMatrixAt(e,w.m.compose(w.v,w.q,w.sc))}s.instanceMatrix.needsUpdate=!0;let c=l(C.x,C.y-t,a,160);T.jet?.set(c.gain*d(r,_,6),c.pan,.9+.2*(1-i))});let E=f(`#f4f6fa`);return(0,g.jsxs)(`group`,{children:[(0,g.jsxs)(`group`,{ref:n,scale:1.15,children:[(0,g.jsx)(`mesh`,{material:E,"rotation-x":Math.PI/2,children:(0,g.jsx)(`capsuleGeometry`,{args:[2.1,30,6,12]})}),[-2.02,2.02].map(e=>(0,g.jsx)(`mesh`,{material:f(`#2b3a55`),position:[e,.6,1],children:(0,g.jsx)(`boxGeometry`,{args:[.12,.45,22]})},e)),(0,g.jsx)(`mesh`,{material:E,position:[0,-.6,-1],children:(0,g.jsx)(`boxGeometry`,{args:[34,.5,5]})}),(0,g.jsx)(`mesh`,{material:f(C.livery),position:[0,4.2,-14.5],children:(0,g.jsx)(`boxGeometry`,{args:[.6,6.5,4.5]})}),(0,g.jsx)(`mesh`,{material:E,position:[0,1,-15],children:(0,g.jsx)(`boxGeometry`,{args:[12,.4,3]})}),[-7,7].map(e=>(0,g.jsx)(`mesh`,{material:f(`#9aa3b5`),position:[e,-1.8,.8],"rotation-x":Math.PI/2,children:(0,g.jsx)(`cylinderGeometry`,{args:[1,1,4.5,10]})},e))]}),(0,g.jsx)(`instancedMesh`,{ref:x,args:[void 0,void 0,v],material:f(`#ffffff`,{opacity:.85}),frustumCulled:!1,children:(0,g.jsx)(`sphereGeometry`,{args:[1,8,6]})})]})}export{x as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalView-wlhSixSH.js","assets/jsx-runtime-BFUkm7bt.js","assets/store-FA83kfnc.js","assets/index-B6qvKFYN.js","assets/index-COpmc42S.css","assets/bloomMarks-DariC6lY.js","assets/BufferGeometryUtils-BsmWvcA2.js","assets/Batched-BOgjreKO.js","assets/rig-wAyl3G1G.js","assets/AccessibilitySettings-DSmFk9JC.js","assets/mic-B316hcCe.js","assets/jukeboxSongs-CjbAzAeb.js","assets/AccessibilitySettings-HrzBDUTN.css","assets/TerminalView-BrP-ENHg.css","assets/AppViewer-alNn4TBB.js","assets/MissionConsole-BEP5CdC8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{At as r,a as i,d as a,ds as o,li as s,m as c,p as l,t as u}from"./store-FA83kfnc.js";import{O as d,a as f,c as p,l as m,o as h,s as g}from"./index-B6qvKFYN.js";import{C as _,I as v,N as y,a as b,b as x,c as S,f as C,g as w,i as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M,v as N}from"./AccessibilitySettings-DSmFk9JC.js";var P=n(e(),1),F=t();function I({repo:e,qa:t,ready:n}){let r=g(),i=l(e=>t.devAgentId?e.agents[t.devAgentId]:void 0),a=l(e=>e.settings.language),[s,c]=(0,P.useState)(!1),u=e.pulls.find(e=>e.number===t.prNumber);if(!u)return null;let{note:d,tone:f}=o(t,u,e.autoMerge,a),_=async e=>{c(!0);try{await e()}catch{}finally{c(!1)}},v=async()=>{await m(n?{icon:`π`,title:r(`Merge PR #{number}?`,{number:u.number}),body:r(`β{title}β passed QA. It will be squash-merged into {branch}.`,{title:u.title,branch:e.defaultBranch}),confirm:r(`Squash & merge`)}:{tone:`warn`,title:r(`Merge PR #{number} without QA?`,{number:u.number}),body:r(`β{title}β has not passed QA yet. Merge it into {branch} anyway?`,{title:u.title,branch:e.defaultBranch}),confirm:r(`Merge anyway`)})&&await _(()=>p.mergePull(e.id,u.number))},y=async()=>{let t=``;await m({icon:`π§`,title:r(`Send PR #{number} back for a fix?`,{number:u.number}),body:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{children:(0,F.jsx)(h,{children:`Its author, or any free agent, fixes it with QAβs findings, then itβs tested once more.`})}),(0,F.jsx)(`input`,{maxLength:1e3,placeholder:r(`Optional note for whoever fixes it`),"aria-label":r(`Note for whoever fixes it`),onChange:e=>t=e.target.value})]}),confirm:r(`Send back`)})&&await _(()=>p.sendBack(e.id,u.number,t.trim()||void 0))},b=async()=>{await m({tone:`danger`,title:r(`Close PR #{number}?`,{number:u.number}),body:r(`β{title}β will be closed without merging. The branch stays on GitHub.`,{title:u.title}),confirm:r(`Close PR`)})&&await _(()=>p.closePull(e.id,u.number))};return(0,F.jsxs)(`div`,{className:`pk-card pk-pr kcard-${f??`plain`}`,style:{"--accent":e.color},children:[(0,F.jsxs)(`div`,{className:`pk-pr-head`,children:[(0,F.jsx)(`span`,{className:`floor-badge`,children:e.floor}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`a`,{href:u.url,target:`_blank`,rel:`noreferrer`,children:(0,F.jsxs)(`b`,{children:[`PR #`,u.number]})}),` `,u.title,(0,F.jsxs)(`div`,{className:`muted small`,children:[e.fullName.split(`/`)[1],i?` Β· ${r(`by {name}`,{name:i.name})}`:``,` Β· `,r(`round {number}`,{number:t.round}),` Β· `,d]})]})]}),t.summary&&(0,F.jsx)(`div`,{className:`small pk-pr-summary`,children:t.summary}),t.commentUrl&&(0,F.jsx)(`a`,{className:`small`,href:t.commentUrl,target:`_blank`,rel:`noreferrer`,children:(0,F.jsx)(h,{children:`QA report β`})}),(0,F.jsxs)(`div`,{className:`pk-actions`,children:[!n&&(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:s,onClick:()=>void _(()=>p.sendToQa(e.id,u.number)),children:(0,F.jsx)(h,{children:`Retry QA`})}),!n&&(0,F.jsx)(`button`,{className:`btn btn-small`,disabled:s,onClick:()=>void y(),children:(0,F.jsx)(h,{children:`Send back`})}),(0,F.jsx)(`button`,{className:`btn btn-small ${n?`btn-good`:``}`,disabled:s||u.isDraft,onClick:()=>void v(),children:r(n?`Merge`:`Merge anyway`)}),(0,F.jsx)(`button`,{className:`btn btn-small btn-ghost`,disabled:s,onClick:()=>void b(),children:(0,F.jsx)(h,{children:`Close`})})]})]})}function L(){let e=l(e=>e.repos),t=l(e=>e.qa),n=l(e=>e.requests),r=A(e,t,n),i=r.requests.length+r.stuck.length+r.ready.length===0;return(0,F.jsxs)(`div`,{className:`pk-page`,children:[i&&(0,F.jsx)(`p`,{className:`pk-empty`,children:(0,F.jsx)(h,{children:`Nothing waits on you. The team carries on, and your phone hears when that changes.`})}),r.requests.length>0&&(0,F.jsx)(`h3`,{className:`pk-h`,children:(0,F.jsx)(h,{children:`π₯ Team changes`})}),r.requests.map(e=>(0,F.jsx)(_,{req:e},e.id)),r.stuck.length>0&&(0,F.jsx)(`h3`,{className:`pk-h`,children:(0,F.jsx)(h,{children:`β οΈ Pull requests that need you`})}),r.stuck.map(e=>(0,F.jsx)(I,{repo:e.repo,qa:e.qa},`${e.repo.id}#${e.qa.prNumber}`)),r.ready.length>0&&(0,F.jsx)(`h3`,{className:`pk-h`,children:(0,F.jsx)(h,{children:`β
Ready to merge`})}),r.ready.map(e=>(0,F.jsx)(I,{repo:e.repo,qa:e.qa,ready:!0},`${e.repo.id}#${e.qa.prNumber}`))]})}var R={idle:`free`,preparing:`setting up`,working:`working`,done:`done`,error:`needs help`,stopped:`stopped`};function z({status:e}){let t=g();return(0,F.jsx)(`span`,{className:`status status-${e}`,children:t(R[e]??e)})}function B(){let[e,t]=(0,P.useState)(!1);return[e,async e=>{t(!0);try{return await e(),!0}catch{return!1}finally{t(!1)}}]}function V({agent:e,repo:t}){let n=g(),a=l(e=>e.agents),o=l(e=>e.qa),s=l(e=>e.settings),c=l(e=>e.clis),d=l(e=>e.openOverlay),f=(0,P.useMemo)(()=>i(t,u(a,t.id),o),[t,a,o]),[m,_]=B(),[y,x]=(0,P.useState)(``),[S,C]=(0,P.useState)(!1),[D,O]=(0,P.useState)(``),k=E(e),A=T(f),j=A.find(e=>e.key===y),M=e.status===`working`||e.status===`preparing`,I=N(e,s),L=async()=>{let t=D.trim();t&&await _(()=>p.message(e.id,t))&&(O(``),C(!1))};return(0,F.jsxs)(`div`,{className:`pk-card pk-agent ${e.status===`error`?`pk-agent-bad`:``}`,children:[(0,F.jsxs)(`div`,{className:`pk-agent-head`,children:[(0,F.jsx)(`span`,{className:`avatar`,style:{background:e.color},children:e.name[0]}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{children:e.name}),` `,(0,F.jsx)(`span`,{className:`muted small`,children:w(e,s,c)}),(0,F.jsxs)(`div`,{className:`small pk-ellipsis`,children:[b(e,s.language),M&&e.currentTool?(0,F.jsxs)(`span`,{className:`muted`,children:[` Β· `,n(r(e.currentTool)||e.currentTool),`β¦`]}):null]})]}),(0,F.jsx)(z,{status:e.status})]}),e.lastError&&!M&&(0,F.jsxs)(`div`,{className:`term-error small pk-error`,children:[`β οΈ `,e.lastError]}),I&&(0,F.jsxs)(`div`,{className:`small pk-sign-in`,children:[`π `,n(`Waiting for you to sign {provider} in, in their terminal`,{provider:I}),`.`]}),(0,F.jsxs)(`div`,{className:`pk-actions`,children:[I&&(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,onClick:()=>d({kind:`terminal`,agentId:e.id}),children:(0,F.jsx)(h,{children:`π Sign in`})}),k.stop&&(0,F.jsx)(`button`,{className:`btn btn-small btn-bad`,disabled:m,onClick:()=>void _(()=>p.stop(e.id)),children:(0,F.jsx)(h,{children:`β Stop`})}),k.assign&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`select`,{className:`pk-assign`,value:y,"aria-label":n(`Give {name} an issue or a pull request to test`,{name:e.name}),onChange:e=>x(e.target.value),disabled:m||A.length===0,children:[(0,F.jsx)(`option`,{value:``,children:n(A.length?`Pick an issue or a PRβ¦`:`Nothing to pick up`)}),A.map(e=>(0,F.jsxs)(`option`,{value:e.key,children:[e.kind===`qa`?`π PR `:``,`#`,e.number,` `,e.title]},e.key))]}),(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:m||!j,onClick:()=>j&&void _(()=>j.kind===`qa`?p.sendToQa(t.id,j.number,e.id):p.assign(e.id,j.number)).then(e=>e&&x(``)),children:n(j?.kind===`qa`?`π Test`:`βΆ Start`)})]}),k.clear&&(0,F.jsx)(`button`,{className:`btn btn-small`,disabled:m,onClick:()=>void _(()=>p.reset(e.id)),children:(0,F.jsx)(h,{children:`βΊ Clear desk`})}),k.message&&(0,F.jsx)(`button`,{className:`btn btn-small ${S?`btn-ghost`:``}`,"aria-expanded":S,onClick:()=>C(!S),children:(0,F.jsx)(h,{children:`π¬ Message`})}),(0,F.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>d({kind:`terminal`,agentId:e.id}),children:(0,F.jsx)(h,{children:`Terminal`})})]}),S&&k.message&&(0,F.jsxs)(`form`,{className:`pk-msg`,onSubmit:e=>{e.preventDefault(),L()},children:[(0,F.jsx)(v,{value:D,onChange:O,autoFocus:!0,"aria-label":n(`Message {name}`,{name:e.name}),placeholder:n(M?`Tell {name} something while they workβ¦`:`Ask {name} for a follow-upβ¦`,{name:e.name})}),(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:m||!D.trim(),children:(0,F.jsx)(h,{children:`Send`})})]})]})}function H(){let e=g(),t=l(e=>e.agents.ceo),n=l(e=>e.ceo),[r,i]=B();if(!t)return null;let a=t.status===`working`;return(0,F.jsxs)(`div`,{className:`pk-card pk-agent`,children:[(0,F.jsxs)(`div`,{className:`pk-agent-head`,children:[(0,F.jsx)(`span`,{className:`avatar`,style:{background:t.color},children:t.name[0]}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{children:t.name}),` `,(0,F.jsx)(`span`,{className:`muted small`,children:`CEO`}),(0,F.jsx)(`div`,{className:`small pk-ellipsis`,children:a?n.job?.label??e(`Working`):n.queue.length?e(`Up next: {jobs}`,{jobs:n.queue.map(e=>e.label).join(` β `)}):e(`Free`)})]}),(0,F.jsx)(z,{status:t.status})]}),a&&(0,F.jsx)(`div`,{className:`pk-actions`,children:(0,F.jsx)(`button`,{className:`btn btn-small btn-bad`,disabled:r,onClick:()=>void i(()=>p.stop(t.id)),children:(0,F.jsx)(h,{children:`β Stop`})})})]})}function U({focusRepo:e}){let t=g(),n=l(e=>e.repos),r=l(e=>e.agents),i=(0,P.useRef)(null);return(0,P.useEffect)(()=>i.current?.scrollIntoView({block:`start`}),[]),(0,F.jsxs)(`div`,{className:`pk-page`,children:[(0,F.jsx)(H,{}),n.length===0&&(0,F.jsx)(`p`,{className:`muted`,children:(0,F.jsx)(h,{children:`No floors yet, so no team.`})}),n.map(n=>{let a=u(r,n.id);return(0,F.jsxs)(`section`,{ref:n.id===e?i:void 0,className:`pk-section`,style:{"--accent":n.color},children:[(0,F.jsxs)(`h3`,{className:`pk-h`,children:[(0,F.jsx)(`span`,{className:`floor-badge`,children:n.floor}),` `,n.fullName.split(`/`)[1],(0,F.jsxs)(`span`,{className:`muted small`,children:[` Β· `,t(a.length===1?`{count} agent`:`{count} agents`,{count:a.length})]})]}),a.length===0&&(0,F.jsx)(`p`,{className:`muted small`,children:(0,F.jsx)(h,{children:`Nobody works here yet.`})}),a.map(e=>(0,F.jsx)(V,{agent:e,repo:n},e.id))]},n.id)})]})}var W=(0,P.lazy)(()=>c(()=>import(`./TerminalView-wlhSixSH.js`).then(e=>e.r).then(e=>({default:e.TerminalView})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),G=(0,P.lazy)(()=>c(()=>import(`./AppViewer-alNn4TBB.js`).then(e=>e.n).then(e=>({default:e.AppViewer})),__vite__mapDeps([14,1,2,3,4,9,10,11,12]))),K=(0,P.lazy)(()=>c(()=>import(`./MissionConsole-BEP5CdC8.js`).then(e=>e.t).then(e=>({default:e.UsageCard})),__vite__mapDeps([15,1,2,3,4]))),q=[`company`,`chat`,`kanban`,`team`,`approvals`];function J(e){let t=e?new URL(e,location.origin).searchParams.get(`tab`):null;return q.includes(t)?t:null}var Y=e=>e.split(`/`)[1]??e;function X(){l.getState().openOverlay(null),d(`office`)}var Z=[[`building`,`π¨`,`Building`],[`qa`,`π`,`QA`],[`fixing`,`π§`,`Fixing`],[`ready`,`β
`,`Ready`],[`needsYou`,`β οΈ`,`Needs you`]];function Q(){let e=g(),t=l(e=>e.connected),n=l(e=>e.loaded),r=l(e=>e.usage),i=l(e=>e.restarting?`β³ The office is restartingβ¦`:s(e.officeUpdate,e.settings.language)),a=r.until?new Date(r.until).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):null;return(0,F.jsxs)(F.Fragment,{children:[!t&&(0,F.jsx)(`div`,{className:`pk-banner pk-banner-bad`,children:e(n?`π‘ Reconnecting to the officeβ¦`:`π‘ Connecting to the officeβ¦`)}),r.state===`paused`&&(0,F.jsxs)(`div`,{className:`pk-banner pk-banner-bad`,children:[(0,F.jsx)(h,{children:`βΈ Claudeβs usage limit was reached: no new work starts`}),a?e(` until {time}`,{time:a}):``,`.`]}),r.state===`pacing`&&(0,F.jsxs)(`div`,{className:`pk-banner`,children:[(0,F.jsx)(h,{children:`π’ Pacing new work after a usage warning`}),a?e(` until {time}`,{time:a}):``,`.`]}),i&&(0,F.jsx)(`div`,{className:`pk-banner`,children:e(i)})]})}function $({go:e}){let t=g(),n=l(e=>e.repos),r=l(e=>e.agents),a=l(e=>e.qa),o=l(e=>e.requests),s=l(e=>e.ceo),c=l(e=>e.demo),d=l(e=>e.version),f=r.ceo,p=(0,P.useMemo)(()=>n.map(e=>{let t=u(r,e.id);return{repo:e,team:t.length,busy:t.filter(e=>e.status===`working`||e.status===`preparing`).length,p:D(i(e,t,a))}}),[n,r,a]),m=k(A(n,a,o));return(0,F.jsxs)(`div`,{className:`pk-page`,children:[(0,F.jsx)(Q,{}),m>0&&(0,F.jsxs)(`button`,{className:`pk-callout`,onClick:()=>e(`approvals`),children:[(0,F.jsxs)(`span`,{children:[`β οΈ `,t(m===1?`{count} decision waiting on you`:`{count} decisions waiting on you`,{count:m})]}),(0,F.jsx)(`span`,{children:(0,F.jsx)(h,{children:`Approvals β`})})]}),f&&(0,F.jsxs)(`div`,{className:`pk-card pk-ceo`,children:[(0,F.jsx)(`span`,{className:`avatar`,style:{background:f.color},children:f.name[0]}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{children:f.name}),` `,(0,F.jsx)(`span`,{className:`muted small`,children:`CEO`}),(0,F.jsx)(`div`,{className:`small`,children:f.status===`working`?s.job?.label??t(`Working`):s.queue.length?t(`Next: {job}`,{job:s.queue[0].label}):t(`Free`)})]}),(0,F.jsx)(`button`,{className:`btn btn-small`,onClick:()=>e(`chat`),children:(0,F.jsx)(h,{children:`π¬ Chat`})})]}),p.length===0&&(0,F.jsx)(`p`,{className:`muted`,children:(0,F.jsx)(h,{children:`No projects yet. Connect a repo from the managerβs console in the 3D office.`})}),p.map(({repo:n,team:r,busy:i,p:a})=>(0,F.jsxs)(`div`,{className:`pk-card pk-floor`,style:{"--accent":n.color},children:[(0,F.jsxs)(`div`,{className:`pk-floor-head`,children:[(0,F.jsx)(`span`,{className:`floor-badge`,children:n.floor}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{className:`pk-floor-name`,children:Y(n.fullName)}),(0,F.jsx)(`div`,{className:`muted small pk-ellipsis`,children:n.summary||n.description||n.fullName})]})]}),(0,F.jsx)(`div`,{className:`pk-pipeline`,role:`list`,"aria-label":t(`Floor {floor} pipeline`,{floor:n.floor}),children:Z.map(([e,n,r])=>(0,F.jsxs)(`div`,{role:`listitem`,className:`pk-stage ${a[e]?``:`pk-stage-zero`} ${e===`needsYou`&&a[e]?`pk-stage-hot`:``}`,children:[(0,F.jsxs)(`span`,{className:`pk-stage-n`,children:[(0,F.jsx)(`span`,{className:`pk-stage-icon`,"aria-hidden":!0,children:n}),a[e]]}),(0,F.jsx)(`span`,{className:`pk-stage-label`,children:t(r)})]},e))}),(0,F.jsxs)(`div`,{className:`pk-floor-foot small`,children:[(0,F.jsx)(`span`,{className:`muted`,children:t(`π₯ {team} Β· {busy} busy Β· π {backlog} in backlog`,{team:r,busy:i,backlog:a.backlog})}),(0,F.jsx)(`span`,{className:`spacer`}),(0,F.jsx)(`button`,{className:`btn btn-small`,onClick:()=>e(`kanban`,n.id),children:(0,F.jsx)(h,{children:`Board`})}),(0,F.jsx)(`button`,{className:`btn btn-small`,onClick:()=>e(`team`,n.id),children:(0,F.jsx)(h,{children:`Team`})})]})]},n.id)),(0,F.jsx)(`button`,{className:`btn pk-wide`,onClick:X,children:(0,F.jsx)(h,{children:`π’ Open the 3D office`})}),c&&(0,F.jsx)(`div`,{className:`pk-center small muted`,children:(0,F.jsx)(h,{children:`DEMO MODE: fake repos, fake agents`})}),d&&(0,F.jsxs)(`div`,{className:`pk-center small muted`,children:[`Droidsembly `,d]})]})}function ee({repoId:e,pick:t}){let n=g(),r=l(e=>e.repos),i=r.some(t=>t.id===e)?e:r[0]?.id;return i?(0,F.jsxs)(`div`,{className:`pk-page`,children:[r.length>1&&(0,F.jsx)(`div`,{className:`pk-chips`,role:`tablist`,"aria-label":n(`Floor`),children:r.map(e=>(0,F.jsxs)(`button`,{role:`tab`,"aria-selected":e.id===i,className:`pk-chip ${e.id===i?`pk-chip-on`:``}`,style:{"--accent":e.color},onClick:()=>t(e.id),children:[e.floor,` Β· `,Y(e.fullName)]},e.id))}),(0,F.jsx)(M,{repoId:i,embedded:!0},i)]}):(0,F.jsx)(`p`,{className:`muted pk-page`,children:(0,F.jsx)(h,{children:`No projects yet.`})})}function te(){let e=l(e=>e.toasts),t=l(e=>e.dismissToast);return(0,F.jsx)(`div`,{className:`toasts`,children:e.slice(-2).map(e=>(0,F.jsx)(`div`,{className:`toast toast-${e.level}`,onClick:()=>t(e.id),children:e.text},e.id))})}function ne(){let e=l(e=>e.overlay);return e?.kind===`terminal`&&e.agentId!==`ceo`?(0,F.jsx)(W,{agentId:e.agentId}):e?.kind===`app`?(0,F.jsx)(G,{repoId:e.repoId}):null}function re({onClose:e}){let t=g();return(0,F.jsxs)(y,{title:t(`βοΈ This device and notifications`),onClose:e,className:`pk-settings`,children:[(0,F.jsx)(`div`,{className:`card`,children:(0,F.jsx)(f,{})}),(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(K,{hot:!1})}),(0,F.jsx)(O,{}),(0,F.jsx)(S,{}),(0,F.jsx)(j,{pocket:!0}),(0,F.jsxs)(`div`,{className:`card`,children:[(0,F.jsx)(`h3`,{children:(0,F.jsx)(h,{children:`π± Pocket mode`})}),(0,F.jsxs)(`p`,{className:`muted small`,children:[(0,F.jsx)(h,{children:`This is the office without the 3D building, for phones and touch screens. Itβs picked on its own on small or touch screens; this device remembers what you last chose. To reach the office from your phone safely, see`}),` `,(0,F.jsx)(`a`,{href:`https://github.com/leonvanzyl/cubefarm/blob/main/docs/pocket.md`,children:`docs/pocket.md`}),`.`]}),(0,F.jsx)(`button`,{className:`btn`,onClick:X,children:(0,F.jsx)(h,{children:`π’ Open the 3D office`})})]})]})}function ie(){let e=g(),[t,n]=(0,P.useState)(()=>J(location.href)??`company`),[r,i]=(0,P.useState)(null),[o,s]=(0,P.useState)(!1),c=l(e=>e.settings.companyName),u=l(e=>e.loaded),d=l(e=>e.settings.setupDone),f=l(e=>a(e.messages,e.phoneReadAt)),p=l(e=>k(A(e.repos,e.qa,e.requests))),m=l(e=>e.agents.ceo?.name??`CEO`),_=l(e=>e.usage.state),v=l(e=>e.connected),y=(e,t)=>{t&&i(t),n(e)};(0,P.useEffect)(()=>{let e=e=>{let t=J(e.detail);t&&n(t)};return window.addEventListener(`cubefarm:open`,e),()=>window.removeEventListener(`cubefarm:open`,e)},[]),(0,P.useEffect)(()=>{let e=l.getState();t===`chat`?e.openOverlay({kind:`phone`,tab:`chat`}):e.overlay?.kind===`phone`&&e.openOverlay(null)},[t]),(0,P.useEffect)(()=>(document.title=`${c?`${c} Β· `:``}Droidsembly Β· pocket`,()=>void(document.title=`Droidsembly`)),[c]);let b=[[`company`,`π`,`Company`,0],[`chat`,`π¬`,m,t===`chat`?0:f],[`kanban`,`π`,`Kanban`,0],[`team`,`π₯`,`Team`,0],[`approvals`,`β`,`Approvals`,p]];return(0,F.jsxs)(`div`,{className:`pocket`,children:[(0,F.jsxs)(`header`,{className:`pk-head`,children:[(0,F.jsx)(C,{}),(0,F.jsx)(`b`,{className:`pk-title`,children:c||`Droidsembly`}),(0,F.jsx)(`span`,{className:`pk-dot ${v?`pk-dot-on`:``}`,title:e(v?`Connected`:`Not connected`)}),(0,F.jsx)(`span`,{className:`spacer`}),_!==`normal`&&(0,F.jsx)(`span`,{className:`chip chip-warn`,children:e(_===`paused`?`βΈ paused`:`π’ pacing`)}),(0,F.jsx)(`button`,{className:`pk-icon-btn`,onClick:()=>s(!0),"aria-label":e(`Settings and notifications`),title:e(`Settings and notifications`),children:`βοΈ`})]}),(0,F.jsx)(`main`,{className:`pk-main ${t===`chat`?`pk-main-chat`:``}`,children:u&&!d?(0,F.jsxs)(`div`,{className:`pk-page`,children:[(0,F.jsx)(`p`,{children:(0,F.jsx)(h,{children:`The office isnβt set up yet. Finish the setup in the 3D office (on a computer is easiest), then come back.`})}),(0,F.jsx)(`button`,{className:`btn`,onClick:X,children:(0,F.jsx)(h,{children:`π’ Open the 3D office`})})]}):(0,F.jsxs)(F.Fragment,{children:[t===`company`&&(0,F.jsx)($,{go:y}),t===`chat`&&(0,F.jsx)(x,{autoFocus:!1}),t===`kanban`&&(0,F.jsx)(ee,{repoId:r,pick:i}),t===`team`&&(0,F.jsx)(U,{focusRepo:r}),t===`approvals`&&(0,F.jsx)(L,{})]})}),(0,F.jsx)(`nav`,{className:`pk-tabs`,"aria-label":e(`Pocket office`),children:b.map(([r,i,a,o])=>(0,F.jsxs)(`button`,{className:`pk-tab ${t===r?`pk-tab-on`:``}`,"aria-current":t===r?`page`:void 0,onClick:()=>n(r),children:[(0,F.jsxs)(`span`,{className:`pk-tab-icon`,children:[i,o>0&&(0,F.jsx)(`span`,{className:`badge badge-dot`,children:o})]}),(0,F.jsx)(`span`,{className:`pk-tab-label`,children:r===`chat`?a:e(a)})]},r))}),(0,F.jsx)(te,{}),(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(ne,{})}),o&&(0,F.jsx)(re,{onClose:()=>s(!1)})]})}export{ie as default};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{St as r,Tt as i,f as a,nt as o}from"./bloomMarks-DariC6lY.js";import{a as s}from"./director-CrzFgnoP.js";import{i as c,r as l}from"./Office-BBnd6tyn.js";import{i as u,o as d}from"./kit-C6ByUQ-Y.js";var f=n(e(),1),p=t(),m=`
|
|
2
|
+
varying vec2 vP;
|
|
3
|
+
void main() {
|
|
4
|
+
vP = position.xy;
|
|
5
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
6
|
+
}`,h=`
|
|
7
|
+
uniform float uInner;
|
|
8
|
+
uniform float uOuter;
|
|
9
|
+
uniform float uFade;
|
|
10
|
+
varying vec2 vP;
|
|
11
|
+
vec3 band(float k) {
|
|
12
|
+
// red outside to violet inside
|
|
13
|
+
vec3 c = vec3(0.56, 0.36, 0.95);
|
|
14
|
+
c = mix(c, vec3(0.3, 0.45, 1.0), smoothstep(0.08, 0.2, k));
|
|
15
|
+
c = mix(c, vec3(0.25, 0.8, 0.95), smoothstep(0.22, 0.34, k));
|
|
16
|
+
c = mix(c, vec3(0.35, 0.85, 0.35), smoothstep(0.36, 0.5, k));
|
|
17
|
+
c = mix(c, vec3(1.0, 0.92, 0.3), smoothstep(0.52, 0.64, k));
|
|
18
|
+
c = mix(c, vec3(1.0, 0.6, 0.2), smoothstep(0.66, 0.78, k));
|
|
19
|
+
c = mix(c, vec3(0.98, 0.3, 0.3), smoothstep(0.8, 0.92, k));
|
|
20
|
+
return c;
|
|
21
|
+
}
|
|
22
|
+
void main() {
|
|
23
|
+
float k = (length(vP) - uInner) / (uOuter - uInner);
|
|
24
|
+
float edge = smoothstep(0.0, 0.08, k) * (1.0 - smoothstep(0.92, 1.0, k));
|
|
25
|
+
// its feet fade into the haze
|
|
26
|
+
float feet = smoothstep(5.0, 70.0, vP.y);
|
|
27
|
+
gl_FragColor = vec4(band(k), 0.5 * edge * feet * uFade);
|
|
28
|
+
}`;function g({run:e,elevation:t}){let n=d(e.side),g=(0,f.useMemo)(()=>{let t=s(e.seed),a=160+t()*30,c=a-16,l=new r(c,a,128,1,0,Math.PI),u=new i({vertexShader:m,fragmentShader:h,transparent:!0,depthWrite:!1,side:2,uniforms:{uInner:{value:c},uOuter:{value:a},uFade:{value:0}}}),d=new o(l,u);return d.position.set(n*(340+t()*40),-8,(t()-.5)*80),d.rotation.y=-n*Math.PI/2,d.renderOrder=2,d.frustumCulled=!1,{geo:l,mat:u,mesh:d,chimed:!1}},[e.seed,n]);return(0,f.useEffect)(()=>()=>{g.geo.dispose(),g.mat.dispose()},[g]),a(()=>{let n=e.t;if(g.mat.uniforms.uFade.value=u(n,e.seconds,9),!g.chimed&&n>1.5){g.chimed=!0;let e=l(g.mesh.position.x,60-t,g.mesh.position.z,400);c(`chime`,{gain:Math.max(.5,e.gain),pan:e.pan})}}),(0,p.jsx)(`primitive`,{object:g.mesh})}export{g as default};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{$a as r,Ao as i,Ba as a,Bo as o,E as s,I as c,L as l,La as u,Li as d,N as f,Oa as p,Pa as m,Ti as h,To as g,Va as _,Vo as ee,Wa as te,Xa as ne,_n as re,b as ie,do as v,ea as ae,en as oe,fo as se,hn as y,io as ce,ka as b,kt as le,lo as ue,mn as de,p as x,pt as fe,r as pe,ro as me,sr as he,vn as ge,wo as _e,x as ve,xo as ye,yo as be}from"./store-FA83kfnc.js";import{A as S,Bt as C,C as xe,Ct as Se,D as Ce,Mt as we,O as w,R as T,Tt as Te,Y as Ee,f as E,g as De,gt as Oe,ht as ke,k as Ae,kt as D,pt as je,rt as Me,st as O,tt as Ne,w as Pe,x as k,xt as Fe}from"./bloomMarks-DariC6lY.js";import{Jn as Ie,Rn as Le,Vn as Re,_ as ze,b as Be,d as Ve,g as He,h as Ue,kn as We,p as Ge,u as Ke}from"./cheerRules-CZGSrxOB.js";import{a as A}from"./Batched-BOgjreKO.js";import{B as qe,U as j}from"./rig-wAyl3G1G.js";import{J as Je,N as Ye,a as Xe,c as M,ht as Ze,l as N,o as Qe,u as $e}from"./Shell-BmnZn4UL.js";import{n as et,r as tt}from"./interact-0qw7BGhL.js";import{f as nt,n as rt,u as it}from"./useDayTime-0XsqM14Q.js";import{o as at}from"./cityLayout-7ckfe3wf.js";import{ar as ot,er as st,fn as ct,ir as lt,nr as P,pn as ut,rr as dt,s as ft,tr as pt}from"./Office-BBnd6tyn.js";import{i as mt,r as ht,t as F}from"./billboardLayout-DSKGXPIM.js";var I=n(e(),1),gt=new Map,_t=new Map;function vt(e,t){let n=(0,I.useRef)(t);n.current=t,(0,I.useEffect)(()=>{let t=e=>n.current(e);return gt.set(e,t),()=>{gt.get(e)===t&>.delete(e)}},[e])}function L(e,t){let n=(0,I.useRef)(t);n.current=t,(0,I.useEffect)(()=>{let t=()=>n.current();return _t.set(e,t),()=>{_t.get(e)===t&&_t.delete(e)}},[e])}function yt(e){let t=e.indexOf(`:`);gt.get(t<0?e:e.slice(0,t))?.(t<0?``:e.slice(t+1))}var bt=()=>Object.fromEntries([..._t].map(([e,t])=>[e,t()]));function xt(){let[,e,t]=nt(.5),n=Math.hypot(e,t);return[0,-t/n,e/n]}var St=e=>2*Math.PI*(e-.5);function Ct(e,t,n=xt()){let r=St(t),i=Math.cos(r),a=Math.sin(r),[o,s,c]=n,[l,u,d]=e,f=o*l+s*u+c*d;return[l*i+(s*d-c*u)*a+o*f*(1-i),u*i+(c*l-o*d)*a+s*f*(1-i),d*i+(o*u-s*l)*a+c*f*(1-i)]}function wt(e){let[t,n,r]=nt(e);return[-t,-n,-r]}function Tt(e){let t=e=>Math.round(e*1800/Math.PI)/10;return{yaw:t(Math.atan2(-e[0],-e[2])),pitch:t(Math.asin(Math.max(-1,Math.min(1,e[1]))))}}var Et=[`The Coffee Mug`,`The Rubber Duck`,`The Merge Arrow`,`The Little Bug`,`The Gong`,`The Roomba`,`The Sticky Note`,`The Keyboard`],Dt=9*Math.PI/180,Ot=22*Math.PI/180,kt=[.9,0,.1],At=.17,jt=(e,t)=>Math.acos(Math.min(1,Math.max(-1,e[0]*t[0]+e[1]*t[1]+e[2]*t[2])));function Mt(e=6,t=ft(700)){let n=t.sizes.length,r=e=>[t.positions[e*3],t.positions[e*3+1],t.positions[e*3+2]],i=xt(),a=e=>kt.every(t=>Ct(r(e),t,i)[1]>At),o=Array.from({length:n},(e,t)=>t).filter(e=>t.sizes[e]>=3&&a(e)).sort((e,n)=>t.sizes[n]-t.sizes[e]||Ct(r(n),0,i)[1]-Ct(r(e),0,i)[1]),s=new Set,c=[];for(let i of o){if(c.length>=e)break;if(s.has(i)||c.some(e=>jt(r(e.stars[0]),r(i))<Ot))continue;let a=Array.from({length:n},(e,t)=>t).filter(e=>e!==i&&!s.has(e)&&jt(r(e),r(i))<Dt).sort((e,t)=>jt(r(e),r(i))-jt(r(t),r(i))).slice(0,5);if(a.length<3)continue;let o=[i,...a.sort((e,n)=>t.sizes[n]-t.sizes[e])],l=[],u=new Set([i]);for(;u.size<o.length;){let e=null,t=1/0;for(let n of u)for(let i of o){if(u.has(i))continue;let a=jt(r(n),r(i));a<t&&(t=a,e=[n,i])}l.push(e),u.add(e[1])}let d=o.reduce((e,t)=>[e[0]+r(t)[0],e[1]+r(t)[1],e[2]+r(t)[2]],[0,0,0]),f=Math.hypot(...d);for(let e of o)s.add(e);c.push({name:Et[c.length%Et.length],stars:o,lines:l,centre:[d[0]/f,d[1]/f,d[2]/f]})}return c}var Nt=null,Pt=()=>Nt??=Mt(),R=t(),z={w:1024,h:512},Ft=Math.round(z.w*F.h/F.w),It=null,Lt=()=>It??=at();function Rt(e,t,n){let r=t%2*z.w,i=Math.floor(t/2)*z.h,a=z.w,o=Ft;e.fillStyle=`#2b2d42`,e.fillRect(r,i,a,o),e.fillStyle=n.bg,le(e,r+14,i+14,a-28,o-28,26),e.fill(),e.fillStyle=`rgba(255,255,255,0.75)`;for(let t=0;t<24;t++){let n=(t+.5)/24;for(let t of[i+30,i+o-30])e.beginPath(),e.arc(r+40+n*(a-80),t,6,0,Math.PI*2),e.fill()}e.fillStyle=n.fg,e.textAlign=`center`,e.textBaseline=`middle`,e.font=`700 54px ${fe}`,e.fillText(n.top,r+a/2,i+92,a-120),e.font=`800 176px ${fe}`,e.fillText(n.big,r+a/2,i+o/2+18,a-120),e.font=`600 46px ${fe}`,e.fillText(n.under,r+a/2,i+o-82,a-120)}function zt(){let e=x(e=>e.repos),t=x(e=>e.agents),n=x(e=>e.qa),r=x(e=>e.settings.companyName);return(0,I.useMemo)(()=>{let i=Object.values(t).filter(e=>e.role!==`ceo`);return{company:r,floors:e.length,agents:i.length,working:i.filter(e=>e.status===`working`||e.status===`preparing`).length,issues:e.reduce((e,t)=>e+t.issues.length,0),openPrs:e.reduce((e,t)=>e+t.pulls.filter(e=>e.state===`OPEN`).length,0),inQa:e.reduce((e,t)=>e+pe(t,n).inQa,0),merged:e.reduce((e,t)=>e+t.pulls.filter(e=>e.state===`MERGED`).length,0)}},[e,t,n,r])}function Bt(e){let t=e%2*.5,n=1-Math.floor(e/2)*.5;return{u0:t,u1:t+.5,v1:n,v0:n-Ft/(z.h*2)}}function Vt({top:e}){let t=ee(e),n=(0,I.useMemo)(()=>ht(Lt(),{x:v.x,y:t+v.eye,z:v.z}),[t]),r=zt(),i=(0,I.useMemo)(()=>mt(r),[r]),a=JSON.stringify(i),o=et(z.w*2,z.h*2,e=>i.forEach((t,n)=>Rt(e,n,t)),[a]),s=(0,I.useMemo)(()=>{let e=[],t=[];return n.forEach((n,r)=>{let i=(e,t,r,i)=>e.translate(t,r,i).rotateY(n.yaw).translate(n.x,n.y,n.z),a=new je(F.w,F.h),{u0:o,u1:s,v0:c,v1:l}=Bt(r%4),u=a.attributes.uv;for(let e=0;e<u.count;e++)u.setXY(e,o+u.getX(e)*(s-o),c+u.getY(e)*(l-c));e.push(i(a,0,0,.2)),t.push(i(new k(F.w+.4,F.h+.4,.15),0,0,0)),t.push(i(new k(F.w,.12,.9),0,-F.h/2-.1,.5));let d=n.y-F.h/2-n.top;for(let e of[-F.w/3,F.w/3])t.push(i(new k(.3,d,.3),e,-F.h/2-d/2,-.1))}),{faces:N(e),frames:N(t)}},[n]);(0,I.useEffect)(()=>()=>Object.values(s).forEach(e=>e.dispose()),[s]);let c=(0,I.useMemo)(()=>({face:new Me({map:o,fog:!1,toneMapped:!1,polygonOffset:!0,polygonOffsetFactor:-2}),frame:new Me({color:`#3d405b`,fog:!1})}),[o]);return(0,I.useEffect)(()=>()=>Object.values(c).forEach(e=>e.dispose()),[c]),L(`billboards`,()=>n.map((e,n)=>{let r={x:e.x-v.x,y:e.y-t-v.eye,z:e.z-v.z},a=Math.hypot(r.x,r.y,r.z);return{x:Math.round(e.x),z:Math.round(e.z),dist:Math.round(e.dist),says:`${i[n%4].top}: ${i[n%4].big}`,...Tt([r.x/a,r.y/a,r.z/a])}})),(0,R.jsxs)(`group`,{position:[0,-t-.03,0],children:[(0,R.jsx)(`mesh`,{geometry:s.frames,material:c.frame}),(0,R.jsx)(`mesh`,{geometry:s.faces,material:c.face})]})}var Ht=new Map;function Ut(e,t,n,r,i=!0){let a=Ht.get(e);if(a)return a;let o=document.createElement(`canvas`);return o.width=t,o.height=n,r(o.getContext(`2d`)),a=new Pe(o),a.colorSpace=Se,a.anisotropy=8,i&&(a.wrapS=a.wrapT=Fe),Ht.set(e,a),a}function Wt(e){let t=e>>>0;return()=>(t=t*1664525+1013904223>>>0,t/4294967296)}var Gt=()=>Ut(`paving`,256,256,e=>{e.fillStyle=`#d6d0c4`,e.fillRect(0,0,256,256);let t=Wt(3);for(let n=0;n<260;n++)e.fillStyle=t()<.5?`rgba(255,255,255,0.18)`:`rgba(90,80,70,0.08)`,e.fillRect(t()*256,t()*256,2+t()*3,2+t()*3);e.fillStyle=`#b3ab9d`,e.fillRect(0,0,256,4),e.fillRect(0,0,4,256)}),Kt=()=>Ut(`decking`,512,512,e=>{let t=Wt(7);for(let n=0;n<8;n++){let r=n*64,i=150+Math.floor(t()*30);e.fillStyle=`rgb(${i+40},${i-20},${i-75})`,e.fillRect(0,r,512,64),e.strokeStyle=`rgba(80,40,10,0.18)`,e.lineWidth=2;for(let n=0;n<4;n++){let n=r+8+t()*48;e.beginPath(),e.moveTo(0,n),e.bezierCurveTo(170,n+(t()-.5)*8,340,n+(t()-.5)*8,512,n),e.stroke()}e.fillStyle=`#5b3a24`,e.fillRect(0,r,512,4);let a=(n%2?.3:.75)*512;e.fillRect(a,r,4,64)}}),qt=()=>Ut(`helipad`,1024,1024,e=>{e.fillStyle=`#4a4f5a`,e.beginPath(),e.arc(512,512,508,0,Math.PI*2),e.fill(),e.strokeStyle=`#ffd166`,e.lineWidth=34,e.beginPath(),e.arc(512,512,440,0,Math.PI*2),e.stroke(),e.strokeStyle=`#f8f9fa`,e.lineWidth=10,e.setLineDash([60,40]),e.beginPath(),e.arc(512,512,495,0,Math.PI*2),e.stroke(),e.setLineDash([]),e.fillStyle=`#f8f9fa`,e.fillRect(322,282,70,460),e.fillRect(632,282,70,460),e.fillRect(322,477,380,70)},!1),Jt=()=>Ut(`stripes`,128,8,e=>{for(let t=0;t<4;t++)e.fillStyle=t%2?`#ffffff`:`#c9c9c9`,e.fillRect(t*32,0,32,8)}),Yt=()=>Ut(`windsock`,8,128,e=>{for(let t=0;t<5;t++)e.fillStyle=t%2?`#ffffff`:`#ff7b39`,e.fillRect(0,t*128/5,8,26.6)}),Xt=[`#e63946`,`#3a86ff`,`#ffb703`,`#2a9d8f`],Zt=.45,B=[0,.22,.12],V=[0,.45,-.42],H=[0,B[1]+.86*Math.cos(.5),B[2]+.86*Math.sin(.5)],Qt=.28,$t=.31,en=[0,.98,.3],tn=.42,nn=(e,t)=>[e[0]+t[0],e[1]+t[1],e[2]+t[2]];function U(e,t,n=.045){let r=new C(...e),i=new C(...t).clone().sub(r),a=new k(n,n,i.length());return a.applyQuaternion(new Oe().setFromUnitVectors(new C(0,0,1),i.normalize())),a.translate((e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2)}function rn(e,t,n){let r=new xe,i=[e[0]-Qt,e[1],e[2],e[0]+Qt,e[1],e[2],t[0]-Qt,t[1],t[2],t[0]+Qt,t[1],t[2]];return r.setAttribute(`position`,new T(i,3)),r.setAttribute(`uv`,new T([0,0,1,0,0,1,1,1],2)),r.setAttribute(`color`,new T(Array.from({length:4},()=>[n.r,n.g,n.b]).flat(),3)),r.setIndex([0,2,1,1,2,3]),r.computeVertexNormals(),r}function an(){let e=[],t=[];b.xs.forEach((n,r)=>{let i=g(r),a=e=>[e[0]+i.x,e[1],e[2]+i.z];for(let t of[-.31,$t]){let n=[t,0,0];e.push(U(a(nn(V,n)),a(nn(B,n)))),e.push(U(a(nn(B,n)),a(nn(H,n)))),e.push(U(a([t,0,V[2]]),a([t,V[1]+.02,V[2]]))),e.push(U(a([t,0,.62]),a([t,.64,.34]))),e.push(U(a([t*1.07,.56,-.48]),a([t*1.07,.56,.2]),.07)),e.push(U(a([t*1.07,.56,-.44]),a([t,.3,-.42])))}e.push(U(a([-.31,H[1],H[2]]),a([$t,H[1],H[2]]),.06)),e.push(U(a([-.31,V[1],V[2]]),a([$t,V[1],V[2]]),.06));let o=new w(Xt[r%Xt.length]);t.push(rn(a(V),a(B),o),rn(a(B),a(H),o))});let n=N(ue.flatMap(e=>[new S(e.r,e.r,.05,20).translate(e.x,.55,e.z),new S(.04,.05,.53,8).translate(e.x,.27,e.z),new S(.2,.22,.03,16).translate(e.x,.015,e.z)]));return{frame:N(e),canvas:N(t),tables:n}}var on=(e,t=Date.now())=>Ge(t).some(n=>n.kind===`break`&&n.chair===e&&ze(n,t)!==`down`);function sn({i:e}){let t=g(e),n=tt({id:`deckchair-${e}`,label:`Sit back in the deck chair`,action:{kind:`roof`,op:`chair:${e}`}},3);return(0,R.jsx)(`mesh`,{ref:n,position:[t.x,.5,t.z+.05],visible:!1,children:(0,R.jsx)(`boxGeometry`,{args:[b.w,1,b.l]})})}function cn(e){if(e<0||e>=b.xs.length)return;let t=x.getState();if(P.getState().sitting===e)return;if(on(e)){t.pushToast(`info`,`πͺ Someone's sitting there: try another chair`);return}let n=g(e);ot({id:`deckchair-${e}`,x:n.x+en[0],y:en[1],z:n.z+en[2],tilt:tn,look:1,minPitch:-.95,maxPitch:1.1,exit:_e(e),yaw:0,pitch:.05,onLeave:()=>{P.getState().sitting===e&&P.setState({sitting:null})}}),P.setState({sitting:e,telescope:!1}),Ie({x:n.x,y:.4,z:n.z})}function ln(){let e=(0,I.useMemo)(an,[]);(0,I.useEffect)(()=>()=>Object.values(e).forEach(e=>e.dispose()),[e]);let t=(0,I.useMemo)(()=>new O({map:Jt(),vertexColors:!0,side:2}),[]);return(0,I.useEffect)(()=>()=>t.dispose(),[t]),vt(`chair`,e=>cn(Number(e))),L(`chairs`,()=>b.xs.map((e,t)=>P.getState().sitting===t?`you`:on(t)?`taken`:`free`)),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(`mesh`,{geometry:e.frame,material:j(`#c08552`),castShadow:!0,children:(0,R.jsx)(A,{thickness:.012,color:`#1f1d2b`})}),(0,R.jsx)(`mesh`,{geometry:e.canvas,material:t,castShadow:!0,receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.tables,material:j(`#e9ecef`),castShadow:!0,receiveShadow:!0}),b.xs.map((e,t)=>(0,R.jsx)(sn,{i:t},t))]})}var un=`#1f1d2b`;function dn(e){let t=e>>>0;return()=>(t=t*1664525+1013904223>>>0,t/4294967296)}var fn=e=>({x:(e.minX+e.maxX)/2,z:(e.minZ+e.maxZ)/2,w:e.maxX-e.minX,d:e.maxZ-e.minZ,h:e.h??.6});function pn(){let e=dn(21),t=[],n=[],r=[],i=[],a=[],o=[],s=[];u.forEach((c,l)=>{let{x:u,z:d,w:f,d:p,h:m}=fn(c);t.push({size:[f,m-.06,p],at:[u,(m-.06)/2,d]}),t.push({size:[f+.08,.06,p+.08],at:[u,m-.03,d]}),n.push({size:[f-.12,.04,p-.12],at:[u,m-.02,d]});let h=m,g=(t,n)=>{for(let r=0;r<t;r++)n(u-f/2+.35+r*(f-.7)/Math.max(1,t-1),d+(e()-.5)*.25,r)};if(l===2)for(let e of[-.22,.22])g(Math.round(f/.55),(t,n,i)=>r.push(new D(.17+i%3*.02,10,7).scale(1,.6,1).translate(t,h+.08,d+e)));else l===1?g(Math.round(f/.9),(t,n)=>{s.push(new S(.015,.015,1.1,5).translate(t,h+.55,n)),i.push(new D(.28,10,8).scale(1,1.35,1).translate(t,h+.5,n));for(let r=0;r<4;r++)a.push(new D(.06,8,6).translate(t+(e()-.5)*.4,h+.3+e()*.5,n+(e()<.5?-.24:.24)))}):g(Math.round(f/.8),(t,n)=>{let a=1.2+e()*.5;s.push(new S(.025,.03,a,6).translate(t,h+a/2,n+.2)),r.push(new D(.12,8,6).scale(1.6,.4,1).translate(t+.08,h+a*.5,n+.2)),o.push(new S(.24,.24,.04,14).rotateX(Math.PI/2).translate(t,h+a,n+.18)),s.push(new S(.11,.11,.06,12).rotateX(Math.PI/2).translate(t,h+a,n+.21)),i.push(new Ae(.12,.3,7).translate(t+.25,h+.15,n-.22))})});for(let e of se)t.push({size:[e.w,e.h-.06,e.w],at:[e.x,(e.h-.06)/2,e.z]}),t.push({size:[e.w+.08,.06,e.w+.08],at:[e.x,e.h-.03,e.z]}),n.push({size:[e.w-.12,.04,e.w-.12],at:[e.x,e.h-.02,e.z]}),s.push(new S(.07,.1,1.5,8).translate(e.x,e.h+.75,e.z)),i.push(new D(.75,14,10).translate(e.x,e.h+1.75,e.z)),r.push(new D(.5,12,8).translate(e.x+.45,e.h+1.45,e.z+.2)),r.push(new D(.45,12,8).translate(e.x-.4,e.h+1.5,e.z-.25));return{wood:M(t),soil:M(n),leaves:N(r),dark:N(i),red:N(a),yellow:N(o),brown:N(s)}}function mn(){let{x:e,z:t,r:n,legs:r,h:i}=be,a=[],o=n*.75;for(let n of[-o,o])for(let i of[-o,o])a.push({size:[.16,r,.16],at:[e+n,r/2,t+i]});for(let n of[.5,1.4])a.push({size:[2*o,.08,.08],at:[e,n,t-o]}),a.push({size:[2*o,.08,.08],at:[e,n,t+o]}),a.push({size:[.08,.08,2*o],at:[e-o,n,t]}),a.push({size:[.08,.08,2*o],at:[e+o,n,t]});a.push({size:[2*o+.4,.12,2*o+.4],at:[e,r-.06,t]});for(let o of[-.22,.22])a.push({size:[.06,r+i*.8,.06],at:[e+o,(r+i*.8)/2,t+n+.12]});for(let o=1;o<9;o++)a.push({size:[.44,.04,.04],at:[e,o*(r+i*.8)/9,t+n+.12]});let s=new S(n,n*1.04,i,24).translate(e,r+i/2,t),c=N([.25,.55,.85].map(a=>new we(n*1.03+.02,.035,6,32).rotateX(Math.PI/2).translate(e,r+i*a,t))),l=new Ae(n*1.12,.9,24).translate(e,r+i+.45,t);return{stand:M(a),tank:s,hoops:c,hat:l}}function hn(){let{x:e,z:t,w:n,d:r,h:i}=ne,a=[{size:[n,.07,.8],at:[e,i,t]}];for(let i of[-1,1])a.push({size:[n,.06,.3],at:[e,.44,t+i*(r/2-.15)]});let o=[];for(let a of[-n/2+.25,n/2-.25])o.push({size:[.08,.06,r-.1],at:[e+a,.38,t]}),o.push({size:[.08,i,.08],at:[e+a,i/2,t-.3]}),o.push({size:[.08,i,.08],at:[e+a,i/2,t+.3]});return{top:M(a),legs:M(o)}}function gn(){let e=(0,I.useMemo)(pn,[]),t=(0,I.useMemo)(mn,[]),n=(0,I.useMemo)(hn,[]);return(0,I.useEffect)(()=>()=>[...Object.values(e),...Object.values(t),...Object.values(n)].forEach(e=>e.dispose()),[e,t,n]),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(`mesh`,{geometry:e.wood,material:j(`#b07d4f`),castShadow:!0,receiveShadow:!0,children:(0,R.jsx)(A,{thickness:.02,color:un})}),(0,R.jsx)(`mesh`,{geometry:e.soil,material:j(`#5e4433`),receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.leaves,material:j(`#80c45c`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.dark,material:j(`#3f9b4f`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.red,material:j(`#e63946`)}),(0,R.jsx)(`mesh`,{geometry:e.yellow,material:j(`#ffc93c`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:e.brown,material:j(`#7a5a3c`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:t.stand,material:j(`#5e4a3c`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:t.tank,material:j(`#a8744a`),castShadow:!0,receiveShadow:!0,children:(0,R.jsx)(A,{thickness:.025,color:un})}),(0,R.jsx)(`mesh`,{geometry:t.hoops,material:j(`#495057`)}),(0,R.jsx)(`mesh`,{geometry:t.hat,material:j(`#6b4a33`),castShadow:!0,children:(0,R.jsx)(A,{thickness:.025,color:un})}),(0,R.jsx)(`mesh`,{geometry:n.top,material:j(`#c9905a`),castShadow:!0,receiveShadow:!0,children:(0,R.jsx)(A,{thickness:.018,color:un})}),(0,R.jsx)(`mesh`,{geometry:n.legs,material:j(`#8a5a32`),castShadow:!0})]})}var W={cook:7,char:30},_n=()=>({since:null,turns:0});function G(e,t){if(e.since===null)return`idle`;let n=t-e.since;return n<W.cook?`cooking`:n<W.cook+W.char?`ready`:`charred`}function vn(e,t){if(e.since===null)return 0;let n=Math.max(0,t-e.since);return n<W.cook?n/W.cook:1+Math.min(1,(n-W.cook)/W.char)}function yn(e,t){let n=G(e,t);return n===`cooking`?1:n===`idle`?0:.35}function bn(e,t,n){let r=G(e,t);return r===`cooking`?{op:`turn`,grill:{...e,turns:e.turns+1}}:n?{op:`full`,grill:e}:r===`idle`?{op:`start`,grill:{since:t,turns:0}}:{op:`take`,grill:_n()}}function xn(e){return e===`idle`?`Grill a sausage`:e===`cooking`?`Turn the sausage`:e===`charred`?`Take the (charred) sausage`:`Take the sausage`}var Sn=`#1f1d2b`,Cn=.86,wn=new w(`#e9a0a0`),Tn=new w(`#b5532c`),En=new w(`#3b2922`),Dn=14,On=2.2,kn=1,An={x:a.x,y:Cn,z:a.z};function jn(e){d({name:`grill-sizzle`,group:`toys`,pos:An,dur:.06+Math.random()*.22,peak:(.012+Math.random()*.03)*e,filter:`highpass`,freq:2600+Math.random()*3800,attack:.004}),Math.random()<.18*e&&d({name:`grill-pop`,group:`toys`,pos:An,dur:.03,peak:.05*e,filter:`bandpass`,freq:1500+Math.random()*1500,q:2,attack:.001})}function Mn(){d({name:`grill-hiss`,group:`toys`,pos:An,dur:.9,peak:.07,filter:`highpass`,freq:3200,to:5200,attack:.01})}function Nn(){d({name:`grill-bun`,group:`toys`,pos:An,dur:.12,peak:.04,filter:`lowpass`,freq:700,attack:.01}),ae({name:`grill-bun`,group:`toys`,pos:An,freq:880,to:1320,type:`triangle`,dur:.12,peak:.03})}function Pn(){return{bowl:new D(a.r,24,12,0,Math.PI*2,Math.PI/2,Math.PI/2),lid:new D(a.r*1.02,24,12,0,Math.PI*2,0,Math.PI/2),coals:new Ce(a.r*.85,24).rotateX(-Math.PI/2),puff:new D(.11,10,8)}}function Fn(){let[e,t]=(0,I.useState)(_n),n=(0,I.useRef)(e);n.current=e;let r=(0,I.useMemo)(Pn,[]);(0,I.useEffect)(()=>()=>Object.values(r).forEach(e=>e.dispose()),[r]);let i=(0,I.useMemo)(()=>({sausage:new O({color:wn.clone()}),coals:new Me({color:`#ff6b2c`,toneMapped:!1}),smoke:new Me({color:`#e9ecef`,transparent:!0,opacity:.38,depthWrite:!1})}),[]);(0,I.useEffect)(()=>()=>Object.values(i).forEach(e=>e.dispose()),[i]);let o=(0,I.useRef)(null),s=(0,I.useRef)(null),c=(0,I.useMemo)(()=>({nextCrackle:0,m:new Ne,state:``}),[]),l=()=>performance.now()/1e3,u=G(e,l()),d=tt({id:`grill`,label:xn(u),action:{kind:`roof`,op:`grill`}},3);return E(()=>{let e=l(),r=n.current,u=G(r,e);u!==c.state&&(c.state=u,P.setState({grill:u}),t({...r}));let d=vn(r,e);d<=1?i.sausage.color.lerpColors(wn,Tn,d):i.sausage.color.lerpColors(Tn,En,d-1);let f=yn(r,e);i.coals.color.setRGB(1,.32+.12*Math.sin(e*7)*Math.sin(e*3.1),.08).multiplyScalar(.55+.45*Math.max(f,.3)),o.current&&(o.current.visible=r.since!==null,o.current.rotation.x=r.turns*Math.PI+(f>.5?Math.sin(e*9)*.03:0)),f>0&&e>=c.nextCrackle&&(jn(f),c.nextCrackle=e+(f>.5?.06+Math.random()*.1:.25+Math.random()*.5));let p=s.current;if(p&&(p.visible=f>0,p.visible)){for(let t=0;t<Dn;t++){let n=(e/On+t/Dn)%1,r=(.4+n*1.6)*(t/Dn<f),i=n*n*.9;c.m.makeScale(r,r,r).setPosition(a.x+Math.sin(t*2.3+e*.7)*.12*n,1.01+n*1.6,a.z+i),p.setMatrixAt(t,c.m)}p.instanceMatrix.needsUpdate=!0,i.smoke.opacity=.32*Math.min(1,f+.2)}}),vt(`grill`,()=>{let e=x.getState(),r=l(),{op:i,grill:a}=bn(n.current,r,e.held!==null);if(i===`full`){e.pushToast(`info`,e.held?.kind===`sausage`?`π One at a time: eat that one first (E)`:`π Your hands are full`);return}let o=n.current;n.current=a,t(a),(i===`start`||i===`turn`)&&Mn(),i===`take`&&(Nn(),e.setHeld({kind:`sausage`,id:`sausage-${kn++}`,bites:3,charred:G(o,r)===`charred`}))}),L(`grill`,()=>{let e=l();return{state:G(n.current,e),doneness:Math.round(vn(n.current,e)*100)/100,turns:n.current.turns,sizzle:yn(n.current,e)}}),(0,R.jsxs)(`group`,{children:[(0,R.jsxs)(`group`,{ref:d,children:[(0,R.jsxs)(`group`,{position:[a.x,Cn,a.z],children:[(0,R.jsx)(`mesh`,{geometry:r.bowl,material:j(`#2b2d42`),castShadow:!0,children:(0,R.jsx)(A,{thickness:.015,color:Sn})}),(0,R.jsx)(`mesh`,{geometry:r.coals,position:[0,-.08,0],material:i.coals}),(0,R.jsx)(`mesh`,{position:[0,.01,0],rotation:[-Math.PI/2,0,0],material:j(`#adb5bd`),children:(0,R.jsx)(`ringGeometry`,{args:[a.r*.88,a.r*.95,24]})}),[-.24,-.12,0,.12,.24].map(e=>(0,R.jsx)(`mesh`,{position:[e,.01,0],material:j(`#adb5bd`),children:(0,R.jsx)(`boxGeometry`,{args:[.012,.012,Math.sqrt(a.r*a.r*.85-e*e)*2]})},e)),(0,R.jsx)(`group`,{position:[0,0,a.r],rotation:[1.75,0,0],children:(0,R.jsx)(`mesh`,{geometry:r.lid,position:[0,0,-a.r],material:j(`#2b2d42`),castShadow:!0,children:(0,R.jsx)(A,{thickness:.015,color:Sn})})}),[0,1,2].map(e=>{let t=e/3*Math.PI*2+.5;return(0,R.jsx)(`mesh`,{position:[Math.cos(t)*.28,-.86/2-.05,Math.sin(t)*.28],rotation:[Math.sin(t)*.25,0,-Math.cos(t)*.25],material:j(`#495057`),castShadow:!0,children:(0,R.jsx)(`cylinderGeometry`,{args:[.022,.022,.91,6]})},e)}),(0,R.jsxs)(`group`,{ref:o,position:[.04,.05,0],rotation:[0,.3,0],visible:!1,children:[(0,R.jsx)(`mesh`,{rotation:[0,0,Math.PI/2],material:i.sausage,castShadow:!0,children:(0,R.jsx)(`capsuleGeometry`,{args:[.035,.2,4,10]})}),[-.06,0,.06].map(e=>(0,R.jsx)(`mesh`,{position:[e,-.03,0],material:j(`#5a2d1a`),children:(0,R.jsx)(`boxGeometry`,{args:[.012,.012,.072]})},e))]})]}),(0,R.jsxs)(`group`,{position:[a.x+a.shelf,0,a.z],children:[(0,R.jsxs)(`mesh`,{position:[0,.78,0],material:j(`#c9905a`),castShadow:!0,children:[(0,R.jsx)(`boxGeometry`,{args:[.6,.05,.5]}),(0,R.jsx)(A,{thickness:.012,color:Sn})]}),[-.25,.25].map(e=>[-.2,.2].map(t=>(0,R.jsx)(`mesh`,{position:[e,.38,t],material:j(`#8a5a32`),children:(0,R.jsx)(`boxGeometry`,{args:[.04,.76,.04]})},`${e}${t}`))),(0,R.jsx)(`mesh`,{position:[-.08,.86,0],material:j(`#d4a373`),children:(0,R.jsx)(`boxGeometry`,{args:[.3,.1,.22]})}),[-.05,.05].map(e=>(0,R.jsx)(`mesh`,{position:[-.08,.93,e],rotation:[0,0,Math.PI/2],material:j(`#f2c38b`),children:(0,R.jsx)(`capsuleGeometry`,{args:[.04,.14,4,8]})},e)),(0,R.jsx)(`mesh`,{position:[.17,.89,.1],material:j(`#d62828`),castShadow:!0,children:(0,R.jsx)(`cylinderGeometry`,{args:[.035,.04,.17,10]})}),(0,R.jsx)(`mesh`,{position:[.17,.99,.1],material:qe(`#f8f9fa`),children:(0,R.jsx)(`coneGeometry`,{args:[.02,.05,8]})})]})]}),(0,R.jsx)(`instancedMesh`,{ref:s,args:[r.puff,i.smoke,Dn],frustumCulled:!1,visible:!1,renderOrder:3})]})}var K={x:.17,y:-.15,z:-.42,tilt:-.5,turn:.7},In={x:.03,y:-.07,z:-.24,tilt:-.15,turn:1.35},Ln=`#1f1d2b`;function Rn(){let e=x(e=>e.held?.kind===`sausage`?e.held:null),t=(0,I.useRef)(null),n=(0,I.useRef)(null);if(E(({camera:e})=>{let r=t.current,i=n.current;if(!r||!i)return;r.position.copy(e.position),r.quaternion.copy(e.quaternion);let a=Be.lift,o=performance.now()/1e3;i.position.set(K.x+(In.x-K.x)*a,K.y+(In.y-K.y)*a+Math.sin(o*1.6)*.003*(1-a),K.z+(In.z-K.z)*a),i.rotation.set(K.tilt+(In.tilt-K.tilt)*a,K.turn+(In.turn-K.turn)*a,0,`YXZ`)}),!e)return null;let r=Math.max(.15,e.bites/3),i=.17*r;return(0,R.jsx)(`group`,{ref:t,userData:Ze,children:(0,R.jsx)(`group`,{ref:n,scale:.8,children:(0,R.jsxs)(`group`,{position:[0,0,-.085+i/2],children:[[-1,1].map(e=>(0,R.jsxs)(`mesh`,{position:[e*.026,-.012,0],rotation:[Math.PI/2,0,0],material:j(`#e9b872`),children:[(0,R.jsx)(`capsuleGeometry`,{args:[.026,i,4,10]}),(0,R.jsx)(A,{thickness:.004,color:Ln})]},e)),(0,R.jsxs)(`mesh`,{position:[0,.006,0],rotation:[Math.PI/2,0,0],material:j(e.charred?`#3b2922`:`#b5532c`),children:[(0,R.jsx)(`capsuleGeometry`,{args:[.02,i+.03,4,10]}),(0,R.jsx)(A,{thickness:.004,color:Ln})]}),Array.from({length:Math.max(1,Math.round(5*r))},(e,t)=>(0,R.jsx)(`mesh`,{position:[(t%2?1:-1)*.008,.027,-i/2+.02+t*.032],rotation:[0,(t%2?1:-1)*.9,0],material:j(t%3==2?`#ffc93c`:`#d62828`),children:(0,R.jsx)(`boxGeometry`,{args:[.006,.004,.03]})},t))]})})})}var zn=`#1f1d2b`,{x:q,z:J,t:Y,parapet:X,h:Bn}=me,Z=ce,Vn=1.2;function Hn(e,t,n){let r=new je(e,t).rotateX(-Math.PI/2),i=r.attributes.uv;for(let r=0;r<i.count;r++)i.setXY(r,i.getX(r)*e/n,i.getY(r)*t/n);return r}var Un=[[-q,q,-J,-J+Y],[-q,-q+Y,-J+Y,J-Y],[q-Y,q,-J+Y,J-Y],[-q,Z.minX,J-Y,J],[Z.maxX,q,J-Y,J]];function Wn(){let e=[],t=[],n=[];for(let[r,i,a,o]of Un){let s=i-r,c=o-a,l=(r+i)/2,u=(a+o)/2;e.push({size:[s,X,c],at:[l,X/2,u]}),t.push({size:[s+.06,.07,c+.06],at:[l,X+.035,u]});let d=s>c,f=d?s:c,p=Math.max(1,Math.round(f/1.6));for(let e=0;e<=p;e++){let t=-f/2+e*f/p;n.push({size:[.06,Bn-X,.06],at:[d?l+t:l,X+(Bn-X)/2,d?u:u+t]})}n.push({size:d?[s,.07,.09]:[.09,.07,c],at:[l,Bn,u]}),n.push({size:d?[s,.035,.035]:[.035,.035,c],at:[l,(X+Bn)/2+.05,u]})}return{wall:M(e),cap:M(t),metal:M(n)}}var Q={half:.5,h:2.2};function Gn(e){let{doorHalf:t,doorHeight:n}=m,r=Z.front,i=12+r/2,a=Z.stairX-Q.half,o=Z.stairX+Q.half,s=(e,t,n,a)=>({size:[t-e,a-n,r],at:[(e+t)/2,(n+a)/2,i]}),c=[s(Z.minX,a,0,Z.h),s(a,o,Q.h,Z.h),s(o,-t,0,Z.h),s(-t,t,n,Z.h),s(t,Z.maxX,0,Z.h),{size:[.25,Z.h+e,Z.maxZ-12],at:[Z.minX+.125,(Z.h-e)/2,(12+Z.maxZ)/2]},{size:[.25,Z.h+e,Z.maxZ-12],at:[Z.maxX-.125,(Z.h-e)/2,(12+Z.maxZ)/2]},{size:[Z.maxX-Z.minX,Z.h+e,.25],at:[(Z.minX+Z.maxX)/2,(Z.h-e)/2,Z.maxZ-.125]}],l=[{size:[Z.maxX-Z.minX+.3,.2,Z.maxZ-12+.3],at:[(Z.minX+Z.maxX)/2,Z.h+.1,(12+Z.maxZ)/2]},{size:[1.4,.7,1.1],at:[Z.minX+1.4,Z.h+.55,Z.maxZ-1]},{size:[.9,.5,.9],at:[Z.maxX-.9,Z.h+.45,12.9]}],u=[{size:[Z.maxX-Z.minX+.04,.22,.04],at:[(Z.minX+Z.maxX)/2,Z.h-.5,11.98]},{size:[.08,Q.h+.08,.08],at:[a-.04,Q.h/2,11.98]},{size:[.08,Q.h+.08,.08],at:[o+.04,Q.h/2,11.98]},{size:[Q.half*2+.16,.08,.08],at:[Z.stairX,Q.h+.04,11.98]},{size:[.05,1.6,.05],at:[Z.maxX-.6,Z.h+.2+.8,12.5]}],d=[{size:[Q.half*2,Q.h,.05],at:[Z.stairX,Q.h/2,12.06]}],f=[{size:[.05,.05,.08],at:[Z.stairX+Q.half-.14,1.05,12]},{size:[.5,.04,.04],at:[Z.stairX,1,12.01]}];return{walls:M(c),roof:M(l),trim:M(u),door:M(d),handle:M(f)}}function Kn(){let e=[new k(.3,.14,.12).translate(Z.stairX,Q.h+.35,11.94)];for(let t=0;t<12;t++){let n=t/12*Math.PI*2;e.push(new D(.09,10,6,0,Math.PI*2,0,Math.PI/2).translate(_.x+Math.cos(n)*(_.r+.25),0,_.z+Math.sin(n)*(_.r+.25)))}return N(e)}function qn(){let e=(0,I.useRef)(null),t=(0,I.useMemo)(()=>new S(.2,.09,1.3,16,1,!0).rotateX(Math.PI/2).translate(0,0,.65),[]);(0,I.useEffect)(()=>()=>t.dispose(),[t]);let n=(0,I.useMemo)(()=>new O({map:Yt(),side:2}),[]);return(0,I.useEffect)(()=>()=>n.dispose(),[n]),E(({clock:t})=>{let n=e.current;if(!n)return;let r=t.elapsedTime,i=.5+.5*Math.sin(r*.35)*Math.sin(r*.13+1);n.rotation.set(.55*(1-i)+Math.sin(r*3.1)*.04,Math.sin(r*.27)*.5+Math.sin(r*1.7)*.06,0,`YXZ`)}),(0,R.jsxs)(`group`,{position:[ye.x,0,ye.z],children:[(0,R.jsx)(`mesh`,{position:[0,ye.h/2,0],material:j(`#adb5bd`),castShadow:!0,children:(0,R.jsx)(`cylinderGeometry`,{args:[.045,.06,ye.h,10]})}),(0,R.jsx)(`group`,{ref:e,position:[0,ye.h-.12,0],children:(0,R.jsx)(`mesh`,{geometry:t,material:n,castShadow:!0})})]})}function Jn({top:e}){let t=ee(e),n=(0,I.useMemo)(()=>{let e=p.maxX-p.minX,t=p.maxZ-p.minZ;return{paving:Hn(2*q,2*J,Vn).translate(0,0,0),decking:(()=>{let n=new k(e,.06,t),r=n.attributes.uv;for(let n=0;n<r.count;n++)r.setXY(n,r.getX(n)*e/Vn,r.getY(n)*t/Vn);return n.translate((p.minX+p.maxX)/2,.03,(p.minZ+p.maxZ)/2)})(),helipad:new Ce(_.r,64).rotateX(-Math.PI/2).translate(_.x,.005,_.z),bulbs:Kn()}},[]),r=(0,I.useMemo)(Wn,[]),i=(0,I.useMemo)(()=>Gn(t),[t]);(0,I.useEffect)(()=>()=>[...Object.values(n),...Object.values(r)].forEach(e=>e.dispose()),[n,r]),(0,I.useEffect)(()=>()=>Object.values(i).forEach(e=>e.dispose()),[i]);let a=(0,I.useMemo)(()=>({paving:new O({map:Gt()}),decking:new O({map:Kt()}),helipad:new O({map:qt(),transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2})}),[]);return(0,I.useEffect)(()=>()=>Object.values(a).forEach(e=>e.dispose()),[a]),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(`mesh`,{geometry:n.paving,material:a.paving,receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:n.decking,material:a.decking,receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:n.helipad,material:a.helipad,receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:n.bulbs,material:Xe}),(0,R.jsx)(`mesh`,{geometry:r.wall,material:j(`#c9c2b4`),receiveShadow:!0,castShadow:!0,children:(0,R.jsx)(A,{thickness:.02,color:zn})}),(0,R.jsx)(`mesh`,{geometry:r.cap,material:j(`#ece6da`),receiveShadow:!0}),(0,R.jsx)(`mesh`,{geometry:r.metal,material:j(`#5c677d`),castShadow:!0}),(0,R.jsx)(`mesh`,{geometry:i.walls,material:j(`#efe3cc`),receiveShadow:!0,castShadow:!0,children:(0,R.jsx)(A,{thickness:.02,color:zn})}),(0,R.jsx)(`mesh`,{geometry:i.roof,material:j(`#8d99ae`),castShadow:!0,receiveShadow:!0,children:(0,R.jsx)(A,{thickness:.02,color:zn})}),(0,R.jsx)(`mesh`,{geometry:i.trim,material:j(`#ff8a5b`)}),(0,R.jsx)(`mesh`,{geometry:i.door,material:j(`#2a9d8f`)}),(0,R.jsx)(`mesh`,{geometry:i.handle,material:j(`#dee2e6`)}),(0,R.jsx)(qn,{}),(0,R.jsx)(ct,{top:e})]})}var Yn={x:0,z:11},Xn=[{x:-14.4,z:-4.8},{x:-14.4,z:-1.2}],Zn=null,Qn=()=>Zn??=c([...o(),i()],{planR:ie+.1,lineR:ie+.03,greed:1.3}),$n=(e,t)=>l(Qn(),e,t),er=0,tr=Math.PI/2,nr=.5,rr=.16,ir={every:6,breakChance:.2,callChance:.06,ride:2.5},ar=3e3,or=(e,t)=>$n(e,t)??[t];function sr({agent:e,chair:t}){let n=(0,I.useRef)(null),r=g(t);return E(()=>{let t=n.current;if(!t)return;let r=oe(e.id),i=r?he(r.sit):1;t.rotation.x=Zt*i,t.position.y=nr-rr*i}),(0,R.jsx)(`group`,{position:[r.x,0,r.z],children:(0,R.jsx)(`group`,{ref:n,position:[0,.33999999999999997,0],rotation:[Zt,0,0],children:(0,R.jsx)(`group`,{position:[0,-.5,0],children:(0,R.jsx)(Je,{agent:e})})})})}function cr({agent:e}){return(0,R.jsx)(`group`,{position:[Xn[0].x,0,Xn[0].z],rotation:[0,tr,0],children:(0,R.jsx)(Je,{agent:e})})}function lr(){let e=De(e=>e.camera),t=x(e=>e.agents),[n,r]=(0,I.useState)([]),i=(0,I.useMemo)(()=>new Map,[]),a=(0,I.useMemo)(()=>({roll:ir.every,mounted:Date.now(),dirty:!1}),[]);(0,I.useEffect)(()=>()=>{for(let e of i.keys())re(e),y(e,null);i.clear()},[i]);let o=(e,t)=>{if(!e||!Le(e.status))return!1;let n=e.role===`ceo`?`call`:`break`,r=Ve(Ge(),e.id,n,Date.now(),Math.random(),{chairs:b.xs.length,playerChair:P.getState().sitting,ride:ir.ride,stay:t});return r&&Ue(r),!!r};vt(`visit`,e=>{let[t,n]=e.split(`:`);o(x.getState().agents[t],n?Number(n):void 0)||x.getState().pushToast(`info`,`π No room on the roof for them just now (or they are busy)`)}),L(`visitors`,()=>[...i.values()].map(e=>({id:e.id,name:x.getState().agents[e.id]?.name??e.id,kind:e.kind,chair:e.chair,stage:e.stage,seated:oe(e.id)?.stage===`seated`})));let c=(e,t)=>{a.dirty=!0,t?i.set(e.id,e):i.delete(e.id)},l=(e,t,n)=>{e.stage=`leave`,e.hurry=t,e.path=[...or(n,Yn),Ye],e.wp=0,e.waited=e.ghost=0,y(e.id,null),t&&He(e.id,{leave:Date.now()})},u=(t,n,r,a)=>{let o=oe(t.id);if(!o)return!1;t.wp=Re(t.path,t.wp,o);let c=t.path[t.wp],l=t.wp===t.path.length-1,u=c.x-o.x,d=c.z-o.z,p=Math.hypot(u,d);if(l&&p<.08&&o.speed<.05)return!0;let m=l&&a!==void 0?a:Math.atan2(-u,-d),h=t.hurry?We:ve;if(p>.05&&t.ghost<=0){let a=[...i.values()].filter(e=>e!==t).flatMap(e=>{let t=oe(e.id);return t?[{id:e.id,x:t.x,z:t.z}]:[]}),c=s({id:t.id,x:o.x,z:o.z,dx:u/p,dz:d/p},a,{x:e.position.x,z:e.position.z},(e,t)=>f(Qn().rects,e,t,ie));if(c.wait||c.speed<.15)return t.waited+=n,t.waited>3&&(t.ghost=2),ge(t.id,{mode:`standing`,x:o.x,z:o.z,heading:o.heading,gesture:r}),!1}return t.waited=0,t.ghost=Math.max(0,t.ghost-n),ge(t.id,{mode:`walking`,x:c.x,z:c.z,heading:m,speed:h,gesture:r}),!1};return E((e,t)=>{let n=Math.min(t,.1),s=Date.now(),d=x.getState(),f=it(rt.t)<.5,p=Ge(s);for(let e of p){if(i.has(e.id)||!d.agents[e.id])continue;let t=ze(e,s);if(t===`down`)continue;let n={id:e.id,kind:e.kind,chair:e.chair,stage:`riding`,t:0,path:[],wp:0,leg:0,hold:-1,hurry:!1,waited:0,ghost:0,quietAt:0};t===`up`&&(s-e.arrive>ar||s-a.mounted<1e3)&&(e.kind===`call`?(de(e.id,Xn[0].x,Xn[0].z,tr),ge(e.id,{gesture:`call`}),n.stage=`call`):n.stage=`seated`),c(n,!0)}for(let e of i.values()){let t=d.agents[e.id],r=p.find(t=>t.id===e.id);if(!t||!r&&e.stage===`riding`){re(e.id),c(e,!1);continue}e.t+=n;let i=oe(e.id),o=!Le(t.status),m=!r||s>=r.leave;switch(e.quietAt&&s>e.quietAt&&(y(e.id,null),e.quietAt=0),e.stage){case`riding`:r&&s>=r.arrive&&(de(e.id,Ye.x,Ye.z,er),h({x:0,y:2.6,z:12}),e.stage=`doors`,e.t=0,a.dirty=!0);break;case`doors`:if(e.t<1.2)break;e.path=[Yn,...or(Yn,e.kind===`call`?Xn[0]:_e(e.chair))],e.wp=0,e.hurry=o,e.stage=`walk`;break;case`walk`:o&&!e.hurry&&i?l(e,!0,i):u(e,n,e.kind===`call`?`call`:`none`,e.kind===`call`?tr:er)&&(e.kind===`call`?(e.stage=`call`,e.t=0):(re(e.id),e.stage=`sitting`));break;case`sitting`:i?.stage===`seated`&&(e.stage=`seated`,y(e.id,f?`π`:`π`),e.quietAt=s+3e3);break;case`seated`:(m||o)&&i&&l(e,o,_e(e.chair));break;case`call`:{if((m||o)&&i){l(e,o,i);break}let t=Xn[e.leg];if((!e.path.length||e.path[e.path.length-1]!==t)&&(e.path=[t],e.wp=0),!u(e,n,`call`,tr))break;e.hold<0&&(e.hold=4+Math.random()*5,Math.random()<.6&&(y(e.id,Math.random()<.5?`π`:`π¬`),e.quietAt=s+2500)),e.hold-=n,e.hold<=0&&(e.leg=1-e.leg,e.hold=-1);break}case`leave`:u(e,n,`none`)&&(Ke(e.id),re(e.id),y(e.id,null),c(e,!1))}}if(a.roll-=n,a.roll<=0){a.roll=ir.every;let e=new Set(p.map(e=>e.id)),t=Object.values(d.agents).filter(t=>!e.has(t.id)&&Le(t.status)),n=t.filter(e=>e.role!==`ceo`);n.length&&Math.random()<ir.breakChance&&o(n[Math.floor(Math.random()*n.length)]);let r=t.find(e=>e.role===`ceo`);r&&Math.random()<ir.callChance&&o(r)}a.dirty&&(a.dirty=!1,r([...i.values()].filter(e=>e.stage!==`riding`).map(e=>({id:e.id,kind:e.kind,chair:e.chair}))))}),(0,R.jsx)(`group`,{children:n.map(e=>{let n=t[e.id];return n?e.kind===`call`?(0,R.jsx)(cr,{agent:n},e.id):(0,R.jsx)(sr,{agent:n,chair:e.chair},e.id):null})})}var ur=[[0,3],[1,2],[2,5],[3,4],[0,2],[2,4],[1,3],[3,5]],dr=r.h-.12,fr=.62,pr=[`#fff1c9`,`#fff1c9`,`#ffb86b`,`#ff8fab`,`#8ecae6`,`#fff1c9`,`#b9fbc0`],mr=new w(`#bdb6a6`),hr=new w(`#ffffff`);function gr(e,t,n,r){return Array.from({length:n+1},(i,a)=>{let o=a/n;return new C(e.x+(t.x-e.x)*o,dr-r*4*o*(1-o),e.z+(t.z-e.z)*o)})}function _r(){let e=document.createElement(`canvas`);e.width=e.height=64;let t=e.getContext(`2d`),n=t.createRadialGradient(32,32,0,32,32,32);n.addColorStop(0,`rgba(255,255,255,1)`),n.addColorStop(.25,`rgba(255,255,255,0.55)`),n.addColorStop(1,`rgba(255,255,255,0)`),t.fillStyle=n,t.fillRect(0,0,64,64);let r=new Pe(e);return r.colorSpace=Se,r}function vr(){let e=(0,I.useRef)(null),t=(0,I.useMemo)(()=>{let e=[],t=[];for(let[n,r]of ur){let i=te[n],a=te[r],o=Math.hypot(a.x-i.x,a.z-i.z),s=gr(i,a,24,.12+o*.035);for(let t=0;t<s.length-1;t++)e.push(s[t].x,s[t].y,s[t].z,s[t+1].x,s[t+1].y,s[t+1].z);let c=Math.floor(o/fr);for(let e of gr(i,a,c,.12+o*.035).slice(1,-1))t.push(e.setY(e.y-.07))}let n=new xe;n.setAttribute(`position`,new T(e,3));let i=t.map((e,t)=>new w(pr[t%pr.length])),a=new xe;return a.setAttribute(`position`,new T(t.flatMap(e=>[e.x,e.y,e.z]),3)),a.setAttribute(`color`,new T(i.flatMap(e=>[e.r,e.g,e.b]),3)),{at:t,colors:i,wireGeo:n,haloGeo:a,poles:N(te.flatMap(e=>[new S(r.r,r.r*1.3,r.h,8).translate(e.x,r.h/2,e.z),new D(r.r*1.6,8,6).translate(e.x,r.h,e.z)])),bulbGeo:new D(.055,10,8).scale(1,1.3,1),bulbMat:new Me({color:mr.clone(),toneMapped:!1}),wireMat:new Ee({color:`#2b2d42`}),haloMat:new ke({size:.55,map:_r(),vertexColors:!0,transparent:!0,opacity:0,depthWrite:!1,blending:2,toneMapped:!1}),level:-1}},[]);(0,I.useEffect)(()=>()=>{for(let e of[t.wireGeo,t.haloGeo,t.poles,t.bulbGeo,t.bulbMat,t.wireMat,t.haloMat,t.haloMat.map])e?.dispose()},[t]),(0,I.useEffect)(()=>{let n=e.current;if(!n)return;let r=new Ne;t.at.forEach((e,i)=>{n.setMatrixAt(i,r.makeTranslation(e.x,e.y,e.z)),n.setColorAt(i,t.colors[i])}),n.instanceMatrix.needsUpdate=!0,n.instanceColor&&(n.instanceColor.needsUpdate=!0)},[t]);let n=(0,I.useRef)(null);return E(()=>{let e=Qe();Math.abs(e-t.level)<.004||(t.level=e,t.bulbMat.color.lerpColors(mr,hr,e),t.haloMat.opacity=e*.65,n.current&&(n.current.visible=e>.02))}),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(`mesh`,{geometry:t.poles,material:j(`#3d405b`),castShadow:!0}),(0,R.jsx)(`lineSegments`,{geometry:t.wireGeo,material:t.wireMat}),(0,R.jsx)(`instancedMesh`,{ref:e,args:[t.bulbGeo,t.bulbMat,t.at.length]}),(0,R.jsx)(`points`,{ref:n,geometry:t.haloGeo,material:t.haloMat,visible:!1,renderOrder:2})]})}var yr=72,$=45,br=90*Math.tan(.0358)*1.25,xr=1.36,Sr={yaw:-.7,pitch:.08},Cr=`
|
|
2
|
+
varying vec2 vUv;
|
|
3
|
+
void main() {
|
|
4
|
+
vUv = uv;
|
|
5
|
+
vec4 p = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
6
|
+
gl_Position = p.xyww;
|
|
7
|
+
}`,wr=`
|
|
8
|
+
uniform sampler2D map;
|
|
9
|
+
uniform vec3 color;
|
|
10
|
+
uniform float opacity;
|
|
11
|
+
uniform bool textured;
|
|
12
|
+
varying vec2 vUv;
|
|
13
|
+
void main() {
|
|
14
|
+
vec4 t = textured ? texture2D(map, vUv) : vec4(1.0);
|
|
15
|
+
gl_FragColor = vec4(color * t.rgb, t.a * opacity);
|
|
16
|
+
#include <colorspace_fragment>
|
|
17
|
+
}`,Tr=`
|
|
18
|
+
attribute float aSize;
|
|
19
|
+
uniform float uPixel;
|
|
20
|
+
uniform float uOpacity;
|
|
21
|
+
varying float vAlpha;
|
|
22
|
+
void main() {
|
|
23
|
+
vAlpha = uOpacity * smoothstep(0.0, 0.08, normalize(mat3(modelMatrix) * position).y);
|
|
24
|
+
vec4 p = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
25
|
+
gl_Position = p.xyww;
|
|
26
|
+
gl_PointSize = aSize * uPixel;
|
|
27
|
+
}`,Er=`
|
|
28
|
+
varying float vAlpha;
|
|
29
|
+
void main() {
|
|
30
|
+
float r = length(gl_PointCoord - 0.5);
|
|
31
|
+
float a = max(1.0 - smoothstep(0.1, 0.2, r), (1.0 - smoothstep(0.0, 0.5, r)) * 0.4);
|
|
32
|
+
gl_FragColor = vec4(1.0, 0.97, 0.88, vAlpha * a);
|
|
33
|
+
#include <colorspace_fragment>
|
|
34
|
+
}`;function Dr(e,t,n){return new Te({vertexShader:Cr,fragmentShader:wr,uniforms:{map:{value:e},color:{value:new w(t)},opacity:{value:n},textured:{value:!!e}},transparent:!0,depthWrite:!1})}function Or(e,t,n){let r=document.createElement(`canvas`);r.width=e,r.height=t,n(r.getContext(`2d`));let i=new Pe(r);return i.colorSpace=Se,i.anisotropy=4,i}function kr(){return Or(512,512,e=>{let t=5,n=()=>((t=t*16807%2147483647)-1)/2147483646,r=e.createRadialGradient(256,256,184.5,256,256,256);r.addColorStop(0,`rgba(190,205,255,0.25)`),r.addColorStop(1,`rgba(190,205,255,0)`),e.fillStyle=r,e.fillRect(0,0,512,512);let i=e.createRadialGradient(216,216,10,256,256,205);i.addColorStop(0,`#fbf6e6`),i.addColorStop(.8,`#e9e0c6`),i.addColorStop(1,`#c9bfa4`),e.fillStyle=i,e.beginPath(),e.arc(256,256,205,0,Math.PI*2),e.fill(),e.save(),e.clip();let a=[[-60,-70,70,50,.3],[10,-95,55,40,-.2],[60,-40,60,45,.5],[-95,10,45,75,.2],[-30,25,65,45,-.4],[40,40,40,30,.1],[-120,-40,35,30,0]];e.fillStyle=`rgba(150,143,125,0.55)`;for(let[t,n,r,i,o]of a)e.beginPath(),e.ellipse(256+t,256+n,r,i,o,0,Math.PI*2),e.fill();for(let t=0;t<46;t++){let t=n()*Math.PI*2,r=Math.sqrt(n())*205*.92,i=256+Math.cos(t)*r,a=256+Math.sin(t)*r,o=3+n()**2*18;e.fillStyle=`rgba(120,112,96,0.45)`,e.beginPath(),e.arc(i,a,o,0,Math.PI*2),e.fill(),e.strokeStyle=`rgba(255,252,240,0.7)`,e.lineWidth=Math.max(1,o*.22),e.beginPath(),e.arc(i,a,o,Math.PI*.6,Math.PI*1.6),e.stroke()}e.strokeStyle=`rgba(255,255,250,0.22)`,e.lineWidth=3;for(let t=0;t<14;t++){let r=t/14*Math.PI*2+n()*.2;e.beginPath(),e.moveTo(231,391),e.lineTo(231+Math.cos(r)*(80+n()*120),391+Math.sin(r)*(80+n()*120)),e.stroke()}e.fillStyle=`#fffdf5`,e.beginPath(),e.arc(231,391,9,0,Math.PI*2),e.fill(),e.restore()})}function Ar(e){return Or(512,96,t=>{t.font=`600 44px ${fe}`,t.textAlign=`center`,t.textBaseline=`middle`,t.lineWidth=8,t.strokeStyle=`rgba(8,12,40,0.85)`,t.strokeText(e,256,48),t.fillStyle=`#d7e3ff`,t.fillText(e,256,48)})}function jr({visible:e}){let t=(0,I.useRef)(null),n=(0,I.useRef)(null),r=(0,I.useRef)(null),i=(0,I.useMemo)(()=>{let e=ft(700),t=Pt(),n=t=>new C(e.positions[t*3],e.positions[t*3+1],e.positions[t*3+2]),r=new xe;r.setAttribute(`position`,new T(t.flatMap(e=>e.lines.flatMap(([e,t])=>[...n(e).multiplyScalar($).toArray(),...n(t).multiplyScalar($).toArray()])),3));let i=t.map(e=>{let t=Ar(e.name),n=new C(...e.centre).multiplyScalar($);return{name:e.name,at:n,tex:t,mat:Dr(t,`#ffffff`,.9)}}),a=new C(...xt()),o=new Set(t.flatMap(e=>e.stars)),s=new xe;return s.setAttribute(`position`,new T(Array.from(e.positions,e=>e*$),3)),s.setAttribute(`aSize`,new T(Array.from(e.sizes,(e,t)=>o.has(t)?6+e*1.5:e*2.6),1)),{figures:t,starGeo:s,starMat:new Te({vertexShader:Tr,fragmentShader:Er,uniforms:{uPixel:{value:1},uOpacity:{value:0}},transparent:!0,depthWrite:!1}),lines:r,lineMat:Dr(null,`#9fc3ff`,.6),labels:i,labelGeo:new je(3.6,.68),moonGeo:new je(br,br),moonMat:Dr(kr(),`#ffffff`,1),axis:a,q:new Oe,back:new Oe}},[]);(0,I.useEffect)(()=>()=>{for(let e of[i.lines,i.lineMat,i.starGeo,i.starMat,i.labelGeo,i.moonGeo,i.moonMat,i.moonMat.uniforms.map.value])e.dispose();for(let e of i.labels)e.tex.dispose(),e.mat.dispose()},[i]);let a=(0,I.useRef)([]);return E(({camera:o,gl:s})=>{let c=t.current;if(!c)return;let l=rt.t,u=it(l);if(c.visible=e.current&&u>.3,!c.visible)return;c.position.copy(o.position),i.q.setFromAxisAngle(i.axis,St(l)),n.current?.quaternion.copy(i.q),i.back.copy(i.q).invert();let d=Math.min(1,(u-.3)/.4);i.lineMat.uniforms.opacity.value=.6*d,i.starMat.uniforms.uOpacity.value=d,i.starMat.uniforms.uPixel.value=s.getPixelRatio();for(let[e,t]of i.labels.entries()){let n=a.current[e];n&&(t.mat.uniforms.opacity.value=.9*d,n.quaternion.copy(i.back).multiply(o.quaternion))}let[f,p,m]=wt(l),h=r.current;h&&(h.visible=p>-.03,h.position.set(f*$,p*$,m*$),h.quaternion.copy(o.quaternion),i.moonMat.uniforms.opacity.value=d)}),(0,R.jsxs)(`group`,{ref:t,visible:!1,children:[(0,R.jsx)(`mesh`,{ref:r,geometry:i.moonGeo,material:i.moonMat,frustumCulled:!1,renderOrder:1001}),(0,R.jsxs)(`group`,{ref:n,children:[(0,R.jsx)(`points`,{geometry:i.starGeo,material:i.starMat,frustumCulled:!1,renderOrder:1001}),(0,R.jsx)(`lineSegments`,{geometry:i.lines,material:i.lineMat,frustumCulled:!1,renderOrder:1001}),i.labels.map((e,t)=>(0,R.jsx)(`mesh`,{ref:e=>void(a.current[t]=e),position:e.at,geometry:i.labelGeo,material:e.mat,frustumCulled:!1,renderOrder:1002},e.name))]})]})}function Mr(){let e=De(e=>e.camera),t=(0,I.useRef)(null),n=(0,I.useMemo)(()=>({...Sr}),[]),r=(0,I.useRef)(!1),i=tt({id:`telescope`,label:`Look through the telescope`,action:{kind:`roof`,op:`telescope`}},3),a=()=>{r.current||(ot({id:`telescope`,x:v.x,y:v.eye,z:v.z,tilt:0,look:.9/P.getState().zoom,minPitch:-.5,maxPitch:1.45,exit:{x:v.x,z:v.z+1.05},yaw:n.yaw,pitch:n.pitch,onLeave:()=>P.setState({telescope:!1})}),P.setState({telescope:!0,sitting:null}))},o=e=>{Number.isFinite(e)&&P.setState({zoom:Math.min(st.max,Math.max(st.min,Math.round(e/st.step)*st.step))})};return vt(`telescope`,a),vt(`zoom`,e=>o(Number(e))),L(`telescope`,()=>({yaw:Math.round(n.yaw*180/Math.PI),pitch:Math.round(n.pitch*180/Math.PI),fov:Math.round(e.fov*10)/10})),L(`sky`,()=>{let e=rt.t,t=wt(e);return{night:Math.round(it(e)*100)/100,moon:{...Tt(t),up:t[1]>0},constellations:Pt().map(t=>({name:t.name,stars:t.stars.length,...Tt(Ct(t.centre,e))}))}}),(0,I.useEffect)(()=>{let e=0,t=t=>{r.current&&(e-=t.deltaMode===1?t.deltaY*40:t.deltaY,!(Math.abs(e)<80)&&(o(P.getState().zoom+Math.sign(e)*st.step),e=0))};return window.addEventListener(`wheel`,t,{passive:!0}),()=>window.removeEventListener(`wheel`,t)},[]),(0,I.useEffect)(()=>()=>{lt()?.id===`telescope`&&dt(),e.fov=yr,e.updateProjectionMatrix()},[e]),E((i,a)=>{let o=lt(),s=P.getState();r.current=s.telescope&&o?.id===`telescope`,r.current&&o&&(n.yaw=o.yaw,n.pitch=o.pitch,o.look=.9/s.zoom);let c=t.current;c&&(c.rotation.set(n.pitch,n.yaw,0,`YXZ`),c.visible=!r.current);let l=r.current?yr/s.zoom:yr;e.fov!==l&&(e.fov=Math.abs(l-e.fov)<.05?l:e.fov+(l-e.fov)*(1-Math.exp(-a*12)),e.updateProjectionMatrix())}),(0,R.jsxs)(`group`,{children:[(0,R.jsxs)(`group`,{ref:i,position:[v.x,0,v.z],children:[[0,1,2].map(e=>{let t=e/3*Math.PI*2+.3;return(0,R.jsx)(`mesh`,{position:[Math.cos(t)*.2,xr/2-.05,Math.sin(t)*.2],rotation:[Math.sin(t)*.3,0,-Math.cos(t)*.3],material:j(`#6c757d`),castShadow:!0,children:(0,R.jsx)(`cylinderGeometry`,{args:[.025,.03,1.4100000000000001,8]})},e)}),(0,R.jsx)(`mesh`,{position:[0,.55,0],material:j(`#adb5bd`),children:(0,R.jsx)(`cylinderGeometry`,{args:[.16,.16,.03,12]})}),(0,R.jsx)(`mesh`,{position:[0,1.3,0],material:j(`#343a40`),castShadow:!0,children:(0,R.jsx)(`boxGeometry`,{args:[.14,.16,.14]})}),(0,R.jsxs)(`group`,{ref:t,position:[0,1.4400000000000002,0],children:[(0,R.jsxs)(`mesh`,{position:[0,0,-.15],rotation:[Math.PI/2,0,0],material:j(`#f8f9fa`),castShadow:!0,children:[(0,R.jsx)(`cylinderGeometry`,{args:[.085,.085,1,20]}),(0,R.jsx)(A,{thickness:.012,color:`#1f1d2b`})]}),(0,R.jsxs)(`mesh`,{position:[0,0,-.7],rotation:[Math.PI/2,0,0],material:j(`#1d3557`),castShadow:!0,children:[(0,R.jsx)(`cylinderGeometry`,{args:[.105,.1,.22,20]}),(0,R.jsx)(A,{thickness:.012,color:`#1f1d2b`})]}),(0,R.jsx)(`mesh`,{position:[0,0,0],rotation:[Math.PI/2,0,0],material:j(`#d4a373`),children:(0,R.jsx)(`cylinderGeometry`,{args:[.09,.09,.05,20]})}),(0,R.jsx)(`mesh`,{position:[0,.06,.4],rotation:[Math.PI/2-.6,0,0],material:j(`#343a40`),children:(0,R.jsx)(`cylinderGeometry`,{args:[.025,.03,.14,10]})}),(0,R.jsx)(`mesh`,{position:[.08,.11,-.05],rotation:[Math.PI/2,0,0],material:j(`#d4a373`),children:(0,R.jsx)(`cylinderGeometry`,{args:[.022,.022,.3,10]})})]})]}),(0,R.jsx)(jr,{visible:r})]})}function Nr({top:e}){return(0,I.useEffect)(()=>pt(yt,bt),[]),(0,I.useEffect)(()=>()=>void dt(),[]),L(`lights`,()=>Math.round(Qe()*100)/100),L(`elevation`,()=>ee(e)),(0,R.jsxs)(`group`,{children:[(0,R.jsx)(Jn,{top:e}),(0,R.jsx)($e,{floorLabel:`β² R Β· Roof terrace`,accent:`#ff8a5b`}),(0,R.jsx)(gn,{}),(0,R.jsx)(vr,{}),(0,R.jsx)(ln,{}),(0,R.jsx)(Fn,{}),(0,R.jsx)(Mr,{}),(0,R.jsx)(Vt,{top:e}),(0,R.jsx)(lr,{}),(0,R.jsx)(Rn,{}),(0,R.jsx)(ut,{kind:`roof`})]})}export{Nr as default};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{s as e,t,u as n}from"./jsx-runtime-BFUkm7bt.js";import{$t as r,An as i,Bn as a,C as o,En as s,Fi as c,Fn as l,Hn as u,In as d,Ji as f,Ln as p,Ni as m,On as h,Pa as g,Pn as ee,Qn as te,Ri as ne,Rn as re,Si as _,Un as ie,Uo as ae,Vi as oe,Wn as v,_ as se,_n as ce,_o as y,_t as b,an as le,ar as ue,bo as de,bt as fe,c as x,cn as S,co as C,cr as pe,dn as me,dr as he,en as ge,eo as _e,gn as ve,ha as ye,jt as be,kt as xe,ln as Se,lr as Ce,mo as we,nr as w,on as Te,oo as Ee,or as T,p as E,pt as D,qn as De,rr as Oe,sn as ke,so as O,sr as Ae,tn as je,to as Me,tr as Ne,va as k,vn as Pe,vo as A,w as j,wi as M,xi as Fe,zn as Ie}from"./store-FA83kfnc.js";import{c as N,y as Le}from"./index-B6qvKFYN.js";import{Bt as P,C as Re,Ct as F,O as ze,P as Be,S as Ve,Tt as He,et as Ue,f as I,g as We,gt as Ge,i as Ke,n as qe,pt as Je,rt as Ye,tt as Xe,w as Ze,x as Qe,xt as $e}from"./bloomMarks-DariC6lY.js";import{d as et,l as tt,t as nt}from"./useGraphics-Cif18p7Q.js";import{Dt as rt,In as L,J as it,Jt as R,K as at,Q as z,Rn as ot,Rt as B,Wn as V,X as H,Xn as st,Yn as ct,Z as U,a as lt,bt as ut,c as dt,ft,k as pt,kt as mt,n as ht,o as gt,pn as W,r as _t,t as vt}from"./cheerRules-CZGSrxOB.js";import{t as yt}from"./BufferGeometryUtils-BsmWvcA2.js";import{a as bt,n as xt,o as St,r as Ct}from"./Batched-BOgjreKO.js";import{B as wt,H as Tt,M as Et,U as G,V as Dt,y as Ot}from"./rig-wAyl3G1G.js";import{n as kt,r as At}from"./interact-0qw7BGhL.js";import{$ as jt,J as Mt}from"./AccessibilitySettings-DSmFk9JC.js";import{c as Nt,n as Pt,u as Ft}from"./useDayTime-0XsqM14Q.js";import{A as It,C as Lt,D as Rt,E as zt,O as Bt,S as Vt,T as Ht,j as Ut,w as Wt,x as Gt}from"./TerminalView-wlhSixSH.js";import{i as Kt}from"./dogState-DiOvoobI.js";function qt(){return qt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qt.apply(null,arguments)}var K=n(e()),Jt=K.forwardRef(function({children:e,follow:t=!0,lockX:n=!1,lockY:r=!1,lockZ:i=!1,...a},o){let s=K.useRef(null),c=K.useRef(null),l=new Ge;return I(({camera:e})=>{if(!t||!c.current)return;let a=s.current.rotation.clone();c.current.updateMatrix(),c.current.updateWorldMatrix(!1,!1),c.current.getWorldQuaternion(l),e.getWorldQuaternion(s.current.quaternion).premultiply(l.invert()),n&&(s.current.rotation.x=a.x),r&&(s.current.rotation.y=a.y),i&&(s.current.rotation.z=a.z)}),K.useImperativeHandle(o,()=>c.current,[]),K.createElement(`group`,qt({ref:c},a),K.createElement(`group`,{ref:s},e))}),q=t(),Yt=`#a9d4ff`,Xt={desk:.42,floor:.3},Zt=.2,Qt=Ft(Pt.t),$t=null;function en(){if($t)return $t;let e=document.createElement(`canvas`);e.width=e.height=128;let t=e.getContext(`2d`),n=t.createRadialGradient(64,42,0,64,52,64);return n.addColorStop(0,`rgba(255,255,255,1)`),n.addColorStop(.35,`rgba(255,255,255,0.55)`),n.addColorStop(.7,`rgba(255,255,255,0.15)`),n.addColorStop(1,`rgba(255,255,255,0)`),t.fillStyle=n,t.fillRect(0,0,128,128),$t=new Ze(e),$t.colorSpace=F,$t}var tn=new Map;function nn(e,t){let n=`${e}|${t}`,r=tn.get(n);return r||(r={material:new Ye({map:en(),color:Dt(Yt,e,.3),transparent:!0,opacity:0,blending:2,depthWrite:!1,toneMapped:!1,fog:!1,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}),strength:t},tn.set(n,r),rn(r)),r.material}function rn(e){e.material.opacity=e.strength*Qt,e.material.visible=Qt>.02}function an(){let e=(0,K.useRef)(-1);return Nt(()=>{if(Pt.t!==e.current){e.current=Pt.t,Qt=Ft(Pt.t);for(let e of tn.values())rn(e)}}),null}var on=()=>tt(e=>et(nt(e),`medium`)),sn=()=>null,cn=new Je(1,1).rotateX(-Math.PI/2);function ln({color:e}){return on()?(0,q.jsx)(`mesh`,{geometry:cn,material:nn(e,Xt.desk),position:[0,.772,-.04],scale:[1.75,1,.86],raycast:sn}):null}function un({color:e,height:t}){return on()?(0,q.jsx)(`mesh`,{geometry:cn,material:nn(e,Xt.floor),position:[0,-t+.012,1.7],scale:[4.8,1,3.4],raycast:sn}):null}var dn=`
|
|
2
|
+
varying float vLit;
|
|
3
|
+
void main() {
|
|
4
|
+
// lit from the screen in front (the face looks down -z), a little from above
|
|
5
|
+
vLit = max(dot(normalize(normal), normalize(vec3(0.0, 0.25, -1.0))), 0.0);
|
|
6
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7
|
+
}`,fn=`
|
|
8
|
+
uniform vec3 uColor;
|
|
9
|
+
uniform float uStrength;
|
|
10
|
+
varying float vLit;
|
|
11
|
+
void main() {
|
|
12
|
+
gl_FragColor = vec4(uColor * (vLit * vLit * uStrength), 1.0);
|
|
13
|
+
}`;function pn(e){return on()?(0,q.jsx)(mn,{...e}):null}function mn({id:e,geometry:t}){let n=(0,K.useRef)(null),r=(0,K.useMemo)(()=>new He({vertexShader:dn,fragmentShader:fn,uniforms:{uColor:{value:new ze(Yt).convertLinearToSRGB()},uStrength:{value:0}},transparent:!0,blending:2,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-2}),[]);return(0,K.useEffect)(()=>()=>r.dispose(),[r]),I(()=>{let t=n.current;if(!t)return;let i=ge(e)?.sit??0,a=Zt*Qt*i;r.uniforms.uStrength.value=a,t.visible=a>.01}),(0,q.jsx)(`mesh`,{ref:n,geometry:t,material:r,visible:!1,raycast:sn})}var hn={w:1,h:.1875},gn={seated:1.74,standing:2.2},_n={from:2,clear:2.6};function vn(e,t){let n=gn.seated*e+gn.standing*(1-e);return t&&n+hn.h/2>_n.from?_n.clear:n}var yn={billboard:!0},bn={facesCamera:!0},xn={firstPerson:!0},Sn={leanBack:4.5,spin:2.6,phone:5,sip:3.4,stretch:4.2,doze:1/0,neckRoll:2.8,shoulders:2.6,scratch:2,facepalm:1.9,fistPump:1.7,wave:2.1},Cn=[`leanBack`,`spin`,`phone`,`sip`,`stretch`],wn={min:5,max:14},Tn={min:80,max:130},En={min:25,max:55},Dn=10,On=.35,kn=.45;function An(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return t>>>0}function jn(e){e.rng=e.rng+1831565813|0;let t=e.rng;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}var Mn=(e,t)=>t.min+(t.max-t.min)*jn(e);function Nn(e,t,n=!0){let r={fidget:null,since:0,until:0,next:0,last:null,mood:`busy`,moodSince:t,sessionSince:t,dozeAfter:0,lastScratch:-1/0,rng:An(e),hasMug:n};return r.next=t+2+jn(r)*wn.max,r.dozeAfter=Mn(r,Tn),r}function Pn(e,t,n){e.fidget=t,e.since=n,e.until=n+Sn[t]*(t===`doze`?1:.9+jn(e)*.2)}function Fn(e,t,n){e.fidget=null,e.next=t+Mn(e,n)}var In=e=>Cn.includes(e)||e===`doze`,Ln=e=>e===`working`||e===`thinking`||e===`browsing`,Rn=e=>e===`facepalm`||e===`fistPump`||e===`wave`;function zn(e,t,n){Pn(e,t,n),t!==`doze`&&(e.moodSince=n)}function Bn(e,t){e.fidget===`doze`&&Fn(e,t,wn),e.moodSince=t}function Vn(e,t,n){if(t!==e.mood){Ln(t)&&!Ln(e.mood)&&(e.sessionSince=n,e.next=n+Mn(e,En)),t===`idle`&&(e.next=n+Mn(e,wn)*.5),e.mood=t,e.moodSince=n;let r=e.fidget;r&&!Rn(r)&&(t===`idle`?!In(r):t===`busy`||In(r))&&Fn(e,n,wn)}if(e.fidget){if(n<e.until)return e;let t=Rn(e.fidget);Fn(e,n,e.mood===`idle`?wn:En),t&&(e.next=Math.max(e.next,n+wn.min))}if(t===`idle`){if(n-e.moodSince>=e.dozeAfter)Pn(e,`doze`,n);else if(n>=e.next){let t=Cn[Math.floor(jn(e)*Cn.length)];(t===e.last||t===`sip`&&!e.hasMug)&&(t=Cn[(Cn.indexOf(t)+1+Math.floor(jn(e)*2))%Cn.length]),t===`sip`&&!e.hasMug&&(t=`leanBack`),e.last=t,Pn(e,t,n)}}else t===`thinking`?n-e.moodSince>=5&&n-e.lastScratch>=Dn&&(e.lastScratch=n,Pn(e,`scratch`,n)):t===`working`&&n>=e.next&&n-e.sessionSince>=60&&Pn(e,jn(e)<.5?`neckRoll`:`shoulders`,n);return e}function Hn(e,t){return e.fidget?e.until===1/0?t-e.since:Math.min(1,Math.max(0,(t-e.since)/(e.until-e.since))):0}function Un(e,t){if(!e.fidget)return 0;let n=Math.min(1,(t-e.since)/On),r=e.until===1/0?1:Math.min(1,(e.until-t)/kn),i=Math.max(0,Math.min(n,r));return i*i*(3-2*i)}var Wn=`#f6bd60`,Gn=`#d08c45`,Kn=`#c1121f`;function qn({r:e=.13}){return(0,q.jsxs)(`group`,{children:[(0,q.jsx)(`mesh`,{castShadow:!0,material:G(Wn),children:(0,q.jsx)(`cylinderGeometry`,{args:[e,e,.014,6,1,!1,-Math.PI/8,Math.PI/4]})}),(0,q.jsx)(U,{size:[e*.78,.022,.03],position:[0,.002,e*.9],color:Gn,shadow:!1}),(0,q.jsx)(H,{r:.016,position:[.01,.01,e*.68],scale:[1,.35,1],color:Kn,shadow:!1}),(0,q.jsx)(H,{r:.013,position:[-.008,.01,e*.42],scale:[1,.35,1],color:Kn,shadow:!1})]})}function Jn({kind:e}){switch(e){case`lunchbox`:return(0,q.jsxs)(`group`,{children:[(0,q.jsx)(U,{size:[.17,.08,.12],color:`#4cc9f0`,outline:!0,shadow:!1}),(0,q.jsx)(U,{size:[.175,.025,.125],position:[0,.045,0],color:`#ffd166`,shadow:!1})]});case`sandwich`:return(0,q.jsxs)(`group`,{rotation:[.3,0,0],children:[(0,q.jsx)(U,{size:[.13,.03,.11],position:[0,-.025,0],color:`#f4d58d`,outline:!0,shadow:!1}),(0,q.jsx)(U,{size:[.14,.012,.12],position:[0,-.004,0],color:`#80ed99`,shadow:!1}),(0,q.jsx)(U,{size:[.12,.012,.1],position:[0,.008,0],color:`#e63946`,shadow:!1}),(0,q.jsx)(U,{size:[.13,.03,.11],position:[0,.03,0],color:`#f4d58d`,outline:!0,shadow:!1})]});case`noodles`:return(0,q.jsxs)(`group`,{children:[(0,q.jsx)(z,{r:.045,rTop:.06,h:.12,color:`#f8f9fa`,outline:!0,shadow:!1}),(0,q.jsx)(z,{r:.046,rTop:.052,h:.03,position:[0,-.01,0],color:`#e63946`,shadow:!1}),(0,q.jsx)(z,{r:.006,h:.2,position:[.015,.1,0],rotation:[0,0,.18],color:`#e9c46a`,shadow:!1}),(0,q.jsx)(z,{r:.006,h:.2,position:[-.012,.1,.01],rotation:[.1,0,.1],color:`#e9c46a`,shadow:!1})]});case`pizza`:return(0,q.jsx)(`group`,{position:[0,0,-.13],children:(0,q.jsx)(qn,{})})}}var Yn=`#d4a373`,Xn=`#b5835a`;function Zn({w:e=.42}){return(0,q.jsxs)(`group`,{children:[(0,q.jsx)(U,{size:[e,.05,e],position:[0,.025,0],color:Yn,outline:!0}),(0,q.jsx)(U,{size:[e*.45,.004,e*.3],position:[0,.052,0],color:`#e63946`,shadow:!1})]})}var Qn=(0,q.jsx)(`group`,{position:[0,.16,-.46],children:[0,1,2].map(e=>(0,q.jsx)(`group`,{position:[0,e*.052,0],children:(0,q.jsx)(Zn,{w:.4})},e))});function $n({slices:e}){let t=.42;return(0,q.jsxs)(`group`,{children:[(0,q.jsx)(U,{size:[t,.03,t],position:[0,.015,0],color:Yn,outline:!0}),(0,q.jsx)(U,{size:[t,t,.02],position:[0,t/2,-.42/2],rotation:[-.25,0,0],color:Xn,outline:!0}),Array.from({length:Math.max(0,Math.min(8,e))},(e,t)=>(0,q.jsx)(`group`,{position:[0,.038,0],rotation:[0,t*Math.PI/4,0],children:(0,q.jsx)(qn,{r:.17})},t))]})}var er={protein:.12,cheese:.12,chocolate:.12,pizza:.13},tr={overclock:.125,sparkling:.13,coldbrew:.17,mate:.19},nr={overclock:{body:`#22223b`,band:`#39ff14`,top:`#ced4da`},sparkling:{body:`#caf0f8`,band:`#ff8fab`,top:`#ced4da`},coldbrew:{body:`#3d2817`,band:`#d4a373`,top:`#1f1d2b`},mate:{body:`#74c69d`,band:`#2d6a4f`,top:`#f9c74f`}};function rr({snack:e,left:t}){let n=pt[e],r=t===void 0?1:Math.max(.25,t/n.portions);switch(e){case`overclock`:case`sparkling`:{let t=nr[e],n=tr[e],r=e===`sparkling`?.029:.033;return(0,q.jsxs)(`group`,{children:[(0,q.jsx)(z,{r,h:n,color:t.body,shadow:!1,seg:14}),(0,q.jsx)(z,{r:r+.001,h:n*.3,position:[0,.005,0],color:t.band,shadow:!1,seg:14}),(0,q.jsx)(z,{r:r*.8,rTop:r*.75,h:.012,position:[0,n/2+.005,0],color:t.top,shadow:!1,seg:14})]})}case`coldbrew`:case`mate`:{let t=nr[e],n=tr[e],r=n*.66,i=n-r;return(0,q.jsxs)(`group`,{position:[0,-n/2,0],children:[(0,q.jsx)(z,{r:.034,h:r,position:[0,r/2,0],color:t.body,shadow:!1,seg:14}),(0,q.jsx)(z,{r:.035,h:r*.45,position:[0,r*.48,0],color:t.band,shadow:!1,seg:14}),(0,q.jsx)(z,{r:.016,rTop:.016,h:i*.8,position:[0,r+i*.4,0],color:t.body,shadow:!1,seg:10}),(0,q.jsx)(z,{r:.032,rTop:.017,h:.03,position:[0,r+.012,0],color:t.body,shadow:!1,seg:14}),(0,q.jsx)(z,{r:.018,h:.018,position:[0,n-.005,0],color:t.top,shadow:!1,seg:10})]})}case`pizza`:{let e=er.pizza;return(0,q.jsx)(`group`,{position:[0,0,-e/2],children:(0,q.jsx)(`group`,{position:[0,0,e*(1-r)],scale:[1,1,r],children:(0,q.jsx)(qn,{r:e})})})}case`protein`:{let e=er.protein*r;return(0,q.jsxs)(`group`,{position:[0,0,(er.protein-e)/2],children:[(0,q.jsx)(U,{size:[.036,.016,e],color:`#ff6b35`,shadow:!1}),(0,q.jsx)(U,{size:[.037,.017,Math.min(e,.035)],position:[0,0,e/2-Math.min(e,.035)/2-.004],color:`#1d3557`,shadow:!1}),r<1&&(0,q.jsx)(U,{size:[.03,.012,.004],position:[0,0,-e/2],color:`#a47148`,shadow:!1})]})}case`cheese`:{let e=er.cheese*r;return(0,q.jsxs)(`group`,{position:[0,0,(er.cheese-e)/2],children:[(0,q.jsx)(z,{r:.011,h:e,rotation:[Math.PI/2,0,0],color:`#fff1c1`,shadow:!1,seg:10}),(0,q.jsx)(z,{r:.013,h:.03,position:[0,0,e/2-.015],rotation:[Math.PI/2,0,0],color:`#ffd166`,shadow:!1,seg:10}),r<1&&(0,q.jsx)(H,{r:.011,position:[0,0,-e/2],scale:[1,1,.4],color:`#fff1c1`,shadow:!1})]})}case`chocolate`:{let e=er.chocolate*r,t=r<1?Math.min(e-.02,.035):0;return(0,q.jsxs)(`group`,{position:[0,0,(er.chocolate-e)/2],children:[(0,q.jsx)(U,{size:[.05,.012,e-t],position:[0,0,t/2],color:`#9d0208`,shadow:!1}),(0,q.jsx)(U,{size:[.051,.013,.02],position:[0,0,e/2-.03],color:`#ffba08`,shadow:!1}),t>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(U,{size:[.046,.01,t],position:[0,0,-e/2+t/2],color:`#5e3023`,shadow:!1}),(0,q.jsx)(U,{size:[.047,.012,.003],position:[0,0,-e/2+t+.001],color:`#ced4da`,shadow:!1})]})]})}}}function ir(){return(0,q.jsxs)(`group`,{children:[(0,q.jsx)(U,{size:[.2,.08,.15],position:[0,.04,0],color:`#d8f3dc`,shadow:!1}),(0,q.jsx)(U,{size:[.17,.05,.12],position:[0,.035,0],color:`#e9c46a`,shadow:!1}),(0,q.jsx)(U,{size:[.21,.02,.16],position:[0,.09,0],color:`#4361ee`,shadow:!1}),(0,q.jsx)(U,{size:[.004,.035,.11],position:[-.101,.045,0],color:`#fefae0`,shadow:!1}),(0,q.jsx)(U,{size:[.005,.004,.08],position:[-.102,.052,-.005],color:`#e63946`,shadow:!1}),(0,q.jsx)(U,{size:[.005,.004,.06],position:[-.102,.04,.008],color:`#1f1d2b`,shadow:!1})]})}function ar(e,t){let n=[];for(let r in t){let i=e[r];i&&i.status!==`error`&&t[r].status===`error`&&n.push(r)}return n}function or(e,t){let n=[];for(let r in t){let i=t[r];i.status===`passed`&&e[r]?.status!==`passed`&&i.devAgentId&&n.push(i.devAgentId)}return n}function sr(e,t){let n=[];for(let r of t){let t=e.find(e=>e.id===r.id);if(t)for(let e of r.pulls)e.state===`MERGED`&&t.pulls.some(t=>t.number===e.number&&t.state===`OPEN`)&&n.push({repoId:r.id,number:e.number,headRefName:e.headRefName})}return n}function cr(e,t,n){return t||(n.find(t=>t.repoId===e.repoId&&(t.prNumber===e.number||t.branch!=null&&t.branch===e.headRefName))?.id??null)}function lr(e,t,n=4){let r=t.get(e);if(!r)return[];let i=[];for(let[n,a]of t){if(n===e)continue;let t=Math.hypot(a.seatX-r.seatX,a.seatZ-r.seatZ);t<=7.6&&i.push({id:n,d:t})}return i.sort((e,t)=>e.d-t.d).slice(0,n).map(e=>e.id)}var ur=3e3,dr=new Map,fr=new Map,pr=[],mr=new Map,hr=new Map,gr=e=>hr.get(e)??-1/0;function _r(e,t=Date.now()){let n=dr.get(e);if(n)return dr.delete(e),t-n.at<ur?n:void 0}function vr(e,t,n=0,r=0){let i=Date.now();dr.set(e,{fidget:t,x:n,z:r,at:i}),pr.push({id:e,fidget:t,at:i}),pr.length>30&&pr.shift()}function yr(e,t){return fr.set(e,t),()=>{fr.get(e)===t&&fr.delete(e)}}E.subscribe((e,t)=>{if(t.loaded){if(e.qa!==t.qa){for(let t in e.qa){let n=e.qa[t].devAgentId;n&&mr.set(t,n)}for(let n of or(t.qa,e.qa))vr(n,`fistPump`)}if(e.agents!==t.agents)for(let n of ar(t.agents,e.agents))vr(n,`facepalm`);if(e.repos!==t.repos){let n=sr(t.repos,e.repos);if(!n.length)return;let r=[...Object.values(t.agents),...Object.values(e.agents)],i=me();for(let e of n){let t=cr(e,mr.get(`${e.repoId}#${e.number}`),r);t&&hr.set(t,Date.now());let n=t?i.get(t):void 0;if(t&&n)for(let e of lr(t,i))vr(e,`wave`,n.seatX,n.seatZ)}}}}),typeof window<`u`&&(window.__swarmDeskLife={play(e,t,n){let r=n?me().get(n):void 0;vr(e,t,r?.seatX??0,r?.seatZ??0)},list(){return[...fr].map(([e,t])=>({id:e,mood:t.mood,fidget:t.fidget}))},recent:()=>[...pr]});var br={gapMs:2e3,ms:1500},xr={ball:2.5,dart:3};function Sr(e,t){let n=e&&typeof e==`object`?e.toy:void 0;return n===`dart`?`dart`:typeof n==`string`&&t.includes(n)?`ball`:null}function Cr(e,t,n){return e!==null&&!n&&t>=xr[e]}var wr=(e,t,n=br.gapMs)=>e===void 0||t-e>=n,Tr=e=>e*e*(3-2*e);function Er(e){return!(e>=0)||e>=br.ms?0:e<120?Tr(e/120):e<850?1:1-Tr((e-850)/(br.ms-850))}function Dr(e){return!(e>=0)||e>=400?0:e<70?Tr(e/70):1-Tr((e-70)/330)}var Or=(e,t,n)=>Math.min(n,Math.max(t,e));function kr(e,t,n=1.1,r=.5){if(e===0&&t===0)return{head:0,twist:0};let i=Math.atan2(-e,-t),a=Or(i,-n,n);return{head:a,twist:Or(i-a,-r,r)}}var Ar=[],jr=1,Mr=new Set,Nr=new Map,Pr=new Map,Fr=0;function Ir(e,t){let n={id:e,obj:t,key:jr++};Ar=[...Ar,n];for(let e of Mr)e();return()=>{Ar=Ar.filter(e=>e!==n);for(let e of Mr)e()}}var Lr=()=>Ar;function Rr(e){return Mr.add(e),()=>void Mr.delete(e)}function zr(e,t){let n=Nr.get(e);return n||Nr.set(e,n=new Set),n.add(t),()=>{n.delete(t),n.size||Nr.delete(e)}}function Br(e,t=performance.now()){if(!wr(Pr.get(e),t))return!1;Pr.set(e,t),Fr++;for(let t of Nr.get(e)??[])t();return!0}var Vr=()=>Fr,Hr=1.16,Ur=`#1f1d2b`;function Wr(e,t,n,r){let i=n-8-34;e.lineWidth=8,e.lineJoin=`round`,e.strokeStyle=Ur,e.fillStyle=`#ffffff`,e.beginPath(),e.roundRect(8,8,t-16,i-8,40),e.fill(),e.stroke(),e.beginPath(),e.moveTo(62,i-6),e.lineTo(28,n-8),e.lineTo(104,i-6),e.fill(),e.beginPath(),e.moveTo(62,i),e.lineTo(28,n-8),e.lineTo(104,i),e.stroke(),e.fillStyle=`#e63946`,e.font=`700 ${r.length>2?84:100}px ${D}`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(r,t/2,(8+i)/2+4)}function Gr({text:e,since:t}){let n=(0,K.useRef)(null),r=kt(256,176,t=>Wr(t,256,176,e),[e]);return I(()=>{if(!n.current)return;let e=performance.now()-t,r=br.ms-e,i=e<90?.3+e/90*.9:e<170?1.2-(e-90)/80*.2:r<150?Math.max(.01,r/150):1;n.current.scale.setScalar(i)}),(0,q.jsx)(Jt,{position:[.18,1.45,0],userData:yn,children:(0,q.jsx)(`group`,{ref:n,scale:.3,children:(0,q.jsxs)(`mesh`,{position:[.195,.156,0],renderOrder:2,children:[(0,q.jsx)(`planeGeometry`,{args:[.5,.344]}),(0,q.jsx)(`meshBasicMaterial`,{map:r,transparent:!0,toneMapped:!1,depthWrite:!1})]})})})}function Kr(e,t){let n=We(e=>e.camera),r=(0,K.useRef)(-1/0),[i,a]=(0,K.useState)(null),o=(0,K.useMemo)(()=>({w:0,flinch:0,headYaw:0,headPitch:0,twist:0}),[]),s=(0,K.useMemo)(()=>new P,[]);return(0,K.useEffect)(()=>{let n=t.current;return n?Ir(e,n):void 0},[e,t]),(0,K.useEffect)(()=>zr(e,()=>{let e=performance.now();r.current=e;let n=t.current?.getWorldPosition(new P);_(n&&{x:n.x,y:n.y+Hr,z:n.z}),a({text:Math.random()<.65?`hey!`:`!`,since:e})}),[e,t]),(0,K.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>a(null),br.ms);return()=>clearTimeout(e)},[i]),{pose:e=>{let i=e-r.current;o.w=Er(i),o.flinch=Dr(i);let a=t.current;if(o.w===0||!a)return o.w=o.flinch=o.headYaw=o.headPitch=o.twist=0,o;a.worldToLocal(s.copy(n.position));let c=kr(s.x,s.z);return o.headYaw=c.head,o.twist=c.twist,o.headPitch=Math.min(.45,Math.max(-.3,Math.atan2(s.y-Hr,Math.hypot(s.x,s.z)))),o},bubble:i&&(0,q.jsx)(Gr,{text:i.text,since:i.since},i.since)}}var qr=512,Jr=176,Yr=8,Xr=28,Zr=`#1f1d2b`,Qr=40,$r=_n.clear-hn.h/2,ei=.327875,ti=4.5,ni=new P,ri=null,ii=new Map,ai=e=>!/[\p{L}\p{N}]/u.test(e)&&[...e].length<=3;function oi(e,t){if(e.font=`600 60px ${D}`,e.measureText(t).width<=560)return{lines:[t],size:60};let n=t.split(/\s+/).join(` `);for(let r of[48,42]){e.font=`600 ${r}px ${D}`;let i=e.measureText(t).width/2;for(let a=Math.max(160,i+24);a<=600;a+=24){let i=be(e,t,a,2);if(i.join(` `)===n)return{lines:i,size:r}}}return{lines:be(e,t,600,2),size:42}}function si(e){ri??=document.createElement(`canvas`).getContext(`2d`);let t=ri,{lines:n,size:r}=oi(t,e);t.font=`600 ${r}px ${D}`;let i=Math.max(...n.map(e=>t.measureText(e).width)),a=Math.ceil(Math.max(200,i+16+56)/8)*8,o=document.createElement(`canvas`);o.width=a,o.height=Jr;let s=o.getContext(`2d`);s.lineWidth=8,s.lineJoin=`round`,s.strokeStyle=Zr,s.fillStyle=`#ffffff`,s.beginPath(),s.roundRect(Yr,Yr,a-16,126,40),s.fill(),s.stroke(),s.beginPath(),s.moveTo(62,128),s.lineTo(Xr,168),s.lineTo(104,128),s.fill(),s.beginPath(),s.moveTo(62,134),s.lineTo(Xr,168),s.lineTo(104,134),s.stroke(),s.fillStyle=Zr,s.font=`600 ${r}px ${D}`,s.textAlign=`center`,s.textBaseline=`middle`;let c=r*1.08;return n.forEach((e,t)=>s.fillText(e,a/2,74+(t-(n.length-1)/2)*c)),o}function ci(e){let t=ii.get(e);if(t)return ii.delete(e),ii.set(e,t),t;let n;ai(e)?(n=document.createElement(`canvas`),n.width=256,n.height=Jr,Wr(n.getContext(`2d`),256,Jr,e)):n=si(e);let r=new Ze(n);if(r.colorSpace=F,r.anisotropy=4,t={tex:r,w:n.width/qr},ii.set(e,t),ii.size>Qr){let[e,t]=ii.entries().next().value;ii.delete(e),t.tex.dispose()}return t}function li({id:e,y:t}){let n=We(e=>e.camera),r=(0,K.useRef)(null),i=(0,K.useRef)(null),a=(0,K.useRef)(null);return I(()=>{let t=ve(e),o=r.current;if(!o||!a.current||!i.current||(o.visible=!!t,!t))return;let s=ci(t.text);a.current.map!==s.tex&&(a.current.map=s.tex,a.current.needsUpdate=!0,i.current.scale.set(s.w,Jr/qr,1),i.current.position.set(s.w/2-Xr/qr,.156,0));let c=performance.now(),l=c-t.at,u=t.until===void 0?1/0:t.until-c,d=l<90?.3+l/90*.9:l<170?1.2-(l-90)/80*.2:u<150?Math.max(.01,u/150):1;o.getWorldPosition(ni);let f=Math.min(Math.max(1,($r-ni.y)/ei),Math.max(1,ni.distanceTo(n.position)/ti));o.scale.setScalar(d*f)}),(0,q.jsx)(Jt,{position:[.2,t,0],userData:yn,children:(0,q.jsx)(`group`,{ref:r,visible:!1,children:(0,q.jsxs)(`mesh`,{ref:i,position:[.195,.156,0],scale:[.5,Jr/qr,1],renderOrder:2,children:[(0,q.jsx)(`planeGeometry`,{args:[1,1]}),(0,q.jsx)(`meshBasicMaterial`,{ref:a,transparent:!0,toneMapped:!1,depthWrite:!1})]})})})}function ui(e){let t=Mt(e=>e.costume);return t?(0,q.jsx)(t,{...e}):null}var di=`#1f1d2b`,J=Me,fi=.03,pi=`#f8f9fa`;function mi({handle:e=!0}){return(0,q.jsxs)(`group`,{children:[(0,q.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],position:[0,0,-.004],material:G(`#e63946`),castShadow:!0,children:[(0,q.jsx)(`cylinderGeometry`,{args:[.078,.078,.008,24]}),(0,q.jsx)(bt,{thickness:.006,color:di})]}),(0,q.jsx)(`mesh`,{rotation:[Math.PI/2,0,0],position:[0,0,.004],material:G(`#22223b`),children:(0,q.jsx)(`cylinderGeometry`,{args:[.078,.078,.008,24]})}),e&&(0,q.jsx)(`mesh`,{position:[0,-.115,0],material:G(`#d4a373`),children:(0,q.jsx)(`boxGeometry`,{args:[.026,.085,.022]})})]})}var hi=null;function gi(){if(hi)return hi;let e=document.createElement(`canvas`);e.width=256,e.height=32;let t=e.getContext(`2d`);t.strokeStyle=`rgba(30,30,40,0.85)`,t.lineWidth=1.2;for(let e=0;e<=256;e+=6)t.beginPath(),t.moveTo(e,0),t.lineTo(e,32),t.stroke();for(let e=4;e<=32;e+=6)t.beginPath(),t.moveTo(0,e),t.lineTo(256,e),t.stroke();t.fillStyle=`#f8f9fa`,t.fillRect(0,0,256,5);let n=new Ze(e);return n.colorSpace=F,hi=new Ye({map:n,transparent:!0,side:2,depthWrite:!1}),hi}var _i=(0,K.memo)(function(){let e={x:J.len/2,z:J.wid/2},t=.02,n=R.net,r=J.wid+n.overhang*2;return(0,q.jsxs)(`group`,{position:[J.x,0,J.z],children:[(0,q.jsxs)(`mesh`,{position:[0,J.top-fi/2,0],material:G(`#1d4e89`),castShadow:!0,receiveShadow:!0,children:[(0,q.jsx)(`boxGeometry`,{args:[J.len,fi,J.wid]}),(0,q.jsx)(bt,{thickness:.012,color:di})]}),[[0,e.z-t/2,J.len,t],[0,-e.z+t/2,J.len,t],[e.x-t/2,0,t,J.wid],[-e.x+t/2,0,t,J.wid],[0,0,J.len,.006]].map(([e,t,n,r],i)=>(0,q.jsx)(`mesh`,{position:[e,J.top+.001,t],material:G(pi),children:(0,q.jsx)(`boxGeometry`,{args:[n,.002,r]})},i)),(0,q.jsx)(U,{size:[J.len-.3,.08,J.wid-.3],position:[0,J.top-fi-.04,0],color:`#495057`,shadow:!1}),[-1,1].flatMap(t=>[-1,1].map(n=>(0,q.jsx)(U,{size:[.05,J.top-fi,.05],position:[t*(e.x-.25),(J.top-fi)/2,n*(e.z-.2)],color:`#343a40`},`${t}${n}`))),(0,q.jsx)(`mesh`,{position:[0,J.top+n.h/2,0],rotation:[0,Math.PI/2,0],material:gi(),children:(0,q.jsx)(`planeGeometry`,{args:[r,n.h]})}),[-1,1].map(t=>(0,q.jsxs)(`group`,{children:[(0,q.jsx)(U,{size:[.03,n.h+.02,.03],position:[0,J.top+n.h/2,t*(e.z+n.overhang)],color:`#212529`}),(0,q.jsx)(U,{size:[.05,.03,.08],position:[0,J.top-.005,t*(e.z+.02)],color:`#212529`})]},t)),(0,q.jsxs)(`group`,{position:[.25,J.top-.03,-e.z-.05],children:[(0,q.jsx)(z,{r:.045,rTop:.05,h:.09,color:`#adb5bd`,outline:!0}),[[-.015,.05,.01],[.017,.055,-.008],[0,.075,.004]].map(([e,t,n],r)=>(0,q.jsx)(`mesh`,{position:[e,t,n],material:G(`#ff9f1c`),children:(0,q.jsx)(`sphereGeometry`,{args:[R.ball.r,12,10]})},r))]})]})});function vi(){return(0,K.useSyncExternalStore)(B,mt),[`west`,`east`].map(e=>ut(e)?null:(0,q.jsx)(`group`,{position:[J.x+(e===`west`?-1:1)*(J.len/2-.42),J.top-.16,J.z+J.wid/2+.025],rotation:[.08,Math.PI,0],children:(0,q.jsx)(mi,{})},e))}function yi(e,t,n){return e?e===`player`?n:t[e]??`?`:``}function bi(e,t,n,r,i,a,o){if(xe(e,0,0,t,n,26),e.fillStyle=`#15151f`,e.fill(),e.textAlign=`center`,e.textBaseline=`middle`,!r||r.phase===`waiting`){let i=r&&(r.west||r.east);e.fillStyle=`#ffd166`,e.font=`700 52px ${D}`,e.fillText(`π`,t/2,n*.33),e.font=`700 34px ${D}`,e.fillStyle=`#f8f9fa`,e.fillText(i?`Waiting for a playerβ¦`:`Fancy a game? E at an end`,t/2,n*.7);return}let s=i===`west`?`east`:`west`;for(let[c,l]of[[i,t*.27],[s,t*.73]]){let i=yi(r[c],a,o);for(e.font=`600 30px ${D}`;i.length>3&&e.measureText(i).width>t*.42;)i=i.slice(0,-2);e.fillStyle=`#ced4da`,e.fillText(i,l,n*.2),e.fillStyle=r.phase===`over`&&r.last?.winner===c?`#06d6a0`:`#ffd166`,e.font=`800 104px ${D}`,e.fillText(String(r.score[c]),l,n*.6),r.server===c&&r.phase!==`over`&&(e.fillStyle=`#ff9f1c`,e.beginPath(),e.arc(l,n*.9,9,0,Math.PI*2),e.fill())}e.fillStyle=`#6c757d`,e.font=`800 70px ${D}`,e.fillText(`:`,t/2,n*.58)}function xi(){let e=(0,K.useSyncExternalStore)(B,mt),t=E(e=>e.agents),n=E(e=>e.settings.managerName.trim().split(/\s+/)[0]||`You`),r={};for(let e of Object.values(t))r[e.id]=e.name;let i=[e?.phase,e?.west,e?.east,e?.score.west,e?.score.east,e?.server,e?.last?.winner,n,e?.west&&r[e.west],e?.east&&r[e.east]],a=kt(512,300,t=>bi(t,512,300,e,`west`,r,n),i),o=kt(512,300,t=>bi(t,512,300,e,`east`,r,n),i),s=.56,c=.33;return(0,q.jsxs)(`group`,{position:[J.x,J.top+.42,J.z-J.wid/2-.1],children:[(0,q.jsx)(U,{size:[.03,J.top+.42,.03],position:[0,-(J.top+.42)/2,0],color:`#212529`,shadow:!1}),(0,q.jsx)(U,{size:[.24,.02,.18],position:[0,-(J.top+.42)+.01,0],color:`#212529`,shadow:!1}),(0,q.jsxs)(`mesh`,{material:G(`#2b2d42`),children:[(0,q.jsx)(`boxGeometry`,{args:[.6000000000000001,.37,.03]}),(0,q.jsx)(bt,{thickness:.01,color:di})]}),(0,q.jsxs)(`mesh`,{position:[0,0,.016],children:[(0,q.jsx)(`planeGeometry`,{args:[s,c]}),(0,q.jsx)(`meshBasicMaterial`,{map:a,toneMapped:!1})]}),(0,q.jsxs)(`mesh`,{position:[0,0,-.016],rotation:[0,Math.PI,0],children:[(0,q.jsx)(`planeGeometry`,{args:[s,c]}),(0,q.jsx)(`meshBasicMaterial`,{map:o,toneMapped:!1})]})]})}var Si=7;function Ci(e,t,n,r,i){if(xe(e,0,0,t,n,30),e.fillStyle=`#1b4332`,e.fill(),e.lineWidth=10,e.strokeStyle=`#d4a373`,xe(e,5,5,t-10,n-10,26),e.stroke(),e.textBaseline=`middle`,e.textAlign=`center`,e.fillStyle=`#ffd166`,e.font=`800 54px ${D}`,e.fillText(`π PING-PONG LADDER`,t/2,62),e.font=`600 26px ${D}`,e.fillStyle=`rgba(255,255,255,0.7)`,e.fillText(`games won β lost on this floor`,t/2,108),!r.length){e.font=`600 36px ${D}`,e.fillStyle=`#f8f9fa`,e.fillText(`No games yet.`,t/2,n/2+20),e.fillText(`Pick up a paddle!`,t/2,n/2+70);return}let a=(n-150-24)/Si;r.slice(0,Si).forEach((n,r)=>{let o=150+a*(r+.5),s=n.id===W;s&&(e.fillStyle=`rgba(255,209,102,0.18)`,xe(e,28,o-a/2+4,t-56,a-8,14),e.fill()),e.textAlign=`left`,e.font=`800 40px ${D}`,e.fillStyle=r===0?`#ffd166`:`#f8f9fa`,e.fillText(`${r+1}.`,48,o);let c=s?`${i} (you)`:n.name;for(e.font=`600 40px ${D}`;c.length>3&&e.measureText(c).width>t*.52;)c=c.slice(0,-2);e.fillText(c,118,o),e.textAlign=`right`,e.font=`700 40px ${D}`,e.fillText(`${n.wins}β${n.losses}`,t-48,o)})}function wi({repoId:e}){let t=E(t=>t.pong[e])??Ti,n=E(e=>e.settings.managerName.trim().split(/\s+/)[0]||`You`),r=kt(768,666,e=>Ci(e,768,666,t,n),[t,n]),i=_e;return(0,q.jsxs)(`group`,{position:[i.x,i.y,11.97],rotation:[0,Math.PI,0],children:[(0,q.jsxs)(`mesh`,{material:G(`#7f5539`),children:[(0,q.jsx)(`boxGeometry`,{args:[i.w+.06,i.h+.06,.03]}),(0,q.jsx)(bt,{thickness:.012,color:di})]}),(0,q.jsxs)(`mesh`,{position:[0,0,.017],children:[(0,q.jsx)(`planeGeometry`,{args:[i.w,i.h]}),(0,q.jsx)(`meshBasicMaterial`,{map:r,toneMapped:!1})]})]})}var Ti=[];function Ei({repoId:e}){return(0,q.jsxs)(`group`,{children:[(0,q.jsx)(_i,{}),(0,q.jsx)(vi,{}),(0,q.jsx)(xi,{}),(0,q.jsx)(wi,{repoId:e})]})}var Di=`#1f1d2b`,Oi=new Je(.16,.16),ki=null;function Ai(){if(ki)return ki;let e=document.createElement(`canvas`);e.width=e.height=64;let t=e.getContext(`2d`);t.font=`700 54px ${D}`,t.textAlign=`center`,t.textBaseline=`middle`,t.lineWidth=9,t.lineJoin=`round`,t.strokeStyle=Di,t.fillStyle=`#ffffff`,t.strokeText(`z`,32,30),t.fillText(`z`,32,30);let n=new Ze(e);return n.colorSpace=F,ki=new Ye({map:n,transparent:!0,depthWrite:!1,toneMapped:!1}),ki}function ji({on:e,position:t}){let n=(0,K.useRef)(null),r=We(e=>e.camera),i=(0,K.useMemo)(()=>({parent:new Ge,camera:new Ge}),[]);return I(()=>{let t=n.current;if(!t||(t.visible=e.current,!e.current||!t.parent))return;t.parent.getWorldQuaternion(i.parent),t.quaternion.copy(i.parent.invert().multiply(r.getWorldQuaternion(i.camera)));let a=performance.now()/1e3;for(let e=0;e<t.children.length;e++){let n=t.children[e],r=(a*.4+e/3)%1,i=r<.15?r/.15:r>.75?(1-r)/.25:1;n.position.set(r*.16+Math.sin(r*7+e)*.03,r*.38,0),n.scale.setScalar(Math.max(.001,(.45+r*.75)*i)),n.rotation.z=Math.sin(r*5+e)*.25}}),(0,q.jsx)(`group`,{ref:n,position:t,visible:!1,userData:bn,children:[0,1,2].map(e=>(0,q.jsx)(`mesh`,{geometry:Oi,material:Ai(),renderOrder:2},e))})}var Mi=.1,Ni=.05,Pi=3,Fi={x:0,y:0,z:0},Ii=null;function Li(){let e=Fe(),t=m(`typing`);if(!e||!t)return null;if(Ii?.ctx===e.ctx)return Ii;try{let{ctx:n}=e,r=()=>{let e=M(n,Fi);return e.connect(t),e},i=n.createBuffer(1,n.sampleRate,n.sampleRate),a=i.getChannelData(0);for(let e=0;e<a.length;e++)a[e]=Math.random()*2-1;return Ii={ctx:n,voices:Array.from({length:6},r),crowd:r(),noise:i},Ii}catch{return null}}var Ri=e=>e.positionX?{x:e.positionX.value,y:e.positionY.value,z:e.positionZ.value}:null;function zi(e,t,n,r){let i=ne(n);if(!i||(r.occluded=!0,r.gain*=i.gain,!e||!t))return t;let a=e.ctx.createBiquadFilter();a.type=`lowpass`,a.frequency.value=i.cutoff;let o=e.ctx.createGain();return o.gain.value=i.gain,a.connect(o).connect(t),a}var Bi={woo:{dur:.46,pitch:[.85,1.28,.92],f1:[300,370,340],f2:[640,920,820],breath:0},yay:{dur:.42,pitch:[1.06,1.3,1],f1:[290,620,450],f2:[2250,1850,2150],breath:0},hey:{dur:.34,pitch:[1.18,1.24,.95],f1:[520,580,420],f2:[1800,1900,2150],breath:.06}};function Vi(e,[t,n,r],i,a,o,s){e.setValueAtTime(t*i,a),e.exponentialRampToValueAtTime(n*i,o),e.exponentialRampToValueAtTime(r*i,s)}function Hi(e,t,n,r,i,a,o){let s=e.ctx.createBufferSource();s.buffer=e.noise;let c=e.ctx.createBiquadFilter();c.type=`bandpass`,c.frequency.value=a,c.Q.value=o;let l=e.ctx.createGain();l.gain.setValueAtTime(1e-4,n),l.gain.exponentialRampToValueAtTime(i,n+Math.min(.02,r*.3)),l.gain.exponentialRampToValueAtTime(1e-4,n+r),s.connect(c).connect(l).connect(t),s.start(n,Math.random()*.8),s.stop(n+r+.02)}function Ui(e,t,n,r,i,a,o=1,s=1){let c=Bi[i];c.breath&&Hi(e,t,n,c.breath+.04,a*.45,1500*r.formant,.9);let l=n+c.breath,u=l+c.dur*s,d=l+c.dur*s*.3,f=r.pitch*o*(.96+Math.random()*.08),p=e.ctx.createOscillator();p.type=`sawtooth`,Vi(p.frequency,c.pitch,f,l,d,u);let m=e.ctx.createBiquadFilter();m.type=`bandpass`,m.Q.value=2.5,Vi(m.frequency,c.f1,r.formant,l,d,u);let h=e.ctx.createBiquadFilter();h.type=`bandpass`,h.Q.value=5,Vi(h.frequency,c.f2,r.formant,l,d,u);let g=e.ctx.createGain();g.gain.value=.45+r.bright*.6;let ee=e.ctx.createGain();return ee.gain.setValueAtTime(1e-4,l),ee.gain.exponentialRampToValueAtTime(a*Pi,l+.04),ee.gain.exponentialRampToValueAtTime(a*Pi*.7,u-.1*s),ee.gain.exponentialRampToValueAtTime(1e-4,u),p.connect(m).connect(ee),p.connect(h).connect(g).connect(ee),ee.connect(t),p.start(l),p.stop(u+.05),u}function Wi(e,t,n,r){let i=Ui(e,t,n,r,r.word,Mi);if(r.extra===`woo`)Ui(e,t,i+.08+Math.random()*.1,r,`woo`,Mi*.55,1.12,.8);else if(r.extra===`clap`)for(let n=0;n<3;n++)Hi(e,t,i+.05+n*.14+Math.random()*.03,.045,Mi*.6,1200+Math.random()*400,1.3)}function Gi(e,t,n,r){let{ctx:i}=e,a=i.createGain();a.gain.value=r*Pi,a.connect(t);let o=i.createBiquadFilter();o.type=`bandpass`,o.frequency.value=620,o.Q.value=2.5;let s=i.createBiquadFilter();s.type=`bandpass`,s.frequency.value=1900,s.Q.value=4;let c=i.createGain();c.gain.value=.5,o.connect(a),s.connect(c).connect(a);for(let e=0;e<4;e++){let e=n+dt(Math.random()),t=.5+Math.random()*.25,r=230+Math.random()*190,a=i.createOscillator();a.type=`sawtooth`,Vi(a.frequency,Bi.yay.pitch,r,e,e+t*.3,e+t);let c=i.createGain();c.gain.setValueAtTime(1e-4,e),c.gain.exponentialRampToValueAtTime(.5,e+.08),c.gain.exponentialRampToValueAtTime(1e-4,e+t),a.connect(c),c.connect(o),c.connect(s),a.start(e),a.stop(e+t+.05)}Hi(e,a,n+.1,1.1,.15,2e3,.6)}var Ki=64,qi=Array.from({length:Ki},()=>({voice:null,x:0,y:0,z:0,d:0})),Y=[],Ji=!1,Yi=-1/0;function Xi(e,t,n,r){if(Y.length>=Ki)return;let i=qi[Y.length];i.voice=e,i.x=t,i.y=n,i.z=r,Y.push(i),Ji||(Ji=!0,queueMicrotask(Zi))}function Zi(){Ji=!1;let e=performance.now(),t=E.getState();if(!document.hidden&&t.travel===null&&t.overlay===null&<(Yi,e,Ce.celebrateUntil-6e3)&&Y.length){Yi=e;try{Qi()}catch{}}for(let e of Y)e.voice=null;Y.length=0}function Qi(){let e=c();for(let t of Y)t.d=ye(e,t);let t=gt(Y),n=Li(),r=n?n.ctx.currentTime+vt:0;if(t.voiced.forEach((e,t)=>{let i=Y[e],a={x:i.x,y:i.y,z:i.z},o=n?.voices[t];o&&f(o,a.x,a.y,a.z);let s=oe(`cheer:${i.voice.word}`,{group:`typing`,pos:a,peak:Mi,played:!!o});s.from=o?Ri(o):null;let c=zi(n,o,a,s);n&&c&&Wi(n,c,r+dt(Math.random()),i.voice)}),!t.crowd.length)return;let i={x:0,y:0,z:0};for(let e of t.crowd)i.x+=Y[e].x/t.crowd.length,i.y+=Y[e].y/t.crowd.length,i.z+=Y[e].z/t.crowd.length;let a=Ni*_t(t.crowd.length);n&&f(n.crowd,i.x,i.y,i.z);let o=oe(`cheer:crowd`,{group:`typing`,pos:i,peak:a,played:!!n});o.from=n?Ri(n.crowd):null;let s=zi(n,n?.crowd,i,o);n&&s&&Gi(n,s,r+.05,a)}var $i={pitch:-.34,yaw:.26},ea={typing:{l:$i,r:$i,lean:.1,headPitch:-.02,headYaw:0,type:1,mouse:0},browsing:{l:$i,r:{pitch:-.4,yaw:-.22},lean:.06,headPitch:.05,headYaw:.04,type:.25,mouse:1},thinking:{l:$i,r:{pitch:.55,yaw:.95},lean:.02,headPitch:.1,headYaw:-.12,type:.3,mouse:0},relaxed:{l:{pitch:-.9,yaw:.35},r:{pitch:-.9,yaw:.35},lean:-.1,headPitch:.06,headYaw:0,type:0,mouse:0},cheer:{l:{pitch:1.45,yaw:-.35},r:{pitch:1.45,yaw:-.35},lean:-.05,headPitch:.2,headYaw:0,type:0,mouse:0},slump:{l:{pitch:-1.35,yaw:-.15},r:{pitch:-1.35,yaw:-.15},lean:.25,headPitch:-.45,headYaw:0,type:0,mouse:0}},ta=e=>({...e,l:{...e.l},r:{...e.r}}),na=Ue.lerp,ra={person:!0},ia=It.shell,X={x:.11,seatY:.5,seatZ:-.04,standY:.815,thigh:.32},aa={x:.62,z:-.1},oa=.18,sa=[0,1.98,-1.12],ca={pitch:-1.42,yaw:-.1},la={at:[0,-.02,-.52],ahead:-.07,scale:1.3,sipTilt:1},ua={none:{l:null,r:null,head:0},reach:{l:null,r:{pitch:1.05,yaw:.05},head:.15},post:{l:null,r:{pitch:1.05,yaw:.05},head:.15},hold:{l:{pitch:-.45,yaw:.4},r:{pitch:-.45,yaw:.4},head:-.05},sip:{l:null,r:{pitch:.7,yaw:.85},head:.25},stretch:{l:{pitch:1.55,yaw:.22},r:{pitch:1.55,yaw:.22},head:.3},stoop:{l:{pitch:-1,yaw:.3},r:{pitch:-1,yaw:.3},head:-.5},shoot:{l:{pitch:1.2,yaw:.35},r:{pitch:1.2,yaw:.35},head:.35},toss:{l:{pitch:.35,yaw:.3},r:{pitch:.35,yaw:.3},head:.05},catch:{l:{pitch:-.1,yaw:.1},r:{pitch:-.1,yaw:.1},head:.1},shrug:{l:{pitch:-.7,yaw:-.75},r:{pitch:-.7,yaw:-.75},head:-.12},mug:{l:null,r:{pitch:-.75,yaw:.3},head:-.05},tap:{l:null,r:{pitch:-.3,yaw:.05},head:-.3},chat:{l:{pitch:-.55,yaw:-.45},r:{pitch:-.75,yaw:.3},head:.08},cheer:{l:ea.cheer.l,r:ea.cheer.r,head:ea.cheer.headPitch},wave:{l:null,r:{pitch:1.25,yaw:-.3},head:.1},talk:{l:null,r:{pitch:-.3,yaw:.45},head:.05},take:{l:null,r:{pitch:.75,yaw:-.3},head:.1},windup:{l:{pitch:.2,yaw:.3},r:{pitch:2.1,yaw:.05},head:.1},strike:{l:{pitch:-.6,yaw:.2},r:{pitch:-.25,yaw:.25},head:0},point:{l:null,r:{pitch:.6,yaw:-.12},head:.28},gasp:{l:{pitch:.72,yaw:.95},r:{pitch:.72,yaw:.95},head:.18},clap:{l:{pitch:.05,yaw:.62},r:{pitch:.05,yaw:.62},head:.08},nod:{l:null,r:null,head:-.05},thumbs:{l:null,r:{pitch:.45,yaw:.25},head:.12},call:{l:{pitch:-.75,yaw:.55},r:{pitch:.62,yaw:.8},head:.06},shake:{l:null,r:{pitch:-.12,yaw:.15},head:.08},paddle:{l:{pitch:-.5,yaw:.5},r:{pitch:-.35,yaw:-.25},head:.05}},da={hand:-.5,blade:-.17},fa={l:ea.cheer.l,r:ea.cheer.r,head:ea.cheer.headPitch},pa={pitch:-.12,yaw:-.55},ma={pitch:.55,yaw:.7},ha=(e,t,n)=>Ae(Math.min(1,Math.max(0,(e-t)/(n-t)))),Z=(e,t,n)=>{e.pitch=t,e.yaw=n};function ga(e,t,n,r,i){switch(i.lw=i.rw=i.leanW=i.pitchW=i.yaw=i.roll=i.twist=i.spin=0,e){case`leanBack`:Z(i.l,2.45,.75),Z(i.r,2.45,.75),i.lw=i.rw=i.leanW=i.pitchW=1,i.lean=-.2+Math.sin(n*1.4)*.025,i.pitch=.14;break;case`spin`:i.spin=Math.sin(t*Math.PI*2)*.55,i.yaw=-i.spin*.5;break;case`phone`:Z(i.l,-.3,.6),Z(i.r,-.26+(Math.sin(n*11)>.4?.04:0),.55),i.lw=i.rw=i.pitchW=i.leanW=1,i.pitch=-.42,i.lean=.05;break;case`sip`:{let e=ha(t,.3,.45)-ha(t,.62,.77);Z(i.r,pa.pitch+(ma.pitch-pa.pitch)*e,pa.yaw+(ma.yaw-pa.yaw)*e),i.rw=1,i.twist=-.32*(1-e),i.lean=.16*(1-e),i.leanW=1,i.pitch=.28*e,i.pitchW=e;break}case`doze`:i.pitch=-.6+Math.sin(t*.9)*.05+(Math.sin(t*.37)>.97?.12:0),i.pitchW=1,i.roll=.16,i.lean=.08,i.leanW=1;break;case`neckRoll`:{let e=t*Math.PI*2.4;i.pitch=Math.sin(e)*.24-.05,i.pitchW=1,i.roll=Math.cos(e)*.3;break}case`shoulders`:Z(i.l,.05,1.35),i.lw=1,i.yaw=.3,i.twist=-.12;break;case`scratch`:Z(i.r,1.42+Math.sin(n*17)*.06,.6+Math.sin(n*17+1)*.05),i.rw=1,i.roll=-.14,i.pitch=.04,i.pitchW=1;break;case`facepalm`:Z(i.r,.73,.6),i.rw=1,i.pitch=-.3,i.pitchW=1,i.yaw=Math.sin(n*5)*.12,i.lean=.12,i.leanW=1;break;case`fistPump`:Z(i.r,1.15+Math.max(0,Math.sin(t*Math.PI*6))*.45,-.15),i.rw=1,i.pitch=.18,i.pitchW=1,i.lean=-.06,i.leanW=1;break;case`wave`:Z(r>0?i.l:i.r,1.3,-.3+Math.sin(n*10)*.35),r>0?i.lw=1:i.rw=1,i.yaw=Math.max(-1.1,Math.min(1.1,r*.7)),i.twist=Math.max(-.4,Math.min(.4,r*.3)),i.pitch=.08,i.pitchW=1}return i}function _a({agent:e,chair:t,mug:n,carrying:r,standAt:o=aa,scale:c=1,children:f}){let m=(0,K.useRef)(null),g=(0,K.useRef)(null),ne=(0,K.useRef)(null),_=(0,K.useRef)(null),ae=(0,K.useRef)(ta(ea.relaxed)),oe=(0,K.useMemo)(()=>w(e.id),[e.id]),y=(0,K.useRef)({name:null,at:0}),b=(0,K.useMemo)(()=>Ut(e),[e.id,e.look,e.role,e.style]),de=(0,K.useRef)(null),fe=(0,K.useRef)(null),C=(0,K.useRef)(null),me=(0,K.useRef)(null),ge=(0,K.useRef)(null),_e=(0,K.useRef)(null),ve=(0,K.useRef)(null),ye=(0,K.useRef)(null),be=(0,K.useRef)(null),xe=(0,K.useRef)(null),Ce=(0,K.useRef)(null),we=(0,K.useRef)(null),Ee=(0,K.useRef)(null),D=(0,K.useRef)(null),O=(0,K.useRef)(null),Me=(0,K.useRef)(null),k=(0,K.useSyncExternalStore)(s,()=>ke(e.id)),A=(0,K.useSyncExternalStore)(s,()=>Te(e.id)),j=(0,K.useSyncExternalStore)(s,()=>S(e.id)),M=(0,K.useMemo)(()=>({s:T(),g:{stride:0,cadence:0,bob:0,lean:0},placed:!1,gl:0,gr:0,gh:0,l:{...ca},r:{...ca},bat:new P,shoulder:new P,q:new Ge}),[]),Fe=(0,K.useMemo)(()=>({v:ht(e.id,e.look),party:!1,head:new P}),[e.id,e.look]),N=(0,K.useMemo)(()=>({s:Nn(e.id,performance.now()/1e3,n!=null),o:{l:{...ca},r:{...ca},lw:0,rw:0,lean:0,leanW:0,pitch:0,pitchW:0,yaw:0,roll:0,twist:0,spin:0},stretch:null,tx:0,tz:0,toward:0,browse:0,rest:null,held:!1,v:new P}),[e.id,n]),Le=(0,K.useRef)(!1),Re=(0,K.useRef)(null),F=(0,K.useRef)(null),ze=Kr(e.id,fe),Be=E(t=>re(e,t.repos,e.prNumber==null?void 0:t.qa[x(e.repoId,e.prNumber)])),Ve=(0,K.useMemo)(()=>({s:p(),seed:v(e.id)%10007}),[e.id]),He=(0,K.useRef)(null),Ue=(0,K.useMemo)(()=>({expression:Ve.s.expression,lid:0,look:b}),[Ve]);Ue.look=b,(0,K.useEffect)(()=>i(e.id,Ue),[e.id,Ue]),e.currentTool&&(y.current={name:e.currentTool,at:performance.now()}),(0,K.useEffect)(()=>h(e.id,M.s),[e.id,M]),(0,K.useEffect)(()=>yr(e.id,N.s),[e.id,N]),(0,K.useEffect)(()=>()=>{N.stretch&&je(e.id)===N.stretch&&ce(e.id)},[e.id,N]),(0,K.useEffect)(()=>st(e.id),[e.id]),I((r,i)=>{let s=Math.min(i,.1),c=performance.now(),f=c/1e3+oe,p=he(e.repoId,c);p&&!Fe.party&&g.current&&(g.current.getWorldPosition(Fe.head),Xi(Fe.v,Fe.head.x,Fe.head.y,Fe.head.z)),Fe.party=p;let h=M.s,re=de.current,v=je(e.id);if(re){re.visible=!Se(e.id),M.placed||=(re.updateWorldMatrix(!0,!1),!0);let t=re.matrixWorld.elements;h.seatX=t[12],h.seatZ=t[14],h.seatHeading=Math.atan2(t[8],t[10]),h.standX=t[0]*o.x+t[8]*o.z+t[12],h.standZ=t[2]*o.x+t[10]*o.z+t[14],pe(h,v??null,s);let n=fe.current;if(n&&h.stage===`seated`)n.position.set(0,0,0),n.rotation.y=0;else if(n){let e=h.x-t[12],r=h.z-t[14];n.position.set(t[0]*e+t[2]*r,0,t[8]*e+t[10]*r),n.rotation.y=h.heading-h.seatHeading}let r=h.stage===`up`?v?.gesture??`none`:`none`,i=h.stage===`up`&&se()===e.id,a=p&&!i?fa:ua[r],c=1-Math.exp(-s*6);a.l&&Object.assign(M.l,a.l),a.r&&Object.assign(M.r,a.r);let l=h.stage===`up`&&!p?rt(e.id):null;if(l&&m.current){m.current.localToWorld(M.shoulder.set(.25*zt(b),.44,0));let e=M.bat.set(l.x,l.y,l.z).sub(M.shoulder).applyQuaternion(m.current.getWorldQuaternion(M.q).invert()).normalize();M.r.yaw=Math.asin(Math.max(-1,Math.min(1,-e.x))),M.r.pitch=Math.atan2(e.y,-e.z)}if(r===`wave`&&(M.r.yaw+=Math.sin(f*9)*.4),r===`shake`&&(M.r.pitch+=Math.sin(f*11)*.13),r===`talk`&&(M.r.pitch+=Math.sin(f*4.3)*.18,M.r.yaw+=Math.sin(f*2.6)*.2),r===`clap`&&!p){let e=Math.abs(Math.sin(f*7))*.3;M.l.yaw-=e,M.r.yaw-=e}D.current&&(D.current.visible=r===`hold`),M.gl+=(+!!a.l-M.gl)*c,M.gr+=(+!!a.r-M.gr)*(l?1-Math.exp(-s*25):c),M.gh+=(a.head-M.gh)*c,ct(e.id,h,h.stage===`up`?v?.gesture??`none`:`none`,s,t[13]),xe.current&&(xe.current.visible=i),Ce.current&&(Ce.current.visible=h.stage===`up`&&ft(e.id))}let x=h.stage===`seated`,S=Ae(h.sit),w=1-S,Te=ue(h.speed,M.g),T=Math.min(1,h.speed/.5),E=Math.sin(h.phase)*Te.stride*T,ke=-Te.bob*T*Math.sin(h.phase)**2;t?.current&&(O.current??=t.current.position.z,t.current.position.z=O.current+oa*w);let k=e.status===`working`||e.status===`preparing`,A=p||e.status===`done`&&e.endedAt!=null&&Date.now()-e.endedAt<7e3,j=p?`cheer`:te(e.status,e.currentTool,y.current.name,c-y.current.at,A),P=ea[j],I=ae.current,We=1-Math.exp(-s*5);for(let e of[`l`,`r`])I[e].pitch+=(P[e].pitch-I[e].pitch)*We,I[e].yaw+=(P[e].yaw-I[e].yaw)*We;for(let e of[`lean`,`headPitch`,`headYaw`,`type`,`mouse`])I[e]+=(P[e]-I[e])*We;let Ge=u(f),Ke=I.type*Ge*.1,qe=Ne(e.status),Je=ie(f,qe,a.l)*Ke,Ye=ie(f,qe,a.r)*Ke*(1-I.mouse),Xe=Math.sin(f*3.1)*.05*I.type,Ze=Math.sin(f*2.7+1)*.05*I.type,Qe=Math.sin(f*1.9)*.06*I.mouse,$e=De(f)*I.mouse,et=A?Math.sin(f*9)*.35:0,tt=p?et*w:0,nt=-(b.height-1)*.55,L=ze.pose(c),it=L.flinch*.55,R=N.s,at=c/1e3,z=_r(e.id);if(z&&(zn(R,z.fidget,at),re)){let e=re.matrixWorld.elements,t=z.x-e[12],n=z.z-e[14];N.toward=Math.atan2(-(e[0]*t+e[2]*n),-(e[8]*t+e[10]*n))}L.w>0&&Bn(R,at);let ot=v!=null&&v===N.stretch;Vn(R,v&&!ot||A||e.status===`preparing`||e.status===`error`?`busy`:k?j===`browsing`?`browsing`:j===`thinking`?`thinking`:`working`:`idle`,at);let B=Hn(R,at);R.fidget===`stretch`&&B<.8?!N.stretch&&!v&&x&&B<.2&&(Pe(e.id,{mode:`standing`,x:h.standX,z:h.standZ,heading:h.seatHeading,speed:Oe,gesture:`stretch`}),N.stretch=je(e.id)??null):N.stretch&&=(je(e.id)===N.stretch&&ce(e.id),null);let V=Un(R,at),H=ga(V>0?R.fidget:null,B,f,N.toward,N.o),st=H.lw*V,U=H.rw*V;N.browse+=(+(j===`browsing`)-N.browse)*(1-Math.exp(-s*1.2)),Le.current=x&&R.fidget===`doze`&&V>.5;let lt=h.stage===`up`&&(v?.gesture===`shake`||v?.gesture===`cheer`),ut=le(e.id,c)??l({status:e.status,hit:L.w>0,cheering:A||lt,asleep:Le.current,drowsy:d(R.mood===`idle`?at-R.moodSince:0,!k&&e.endedAt!=null?(Date.now()-e.endedAt)/1e3:0),pr:Be,justMerged:Date.now()-gr(e.id)<9e4});Ie(Ve.s,ut,s),Ue.expression=ut,Ue.lid=Le.current?1:ee(f,Ve.seed),Ht(He,Ve.s,Ue.lid),Re.current&&(Re.current.visible=x&&R.fidget===`phone`&&V>.35||h.stage===`up`&&v?.gesture===`call`),x&&fe.current&&(fe.current.rotation.y=H.spin*V),t?.current&&(t.current.rotation.y=x?H.spin*V:0);let dt=Math.sin(f*1.1)*.03*(1-T),pt=(ca.pitch-E*1.1+dt)*(1-M.gl)+M.l.pitch*M.gl,mt=ca.yaw*(1-M.gl)+M.l.yaw*M.gl,ht=(ca.pitch+E*1.1+dt)*(1-M.gr)+M.r.pitch*M.gr,gt=ca.yaw*(1-M.gr)+M.r.yaw*M.gr;if(ne.current&&_.current){ne.current.rotation.set(na(I.l.pitch+nt+Je,H.l.pitch,st)*S+pt*w+it,na(-(I.l.yaw+Xe)+et,-H.l.yaw,st)*S-mt*w+tt,0),_.current.rotation.set(na(I.r.pitch+nt+Ye-$e,H.r.pitch,U)*S+ht*w+it,na(I.r.yaw+Ze*(1-I.mouse)+Qe-et,H.r.yaw,U)*S+gt*w-tt,0);let e=we.current;e&&Ce.current?.visible&&e.rotation.set(-_.current.rotation.x,-_.current.rotation.y,0,`YXZ`);let t=Me.current;if(t){let e=!p&&v?.gesture===`sip`?M.gr*la.sipTilt:0;t.rotation.set(e-_.current.rotation.x,-_.current.rotation.y,0,`YXZ`),t.visible=!x}}if(m.current){let e=Math.sin(f*1.6)*.015,t=na(I.lean,H.lean,H.leanW*V)+N.browse*.1;m.current.rotation.x=(-t+e+(k?Math.sin(f*9)*.006*Ge:0))*S+(e-Te.lean*T)*w+L.flinch*.2,m.current.rotation.y=L.twist*L.w+Math.sin(h.phase)*.1*T*w+H.twist*V*S,m.current.rotation.z=(Math.sin(f*.5)*.03*(1-T)+Math.sin(h.phase)*.035*T)*w,m.current.position.set(0,X.seatY*S+(X.standY+ke)*w,-(b.height-1)*.25*S)}if(C.current&&(C.current.visible=x),me.current&&(me.current.visible=!x),!x&&ge.current&&_e.current&&ve.current&&ye.current){let e=.3+Te.stride,t=Math.sin(f*.5)*.15*(1-T),n=-(Math.max(0,Math.cos(h.phase))*e*T+Math.max(0,t)+.04),r=-(Math.max(0,-Math.cos(h.phase))*e*T+Math.max(0,-t)+.04),i=X.seatY*S+(X.standY+ke)*w,a=X.seatZ*S;ge.current.position.set(-X.x,i,a),_e.current.position.set(X.x,i,a),ge.current.rotation.x=Math.PI/2*S+(E-n*.4)*w,_e.current.rotation.x=Math.PI/2*S+(-E-r*.4)*w,ve.current.rotation.x=-Math.PI/2*S+n*w,ye.current.rotation.x=-Math.PI/2*S+r*w}if(Ee.current&&(Ee.current.position.y=(X.standY-X.seatY)*w),be.current){let[e,t,n]=sa;be.current.position.set(e*S,t*S+(X.standY+b.height*1.18+.26)*w,n*S)}if(g.current){let t=k&&Math.sin(f*.55+2)>.92?-.22:0,n=e.status===`preparing`?Math.sin(f*1.3)*.5:Math.sin(f*.4)*.08,r=h.stage===`up`&&v?.gesture===`nod`?Math.max(0,Math.sin(f*6))*.22:0,i=na(I.headPitch+t+(k?Math.sin(f*4.5)*.02*Ge:0),H.pitch,H.pitchW*V)*S+(Math.sin(f*.3)*.05+M.gh-r)*w,a=(n+I.headYaw+H.yaw*V)*S+Math.sin(f*.4)*.15*(1-T)*w;g.current.rotation.set(i+(L.headPitch-i)*L.w,a+(L.headYaw-a)*L.w,((j===`thinking`?.12:0)+H.roll*V)*S*(1-L.w))}let W=n?.current;if(W){let e=R.fidget===`sip`&&x?ha(B,.2,.3)-ha(B,.78,.88):0;e>0&&F.current&&W.parent?(N.rest??=W.position.clone(),F.current.getWorldPosition(N.v),W.parent.worldToLocal(N.v),W.position.lerpVectors(N.rest,N.v,e),W.rotation.x=.7*(ha(B,.3,.45)-ha(B,.62,.77)),N.held=!0):N.held&&N.rest&&(W.position.copy(N.rest),W.rotation.x=0,N.held=!1)}});let We=e.status===`working`||e.status===`preparing`;return(0,q.jsx)(`group`,{ref:de,userData:ra,children:(0,q.jsxs)(`group`,{ref:fe,scale:c,children:[(0,q.jsx)(`group`,{ref:Ee,children:ze.bubble}),(0,q.jsx)(ji,{on:Le,position:[.24,1.6,-.14]}),(0,q.jsxs)(`group`,{ref:C,children:[(0,q.jsx)(Ct,{geometry:Rt.legs,color:ia,castShadow:!0,outline:.008}),(0,q.jsx)(Ct,{geometry:Rt.shoes,color:Vt,castShadow:!0})]}),(0,q.jsx)(`group`,{ref:me,visible:!1,children:[{hip:ge,knee:ve,x:-X.x},{hip:_e,knee:ye,x:X.x}].map(({hip:e,knee:t,x:n})=>(0,q.jsxs)(`group`,{ref:e,position:[n,X.seatY,X.seatZ],rotation:[Math.PI/2,0,0],children:[(0,q.jsx)(Ct,{geometry:Rt.joint,color:Vt}),(0,q.jsx)(Ct,{geometry:Rt.thigh,color:ia,castShadow:!0,outline:.008}),(0,q.jsxs)(`group`,{ref:t,position:[0,-X.thigh,0],rotation:[-Math.PI/2,0,0],children:[(0,q.jsx)(Ct,{geometry:Rt.joint,color:Vt}),(0,q.jsx)(Ct,{geometry:Rt.shin,color:ia,castShadow:!0,outline:.008}),(0,q.jsx)(Ct,{geometry:Rt.shoe,color:Vt,castShadow:!0})]})]},n))}),(0,q.jsxs)(`group`,{ref:m,position:[0,.5,-(b.height-1)*.25],scale:b.height,children:[(0,q.jsx)(Wt,{agent:e,look:b,busy:We}),(0,q.jsx)(`group`,{scale:[zt(b),1,jt[b.build].depth],children:(0,q.jsx)(ui,{agent:e,look:b,part:`body`})}),[{ref:ne,x:-.25},{ref:_,x:.25}].map(({ref:t,x:n})=>(0,q.jsxs)(`group`,{ref:t,position:[n*zt(b),.44,0],children:[(0,q.jsx)(Lt,{agent:e,look:b}),t===_&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`group`,{ref:F,position:[0,.03,-.56]}),(0,q.jsxs)(`group`,{ref:Re,position:[-.03,.06,-.52],rotation:[.7,-.55,0],visible:!1,children:[(0,q.jsx)(Ct,{geometry:Bt.phone,color:Vt}),(0,q.jsx)(`mesh`,{geometry:Bt.phoneScreen,material:G(`#8ecae6`,{emissive:`#8ecae6`,emissiveIntensity:.5})})]}),A&&(0,q.jsx)(`group`,{position:la.at,children:(0,q.jsx)(Jn,{kind:A})}),j&&(0,q.jsx)(`group`,{position:la.at,children:(0,q.jsx)(rr,{snack:j.snack,left:j.left})}),k&&(0,q.jsx)(`group`,{ref:Me,position:la.at,visible:!1,children:(0,q.jsx)(`group`,{position:[0,0,la.ahead],rotation:[0,-Math.PI/2,0],scale:la.scale,children:(0,q.jsx)(at,{color:it(k.id),sips:k.sips,shadow:!1})})}),(0,q.jsxs)(`group`,{ref:Ce,position:[0,0,da.hand],visible:!1,children:[(0,q.jsx)(z,{r:.014,h:.1,position:[0,0,-.05],rotation:[Math.PI/2,0,0],color:`#d4a373`,shadow:!1}),(0,q.jsx)(`group`,{ref:we,position:[0,0,da.blade],children:(0,q.jsx)(mi,{handle:!1})})]}),(0,q.jsxs)(`group`,{ref:xe,position:[0,0,-.5],rotation:[.5,0,0],visible:!1,children:[(0,q.jsx)(z,{r:.025,h:.55,position:[0,0,-.27],rotation:[Math.PI/2,0,0],color:`#f1d19b`,shadow:!1}),(0,q.jsx)(H,{r:.12,position:[0,0,-.56],color:`#e76f51`,outline:!0,shadow:!1}),(0,q.jsx)(z,{r:.125,h:.05,position:[0,0,-.56],rotation:[Math.PI/2,0,0],color:`#f4a261`,shadow:!1})]})]})]},n)),(0,q.jsxs)(`group`,{ref:g,position:[0,.7,0],scale:1.12,children:[(0,q.jsx)(Gt,{agent:e,look:b,busy:We,face:He}),(0,q.jsx)(`group`,{scale:[1.4,1.15,1.15],children:(0,q.jsx)(ui,{agent:e,look:b,part:`head`})}),t&&(0,q.jsx)(pn,{id:e.id,geometry:Rt.head})]}),r&&(0,q.jsx)(`group`,{ref:D,visible:!1,children:r})]}),(0,q.jsx)(li,{id:e.id,y:X.standY+b.height*1.18+.4}),f&&(0,q.jsx)(`group`,{ref:be,position:sa,children:f})]})})}var va=e=>e.seatedFor>=e.restless,ya={x:0,z:12.9},ba=1.2,xa={name:`arrive`,work:!0,when:()=>!1,spot:[],steps:[{gesture:`none`,seconds:1.1,turn:.8},{gesture:`none`,seconds:1.1,turn:-.8},{gesture:`wave`,seconds:1.8,face:`peer`},{gesture:`none`,seconds:.4,face:`peer`}]},Sa={name:`leave`,work:!0,when:()=>!1,spot:[],steps:[{gesture:`reach`,seconds:1.1},{gesture:`hold`,seconds:.6}],carry:`hold`};function Ca(e,t,n){let r=o(e,t,n);return r&&[{x:t.x,z:t.z},...r]}function wa(e,t,n){let r=o(e,n,t);return r&&[{x:n.x,z:n.z},...r,ya]}function Ta(e,t){let n=null,r=1/0;for(let i of t){if(i.id===e.id)continue;let t=Math.hypot(i.x-e.x,i.z-e.z);t<r&&(r=t,n=i)}return n}var Ea=(e,t)=>Math.atan2(-(t.x-e.x),-(t.z-e.z));function Da(e,t){let n=t.filter(t=>t.id!==e.id&&t.role!==`ceo`&&t.status===`working`).filter(t=>Math.hypot(t.home.x-e.home.x,t.home.z-e.home.z)<=9);return Ta({id:e.id,...e.home},n.map(e=>({...e,x:e.home.x,z:e.home.z})))}function Oa(e){let{x:t,z:n,facing:r}=e.home;return{id:`visit-${e.id}`,x:t-Math.sin(r)*.45,z:n+Math.cos(r)*.45,facing:r}}V({name:`visit`,when:(e,t)=>e.role!==`ceo`&&t.floor===`office`&&ot(e.status)&&va(t)&&!!t.home&&!!t.others&&!!Da({id:e.id,home:t.home},t.others),spot:[],place:(e,t)=>{let n=t.home&&t.others?Da({id:e.id,home:t.home},t.others):null;return n&&Oa(n)},steps:[{gesture:`none`,seconds:2.5},{gesture:`none`,seconds:2,turn:.15},{gesture:`talk`,seconds:1.6},{gesture:`none`,seconds:1}],weight:.7}),V({name:`stroll`,when:(e,t)=>e.role===`ceo`&&t.floor===`lobby`&&ot(e.status)&&va(t),spot:[`reception`,`window-*`],steps:[{gesture:`none`,seconds:3},{gesture:`none`,seconds:2,turn:.6},{gesture:`none`,seconds:2,turn:-.5}],weight:2});var ka={cooler:{x:13.9,z:-9.4},couch:{x:-12.6,z:8.6}},Aa={name:`chat`,when:()=>!1,spot:[],steps:[{gesture:`none`,seconds:1.5},{gesture:`talk`,seconds:3,say:!0},{gesture:`none`,seconds:3.5},{gesture:`talk`,seconds:2.5,say:!0},{gesture:`none`,seconds:3},{gesture:`talk`,seconds:3,say:!0},{gesture:`none`,seconds:3},{gesture:`talk`,seconds:2,say:!0},{gesture:`none`,seconds:1.5}]};function ja(e,t){if(t.sinceLast<40||!t.venues.length)return null;let n=t.cap-t.away;if(n<2)return null;let r=e.filter(e=>e.seatedFor>=e.restless);if(!r.length||t.rand()>=.6)return null;let i=r[Math.floor(t.rand()*r.length)],a=e=>Math.hypot(e.home.x-i.home.x,e.home.z-i.home.z),o=e.filter(e=>e.id!==i.id&&e.seatedFor>=8).sort((e,t)=>a(e)-a(t)),s=Math.min(t.rand()<.5?2:3,n,o.length+1);return s<2?null:{ids:[i.id,...o.slice(0,s-1).map(e=>e.id)],venue:t.venues[Math.floor(t.rand()*t.venues.length)]}}function Ma(e,t,n,r=.7){for(let i=0;i<12;i++){let a=i*Math.PI/6,o=[];for(let n=0;n<t;n++){let i=a+n*Math.PI*2/t,s=e.x+Math.cos(i)*r,c=e.z+Math.sin(i)*r;o.push({id:`chat-${n}`,x:s,z:c,facing:Math.atan2(e.z-c,e.x-s)})}if(o.every(e=>n(e.x,e.z)))return o}return null}function Na(e,t,n,r){let i=(e?.pulls??[]).map(e=>e.mergedAt?Date.parse(e.mergedAt):NaN).filter(e=>Number.isFinite(e)),a=t.filter(e=>e.status===`failed`||e.status===`needs-human`).map(e=>e.updatedAt),o=e=>e.length?Math.max(0,(r-Math.max(...e))/1e3):null;return{mergedAgo:o(i),failedAgo:o(a),working:n}}function Pa(e,t,n){return e===`π`?(t?.pulls??[]).filter(e=>e.mergedAt).sort((e,t)=>Date.parse(t.mergedAt)-Date.parse(e.mergedAt))[0]?.number??null:e===`π`?[...n].filter(e=>e.status===`failed`||e.status===`needs-human`).sort((e,t)=>t.updatedAt-e.updatedAt)[0]?.prNumber??null:null}function Fa(e){let t=e=>e!=null&&e<600;return[[`β`,2],[`π`,2],[`π`,e.working>0?2:.5],[`π`,t(e.mergedAgo)?5:.3],[`π`,t(e.failedAgo)?5:.3]]}function Ia(e,t){let n=Fa(e),r=t*n.reduce((e,[,t])=>e+t,0);for(let[e,t]of n)if(r-=t,r<0)return e;return n[0][0]}function La(e,t,n=we.seats.length){let r=new Map(t.map(e=>[e.id,e])),i=[];for(let t of e.list){let e=r.get(t.id);t.phase===`waiting`?e?.status===`pending`?i.push(t):e&&i.push({...t,phase:e.status===`approved`?`hired`:`declined`}):i.push(t)}let a=new Set(i.map(e=>e.seat)),o=new Set(i.map(e=>e.id)),s=0,c=t.filter(e=>e.kind===`hire`&&e.status===`pending`&&!o.has(e.id)).sort((e,t)=>e.createdAt-t.createdAt);for(let e of c){let t=0;for(;t<n&&a.has(t);)t++;if(t>=n){s++;continue}a.add(t),i.push({id:e.id,seat:t,phase:`waiting`})}return i.length===e.list.length&&i.every((t,n)=>t===e.list[n])&&s===e.outside?e:{list:i,outside:s}}function Ra(e,t){return e.list.some(e=>e.id===t)?{...e,list:e.list.filter(e=>e.id!==t)}:e}function za(e,t){let n=new Map(e.map(e=>[e.id,e.status]));return t.filter(e=>e.kind===`hire`&&e.status===`approved`&&e.agentId&&n.get(e.id)===`pending`).map(e=>({agentId:e.agentId,repoId:e.repoId}))}function Ba(e,t){let n=[];for(let r of t)r.role!==`ceo`&&!e.has(r.id)&&n.push({agentId:r.id,repoId:r.repoId});return n}function Va(e,t){return e===`declined`?{gesture:`nod`,seconds:2,say:`π`}:t?{gesture:`shake`,seconds:3,say:`π€`}:{gesture:`cheer`,seconds:2.2,say:`π`}}var Ha=1.1,Ua=e=>({x:we.x-.6,z:we.seats[e]??we.seats[0]});function Wa(e,t,n){let r=Ua(e),i=Math.hypot(r.x-t.x,r.z-t.z);if(i>4.5)return{at:r,near:!1};for(let e of[1,1.25,1.5]){if(e>=i)break;let a={x:t.x+(r.x-t.x)*e/i,z:t.z+(r.z-t.z)*e/i};if(n(a.x,a.z))return{at:a,near:!0}}return{at:r,near:!0}}var Ga=C.lobby.east.door,Ka={inside:{x:15.1,z:Ga},outside:{x:17.3,z:Ga},away:{x:17.3,z:k.maxZ-.9}};function qa(e,t){let n=j(e,`elevator`),r=n?o(e,t,n):null;return r&&[...r,ya]}function Ja(e,t){let n=o(e,t,Ka.inside);return n&&[...n,Ka.outside,Ka.away]}var Ya=[{what:`whiteboard`,ids:e=>e.spots.filter(e=>e.id.startsWith(`board-`)).sort((e,t)=>Math.abs(e.x)-Math.abs(t.x)).map(e=>e.id),gesture:`none`,seconds:2.2},{what:`coffee machine`,ids:()=>[`coffee`],gesture:`tap`,seconds:1.8},{what:`gong`,ids:()=>[`gong`],gesture:`none`,seconds:1.8}],Xa={m:1.6,s:2};function Za(e,t){let n=Ya.flatMap(t=>{let n=t.ids(e).map(t=>j(e,t)).find(e=>!!e);return n?[{spot:n,what:t.what,gesture:t.gesture,seconds:t.seconds}]:[]}),r=[],i=t;for(;n.length;){let e=e=>Math.hypot(e.spot.x-i.x,e.spot.z-i.z),t=n.reduce((t,r,i)=>e(r)<e(n[t])?i:t,0),[a]=n.splice(t,1);r.push(a),i=a.spot}return r}var Qa=.75;function $a(e,t,n){if(Math.hypot(t.x-e.x,t.z-e.z)>2)return{x:e.x,z:e.z};let r=-Math.sign(t.x-e.x),i=Math.abs(t.x-e.x)>.1?r:Math.sign((n?.x??e.x+1)-e.x)||1;return{x:e.x+i*Qa,z:e.z}}function eo(e,t){let n=0,r=!1,i=0,a=0,o={x:NaN,z:NaN},s=-1,c=null,l={x:0,z:0},u=()=>{n++,r=!1,i=0,a=0,s=-1,c=null,t.progress(e[n]??null)},d=f=>{let p=e[n];if(!p)return{do:`done`,x:f.x,z:f.z,heading:f.heading,gesture:`none`};let m=L(p.spot.facing);if(s<0){let e=Math.hypot(f.x-p.spot.x,f.z-p.spot.z);a=Math.hypot(f.x-o.x,f.z-o.z)<.02?a+f.dt:0,o={x:f.x,z:f.z};let n=r&&(f.arrived&&e<.6||e<Xa.m&&a>Xa.s);if(r=!0,i+=f.dt,i>30)return u(),d({...f,dt:0});if(!n)return{do:`walk`,x:p.spot.x,z:p.spot.z,heading:m,gesture:`none`};s=0,l={x:f.x,z:f.z},c=t.arrive(p,l)}return s+=f.dt,s<p.seconds?{do:`stand`,x:l.x,z:l.z,heading:m,gesture:p.gesture}:c&&s<p.seconds+1.2?{do:`stand`,x:l.x,z:l.z,heading:Ea(l,c),gesture:`wave`}:(u(),d({...f,dt:0}))};return t.progress(e[0]??null),{tick:d,end:()=>t.progress(null)}}var to=(e,t,n)=>Ta({id:e,...t},n),no=null,ro=new Map,Q=new Map,io=null,ao=new Set;function oo(e){no=e}function so(e,t=Date.now()){let n=ro.get(e);return ro.delete(e),n!==void 0&&t-n<3e5&&!Q.has(e)}function co(e,t){Q.set(e,{state:`touring`,stop:t[0]?.what??null,stops:t.map(e=>e.what),at:Date.now()})}function lo(e,t){let n=Q.get(e);n?.state===`touring`&&(n.stop=t?.what??null)}function uo(e,t){let n=Q.get(e);Q.set(e,{state:t,stop:null,stops:n?.stops??[],at:Date.now()}),Q.size>20&&Q.delete(Q.keys().next().value)}var fo=E.getState();if(fo.loaded&&!fo.replaying&&(io=new Set(Object.keys(fo.agents))),E.subscribe((e,t)=>{if(!e.loaded||e.replaying)return;if(!io){io=new Set(Object.keys(e.agents));return}if(e.agents===t.agents&&e.requests===t.requests)return;let n=Date.now();for(let[e,t]of ro)n-t>=3e5&&ro.delete(e);let r=e=>{io.has(e)||(io.add(e),Q.has(e)||ro.set(e,n))};if(e.agents!==t.agents)for(let t of Ba(io,Object.values(e.agents)))r(t.agentId);if(e.requests!==t.requests)for(let n of za(t.requests,e.requests))r(n.agentId)}),typeof window<`u`){let e=e=>{let t=E.getState().requests.find(t=>t.id===e),n=t?E.getState().repos.find(e=>e.id===t.repoId)?.floor??null:null;return{name:t?.name??null,cli:t?.cli??null,floor:n}};window.__swarmHiring={candidates:()=>no?.list.map(t=>({...t,...e(t.id)}))??null,seats:()=>no&&{seats:we.seats.map((e,t)=>({seat:t,z:e,candidate:no?.list.find(e=>e.seat===t)?.id??null})),outside:no.outside},tours:()=>({tours:Object.fromEntries(Q),due:[...ro.keys()]}),propose:(e=`hire`,t)=>N.demoPropose(e,t),interview:e=>E.getState().openOverlay({kind:`interview`,requestId:e})}}var $={ivory:`#faf8f5`,graphite:`#202b38`,metal:`#596d7b`,cyan:`#54dfff`,amber:`#ffbb66`,orange:`#e99743`,floor:`#cdd5d8`,rug:`#718797`,petrol:`#17485c`,ceiling:`#dce3e5`};function po(e){let t=Number.parseInt(e.slice(1),16);return`#`+[146,153,154].map((e,n)=>Math.round((t>>16-n*8&255)*.55+e*.45).toString(16).padStart(2,`0`)).join(``)}var mo=new Qe(1,1,1),ho=()=>{};function go({at:e,size:t,color:n=$.cyan}){return(0,q.jsx)(`mesh`,{geometry:mo,material:wt(n),position:e,scale:t,raycast:ho})}var _o=`#b9c2cf`;function vo({floorLabel:e,accent:t}){let n=(0,K.useRef)(null),i=(0,K.useRef)(null),a=(0,K.useRef)(0),o=(0,K.useRef)(null),{doorHalf:s,cabinHalf:c,depth:l,doorHeight:u}=g,d=12.15,f=At({id:`elevator`,label:`Use the elevator`,action:{kind:`elevator`}},3.5),p=At({id:`elevator-panel`,label:`Choose a floor`,action:{kind:`elevator`}},2.5),m=kt(512,128,t=>fe(t,512,128,[{text:e,size:56,color:`#7CFFB2`}],`#15151f`),[e]);return I((e,t)=>{let c=E.getState().travel,l=Ot.x,u=Ot.z-d,f=Math.hypot(l,u)<2.8;for(let e of r())e.stage!==`seated`&&Math.abs(e.x)<s+.6&&Math.abs(e.z-d)<2&&(f=!0);Kt.drawn&&Math.abs(Kt.x)<s+.6&&Math.abs(Kt.z-d)<2&&(f=!0);let p=c?.phase===`closing`?0:f||c?.phase===`opening`?1:0;a.current=Le()?p:a.current+(p-a.current)*(1-Math.exp(-t*5));let m=a.current*s*.98;n.current&&(n.current.position.x=-s/2-m),i.current&&(i.current.position.x=s/2+m),o.current&&(o.current.visible=Et().z!==1)}),(0,q.jsxs)(`group`,{ref:o,children:[(0,q.jsxs)(`group`,{ref:f,children:[(0,q.jsx)(U,{size:[.22,u+.1,.36],position:[-s-.05,(u+.1)/2,12],color:_o,outline:!0}),(0,q.jsx)(U,{size:[.22,u+.1,.36],position:[s+.05,(u+.1)/2,12],color:_o,outline:!0}),(0,q.jsx)(U,{size:[s*2+.32,.22,.36],position:[0,u+.08,12],color:_o,outline:!0}),(0,q.jsx)(`mesh`,{ref:n,position:[-s/2,u/2,d],material:G(`#d9dee6`),castShadow:!0,children:(0,q.jsx)(`boxGeometry`,{args:[s,u,.06]})}),(0,q.jsx)(`mesh`,{ref:i,position:[s/2,u/2,d],material:G(`#d9dee6`),castShadow:!0,children:(0,q.jsx)(`boxGeometry`,{args:[s,u,.06]})})]}),(0,q.jsxs)(`mesh`,{position:[0,u+.55,11.97],rotation:[0,Math.PI,0],children:[(0,q.jsx)(`planeGeometry`,{args:[1.6,.4]}),(0,q.jsx)(`meshBasicMaterial`,{map:m,toneMapped:!1})]}),(0,q.jsxs)(`group`,{position:[s+.55,1.2,11.97],rotation:[0,Math.PI,0],children:[(0,q.jsx)(U,{size:[.22,.4,.04],position:[0,0,0],color:_o,outline:!0}),(0,q.jsx)(`mesh`,{position:[0,.08,.025],material:wt(t),children:(0,q.jsx)(`circleGeometry`,{args:[.05,20]})}),(0,q.jsx)(`mesh`,{position:[0,-.08,.025],material:wt(`#ffffff`),children:(0,q.jsx)(`circleGeometry`,{args:[.05,20]})})]}),(0,q.jsxs)(`group`,{position:[0,0,12],children:[(0,q.jsx)(`mesh`,{position:[0,.01,l/2],rotation:[-Math.PI/2,0,0],receiveShadow:!0,material:G(`#8d7b68`),children:(0,q.jsx)(`planeGeometry`,{args:[c*2,l]})}),(0,q.jsx)(`mesh`,{position:[0,u+.2,l/2],rotation:[Math.PI/2,0,0],material:G(`#f1f3f5`),children:(0,q.jsx)(`planeGeometry`,{args:[c*2,l]})}),(0,q.jsx)(`mesh`,{position:[0,u+.18,l/2],rotation:[Math.PI/2,0,0],material:wt(`#fff6d6`),children:(0,q.jsx)(`circleGeometry`,{args:[.45,32]})}),[-1,1].map(e=>(0,q.jsx)(`mesh`,{position:[e*(c+.05),y/2,(l+.05)/2],material:G(`#c8ced8`),children:(0,q.jsx)(`boxGeometry`,{args:[.1,y,l-.05]})},e)),(0,q.jsx)(`mesh`,{position:[0,y/2,l+.05],material:G(`#c8ced8`),children:(0,q.jsx)(`boxGeometry`,{args:[c*2+.2,y,.1]})}),(0,q.jsx)(U,{size:[c*2-.2,.05,.08],position:[0,.95,l-.05],color:`#e9c46a`,outline:!0}),(0,q.jsxs)(`group`,{ref:p,position:[c-.02,1.25,.9],rotation:[0,-Math.PI/2,0],children:[(0,q.jsx)(U,{size:[.36,.7,.04],position:[0,0,0],color:_o,outline:!0}),[.22,.08,-.06,-.2].map((e,n)=>(0,q.jsx)(`mesh`,{position:[0,e,.025],material:wt(n===0?t:`#fdfdfd`),children:(0,q.jsx)(`circleGeometry`,{args:[.04,16]})},e))]})]})]})}function yo(e){let t=e.length&&yt(e)||new Re;for(let t of e)t.dispose();return t}var bo=e=>yo(e.map(({size:e,at:t})=>new Qe(...e).translate(...t))),xo=.5;function So(){let e=document.createElement(`canvas`);e.width=e.height=128;let t=e.getContext(`2d`),n=t.createRadialGradient(64,64,0,64,64,64);n.addColorStop(0,`rgba(255,255,255,1)`),n.addColorStop(.42,`rgba(255,255,255,0.8)`),n.addColorStop(.5,`rgba(255,255,255,0.35)`),n.addColorStop(.8,`rgba(255,255,255,0.22)`),n.addColorStop(1,`rgba(255,255,255,0)`),t.fillStyle=n,t.fillRect(0,0,128,128);let r=new Ze(e);return r.colorSpace=F,r}var Co=new Ye({map:So(),color:`#ffcf85`,transparent:!0,opacity:0,blending:2,depthWrite:!1,toneMapped:!1,fog:!1,visible:!1,userData:qe}),wo={ceiling:new Je(3.2,2).rotateX(Math.PI/2),bulb:new Je(1.5,1.5).rotateX(Math.PI/2)},To=new ze(`#d6d0c2`),Eo=new ze(`#fffbe8`),Do=Ke(new Ye({color:To,toneMapped:!1}),`night`),Oo=0,ko=()=>Oo;function Ao(e){Oo=e,Co.opacity=e*xo,Co.visible=e>.01,Do.color.lerpColors(To,Eo,e)}function jo({positions:e,size:t=`ceiling`}){let n=(0,K.useRef)(null);return(0,K.useLayoutEffect)(()=>{let t=n.current;if(!t)return;let r=new Xe;e.forEach(([e,n,i],a)=>t.setMatrixAt(a,r.makeTranslation(e,n+.02,i))),t.instanceMatrix.needsUpdate=!0},[e]),(0,q.jsx)(`instancedMesh`,{ref:n,args:[wo[t],Co,e.length],frustumCulled:!1})}var Mo=.06,No=.1,Po=.08,Fo=.06;function Io(e){let{w:t,h:n,y:r}=de;return Ee.flatMap(i=>{let{door:a,windows:o}=C[e][i],s=r-n/2+Mo,c=r+n/2-No;return[...o.flatMap(e=>[{side:i,z0:e-t/2+Po,z1:e-Fo,y0:s,y1:c},{side:i,z0:e+Fo,z1:e+t/2-Po,y0:s,y1:c}]),{side:i,z0:a-O.half,z1:a+O.half,y0:0,y1:O.h}]})}var Lo=[new Float32Array(16),new Float32Array(16)];function Ro(e,t,n,r,i,a){let o=0;for(let s=0;s<t;s++){let c=(s+1)%t,l=(e[s*2+r]-i)*a,u=(e[c*2+r]-i)*a;if(l>=0&&(n[o*2]=e[s*2],n[o*2+1]=e[s*2+1],o++),l>=0!=u>=0){let t=l/(l-u);n[o*2]=e[s*2]+(e[c*2]-e[s*2])*t,n[o*2+1]=e[s*2+1]+(e[c*2+1]-e[s*2+1])*t,o++}}return o}function zo(e,t,n){let r=ae(e.side),[i,a,o]=t;if(a<=0||i*r<=0)return 0;let s=r*16,c=Lo[0];for(let t=0;t<4;t++){let n=t===0||t===3?e.y0:e.y1,r=t<2?e.z0:e.z1;c[t*2]=s-i*n/a,c[t*2+1]=r-o*n/a}let l=4,u=Lo[1];for(let e=0;e<4;e++){l=Ro(c,l,u,e<2?0:1,e<2?16*(e===0?-1:1):12*(e===2?-1:1),e%2==0?1:-1);let t=c;if(c=u,u=t,l===0)return 0}for(let e=0;e<l*2;e++)n[e]=c[e];return l}var Bo=.2,Vo=.012,Ho=new Ye({color:0,transparent:!0,blending:2,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-4,side:2,fog:!1,visible:!1}),Uo={dir:[0,1,0],version:0};function Wo(e,t,n){Uo.dir[0]=e[0],Uo.dir[1]=e[1],Uo.dir[2]=e[2],Uo.version++,Ho.color.setHex(t).multiplyScalar(n*Bo),Ho.visible=n>.01}var Go=new Float32Array(16);function Ko({kind:e}){let t=(0,K.useMemo)(()=>Io(e),[e]),n=(0,K.useMemo)(()=>{let e=new Re;e.setAttribute(`position`,new Ve(new Float32Array(t.length*8*3),3).setUsage(Be));let n=[];for(let e=0;e<t.length;e++)for(let t=1;t<7;t++)n.push(e*8,e*8+t,e*8+t+1);return e.setIndex(n),e},[t]);(0,K.useEffect)(()=>()=>n.dispose(),[n]);let r=(0,K.useRef)(-1);return Nt(()=>{if(r.current===Uo.version)return;r.current=Uo.version;let e=n.attributes.position,i=e.array;for(let e=0;e<t.length;e++){let n=zo(t[e],Uo.dir,Go);for(let t=0;t<8;t++){let r=(e*8+t)*3,a=t<n?t:0;i[r]=n?Go[a*2]:0,i[r+1]=Vo,i[r+2]=n?Go[a*2+1]:0}}e.needsUpdate=!0}),(0,q.jsx)(`mesh`,{geometry:n,material:Ho,frustumCulled:!1,renderOrder:1})}var qo=$.ivory,Jo=`#1f1d2b`,Yo=null;function Xo(){if(Yo)return Yo;let e=document.createElement(`canvas`);e.width=256,e.height=128,b(e.getContext(`2d`),256,128);let t=new Ze(e);return t.colorSpace=F,Yo=new Ye({map:t,transparent:!0,depthWrite:!1,side:2,toneMapped:!1}),Yo}function Zo(e,t){let{door:n,windows:r}=C[e][t],{w:i,h:a,y:o}=de;return[{z0:n-O.half,z1:n+O.half,y0:0,y1:O.h},...r.map(e=>({z0:e-i/2,z1:e+i/2,y0:o-a/2,y1:o+a/2}))].sort((e,t)=>e.z0-t.z0)}function Qo(e){let t=A,n=[];for(let r of Ee){let i=ae(r)*(16+t/2),a=-12;for(let o of Zo(e,r)){let e=(o.z0+o.z1)/2;o.z0>a&&n.push({size:[t,y,o.z0-a],at:[i,y/2,(a+o.z0)/2]}),o.y0>0&&n.push({size:[t,o.y0,o.z1-o.z0],at:[i,o.y0/2,e]}),n.push({size:[t,y-o.y1,o.z1-o.z0],at:[i,(o.y1+y)/2,e]}),a=o.z1}n.push({size:[t,y,12-a],at:[i,y/2,(a+12)/2]})}return bo(n)}function $o(e){let t=A+.06,n=[];for(let r of Ee){let i=ae(r)*(16+A/2);for(let a of Zo(e,r)){let e=(a.z0+a.z1)/2,r=a.z1-a.z0,o=a.y1-a.y0;if(a.y0===0){n.push({size:[t,.12,r+.24],at:[i,a.y1+.06,e]});for(let e of[a.z0-.06,a.z1+.06])n.push({size:[t,a.y1,.12],at:[i,a.y1/2,e]});continue}n.push({size:[t,.1,r],at:[i,a.y1-.05,e]}),n.push({size:[A+.22,.08,r+.2],at:[i,a.y0+.02,e]});for(let e of[a.z0+.04,a.z1-.04])n.push({size:[t,o,.08],at:[i,(a.y0+a.y1)/2,e]});n.push({size:[.12,o,.07],at:[i,(a.y0+a.y1)/2,e]})}}return bo(n)}function es(e){let{w:t,h:n,y:r}=de;return yo(Ee.flatMap(i=>C[e][i].windows.map(e=>new Je(t,n).rotateY(Math.PI/2).translate(ae(i)*(16+A/2),r,e))))}function ts({kind:e}){let t=(0,K.useMemo)(()=>Qo(e),[e]),n=(0,K.useMemo)(()=>$o(e),[e]),r=(0,K.useMemo)(()=>es(e),[e]);return(0,K.useEffect)(()=>()=>[t,n,r].forEach(e=>e.dispose()),[t,n,r]),(0,q.jsxs)(`group`,{children:[(0,q.jsx)(`mesh`,{geometry:t,material:G(qo),receiveShadow:!0}),(0,q.jsx)(`mesh`,{geometry:n,material:G($.graphite),children:(0,q.jsx)(bt,{thickness:.018,color:Jo})}),(0,q.jsx)(`mesh`,{geometry:r,material:Xo(),renderOrder:1})]})}var ns=St(new Je(1.25,.38),{shading:`glowNight`});function rs({position:e}){return(0,q.jsxs)(`group`,{position:e,children:[(0,q.jsx)(U,{size:[1.4,.06,.5],position:[0,0,0],color:$.graphite,shadow:!1}),(0,q.jsx)(xt,{look:ns,color:`#ffe4bc`,position:[0,-.035,0],rotation:[Math.PI/2,0,0]})]})}function is({kind:e,accent:t,floorColor:n}){let r=G(qo),i=.3,{doorHalf:a,doorHeight:o}=g,s=(0,K.useMemo)(()=>{let e=[];for(let t=-12;t<=12;t+=6)for(let n=-8;n<=8;n+=5.5)e.push([t,y-.04,n]);return e},[]),c=(0,K.useMemo)(()=>{let e=document.createElement(`canvas`);e.width=e.height=512;let t=e.getContext(`2d`);for(let e=0;e<2;e++){for(let r=-0;r<512;r+=256){let i=(e*7+Math.floor((r+0)/256)*3)%5*.012-.024;t.fillStyle=Tt(n,i),t.fillRect(r,e*256,256,256),t.fillStyle=Tt(n,-.1),t.fillRect(r,e*256,2,256),t.fillStyle=Tt(n,i-.035),t.fillRect(r+12,e*256+12,20,2),t.fillRect(r+12,e*256+12,2,20)}t.fillStyle=Tt(n,-.12),t.fillRect(0,e*256,512,2)}let r=new Ze(e);return r.colorSpace=F,r.wrapS=r.wrapT=$e,r.repeat.set(8,6),r.anisotropy=8,r},[n]),l=16-a,u=Ee.flatMap(t=>{let n=ae(t),r=C[e][t].door;return[[-12,r-O.half-.12],[r+O.half+.12,12]].map(([e,t])=>({p:[n*15.98,0,(e+t)/2],r:-n*Math.PI/2,w:t-e}))});return(0,q.jsxs)(`group`,{children:[(0,q.jsxs)(`mesh`,{rotation:[-Math.PI/2,0,0],receiveShadow:!0,children:[(0,q.jsx)(`planeGeometry`,{args:[32,24]}),(0,q.jsx)(`meshToonMaterial`,{map:c})]}),(0,q.jsx)(`mesh`,{rotation:[Math.PI/2,0,0],position:[0,y,0],material:G($.ceiling),children:(0,q.jsx)(`planeGeometry`,{args:[32,24]})}),[-9,-3,3,9].map((e,t)=>(0,q.jsxs)(`group`,{children:[(0,q.jsx)(U,{size:[.34,.018,23.2],position:[e,y-.012,0],color:$.graphite,shadow:!1}),(0,q.jsx)(go,{at:[e-.11,y-.024,0],size:[.035,.006,22.8],color:t%2==0?$.cyan:$.amber}),[-8,-2.5,3,8.5].map(n=>(0,q.jsx)(go,{at:[e+.08,y-.024,n],size:[.1,.006,.65],color:t%2==0?$.amber:$.cyan},n))]},e)),s.map(e=>(0,q.jsx)(rs,{position:e},e.join())),(0,q.jsx)(jo,{positions:s}),(0,q.jsx)(Ko,{kind:e}),(0,q.jsx)(`mesh`,{position:[0,y/2,-12-i/2],material:r,receiveShadow:!0,children:(0,q.jsx)(`boxGeometry`,{args:[32.6,y,i]})}),(0,q.jsx)(ts,{kind:e}),[-1,1].map(e=>(0,q.jsx)(`mesh`,{position:[e*(a+l/2),y/2,12.15],material:r,receiveShadow:!0,children:(0,q.jsx)(`boxGeometry`,{args:[l,y,i]})},e)),(0,q.jsx)(`mesh`,{position:[0,(y+o)/2,12.15],material:r,children:(0,q.jsx)(`boxGeometry`,{args:[a*2,y-o,i]})}),[{p:[0,0,-11.98],r:0,w:32},...u,{p:[-(a+l/2),0,11.98],r:Math.PI,w:l},{p:[a+l/2,0,11.98],r:Math.PI,w:l}].map(({p:n,r,w:i},a)=>(0,q.jsxs)(`group`,{position:[n[0],0,n[2]],rotation:[0,r,0],children:[(0,q.jsx)(`mesh`,{position:[0,.06,0],material:G($.graphite),children:(0,q.jsx)(`boxGeometry`,{args:[i,.12,.04]})}),(0,q.jsx)(`mesh`,{position:[0,.95,0],material:G(t),children:(0,q.jsx)(`boxGeometry`,{args:[i,e===`office`?.06:.12,.03]})}),(0,q.jsx)(go,{at:[0,.98,.018],size:[i,.018,.006]}),(0,q.jsx)(`mesh`,{position:[0,y-.22,0],material:G($.graphite),children:(0,q.jsx)(`boxGeometry`,{args:[i,.26,.04]})}),(0,q.jsx)(go,{at:[0,y-.36,.025],size:[i,.025,.008],color:$.amber})]},a))]})}export{Sr as $,eo as A,Na as B,Wa as C,Va as D,Za as E,ka as F,ja as G,Ma as H,ba as I,_a as J,Oa as K,Sa as L,xa as M,ya as N,$a as O,Aa as P,Cr as Q,Ca as R,Ja as S,Ra as T,Ta as U,Ea as V,Ia as W,mi as X,ji as Y,Ei as Z,lo as _,vn as _t,Do as a,tr as at,Ha as b,an as bt,bo as c,Jn as ct,go as d,Zn as dt,Lr as et,$ as f,qn as ft,so as g,hn as gt,oo as h,xn as ht,jo as i,vr as it,to as j,La as k,yo as l,$n as lt,ao as m,bn as mt,Xo as n,Vr as nt,ko as o,rr as ot,po as p,yn as pt,Pa as q,Wo as r,Br as rt,Ao as s,ir as st,is as t,Rr as tt,vo as u,Qn as ut,uo as v,un as vt,qa as w,Ua as x,Jt as xt,co as y,ln as yt,wa as z};
|