1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12160],{12160:(e,t,n)=>{n.r(t),n.d(t,{LivingAvatarProof:()=>u});var o=n(4536),a=n(11092),i=n(53066),r=n.n(i),s=n(90625),l=n(14404),c=n(41566),d=n(66834);function u(e){let{seed:t="you",backHref:n="/labs/spatial-soak"}=e,i=(0,a.useRef)(null),u=(0,a.useRef)(0),p=(0,a.useRef)(null),f=(0,a.useRef)(null),[h,m]=(0,a.useState)("idle"),[g,y]=(0,a.useState)(0);(0,a.useEffect)(()=>{var e;let n=i.current;if(!n)return;let o=new s.JeP({antialias:!0,alpha:!0});o.setPixelRatio(Math.min(window.devicePixelRatio,2)),o.setSize(n.clientWidth,n.clientHeight),o.xr.enabled=!0,n.appendChild(o.domElement);let a=new s.Z58,r=new s.ubm(50,n.clientWidth/n.clientHeight,.1,100);r.position.set(0,1.15,1.85),r.lookAt(0,.85,0),a.add(new s.dth(0xffffff,4866102,1.1));let d=new s.ZyN(0xfff2dc,1);d.position.set(2,4,3),a.add(d);let h=(0,c.KV)((0,c.i$)(t),{speaking:!0});a.add(h);let m=h.userData.speakingRig,g=null;null==(e=navigator.xr)||e.isSessionSupported("immersive-vr").then(e=>{e&&((g=l.Z.createButton(o)).style.position="absolute",g.style.bottom="14px",g.style.left="50%",g.style.transform="translateX(-50%)",n.appendChild(g))}).catch(()=>{});let v=new s.zD7,w=0,x=new Uint8Array(32);o.setAnimationLoop(()=>{let e=v.getDelta(),t=p.current?f.current:null,n=t?function(e,t){e.getByteTimeDomainData(t);let n=0;for(let e=0;e<t.length;e++){let o=Math.abs(t[e]-128);o>n&&(n=o)}return Math.min(1,n/128*1.6)}(t,x):0;u.current=n,null==m||m.update(n,e),h.rotation.y=.35*Math.sin(.25*v.elapsedTime),(7&w++)==0&&y(n),o.render(a,r)});let b=()=>{n.clientWidth&&(r.aspect=n.clientWidth/n.clientHeight,r.updateProjectionMatrix(),o.setSize(n.clientWidth,n.clientHeight))};return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b),o.setAnimationLoop(null),(0,c.Vr)(h),o.dispose(),(null==g?void 0:g.parentNode)&&g.parentNode.removeChild(g),o.domElement.parentNode&&o.domElement.parentNode.removeChild(o.domElement)}},[t]);let v=async()=>{if("on"!==h&&"starting"!==h){m("starting");try{let e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}}),t=new(window.AudioContext||window.webkitAudioContext),n=t.createMediaStreamSource(e),o=t.createAnalyser();o.fftSize=32,o.smoothingTimeConstant=.6,n.connect(o),f.current=o,p.current={ctx:t,stream:e},m("on")}catch(e){m("denied")}}};return(0,a.useEffect)(()=>()=>{var e,t;null==(e=p.current)||e.stream.getTracks().forEach(e=>e.stop()),null==(t=p.current)||t.ctx.close(),p.current=null,f.current=null},[]),(0,o.jsxs)("div",{className:"living-proof",children:[(0,o.jsx)("div",{className:"living-proof__stage",ref:i}),(0,o.jsxs)("aside",{className:"living-proof__panel",children:[(0,o.jsx)(r(),{href:n,className:"btn btn-ghost btn-sm",children:"â Back"}),(0,o.jsx)("h1",{children:"Living Vector"}),(0,o.jsx)("p",{className:"muted",children:"One signal â your live voice level â drives a 2D glyph and a 3D avatar at once. The glyph that breathes when a Soak goes live is the same idea as the avatarâs speaking presence, just a different renderer."}),(0,o.jsxs)("div",{className:"living-proof__signal",children:[(0,o.jsx)("span",{className:"living-proof__glyph",style:{color:"var(--t-soak, #f26d4a)"},children:(0,o.jsx)(d.In,{name:"soundwave",size:40,animated:g>.06})}),(0,o.jsx)("div",{className:"living-proof__meter","aria-hidden":!0,children:(0,o.jsx)("span",{style:{transform:"scaleX(".concat(Math.max(.02,g),")")}})}),(0,o.jsx)("span",{className:"living-proof__pct",children:Math.round(100*g)})]}),"on"===h?(0,o.jsx)("p",{className:"muted living-proof__hint",children:"Speak â watch the halo and the bars move together."}):"denied"===h?(0,o.jsx)("p",{className:"muted living-proof__hint",children:"Mic blocked. Allow microphone access and reload to drive the avatar."}):(0,o.jsx)("button",{type:"button",className:"btn btn-primary",onClick:()=>void v(),disabled:"starting"===h,children:"starting"===h?"Startingâ¦":"Turn on microphone"}),(0,o.jsx)("p",{className:"muted living-proof__fine",children:"Faceless by design â presence, not a face. Frozen mic = still avatar."})]})]})}}
1,14404:(e,t,n)=>{n.d(t,{Z:()=>o});class o{static createButton(e,t={}){let n=document.createElement("button");function a(){n.style.display="",n.style.cursor="auto",n.style.left="calc(50% - 75px)",n.style.width="150px",n.onmouseenter=null,n.onmouseleave=null,n.onclick=null}function i(e){e.style.position="absolute",e.style.bottom="20px",e.style.padding="12px 6px",e.style.border="1px solid #fff",e.style.borderRadius="4px",e.style.background="rgba(0,0,0,0.1)",e.style.color="#fff",e.style.font="normal 13px sans-serif",e.style.textAlign="center",e.style.opacity="0.5",e.style.outline="none",e.style.zIndex="999"}if("xr"in navigator)return n.id="VRButton",n.style.display="none",i(n),navigator.xr.isSessionSupported("immersive-vr").then(function(i){i?function(){let o=null;async function a(t){t.addEventListener("end",i),await e.xr.setSession(t),n.textContent="EXIT VR",o=t}function i(){o.removeEventListener("end",i),n.textContent="ENTER VR",o=null}n.style.display="",n.style.cursor="pointer",n.style.left="calc(50% - 50px)",n.style.width="100px",n.textContent="ENTER VR";let r={...t,optionalFeatures:["local-floor","bounded-floor","layers",...t.optionalFeatures||[]]};n.onmouseenter=function(){n.style.opacity="1.0"},n.onmouseleave=function(){n.style.opacity="0.5"},n.onclick=function(){null===o?navigator.xr.requestSession("immersive-vr",r).then(a):(o.end(),void 0!==navigator.xr.offerSession&&navigator.xr.offerSession("immersive-vr",r).then(a).catch(e=>{console.warn(e)}))},void 0!==navigator.xr.offerSession&&navigator.xr.offerSession("immersive-vr",r).then(a).catch(e=>{console.warn(e)})}():(a(),n.textContent="VR NOT SUPPORTED"),i&&o.xrSessionIsGranted&&n.click()}).catch(function(e){a(),console.warn("Exception when trying to call xr.isSessionSupported",e),n.textContent="VR NOT ALLOWED"}),n;{let e=document.createElement("a");return!1===window.isSecureContext?(e.href=document.location.href.replace(/^http:/,"https:"),e.innerHTML="WEBXR NEEDS HTTPS"):(e.href="https://immersiveweb.dev/",e.innerHTML="WEBXR NOT AVAILABLE"),e.style.left="calc(50% - 90px)",e.style.width="180px",e.style.textDecoration="none",i(e),e}}static registerSessionGrantedListener(){"undefined"!=typeof navigator&&"xr"in navigator&&(/WebXRViewer\//i.test(navigator.userAgent)||navigator.xr.addEventListener("sessiongranted",()=>{o.xrSessionIsGranted=!0}))}}o.xrSessionIsGranted=!1,o.registerSessionGrantedListener()},31519:(e,t,n)=>{n.d(t,{CK:()=>o,VQ:()=>a,XH:()=>i});let o=["#E05A3A","#F1A23A","#4EA1B0","#B8526E","#6B9F6F","#8856A8","#D17A3E","#5A7BC8"];function a(e){let t=()=>o[Math.floor(Math.random()*o.length)],n=t();if(!e)return n;for(let o=0;o<8&&n===e;o++)n=t();return n}function i(e){let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)>>>0;return o[t%o.length]}},34662:(e,t,n)=>{n.d(t,{fx:()=>a,ic:()=>i});let o=e=>e<0?0:e>1?1:Number.isFinite(e)?e:0;function a(e){let t=o(e);return{opacity:.85*t,glowScale:1+.7*t,headScale:1+.05*t}}function i(e,t,n){return e+(o(t)-e)*Math.min(1,12*Math.max(0,n))}},41566:(e,t,n)=>{n.d(t,{CK:()=>a.CK,KV:()=>h,Pf:()=>u,Vr:()=>m,i$:()=>p,jC:()=>c,kb:()=>l,l9:()=>f,pr:()=>s,rr:()=>r});var o=n(90625),a=n(31519),i=n(34662);let r=["capsule","orb","cube"],s=["none","cap","crown","antenna"],l={capsule:"Classic",orb:"Bubble",cube:"Blocky"},c={none:"None",cap:"Cap",crown:"Crown",antenna:"Antenna"},d="hottub:vr-avatar";function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"you";return{color:(0,a.XH)(e),body:"capsule",hat:"none"}}function p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"you",t=u(e);try{let e=window.localStorage.getItem(d);if(!e)return t;let n=JSON.parse(e);return{color:"string"==typeof n.color&&a.CK.includes(n.color)?n.color:t.color,body:r.includes(n.body)?n.body:"capsule",hat:s.includes(n.hat)?n.hat:"none"}}catch(e){return t}}function f(e){try{window.localStorage.setItem(d,JSON.stringify(e))}catch(e){}}function h(e,t){let n,a,r=new o.YJl,s=new o.Q1f(e.color),l=new o._4j({color:s,roughness:.5,metalness:.05}),c=new o._4j({color:s.clone().offsetHSL(0,-.06,.1),roughness:.55});"orb"===e.body?((n=new o.eaF(new o.Gu$(.3,24,20),l)).position.y=.3,a=.66):"cube"===e.body?((n=new o.eaF(new o.iNn(.42,.5,.42),l)).position.y=.3,a=.72):((n=new o.eaF(new o.qU7(.22,.32,8,16),l)).position.y=.34,a=.74),r.add(n);let d=new o.eaF(new o.Gu$(.17,20,16),c);if(d.position.y=a,r.add(d),"cap"===e.hat){let e=new o._4j({color:2761504,roughness:.7}),t=new o.eaF(new o.Gu$(.18,18,10,0,2*Math.PI,0,Math.PI/2),e);t.position.y=a+.05;let n=new o.eaF(new o.iNn(.26,.03,.16),e);n.position.set(0,a+.04,.17),r.add(t),r.add(n)}else if("crown"===e.hat){let e=new o._4j({color:0xf1a23a,roughness:.35,metalness:.45}),t=new o.eaF(new o.Ho_(.16,.18,.12,8,1,!0),e);t.position.y=a+.16,r.add(t)}else if("antenna"===e.hat){let e=new o._4j({color:2761504,roughness:.7}),t=new o._4j({color:0xf1a23a,roughness:.3,metalness:.4}),n=new o.eaF(new o.Ho_(.012,.012,.22,6),e);n.position.y=a+.28;let i=new o.eaF(new o.Gu$(.045,12,10),t);i.position.y=a+.41,r.add(n),r.add(i)}if(null==t?void 0:t.speaking){let e=d.scale.x,t=new o.V9B({color:s.clone().offsetHSL(0,-.1,.18),transparent:!0,opacity:0,blending:o.EZo,depthWrite:!1}),n=new o.eaF(new o.Gu$(.24,18,14),t);n.position.y=a,r.add(n);let l=0;r.userData.speakingRig={update(o,a){l=(0,i.ic)(l,o,a);let{opacity:r,glowScale:s,headScale:c}=(0,i.fx)(l);t.opacity=r,n.scale.setScalar(s),d.scale.setScalar(e*c)}}}return r.userData.isSelfAvatar=!0,r}function m(e){e.traverse(e=>{e.geometry&&e.geometry.dispose();let t=e.material;
1Array.isArray(t)?t.forEach(e=>e.dispose()):null==t||t.dispose()})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.