PageSourceSearch

https://www.spatial.io/_next/static/chunks/unity-client-saga.550b4068361070d3.js

js spatial.io collected 2026-09-24 08:34:23 UTC 33,338 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1119],{51878:function(e,t,i){i.d(t,{k:function(){return l},x:function(){return c}});var n=i(69517),o=i(81746),r=i(6590);function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?a(Object(i),!0).forEach(function(t){(0,n.Z)(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}let l="GET_USERS_AVATARS",c=(e,t)=>{var i,n;let a=(0,r.W)(),c=s(s({},e),{},{count:null!==(i=e.count)&&void 0!==i?i:500,skip:null!==(n=e.skip)&&void 0!==n?n:0});return(0,o.N)(s({queryKey:[l,c],queryFn:e=>{let{pageParam:t=0}=e;return a.usersV2.avatars.getAvatars(s(s({},c),{},{skip:t}))},getNextPageParam:(e,t)=>e.count<c.count?void 0:c.count*t.length,staleTime:3e5},t))}},73254:function(e,t,i){i.d(t,{H6:function(){return y},h$:function(){return f},s6:function(){return _},uS:function(){return m}});var n=i(69517),o=i(81746),r=i(56729),a=i(10330),s=i(61266),l=i(2784),c=i(78454),d=i(75365),u=i(6590);function h(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function p(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?h(Object(i),!0).forEach(function(t){(0,n.Z)(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}let m="GET_USERS_EMOTES",g="GET_USERS_RECENT_EMOTES",_=(e,t)=>{var i,n;let r=(0,u.W)(),a={count:null!==(i=e.count)&&void 0!==i?i:100,skip:null!==(n=e.skip)&&void 0!==n?n:0};return(0,o.N)(p({queryKey:[m,a],queryFn:e=>{let{pageParam:t}=e;return r.usersV2.emotes.getEmotes(p(p({},a),{},{skip:t}))},getNextPageParam:(e,t)=>e.count<a.count?void 0:a.count*t.length,staleTime:3e5},t))},f=e=>{let t=(0,u.W)(),i=(0,l.useCallback)(e=>({emotes:e.emotes.map(e=>"emoji"===e.emoteType?{id:e.id,displayEmoji:(0,d.t)(e.id)}:e)}),[]);return(0,r.a)(p({queryKey:[g],queryFn:()=>t.usersV2.emotes.getRecentEmotes(),select:i,staleTime:3e5},e))},y=e=>{let t=(0,u.W)(),i=(0,a.NL)();return(0,s.D)(p({mutationFn:e=>{let i="displayEmoji"in e,n={emoteID:i?e.id:e.assetType===c.oI.UnityPackage?e.itemID:e.id,emoteType:i?"emoji":e.assetType===c.oI.UnityPackage?"unity":"animation"};return t.usersV2.emotes.updateRecentEmotes(n)},onMutate:async e=>{await i.cancelQueries([g]);let t=i.getQueryData([g]);return i.setQueryData([g],t=>{if(t)return{emotes:["displayEmoji"in e?{id:e.id,displayEmoji:(0,d.t)(e.id)}:e,...t.emotes.slice(0,t.emotes.length-1)]}}),{previousRecentEmotes:t}},onSettled:()=>{i.invalidateQueries([g])}},e))}},48107:function(e,t,i){let n,o;i.r(t),i.d(t,{unityClientSaga:function(){return ex}});var r=i(69517),a=i(14772),s=i(92642),l=i(91199),c=i(27398),d=i(91645),u=i(6994),h=i(35090),p=i(78749),m=i(6593),g=i(36819);let _="azure-speech-sdk-script",f=null,y=null,v=!1,S=!1;function b(){return window.SpeechSDK||null}function C(e){let t={keys:[],values:[]};if(!e)return t;let i=e.translations;if(!i||"function"!=typeof i.get)return t;let n=Array.isArray(i.languages)?i.languages:[];for(let e=0;e<n.length;e++){let o=n[e];try{let e=i.get(o);e&&(t.keys.push(o),t.values.push(e))}catch{}}return t}function k(){var e,t;let i=b();if(!i||!o)return null===(e=f)||void 0===e||e("Canceled",{error:!0,errorMessage:"Speech SDK not loaded"}),0;try{let e=i.SpeechTranslationConfig.fromSubscription(o.key,o.region);e.speechRecognitionLanguage=o.inputLanguage;for(let t=0;t<o.targets.length;t++)e.addTargetLanguage(o.targets[t]);let t=i.AudioConfig.fromDefaultMicrophoneInput(),r=new i.TranslationRecognizer(e,t);return r.recognizing=(e,t)=>
1{var i;let n=null==t?void 0:t.result,o=C(n);null===(i=f)||void 0===i||i("Recognizing",{text:n?n.text:"",keys:o.keys,values:o.values})},r.recognized=(e,t)=>{var i;let n=null==t?void 0:t.result,o=C(n);null===(i=f)||void 0===i||i("Recognized",{text:n?n.text:"",keys:o.keys,values:o.values})},r.canceled=(e,t)=>{var i;null===(i=f)||void 0===i||i("Canceled",{error:!t||t.reason===b().CancellationReason.Error,errorMessage:t?t.errorDetails:"Canceled"})},n=r,S&&n.startContinuousRecognitionAsync(),1}catch(e){return null===(t=f)||void 0===t||t("Canceled",{error:!0,errorMessage:String(e)}),0}}var w=e=>(f=e,function(){if(v)return 1;if(document.getElementById(_)){var e;return v=!!b(),null===(e=f)||void 0===e||e("ScriptLoaded",v),v?1:0}let t=document.createElement("script");return t.id=_,t.async=!0,t.src="https://aka.ms/csspeech/jsbrowserpackageraw",t.onload=()=>{var e;v=!!b(),null===(e=f)||void 0===e||e("ScriptLoaded",v)},t.onerror=()=>{var e;v=!1,null===(e=f)||void 0===e||e("ScriptLoaded",!1)},document.head.appendChild(t),1}()),O=e=>{y=e},T=()=>v?1:0,D=(e,t,i,n,r)=>{try{console.log("[AzureSpeech][StartListening] invoked",{sdkLoaded:v})}catch{}if(!v){var a;return null===(a=f)||void 0===a||a("Canceled",{error:!0,errorMessage:"Speech SDK not loaded"}),0}return S=i,o={key:e,region:t,inputLanguage:n,targets:(r||"").split(",").map(e=>e.trim()).filter(e=>e.length>0)},k()},I=()=>{if(!n)return;let e=n;n=void 0,S=!1;try{e.stopContinuousRecognitionAsync(()=>{var t;try{e.close()}catch{}null===(t=y)||void 0===t||t(0)},()=>{var t;try{e.close()}catch{}null===(t=y)||void 0===t||t(1)})}catch(e){}},R=()=>n&&S?1:0,P=()=>{if(!n)return;let e=n;n=void 0,console.log("[AzureSpeech][PauseContinuousRecognition] invoked",{reco:e}),S=!1;try{e.stopContinuousRecognitionAsync(()=>{var t;try{e.close()}catch{}null===(t=y)||void 0===t||t(0)},()=>{var t;try{e.close()}catch{}null===(t=y)||void 0===t||t(1)})}catch(e){}},N=()=>{},E=e=>{o||(o={key:"",region:"",inputLanguage:"",targets:[]}),-1===o.targets.indexOf(e)&&o.targets.push(e),n&&k()},A=e=>{o&&(o.targets=o.targets.filter(t=>t!==e),n&&k())},L=e=>{n&&k()},x=i(34109),M=i(78258),j=i(83320);class U{constructor(e,t,i){(0,r.Z)(this,"_minDelay",.2),(0,r.Z)(this,"_maxDelay",1.2),(0,r.Z)(this,"_volume",1),(0,r.Z)(this,"_playbackTailTime",0),this._audioContext=e,this._channels=t,this._sampleRate=i,this.setup()}setup(){this._gainNode=this._audioContext.createGain(),this._gainNode.gain.value=this._volume,this._rtcAudioPipe=window.globalRTCAudioLoopback,this._gainNode.connect(this._audioContext.destination),this._playbackTailTime=this._audioContext.currentTime}dispose(){if(this._audioElement&&(this._audioElement.srcObject=null,this._audioElement.remove()),this._destinationNode){var e;null===(e=this._rtcAudioPipe)||void 0===e||e.removeStream(this._destinationNode.stream)}}setVolume(e){this._volume=e,this._gainNode&&(this._gainNode.gain.value=this._volume)}feed(e){if(!e.length)return;let t=this._audioContext.createBufferSource(),i=e.length/this._channels,n=this._audioContext.createBuffer(this._channels,i,this._sampleRate);for(let t=0;t<this._channels;t++){let o=n.getChannelData(t),r=t;for(let t=0;t<i;t++)o[t]=e[r],r+=this._channels}this._playbackTailTime<this._audioContext.currentTime&&(this._playbackTailTime=this._audioContext.currentTime+this._minDelay),this._playbackTailTime-this._audioContext.currentTime>this._maxDelay&&(this._playbackTailTime=this._audioContext.currentTime+this._maxDelay),t.buffer=n,t.connect(this._gainNode),t.start(this._playbackTailTime),this._playbackTailTime+=n.duration}}let z=new M.nZ("Voice");class Y{constructor(){(0,r.Z)(this,"_streams",{}),(0,r.Z)(this,"_inputConnection",null),(0,r.Z)(this,"_outputConnection",null),(0,r.Z)(this,"_currOfferPromise",null),this.initConnection(),this.createOfferWhenAvailable({offerToReceiveAudio:!0,offerToReceiveVideo:!1})}dispose(){var e,t;null===(e=this._inputConnection)||void 0===e||e.close(),null===(t=this._outputConnection)||void 0===t||t.close(),this._inputConnection=null,this._outputConnection=null,this._streams={}}initConnection(){let e=void 0;this._inputConnection=new RTCPeerConnection(e),this._inputConnection.onicecandidate=e=>this.onIceCandidate(this._outputConnection,e),this._outputConnection=new RTCPeerConnection(e),this._outputConnection.onicecandidate=e=>this.onIceCandidate(this._inputConnection,e),this._outputConnection.ontrack=this.onOutputStreamOpened.bind(this)}addStream(e,t,i){this.isConnectionClosed()&&this.initConnection();let n=this._inputConnection.addTrack(e.getAudioTracks()[0],e);this._streams[e.id]={inputStream:e,outputStream:null,sender:n,onOutputStreamOpen:t,onError:i},this.createOfferWhenAvailable({offerToReceiveAudio:!0,offerToReceiveVideo:!1})}createOfferWhenAvailable(e){this._currOfferPromise?this._currOfferPromise.finally(()=>{this.createOfferWhenAvailable(e)}):this._currOfferPromise=new Promise(t=>{this._inputConnection.createOffer(e).then(this.gotInputDescription.bind(this)).catch(this.onError.bind(this)).finally(()=>{this._currOfferPromise=null,t()})})}removeStream(e){let t=this._streams[e.id];if(!this.isConnectionClosed()){var i;null===(i=this._inputConnection)||void 0===i||i.removeTrack(t.sender)}delete this._streams[e.id]}isConnectionClosed(){var e,t;return(null===(e=this._inputConnection)||void 0===e?void 0:e.signalingState)==="closed"||(null===(t=this._outputConnection)||void 0===t?void 0:t.signalingState)==="closed"}gotInputDescription(e){return this._inputConnection.setLocalDescription(e).then(()=>this._outputConnection.setRemoteDescription(e).then(()=>this._outputConnection.createAnswer().then(this.gotOutputDescription.bind(this)).catch(this.onError.bind(this))).catch(this.onError.bind(this))).catch(this.onError.bind(this))}gotOutputDescription(e){return this._outputConnection.setLocalDescription(e).then(()=>{var t;return null===(t=this._inputConnection)||void 0===t?void 0:t.setRemoteDescription(e).catch(this.onError.bind(this))}).catch(this.onError.bind(this))}onOutputStreamOpened(e){for(let t=0;t<e.streams.length;++t){let i=e.streams[t],n=this._streams[i.id];n?(n.outputStream=i,n.onOutputStreamOpen(i)):j.k.error(z,"remote stream opened unexpectedly")}}
1onIceCandidate(e,t){e.addIceCandidate(t.candidate).catch(this.onError.bind(this))}onError(e){Object.values(this._streams).forEach(t=>{t.onError(e)})}}var G=i(13115),W=i(16223),F=i.p+"static/microphone-recorder.1c511eaad645cc08.worklet.js";class B{get deviceID(){return this._deviceID}get groupID(){return this._groupID}get mediaStream(){return this._mediaStream}get isCreatingStream(){return this._isCreatingStream}get status(){return this._status}constructor(e,t){(0,r.Z)(this,"_mediaStream",null),(0,r.Z)(this,"_isCreatingStream",!1),(0,r.Z)(this,"_isCanceled",!1),(0,r.Z)(this,"_shouldBeRecording",!1),this._deviceID=e,this._statusCallback=(e,i)=>{this._status=e,t(e,i)}}createStream(){let e={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,googEchoCancellation:!0,googNoiseSuppression:!0,googAutoGainControl:!0,deviceId:this._deviceID?this._deviceID:void 0};return navigator.mediaDevices.getUserMedia({audio:e,video:!1})}handleStartSuccess(){this._statusCallback(W.PF.On,null),this._mediaStream.onremovetrack=()=>{this._statusCallback(W.PF.Off,"microphone track has been removed unexpectedly")},this._mediaStream.getTracks().forEach(e=>{var t;e.onended=()=>{this._statusCallback(W.PF.Off,null)},e.onmute=()=>{this._shouldBeRecording?this._statusCallback(W.PF.Muted,"microphone has been muted unexpectedly"):this._statusCallback(W.PF.Off,null)},e.onunmute=()=>{this._statusCallback(W.PF.On,null)},this._groupID=null===(t=e.getSettings())||void 0===t?void 0:t.groupId}),this._shouldBeRecording||this.pause()}handleStartFailed(e){let t=W.PF.Unknown;if(e.name in W.PF){let i=e.name;t=W.PF[i]}this._statusCallback(t,e.message)}async start(){this._isCreatingStream=!0,this._shouldBeRecording=!0,this._statusCallback(W.PF.RequestingPermissions,null);try{let e=await this.createStream();if(this._mediaStream=e,this._isCanceled)return;return this.handleStartSuccess(),!0}catch(e){if(this._isCanceled)return;return this.handleStartFailed(e),!1}finally{this._isCreatingStream=!1,this._isCanceled&&this.stop()}}stop(){if(this._shouldBeRecording=!1,this._isCreatingStream){this._isCanceled=!0;return}this._mediaStream&&(this._mediaStream.getTracks().forEach(e=>{e.stop()}),this._mediaStream=null),this._statusCallback(W.PF.Off,null)}pause(){this._shouldBeRecording=!1;let e=!1;this._mediaStream&&this._mediaStream.getTracks().forEach(t=>{t.enabled=!1,e=!0}),e&&this._statusCallback(W.PF.Off,null)}resume(){this._shouldBeRecording=!0;let e=!1;return this._mediaStream&&this._mediaStream.getTracks().forEach(t=>{"live"===t.readyState&&(t.enabled=!0,e=!0)}),!!e&&(this._statusCallback(W.PF.On,null),!0)}debugInfo(){return{deviceID:this._deviceID,groupID:this._groupID,status:this._status,isCreatingStream:this._isCreatingStream,isCanceled:this._isCanceled,shouldBeRecording:this._shouldBeRecording,mediaStream:this._mediaStream?{active:this._mediaStream.active,id:this._mediaStream.id}:null}}}let K=new M.nZ("Microphone");class X{static get instance(){return X._instance}get audioContext(){return this._audioContext}get outputNode(){return this._gainNode}constructor(e,t,i,n){(0,r.Z)(this,"_deviceID",null),(0,r.Z)(this,"_currentStream",null),(0,r.Z)(this,"_sourceNode",null),(0,r.Z)(this,"_workletNode",null),(0,r.Z)(this,"_processorNode",null),(0,r.Z)(this,"_isReading",!1),(0,r.Z)(this,"handleMediaDevicesChanged",async()=>{try{let n=await navigator.mediaDevices.enumerateDevices();if(!n)return;let o=!1,r=null,a=null;for(let e=0;e<n.length;++e)"audioinput"!==n[e].kind||(n[e].deviceId===this._deviceID?(o=!0,a=n[e].groupId):o||null!==r&&"default"!==n[e].deviceId||(r=n[e].deviceId));if(o){var e,t,i;if(((null===(e=this._currentStream)||void 0===e?void 0:e.groupID)!==a||(null===(t=this._currentStream)||void 0===t?void 0:t.deviceID)!==this._deviceID||(null===(i=this._currentStream)||void 0===i?void 0:i.status)!==W.PF.On)&&this._shouldBeRecording){let e=this.debugInfo();e.currentGroupID=a,j.k.info(K,"restarting microphone stream after device list has changed",{LogData:e}),this.start()}}else if(r&&this._shouldBeRecording){let e=this.debugInfo();e.fallbackDeviceID=r,j.k.info(K,"starting microphone stream with a fallback device",{LogData:e}),this.startWithDevice(r)}}catch(e){j.k.error(K,"failed with handling devices changed",e)}}),X._instance=this,this._audioContext=e,this._statusCallback=t,this._gainNode=this._audioContext.createGain(),navigator.mediaDevices.addEventListener("devicechange",this.handleMediaDevicesChanged),this.setupPermissionsHandler(),this.startDataReadback(n,i),X.onMicrophoneInitialized.emit()}dispose(){X._instance===this&&(X._instance=null),this.stop(),this.stopDataReadback(),this._gainNode&&(this._gainNode.disconnect(),this._gainNode=null),navigator.mediaDevices.removeEventListener("devicechange",this.handleMediaDevicesChanged)}start(){"suspended"===this._audioContext.state&&this._audioContext.resume(),this.startWithDevice(this._deviceID)}stop(){var e;this._shouldBeRecording=!1,null===(e=this._currentStream)||void 0===e||e.stop(),this._sourceNode&&(this._sourceNode.disconnect(),this._sourceNode=null)}pause(){var e;null===(e=this._currentStream)||void 0===e||e.pause()}resume(){var e;null===(e=this._currentStream)||void 0===e||e.resume()}setDeviceID(e){j.k.debug(K,"setting microphone deviceID",{LogData:{deviceID:e}}),e!==this._deviceID&&(this._deviceID=e,this._shouldBeRecording&&this.start())}setGain(e){var t;null===(t=this._gainNode)||void 0===t||t.gain.setValueAtTime(e,this._audioContext.currentTime)}startWithDevice(e){this.stop(),this._shouldBeRecording=!0,j.k.debug(K,"starting microphone stream",{LogData:{deviceID:e}});let t=new B(e,(e,i)=>{this.handleMicStatusChanged(t,e,i)});this._currentStream=t,this._currentStream.start().then(e=>{this.handleMicrophoneStreamStarted(t,e)})}handleMicStatusChanged(e,t,i){e===this._currentStream&&(this._statusCallback(t,i),t===W.PF.Off&&this._shouldBeRecording&&(j.k.info(K,"microphone has stopped when it should be recording",{LogData:this.debugInfo()}),this.start()))}handleMicrophoneStreamStarted(e,t){let i=e===this._currentStream;if(j.k.debug(K,"handle microphone stream started",{LogData:{success:t,isCurrentStream:i}}),t&&i){var n;null===(n=this._sourceNode)||void 0===n||n.disconnect(),this._sourceNode=this._audioContext.createMediaStreamSource(e.mediaStream),this._sourceNode.connect(this._gainNode)}}async setupPermissionsHandler(){if(navigator.permissions)try{let e=await navigator.permissions.query({name:"microphone"});e.onchange=()=>{var t;j.k.debug(K,"microphone permission status has changed",{LogData:{status:e.state}}),"granted"===e.state&&this._shouldBeRecording&&!(null!==(t=this._currentStream)&&void 0!==t&&t.isCreatingStream)&&(j.k.info(K,"restarting microphone stream due to permission being granted"),this.start())}}catch(e){}}setupAudioWorklet(e,t){var i;this._workletNode=new AudioWorkletNode(this._audioContext,"recorder-worklet"),this._workletNode.port.postMessage({bufferLength:e}),this._workletNode.port.onmessage=function(e){t(e.data)},null===(i=this._gainNode)||void 0===i||i.connect(this._workletNode),this._workletNode.connect(this._audioContext.destination)}setupScriptProcessor(e,t){var i;this._processorNode=this._audioContext.createScriptProcessor(e,1,1),this._processorNode.onaudioprocess=function(e){t(e.inputBuffer.getChannelData(0))},null===(i=this._gainNode)||void 0===i||i.connect(this._processorNode),this._processorNode.connect(this._audioContext.destination)}async startDataReadback(e,t){var i;if(this._isReading){j.k.error(K,"tried starting data readback when it was already reading");return}if(this._isReading=!0,"function"==typeof(null===(i=this._audioContext.audioWorklet)||void 0===i?void 0:i.addModule))try{this.setupAudioWorklet(e,t)}catch(i){try{await this._audioContext.audioWorklet.addModule(F),this.setupAudioWorklet(e,t)}catch(i){j.k.warn(K,"creating audio worklet for readback has failed",i),this.setupScriptProcessor(e,t)}}else this.setupScriptProcessor(e,t)}stopDataReadback(){var e,t;this._workletNode&&(null===(e=this._gainNode)||void 0===e||e.disconnect(this._workletNode),this._workletNode.disconnect(),this._workletNode=null),this._processorNode&&(null===(t=this._gainNode)||void 0===t||t.disconnect(this._processorNode),this._processorNode.disconnect(),this._processorNode=null),this._isReading=!1}debugInfo(){var e;return{deviceID:this._deviceID,shouldBeRecording:this._shouldBeRecording,isReading:this._isReading,sourceNode:this._sourceNode?{channelCount:this._sourceNode.channelCount,channelCountMode:this._sourceNode.channelCountMode,channelCountInterpretation:this._sourceNode.channelInterpretation,numberOfInputs:this._sourceNode.numberOfInputs,numberOfOutputs:this._sourceNode.numberOfOutputs}:null,workletNode:this._workletNode?{parameters:this._workletNode.parameters,channelCount:this._workletNode.channelCount,channelCountMode:this._workletNode.channelCountMode,channelCountInterpretation:this._workletNode.channelInterpretation,numberOfInputs:this._workletNode.numberOfInputs,numberOfOutputs:this._workletNode.numberOfOutputs}:null,processorNode:this._processorNode?{bufferSize:this._processorNode.bufferSize,channelCount:this._processorNode.channelCount,channelCountMode:this._processorNode.channelCountMode,channelCountInterpretation:this._processorNode.channelInterpretation,numberOfInputs:this._processorNode.numberOfInputs,numberOfOutputs:this._processorNode.numberOfOutputs}:null,micStream:null===(e=this._currentStream)||void 0===e?void 0:e.debugInfo()}}}(0,r.Z)(X,"onMicrophoneInitialized",new G.Event);var q=i(41690),Z=i(27875),V=i.n(Z),$=i(64432);function*H(e,t){let i=e.getReader();try{for(;;){let{done:e,value:n}=yield i.read();if(e)return;t(n)}}finally{i.releaseLock()}}function*Q(e){try{let t=yield(0,a.RE)(fetch,e);if(!t.ok)throw Error(`Failed to fetch ${e}`);yield(0,a.RE)([t,t.blob])}catch(t){throw s.Tb(t,{level:"fatal",tags:{download_unity_url:e}}),t}}function*J(e,t){let i=yield(0,a.RE)(fetch,e);if(!i.ok)throw Error(`Failed to fetch ${e}`);let n=i.headers.get("Content-Length"),o=i.headers.get("Content-Encoding");t.put({type:"INITIAL_SIZE",payload:{contentLength:n,contentEncoding:o,url:e}}),yield(0,a.RE)(H,i.body,e=>{t.put({type:"DOWNLOAD_PROGRESS",payload:e.length})})}function*ee(e){let t=(0,l.CE)();yield(0,a.rM)(ei,t);try{yield(0,a.RE)(J,e,t)}catch(t){throw s.Tb(t,{level:"fatal",tags:{download_unity_url:e}}),t}finally{t.close()}}function*et(e){yield(0,a.$6)([(0,a.RE)(Q,e.dataUrl),(0,a.RE)(ee,e.code
1Url),(0,a.RE)(Q,e.frameworkUrl)])}function*ei(e){let t=1,i=0,n=0,o=!1;for(;;){let r=yield(0,a.qn)(e);if("INITIAL_SIZE"===r.type){let{contentLength:e,contentEncoding:n,url:a}=r.payload,s="undefined"!=typeof navigator&&(0,$.vU)(navigator.userAgent),l="br"===n||a.endsWith(".br"),c="gzip"===n||a.endsWith(".gzip");t=s?1:l?5:c?4:5,e&&(i=Math.round(parseInt(e,10)*t)),Number.isNaN(i)||0===i||(o=!0)}else if(o){n+=r.payload;let e=V()(n/i,0,1);yield(0,a.gz)(m.eX.setUnityInitializationProgress(e))}}}var en=i(5632),eo=i.n(en),er=i(90087),ea=i(51878),es=i(73254),el=i(98046),ec=i(39657),ed=i(96790),eu=i(46700),eh=i(32082),ep=i(56873),em=i(77994),eg=i(11897),e_=i(89013),ef=i(52322),ey=i(48013),ev=i(90313);function eS(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function eb(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?eS(Object(i),!0).forEach(function(t){(0,r.Z)(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):eS(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}let eC=["hasUsedMouseOrKeyboard","isMouseOverUnityUI","microphone/status","roomSession/roomInstances","roomSession/sessionDataSynced"],ek={app_bootstrap_result:function*(e){let{startupMessage:t}=e.data;null!=t&&t.message&&(yield(0,a.gz)(m.eX.patchAppState([{op:"replace",path:["startupMessage"],value:t}])),yield(0,a.gz)(m.eX.openModal({type:eu.c3.BootstrapMessage})))},app_finished_booting:function*(){let e=yield*(0,u.w_)(e=>e.user),t=yield(0,a.Ys)(e=>e.auth);d.finishBooting(),d.setWebUserAgent((0,$.GI)(navigator.userAgent)),d.initializeAppStateObservers(eC),d.logIn(t.accessToken,t.useAuthlessToken,JSON.stringify(e.raw));let i=new URLSearchParams(window.location.search);eT(),yield(0,a.rM)(eD,i),eI(i),eR(i),yield(0,a.gz)(m.eX.finishUnityBooting())},app_state_changed:function*(e){yield(0,a.gz)(m.eX.setUnityAppState(e.data))},app_state_patches:function*(e){yield(0,a.gz)(m.eX.patchAppState(e.data))},app_request_alert:function*(e){let t=e.data;if(t.alertType===W.Km.EnterPortal)yield(0,a.gz)(m.eX.setAlertFromUnity(t));else if(t.alertType===W.Km.ItemPurchaseConfirmation)yield(0,a.gz)(m.eX.openModal({type:eu.c3.ConfirmBuyItemModal,payload:eb({},t)}));else if(t.alertType===W.Km.ItemPurchaseWithUpsellConfirmation)yield(0,a.gz)(m.eX.openModal({type:eu.c3.UpsellBuyItemModal,payload:eb({},t)}));else if(t.alertType===W.Km.RequestAd){if(!(yield(0,a.Ys)(e=>e.unity.appState.isAdsSupported))){d.requestAlertFeedback(t.callbackID,{success:!1,errorReason:"ADS_NOT_SUPPORTED"});return}if(t.requestAdParams.adType===W.Nf.None){d.requestAlertFeedback(t.callbackID,{success:!1,errorReason:"AD_TYPE_NONE"});return}yield(0,a.gz)(m.eX.requestAd(eb(eb({},t.requestAdParams),{},{callbackId:t.callbackID})))}else if(t.alertType===W.Km.CrazyGamesGameplayStart)yield(0,a.gz)(m.eX.cgGameplayStart());else if(t.alertType===W.Km.CrazyGamesGameplayStop)yield(0,a.gz)(m.eX.cgGameplayStop());else if(t.alertType===W.Km.UpsellUserToSignIn)yield(0,a.gz)(m.eX.openModal({type:eu.c3.Login,payload:{titleCta:"Sign in to buy premium items!"}}));else if(t.alertType===W.Km.ScreenshareDailyLimitReached){if(yield(0,a.Ys)(e=>el.hY(e.unity.appState))){let e=yield(0,a.Ys)(e=>e.unity.appState.roomSession.roomID),t=yield(0,a.Ys)(e=>e.unity.appState.roomSession.screenshareTimeUsed),i=yield(0,a.Ys)(e=>e.unity.appState.roomSession.spaceLimits.screenShareDailyLimitSeconds);yield(0,a.gz)(m.eX.openModal({type:eu.c3.SpaceSubUpgrade,payload:{source:t>=i?"screenshareLimitReached":"screenshareUpsell",recommendedPlanId:"PRO",spaceId:e}}))}else(0,ep.A)("You've exceeded the screen share limit. The owner of this space needs to upgrade their space to remove the limit.")}else if(t.alertType===W.Km.NavigateWithHyperlink)yield(0,a.gz)(m.eX.openSpaceModal({type:"HyperlinkConfirm",payload:{unityAlert:t}}));else if(t.alertType===W.Km.ConfirmPortalPermissions||t.alertType===W.Km.NFTEnvironmentFallback)yield(0,a.gz)(m.eX.openSpaceModal({type:"ReactAlertGeneric",payload:{unityAlert:t}}));else if(t.alertType===W.Km.SpaceStorageLimitReached){let e=yield*(0,u.w_)(e=>e.user);if((0,er.r$)(e))return;if(yield(0,a.Ys)(e=>el.hY(e.unity.appState))){let e=yield(0,a.Ys)(e=>e.unity.appState.roomSession.roomID);yield(0,a.gz)(m.eX.openModal({type:eu.c3.SpaceSubUpgrade,payload:{source:"storageLimitReached",spaceId:e}}))}else(0,ep.A)("You've exceeded the space's file storage limit. The owner of this space needs to upgrade their space to increase this limit.")}else!function(e,t){let i=`spatial_unity_alert_${e.callbackID}`;ep.A.custom(i=>{let n=e=>{t(e),ep.A.dismiss(i)};return(0,ef.jsxs)("div",{className:"grid gap-4",children:[(0,ef.jsx)(em.X,{asChild:!0,size:"h3",children:(0,ef.jsx)("h3",{children:e.title})}),(0,ef.jsx)(eg.x,{children:e.message}),(0,ef.jsxs)("div",{className:"grid grid-flow-col justify-center gap-2",children:[(0,ef.jsx)(e_.z,{className:"w-fit",color:"primary",size:"lg",variant:"text",onClick:()=>n(e.deniedText),children:e.deniedText}),(0,ef.jsx)(e_.z,{className:"w-fit",color:"blue",size:"lg",variant:"text",onClick:()=>n(e.permitText),children:e.permitText})]})]})},{closeButton:!1,dismissible:!1,duration:1/0,id:i,position:"top-center"})}(t,e=>{d.requestAlertFeedback(t.callbackID,e)})},get_app_config:function*(){d.setAppConfig({spatialUid:yield(0,a.Ys)(e=>e.spatialUid),swagOrigin:"",sapiOrigin:x.default.API_URL})},auth_token_updated:function*(e){let t=yield(0,a.Ys)(e=>e.auth);t.status===eh.tD.Authenticated&&t.useAuthlessToken&&(yield(0,a.gz)(m.eX.setAuthSuccess(eb(eb({},t),{},{accessToken:e.data}))))},set_canvas_size:function*(e){let{width:t,height:i}=e.data,n=yield(0,a.Ys)(e=>e.canvas.element);n&&(n.width=t,n.height=i)},set_microphone_level:function*(e){(yield(0,a.Ys)(e=>e.space.micPeakAmplitude)).set(e.data.level)},leave_room:function*(){(yield(0,a.Ys)(e=>e.auth.isSigningInFromSpace))||((yield(0,a.Ys)(e=>e.isInIframe))?yield(0,a.gz)(m.eX.setShowIframeBlockingModal(!0)):eo().push("/"))},mixpanel_track:function(e){ed.nT.track(e.data.eventName,e.data.properties)},mixpanel_register:function(e){ed.nT.register(e.data)},mixpanel_unregister:function(e){ed.nT.unregister(e.data)}
1,end_of_frame:ev.b,quest_completed:function*(e){let{data:t}=e,i=(yield(0,a.Ys)(e=>e.unity.appState.roomSession.questSystem.quests))[t.questId];i&&(yield(0,a.gz)(m.eX.questCompleted(i)))},quest_task_completed:function*(e){let t=yield(0,a.Ys)(e=>el.ao(e.unity.appState));if(!t)return;let i=t.taskIDtoIndex[e.data.taskId],n=t.tasks[i];n&&(yield(0,a.gz)(m.eX.questTaskCompleted(n)))},badge_rewarded:function*(e){yield(0,a.gz)(m.eX.badgeRewarded(e.data.badgeId))},backpack_item_added:function*(e){let t=e.data,i=yield(0,a.Ys)(e=>e.reactQueryClient);t.type===W.qG.Emote&&i.invalidateQueries({queryKey:[es.uS]}),t.type===W.qG.Avatar&&i.invalidateQueries({queryKey:[ea.k]})},reload_webpage:function(){window.location.reload()},open_livestream_lightbox:function*(){if(!(yield(0,a.Ys)(e=>e.unity.appState.roomSession.room.crossInstanceStreamingEnabled)))return;let e=yield(0,a.Ys)(e=>e.unity.appState.roomSession.livestream.hlsPlaybackURL);if(!e)return;let t=yield(0,a.Ys)(e=>e.hls.urlToMediaStream);t&&t[e]&&(yield(0,a.gz)(m.eX.openSpaceModal({type:"LivestreamLightbox"})))},open_popup_with_url:function(e){let t=e.data,i=window.screenX,n=window.screenY,o=window.outerWidth,r=window.outerHeight,a=`width=600,height=900,left=${i+o/2-300},top=${n+r/2-450},scrollbars=yes,resizable=yes`;window.open(t,"SpatialPopup",a)},jumped_through_portal:function*(e){let t=yield(0,a.Ys)(e=>e.space.pathPrefix),i=yield(0,a.Ys)(e=>e.canvas.enableRtcInEmbed);yield(0,a.gz)(m.eX.setSpaceJoinContext({method:W.$t.UserJumpedThroughPortal}));let n=(0,ec.xR)({pathPrefix:t,id:e.data.roomId,slug:e.data.roomSlug,enableRtcInEmbed:i});eo().push(n)}},ew=new M.nZ("UnityBridge");function*eO(e){let t=JSON.parse(e),i=ek[t.name];if(!i){j.k.error(ew,"Unhandled message",{message:t});return}yield(0,a.RE)(i,t)}let eT=()=>{let e=ey.K.fetch(ey.K.STORAGE_LOCAL_LOG_LEVEL_KEY,-1),t=ey.K.fetch(ey.K.STORAGE_REMOTE_LOG_LEVEL_KEY,-1);e>=0&&d.setLocalLogLevel(e),t>=0&&d.setRemoteLogLevel(t)}
1;function*eD(e){let t=yield(0,a.Ys)(m.aC.getSelectedPixelRatio),i=parseFloat(e.get("pixel_ratio"));for(i&&(t=i),t>1&&(t=1),yield(0,a.gz)(m.eX.setMediaSettings({selectedPixelRatio:t}));;)-1===t?(d.setCameraPixelRatio(1),d.enableAutoCameraPixelRatio()):(d.setCameraPixelRatio(t),d.disableAutoCameraPixelRatio()),[t]=yield*(0,u.Sq)(m.aC.getSelectedPixelRatio)}let eI=e=>{let t=parseFloat(e.get("framerate"));t&&d.setFramerateSettings(t,0)},eR=e=>{let t=parseInt(e.get("anti_aliasing"));t&&d.setAntiAliasing(t)};function*eP(){let e=e=>el.S2(e.unity.appState),t=new Set,i=yield(0,a.Ys)(e);for(;;){let n=yield(0,a.Ys)(e=>e.unity.appState.roomSession.inRoomAndFullyParticipating),o=new Set;for(let[e,r]of Object.entries(i)){let i=`unity-${e}`;if(o.add(i),(r.category!==W.OE.InRoomOnly||n)&&!t.has(i)){let e=r.messages.join("\n");(0,ep.A)(e,{closeButton:!1,dismissible:!1,duration:1/0,id:i})}}for(let e of t)o.has(e)||ep.A.dismiss(e);t=o,[i]=yield*(0,u.Sq)(e)}}function eN(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function eE(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?eN(Object(i),!0).forEach(function(t){(0,r.Z)(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):eN(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}let eA=new M.nZ("UnityDownload");function*eL(e,t){let i="pre-download-unity",n=`${i}-start`;t&&performance.mark(n),yield(0,a.RE)(et,e),yield(0,a.gz)(m.eX.setUnityDownloadState(g.r5.Done)),h.Q8(),performance.measure("DownloadUnity","DownloadUnity-start"),t&&performance.measure(i,n)}function*ex(e,t,i){"production"!==x.default.DEPLOYMENT_ENV&&(window.UnityMessages=d),window.spatialWebGLCreateMicrophone=(e,t,i,n)=>new X(e,t,i,n),window.chrome&&"undefined"!=typeof RTCPeerConnection?window.globalRTCAudioLoopback=new Y:window.globalRTCAudioLoopback=null,window.spatialWebGLCreateAudioSource=(e,t,i)=>new U(e,t,i),window.spatialWebGLCreateVideoSource=q.oS,window.spatialWebGLDestroyVideoSource=q.Bt,window.spatialWebGLSetVideoPaused=q.yx,window.spatialWebGLSetVideoPlaybackTime=q.LP,window.spatialWebGLSetVideoVolume=q.BV,window.spatialWebGLSetVideoLoops=q.fV,window.spatialWebGLAzureSpeech={init:e=>w(e),provideStopCallback:e=>O(e),isLoaded:()=>T(),startListening:(e,t,i,n,o)=>D(e,t,i,n,o),stopListening:()=>I(),isContinuousRecognitionStarted:()=>R(),pauseContinuousRecognition:()=>P(),resumeContinuousRecognition:()=>N(),addLanguage:e=>E(e),removeLanguage:e=>A(e),setMicrophone:e=>L(e)},window.spatialWebGLStartSentryTransaction=e=>s.Yr({name:e});let n=(0,l.GG)(e=>(window.ReactUnityWebGL={MessageToReact:t=>e(t)},()=>{window.ReactUnityWebGL.MessageToReact=e=>{let t;try{t=JSON.parse(e),delete t.data}catch{}j.k.error("Message sent from Unity after the channel was closed.",t)}}),l.Ef.expanding()),o=eE(eE({},e),{},{companyName:"Spatial Systems, Inc.",productName:"Spatial",devicePixelRatio:window.devicePixelRatio,print:e=>{j.k.debug(`Unity message: ${e}`)},printErr:e=>{if(e instanceof Error?j.k.error("Unity error:",e):j.k.error(`Unity error: ${e}`),"out of memory"===e){let e=Error("SPATIAL_UNITY_OUT_OF_MEMORY");s.Tb(e,{level:"fatal"}),null===p.Ko||void 0===p.Ko||(0,p.Ko)()}},matchWebGLToCanvasSize:!0,startupErrorHandler:eM("SPATIAL_UNITY_FATAL_STARTUP_EXCEPTION"),errorHandler:eM("SPATIAL_UNITY_FATAL_EXCEPTION")});j.k.debug(eA,"Unity instance parameters",o);let r="unity-download-and-boot",_=`${r}-start`;performance.mark(_),performance.mark("DownloadUnity-start"),yield(0,a.gz)(m.eX.setUnityDownloadState(g.r5.InProgress));let f=yield(0,a.Ys)(e=>!e.unity.shouldStart);yield(0,a.RE)(eL,e,f),yield*(0,u.Xs)(e=>e.unity.shouldStart),performance.mark("BootUnity-start");let y=yield(0,a.RE)(t,i,o);performance.measure("BootUnity","BootUnity-start"),performance.measure(r,_),h.ll(),yield(0,a.RE)(d.setMessageSender,e=>{let t=JSON.stringify(e);y.SendMessage("UnityMessageManager","onRNMessage",t)}),yield(0,a.rM)(c.Y6,n,eO),yield(0,a.rM)(eP)}function eM(e){return function(t){if(!s.eW()){let i=Error(e);i.stack=t,s.Tb(i,{level:"fatal"})}return null===p.Ko||void 0===p.Ko||(0,p.Ko)(),!0}}}}]);

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.