hart-estate-widget
Version:
HART Estate widget
2 lines • 519 kB
JavaScript
/*! For license information please see TalanVendor.js.LICENSE.txt */
var t={18:(t,e,n)=>{n.d(e,{A:()=>d});var i=n(734),r=n.n(i),a=n(431),s=n.n(a),o=n(502),l=n.n(o),c=new URL(n(460),n.b),h=s()(r()),u=l()(c);h.push([t.id,`.widget-application .talanLogo{display:flex;flex-direction:column;gap:.75em;width:256px;height:250px;position:absolute;left:0;top:0;z-index:6;padding:4px;transition:height .2s,background-color .2s;overflow:hidden;background-color:rgba(255,255,255,.7)}.widget-application .talanLogo *{font-weight:500;font-size:15px}.widget-application .talanLogo b{font-weight:bold}.widget-application .talanLogo a{color:#58a;text-decoration:underline}.widget-application .talanLogo__logoRow{flex-shrink:0;flex-grow:0;cursor:pointer;display:flex;align-items:center;flex-direction:column;height:48px;gap:.1em}.widget-application .talanLogo__arrow{display:block;width:64px;height:64px;position:absolute;left:-8px;top:-8px;transition:transform .2s;background-image:url(${u});background-repeat:no-repeat;background-size:128px 768px;background-position:0 -256px}.widget-application .talanLogo__logoRow img{object-fit:contain;width:60%;height:100%}.widget-application .talanLogo__row{display:flex;flex-direction:column;gap:.1em}.widget-application .talanLogo--collapse{height:64px;background-color:rgba(255,255,255,0)}.widget-application .talanLogo--collapse .talanLogo__arrow{transform:rotate(-180deg)}`,""]);const d=h},26:(t,e,n)=>{var i=n(72),r=n.n(i),a=n(825),s=n.n(a),o=n(659),l=n.n(o),c=n(56),h=n.n(c),u=n(540),d=n.n(u),p=n(113),f=n.n(p),m=n(107),g={};g.styleTagTransform=f(),g.setAttributes=h(),g.insert=l().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=d(),r()(m.A,g),m.A&&m.A.locals&&m.A.locals},41:(t,e,n)=>{n.d(e,{V3:()=>a});var i=n(458),r=n(306);class a{x;y;z;constructor(t=0,e=0,n=0){"number"==typeof t?(this.x=t,this.y=e,this.z=n):"X"in t?(this.x=t.X,this.y=t.Y,this.z=t.Z):(this.x=t.x,this.y=t.y,this.z=t.z)}get lower(){const{x:t,y:e,z:n}=this;return{x:t,y:e,z:n}}get upper(){const{x:t,y:e,z:n}=this;return{X:t,Y:e,Z:n}}get vector2(){return r.V2.from(this)}get array(){return[this.x,this.y,this.z]}get three(){return new i.Pq0(this.x,this.y,this.z)}get sqLength(){return this.x**2+this.y**2+this.z**2}get length(){return(this.x**2+this.y**2+this.z**2)**.5}clone(){return new a(this.x,this.y,this.z)}asVector2(){return new r.V2(this.x,this.y)}copy(t){return"X"in t?(this.x=t.X,this.y=t.Y,this.z=t.Z):(this.x=t.x,this.y=t.y,this.z=t.z),this}set(t,e,n){return this.x=t,this.y=e,this.z=n,this}normalize(){const{length:t}=this;return this.x/=t,this.y/=t,this.z/=t,this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}add(t){return"X"in t?(this.x+=t.X,this.y+=t.Y,this.z+=t.Z):(this.x+=t.x,this.y+=t.y,this.z+=t.z),this}addScalar(t,e,n){return this.x+=t,this.y+=e,this.z+=n,this}sub(t){return"X"in t?(this.x-=t.X,this.y-=t.Y,this.z-=t.Z):(this.x-=t.x,this.y-=t.y,this.z-=t.z),this}subScalar(t,e,n){return this.x-=t,this.y-=e,this.z-=n,this}scale(t){return this.x*=t,this.y*=t,this.z*=t,this}scaleVector(t){return"X"in t?(this.x*=t.X,this.y*=t.Y,this.z*=t.Z):(this.x*=t.x,this.y*=t.y,this.z*=t.z),this}rotateX(t){const{x:e,y:n,z:i}=this,r=Math.cos(t),a=Math.sin(t);return this.x=e,this.y=n*r-i*a,this.z=i*r+n*a,this}rotateY(t){const{x:e,y:n,z:i}=this,r=Math.cos(t),a=Math.sin(t);return this.x=e*r+i*a,this.y=n,this.z=i*r-e*a,this}rotateZ(t){const{x:e,y:n,z:i}=this,r=Math.cos(t),a=Math.sin(t);return this.x=e*r-n*a,this.y=n*r+e*a,this.z=i,this}lerpf(t,e){return"X"in t?(this.x+=(t.X-this.x)*e,this.y+=(t.Y-this.y)*e,this.z+=(t.Z-this.z)*e):(this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e),this}lerp(t,e){return e<0?e=0:e>1&&(e=1),"X"in t?(this.x+=(t.X-this.x)*e,this.y+=(t.Y-this.y)*e,this.z+=(t.Z-this.z)*e):(this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e),this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}applyMatrix4(t){const{x:e,y:n,z:i}=this,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*a,this}static get one(){return new a(1,1,1)}static get zero(){return new a(0,0,0)}static get right(){return new a(1,0,0)}static get left(){return new a(-1,0,0)}static get down(){return new a(0,1,0)}static get up(){return new a(0,-1,0)}static get front(){return new a(0,0,1)}static get back(){return new a(0,0,-1)}static from(t){return Array.isArray(t)?new a(t[0],t[1],t[2]):"X"in t?new a(t.X,t.Y,t.Z):new a(t.x,t.y,t.z)}static center(t,e){let n,i,r,s,o,l;return"X"in t?(n=t.X,i=t.Y,r=t.Z):(n=t.x,i=t.y,r=t.z),"X"in e?(s=e.X,o=e.Y,l=e.Z):(s=e.x,o=e.y,l=e.z),new a((n+s)/2,(i+o)/2,(r+l)/2)}static distance(t,e){let n,i,r,a,s,o;return"X"in t?(n=t.X,i=t.Y,r=t.Z):(n=t.x,i=t.y,r=t.z),"X"in e?(a=e.X,s=e.Y,o=e.Z):(a=e.x,s=e.y,o=e.z),((a-n)**2+(s-i)**2+(o-r)**2)**.5}static set(t,e,n,i){"X"in t?(t.X=e,t.Y=n,t.Z=i):(t.x=e,t.y=n,t.z=i)}static copy(t,e){let n,i,r;"X"in e?(n=e.X,i=e.Y,r=e.Z):(n=e.x,i=e.y,r=e.z),"X"in t?(t.X=n,t.Y=i,t.Z=r):(t.x=n,t.y=i,t.z=r)}}},56:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},72:t=>{var e=[];function n(t){for(var n=-1,i=0;i<e.length;i++)if(e[i].identifier===t){n=i;break}return n}function i(t,i){for(var a={},s=[],o=0;o<t.length;o++){var l=t[o],c=i.base?l[0]+i.base:l[0],h=a[c]||0,u="".concat(c," ").concat(h);a[c]=h+1;var d=n(u),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)e[d].references++,e[d].updater(p);else{var f=r(p,i);i.byIndex=o,e.splice(o,0,{identifier:u,updater:f,references:1})}s.push(u)}return s}function r(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,r){var a=i(t=t||[],r=r||{});return function(t){t=t||[];for(var s=0;s<a.length;s++){var o=n(a[s]);e[o].references--}for(var l=i(t,r),c=0;c<a.length;c++){var h=n(a[c]);0===e[h].references&&(e[h].updater(),e.splice(h,1))}a=l}}},86:(t,e,n)=>{n.d(e,{P:()=>s});var i=n(458),r=n(250),a=n(214);class s extends i.B69{linksPool=[];materialPool=new Map;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("stairDown"),this.cacheMaterial("stairUp")}dispose(){}update(t){this.updateData(t);const{stairStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&e.update(t)}))}async updatePool(){const t=this._store,e=t.domainStore.stairStore.currentArray;if(null==e)return;const{linksPool:n}=this;for(let i=n.length,r=e.length;i<r;i++){const e=new a.W(t);this.add(e),n[i]=e}for(let t=0,i=n.length;t<i;t++){const i=n[t];if(t>=e.length){i.visible=!1,i.isInteractive=!1;continue}const r=e[t];i.material=this.getMaterial(r.icon),i.visible=!0,i.isInteractive=!0,i.setDomain(r)}}onRaycastDown=t=>{"Stair"===t.type&&this.linksPool.some((e=>!(!e.isInteractive||t.id!==e.domainId||(e.onRaycastDown(t),0))))};onRaycastChange=t=>{this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)}))};cacheMaterial(t){if(this.materialPool.has(t))return;const e=this._store.panoramaTabStore.linkIconStore.get(t),n=new r.g({color:4303415});this.materialPool.set(t,n),this._store.panoramaTabStore.iconTextureResources.get(e).then((t=>{t&&(n.map=t,n.needsUpdate=!0)}))}getMaterial(t){return this.cacheMaterial(t),this.materialPool.get(t)}}},107:(t,e,n)=>{n.d(e,{A:()=>o});var i=n(734),r=n.n(i),a=n(431),s=n.n(a)()(r());s.push([t.id,".widget-application .talanTextRenderer{display:block;width:100%;height:100%;position:absolute;left:0;top:0;z-index:5;pointer-events:none}.widget-application .talanFloatText{display:flex;position:absolute;color:#fff;filter:drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));font-weight:600;transition:opacity .1s}.widget-application .talanFloatText{font-size:48px}@media(max-width: 1024px){.widget-application .talanFloatText{font-size:36px}}@media(max-width: 768px){.widget-application .talanFloatText{font-size:24px}}.widget-application .talanFloatText--hidden{opacity:0}",""]);const o=s},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},136:(t,e,n)=>{n.d(e,{j:()=>u});var i=n(405),r=n(306),a=n(41),s=n(458);n(26);const o=new a.V3,l=new s.Pq0,c=new s.Pq0,h=new r.V2(.5,2),u=({store:t})=>{const{useEffect:e,useRef:n,useState:r}=t.reactStore.react,[a,s]=r(""),u=n(null),d=n(null);e((()=>{let t=window.requestAnimationFrame((function e(){t=window.requestAnimationFrame(e),p()}));return()=>window.cancelAnimationFrame(t)}),[]);const p=()=>{const e=u.current,n=d.current;if(!e||!n)return;if("panorama"!==t.tabStore.tab)return void(e.style.display="none");e.style.display="block";const i=(()=>{const{domainStore:e}=t;if(0===e.selected.length)return;const n=e.selected.find((t=>"Portal"===t.type));if(!n)return;const i=e.portalStore.getById(n.id);return i&&i.data.Hint?i:void 0})();if(!i)return void(n.className="talanFloatText talanFloatText--hidden");const{camera:r}=t.panoramaTabStore.sceneController.widgetScene;r.getWorldPosition(c),o.copy(i.position).rotateY(Math.PI/2),l.copy(o).project(r);const a=l.x+1,p=1-l.y,f=l.z,m=a*(e.offsetWidth/2-n.offsetWidth*h.x)|0,g=p*(e.offsetHeight/2-n.offsetHeight*h.y)|0;f<1?(s(i.data.Hint),n.className="talanFloatText",n.style.transform=`matrix(1,0,0,1,${m},${g})`):n.className="talanFloatText talanFloatText--hidden"};return(0,i.jsx)("div",{className:"talanTextRenderer",ref:u,children:(0,i.jsx)("div",{className:"talanFloatText",ref:d,children:a})})}},213:t=>{t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIGNsYXNzPSJzdmctaWNvbl9faWNvbiIgdmlld0JveD0iMCAwIDEwNyAyMCIgd2lkdGg9IjEwNyIgaGVpZ2h0PSIyMCI+PHBhdGggZmlsbD0iIzQxQUEzNyIgZD0iTTg5LjMxMSAxOS40MTVWLjQ1aDUuNTJ2Ni43Nmg2LjY0OFYuNDVoNS41MnYxOC45NjRoLTUuNTJ2LTcuMjFoLTYuNjQ3djcuMjFoLTUuNTJaTTcwLjU3IDkuOTUxYzAgMi42NjYgMi4xNzcgNC44NDQgNC44OCA0Ljg0NCAxLjU3OCAwIDIuOTMtLjYzOCAzLjk0NC0xLjY1MlY2Ljc5N2MtMS4wNTEtMS4wNTEtMi40MDMtMS42OS0zLjk0My0xLjY5LTIuNzAzIDAtNC44ODIgMi4xNzgtNC44ODIgNC44NDRabTE0LjM0NCA5LjQ2M2gtNC40M2wtLjQ1Mi0xLjA4OWMtMS4yNzYuOTM5LTMuMTE3IDEuNTQtNS4xMDcgMS41NC01LjU1OCAwLTEwLjAyNy00LjQ3LTEwLjAyNy05LjkxNUM2NC45IDQuNDcgNjkuMzY4IDAgNzQuOTI1IDBjMS45OSAwIDMuODMuNjM4IDUuMTA3IDEuNTc3bC40NTEtMS4xMjZoNC40MzF2MTguOTYzWm0tNDIuNTc5LTQuNjE4Yy4yMjUuMDM4LjQ1LjA3NS43MTMuMDc1IDEuMTI2IDAgMS45NTMtLjYzOCAyLjEwMy0yLjE0TDQ2LjM1My40NWgxNS4zOTZ2MTguOTY0aC01LjUyVjUuMjk1aC01LjEwN2wtLjg2NCA4LjM3NGMtLjQxMyA0LjIwNi0yLjU1NCA2LjE5Ny01Ljg1OCA2LjE5Ny0uODY0IDAtMS4zOS0uMTUtMi4wNjYtLjQxM3YtNC42NTdabS0xNy44NS00Ljg0NWMwIDIuNjY2IDIuMTc4IDQuODQ0IDQuODgyIDQuODQ0IDEuNTc3IDAgMi45MjgtLjYzOCAzLjk0My0xLjY1MlY2Ljc5N2MtMS4wNTItMS4wNTEtMi40MDQtMS42OS0zLjk0My0xLjY5LTIuNzA0IDAtNC44ODIgMi4xNzgtNC44ODIgNC44NDRabTE0LjM0NCA5LjQ2M0gzNC40bC0uNDUyLTEuMDg5Yy0xLjI3Ni45MzktMy4xMTcgMS41NC01LjEwNyAxLjU0LTUuNTU4IDAtMTAuMDI2LTQuNDctMTAuMDI2LTkuOTE1QzE4LjgxNCA0LjQ3IDIzLjI4NCAwIDI4Ljg0IDBjMS45OSAwIDMuODMuNjM4IDUuMTA3IDEuNTc3bC40NTEtMS4xMjZoNC40MzF2MTguOTYzWm0tMzIuNjExLjAwMVY1LjI5NUguNDM1Vi40NTFoMTcuMTI0djQuODQ0aC01LjgydjE0LjEySDYuMjE3WiIvPjwvc3ZnPg=="},214:(t,e,n)=>{n.d(e,{W:()=>a});var i=n(479),r=n(458);class a extends r.kxk{domainType="Stair";isInteractive=!1;domain;domainId="";_store;constructor(t){super(),this._store=t,this.scale.setScalar(.1)}setDomain(t){this.domain=t,this.domainId=t?.id??""}update(t){(0,i.x3)(t);const{domain:e}=this;e&&this.position.copy(e.position)}onRaycastDown(t){if(this.domainType!==t.type||this.domainId!==t.id)return;let{targetVariantId:e,targetFloorIndex:n,targetPanoramaId:i}=this.domain;const{indexStore:r}=this._store;if(!e&&-1===n){const t=r.resolver.resolveByPanoramaId(i);t&&(e=t.variantId,n=t.floorIndex,i=t.panoramaId)}e||(e=r.variantId),-1===n&&(n=r.floorIndex),i&&r.set(e,n,i)}onRaycastChange(t){const e=this.domainType===t.type&&this.domainId===t.id;this.scale.setScalar(e?.15:.1)}}},215:(t,e,n)=>{n.d(e,{f:()=>a});var i=n(405),r=(n(231),n(213));const a=({store:t})=>{const{useState:e}=t.reactStore.react,[n,a]=e("talanLogo");return(0,i.jsxs)("div",{className:n,children:[(0,i.jsxs)("div",{className:"talanLogo__logoRow",onClick:()=>{a((t=>"talanLogo"===t?"talanLogo talanLogo--collapse":"talanLogo"))},children:[(0,i.jsx)("div",{className:"talanLogo__arrow"}),(0,i.jsx)("img",{src:r,alt:""})]}),(0,i.jsxs)("div",{className:"talanLogo__row",children:[(0,i.jsx)("b",{children:"Природные кварталы «Сибирия»"}),(0,i.jsx)("a",{href:"https://xn--90absbknhbvge.xn--80aa6ajv.xn--p1ai/",children:"новосибирск.талан.рф"})]}),(0,i.jsxs)("div",{className:"talanLogo__row",children:[(0,i.jsx)("b",{children:"Офис продаж"}),(0,i.jsx)("a",{href:"tel:+73833753751",children:"+ 7 (383) 375-37-51"}),(0,i.jsx)("span",{children:"пн-пт 9:00 — 18:00"})]}),(0,i.jsxs)("div",{className:"talanLogo__row",children:[(0,i.jsx)("span",{children:"Застройщик имеет право внести изменения в проект."}),(0,i.jsx)("span",{children:"Не является публичной офертой."})]})]})}},222:(t,e,n)=>{n.d(e,{e:()=>a});var i=n(458),r=n(250);class a extends i.B69{linksPool=[];materialPool=new Map;_store;_prevVersion=-1;constructor(t){super(),this._store=t}init(){this.cacheMaterial("door")}dispose(){}update(t){this.updateData(t);const{apertureStore:e}=this._store.domainStore;this._prevVersion!==e.version&&(this._prevVersion=e.version,this.updatePool())}updateData(t){this.linksPool.forEach((e=>{e.visible&&e.update(t)}))}async updatePool(){}onRaycastDown=t=>{"Aperture"===t.type&&this.linksPool.some((e=>!(!e.isInteractive||e.domainId!==t.id||(e.onRaycastDown(t),0))))};_prevEvent={id:"",type:""};onRaycastChange=t=>{this._prevEvent.type===t.type&&this._prevEvent.id===t.id||(this._prevEvent.type=t.type,this._prevEvent.id=t.id,this.linksPool.forEach((e=>{e.isInteractive&&e.onRaycastChange(t)})))};cacheMaterial(t){if(this.materialPool.has(t))return;const e=this._store.panoramaTabStore.linkIconStore.get(t),n=new r.g({color:4303415});this.materialPool.set(t,n),this._store.panoramaTabStore.iconTextureResources.get(e).then((t=>{t&&(n.map=t,n.needsUpdate=!0)}))}getMaterial(t){return this.cacheMaterial(t),this.materialPool.get(t)}}},231:(t,e,n)=>{var i=n(72),r=n.n(i),a=n(825),s=n.n(a),o=n(659),l=n.n(o),c=n(56),h=n.n(c),u=n(540),d=n.n(u),p=n(113),f=n.n(p),m=n(18),g={};g.styleTagTransform=f(),g.setAttributes=h(),g.insert=l().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=d(),r()(m.A,g),m.A&&m.A.locals&&m.A.locals},250:(t,e,n)=>{n.d(e,{g:()=>r});var i=n(458);class r extends i.RoJ{constructor(t){super({sizeAttenuation:!1,depthTest:!1,depthWrite:!1,transparent:!0,...t})}}},306:(t,e,n)=>{n.d(e,{V2:()=>a});var i=n(373),r=n(458);class a{x;y;constructor(t=0,e=0){"number"==typeof t?(this.x=t,this.y=e):"X"in t?(this.x=t.X,this.y=t.Y):(this.x=t.x,this.y=t.y)}get lower(){const{x:t,y:e}=this;return{x:t,y:e}}get upper(){const{x:t,y:e}=this;return{X:t,Y:e}}get array(){return[this.x,this.y]}get three(){return new r.I9Y(this.x,this.y)}clone(){return new a(this.x,this.y)}negate(){return this.x=-this.x,this.y=-this.y,this}get sqLength(){return this.x**2+this.y**2}get length(){return(this.x**2+this.y**2)**.5}normalize(){const t=Math.max(this.length,1e-8);return this.x/=t,this.y/=t,this}zero(){return this.x=0,this.y=0,this}one(){return this.x=1,this.y=1,this}copy(t){return"X"in t?(this.x=t.X,this.y=t.Y):(this.x=t.x,this.y=t.y),this}set(t,e){return this.x=t,this.y=e,this}add(t){return"X"in t?(this.x+=t.X,this.y+=t.Y):(this.x+=t.x,this.y+=t.y),this}addf(t,e){return this.x+=t,this.y+=e,this}sub(t){return"X"in t?(this.x-=t.X,this.y-=t.Y):(this.x-=t.x,this.y-=t.y),this}subf(t,e){return this.x-=t,this.y-=e,this}scalen(t){return this.x*=t,this.y*=t,this}scale(t){return"X"in t?(this.x*=t.X,this.y*=t.Y):(this.x*=t.x,this.y*=t.y),this}scalef(t,e){return this.x*=t,this.y*=e,this}rotateR(t){const e=Math.cos(t),n=Math.sin(t),{x:i,y:r}=this;return this.x=i*e-r*n,this.y=r*e+i*n,this}rotateD(t){return this.rotateR(t*i.up)}lerpf(t,e){return"X"in t?(this.x+=(t.X-this.x)*e,this.y+=(t.Y-this.y)*e):(this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e),this}lerp(t,e){return e<0?e=0:e>1&&(e=1),"X"in t?(this.x+=(t.X-this.x)*e,this.y+=(t.Y-this.y)*e):(this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e),this}dot(t){return"X"in t?this.x*t.X+this.y*t.Y:this.x*t.x+this.y*t.y}cross(t){return"X"in t?this.x*t.Y-this.y*t.X:this.x*t.y-this.y*t.x}projectLength(t){let e,n;return"X"in t?(e=t.X,n=t.Y):(e=t.x,n=t.y),(this.x*e+this.y*n)/(e**2+n**2)**.5}distanceTo(t){let e,n;return"X"in t?(e=t.X,n=t.Y):(e=t.x,n=t.y),((this.x-e)**2+(this.y-n)**2)**.5}sqrDistanceTo(t){let e,n;return"X"in t?(e=t.X,n=t.Y):(e=t.x,n=t.y),(this.x-e)**2+(this.y-n)**2}static dot(t,e){let n,i,r,a;return"X"in t?(n=t.X,i=t.Y):(n=t.x,i=t.y),"X"in e?(r=e.X,a=e.Y):(r=e.x,a=e.y),n*r+i*a}static cross(t,e){let n,i,r,a;return"X"in t?(n=t.X,i=t.Y):(n=t.x,i=t.y),"X"in e?(r=e.X,a=e.Y):(r=e.x,a=e.y),n*a-i*r}static add(t,e){let n,i,r,s;return"X"in t?(n=t.X,i=t.Y):(n=t.x,i=t.y),"X"in e?(r=e.X,s=e.Y):(r=e.x,s=e.y),new a(n+r,i+s)}static sub(t,e){let n,i,r,s;return"X"in t?(n=t.X,i=t.Y):(n=t.x,i=t.y),"X"in e?(r=e.X,s=e.Y):(r=e.x,s=e.y),new a(n-r,i-s)}static get left(){return new a(-1,0)}static get right(){return new a(1,0)}static get up(){return new a(0,-1)}static get down(){return new a(0,1)}static get one(){return new a(1,1)}static get zero(){return new a(0,0)}static lerpf(t,e,n){let i,r,s,o;return"X"in t?(i=t.X,r=t.Y):(i=t.x,r=t.y),"X"in e?(s=e.X,o=e.Y):(s=e.x,o=e.y),new a(i+(s-i)*n,r+(o-r)*n)}static lerp(t,e,n){return n<0?n=0:n>1&&(n=1),a.lerpf(t,e,n)}static from(t){return Array.isArray(t)?new a(t[0],t[1]):"X"in t?new a(t.X,t.Y):new a(t.x,t.y)}static sqrDistance(t,e){let n,i,r,a;return"X"in t?(n=t.X,i=t.Y):(n=t.x,i=t.y),"X"in e?(r=e.X,a=e.Y):(r=e.x,a=e.y),(r-n)**2+(a-i)**2}static distance(t,e){let n,i,r,a;return"X"in t?(n=t.X,i=t.Y):(n=t.x,i=t.y),"X"in e?(r=e.X,a=e.Y):(r=e.x,a=e.y),((r-n)**2+(a-i)**2)**.5}static direction(t,e){let n,i,r,s;"X"in t?(n=t.X,i=t.Y):(n=t.x,i=t.y),"X"in e?(r=e.X,s=e.Y):(r=e.x,s=e.y);const o=r-n,l=s-i,c=Math.max((o*o+l*l)**.5,1e-8);return new a(o/c,l/c)}static fromRadians(t){return new a(Math.cos(t),Math.sin(t))}static fromDegrees(t){return a.fromRadians(t*i.up)}static radiansBetween(t,e){let n,i,r,a;return"X"in t?(n=t.X,i=t.Y):(n=t.x,i=t.y),"X"in e?(r=e.X,a=e.Y):(r=e.x,a=e.y),Math.atan2(a,r)-Math.atan2(i,n)}static degreesBetween(t,e){return a.radiansBetween(t,e)*i.a5}static set(t,e,n){"X"in t?(t.X=e,t.Y=n):(t.x=e,t.y=n)}static copy(t,e){let n,i;"X"in e?(n=e.X,i=e.Y):(n=e.x,i=e.y),"X"in t?(t.X=n,t.Y=i):(t.x=n,t.y=i)}static center(t,e){let n,i,r,s;return"X"in t?(n=t.X,i=t.Y):(n=t.x,i=t.y),"X"in e?(r=e.X,s=e.Y):(r=e.x,s=e.y),new a((n+r)/2,(i+s)/2)}static copyCenter(t,e,n){let i,r,a,s;"X"in e?(i=e.X,r=e.Y):(i=e.x,r=e.y),"X"in n?(a=n.X,s=n.Y):(a=n.x,s=n.y),"X"in t?(t.X=(i+a)/2,t.Y=(r+s)/2):(t.x=(i+a)/2,t.y=(r+s)/2)}}},371:(t,e,n)=>{n.d(e,{b:()=>a});var i=n(405),r=n(136);const a=({store:t})=>(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(r.j,{store:t})})},373:(t,e,n)=>{n.d(e,{J$:()=>s,a5:()=>r,up:()=>a});const{PI:i}=Math,r=(Math.PI,180/i),a=i/180,s=t=>t<0?0:t>1?1:t},405:(t,e,n)=>{t.exports=n(775)},431:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,r,a){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(i)for(var o=0;o<this.length;o++){var l=this[o][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var h=[].concat(t[c]);i&&s[h[0]]||(void 0!==a&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=a),n&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=n):h[2]=n),r&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=r):h[4]="".concat(r)),e.push(h))}},e}},458:(t,e,n)=>{n.d(e,{$EB:()=>s,B69:()=>un,I9Y:()=>Nt,LoY:()=>jn,Pq0:()=>ce,RoJ:()=>fs,V9B:()=>Dn,eaF:()=>hi,kxk:()=>Rs,qtW:()=>Bn});const i="158",r=0,a=1,s=2,o=100,l=101,c=102,h=200,u=201,d=202,p=203,f=204,m=205,g=206,_=207,v=208,x=209,y=210,M=211,S=212,E=213,A=214,T=301,b=302,w=306,R=1e3,C=1001,L=1002,P=1003,D=1004,U=1005,I=1006,N=1007,O=1008,F=1009,B=1012,z=1014,H=1015,V=1016,G=1020,k=1023,W=1026,X=1027,j=33776,Y=33777,q=33778,Q=33779,K=36492,Z=2300,J=2301,$=2302,tt=3001,et="",nt="srgb",it="srgb-linear",rt="display-p3",at="display-p3-linear",st="linear",ot="srgb",lt="rec709",ct="p3",ht=7680,ut=512,dt=513,pt=514,ft=515,mt=516,gt=517,_t=518,vt=519,xt=35044,yt="300 es",Mt=1035,St=2e3,Et=2001;class At{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e<i;e++)n[e].call(this,t);t.target=null}}}const Tt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],bt=Math.PI/180,wt=180/Math.PI;function Rt(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Tt[255&t]+Tt[t>>8&255]+Tt[t>>16&255]+Tt[t>>24&255]+"-"+Tt[255&e]+Tt[e>>8&255]+"-"+Tt[e>>16&15|64]+Tt[e>>24&255]+"-"+Tt[63&n|128]+Tt[n>>8&255]+"-"+Tt[n>>16&255]+Tt[n>>24&255]+Tt[255&i]+Tt[i>>8&255]+Tt[i>>16&255]+Tt[i>>24&255]).toLowerCase()}function Ct(t,e,n){return Math.max(e,Math.min(n,t))}function Lt(t,e,n){return(1-n)*t+n*e}function Pt(t){return!(t&t-1)&&0!==t}function Dt(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Ut(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function It(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}class Nt{constructor(t=0,e=0){Nt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Ct(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*i+t.x,this.y=r*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ot{constructor(t,e,n,i,r,a,s,o,l){Ot.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,a,s,o,l)}set(t,e,n,i,r,a,s,o,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=s,c[3]=e,c[4]=r,c[5]=o,c[6]=n,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,a=n[0],s=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],_=i[1],v=i[4],x=i[7],y=i[2],M=i[5],S=i[8];return r[0]=a*f+s*_+o*y,r[3]=a*m+s*v+o*M,r[6]=a*g+s*x+o*S,r[1]=l*f+c*_+h*y,r[4]=l*m+c*v+h*M,r[7]=l*g+c*x+h*S,r[2]=u*f+d*_+p*y,r[5]=u*m+d*v+p*M,r[8]=u*g+d*x+p*S,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],s=t[5],o=t[6],l=t[7],c=t[8];return e*a*c-e*s*l-n*r*c+n*s*o+i*r*l-i*a*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],s=t[5],o=t[6],l=t[7],c=t[8],h=c*a-s*l,u=s*o-c*r,d=l*r-a*o,p=e*h+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=h*f,t[1]=(i*l-c*n)*f,t[2]=(s*n-i*a)*f,t[3]=u*f,t[4]=(c*e-i*o)*f,t[5]=(i*r-s*e)*f,t[6]=d*f,t[7]=(n*o-l*e)*f,t[8]=(a*e-n*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,a,s){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*a+l*s)+a+t,-i*l,i*o,-i*(-l*a+o*s)+s+e,0,0,1),this}scale(t,e){return this.premultiply(Ft.makeScale(t,e)),this}rotate(t){return this.premultiply(Ft.makeRotation(-t)),this}translate(t,e){return this.premultiply(Ft.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const Ft=new Ot;function Bt(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function zt(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Ht(){const t=zt("canvas");return t.style.display="block",t}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;const Vt={};function Gt(t){t in Vt||(Vt[t]=!0,console.warn(t))}const kt=(new Ot).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Wt=(new Ot).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Xt={[it]:{transfer:st,primaries:lt,toReference:t=>t,fromReference:t=>t},[nt]:{transfer:ot,primaries:lt,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[at]:{transfer:st,primaries:ct,toReference:t=>t.applyMatrix3(Wt),fromReference:t=>t.applyMatrix3(kt)},[rt]:{transfer:ot,primaries:ct,toReference:t=>t.convertSRGBToLinear().applyMatrix3(Wt),fromReference:t=>t.applyMatrix3(kt).convertLinearToSRGB()}},jt=new Set([it,at]),Yt={enabled:!0,_workingColorSpace:it,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!jt.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=Xt[e].toReference;return(0,Xt[n].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Xt[t].primaries},getTransfer:function(t){return t===et?st:Xt[t].transfer}};function qt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Qt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let Kt;class Zt{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Kt&&(Kt=zt("canvas")),Kt.width=t.width,Kt.height=t.height;const n=Kt.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Kt}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=zt("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t<r.length;t++)r[t]=255*qt(r[t]/255);return n.putImageData(i,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*qt(e[t]/255)):e[t]=qt(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let Jt=0;class $t{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Jt++}),this.uuid=Rt(),this.data=t,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(te(i[e].image)):t.push(te(i[e]))}else t=te(i);n.url=t}return e||(t.images[this.uuid]=n),n}}function te(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Zt.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ee=0;class ne extends At{constructor(t=ne.DEFAULT_IMAGE,e=ne.DEFAULT_MAPPING,n=1001,i=1001,r=1006,a=1008,s=1023,o=1009,l=ne.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ee++}),this.uuid=Rt(),this.name="",this.source=new $t(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new Nt(0,0),this.repeat=new Nt(1,1),this.center=new Nt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ot,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof c?this.colorSpace=c:(Gt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=c===tt?nt:et),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case R:t.x=t.x-Math.floor(t.x);break;case C:t.x=t.x<0?0:1;break;case L:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case R:t.y=t.y-Math.floor(t.y);break;case C:t.y=t.y<0?0:1;break;case L:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Gt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===nt?tt:3e3}set encoding(t){Gt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===tt?nt:et}}ne.DEFAULT_IMAGE=null,ne.DEFAULT_MAPPING=300,ne.DEFAULT_ANISOTROPY=1;class ie{constructor(t=0,e=0,n=0,i=1){ie.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const a=.01,s=.1,o=t.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],f=o[2],m=o[6],g=o[10];if(Math.abs(c-u)<a&&Math.abs(h-f)<a&&Math.abs(p-m)<a){if(Math.abs(c+u)<s&&Math.abs(h+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,o=(d+1)/2,_=(g+1)/2,v=(c+u)/4,x=(h+f)/4,y=(p+m)/4;return t>o&&t>_?t<a?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=v/n,r=x/n):o>_?o<a?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(o),n=v/i,r=y/i):_<a?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(_),n=x/r,i=y/r),this.set(n,i,r,e),this}let _=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(_)<.001&&(_=1),this.x=(m-p)/_,this.y=(h-f)/_,this.z=(u-c)/_,this.w=Math.acos((l+d+g-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class re extends At{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new ie(0,0,t,e),this.scissorTest=!1,this.viewport=new ie(0,0,t,e);const i={width:t,height:e,depth:1};void 0!==n.encoding&&(Gt("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===tt?nt:et),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:I,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new ne(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(t,e,n=1){this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new $t(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ae extends re{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class se extends ne{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=P,this.minFilter=P,this.wrapR=C,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class oe extends ne{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=P,this.minFilter=P,this.wrapR=C,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class le{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,a,s){let o=n[i+0],l=n[i+1],c=n[i+2],h=n[i+3];const u=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(0===s)return t[e+0]=o,t[e+1]=l,t[e+2]=c,void(t[e+3]=h);if(1===s)return t[e+0]=u,t[e+1]=d,t[e+2]=p,void(t[e+3]=f);if(h!==f||o!==u||l!==d||c!==p){let t=1-s;const e=o*u+l*d+c*p+h*f,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),a=Math.atan2(r,e*n);t=Math.sin(t*a)/r,s=Math.sin(s*a)/r}const r=s*n;if(o=o*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+f*r,t===1-s){const t=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=t,l*=t,c*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,a){const s=n[i],o=n[i+1],l=n[i+2],c=n[i+3],h=r[a],u=r[a+1],d=r[a+2],p=r[a+3];return t[e]=s*p+c*h+o*d-l*u,t[e+1]=o*p+c*u+l*h-s*d,t[e+2]=l*p+c*d+s*u-o*h,t[e+3]=c*p-s*h-o*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const n=t._x,i=t._y,r=t._z,a=t._order,s=Math.cos,o=Math.sin,l=s(n/2),c=s(i/2),h=s(r/2),u=o(n/2),d=o(i/2),p=o(r/2);switch(a){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],a=e[1],s=e[5],o=e[9],l=e[2],c=e[6],h=e[10],u=n+s+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-o)*t,this._y=(r-l)*t,this._z=(a-i)*t}else if(n>s&&n>h){const t=2*Math.sqrt(1+n-s-h);this._w=(c-o)/t,this._x=.25*t,this._y=(i+a)/t,this._z=(r+l)/t}else if(s>h){const t=2*Math.sqrt(1+s-n-h);this._w=(r-l)/t,this._x=(i+a)/t,this._y=.25*t,this._z=(o+c)/t}else{const t=2*Math.sqrt(1+h-n-s);this._w=(a-i)/t,this._x=(r+l)/t,this._y=(o+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Ct(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this.