PageSourceSearch

https://rapidassets.ai/assets/RigAnimatePanel-DnAHxl20.js

js rapidassets.ai collected 2026-10-04 20:05:53 UTC 69,997 bytes, 153 lines download raw bytes

vendor: 30,541 bytes, lines 1-86
1var na=Object.defineProperty;var ia=(n,t,a)=>t in n?na(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var pe=(n,t,a)=>ia(n,typeof t!="symbol"?t+"":t,a);import{R as lt,M as Zr,I as sa,S as Cr,D as oa,a as ct,H as Ue,F as ze,b as rr,L as Pe,c as mr,d as la,C as $e,e as ut,O as ca,P as dt,W as ht,U as Mr,f as ua,g as da,h as Pr,T as tr,i as ha,j as ga,B as pa,k as fa,l as Hr,m as gt,n as ma,o as va,p as nt,q as wa,r as Sr,V as er,N as _a,u as nr,s as M,t as Ir,v as xa,E as ya,w as ba,x as Ea,y as $r,z as Sa,A as pt,_ as ft,G as it,J as Ma,K as Wr,Q as Ia,X as Ca,Y as Ra,Z as Ta,$ as Aa,a0 as st,a1 as Fa,a2 as Na,a3 as Ua,a4 as v,a5 as yr,a6 as ka,a7 as Ar,a8 as Oa,a9 as Fr,aa as Nr,ab as Ur,ac as Ba,ad as Da,ae as La,af as kr,ag as Or,ah as Br,ai as Dr,aj as dr,ak as ja,al as Pa,am as mt,an as Ha,ao as za,ap as Ga}from"./index-DgKwvKuy.js";import{M as Za}from"./MeshStatsChip-PuYa5e_v.js";const vt=parseInt(lt.replace(/\D+/g,""));var Ne=Uint8Array,We=Uint16Array,zr=Uint32Array,wt=new Ne([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_t=new Ne([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),$a=new Ne([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xt=function(n,t){for(var a=new We(31),s=0;s<31;++s)a[s]=t+=1<<n[s-1];for(var l=new zr(a[30]),s=1;s<30;++s)for(var h=a[s];h<a[s+1];++h)l[h]=h-a[s]<<5|s;return[a,l]},yt=xt(wt,2),bt=yt[0],Wa=yt[1];bt[28]=258,Wa[258]=28;var Xa=xt(_t,0),Ya=Xa[0],Gr=new We(32768);for(var ce=0;ce<32768;++ce){var Ze=(ce&43690)>>>1|(ce&21845)<<1;Ze=(Ze&52428)>>>2|(Ze&13107)<<2,Ze=(Ze&61680)>>>4|(Ze&3855)<<4,Gr[ce]=((Ze&65280)>>>8|(Ze&255)<<8)>>>1}var fr=function(n,t,a){for(var s=n.length,l=0,h=new We(t);l<s;++l)++h[n[l]-1];var c=new We(t);for(l=0;l<t;++l)c[l]=c[l-1]+h[l-1]<<1;var p;if(a){p=new We(1<<t);var g=15-t;for(l=0;l<s;++l)if(n[l])for(var w=l<<4|n[l],R=t-n[l],T=c[n[l]-1]++<<R,A=T|(1<<R)-1;T<=A;++T)p[Gr[T]>>>g]=w}else for(p=new We(s),l=0;l<s;++l)n[l]&&(p[l]=Gr[c[n[l]-1]++]>>>15-n[l]);return p},wr=new Ne(288);for(var ce=0;ce<144;++ce)wr[ce]=8;for(var ce=144;ce<256;++ce)wr[ce]=9;for(var ce=256;ce<280;++ce)wr[ce]=7;for(var ce=280;ce<288;++ce)wr[ce]=8;var Et=new Ne(32);for(var ce=0;ce<32;++ce)Et[ce]=5;var Va=fr(wr,9,1),qa=fr(Et,5,1),Lr=function(n){for(var t=n[0],a=1;a<n.length;++a)n[a]>t&&(t=n[a]);return t},Oe=function(n,t,a){var s=t/8|0;return(n[s]|n[s+1]<<8)>>(t&7)&a},jr=function(n,t){var a=t/8|0;return(n[a]|n[a+1]<<8|n[a+2]<<16)>>(t&7)},Ja=function(n){return(n/8|0)+(n&7&&1)},Ka=function(n,t,a){(a==null||a>n.length)&&(a=n.length);var s=new(n instanceof We?We:n instanceof zr?zr:Ne)(a-t);return s.set(n.subarray(t,a)),s},Qa=function(n,t,a){var s=n.length;if(!s||a&&!a.l&&s<5)return t||new Ne(0);var l=!t||a,h=!a||a.i;a||(a={}),t||(t=new Ne(s*3));var c=function(H){var _e=t.length;if(H>_e){var ke=new Ne(Math.max(_e*2,H));ke.set(t),t=ke}},p=a.f||0,g=a.p||0,w=a.b||0,R=a.l,T=a.d,A=a.m,G=a.n,P=s*8;do{if(!R){a.f=p=Oe(n,g,1);var he=Oe(n,g+1,3);if(g+=3,he)if(he==1)R=Va,T=qa,A=9,G=5;else if(he==2){var te=Oe(n,g,31)+257,ue=Oe(n,g+10,15)+4,Y=te+Oe(n,g+5,31)+1;g+=14;for(var j=new Ne(Y),ie=new Ne(19),E=0;E<ue;++E)ie[$a[E]]=Oe(n,g+E*3,7);g+=ue*3;for(var I=Lr(ie),D=(1<<I)-1,q=fr(ie,I,1),E=0;E<Y;){var k=q[Oe(n,g,D)];g+=k&15;var $=k>>>4;if($<16)j[E++]=$;else{var Z=0,U=0;for($==16?(U=3+Oe(n,g,3),g+=2,Z=j[E-1]):$==17?(U=3+Oe(n,g,7),g+=3):$==18&&(U=11+Oe(n,g,127),g+=7);U--;)j[E++]=Z}}var Q=j.subarray(0,te),L=j.subarray(te);A=Lr(Q),G=Lr(L),R=fr(Q,A,1),T=fr(L,G,1)}else throw"invalid block type";else{var $=Ja(g)+4,J=n[$-4]|n[$-3]<<8,K=$+J;if(K>s){if(h)throw"unexpected EOF";break}l&&c(w+J),t.set(n.subarray($,K),w),a.b=w+=J,a.p=g=K*8;continue}if(g>P){if(h)throw"unexpected EOF";break}}l&&c(w+131072);for(var Se=(1<<A)-1,Be=(1<<G)-1,Me=g;;Me=g){var Z=R[jr(n,g)&Se],re=Z>>>4;if(g+=Z&15,g>P){if(h)throw"unexpected EOF";break}if(!Z)throw"invalid length/literal";if(re<256)t[w++]=re;else if(re==256){Me=g,R=null;break}else{var De=re-254;if(re>264){var E=re-257,V=wt[E];De=Oe(n,g,(1<<V)-1)+bt[E],g+=V}var O=T[jr(n,g)&Be],me=O>>>4;if(!O)throw"invalid distance";g+=O&15;var L=Ya[me];if(me>3){var V=_t[me];L+=jr(n,g)&(1<<V)-1,g+=V}if(g>P){if(h)throw"unexpected EOF";break}l&&c(w+131072);for(var Ie=w+De;w<Ie;w+=4)t[w]=t[w-L],t[w+1]=t[w+1-L],t[w+2]=t[w+2-L],t[w+3]=t[w+3-L];w=Ie}}a.l=R,a.p=Me,a.b=w,R&&(p=1,a.m=A,a.d=T,a.n=G)}while(!p);return w==t.length?t:Ka(t,0,w)},en=new Ne(0),rn=function(n){if((n[0]&15)!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)throw"invalid zlib data";if(n[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function br(n,t){return Qa((rn(n),n.subarray(2,-4)),t)}var tn=typeof TextDecoder<"u"&&new TextDecoder,an=0;try{tn.decode(en,{stream:!0}),an=1}catch{}const nn=n=>n&&n.isCubeTexture;class sn extends Zr{constructor(t,a){var s,l;const h=nn(t),p=((l=h?(s=t.image[0])==null?void 0:s.width:t.image.width)!=null?l:1024)/4,g=Math.floor(Math.log2(p)),w=Math.pow(2,g),R=3*Math.max(w,16*7),T=4*w,A=[h?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/R}`,`#define CUBEUV_TEXEL_HEIGHT ${1/T}`,`#define CUBEUV_MAX_MIP ${g}.0`],G=`
2        varying vec3 vWorldPosition;
3        void main() 
4        {
5            vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );
6            vWorldPosition = worldPosition.xyz;
7            
8            gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
9        }
10        `,P=A.join(`
11`)+`
12        #define ENVMAP_TYPE_CUBE_UV
13        varying vec3 vWorldPosition;
14        uniform float radius;
15        uniform float height;
16        uniform float angle;
17        #ifdef ENVMAP_TYPE_CUBE
18            uniform samplerCube map;
19        #else
20            uniform sampler2D map;
21        #endif
22        // From: https://www.shadertoy.com/view/4tsBD7
23        float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) 
24        {
25            float d = dot ( rd, n );
26            
27            if( d > 0.0 ) { return 1e6; }
28            
29            vec3  o = ro - c;
30            float t = - dot( n, o ) / d;
31            vec3  q = o + rd * t;
32            
33            return ( dot( q, q ) < r * r ) ? t : 1e6;
34        }
35        // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm
36        float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) 
37        {
38            vec3 oc = ro - ce;
39            float b = dot( oc, rd );
40            float c = dot( oc, oc ) - ra * ra;
41            float h = b * b - c;
42            
43            if( h < 0.0 ) { return -1.0; }
44            
45            h = sqrt( h );
46            
47            return - b + h;
48        }
49        vec3 project() 
50        {
51            vec3 p = normalize( vWorldPosition );
52            vec3 camPos = cameraPosition;
53            camPos.y -= height;
54            float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );
55            if( intersection > 0.0 ) {
56                
57                vec3 h = vec3( 0.0, - height, 0.0 );
58                float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );
59                p = ( camPos + min( intersection, intersection2 ) * p ) / radius;
60            } else {
61                p = vec3( 0.0, 1.0, 0.0 );
62            }
63            return p;
64        }
65        #include <common>
66        #include <cube_uv_reflection_fragment>
67        void main() 
68        {
69            vec3 projectedWorldPosition = project();
70            
71            #ifdef ENVMAP_TYPE_CUBE
72                vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;
73            #else
74                vec3 direction = normalize( projectedWorldPosition );
75                vec2 uv = equirectUv( direction );
76                vec3 outcolor = texture2D( map, uv ).rgb;
77            #endif
78            gl_FragColor = vec4( outcolor, 1.0 );
79            #include <tonemapping_fragment>
80            #include <${vt>=154?"colorspace_fragment":"encodings_fragment"}>
81        }
82        `,he={map:{value:t},height:{value:(a==null?void 0:a.height)||15},radius:{value:(a==null?void 0:a.radius)||100}},$=new sa(1,16),J=new Cr({uniforms:he,fragmentShader:P,vertexShader:G,side:oa});super($,J)}set radius(t){this.material.uniforms.radius.value=t}get radius(){return this.material.uniforms.radius.value}set height(t){this.material.uniforms.height.value=t}get height(){return this.material.uniforms.height.value}}class on extends ct{constructor(t){super(t),this.type=Ue}parse(t){const c=function(E,I){switch(E){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(I||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(I||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(I||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(I||""))}},R=`
83`,T=function(E,I,D){I=I||1024;let k=E.pos,Z=-1,U=0,Q="",L=String.fromCharCode.apply(null,new Uint16Array(E.subarray(k,k+128)));for(;0>(Z=L.indexOf(R))&&U<I&&k<E.byteLength;)Q+=L,U+=L.length,k+=128,L+=String.fromCharCode.apply(null,new Uint16Array(E.subarray(k,k+128)));return-1<Z?(E.pos+=U+Z+1,Q+L.slice(0,Z)):!1},A=function(E){const I=/^#\?(\S+)/,D=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,q=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,k=/^\s*FORMAT=(\S+)\s*$/,Z=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,U={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let Q,L;for((E.pos>=E.byteLength||!(Q=T(E)))&&c(1,"no header found"),(L=Q.match(I))||c(3,"bad initial token"),U.valid|=1,U.programtype=L[1],U.string+=Q+`
84`;Q=T(E),Q!==!1;){if(U.string+=Q+`
85`,Q.charAt(0)==="#"){U.comments+=Q+`
86`;continue}if((L=Q.match(D))&&(U.gamma=parseFloat(L[1])),(L=Q.match(q))&&(U.exposure=parseFloat(L[1])),(L=Q.match(k))&&(U.valid|=2,U.format=L[1]),(L=Q.match(Z))&&(U.valid|=4,U.height=parseInt(L[1],10),U.width=parseInt(L[2],10)),U.valid&2&&U.valid&4)break}return U.valid&2||c(3,"missing format specifier"),U.valid&4||c(3,"missing image size specifier"),U},G=function(E,I,D){const q=I;if(q<8||q>32767||E[0]!==2||E[1]!==2||E[2]&128)return new Uint8Array(E);q!==(E[2]<<8|E[3])&&c(3,"wrong scanline width");const k=new Uint8Array(4*I*D);k.length||c(4,"unable to allocate buffer space");let Z=0,U=0;const Q=4*q,L=new Uint8Array(4),Se=new Uint8Array(Q);let Be=D;for(;Be>0&&U<E.byteLength;){U+4>E.byteLength&&c(1),L[0]=E[U++],L[1]=E[U++],L[2]=E[U++],L[3]=E[U++],(L[0]!=2||L[1]!=2||(L[2]<<8|L[3])!=q)&&c(3,"bad rgbe scanline format");let Me=0,re;for(;Me<Q&&U<E.byteLength;){re=E[U++];const V=re>128;if(V&&(re-=128),(re===0||Me+re>Q)&&c(3,"bad scanline data"),V){const O=E[U++];for(let me=0;me<re;me++)Se[Me++]=O}else Se.set(E.subarray(U,U+re),Me),Me+=re,U+=re}const De=q;for(let V=0;V<De;V++){let O=0;k[Z]=Se[V+O],O+=q,k[Z+1]=Se[V+O],O+=q,k[Z+2]=Se[V+O],O+=q,k[Z+3]=Se[V+O],Z+=4}Be--}return k},P=function(E,I,D,q){const k=E[I+3],Z=Math.pow(2,k-128)/255;D[q+0]=E[I+0]*Z,D[q+1]=E[I+1]*Z,D[q+2]=E[I+2]*Z,D[q+3]=1},he=function(E,I,D,q){const k=E[I+3],Z=Math.pow(2,k-128)/255;D[q+0]=rr.toHalfFloat(Math.min(E[I+0]*Z,65504)),D[q+1]=rr.toHalfFloat(Math.min(E[I+1]*Z,65504)),D[q+2]=rr.toHalfFloat(Math.min(E[I+2]*Z,65504)),D[q+3]=rr.toHalfFloat(1)},$=new Uint8Array(t);$.pos=0;const J=A($),K=J.width,te=J.height,ue=G($.subarray($.pos),K,te);let Y,j,ie;switch(this.type){case ze:ie=ue.length/4;const E=new Float32Array(ie*4);for(let D=0;D<ie;D++)P(ue,D*4,E,D*4);Y=E,j=ze;break;case Ue:ie=ue.length/4;const I=new Uint16Array(ie*4);for(let D=0;D<ie;D++)he(ue,D*4,I,D*4);Y=I,j=Ue;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:K,height:te,data:Y,header:J.string,gamma:J.gamma,exposure:J.exposure,type:j}}setDataType(t){return this.type=t,this}load(t,a,s,l){function h(c,p){switch(c.type){case ze:case Ue:"colorSpace"in c?c.colorSpace="srgb-linear":c.encoding=3e3,c.minFilter=Pe,c.magFilter=Pe,c.generateMipmaps=!1,c.flipY=!0;break}a&&a(c,p)}return super.load(t,h,s,l)}}const hr=vt>=152;class ln extends ct{constructor(t){super(t),this.type=Ue}parse(t){const I=Math.pow(2.7182818,2.2);function D(e,r){for(var i=0,o=0;o<65536;++o)(o==0||e[o>>3]&1<<(o&7))&&(r[i++]=o);for(var u=i-1;i<65536;)r[i++]=0;return u}function q(e){for(var r=0;r<16384;r++)e[r]={},e[r].len=0,e[r].lit=0,e[r].p=null}const k={l:0,c:0,lc:0};function Z(e,r,i,o,u){for(;i<e;)r=r<<8|tt(o,u),i+=8;i-=e,k.l=r>>i&(1<<e)-1,k.c=r,k.lc=i}const U=new Array(59);function Q(e){for(var r=0;r<=58;++r)U[r]=0;for(var r=0;r<65537;++r)U[e[r]]+=1;for(var i=0,r=58;r>0;--r){var o=i+U[r]>>1;U[r]=i,i=o}for(var r=0;r<65537;++r){var u=e[r];u>0&&(e[r]=u|U[u]++<<6)}}function L(e,r,i,o,u,d,_){for(var m=i,b=0,y=0;u<=d;u++){if(m.value-i.value>o)return!1;Z(6,b,y,e,m);var S=k.l;if(b=k.c,y=k.lc,_[u]=S,S==63){if(m.value-i.value>o)throw"Something wrong with hufUnpackEncTable";Z(8,b,y,e,m);var x=k.l+6;if(b=k.c,y=k.lc,u+x>d+1)throw"Something wrong with hufUnpackEncTable";for(;x--;)_[u++]=0;u--}else if(S>=59){var x=S-59+2;if(u+x>d+1)throw"Something wrong with hufUnpackEncTable";for(;x--;)_[u++]=0;u--}}Q(_)}function Se(e){return e&63}function Be(e){return e>>6}function Me(e,r,i,o){for(;r<=i;r++){var u=Be(e[r]),d=Se(e[r]);if(u>>d)throw"Invalid table entry";if(d>14){var _=o[u>>d-14];if(_.len)throw"Invalid table entry";if(_.lit++,_.p){var m=_.p;_.p=new Array(_.lit);for(var b=0;b<_.lit-1;++b)_.p[b]=m[b]}else _.p=new Array(1);_.p[_.lit-1]=r}else if(d)for(var y=0,b=1<<14-d;b>0;b--){var _=o[(u<<14-d)+y];if(_.len||_.p)throw"Invalid table entry";_.len=d,_.lit=r,y++}}return!0}const re={c:0,lc:0};function De(e,r,i,o){e=e<<8|tt(i,o),r+=8,re.c=e,re.lc=r}const V={c:0,lc:0};function O(e,r,i,o,u,d,_,m,b,y){if(e==r){o<8&&(De(i,o,u,_),i=re.c,o=re.lc),o-=8;var S=i>>o,S=new Uint8Array([S])[0];if(b.value+S>y)return!1;for(var x=m[b.value-1];S-- >0;)m[b.value++]=x}else if(b.value<y)m[b.value++]=e;else return!1;V.c=i,V.lc=o}function me(e){return e&65535}function Ie(e){var r=me(e);return r>32767?r-65536:r}const H={a:0,b:0};function _e(e,r){var i=Ie(e),o=Ie(r),u=o,d=i+(u&1)+(u>>1),_=d,m=d-u;H.a=_,H.b=m}function ke(e,r){var i=me(e),o=me(r),u=i-(o>>1)&65535,d=o+u-32768&65535;H.a=d,H.b=u}function f(e,r,i,o,u,d,_){for(var m=_<16384,b=i>u?u:i,y=1,S;y<=b;)y<<=1;for(y>>=1,S=y,y>>=1;y>=1;){for(var x=0,ge=x+d*(u-S),F=d*y,N=d*S,B=o*y,z=o*S,ae,se,ve,Ee;x<=ge;x+=N){for(var oe=x,je=x+o*(i-S);oe<=je;oe+=z){var le=oe+B,we=oe+F,He=we+B;m?(_e(e[oe+r],e[we+r]),ae=H.a,ve=H.b,_e(e[le+r],e[He+r]),se=H.a,Ee=H.b,_e(ae,se),e[oe+r]=H.a,e[le+r]=H.b,_e(ve,Ee),e[we+r]=H.a,e[He+r]=H.b):(ke(e[oe+r],e[we+r]),ae=H.a,ve=H.b,ke(e[le+r],e[He+r]),se=H.a,Ee=H.b,ke(ae,se),e[oe+r]=H.a,e[le+r]=H.b,ke(ve,Ee),e[we+r]=H.a,e[He+r]=H.b)}if(i&y){var we=oe+F;m?_e(e[oe+r],e[we+r]):ke(e[oe+r],e[we+r]),ae=H.a,e[we+r]=H.b,e[oe+r]=ae}}if(u&y)for(var oe=x,je=x+o*(i-S);oe<=je;oe+=z){var le=oe+B;m?_e(e[oe+r],e[le+r]):ke(e[oe+r],e[le+r]),ae=H.a,e[le+r]=H.b,e[oe+r]=ae}S=y,y>>=1}return x}function W(e,r,i,o,u,d,_,m,b,y){for(var S=0,x=0,ge=m,F=Math.trunc(u.value+(d+7)/8);u.value<F;)for(De(S,x,i,u),S=re.c,x=re.lc;x>=14;){var N=S>>x-14&16383,B=r[N];if(B.len)x-=B.len,O(B.lit,_,S,x,i,o,u,b,y,ge),S=V.c,x=V.lc;else{if(!B.p)throw"hufDecode issues";var z;for(z=0;z<B.lit;z++){for(var ae=Se(e[B.p[z]]);x<ae&&u.value<F;)De(S,x,i,u),S=re.c,x=re.lc;if(x>=ae&&Be(e[B.p[z]])==(S>>x-ae&(1<<ae)-1)){x-=ae,O(B.p[z],_,S,x,i,o,u,b,y,ge),S=V.c,x=V.lc;break}}if(z==B.lit)throw"hufDecode issues"}}var se=8-d&7;for(S>>=se,x-=se;x>0;){var B=r[S<<14-x&16383];if(B.len)x-=B.len,O(B.lit,_,S,x,i,o,u,b,y,ge),S=V.c,x=V.lc;else throw"hufDecode issues"}return!0}function fe(e,r,i,o,u,d){var _={value:0},m=i.value,b=Ce(r,i),y=Ce(r,i);i.value+=4;var S=Ce(r,i);if(i.value+=4,b<0||b>=65537||y<0||y>=65537)throw"Something wrong with HUF_ENCSIZE";var x=new Array(65537),ge=new Array(16384);q(ge);var F=o-(i.value-m);if(L(e,r,i,F,b,y,x),S>8*(o-(i.value-m)))throw"Something wrong with hufUncompress";Me(x,b,y,ge),W(x,ge,e,r,i,S,y,d,u,_)}function Xe(e,r,i){for(var o=0;o<i;++o)r[o]=e[r[o]]}function ir(e){for(var r=1;r<e.length;r++){var i=e[r-1]+e[r]-128;e[r]=i}}function be(e,r){for(var i=0,o=Math.floor((e.length+1)/2),u=0,d=e.length-1;!(u>d||(r[u++]=e[i++],u>d));)r[u++]=e[o++]}function Le(e){for(var r=e.byteLength,i=new Array,o=0,u=new DataView(e);r>0;){var d=u.getInt8(o++);if(d<0){var _=-d;r-=_+1;for(var m=0;m<_;m++)i.push(u.getUint8(o++))}else{var _=d;r-=2;for(var b=u.getUint8(o++),m=0;m<_+1;m++)i.push(b)}}return i}function Ve(e,r,i,o,u,d){var le=new DataView(d.buffer),_=i[e.idx[0]].width,m=i[e.idx[0]].height,b=3,y=Math.floor(_/8),S=Math.ceil(_/8),x=Math.ceil(m/8),ge=_-(S-1)*8,F=m-(x-1)*8,N={value:0},B=new Array(b),z=new Array(b),ae=new Array(b),se=new Array(b),ve=new Array(b);for(let ne=0;ne<b;++ne)ve[ne]=r[e.idx[ne]],B[ne]=ne<1?0:B[ne-1]+S*x,z[ne]=new Float32Array(64),ae[ne]=new Uint16Array(64),se[ne]=new Uint16Array(S*64);for(let ne=0;ne<x;++ne){var Ee=8;ne==x-1&&(Ee=F);var oe=8;for(let de=0;de<S;++de){de==S-1&&(oe=ge);for(let ee=0;ee<b;++ee)ae[ee].fill(0),ae[ee][0]=u[B[ee]++],qe(N,o,ae[ee]),Ut(ae[ee],z[ee]),kt(z[ee]);Ot(z);for(let ee=0;ee<b;++ee)Bt(z[ee],se[ee],de*64)}let ye=0;for(let de=0;de<b;++de){const ee=i[e.idx[de]].type;for(let Fe=8*ne;Fe<8*ne+Ee;++Fe){ye=ve[de][Fe];for(let Ye=0;Ye<y;++Ye){const Re=Ye*64+(Fe&7)*8;le.setUint16(ye+0*2*ee,se[de][Re+0],!0),le.setUint16(ye+1*2*ee,se[de][Re+1],!0),le.setUint16(ye+2*2*ee,se[de][Re+2],!0),le.setUint16(ye+3*2*ee,se[de][Re+3],!0),le.setUint16(ye+4*2*ee,se[de][Re+4],!0),le.setUint16(ye+5*2*ee,se[de][Re+5],!0),le.setUint16(ye+6*2*ee,se[de][Re+6],!0),le.setUint16(ye+7*2*ee,se[de][Re+7],!0),ye+=8*2*ee}}if(y!=S)for(let Fe=8*ne;Fe<8*ne+Ee;++Fe){const Ye=ve[de][Fe]+8*y*2*ee,Re=y*64+(Fe&7)*8;for(let Ge=0;Ge<oe;++Ge)le.setUint16(Ye+Ge*2*ee,se[de][Re+Ge],!0)}}}for(var je=new Uint16Array(_),le=new DataView(d.buffer),we=0;we<b;++we){i[e.idx[we]].decoded=!0;var He=i[e.idx[we]].type;if(i[we].type==2)for(var ur=0;ur<m;++ur){const ne=ve[we][ur];for(var Ae=0;Ae<_;++Ae)je[Ae]=le.getUint16(ne+Ae*2*He,!0);for(var Ae=0;Ae<_;++Ae)le.setFloat32(ne+Ae*2*He,C(je[Ae]),!0)}}}function qe(e,r,i){for(var o,u=1;u<64;)o=r[e.value],o==65280?u=64:o>>8==255?u+=o&255:(i[u]=o,u++),e.value++}function Ut(e,r){r[0]=C(e[0]),r[1]=C(e[1]),r[2]=C(e[5]),r[3]=C(e[6]),r[4]=C(e[14]),r[5]=C(e[15]),r[6]=C(e[27]),r[7]=C(e[28]),r[8]=C(e[2]),r[9]=C(e[4]),r[10]=C(e[7]),r[11]=C(e[13]),r[12]=C(e[16]),r[13]=C(e[26]),r[14]=C(e[29]),r[15]=C(e[42]),r[16]=C(e[3]),r[17]=C(e[8]),r[18]=C(e[12]),r[19]=C(e[17]),r[20]=C(e[25]),r[21]=C(e[30]),r[22]=C(e[41]),r[23]=C(e[43]),r[24]=C(e[9]),r[25]=C(e[11]),r[26]=C(e[18]),r[27]=C(e[24]),r[28]=C(e[31]),r[29]=C(e[40]),r[30]=C(e[44]),r[31]=C(e[53]),r[32]=C(e[10]),r[33]=C(e[19]),r[34]=C(e[23]),r[35]=C(e[32]),r[36]=C(e[39]),r[37]=C(e[45]),r[38]=C(e[52]),r[39]=C(e[54]),r[40]=C(e[20]),r[41]=C(e[22]),r[42]=C(e[33]),r[43]=C(e[38]),r[44]=C(e[46]),r[45]=C(e[51]),r[46]=C(e[55]),r[47]=C(e[60]),r[48]=C(e[21]),r[49]=C(e[34]),r[50]=C(e[37]),r[51]=C(e[47]),r[52]=C(e[50]),r[53]=C(e[56]),r[54]=C(e[59]),r[55]=C(e[61]),r[56]=C(e[35]),r[57]=C(e[36]),r[58]=C(e[48]),r[59]=C(e[49]),r[60]=C(e[57]),r[61]=C(e[58]),r[62]=C(e[62]),r[63]=C(e[63])}function kt(e){const r=.5*Math.cos(.7853975),i=.5*Math.cos(3.14159/16),o=.5*Math.cos(3.14159/8),u=.5*Math.cos(3*3.14159/16),d=.5*Math.cos(5*3.14159/16),_=.5*Math.cos(3*3.14159/8),m=.5*Math.cos(7*3.14159/16);for(var b=new Array(4),y=new Array(4),S=new Array(4),x=new Array(4),ge=0;ge<8;++ge){var F=ge*8;b[0]=o*e[F+2],b[1]=_*e[F+2],b[2]=o*e[F+6],b[3]=_*e[F+6],y[0]=i*e[F+1]+u*e[F+3]+d*e[F+5]+m*e[F+7],y[1]=u*e[F+1]-m*e[F+3]-i*e[F+5]-d*e[F+7],y[2]=d*e[F+1]-i*e[F+3]+m*e[F+5]+u*e[F+7],y[3]=m*e[F+1]-d*e[F+3]+u*e[F+5]-i*e[F+7],S[0]=r*(e[F+0]+e[F+4]),S[3]=r*(e[F+0]-e[F+4]),S[1]=b[0]+b[3],S[2]=b[1]-b[2],x[0]=S[0]+S[1],x[1]=S[3]+S[2],x[2]=S[3]-S[2],x[3]=S[0]-S[1],e[F+0]=x[0]+y[0],e[F+1]=x[1]+y[1],e[F+2]=x[2]+y[2],e[F+3]=x[3]+y[3],e[F+4]=x[3]-y[3],e[F+5]=x[2]-y[2],e[F+6]=x[1]-y[1],e[F+7]=x[0]-y[0]}for(var N=0;N<8;++N)b[0]=o*e[16+N],b[1]=_*e[16+N],b[2]=o*e[48+N],b[3]=_*e[48+N],y[0]=i*e[8+N]+u*e[24+N]+d*e[40+N]+m*e[56+N],y[1]=u*e[8+N]-m*e[24+N]-i*e[40+N]-d*e[56+N],y[2]=d*e[8+N]-i*e[24+N]+m*e[40+N]+u*e[56+N],y[3]=m*e[8+N]-d*e[24+N]+u*e[40+N]-i*e[56+N],S[0]=r*(e[N]+e[32+N]),S[3]=r*(e[N]-e[32+N]),S[1]=b[0]+b[3],S[2]=b[1]-b[2],x[0]=S[0]+S[1],x[1]=S[3]+S[2],x[2]=S[3]-S[2],x[3]=S[0]-S[1],e[0+N]=x[0]+y[0],e[8+N]=x[1]+y[1],e[16+N]=x[2]+y[2],e[24+N]=x[3]+y[3],e[32+N]=x[3]-y[3],e[40+N]=x[2]-y[2],e[48+N]=x[1]-y[1],e[56+N]=x[0]-y[0]}function Ot(e){for(var r=0;r<64;++r){var i=e[0][r],o=e[1][r],u=e[2][r];e[0][r]=i+1.5747*u,e[1][r]=i-.1873*o-.4682*u,e[2][r]=i+1.8556*o}}function Bt(e,r,i){for(var o=0;o<64;++o)r[i+o]=rr.toHalfFloat(Dt(e[o]))}function Dt(e){return e<=1?Math.sign(e)*Math.pow(Math.abs(e),2.2):Math.sign(e)*Math.pow(I,Math.abs(e)-1)}function et(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function Lt(e){var r=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),i=new Uint8Array(Le(r)),o=new Uint8Array(i.length);return ir(i),be(i,o),new DataView(o.buffer)}function Tr(e){var r=e.array.slice(e.offset.value,e.offset.value+e.size),i=br(r),o=new Uint8Array(i.length);return ir(i),be(i,o),new DataView(o.buffer)}function jt(e){for(var r=e.viewer,i={value:e.offset.value},o=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),u=new Uint8Array(8192),d=0,_=new Array(e.channels),m=0;m<e.channels;m++)_[m]={},_[m].start=d,_[m].end=_[m].start,_[m].nx=e.width,_[m].ny=e.lines,_[m].size=e.type,d+=_[m].nx*_[m].ny*_[m].size;var b=or(r,i),y=or(r,i);if(y>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(b<=y)for(var m=0;m<y-b+1;m++)u[m+b]=Je(r,i);var S=new Uint16Array(65536),x=D(u,S),ge=Ce(r,i);fe(e.array,r,i,ge,o,d);for(var m=0;m<e.channels;++m)for(var F=_[m],N=0;N<_[m].size;++N)f(o,F.start+N,F.nx,F.size,F.ny,F.nx*F.size,x);Xe(S,o,d);for(var B=0,z=new Uint8Array(o.buffer.byteLength),ae=0;ae<e.lines;ae++)for(var se=0;se<e.channels;se++){var F=_[se],ve=F.nx*F.size,Ee=new Uint8Array(o.buffer,F.end*2,ve*2);z.set(Ee,B),B+=ve*2,F.end+=ve}return new DataView(z.buffer)}function Pt(e){var r=e.array.slice(e.offset.value,e.offset.value+e.size),i=br(r);const o=e.lines*e.channels*e.width,u=e.type==1?new Uint16Array(o):new Uint32Array(o);let d=0,_=0;const m=new Array(4);for(let b=0;b<e.lines;b++)for(let y=0;y<e.channels;y++){let S=0;switch(e.type){case 1:m[0]=d,m[1]=m[0]+e.width,d=m[1]+e.width;for(let x=0;x<e.width;++x){const ge=i[m[0]++]<<8|i[m[1]++];S+=ge,u[_]=S,_++}break;case 2:m[0]=d,m[1]=m[0]+e.width,m[2]=m[1]+e.width,d=m[2]+e.width;for(let x=0;x<e.width;++x){const ge=i[m[0]++]<<24|i[m[1]++]<<16|i[m[2]++]<<8;S+=ge,u[_]=S,_++}break}}return new DataView(u.buffer)}function rt(e){var r=e.viewer,i={value:e.offset.value},o=new Uint8Array(e.width*e.lines*(e.channels*e.type*2)),u={version:Te(r,i),unknownUncompressedSize:Te(r,i),unknownCompressedSize:Te(r,i),acCompressedSize:Te(r,i),dcCompressedSize:Te(r,i),rleCompressedSize:Te(r,i),rleUncompressedSize:Te(r,i),rleRawSize:Te(r,i),totalAcUncompressedCount:Te(r,i),totalDcUncompressedCount:Te(r,i),acCompression:Te(r,i)};if(u.version<2)throw"EXRLoader.parse: "+cr.compression+" version "+u.version+" is unsupported";for(var d=new Array,_=or(r,i)-2;_>0;){var m=_r(r.buffer,i),b=Je(r,i),y=b>>2&3,S=(b>>4)-1,x=new Int8Array([S])[0],ge=Je(r,i);d.push({name:m,index:x,type:ge,compression:y}),_-=m.length+3}for(var F=cr.channels,N=new Array(e.channels),B=0;B<e.channels;++B){var z=N[B]={},ae=F[B];z.name=ae.name,z.compression=0,z.decoded=!1,z.type=ae.pixelType,z.pLinear=ae.pLinear,z.width=e.width,z.height=e.lines}for(var se={idx:new Array(3)},ve=0;ve<e.channels;++ve)for(var z=N[ve],B=0;B<d.length;++B){var Ee=d[B];z.name==Ee.name&&(z.compression=Ee.compression,Ee.index>=0&&(se.idx[Ee.index]=ve),z.offset=ve)}if(u.acCompressedSize>0)switch(u.acCompression){case 0:var le=new Uint16Array(u.totalAcUncompressedCount);fe(e.array,r,i,u.acCompressedSize,le,u.totalAcUncompressedCount);break;case 1:var oe=e.array.slice(i.value,i.value+u.totalAcUncompressedCount),je=br(oe),le=new Uint16Array(je.buffer);i.value+=u.totalAcUncompressedCount;break}if(u.dcCompressedSize>0){var we={array:e.array,offset:i,size:u.dcCompressedSize},He=new Uint16Array(Tr(we).buffer);i.value+=u.dcCompressedSize}if(u.rleRawSize>0){var oe=e.array.slice(i.value,i.value+u.rleCompressedSize),je=br(oe),ur=Le(je.buffer);i.value+=u.rleCompressedSize}for(var Ae=0,ne=new Array(N.length),B=0;B<ne.length;++B)ne[B]=new Array;for(var ye=0;ye<e.lines;++ye)for(var de=0;de<N.length;++de)ne[de].push(Ae),Ae+=N[de].width*e.type*2;Ve(se,ne,N,le,He,o);for(var B=0;B<N.length;++B){var z=N[B];if(!z.decoded)switch(z.compression){case 2:for(var ee=0,Fe=0,ye=0;ye<e.lines;++ye){for(var Ye=ne[B][ee],Re=0;Re<z.width;++Re){for(var Ge=0;Ge<2*z.type;++Ge)o[Ye++]=ur[Fe+Ge*z.width*z.height];Fe++}ee++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(o.buffer)}function _r(e,r){for(var i=new Uint8Array(e),o=0;i[r.value+o]!=0;)o+=1;var u=new TextDecoder().decode(i.slice(r.value,r.value+o));return r.value=r.value+o+1,u}function Ht(e,r,i){var o=new TextDecoder().decode(new Uint8Array(e).slice(r.value,r.value+i));return r.value=r.value+i,o}function zt(e,r){var i=sr(e,r),o=Ce(e,r);return[i,o]}function Gt(e,r){var i=Ce(e,r),o=Ce(e,r);return[i,o]}function sr(e,r){var i=e.getInt32(r.value,!0);return r.value=r.value+4,i}function Ce(e,r){var i=e.getUint32(r.value,!0);return r.value=r.value+4,i}function tt(e,r){var i=e[r.value];return r.value=r.value+1,i}function Je(e,r){var i=e.getUint8(r.value);return r.value=r.value+1,i}const Te=function(e,r){let i;return"getBigInt64"in DataView.prototype?i=Number(e.getBigInt64(r.value,!0)):i=e.getUint32(r.value+4,!0)+Number(e.getUint32(r.value,!0)<<32),r.value+=8,i};function xe(e,r){var i=e.getFloat32(r.value,!0);return r.value+=4,i}function Zt(e,r){return rr.toHalfFloat(xe(e,r))}function C(e){var r=(e&31744)>>10,i=e&1023;return(e>>15?-1:1)*(r?r===31?i?NaN:1/0:Math.pow(2,r-15)*(1+i/1024):6103515625e-14*(i/1024))}function or(e,r){var i=e.getUint16(r.value,!0);return r.value+=2,i}function $t(e,r){return C(or(e,r))}function Wt(e,r,i,o){for(var u=i.value,d=[];i.value<u+o-1;){var _=_r(r,i),m=sr(e,i),b=Je(e,i);i.value+=3;var y=sr(e,i),S=sr(e,i);d.push({name:_,pixelType:m,pLinear:b,xSampling:y,ySampling:S})}return i.value+=1,d}function Xt(e,r){var i=xe(e,r),o=xe(e,r),u=xe(e,r),d=xe(e,r),_=xe(e,r),m=xe(e,r),b=xe(e,r),y=xe(e,r);return{redX:i,redY:o,greenX:u,greenY:d,blueX:_,blueY:m,whiteX:b,whiteY:y}}function Yt(e,r){var i=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],o=Je(e,r);return i[o]}function Vt(e,r){var i=Ce(e,r),o=Ce(e,r),u=Ce(e,r),d=Ce(e,r);return{xMin:i,yMin:o,xMax:u,yMax:d}}function qt(e,r){var i=["INCREASING_Y"],o=Je(e,r);return i[o]}function Jt(e,r){var i=xe(e,r),o=xe(e,r);return[i,o]}function Kt(e,r){var i=xe(e,r),o=xe(e,r),u=xe(e,r);return[i,o,u]}function Qt(e,r,i,o,u){if(o==="string"||o==="stringvector"||o==="iccProfile")return Ht(r,i,u);if(o==="chlist")return Wt(e,r,i,u);if(o==="chromaticities")return Xt(e,i);if(o==="compression")return Yt(e,i);if(o==="box2i")return Vt(e,i);if(o==="lineOrder")return qt(e,i);if(o==="float")return xe(e,i);if(o==="v2f")return Jt(e,i);if(o==="v3f")return Kt(e,i);if(o==="int")return sr(e,i);if(o==="rational")return zt(e,i);if(o==="timecode")return Gt(e,i);if(o==="preview")return i.value+=u,"skipped";i.value+=u}function ea(e,r,i){const o={};if(e.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";o.version=e.getUint8(4);const u=e.getUint8(5);o.spec={singleTile:!!(u&2),longName:!!(u&4),deepFormat:!!(u&8),multiPart:!!(u&16)},i.value=8;for(var d=!0;d;){var _=_r(r,i);if(_==0)d=!1;else{var m=_r(r,i),b=Ce(e,i),y=Qt(e,r,i,m,b);y===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${m}'.`):o[_]=y}}if(u&-5)throw console.error("EXRHeader:",o),"THREE.EXRLoader: provided file is currently unsupported.";return o}function ra(e,r,i,o,u){const d={size:0,viewer:r,array:i,offset:o,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:e.channels[0].pixelType,uncompress:null,getter:null,format:null,[hr?"colorSpace":"encoding"]:null};switch(e.compression){case"NO_COMPRESSION":d.lines=1,d.uncompress=et;break;case"RLE_COMPRESSION":d.lines=1,d.uncompress=Lt;break;case"ZIPS_COMPRESSION":d.lines=1,d.uncompress=Tr;break;case"ZIP_COMPRESSION":d.lines=16,d.uncompress=Tr;break;case"PIZ_COMPRESSION":d.lines=32,d.uncompress=jt;break;case"PXR24_COMPRESSION":d.lines=16,d.uncompress=Pt;break;case"DWAA_COMPRESSION":d.lines=32,d.uncompress=rt;break;case"DWAB_COMPRESSION":d.lines=256,d.uncompress=rt;break;default:throw"EXRLoader.parse: "+e.compression+" is unsupported"}if(d.scanlineBlockSize=d.lines,d.type==1)switch(u){case ze:d.getter=$t,d.inputSize=2;break;case Ue:d.getter=or,d.inputSize=2;break}else if(d.type==2)switch(u){case ze:d.getter=xe,d.inputSize=4;break;case Ue:d.getter=Zt,d.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+d.type+" for "+e.compression+".";d.blockCount=(e.dataWindow.yMax+1)/d.scanlineBlockSize;for(var _=0;_<d.blockCount;_++)Te(r,o);d.outputChannels=d.channels==3?4:d.channels;const m=d.width*d.height*d.outputChannels;switch(u){case ze:d.byteArray=new Float32Array(m),d.channels<d.outputChannels&&d.byteArray.fill(1,0,m);break;case Ue:d.byteArray=new Uint16Array(m),d.channels<d.outputChannels&&d.byteArray.fill(15360,0,m);break;default:console.error("THREE.EXRLoader: unsupported type: ",u);break}return d.bytesPerLine=d.width*d.inputSize*d.channels,d.outputChannels==4?d.format=mr:d.format=la,hr?d.colorSpace="srgb-linear":d.encoding=3e3,d}const xr=new DataView(t),ta=new Uint8Array(t),lr={value:0},cr=ea(xr,t,lr),X=ra(cr,xr,ta,lr,this.type),at={value:0},aa={R:0,G:1,B:2,A:3,Y:0};for(let e=0;e<X.height/X.scanlineBlockSize;e++){const r=Ce(xr,lr);X.size=Ce(xr,lr),X.lines=r+X.scanlineBlockSize>X.height?X.height-r:X.scanlineBlockSize;const o=X.size<X.lines*X.bytesPerLine?X.uncompress(X):et(X);lr.value+=X.size;for(let u=0;u<X.scanlineBlockSize;u++){const d=u+e*X.scanlineBlockSize;if(d>=X.height)break;for(let _=0;_<X.channels;_++){const m=aa[cr.channels[_].name];for(let b=0;b<X.width;b++){at.value=(u*(X.channels*X.width)+_*X.width+b)*X.inputSize;const y=(X.height-1-d)*(X.width*X.outputChannels)+b*X.outputChannels+m;X.byteArray[y]=X.getter(o,at)}}}}return{header:cr,width:X.width,height:X.height,data:X.byteArray,format:X.format,[hr?"colorSpace":"encoding"]:X[hr?"colorSpace":"encoding"],type:this.t
86ype}}setDataType(t){return this.type=t,this}load(t,a,s,l){function h(c,p){hr?c.colorSpace=p.colorSpace:c.encoding=p.encoding,c.minFilter=Pe,c.magFilter=Pe,c.generateMipmaps=!1,c.flipY=!1,a&&a(c,p)}return super.load(t,h,s,l)}}const cn=()=>parseInt(lt.replace(/\D+/g,"")),un=cn(),dn=3e3,hn=3001,St=(n,t,a)=>{let s;switch(n){case Hr:s=new Uint8ClampedArray(t*a*4);break;case Ue:s=new Uint16Array(t*a*4);break;case fa:s=new Uint32Array(t*a*4);break;case pa:s=new Int8Array(t*a*4);break;case ga:s=new Int16Array(t*a*4);break;case ha:s=new Int32Array(t*a*4);break;case ze:s=new Float32Array(t*a*4);break;default:throw new Error("Unsupported data type")}return s};let Er;const gn=(n,t,a,s)=>{if(Er!==void 0)return Er;const l=new ht(1,1,s);t.setRenderTarget(l);const h=new Zr(new dt,new gt({color:16777215}));t.render(h,a),t.setRenderTarget(null);const c=St(n,l.width,l.height);return t.readRenderTargetPixels(l,0,0,l.width,l.height,c),l.dispose(),h.geometry.dispose(),h.material.dispose(),Er=c[0]!==0,Er};class Xr{constructor(t){pe(this,"_renderer");pe(this,"_rendererIsDisposable",!1);pe(this,"_material");pe(this,"_scene");pe(this,"_camera");pe(this,"_quad");pe(this,"_renderTarget");pe(this,"_width");pe(this,"_height");pe(this,"_type");pe(this,"_colorSpace");pe(this,"_supportsReadPixels",!0);pe(this,"render",()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(t){throw this._renderer.setRenderTarget(null),t}this._renderer.setRenderTarget(null)});var s,l,h,c,p,g,w,R,T,A,G,P,he,$,J,K;this._width=t.width,this._height=t.height,this._type=t.type,this._colorSpace
vendor: 5,193 bytes, line 86
86=t.colorSpace;const a={format:mr,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((s=t.renderTargetOptions)==null?void 0:s.anisotropy)!==void 0?(l=t.renderTargetOptions)==null?void 0:l.anisotropy:1,generateMipmaps:((h=t.renderTargetOptions)==null?void 0:h.generateMipmaps)!==void 0?(c=t.renderTargetOptions)==null?void 0:c.generateMipmaps:!1,magFilter:((p=t.renderTargetOptions)==null?void 0:p.magFilter)!==void 0?(g=t.renderTargetOptions)==null?void 0:g.magFilter:Pe,minFilter:((w=t.renderTargetOptions)==null?void 0:w.minFilter)!==void 0?(R=t.renderTargetOptions)==null?void 0:R.minFilter:Pe,samples:((T=t.renderTargetOptions)==null?void 0:T.samples)!==void 0?(A=t.renderTargetOptions)==null?void 0:A.samples:void 0,wrapS:((G=t.renderTargetOptions)==null?void 0:G.wrapS)!==void 0?(P=t.renderTargetOptions)==null?void 0:P.wrapS:$e,wrapT:((he=t.renderTargetOptions)==null?void 0:he.wrapT)!==void 0?($=t.renderTargetOptions)==null?void 0:$.wrapT:$e};if(this._material=t.material,t.renderer?this._renderer=t.renderer:(this._renderer=Xr.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new ut,this._camera=new ca,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!gn(this._type,this._renderer,this._camera,a)){let te;switch(this._type){case Ue:te=this._renderer.extensions.has("EXT_color_buffer_float")?ze:void 0;break}te!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${ze}`),this._type=te):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new Zr(new dt,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new ht(this.width,this.height,a),this._renderTarget.texture.mapping=((J=t.renderTargetOptions)==null?void 0:J.mapping)!==void 0?(K=t.renderTargetOptions)==null?void 0:K.mapping:Mr}static instantiateRenderer(){const t=new ua;return t.setSize(128,128),t}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const t=St(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,t),t}toDataTexture(t){const a=new da(this.toArray(),this.width,this.height,mr,this._type,(t==null?void 0:t.mapping)||Mr,(t==null?void 0:t.wrapS)||$e,(t==null?void 0:t.wrapT)||$e,(t==null?void 0:t.magFilter)||Pe,(t==null?void 0:t.minFilter)||Pe,(t==null?void 0:t.anisotropy)||1,Pr);return a.generateMipmaps=(t==null?void 0:t.generateMipmaps)!==void 0?t==null?void 0:t.generateMipmaps:!1,a}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(t){this.disposeOnDemandRenderer(),t&&this.renderTarget.dispose(),this.material instanceof Cr&&Object.values(this.material.uniforms).forEach(a=>{a.value instanceof tr&&a.value.dispose()}),Object.values(this.material).forEach(a=>{a instanceof tr&&a.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(t){this._width=t,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(t){this._height=t,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(t){this._renderTarget=t,this._width=t.width,this._height=t.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}class Mt extends Error{}class It extends Error{}const gr=(n,t,a)=>{const s=new RegExp(`${t}="([^"]*)"`,"i").exec(n);if(s)return s[1];const l=new RegExp(`<${t}[^>]*>([\\s\\S]*?)</${t}>`,"i").exec(n);if(l){const h=l[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return h&&h.length===3?h.map(c=>c.replace(/<\/?rdf:li>/g,"")):l[1].trim()}if(a!==void 0)return a;throw new Error(`Can't find ${t} in gainmap metadata`)},pn=n=>{let t;typeof TextDecoder<"u"?t=new TextDecoder().decode(n):t=n.toString();let a=t.indexOf("<x:xmpmeta");for(;a!==-1;){const s=t.indexOf("x:xmpmeta>",a),l=t.slice(a,s+10);try{const h=gr(l,"hdrgm:GainMapMin","0"),c=gr(l,"hdrgm:GainMapMax"),p=gr(l,"hdrgm:Gamma","1"),g=gr(l,"hdrgm:OffsetSDR","0.015625"),w=gr(l,"hdrgm:OffsetHDR","0.015625"),R=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(l),T=R?R[1]:"0",A=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(l);if(!A)throw new Error("Incomplete gainmap metadata");const G=A[1];return{gainMapMin:Array.isArray(h)?h.map(P=>parseFloat(P)):[parseFloat(h),parseFloat(h),parseFloat(h)],gainMapMax:Array.isArray(c)?c.map(P=>parseFloat(P)):[parseFloat(c),parseFloat(c),parseFloat(c)],gamma:Array.isArray(p)?p.map(P=>parseFloat(P)):[parseFloat(p),parseFloat(p),parseFloat(p)],offsetSdr:Array.isArray(g)?g.map(P=>parseFloat(P)):[parseFloat(g),parseFloat(g),parseFloat(g)],offsetHdr:Array.isArray(w)?w.map(P=>parseFloat(P)):[parseFloat(w),parseFloat(w),parseFloat(w)],hdrCapacityMin:parseFloat(T),hdrCapacityMax:p
vendor: 4,563 bytes, lines 86-91
86arseFloat(G)}}catch{}a=t.indexOf("<x:xmpmeta",s)}};class fn{constructor(t){pe(this,"options");this.options={debug:t&&t.debug!==void 0?t.debug:!1,extractFII:t&&t.extractFII!==void 0?t.extractFII:!0,extractNonFII:t&&t.extractNonFII!==void 0?t.extractNonFII:!0}}extract(t){return new Promise((a,s)=>{const l=this.options.debug,h=new DataView(t.buffer);if(h.getUint16(0)!==65496){s(new Error("Not a valid jpeg"));return}const c=h.byteLength;let p=2,g=0,w;for(;p<c;){if(++g>250){s(new Error(`Found no marker after ${g} loops 😵`));return}if(h.getUint8(p)!==255){s(new Error(`Not a valid marker at offset 0x${p.toString(16)}, found: 0x${h.getUint8(p).toString(16)}`));return}if(w=h.getUint8(p+1),l&&console.log(`Marker: ${w.toString(16)}`),w===226){l&&console.log("Found APP2 marker (0xffe2)");const R=p+4;if(h.getUint32(R)===1297106432){const T=R+4;let A;if(h.getUint16(T)===18761)A=!1;else if(h.getUint16(T)===19789)A=!0;else{s(new Error("No valid endianness marker found in TIFF header"));return}if(h.getUint16(T+2,!A)!==42){s(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const G=h.getUint32(T+4,!A);if(G<8){s(new Error("Not valid TIFF data! (First offset less than 8)"));return}const P=T+G,he=h.getUint16(P,!A),$=P+2;let J=0;for(let Y=$;Y<$+12*he;Y+=12)h.getUint16(Y,!A)===45057&&(J=h.getUint32(Y+8,!A));const te=P+2+he*12+4,ue=[];for(let Y=te;Y<te+J*16;Y+=16){const j={MPType:h.getUint32(Y,!A),size:h.getUint32(Y+4,!A),dataOffset:h.getUint32(Y+8,!A),dependantImages:h.getUint32(Y+12,!A),start:-1,end:-1,isFII:!1};j.dataOffset?(j.start=T+j.dataOffset,j.isFII=!1):(j.start=0,j.isFII=!0),j.end=j.start+j.size,ue.push(j)}if(this.options.extractNonFII&&ue.length){const Y=new Blob([h]),j=[];for(const ie of ue){if(ie.isFII&&!this.options.extractFII)continue;const E=Y.slice(ie.start,ie.end+1,"image/jpeg");j.push(E)}a(j)}}}p+=2+h.getUint16(p+2)}})}}const mn=async n=>{const t=pn(n);if(!t)throw new It("Gain map XMP metadata not found");const s=await new fn({extractFII:!0,extractNonFII:!0}).extract(n);if(s.length!==2)throw new Mt("Gain map recovery image not found");return{sdr:new Uint8Array(await s[0].arrayBuffer()),gainMap:new Uint8Array(await s[1].arrayBuffer()),metadata:t}},ot=n=>new Promise((t,a)=>{const s=document.createElement("img");s.onload=()=>{t(s)},s.onerror=l=>{a(l)},s.src=URL.createObjectURL(n)});class vn extends ma{constructor(a,s){super(s);pe(this,"_renderer");pe(this,"_renderTargetOptions");pe(this,"_internalLoadingManager");pe(this,"_config");this._config=a,a.renderer&&(this._renderer=a.renderer),this._internalLoadingManager=new va}setRenderer(a){return this._renderer=a,this}setRenderTargetOptions(a){return this._renderTargetOptions=a,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const a=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new tr,sdr:new tr});return this._config.createQuadRenderer({width:16,height:16,type:Ue,colorSpace:Pr,material:a,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(a,s,l){const h=s?new Blob([s],{type:"image/jpeg"}):void 0,c=new Blob([a],{type:"image/jpeg"});let p,g,w=!1;if(typeof createImageBitmap>"u"){const R=await Promise.all([h?ot(h):Promise.resolve(void 0),ot(c)]);g=R[0],p=R[1],w=l==="flipY"}else{const R=await Promise.all([h?createImageBitmap(h,{imageOrientation:l||"flipY"}):Promise.resolve(void 0),createImageBitmap(c,{imageOrientation:l||"flipY"})]);g=R[0],p=R[1]}return{sdrImage:p,gainMapImage:g,needsFlip:w}}createTextures(a,s,l){const h=new tr(s||new ImageData(2,2),Mr,$e,$e,Pe,nt,mr,Hr,1,Pr);h.flipY=l,h.needsUpdate=!0;const c=new tr(a,Mr,$e,$e,Pe,nt,mr,Hr,1,wa);return c.flipY=l,c.needsUpdate=!0,{gainMap:h,sdr:c}}updateQuadRenderer(a,s,l,h,c){a.width=s.width,a.height=s.height,a.material.gainMap=l,a.material.sdr=h,a.material.gainMapMin=c.gainMapMin,a.material.gainMapMax=c.gainMapMax,a.material.offsetHdr=c.offsetHdr,a.material.offsetSdr=c.offsetSdr,a.material.gamma=c.gamma,a.material.hdrCapacityMin=c.hdrCapacityMin,a.material.hdrCapacityMax=c.hdrCapacityMax,a.material.maxDisplayBoost=Math.pow(2,c.hdrCapacityMax),a.material.needsUpdate=!0}}const wn=`
87varying vec2 vUv;
88
89void main() {
90  vUv = uv;
91  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
91);
92}
93`,_n=`
94// min half float value
95#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 )
96// max half float value
97#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 )
98
99uniform sampler2D sdr;
100uniform sampler2D gainMap;
101uniform vec3 gamma;
102uniform vec3 offsetHdr;
103uniform vec3 offsetSdr;
104uniform vec3 gainMapMin;
105uniform vec3 gainMapMax;
106uniform float weightFactor;
107
108varying vec2 vUv;
109
110void main() {
111  vec3 rgb = texture2D( sdr, vUv ).rgb;
112  vec3 recovery = texture2D( gainMap, vUv ).rgb;
113  vec3 logRecovery = pow( recovery, gamma );
114  vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery;
115  vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr;
116  vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
117  gl_FragColor = vec4( clampedHdrColor , 1.0 );
118}
119`;class xn extends Cr{constructor({gamma:a,offsetHdr:s,offsetSdr:l,gainMapMin:h,gainMapMax:c,maxDisplayBoost:p,hdrCapacityMin:g,hdrCapacityMax:w,sdr:R,gainMap:T}){super({name:"GainMapDecoderMaterial",vertexShader:wn,fragmentShader:_n,uniforms:{sdr:{value:R},gainMap:{value:T},gamma:{value:new er(1/a[0],1/a[1],1/a[2])},offsetHdr:{value:new er().fromArray(s)},offsetSdr:{value:new er().fromArray(l)},gainMapMin:{value:new er().fromArray(h)},gainMapMax:{value:new er().fromArray(c)},weightFactor:{value:(Math.log2(p)-g)/(w-g)}},blending:_a,depthTest:!1,depthWrite:!1});pe(this,"_maxDisplayBoost");pe(this,"_hdrCapacityMin");pe(this,"_hdrCapacityMax");this._maxDisplayBoost=p,this._hdrCapacityMin=g,this._hdrCapacityMax=w,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(a){this.uniforms.sdr.value=a}get gainMap(){return this.uniforms.gainMap.value}set gainMap(a){this.uniforms.gainMap.value=a}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(a){this.uniforms.offsetHdr.value.fromArray(a)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(a){this.uniforms.offsetSdr.value.fromArray(a)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(a){this.uniforms.gainMapMin.value.fromArray(a)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(a){this.uniforms.gainMapMax.value.fromArray(a)}get gamma(){const a=this.uniforms.gamma.value;return[1/a.x,1/a.y,1/a.z]}set gamma(a){const s=this.uniforms.gamma.value;s.x=1/a[0],s.y=1/a[1],s.z=1/a[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(a){this._hdrCapacityMin=a,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(a){this._hdrCapacityMax=a,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(a){this._maxDisplayBoost=Math.max(1,Math.min(65504,a)),this.calculateWeight()}calculateWeight(){const a=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,a))}}class Ct extends vn{constructor(t,a){super({renderer:t,createMaterial:s=>new xn(s),createQuadRenderer:s=>new Xr(s)},a)}async render(t,a,s,l){const{sdrImage:h,gainMapImage:c,needsFlip:p}=await this.processImages(s,l,"flipY"),{gainMap:g,sdr:w}=this.createTextures(h,c,p);this.updateQuadRenderer(t,h,g,w,a),t.render()}}class yn extends Ct{load([t,a,s],l,h,c){const p=this.prepareQuadRenderer();let g,w,R;const T=async()=>{if(g&&w&&R){try{await this.render(p,R,g,w)}catch(I){this.manager.itemError(t),this.manager.itemError(a),this.manager.itemError(s),typeof c=="function"&&c(I),p.disposeOnDemandRenderer();return}typeof l=="function"&&l(p),this.manager.itemEnd(t),this.manager.itemEnd(a),this.manager.itemEnd(s),p.disposeOnDemandRenderer()}};let A=!0,G=0,P=0,he=!0,$=0,J=0,K=!0,te=0,ue=0;const Y=()=>{if(typeof h=="function"){const I=G+$+te,D=P+J+ue,q=A&&he&&K;h(new ProgressEvent("progress",{lengthComputable:q,loaded:D,total:I}))}};this.manager.itemStart(t),this.manager.itemStart(a),this.manager.itemStart(s);const j=new Sr(this._internalLoadingManager);j.setResponseType("arraybuffer"),j.setRequestHeader(this.requestHeader),j.setPath(this.path),j.setWithCredentials(this.withCredentials),j.load(t,async I=>
119{if(typeof I=="string")throw new Error("Invalid sdr buffer");g=I,await T()},I=>{A=I.lengthComputable,P=I.loaded,G=I.total,Y()},I=>{this.manager.itemError(t),typeof c=="function"&&c(I)});const ie=new Sr(this._internalLoadingManager);ie.setResponseType("arraybuffer"),ie.setRequestHeader(this.requestHeader),ie.setPath(this.path),ie.setWithCredentials(this.withCredentials),ie.load(a,async I=>{if(typeof I=="string")throw new Error("Invalid gainmap buffer");w=I,await T()},I=>{he=I.lengthComputable,J=I.loaded,$=I.total,Y()},I=>{this.manager.itemError(a),typeof c=="function"&&c(I)});const E=new Sr(this._internalLoadingManager);return E.setRequestHeader(this.requestHeader),E.setPath(this.path),E.setWithCredentials(this.withCredentials),E.load(s,async I=>{if(typeof I!="string")throw new Error("Invalid metadata string");R=JSON.parse(I),await T()},I=>{K=I.lengthComputable,ue=I.loaded,te=I.total,Y()},I=>{this.manager.itemError(s),typeof c=="function"&&c(I)}),p}}class bn extends Ct{load(t,a,s,l){const h=this.prepareQuadRenderer(),c=new Sr(this._internalLoadingManager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(this.withCredentials),this.manager.itemStart(t),c.load(t,async p=>{if(typeof p=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const g=new Uint8Array(p);let w,R,T;try{const A=await mn(g);w=A.sdr,R=A.gainMap,T=A.metadata}catch(A){if(A instanceof It||A instanceof Mt)console.warn(`Failure to reconstruct an HDR image from ${t}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),T={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},w=g;else throw A}try{await this.render(h,T,w.buffer,R==null?void 0:R.buffer)}catch(A){this.manager.itemError(t),typeof l=="function"&&l(A),h.disposeOnDemandRenderer();return}typeof a=="function"&&a(h),this.manager.itemEnd(t),h.disposeOnDemandRenderer()},s,p=>{this.manager.itemError(t),typeof l=="function"&&l(p)}),h}}const vr={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},Rt="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",ar=n=>Array.isArray(n),Yr=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function Rr({files:n=Yr,path:t="",preset:a=void 0,encoding:s=void 0,extensions:l}={}){let h=null,c=!1;a&&(Vr(a),n=vr[a],t=Rt),c=ar(n);const{extension:p,isCubemap:g}=qr(n);if(h=Jr(p),!h)throw new Error("useEnvironment: Unrecognized file extension: "+n);const w=nr(G=>G.gl);M.useLayoutEffect(()=>{if(p!=="webp"&&p!=="jpg"&&p!=="jpeg")return;function G(){Ir.clear(h,c?[n]:n)}w.domElement.addEventListener("webglcontextlost",G,{once:!0})},[n,w.domElement]);const R=Ir(h,c?[n]:n,G=>{(p==="webp"||p==="jpg"||p==="jpeg")&&G.setRenderer(w),G.setPath==null||G.setPath(t),l&&l(G)});let T=c?R[0]:R;if(p==="jpg"||p==="jpeg"||p==="webp"){var A;T=(A=T.renderTarget)==null?void 0:A.texture}return T.mapping=g?xa:ya,"colorSpace"in T?T.colorSpace=s??g?"srgb":"srgb-linear":T.encoding=s??g?hn:dn,T}const En={files:Yr,path:"",preset:void 0,extensions:void 0};Rr.preload=n=>{const t={...En,...n};let{files:a,path:s=""}=t;
119const{preset:l,extensions:h}=t;l&&(Vr(l),a=vr[l],s=Rt);const{extension:c}=qr(a);if(c==="webp"||c==="jpg"||c==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const p=Jr(c);if(!p)throw new Error("useEnvironment: Unrecognized file extension: "+a);Ir.preload(p,ar(a)?[a]:a,g=>{g.setPath==null||g.setPath(s),h&&h(g)})};const Sn={files:Yr,preset:void 0};Rr.clear=n=>{const t={...Sn,...n};let{files:a}=t;const{preset:s}=t;s&&(Vr(s),a=vr[s]);const{extension:l}=qr(a),h=Jr(l);if(!h)throw new Error("useEnvironment: Unrecognized file extension: "+a);Ir.clear(h,ar(a)?[a]:a)};function Vr(n){if(!(n in vr))throw new Error("Preset must be one of: "+Object.keys(vr).join(", "))}function qr(n){var t;const a=ar(n)&&n.length===6,s=ar(n)&&n.length===3&&n.some(c=>c.endsWith("json")),l=ar(n)?n[0]:n;return{extension:a?"cube":s?"webp":l.startsWith("data:application/exr")?"exr":l.startsWith("data:application/hdr")?"hdr":l.startsWith("data:image/jpeg")?"jpg":(t=l.split(".").pop())==null||(t=t.split("?"))==null||(t=t.shift())==null?void 0:t.toLowerCase(),isCubemap:a,isGainmap:s}}function Jr(n){return n==="cube"?ba:n==="hdr"?on:n==="exr"?ln:n==="jpg"||n==="jpeg"?bn:n==="webp"?yn:null}const Mn=n=>n.current&&n.current.isScene,In=n=>Mn(n)?n.current:n;function Kr(n,t,a,s,l={}){var h,c,p,g;l={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...l};const w=In(t||a),R=w.background,T=w.environment,A={backgroundBlurriness:w.backgroundBlurriness,backgroundIntensity:w.backgroundIntensity,backgroundRotation:(h=(c=w.backgroundRotation)==null||c.clone==null?void 0:c.clone())!==null&&h!==void 0?h:[0,0,0],environmentIntensity:w.environmentIntensity,environmentRotation:(p=(g=w.environmentRotation)==null||g.clone==null?void 0:g.clone())!==null&&p!==void 0?p:[0,0,0]};return n!=="only"&&(w.environment=s),n&&(w.background=s),it(w,l),()=>{n!=="only"&&(w.environment=T),n&&(w.background=R),it(w,A)}}function Qr({scene:n,background:t=!1,map:a,...s}){const l=nr(h=>h.scene);return M.useLayoutEffect(()=>{if(a)return Kr(t,n,l,a,s)}),null}function Tt({background:n=!1,scene:t,blur:a,backgroundBlurriness:s,backgroundIntensity:l,backgroundRotation:h,environmentIntensity:c,environmentRotation:p,...g}){const w=Rr(g),R=nr(T=>T.scene);return M.useLayoutEffect(()=>Kr(n,t,R,w,{backgroundBlurriness:a??s,backgroundIntensity:l,backgroundRotation:h,environmentIntensity:c,environmentRotation:p})),M.useEffect(()=>()=>{w.dispose()},[w]),null}function Cn({children:n,near:t=.1,far:a=1e3,resolution:s=256,frames:l=1,map:h,background:c=!1,blur:p,backgroundBlurriness:g,backgroundIntensity:w,backgroundRotation:R,environmentIntensity:T,environmentRotation:A,scene:G,files:P,path:he,preset:$=void 0,extensions:J}){const K=nr(E=>E.gl),te=nr(E=>E.scene),ue=M.useRef(null),[Y]=M.useState(()=>new ut),j=M.useMemo(()=>{const E=new Ea(s);return E.texture.type=Ue,E},[s]);M.useEffect(()=>()=>{j.dispose()},[j]),M.useLayoutEffect(()=>{if(l===1){const E=K.autoClear;K.autoClear=!0,ue.current.update(K,Y),K.autoClear=E}return Kr(c,G,te,j.texture,{backgroundBlurriness:p??g,backgroundIntensity:w,backgroundRotation:R,environmentIntensity:T,environmentRotation:A})},[n,Y,j.texture,G,te,c,l,K]);let ie=1;return $r(()=>{if(l===1/0||ie<l){const E=K.autoClear;K.autoClear=!0,ue.current.update(K,Y),K.autoClear=E,ie++}}),M.createElement(M.Fragment,null,Sa(M.createElement(M.Fragment,null,n,M.createElement("cubeCamera",{ref:ue,args:[t,a,j]}),P||$?M.createElement(Tt,{background:!0,files:P,preset:$,path:he,extensions:J}):h?M.createElement(Qr,{background:!0,map:h,extensions:J}):null),Y))}function Rn(n){var t,a,s,l;const h=Rr(n),c=n.map||h;M.useMemo(()=>pt({GroundProjectedEnvImpl:sn}),[]),M.useEffect(()=>()=>{h.dispose()},[h]);const p=M.useMemo(()=>[c],[c]),g=(t=n.ground)==null?void 0:t.height,w=(a=n.ground)==null?void 0:a.radius,R=(s=(l=n.ground)==null?void 0:l.scale)!==null&&s!==void 0?s:1e3;return M.createElement(M.Fragment,null,M.createElement(Qr,ft({},n,{map:c})),M.createElement("groundProjectedEnvImpl",{args:p,scale:R,height:g,radius:w}))}function Tn(n){return n.ground?M.createElement(Rn,n):n.map?M.createElement(Qr,n):n.
119children?M.createElement(Cn,n):M.createElement(Tt,n)}class An extends Cr{constructor(){super({uniforms:{time:{value:0},pixelRatio:{value:1}},vertexShader:`
120        uniform float pixelRatio;
121        uniform float time;
122        attribute float size;  
123        attribute float speed;  
124        attribute float opacity;
125        attribute vec3 noise;
126        attribute vec3 color;
127        varying vec3 vColor;
128        varying float vOpacity;
129
130        void main() {
131          vec4 modelPosition = modelMatrix * vec4(position, 1.0);
132          modelPosition.y += sin(time * speed + modelPosition.x * noise.x * 100.0) * 0.2;
133          modelPosition.z += cos(time * speed + modelPosition.x * noise.y * 100.0) * 0.2;
134          modelPosition.x += cos(time * speed + modelPosition.x * noise.z * 100.0) * 0.2;
135          vec4 viewPosition = viewMatrix * modelPosition;
136          vec4 projectionPostion = projectionMatrix * viewPosition;
137          gl_Position = projectionPostion;
138          gl_PointSize = size * 25. * pixelRatio;
139          gl_PointSize *= (1.0 / - viewPosition.z);
140          vColor = color;
141          vOpacity = opacity;
142        }
143      `,fragmentShader:`
144        varying vec3 vColor;
145        varying float vOpacity;
146        void main() {
147          float distanceToCenter = distance(gl_PointCoord, vec2(0.5));
148          float strength = 0.05 / distanceToCenter - 0.1;
149          gl_FragColor = vec4(vColor, strength * vOpacity);
150          #include <tonemapping_fragment>
151          #include <${un>=154?"colorspace_fragment":"encodings_fragment"}>
152        }
153      `})}get time(){return this.uniforms.time.value}set time(t){this.uniforms.time.value=t}get pixelRatio(){return this.uniforms.pixelRatio.value}set pixelRatio(t){this.uniforms.pixelRatio.value=t}}const At=n=>n&&n.constructor===Float32Array,Fn=n=>[n.r,n.g,n.b],Ft=n=>n instanceof Ia||n instanceof er||n instanceof Ca,Nt=n=>Array.isArray(n)?n:Ft(n)?n.toArray():[n,n,n];function pr(n,t,a){return M.useMemo(()=>{if(t!==void 0){if(At(t))return t;if(t instanceof Wr){const s=Array.from({length:n*3},()=>Fn(t)).flat();return Float32Array.from(s)}else if(Ft(t)||Array.isArray(t)){const s=Array.from({length:n*3},()=>Nt(t)).flat();return Float32Array.from(s)}return Float32Array.from({length:n},()=>t)}return Float32Array.from({length:n},a)},[t])}const Nn=M.forwardRef(({noise:n=1,count:t=100,speed:a=1,opacity:s=1,scale:l=1,size:h,color:c,children:p,...g},w)=>{M.useMemo(()=>pt({SparklesImplMaterial:An}),[]);const R=M.useRef(null),T=nr(te=>te.viewport.dpr),A=Nt(l),G=M.useMemo(()=>Float32Array.from(Array.from({length:t},()=>A.map(Ma.randFloatSpread)).flat()),[t,...A]),P=pr(t,h,Math.random),he=pr(t,s),$=pr(t,a),J=pr(t*3,n),K=pr(c===void 0?t*3:t,At(c)?c:new Wr(c),()=>1);return $r(te=>{R.current&&R.current.material&&(R.current.material.time=te.clock.elapsedTime)}),M.useImperativeHandle(w,()=>R.current,[]),M.createElement("points",ft({key:`particle-${t}-${JSON.stringify(l)}`},g,{ref:R}),M.createElement("bufferGeometry",null,M.createElement("bufferAttribute",{attach:"attributes-position",args:[G,3]}),M.createElement("bufferAttribute",{attach:"attributes-size",args:[P,1]}),M.createElement("bufferAttribute",{attach:"attributes-opacity",args:[he,1]}),M.createElement("bufferAttribute",{attach:"attributes-speed",args:[$,1]}),M.createElement("bufferAttribute",{attach:"attributes-color",args:[K,3]}),M.createElement("bufferAttribute",{attach:"attributes-noise",args:[J,3]})),p||M.createElement("sparklesImplMaterial",{transparent:!0,pixelRatio:T,depthWrite:!1}))}),Un=["biped","quadruped","hexapod","octopod","avian","serpentine","aquatic"],kn=new Set(["animate_rig","animate_3d","animate_prerigcheck"]),On=()=>new URLSearchParams(window.location.search).get("projectId")??"",Ke=n=>n.metadata??{},Qe=n=>n&&n.length>18?`${n.slice(0,8)}…${n.slice(-6)}`:n??"",Bn=()=>new Date().toLocaleTimeString(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});function Dn({url:n,showBones:t}){const a=mt(n),s=M.useRef(null);return M.useEffect(()=>{if(!t){s.current&&(s.current.visible=!1);return}if(!s.current){let l=!1;if(a.scene.traverse(c=>{c.isSkinnedMesh&&(l=!0)}),!l)return;const h=new Ha(a.scene);h.material.depthTest=!1,h.renderOrder=999,a.scene.add(h),s.current=h}s.current.visible=!0},[t,a.scene]),v.jsx("primitive",{object:a.scene})}function Ln({url:n}){const t=mt(n),a=M.useRef(),{stencil:s,radius:l,center:h}=M.useMemo(()=>{const c=new gt({color:new Wr("#7dd3fc"),wireframe:!0,transparent:!0,opacity:.35,depthWrite:!1});a.current=c;const p=t.scene.clone(!0);p.traverse(R=>{const T=R;T.isMesh&&(T.material=c)});const w=new za().setFromObject(p).getBoundingSphere(new Ga);return{stencil:p,radius:Math.max(w.radius,.5),center:w.center}},[t.scene]);return $r(({clock:c})=>{const p=a.current;
153if(!p)return;const g=c.elapsedTime;p.opacity=.25+.2*(.5+.5*Math.sin(g*3)),p.color.setHSL(.55+.05*Math.sin(g*1.3),.9,.7)}),v.jsxs("group",{children:[v.jsx("primitive",{object:s}),v.jsx(Nn,{count:90,scale:[l*2.4,l*2.4,l*2.4],position:[h.x,h.y,h.z],size:6,speed:1.2,color:"#a5f3fc"})]})}class jn extends M.Component{constructor(){super(...arguments);pe(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?v.jsx("div",{className:"flex h-full items-center justify-center p-6 text-center text-xs text-muted-foreground",children:"Could not load this model file for preview. Rigging still works — run it and download the result."}):this.props.children}}function Pn({url:n,showBones:t,rigging:a}){return v.jsxs(ja,{camera:{position:[0,1.2,3],fov:42},children:[v.jsx("ambientLight",{intensity:.4}),v.jsx("directionalLight",{position:[3,6,4],intensity:1.2}),v.jsxs(M.Suspense,{fallback:null,children:[v.jsx(Tn,{preset:"city"}),a?v.jsx(Ln,{url:n}):v.jsx(Dn,{url:n,showBones:t})]}),v.jsx(Pa,{makeDefault:!0,enableDamping:!0,target:[0,.8,0]})]})}function Zn(){const{toast:n}=Ra(),t=On(),[a,s]=M.useState([]),[l,h]=M.useState(!0),[c,p]=M.useState(null),[g,w]=M.useState(!0),[R,T]=M.useState("biped"),[A,G]=M.useState("tripo"),[P,he]=M.useState("glb"),[$,J]=M.useState({}),[K,te]=M.useState(!1),[ue,Y]=M.useState([]),[j,ie]=M.useState(!1),E=M.useRef(new Set),I=M.useRef(null),D=M.useRef(!0),q=M.useRef(null),k=M.useCallback((f,W)=>{D.current&&Y(fe=>[...fe.slice(-79),{t:Bn(),tone:f,text:W}])},[]);M.useEffect(()=>{var f;(f=q.current)==null||f.scrollIntoView({behavior:"smooth",block:"end"})},[ue]);const Z=M.useCallback(async()=>{if(t){h(!0);try{const f=await Ta("3d",t,50);D.current&&s(f.data)}catch{k("error","Could not load the project's 3D history.")}finally{D.current&&h(!1)}}},[t,k]),U=M.useCallback(async(f,W,fe)=>{var ir;if(E.current.has(f))return;E.current.add(f),J(be=>({...be,[f]:{label:W,status:"queued",sourceJobId:fe}}));let Xe="";try{const be=await Aa("3d",f,{signal:(ir=I.current)==null?void 0:ir.signal,onUpdate:Le=>{const Ve=(Le.status||"…").toLowerCase();Ve!==Xe&&(Xe=Ve,k("info",`${W} → ${Ve}`)),D.current&&J(qe=>qe[f]?{...qe,[f]:{...qe[f],status:Ve}}:qe)}});if(!D.current)return;if((be.status||"").toUpperCase()==="COMPLETED")k("ok",`${W} COMPLETED · job ${Qe(be.jobId)} — bones are in.`),n({title:"Rigging finished"});else{const Le=st(be);k("error",`${W} ${be.status}: ${Le}`),n({title:"Rigging failed",description:Le,variant:"destructive"})}}catch(be){D.current&&(be==null?void 0:be.name)!=="AbortError"&&k("error",`${W}: lost track of the job — it keeps running; refresh to re-attach.`)}finally{E.current.delete(f),D.current&&(J(be=>{const Le={...be};return delete Le[f],Le}),Z())}},[Z,n,k]);M.useEffect(()=>(D.current=!0,I.current=new AbortController,Z(),()=>{var f;D.current=!1,(f=I.current)==null||f.abort()}),[Z]),M.useEffect(()=>{for(const f of a)if(!Fa(f.status)&&f.id&&!E.current.has(f.id)){if((f.modelType||"").toLowerCase()!=="animate_rig")continue;const W=typeof Ke(f).original_model_task_id=="string"?Ke(f).original_model_task_id:"";k("info",`Re-attached to a running rig from history (${Qe(f.jobId)}).`),U(f.id,f.modelType||"Rigging",W)}},[a,U,k]);const Q=M.useMemo(()=>a.filter(f=>(f.status||"").toUpperCase()==="COMPLETED"&&f.jobId),[a]),L=M.useMemo(()=>Q.filter(f=>!kn.has((f.modelType||"").toLowerCase())),[Q]),Se=M.useMemo(()=>{const f=new Map;for(const W of Q){if((W.modelType||"").toLowerCase()!=="animate_rig")continue;const fe=Ke(W).original_model_task_id;typeof fe=="string"&&fe&&f.set(fe,W)}return f},[Q]),Be=M.useMemo(()=>a.filter(f=>["FAILED","TIMEOUT","CANCELED"].includes((f.status||"").toUpperCase())).slice(0,4),[a]),Me=M.useMemo(()=>new Set(Object.values($).map(f=>f.sourceJobId)),[$]),re=M.useCallback(f=>{var W;return((W=Na("3d",f))==null?void 0:W.url)??null},[]),De=M.useCallback(f=>{const W=Ke(f),fe=W.thumbnail_url??W.thumbnailUrl;return typeof fe=="string"&&fe.startsWith("http")?fe:null},[]),V=M.useCallback(f=>{const W=Ke(f);return typeof W.prompt=="string"&&W.prompt.trim()?W.prompt.trim():f.modelType||Qe(f.jobId)},[]),O=L.find(f=>
153f.jobId===c)??null,me=O!=null&&O.jobId?Se.get(O.jobId)??null:null,Ie=!!(O!=null&&O.jobId&&Me.has(O.jobId)),H=me??O,_e=H?re(H):null,ke=M.useCallback(async()=>{if(!(O!=null&&O.jobId)||!t)return;te(!0);const f={model_type:"animate_rig",original_model_task_id:O.jobId,rig_type:R,spec:A,out_format:P};k("send",`SUBMIT model_type=animate_rig · original_model_task_id=${O.jobId} · rig_type=${R} · spec=${A} · ${P} → unified-3d pipeline`);try{const{historyId:W,jobId:fe}=await Ua("3d",t,{generation_type:"3d_generation",...f});k("ok",`Rigging accepted · job ${Qe(fe)} — waiting on Pub/Sub completion`),U(W,`Rigging · ${V(O)}`,O.jobId)}catch(W){const fe=W instanceof Error?W.message:"unknown error";k("error",`Rigging REJECTED at submit: ${fe}`),n({title:"Rigging did not go through",description:fe,variant:"destructive"})}finally{te(!1)}},[O,t,R,A,P,k,U,V,n]);return t?v.jsxs("div",{className:"grid h-full grid-cols-1 overflow-hidden lg:grid-cols-[320px_minmax(0,1fr)]",children:[v.jsxs("aside",{className:"flex min-h-0 flex-col border-r",children:[v.jsxs("div",{className:"flex items-center justify-between border-b p-3",children:[v.jsx("h3",{className:"text-sm font-semibold",children:"Characters"}),v.jsx(yr,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>void Z(),"aria-label":"Refresh",children:v.jsx(ka,{className:Ar("h-3.5 w-3.5",l&&"animate-spin")})})]}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:[L.length===0?v.jsx("p",{className:"text-xs text-muted-foreground",children:"No 3D characters yet — generate one in chat or manual mode first."}):v.jsx("div",{className:"grid grid-cols-2 gap-2",children:L.map(f=>{const W=!!(f.jobId&&Se.has(f.jobId)),fe=!!(f.jobId&&Me.has(f.jobId)),Xe=De(f);return v.jsxs("button",{type:"button",onClick:()=>p(f.jobId??null),"data-jobid":f.jobId,"data-rigged":W?"true":"false",className:Ar("group relative overflow-hidden rounded-xl border text-left transition-colors",f.jobId===c?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[v.jsx("div",{className:"flex aspect-square items-center justify-center bg-muted/30",children:Xe?v.jsx("img",{src:Xe,alt:V(f),loading:"lazy",className:"h-full w-full object-cover"}):v.jsx(Oa,{className:"h-8 w-8 text-muted-foreground/50"})}),v.jsx("div",{className:"absolute left-1.5 top-1.5",children:fe?v.jsxs(Fr,{className:"gap-1 bg-sky-500/90 text-[9px] text-white",children:[v.jsx(Nr,{className:"h-2.5 w-2.5 animate-spin"})," Rigging…"]}):W?v.jsxs(Fr,{className:"gap-1 bg-emerald-600/90 text-[9px] text-white",children:[v.jsx(Ur,{className:"h-2.5 w-2.5"})," Rigged"]}):v.jsx(Fr,{variant:"secondary",className:"text-[9px]",children:"Not rigged"})}),v.jsxs("div",{className:"p-1.5",children:[v.jsx("p",{className:"truncate text-[11px] font-medium",children:V(f)}),v.jsx("p",{className:"truncate text-[9px] text-muted-foreground",children:Qe(f.jobId)})]})]},f.id)})}),Be.length>0?v.jsxs("div",{className:"mt-4",children:[v.jsx("p",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:"Failed"}),v.jsx("ul",{className:"space-y-1",children:Be.map(f=>v.jsxs("li",{className:"rounded-lg border border-destructive/30 bg-destructive/5 px-2.5 py-2 text-xs",children:[v.jsxs("span",{className:"flex items-center gap-1.5 font-medium",children:[v.jsx(Ba,{className:"h-3 w-3 shrink-0 text-destructive"}),V(f)]}),v.jsx("span",{className:"mt-0.5 block text-[10px] leading-snug text-muted-foreground",children:st(f)})]},f.id))})]}):null]})]}),v.jsxs("section",{className:"flex min-h-0 flex-col",children:[v.jsx("div",{className:"relative min-h-[280px] flex-1","data-rigging":Ie?"true":"false",children:_e?v.jsxs(v.Fragment,{children:[v.jsx(jn,{children:v.jsx(Pn,{url:Ie&&O?re(O)??_e:_e,showBones:g&&!!me,rigging:Ie})},`${_e}-${Ie}`),_e?v.jsx("div",{className:"pointer-events-none absolute bottom-2 left-2 z-10",children:v.jsx(Za,{url:_e})}):null,Ie?v.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-4 flex justify-center","data-testid":"rig-magic",children:v.jsxs("span",{className:"flex items-center gap-2 rounded-full bg-background/80 px-3 py-1.5 text-xs text-sky-300 backdrop-blur",children:[v.jsx(Nr,{className:"h-3.5 w-3.5 animate-spin"}),"Rigging ",O?V(O):"character"," — building the skeleton…"]})}):v.jsxs(v.Fragment,{children:[me?v.jsx("div",{className:"absolute left-2 top-2 flex gap-2",children:v.jsxs(yr,{size:"sm",variant:g?"default":"secondary",onClick:()=>w(f=>!f),"aria-pressed":g,children:[v.jsx(Ur,{className:"mr-1.5 h-3.5 w-3.5"})," Bones"]})}):null,v.jsx("div",{className:"absolute right-2 top-2",children:v.jsx(Da,{url:_e,taskId:H==null?void 0:H.jobId,modelType:H==null?void 0:H.modelType,preconverted:H?La(Ke(H)):void 0,filenameBase:O?V(O).slice(0,60):"model"})})]})]}):v.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Pick a character on the left."})}),v.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-t p-3",children:[v.jsxs(kr,{value:R,onValueChange:f=>T(f),children:[v.jsx(Or,{className:"h-8 w-32 text-xs","aria-label":"Rig type",children:v.jsx(Br,{})}),v.jsx(Dr,{children:Un.map(f=>v.jsx(dr,{value:f,children:f},f))})]}),v.jsxs(kr,{value:A,onValueChange:f=>G(f),children:[v.jsx(Or,{className:"h-8 w-40 text-xs","aria-label":"Skeleton 
153spec",children:v.jsx(Br,{})}),v.jsxs(Dr,{children:[v.jsx(dr,{value:"tripo",children:"tripo skeleton"}),v.jsx(dr,{value:"mixamo",children:"mixamo skeleton"})]})]}),v.jsxs(kr,{value:P,onValueChange:f=>he(f),children:[v.jsx(Or,{className:"h-8 w-20 text-xs","aria-label":"Output format",children:v.jsx(Br,{})}),v.jsxs(Dr,{children:[v.jsx(dr,{value:"glb",children:"glb"}),v.jsx(dr,{value:"fbx",children:"fbx"})]})]}),v.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[v.jsxs(yr,{size:"sm",variant:"ghost",className:"relative text-xs text-muted-foreground",onClick:()=>ie(f=>!f),"aria-expanded":j,children:["Log",!j&&ue.some(f=>f.tone==="error")?v.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-2 w-2 rounded-full bg-destructive","aria-label":"Errors in log"}):null]}),me?v.jsxs("p",{className:"text-xs text-emerald-500",children:["Rigged ✓ ",v.jsxs("span",{className:"text-muted-foreground",children:["(",Qe(me.jobId),")"]})]}):null,v.jsxs(yr,{disabled:!O||Ie||K||!!me,onClick:()=>void ke(),title:me?"Already rigged":void 0,children:[K||Ie?v.jsx(Nr,{className:"mr-1.5 h-4 w-4 animate-spin"}):v.jsx(Ur,{className:"mr-1.5 h-4 w-4"}),me?"Rigged":Ie?"Rigging…":"Rig character"]})]})]}),j?v.jsxs("div",{className:"h-28 shrink-0 overflow-y-auto border-t bg-muted/20 p-2 font-mono text-[11px] leading-relaxed",children:[ue.length===0?v.jsx("p",{className:"text-muted-foreground",children:"Activity log — submissions, status changes and errors appear here."}):ue.map((f,W)=>v.jsxs("p",{className:Ar(f.tone==="error"&&"text-destructive",f.tone==="ok"&&"text-emerald-500",f.tone==="send"&&"text-primary",f.tone==="info"&&"text-muted-foreground"),children:[v.jsx("span",{className:"opacity-60",children:f.t})," ",f.text]},W)),v.jsx("div",{ref:q})]}):null]})]}):v.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center text-sm text-muted-foreground",children:"Open a project to rig its characters."})}export{Zn as default};

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.