t2-mapper/docs/_next/static/chunks/1fe5719635cf5984.js
2026-03-09 12:38:40 -07:00

1 line
No EOL
20 KiB
JavaScript

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29055,e=>{"use strict";var t=e.i(43476),n=e.i(71645),i=e.i(15080),a=e.i(71753),r=e.i(90072),o=e.i(12979),s=e.i(51434),l=e.i(79123),u=e.i(89887);e.i(13876);var c=e.i(58647);let m=new Map,d=new Map;function f(e,t=1){d.set(e,t)}function p(e){d.delete(e)}let h=0;function S(){return h}function g(){for(let[e]of(h++,d)){try{e.stop()}catch{}try{e.disconnect()}catch{}}d.clear()}function y(e,t){let n=t(e),i=n?.filename;if(!i)return null;let a=i.endsWith(".wav")?i:`${i}.wav`,r=n.description,o=null!=r?t(r):void 0,s=o?.is3D??!0,l=o?.isLooping??!1,u=o?.referenceDistance??20;return{filename:a,is3D:s,isLooping:l,refDist:u,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function T(e,t,n,i,a){let s;try{s=(0,o.audioToUrl)(e.filename)}catch{return}let l=c.engineStore.getState().playback.rate,u=h;I(s,n,n=>{if(u===h)try{if(e.is3D&&a){let o=new r.PositionalAudio(t);o.setBuffer(n),o.setDistanceModel("inverse"),o.setRefDistance(e.refDist),o.setMaxDistance(e.maxDist),o.setRolloffFactor(1),o.setVolume(e.volume),o.setPlaybackRate(l),i&&o.position.copy(i),a.add(o),d.set(o,1),o.play(),o.source.onended=()=>{d.delete(o);try{o.disconnect()}catch{}a.remove(o)}}else{let i=new r.Audio(t);i.setBuffer(n),i.setVolume(e.volume),i.setPlaybackRate(l),d.set(i,1),i.play(),i.source.onended=()=>{d.delete(i);try{i.disconnect()}catch{}}}}catch{}})}function I(e,t,n){m.has(e)?n(m.get(e)):t.load(e,t=>{m.set(e,t),n(t)},void 0,t=>{console.error("Audio load error",e,t)})}c.engineStore.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of d)try{t.setPlaybackRate(n*e)}catch{}});let w=(0,n.memo)(function({entity:e}){let{debugMode:c}=(0,l.useDebug)(),m=e.audioFileName??"",d=e.audioVolume??1,f=e.audioMinDistance??1,p=e.audioMaxDistance??1,h=e.audioMinLoopGap??0,S=e.audioMaxLoopGap??0,g=e.audioIs3D??!0?1:0,y=e.audioIsLooping??!0,[T,w,A]=e.position??[0,0,0],{scene:M,camera:k}=(0,i.useThree)(),{audioLoader:N,audioListener:v}=(0,s.useAudio)(),{audioEnabled:b}=(0,l.useSettings)(),x=(0,n.useRef)(null),R=(0,n.useRef)(null),_=(0,n.useRef)(null),L=(0,n.useRef)(!1),C=(0,n.useRef)(!1),O=(0,n.useRef)(new r.Vector3(T,w,A)),E=(0,n.useRef)(0),D=()=>{null!=R.current&&(clearTimeout(R.current),R.current=null),null!=_.current&&(clearTimeout(_.current),_.current=null)};(0,n.useEffect)(()=>{let e;if(N&&v){if(E.current++,g){let t=new r.PositionalAudio(v);t.position.copy(O.current),t.setDistanceModel("inverse"),t.setRefDistance(f),t.setMaxDistance(p),t.setRolloffFactor(1),t.setVolume(d),e=t,M.add(e)}else(e=new r.Audio(v)).setVolume(d);return x.current=e,()=>{D();try{e.stop()}catch{}try{e.disconnect()}catch{}g&&M.remove(e),x.current=null,L.current=!1,C.current=!1}}},[N,v,g,f,p,d,M]);let P=(e,t)=>{if(y)if(h>0||S>0){let n=Math.max(0,h),i=Math.max(n,S),a=n===i?n:Math.random()*(i-n)+n;e.loop=!1;let r=()=>{t===E.current&&(!1===e.isPlaying?R.current=setTimeout(()=>{if(t===E.current)try{e.play(),P(e,t)}catch{}},a):_.current=setTimeout(r,100))};_.current=setTimeout(r,100)}else e.setLoop(!0)},F=e=>{if(!N)return;let t=E.current;if(L.current)try{e.isPlaying||(e.play(),P(e,t))}catch{}else{let n;try{n=(0,o.audioToUrl)(m)}catch{return}I(n,N,n=>{if(t===E.current&&!e.buffer){e.setBuffer(n),L.current=!0;try{e.play(),P(e,t)}catch{}}})}};return(0,n.useEffect)(()=>{let e=x.current;e&&!g&&b&&m&&F(e)},[b,g,m,N,v]),(0,a.useFrame)(()=>{let e=x.current;if(!e||!g||!b||!m)return;let t=k.position.distanceTo(O.current),n=C.current,i=t<=p;if(i&&!n)C.current=!0,F(e);else if(!i&&n){C.current=!1,D();try{e.stop()}catch{}}}),(0,n.useEffect)(()=>{let e=x.current;if(e&&!b){D();try{e.stop()}catch{}C.current=!1}},[b]),c?(0,t.jsxs)("mesh",{position:O.current,children:[(0,t.jsx)("sphereGeometry",{args:[f,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:"#00ff00",wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,t.jsx)(u.FloatingLabel,{color:"#00ff00",position:[0,f+1,0],children:m})]}):null});e.s(["AudioEmitter",0,w,"audioBufferCache",0,m,"getCachedAudioBuffer",()=>I,"getSoundGeneration",()=>S,"playOneShotSound",()=>T,"resolveAudioProfile",()=>y,"stopAllTrackedSounds",()=>g,"trackSound",()=>f,"untrackSound",()=>p])},9721,e=>{"use strict";var t=e.i(43476),n=e.i(932),i=e.i(71645),a=e.i(71753),r=e.i(90072),o=e.i(82816),s=e.i(85557);class l{states;seqIndexToName;currentStateIndex=0;delayTime=0;lastFireCount=-1;spinTimeScale=0;constructor(e,t){this.states=e,this.seqIndexToName=t,e.length>0&&(this.delayTime=e[0].timeoutValue??0)}get stateIndex(){return this.currentStateIndex}reset(){this.currentStateIndex=0,this.delayTime=this.states.length>0?this.states[0].timeoutValue??0:0,this.lastFireCount=-1}tick(e,t){if(0===this.states.length)return{sequenceName:null,isFiring:!1,spinTimeScale:0,reverse:!1,scaleAnimation:!1,timeoutValue:0,transitioned:!1,soundDataBlockIds:[],stateIndex:-1};let n=this.lastFireCount>=0&&t.fireCount!==this.lastFireCount;this.lastFireCount=t.fireCount;let i=[];if(n){let e=this.states.findIndex(e=>e.fire);if(e>=0&&e!==this.currentStateIndex){this.currentStateIndex=e,this.delayTime=this.states[e].timeoutValue??0;let t=this.states[e].soundDataBlockId;t>=0&&i.push(t)}}this.delayTime-=e;let a=n,r=this.evaluateTickTransitions(t),o=0;for(;r>=0&&o<32;){if(o++,a=!0,r===this.currentStateIndex){this.delayTime=this.states[r].timeoutValue??0;break}let e=this.states[this.currentStateIndex].spin,n=this.delayTime;this.currentStateIndex=r;let s=this.states[r].timeoutValue??0;this.delayTime=s;let l=this.states[r].soundDataBlockId;switch(l>=0&&i.push(l),this.states[r].spin){case 1:this.spinTimeScale=0;break;case 4:this.spinTimeScale=1;break;case 2:3===e&&s>0&&(this.delayTime*=1-n/s);break;case 3:2===e&&s>0&&(this.delayTime*=1-n/s)}r=this.evaluateEntryTransitions(t)}let s=this.states[this.currentStateIndex],l=s.timeoutValue??0;switch(s.spin){case 1:this.spinTimeScale=0;break;case 2:this.spinTimeScale=l>0?Math.max(0,1-this.delayTime/l):1;break;case 4:this.spinTimeScale=1;break;case 3:this.spinTimeScale=l>0?Math.max(0,this.delayTime/l):0}return{sequenceName:this.resolveSequenceName(s),isFiring:s.fire,spinTimeScale:this.spinTimeScale,reverse:!s.direction,scaleAnimation:s.scaleAnimation,timeoutValue:s.timeoutValue??0,transitioned:a,soundDataBlockIds:i,stateIndex:this.currentStateIndex}}evaluateTickTransitions(e){let t=this.states[this.currentStateIndex],n=this.delayTime<=0;if(!(n||!t.waitForTimeout))return -1;let i=this.evaluateConditions(t,e);if(-1!==i)return i;if(n){let e=t.transitionOnTimeout;if(-1!==e)return e}return -1}evaluateEntryTransitions(e){let t=this.states[this.currentStateIndex];return this.evaluateConditions(t,e)}evaluateConditions(e,t){let n=t.loaded?e.transitionOnLoaded:e.transitionOnNotLoaded;if(-1!==n)return n;let i=t.ammo?e.transitionOnAmmo:e.transitionOnNoAmmo;if(-1!==i)return i;let a=t.target?e.transitionOnTarget:e.transitionOnNoTarget;if(-1!==a)return a;let r=t.wet?e.transitionOnWet:e.transitionOnNotWet;if(-1!==r)return r;let o=t.triggerDown?e.transitionOnTriggerDown:e.transitionOnTriggerUp;return -1!==o?o:-1}resolveSequenceName(e){return null==e.sequence||e.sequence<0?null:this.seqIndexToName[e.sequence]??null}}var u=e.i(43595),c=e.i(91907),m=e.i(87297),d=e.i(51434),f=e.i(29055),p=e.i(12979),h=e.i(79123);e.i(13876);var S=e.i(58647),g=e.i(93784);let y=["root","run","back","side","fall","jump","land"];function T(e,t,n){let i=e.current;if(i){(0,f.untrackSound)(i);try{i.stop()}catch{}try{i.disconnect()}catch{}n?.remove(i),e.current=null,t.current=-1}}function I(e){let l,d,f,p,h,T,I,b,x,R,_,L,C,O,E,D,P,F,B,q,V=(0,n.c)(47),{entity:j}=e,W=(0,S.useEngineStoreApi)(),U=j.shapeName??j.dataBlock,G=(0,c.useStaticShape)(U);V[0]!==U?(l=e=>{let t=U?.toLowerCase();return t?e.runtime.sequenceAliases.get(t):void 0},V[0]=U,V[1]=l):l=V[1];let Y=(0,S.useEngineSelector)(l);V[2]!==G.scene?(h=o.clone(G.scene),d=(0,s.processShapeScene)(h),h.traverse(N),p=new r.AnimationMixer(h),f=null,h.traverse(e=>{f||"Mount0"!==e.name||(f=e)}),V[2]=G.scene,V[3]=d,V[4]=f,V[5]=p,V[6]=h):(d=V[3],f=V[4],p=V[5],h=V[6]),V[7]!==d||V[8]!==f||V[9]!==p||V[10]!==h?(T={clonedScene:h,mixer:p,mount0:f,iflInitializers:d},V[7]=d,V[8]=f,V[9]=p,V[10]=h,V[11]=T):T=V[11];let{clonedScene:z,mixer:K,mount0:H,iflInitializers:$}=T;V[12]===Symbol.for("react.memo_cache_sentinel")?(I=new Map,V[12]=I):I=V[12];let J=(0,i.useRef)(I);V[13]===Symbol.for("react.memo_cache_sentinel")?(b={head:null,headside:null},V[13]=b):b=V[13];let Q=(0,i.useRef)(b);V[14]===Symbol.for("react.memo_cache_sentinel")?(x=new Map,V[14]=x):x=V[14];let X=(0,i.useRef)(x),Z=(0,i.useRef)(null);V[15]===Symbol.for("react.memo_cache_sentinel")?(R={name:"root",timeScale:1},V[15]=R):R=V[15];let ee=(0,i.useRef)(R),et=(0,i.useRef)(!1),en=(0,i.useRef)(void 0);if(V[16]!==W||V[17]!==U){e:{let e=W.getState().playback,t=e.recording?.streamingPlayback,n=U?.toLowerCase();if(!t||!n){let e;V[19]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,V[19]=e):e=V[19],_=e;break e}let i=t.getShapeConstructorSequences(n);if(!i){let e;V[20]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,V[20]=e):e=V[20],_=e;break e}_=function(e,t){let n=new Map,i=[];for(let n of e){let e=n.indexOf(" ");if(-1===e)continue;let a=n.slice(0,e).toLowerCase(),r=n.slice(e+1).trim().toLowerCase();if(!r||!a.startsWith(t)||!a.endsWith(".dsq"))continue;let o=a.slice(t.length,-4);o&&i.push({clipName:o,alias:r})}let a=new Set;for(let e=0;e<y.length;e++){let t=y[e];for(let r=0;r<i.length;r++)if(i[r].alias===t){a.add(r),n.set(e,i[r]);break}}let r=7;for(let e=0;e<i.length;e++)!a.has(e)&&(n.set(r,i[e]),r++);return n}(i,n.replace(/\.dts$/i,"")+"_")}V[16]=W,V[17]=U,V[18]=_}else _=V[18];let ei=_;V[21]!==G.animations||V[22]!==K||V[23]!==Y?(L=()=>{let e=(0,u.getAliasedActions)(G.animations,K,Y);J.current=e;let t=e.get("root");t&&t.play(),ee.current={name:"root",timeScale:1};let n={head:null,headside:null};for(let{key:e,names:t}of[{key:"head",names:["head"]},{key:"headside",names:["headside"]}]){let i=G.animations.find(e=>t.includes(e.name.toLowerCase()));if(!i)continue;let a=i.clone(),o=Math.round(30*i.duration/2);r.AnimationUtils.makeClipAdditive(a,o,i,30);let s=K.clipAction(a);s.blendMode=r.AdditiveAnimationBlendMode,s.timeScale=0,s.weight=1,s.play(),n[e]=s}Q.current=n;let i=new Map,a=G.animations.find(k),o=a?Math.round(30*a.duration/2):0;for(let e of["lookde","lookms","looksn"]){let t=G.animations.find(t=>t.name.toLowerCase()===e);if(!t)continue;let n=t.clone(),s=a??t;r.AnimationUtils.makeClipAdditive(n,o,s,30);let l=K.clipAction(n);l.blendMode=r.AdditiveAnimationBlendMode,l.timeScale=0,l.weight=0,l.play(),i.set(e,l)}X.current=i;let s=i.get("lookde");return s&&(s.weight=1,Z.current="lookde"),K.update(0),()=>{K.stopAllAction(),J.current=new Map,Q.current={head:null,headside:null},X.current=new Map,Z.current=null}},C=[K,G.animations,Y],V[21]=G.animations,V[22]=K,V[23]=Y,V[24]=L,V[25]=C):(L=V[24],C=V[25]),(0,i.useEffect)(L,C),V[26]!==$?(O=()=>{let e=[];for(let{mesh:t,initialize:n}of $)n(t,M).then(t=>e.push(t)).catch(A);return()=>e.forEach(w)},E=[$],V[26]=$,V[27]=O,V[28]=E):(O=V[27],E=V[28]),(0,i.useEffect)(O,E);let ea=(0,i.useRef)(j.weaponShape),[er,eo]=(0,i.useState)(j.weaponShape);return V[29]!==ei||V[30]!==W||V[31]!==j.headPitch||V[32]!==j.headYaw||V[33]!==j.keyframes||V[34]!==j.weaponShape||V[35]!==K?(D=(e,t)=>{j.weaponShape!==ea.current&&(ea.current=j.weaponShape,eo(j.weaponShape));let n=W.getState().playback,i="playing"===n.status,a=g.streamPlaybackStore.getState().time,o=(0,s.getKeyframeAtTime)(j.keyframes??[],a),l=o?.damageState!=null&&o.damageState>=1,u=J.current;if(l&&!et.current){et.current=!0;let e=null!=o.actionAnim?ei.get(o.actionAnim):void 0;if(e){let t=u.get(e.clipName);if(t){let n=u.get(ee.current.name.toLowerCase());n&&n.fadeOut(s.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(s.ANIM_TRANSITION_TIME).play(),ee.current={name:e.clipName,timeScale:1},en.current=o.actionAnim}}}if(!l&&et.current){et.current=!1,en.current=void 0;let e=u.get(ee.current.name.toLowerCase());e&&(e.stop(),e.setLoop(r.LoopRepeat,1/0),e.clampWhenFinished=!1),ee.current={name:"root",timeScale:1};let t=u.get("root");t&&t.reset().play()}let c=o?.actionAnim,m=en.current;if(!et.current&&c!==m){en.current=c;let e=null!=m&&m>=7;if(null!=c&&c>=7){let e=ei.get(c);if(e){let t=u.get(e.clipName);if(t){let n=u.get(ee.current.name.toLowerCase());n&&n.fadeOut(s.ANIM_TRANSITION_TIME),t.setLoop(r.LoopOnce,1),t.clampWhenFinished=!0,t.reset().fadeIn(s.ANIM_TRANSITION_TIME).play(),ee.current={name:e.clipName,timeScale:1}}}}else if(e){let e=ei.get(m);if(e){let t=u.get(e.clipName);t&&(t.fadeOut(s.ANIM_TRANSITION_TIME),t.setLoop(r.LoopRepeat,1/0),t.clampWhenFinished=!1)}ee.current={name:"root",timeScale:1};let t=u.get("root");t&&t.reset().fadeIn(s.ANIM_TRANSITION_TIME).play()}}if(null!=c&&c>=7&&o?.actionAtEnd){let e=ei.get(c);if(e){let t=u.get(e.clipName);t&&(t.paused=!0)}}let d=null!=en.current&&en.current>=7;if(!et.current&&!d){let e=function(e,t){if(!e)return{animation:"root",timeScale:1};let[n,i,a]=e;if(a<-10)return{animation:"fall",timeScale:1};let r=-2*Math.atan2(t[1],t[3]),o=Math.cos(r),s=Math.sin(r),l=n*o+i*s,u=-n*s+i*o,c=-u,m=-l,d=Math.max(u,c,m,l);return d<.1?{animation:"root",timeScale:1}:d===u?{animation:"run",timeScale:1}:d===c?{animation:"back",timeScale:1}:d===m?{animation:"side",timeScale:1}:{animation:"side",timeScale:-1}}(o?.velocity,o?.rotation??[0,0,0,1]),t=ee.current;if(e.animation!==t.name||e.timeScale!==t.timeScale){let n=u.get(t.name.toLowerCase()),a=u.get(e.animation.toLowerCase());a&&(i&&n&&n!==a?(n.fadeOut(s.ANIM_TRANSITION_TIME),a.reset().fadeIn(s.ANIM_TRANSITION_TIME).play()):(n&&n!==a&&n.stop(),a.reset().play()),a.timeScale=e.timeScale,ee.current={name:e.animation,timeScale:e.timeScale})}}let f=function(e){if(!e)return"lookde";let t=e.toLowerCase();return t.includes("missile")?"lookms":t.includes("sniper")?"looksn":"lookde"}(j.weaponShape);if(f!==Z.current){let e=X.current,t=Z.current?e.get(Z.current):null,n=e.get(f);n&&(t&&(t.weight=0),n.weight=+!l,Z.current=f)}let{head:p,headside:h}=Q.current,S=Z.current?X.current.get(Z.current):null,y=+!l,T=j.headPitch??0,I=j.headYaw??0,w=(T+1)/2;S&&(S.time=w*S.getClip().duration,S.weight=y),p&&(p.time=w*p.getClip().duration,p.weight=y),h&&(h.time=(I+1)/2*h.getClip().duration,h.weight=y),i?K.update(t*n.rate):K.update(0)},V[29]=ei,V[30]=W,V[31]=j.headPitch,V[32]=j.headYaw,V[33]=j.keyframes,V[34]=j.weaponShape,V[35]=K,V[36]=D):D=V[36],(0,a.useFrame)(D),V[37]===Symbol.for("react.memo_cache_sentinel")?(P=[0,Math.PI/2,0],V[37]=P):P=V[37],V[38]!==z?(F=(0,t.jsx)("group",{rotation:P,children:(0,t.jsx)("primitive",{object:z})}),V[38]=z,V[39]=F):F=V[39],V[40]!==er||V[41]!==j||V[42]!==H?(B=er&&H&&(0,t.jsx)(m.ShapeErrorBoundary,{fallback:null,children:(0,t.jsx)(i.Suspense,{fallback:null,children:(0,t.jsx)(v,{entity:j,weaponShape:er,mount0:H})})},er),V[40]=er,V[41]=j,V[42]=H,V[43]=B):B=V[43],V[44]!==F||V[45]!==B?(q=(0,t.jsxs)(t.Fragment,{children:[F,B]}),V[44]=F,V[45]=B,V[46]=q):q=V[46],q}function w(e){return e()}function A(){}function M(){return g.streamPlaybackStore.getState().time}function k(e){return"lookde"===e.name.toLowerCase()}function N(e){if(e.isMesh&&e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.side=r.FrontSide}function v(e){let t,u,m,g,y,I,w,A,M,k,N,v,_,L,C=(0,n.c)(38),{entity:O,weaponShape:E,mount0:D}=e,P=(0,S.useEngineStoreApi)(),F=(0,c.useStaticShape)(E);if(C[0]!==F.animations||C[1]!==F.scene){t=o.clone(F.scene),u=(0,s.processShapeScene)(t);let e=(0,s.getPosedNodeTransform)(F.scene,F.animations,"Mountpoint");if(e){let n=e.quaternion.clone().invert(),i=e.position.clone().negate().applyQuaternion(n);t.position.copy(i),t.quaternion.copy(n)}g=new Map,t.traverse(e=>{if(!e.isMesh)return;let t=e.userData,n=(t?.vis_sequence??"").toLowerCase();if(!n)return;let i=g.get(n);i||(i=[],g.set(n,i)),i.push(e)}),m=new r.AnimationMixer(t),C[0]=F.animations,C[1]=F.scene,C[2]=t,C[3]=u,C[4]=m,C[5]=g}else t=C[2],u=C[3],m=C[4],g=C[5];let B=m,q=F.scene;C[6]!==q||C[7]!==F.animations?(y=function(e,t){let n=e.userData?.dts_sequence_names;if("string"==typeof n)try{return JSON.parse(n).map(e=>e.toLowerCase())}catch{}return t.map(e=>e.name.toLowerCase())}(q,F.animations),C[6]=q,C[7]=F.animations,C[8]=y):y=C[8];let V=y;C[9]!==t||C[10]!==u||C[11]!==B||C[12]!==V||C[13]!==g?(I={weaponClone:t,weaponMixer:B,seqIndexToName:V,visNodesBySequence:g,weaponIflInitializers:u},C[9]=t,C[10]=u,C[11]=B,C[12]=V,C[13]=g,C[14]=I):I=C[14];let{weaponClone:j,weaponMixer:W,seqIndexToName:U,visNodesBySequence:G,weaponIflInitializers:Y}=I;C[15]===Symbol.for("react.memo_cache_sentinel")?(w=new Map,C[15]=w):w=C[15];let z=(0,i.useRef)(w),K=(0,i.useRef)(null);C[16]!==F.animations||C[17]!==W?(A=()=>{let e=new Map;for(let t of F.animations)e.set(t.name.toLowerCase(),W.clipAction(t));z.current=e;let t=e.get("spin");return t&&(t.setLoop(r.LoopRepeat,1/0),t.timeScale=0,t.play()),K.current=t??null,W.update(0),()=>{W.stopAllAction(),z.current=new Map,K.current=null,T(et,en)}},M=[W,F.animations],C[16]=F.animations,C[17]=W,C[18]=A,C[19]=M):(A=C[18],M=C[19]),(0,i.useEffect)(A,M),C[20]!==Y?(k=()=>{let e=[];for(let{mesh:t,initialize:n}of Y)n(t,R).then(t=>e.push(t)).catch(x);return()=>e.forEach(b)},N=[Y],C[20]=Y,C[21]=k,C[22]=N):(k=C[21],N=C[22]),(0,i.useEffect)(k,N);let{audioLoader:H,audioListener:$}=(0,d.useAudio)(),J=(0,h.useSettings)(),Q=J?.audioEnabled??!1,X=(0,i.useRef)(null),Z=(0,i.useRef)(null),ee=(0,i.useRef)(O.weaponImageStates),et=(0,i.useRef)(null),en=(0,i.useRef)(-1);return C[23]!==D||C[24]!==j?(v=()=>(D.add(j),()=>{D.remove(j)}),_=[j,D],C[23]=D,C[24]=j,C[25]=v,C[26]=_):(v=C[25],_=C[26]),(0,i.useEffect)(v,_),C[27]!==Q||C[28]!==$||C[29]!==H||C[30]!==P||C[31]!==O.weaponImageState||C[32]!==O.weaponImageStates||C[33]!==U||C[34]!==G||C[35]!==j||C[36]!==W?(L=(e,t)=>{let n=P.getState().playback,i="playing"===n.status,a=z.current,o=O.weaponImageState,u=O.weaponImageStates;u!==ee.current&&(ee.current=u,u&&u.length>0?X.current=new l(u,U):X.current=null,Z.current=null,T(et,en,j)),!X.current&&u&&u.length>0&&(X.current=new l(u,U));let c=X.current;if(c&&o&&i){let e=t*n.rate,i=c.tick(e,o);if(function(e,t,n,i){let a=e.sequenceName,o=n.current;if(a===o&&!e.transitioned)return;if(a!==o){if(o){let e=i.get(o);if(e)for(let t of e)t.visible=!1}if(a){let e=i.get(a);if(e)for(let t of e)t.visible=!0}}if(!a){if(o){let e=t.get(o);e&&e.fadeOut(s.ANIM_TRANSITION_TIME),n.current=null}return}let l=t.get(a);if(l&&(e.transitioned||a!==o)){let i=o?t.get(o):null;if(e.isFiring||e.timeoutValue>0?(l.setLoop(r.LoopOnce,1),l.clampWhenFinished=!0):(l.setLoop(r.LoopRepeat,1/0),l.clampWhenFinished=!1),e.scaleAnimation&&e.timeoutValue>0){let t=l.getClip().duration;l.timeScale=t>0?t/e.timeoutValue:1}else l.timeScale=e.reverse?-1:1;i&&i!==l?(i.fadeOut(s.ANIM_TRANSITION_TIME),l.reset().fadeIn(s.ANIM_TRANSITION_TIME).play()):l.reset().play(),n.current=a}}(i,a,Z,G),et.current&&i.stateIndex!==en.current&&T(et,en,j),Q&&H&&$&&i.soundDataBlockIds.length>0){let e=n.recording?.streamingPlayback.getDataBlockData.bind(n.recording.streamingPlayback);if(e)for(let t of i.soundDataBlockIds){let i=(0,f.resolveAudioProfile)(t,e);if(i)if(i.isLooping){if(!et.current)try{let e=(0,p.audioToUrl)(i.filename),t=(0,f.getSoundGeneration)();(0,f.getCachedAudioBuffer)(e,H,e=>{if(t!==(0,f.getSoundGeneration)()||et.current)return;let a=c.stateIndex,o=new r.PositionalAudio($);o.setBuffer(e),o.setDistanceModel("inverse"),o.setRefDistance(i.refDist),o.setMaxDistance(i.maxDist),o.setRolloffFactor(1),o.setVolume(i.volume),o.setPlaybackRate(n.rate),o.setLoop(!0),j.add(o),(0,f.trackSound)(o),o.play(),et.current=o,en.current=a})}catch{}}else(0,f.playOneShotSound)(i,$,H,void 0,j)}}K.current&&(K.current.timeScale=i.spinTimeScale)}i?W.update(t*n.rate):W.update(0)},C[27]=Q,C[28]=$,C[29]=H,C[30]=P,C[31]=O.weaponImageState,C[32]=O.weaponImageStates,C[33]=U,C[34]=G,C[35]=j,C[36]=W,C[37]=L):L=C[37],(0,a.useFrame)(L),null}function b(e){return e()}function x(){}function R(){return g.streamPlaybackStore.getState().time}function _(e){let t,a,r=(0,n.c)(7),{shapeName:o,eyeOffsetRef:l}=e,u=(0,c.useStaticShape)(o);return r[0]!==l||r[1]!==u.animations||r[2]!==u.scene?(t=()=>{let e=(0,s.getPosedNodeTransform)(u.scene,u.animations,"Eye");e?l.current.set(e.position.z,e.position.y,-e.position.x):l.current.set(0,s.DEFAULT_EYE_HEIGHT,0)},r[0]=l,r[1]=u.animations,r[2]=u.scene,r[3]=t):t=r[3],r[4]!==l||r[5]!==u?(a=[u,l],r[4]=l,r[5]=u,r[6]=a):a=r[6],(0,i.useEffect)(t,a),null}e.s(["PlayerEyeOffset",()=>_,"PlayerModel",()=>I],9721)}]);