diff --git a/dist/himp.platform.angular/browser/chunk-544QITXJ.js b/dist/himp.platform.angular/browser/chunk-544QITXJ.js deleted file mode 100644 index a749c76..0000000 --- a/dist/himp.platform.angular/browser/chunk-544QITXJ.js +++ /dev/null @@ -1,9 +0,0 @@ -import{$ as ur,$a as ut,A as We,C as He,Ca as et,Ga as tt,Ia as it,La as nt,O as nr,P as or,Pa as ot,S as sr,Sa as st,T as ar,U as lr,Ua as at,V as Ve,Xa as lt,_ as qe,aa as Tt,bb as ct,ca as Ke,da as cr,db as ht,e as Ue,fa as hr,fb as ft,ga as fr,ha as pr,hb as pt,ia as dr,j as tr,ja as gr,jb as dt,ka as mr,kb as yr,la as Qe,n as rr,pa as Ge,ra as Ye,ta as $e,u as je,ua as Je,v as ze,wa as Xe,ya as Ze,z as ir}from"./chunk-WD6SV3WH.js";import{Ab as Jt,Bb as Xt,Cb as Zt,Db as Et,Eb as we,Fb as Ee,Fe as xt,Gb as er,Ge as Ne,He as It,I as Wt,J as Ht,Jb as Se,K as Vt,Ka as pe,Le as De,Nf as rt,Oa as be,Ta as Ce,Va as _e,X as qt,Y as Kt,Za as Gt,a as _t,b as bt,c as mt,cc as St,dc as Ct,f as ei,gb as ge,h as Lt,ha as Qt,hb as de,hf as Le,ib as ke,ja as Mt,k as Re,ka as Ot,l as Ft,lf as Fe,m as Ut,mb as Yt,n as jt,na as ve,nc as Te,o as Pt,p as zt,qb as Ae,sa as Rt,sb as Be,ta as kt,tb as wt,ub as vt,vb as $t}from"./chunk-VDRVUQCF.js";var Nt=ei((Xr,Bt)=>{"use strict";(function(se){if(typeof Xr=="object"&&typeof Bt<"u")Bt.exports=se();else if(typeof define=="function"&&define.amd)define([],se);else{var ae;typeof window<"u"?ae=window:typeof global<"u"?ae=global:typeof self<"u"?ae=self:ae=this,ae.mqtt=se()}})(function(){var se,ae,me;return function(){function m(P,v,p){function f(o,i){if(!v[o]){if(!P[o]){var r=typeof mt=="function"&&mt;if(!i&&r)return r(o,!0);if(y)return y(o,!0);var e=new Error("Cannot find module '"+o+"'");throw e.code="MODULE_NOT_FOUND",e}var t=v[o]={exports:{}};P[o][0].call(t.exports,function(s){var u=P[o][1][s];return f(u||s)},t,t.exports,m,P,v,p)}return v[o].exports}for(var y=typeof mt=="function"&&mt,c=0;c
=U&&Ix((r-X)/G)&&H("overflow"),X+=(k-U)*G,U=k,F=0;F r&&H("overflow"),I==U){for(Q=X,te=e;R=te<=Z?t:te>=Z+s?s:te-Z,!(Q0&&s>t&&(s=t);for(var u=0;u =0?(_=d.substr(0,g),h=d.substr(g+1)):(_=d,h=""),E=decodeURIComponent(_),M=decodeURIComponent(h),p(r,E)?f(r[E])?r[E].push(M):r[E]=[r[E],M]:r[E]=M}return r};var f=Array.isArray||function(y){return Object.prototype.toString.call(y)==="[object Array]"}},{}],88:[function(m,P,v){"use strict";var p=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}};P.exports=function(o,i,r,e){return i=i||"&",r=r||"=",o===null&&(o=void 0),typeof o=="object"?y(c(o),function(t){var s=encodeURIComponent(p(t))+r;return f(o[t])?y(o[t],function(u){return s+encodeURIComponent(p(u))}).join(i):s+encodeURIComponent(p(o[t]))}).join(i):e?encodeURIComponent(p(e))+r+encodeURIComponent(p(o)):""};var f=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function y(o,i){if(o.map)return o.map(i);for(var r=[],e=0;e",'"',"`"," ","\r",` -`," "],e=["{","}","|","\\","^","`"].concat(r),t=["'"].concat(e),s=["%","/","?",";","#"].concat(t),u=["/","?","#"],d=255,g=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},M={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=m("querystring");function z(C,H,B){if(C&&f.isObject(C)&&C instanceof y)return C;var ne=new y;return ne.parse(C,H,B),ne}y.prototype.parse=function(C,H,B){if(!f.isString(C))throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var ne=C.indexOf("?"),oe=ne!==-1&&ne 127?Q+="x":Q+=k[te];if(!Q.match(g)){var I=Z.slice(0,W),N=Z.slice(W+1),q=k.match(_);q&&(I.push(q[1]),N.unshift(q[2])),N.length&&(S="/"+N.join(".")+S),this.hostname=I.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),le||(this.hostname=p.toASCII(this.hostname));var G=this.port?":"+this.port:"",b=this.hostname||"";this.host=b+G,this.href+=this.host,le&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),S[0]!=="/"&&(S="/"+S))}if(!h[V])for(var W=0,F=t.length;W 0?B.host.split("@"):!1;Q&&(B.auth=Q.shift(),B.host=B.hostname=Q.shift())}return B.search=C.search,B.query=C.query,(!f.isNull(B.pathname)||!f.isNull(B.search))&&(B.path=(B.pathname?B.pathname:"")+(B.search?B.search:"")),B.href=B.format(),B}if(!Z.length)return B.pathname=null,B.search?B.path="/"+B.search:B.path=null,B.href=B.format(),B;for(var te=Z.slice(-1)[0],R=(B.host||C.host||Z.length>1)&&(te==="."||te==="..")||te==="",I=0,N=Z.length;N>=0;N--)te=Z[N],te==="."?Z.splice(N,1):te===".."?(Z.splice(N,1),I++):I&&(Z.splice(N,1),I--);if(!$&&!le)for(;I--;I)Z.unshift("..");$&&Z[0]!==""&&(!Z[0]||Z[0].charAt(0)!=="/")&&Z.unshift(""),R&&Z.join("/").substr(-1)!=="/"&&Z.push("");var q=Z[0]===""||Z[0]&&Z[0].charAt(0)==="/";if(k){B.hostname=B.host=q?"":Z.length?Z.shift():"";var Q=B.host&&B.host.indexOf("@")>0?B.host.split("@"):!1;Q&&(B.auth=Q.shift(),B.host=B.hostname=Q.shift())}return $=$||B.host&&Z.length,$&&!q&&Z.unshift(""),Z.length?B.pathname=Z.join("/"):(B.pathname=null,B.path=null),(!f.isNull(B.pathname)||!f.isNull(B.search))&&(B.path=(B.pathname?B.pathname:"")+(B.search?B.search:"")),B.auth=C.auth||B.auth,B.slashes=B.slashes||C.slashes,B.href=B.format(),B},y.prototype.parseHost=function(){var C=this.host,H=o.exec(C);H&&(H=H[0],H!==":"&&(this.port=H.substr(1)),C=C.substr(0,C.length-H.length)),C&&(this.hostname=C)}},{"./util":91,punycode:86,querystring:89}],91:[function(m,P,v){"use strict";P.exports={isString:function(p){return typeof p=="string"},isObject:function(p){return typeof p=="object"&&p!==null},isNull:function(p){return p===null},isNullOrUndefined:function(p){return p==null}}},{}]},{},[17])(17)})});function ri(se,ae){if(se&1&&(ge(0,"th",5),we(1),de()),se&2){let me=ae.$implicit;pe(),Ee(me.title)}}function ii(se,ae){if(se&1&&(ge(0,"td",7),we(1),de()),se&2){let me=ae.$implicit,m=Be().$implicit;pe(),Ee(m[me.key])}}function ni(se,ae){if(se&1&&(ge(0,"tr"),Ce(1,ii,2,1,"td",6),de()),se&2){let me=Be();pe(),_e("ngForOf",me.columns)}}var wi=(()=>{let ae=class ae{constructor(){this.columns=[],this.data=[]}ngOnInit(){console.log(this.data)}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["app-data-v-lj-table"]],inputs:{columns:"columns",data:"data"},standalone:!0,features:[Se],decls:7,vars:4,consts:[["nzBordered","","nzSize","small",3,"nzData","nzPageSize"],["dynamicTable",""],["style",` - background: rgb(8 22 48); - /* color: #bfceff !important; */ - color: #75f9fd; - text-align: center; - border: 0.5px solid #ffffff !important; - `,"nzShowSort","true",4,"ngFor","ngForOf"],[2,"background","rgb(8 22 48)"],[4,"ngFor","ngForOf"],["nzShowSort","true",2,"background","rgb(8 22 48)","/* color","#bfceff !important",`*/ - color`,"#75f9fd","text-align","center","border","0.5px solid #ffffff !important"],["style","text-align: center; color: #75f9fd; border: 0.5px solid #ffffff !important; transition: background 0.3s",4,"ngFor","ngForOf"],[2,"text-align","center","color","#75f9fd","border","0.5px solid #ffffff !important","transition","background 0.3s"]],template:function(P,v){if(P&1&&(ge(0,"nz-table",0,1)(2,"thead")(3,"tr"),Ce(4,ri,2,1,"th",2),de()(),ge(5,"tbody",3),Ce(6,ni,2,1,"tr",4),de()()),P&2){let p=Et(1);_e("nzData",v.data)("nzPageSize",5),pe(4),_e("ngForOf",v.columns),pe(2),_e("ngForOf",p.data)}},dependencies:[je,ze,st,Ze,lt,ut,at,nt,Ue,$e,Xe,dt,it,tt,et,De,Ge,Ye,ct,pt,qe,ht,rt,Ve,Je,Qe,pr,hr,cr,fr,mr,dr,gr,ft,Fe,Le,ot,He,Ne,We,Ke,Te,St,Tt],styles:[".ant-table-bordered[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], .ant-table-bordered[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{border-color:#fff!important}.tableColor[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{border-right:3px solid #2b3e71!important;border-bottom:1px solid #334474!important;transition:background .3s}.tableColor[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#bfceff!important;background-color:transparent!important;border-right:3px solid #2b3e71!important;border-bottom:1px solid #334474!important}"]});let se=ae;return se})();var Si=(()=>{let ae=class ae{agInit(m){this.cellValue=this.getValueToDisplay(m)}refresh(m){return this.cellValue=this.getValueToDisplay(m),!0}buttonClicked(){alert(`\u70B9\u51FB\u4E86 ${this.cellValue}`)}getValueToDisplay(m){return m.valueFormatted?m.valueFormatted:m.value}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["ng-component"]],standalone:!0,features:[Se],decls:3,vars:1,consts:[[2,"display","flex","justify-content","center","align-items","center","height","100%"],[1,"ag-grid-button-style",3,"click"]],template:function(P,v){P&1&&(ge(0,"span",0)(1,"button",1),Ae("click",function(){return v.buttonClicked()}),we(2),de()()),P&2&&(pe(2),Ee(v.cellValue))},styles:[".ag-grid-button-style[_ngcontent-%COMP%]{cursor:pointer;display:inline-block;width:90px;margin:4px;padding:8px 12px;font-weight:800;color:#e0e0e0;text-align:center;text-decoration:none;background-color:#1e4d6b;border:none;transition:background-color .3s,color .3s}.ag-grid-button-style[_ngcontent-%COMP%]:hover{color:#fff;text-decoration:underline;background-color:#3a6d8c}"]});let se=ae;return se})();function si(se,ae){se&1&&(ge(0,"button",7),we(1,"\u63D0\u4EA4"),de())}function ai(se,ae){se&1&&(ge(0,"button",7),we(1,"\u6253\u5370"),de())}function li(se,ae){se&1&&ke(0,"span",8)}var ui=["*"],Jr=(()=>{let ae=class ae{constructor(){this.showSetting=!1,this.showEditButton=!1,this.optionsList=[],this.onCheckedItemsChange=new be,this.title=""}getCheckedItems(){return this.optionsList.filter(m=>m.checked)}onCheckChange(){let m=this.getCheckedItems();this.onCheckedItemsChange.emit(m)}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["lj-data-v-card"]],inputs:{showSetting:"showSetting",showEditButton:"showEditButton",optionsList:"optionsList",title:"title"},outputs:{onCheckedItemsChange:"onCheckedItemsChange"},standalone:!0,features:[Se],ngContentSelectors:ui,decls:10,vars:4,consts:[[1,"card-content"],[1,"card-top-content"],[1,"card-content-title"],[1,"card-content-l"],[1,"buttons-container"],["class","card-button",4,"ngIf"],["nz-icon","","nzType","setting","nzTheme","outline",4,"ngIf"],[1,"card-button"],["nz-icon","","nzType","setting","nzTheme","outline"]],template:function(P,v){P&1&&(wt(),ge(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),we(4),de()(),ge(5,"div",4),Ce(6,si,2,0,"button",5)(7,ai,2,0,"button",5)(8,li,1,0,"span",6),de()(),vt(9),de()),P&2&&(pe(4),Ee(v.title),pe(2),_e("ngIf",v.showEditButton),pe(),_e("ngIf",v.showEditButton),pe(),_e("ngIf",v.showSetting))},dependencies:[Ne,xt,Te,Ct,Ve,je,ze,st,Ze,lt,ut,at,nt,Ue,$e,Xe,dt,it,tt,et,De,It,Ge,Ye,ct,pt,qe,ht,rt,Je,Qe,ft,Fe,Le,ot,He,We,Ke],styles:['.card-top-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto;align-items:start;justify-content:space-between;margin-bottom:10px}.buttons-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end}.card-button[_ngcontent-%COMP%], span[nz-icon][_ngcontent-%COMP%]{margin-left:.5rem}.card-button[_ngcontent-%COMP%]{cursor:pointer;width:72px;height:40px;font-size:24px;line-height:20px;color:#00eff8;text-align:center;background-color:#213069;border:none;border-radius:3px}.card-content[_ngcontent-%COMP%]{overflow:hidden;height:250px;margin-bottom:.5rem;padding:1rem 1.5rem;padding:1rem;background-image:url("./media/dashboard_card_bg-2QFDBQFD.jpg");background-repeat:no-repeat;background-position:center;background-size:100% 100%}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;flex-grow:1;align-items:center;justify-content:space-between;width:fit-content;height:fit-content;margin-bottom:.5rem;padding:5px 20px;font-size:28px;font-weight:600;line-height:22px;color:#74fafb;color:#00eff8;text-align:center;background-color:#19426e;border:1px solid #1f6f97;border-radius:10px 10px 0 0;box-shadow:inset 0 0 10px #1f6f97}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{flex:1;align-self:flex-start}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}']});let se=ae;return se})();var ci=["myGrid"],Wi=(()=>{let ae=class ae{constructor(){this.title="",this.gridOptions={headerHeight:0,suppressHorizontalScroll:!1,suppressNoRowsOverlay:!0,domLayout:"autoHeight"},this.showEditButton=!1,this.showSetting=!1,this.showPageTurning=!0,this.defaultColDef={width:80,editable:!1,headerClass:"ag-header-center",cellStyle:{"font-weight":"bold",textAlign:"center","justify-content":"center","line-height":"38px"}},this.columnDefs=[],this.rowData=[],this.gridThemeClass="ag-theme-quartz",this.paginationThemeClass="ag-theme-quartz",this.tableColumns=[{key:"sort",title:"\u5E8F\u53F7"},{key:"time",title:"\u65F6\u95F4"},{key:"option",title:"\u64CD\u4F5C"},{key:"optionDesc",title:"\u64CD\u4F5C\u63CF\u8FF0"},{key:"optionMan",title:"\u64CD\u4F5C\u4EBA\u5458"},{key:"mark",title:"\u5907\u6CE8"},{key:"edit",title:"\u7F16\u8F91"}],this.tableData=[{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"}]}ngOnInit(){this.showPageTurning?console.log("showPageTurning:",this.showPageTurning):console.log("showPageTurning has not true"),this.title?console.log("Title has been passed:",this.title):console.log("Title has not been passed"),console.log("-----\u8868\u683C\u521D\u59CB\u5316-----"),this.pageSize=5,this.pageIndex=1,this.pageRowTotal=this.rowData.length,this.gridOptions={headerHeight:0,rowData:this.rowData,columnDefs:this.columnDefs}}onGridReady(m){console.log("onGridReady"),console.log(m),setTimeout(()=>{m.api.sizeColumnsToFit()},100)}nzPageSizeChange(m){this.pageSize=m}nzPageIndexChange(m){console.log(`nzPageIndexChange${m}`),this.grid.api&&(m==1?this.grid.api.paginationGoToFirstPage():this.grid.api.paginationGoToPage(m))}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["lj-app-ag-grid-component"]],viewQuery:function(P,v){if(P&1&&Jt(ci,5),P&2){let p;Xt(p=Zt())&&(v.grid=p.first)}},inputs:{title:"title",showEditButton:"showEditButton",showSetting:"showSetting",showPageTurning:"showPageTurning",defaultColDef:"defaultColDef",columnDefs:"columnDefs",rowData:"rowData",gridThemeClass:"gridThemeClass",paginationThemeClass:"paginationThemeClass"},standalone:!0,features:[Se],decls:8,vars:18,consts:[["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12",3,"showEditButton","showSetting","title"],[3,"suppressPaginationPanel","suppressScrollOnNewData","paginationPageSize","defaultColDef","rowHeight","gridOptions","gridReady"],["myGrid",""],[1,"grid-pagination",3,"hidden"],[1,"page-total-style"],["nzShowSizeChanger","",3,"nzPageIndex","nzPageSize","nzTotal","className","nzPageSizeChange","nzPageIndexChange"]],template:function(P,v){P&1&&(ge(0,"lj-data-v-card",0)(1,"ag-grid-angular",1,2),Ae("gridReady",function(f){return v.onGridReady(f)}),de(),ke(3,"br"),ge(4,"div",3)(5,"div",4),we(6),de(),ge(7,"nz-pagination",5),Ae("nzPageSizeChange",function(f){return v.nzPageSizeChange(f)})("nzPageIndexChange",function(f){return v.nzPageIndexChange(f)}),de()()()),P&2&&($t("title",v.title),_e("showEditButton",v.showEditButton)("showSetting",v.showSetting),pe(),Gt(v.gridThemeClass),_e("suppressPaginationPanel",!0)("suppressPaginationPanel",!0)("suppressScrollOnNewData",!0)("paginationPageSize",v.pageSize)("defaultColDef",v.defaultColDef)("rowHeight",38)("gridOptions",v.gridOptions),pe(3),_e("hidden",!v.showPageTurning),pe(2),er("\u5171 ",v.pageRowTotal," \u9879\u6570\u636E"),pe(),_e("nzPageIndex",v.pageIndex)("nzPageSize",v.pageSize)("nzTotal",v.pageRowTotal)("className",v.paginationThemeClass))},dependencies:[Te,yr,Tt,ur,Jr],styles:[".grid-pagination[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:32px}.grid-pagination[_ngcontent-%COMP%] .ant-select-selection-item, .ant-select-selector[_ngcontent-%COMP%]{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .page-total-style{font-size:medium;font-weight:700;color:#00eff8} .ant-select-item-option{color:#00eff8!important} .ant-select-item-option-active div{font-weight:800!important;color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .anticon{color:#00eff8}.grid-pagination[_ngcontent-%COMP%] .ant-select-selector{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-prev .ant-pagination-item-link{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item a{color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active a{color:#000!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-next button, .ant-pagination-prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active:focus-visible, .ant-pagination-item-active[_ngcontent-%COMP%]:hover, .ant-pagination-next[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%], .ant-pagination-prev[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%]{border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active{font-weight:500;background-color:#00eff8;border-color:#00eff8;border-width:2px}"]});let se=ae;return se})();function hi(se,ae){if(se&1){let me=Yt();ge(0,"li",9)(1,"label",10),Ae("ngModelChange",function(P){let p=Rt(me).$implicit;return kt(p.checked=P)})("ngModelChange",function(){Rt(me);let P=Be(2);return kt(P.onCheckChange())}),we(2),de()()}if(se&2){let me=ae.$implicit;pe(),_e("ngModel",me.checked),pe(),Ee(me.label)}}function fi(se,ae){if(se&1&&(ge(0,"div",4),ke(1,"a",5),ge(2,"nz-dropdown-menu",null,6)(4,"ul",7),Ce(5,hi,3,2,"li",8),de()()()),se&2){let me=Et(3),m=Be();pe(),_e("nzDropdownMenu",me),pe(4),_e("ngForOf",m.optionsList)}}var pi=["*"],en=(()=>{let ae=class ae{constructor(){this.showSetting=!1,this.optionsList=[],this.onCheckedItemsChange=new be,this.title=""}getCheckedItems(){return this.optionsList.filter(m=>m.checked)}onCheckChange(){let m=this.getCheckedItems();this.onCheckedItemsChange.emit(m)}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["data-v-card"]],inputs:{showSetting:"showSetting",optionsList:"optionsList",title:"title"},outputs:{onCheckedItemsChange:"onCheckedItemsChange"},standalone:!0,features:[Se],ngContentSelectors:pi,decls:6,vars:2,consts:[[1,"card-content"],[1,"card-content-title"],[1,"card-content-l"],["class","card-content-r",4,"ngIf"],[1,"card-content-r"],["nz-dropdown","","nz-icon","","nzType","setting","nzTrigger","click","nzTheme","outline",3,"nzDropdownMenu"],["menu","nzDropdownMenu"],["nz-menu","","nzSelectable",""],["nz-menu-item","",4,"ngFor","ngForOf"],["nz-menu-item",""],["nz-checkbox","",3,"ngModel","ngModelChange"]],template:function(P,v){P&1&&(wt(),ge(0,"div",0)(1,"div",1)(2,"div",2),we(3),de(),Ce(4,fi,6,2,"div",3),de(),vt(5),de()),P&2&&(pe(3),Ee(v.title),pe(),_e("ngIf",v.showSetting))},dependencies:[Ne,xt,Te,St,Ct,Ve,or,nr,sr,ar,lr,je,tr,rr,ze,st,Ze,lt,ut,at,nt,Ue,$e,Xe,dt,it,tt,et,De,It,Ge,Ye,ct,pt,qe,ht,rt,Je,Qe,ft,Fe,Le,ot,He,We,ir,Ke],styles:['.card-content[_ngcontent-%COMP%]{overflow:hidden;padding:1rem 1.5rem;background-image:url("./media/dashboard_card_bg-2QFDBQFD.jpg");background-position:top;background-size:cover;margin-bottom:.5rem}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;margin-bottom:.5rem;font-size:18px;font-weight:600;color:#74fafb}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{align-self:flex-start;flex:1}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}']});let se=ae;return se})();var hn=Lt(Nt(),1),Zr=Lt(Nt(),1);var gt=function(se){return se[se.CLOSED=0]="CLOSED",se[se.CONNECTING=1]="CONNECTING",se[se.CONNECTED=2]="CONNECTED",se}(gt||{});var di=new Mt("NgxMqttServiceConfig"),gi=new Mt("NgxMqttClientService");function At(se,...ae){if(!ae.length)return se;let me=ae.shift();if(Dt(se)&&Dt(me))for(let m in me)Dt(me[m])?(se[m]||Object.assign(se,{[m]:{}}),At(se[m],me[m])):Object.assign(se,{[m]:me[m]});return At(se,...ae)}function Dt(se){return se&&typeof se=="object"&&!Array.isArray(se)}var dn=(()=>{let ae=class ae{constructor(m,P){this.options=m,this.observables={},this.state=new zt(gt.CLOSED),this.messages=new Pt,this._clientId=this._generateClientId(),this._connectTimeout=1e4,this._reconnectPeriod=1e4,this._onConnect=new be,this._onReconnect=new be,this._onClose=new be,this._onOffline=new be,this._onError=new be,this._onEnd=new be,this._onMessage=new be,this._onSuback=new be,this._onPacketsend=new be,this._onPacketreceive=new be,this._handleOnConnect=v=>{this.options.connectOnCreate===!0&&Object.keys(this.observables).forEach(p=>{this.client.subscribe(p)}),this.state.next(gt.CONNECTED),this._onConnect.emit(v)},this._handleOnReconnect=()=>{this.options.connectOnCreate===!0&&Object.keys(this.observables).forEach(v=>{this.client.subscribe(v)}),this.state.next(gt.CONNECTING),this._onReconnect.emit()},this._handleOnClose=()=>{this.state.next(gt.CLOSED),this._onClose.emit()},this._handleOnOffline=()=>{this._onOffline.emit()},this._handleOnError=v=>{this._onError.emit(v),console.error(v)},this._handleOnEnd=()=>{this._onEnd.emit()},this._handleOnMessage=(v,p,f)=>{this._onMessage.emit(f),f.cmd==="publish"&&this.messages.next(f)},this._handleOnPacketsend=v=>{this._onPacketsend.emit(v)},this._handleOnPacketreceive=v=>{this._onPacketreceive.emit(v)},m.connectOnCreate!==!1&&this.connect({},P),this.state.subscribe()}get clientId(){return this._clientId}get onConnect(){return this._onConnect}get onReconnect(){return this._onReconnect}get onClose(){return this._onClose}get onOffline(){return this._onOffline}get onError(){return this._onError}get onEnd(){return this._onEnd}get onMessage(){return this._onMessage}get onPacketsend(){return this._onPacketsend}get onPacketreceive(){return this._onPacketreceive}get onSuback(){return this._onSuback}static filterMatchesTopic(m,P){if(m[0]==="#"&&P[0]==="$")return!1;let v=(m||"").split("/").reverse(),p=(P||"").split("/").reverse(),f=()=>{let y=v.pop(),c=p.pop();switch(y){case"#":return!0;case"+":return c?f():!1;default:return y===c&&(y===void 0?!0:f())}};return f()}connect(m,P){let v=At(this.options||{},m),p=v.protocol||"ws",f=v.hostname||"localhost";v.url?this._url=v.url:(this._url=`${p}://${f}`,this._url+=v.port?`:${v.port}`:"",this._url+=v.path?`${v.path}`:""),this.state.next(gt.CONNECTING);let y=At({clientId:this._clientId,reconnectPeriod:this._reconnectPeriod,connectTimeout:this._connectTimeout},v);this.client&&this.client.end(!0),P?this.client=P:this.client=(0,Zr.connect)(this._url,y),this._clientId=y.clientId,this.client.on("connect",this._handleOnConnect),this.client.on("reconnect",this._handleOnReconnect),this.client.on("close",this._handleOnClose),this.client.on("offline",this._handleOnOffline),this.client.on("error",this._handleOnError),this.client.stream.on("error",this._handleOnError),this.client.on("end",this._handleOnEnd),this.client.on("message",this._handleOnMessage),this.client.on("packetsend",this._handleOnPacketsend),this.client.on("packetreceive",this._handleOnPacketreceive)}disconnect(m=!0){if(!this.client)throw new Error("mqtt client not connected");this.client.end(m)}observeRetained(m,P={qos:1}){return this._generalObserve(m,()=>Kt(1),P)}observe(m,P={qos:1}){return this._generalObserve(m,()=>qt(),P)}_generalObserve(m,P,v){if(!this.client)throw new Error("mqtt client not connected");if(!this.observables[m]){let p=new Pt;this.observables[m]=Vt(()=>{let f=new Ft;return this.client.subscribe(m,v,(y,c)=>{c&&c.forEach(o=>{o.qos===128&&(delete this.observables[o.topic],this.client.unsubscribe(o.topic),p.error(`subscription for '${o.topic}' rejected!`)),this._onSuback.emit({filter:m,granted:o.qos!==128})})}),f.add(()=>{delete this.observables[m],this.client.unsubscribe(m)}),f},f=>Wt(p,this.messages)).pipe(Ht(f=>ae.filterMatchesTopic(m,f.topic)),P(),jt())}return this.observables[m]}publish(m,P,v={}){if(!this.client)throw new Error("mqtt client not connected");return Ut.create(p=>{this.client.publish(m,P,v,f=>{f?p.error(f):(p.next(),p.complete())})})}unsafePublish(m,P,v={}){if(!this.client)throw new Error("mqtt client not connected");this.client.publish(m,P,v,p=>{if(p)throw p})}_generateClientId(){return"client-"+Math.random().toString(36).substr(2,19)}};ae.\u0275fac=function(P){return new(P||ae)(Ot(di),Ot(gi))},ae.\u0275prov=Qt({token:ae,factory:ae.\u0275fac,providedIn:"root"});let se=ae;return se})();export{Si as a,wi as b,Wi as c,en as d,dn as e}; diff --git a/dist/himp.platform.angular/browser/chunk-DQAAYVF2.js b/dist/himp.platform.angular/browser/chunk-DRIZM4EY.js similarity index 83% rename from dist/himp.platform.angular/browser/chunk-DQAAYVF2.js rename to dist/himp.platform.angular/browser/chunk-DRIZM4EY.js index 0a85c9e..b27277c 100644 --- a/dist/himp.platform.angular/browser/chunk-DQAAYVF2.js +++ b/dist/himp.platform.angular/browser/chunk-DRIZM4EY.js @@ -1,34 +1,34 @@ -import{a as VV,b as jL,c as GV,d as HV,e as kb}from"./chunk-544QITXJ.js";import{$a as oo,A as Va,Aa as ch,Ba as hh,C as Ga,Ca as fn,Ga as $a,Ia as eo,La as to,Pa as ro,Sa as io,Ua as no,V as Ha,W as OV,X as zV,Xa as ao,_ as Wa,aa as Rm,b as Fb,ba as FV,bb as so,ca as Xn,cb as BV,db as Yn,e as Fa,fb as lo,gb as kV,hb as uo,jb as co,kb as Bb,la as Xa,pa as Ya,ra as qa,ta as Za,u as Ba,ua as ja,v as ka,wa as Ka,y as UV,ya as Ja}from"./chunk-WD6SV3WH.js";import{$ as bV,Ab as Mn,Bb as fi,Cb as pi,D as _V,Db as su,Eb as jt,Fb as ma,Fe as IV,Ga as BL,Ge as Wn,Ha as p_,He as NV,I as xV,Ib as RV,Jb as Ar,Ka as st,Kb as LV,La as da,Lb as qL,Le as Ua,Ma as Ib,Mb as ZL,Me as Ub,Ne as Ob,Nf as Qa,Oa as kL,Pa as VL,Q as SV,Sb as sp,Ta as gr,U as MV,Va as rt,Wa as TV,Xa as Nb,Ya as EV,Za as AV,a as Rb,ba as zL,cc as d_,cd as PV,db as GL,dc as As,e as Kse,eb as HL,f as Jse,fb as WL,g as UL,gb as ft,h as $se,hb as ot,hf as Oa,i as Qse,ia as Db,ib as er,ic as m_,j as Lb,ja as wV,jb as au,kb as ou,la as xn,lb as CV,lf as za,m as vV,na as Er,nc as lh,o as OL,oa as Pb,p as gV,pa as FL,qb as XL,ra as sh,sb as Dr,tb as Sn,tf as zb,u as f_,ub as ni,vb as op,vf as uh,w as yV,xd as v_,xf as lu,yb as YL,yc as DV,zb as Qu}from"./chunk-VDRVUQCF.js";var Bse={};UL(Bse,{AddEquation:()=>Hk,AddOperation:()=>Zoe,AdditiveBlending:()=>Bk,AlphaFormat:()=>ase,AlwaysDepth:()=>Voe,AmbientLight:()=>cL,AnimationClip:()=>Ss,AnimationMixer:()=>fV,AnimationObjectGroup:()=>Ek,AnimationUtils:()=>ca,ArcCurve:()=>ML,ArrowHelper:()=>Tm,Audio:()=>q0,AudioAnalyser:()=>hV,AudioContext:()=>uV,AudioListener:()=>wk,AudioLoader:()=>cV,AxisHelper:()=>SL,BackSide:()=>jf,BasicDepthPacking:()=>_se,BasicShadowMap:()=>BIe,BinaryTextureLoader:()=>rV,BlendingMode:()=>Coe,Bone:()=>eL,BooleanKeyframeTrack:()=>mL,BoundingBoxHelper:()=>p3e,Box2:()=>BM,Box3:()=>Zu,BoxBufferGeometry:()=>lm,BoxGeometry:()=>db,BoxHelper:()=>i_,BufferAttribute:()=>Mt,BufferGeometry:()=>Vt,BufferGeometryLoader:()=>nV,ByteType:()=>Qoe,Cache:()=>Mk,Camera:()=>fa,CameraHelper:()=>bb,CanvasRenderer:()=>x3e,CanvasTexture:()=>iL,CatmullRomCurve3:()=>pV,CineonToneMapping:()=>Joe,CircleBufferGeometry:()=>G0,CircleGeometry:()=>pb,ClampToEdgeWrapping:()=>Ms,Clock:()=>Dk,ClosedSplineCurve3:()=>Fse,Color:()=>Wt,ColorKeyframeTrack:()=>vL,CompressedTexture:()=>C0,CompressedTextureLoader:()=>Pse,ConeBufferGeometry:()=>fb,ConeGeometry:()=>hb,CubeCamera:()=>gL,CubeGeometry:()=>db,CubeReflectionMapping:()=>TL,CubeRefractionMapping:()=>ZR,CubeTexture:()=>Kf,CubeTextureLoader:()=>iV,CubeUVReflectionMapping:()=>EL,CubeUVRefractionMapping:()=>AL,CubicBezierCurve:()=>Mm,CubicBezierCurve3:()=>GOe,CubicInterpolant:()=>hL,CullFaceBack:()=>PM,CullFaceFront:()=>Nk,CullFaceFrontBack:()=>zIe,CullFaceNone:()=>Toe,Curve:()=>pa,CurvePath:()=>yb,CurveUtils:()=>Ab,CustomBlending:()=>Gk,CylinderBufferGeometry:()=>ih,CylinderGeometry:()=>dm,Cylindrical:()=>Ik,DataTexture:()=>sm,DataTextureLoader:()=>BOe,DefaultLoadingManager:()=>Ts,DepthFormat:()=>tm,DepthStencilFormat:()=>S0,DepthTexture:()=>KM,DirectionalLight:()=>uL,DirectionalLightHelper:()=>r_,DirectionalLightShadow:()=>lL,DiscreteInterpolant:()=>fL,DodecahedronBufferGeometry:()=>I0,DodecahedronGeometry:()=>tb,DoubleSide:()=>n_,DstAlphaFactor:()=>Uoe,DstColorFactor:()=>zoe,DynamicBufferAttribute:()=>i3e,EdgesGeometry:()=>V0,EdgesHelper:()=>d3e,EllipseCurve:()=>nh,EqualDepth:()=>Hoe,EquirectangularReflectionMapping:()=>qk,EquirectangularRefractionMapping:()=>jR,Euler:()=>ep,EventDispatcher:()=>pl,ExtrudeGeometry:()=>ml,Face3:()=>ws,Face4:()=>YOe,FaceColors:()=>Fk,FaceNormalsHelper:()=>Mb,FileLoader:()=>vl,FlatShading:()=>Ok,Float32Attribute:()=>h3e,Float32BufferAttribute:()=>Mr,Float64Attribute:()=>f3e,Float64BufferAttribute:()=>YM,FloatType:()=>_0,Fog:()=>E0,FogExp2:()=>T0,Font:()=>lV,FontLoader:()=>Nse,FrontFaceDirectionCCW:()=>FIe,FrontFaceDirectionCW:()=>Eoe,FrontSide:()=>y0,Frustum:()=>kM,GammaEncoding:()=>$k,Geometry:()=>ur,GeometryIdCount:()=>Qk,GeometryUtils:()=>g3e,GreaterDepth:()=>Xoe,GreaterEqualDepth:()=>Woe,GridHelper:()=>Sb,Group:()=>jM,HalfFloatType:()=>JR,HemisphereLight:()=>nL,HemisphereLightHelper:()=>t_,IcosahedronBufferGeometry:()=>P0,IcosahedronGeometry:()=>eb,ImageLoader:()=>Eb,ImageUtils:()=>y3e,ImmediateRenderObject:()=>_b,InstancedBufferAttribute:()=>K0,InstancedBufferGeometry:()=>wm,InstancedInterleavedBuffer:()=>j0,Int16Attribute:()=>s3e,Int16BufferAttribute:()=>WM,Int32Attribute:()=>u3e,Int32BufferAttribute:()=>XM,Int8Attribute:()=>n3e,Int8BufferAttribute:()=>VM,IntType:()=>tse,InterleavedBuffer:()=>Z0,InterleavedBufferAttribute:()=>Ck,Interpolant:()=>Zo,InterpolateDiscrete:()=>OM,InterpolateLinear:()=>DM,InterpolateSmooth:()=>YR,JSONLoader:()=>aV,KeyframeTrack:()=>xm,LOD:()=>ZM,LatheBufferGeometry:()=>F0,LatheGeometry:()=>cb,Layers:()=>$R,LensFlare:()=>Sk,LessDepth:()=>Goe,LessEqualDepth:()=>qR,Light:()=>Bi,LightShadow:()=>Am,Line:()=>rh,Line3:()=>rm,LineBasicMaterial:()=>Fi,LineCurve:()=>Ku,LineCurve3:()=>WOe,LineDashedMaterial:()=>_m,LinePieces:()=>ZOe,LineSegments:()=>yi,LineStrip:()=>qOe,LinearEncoding:()=>FM,LinearFilter:()=>qo,LinearInterpolant:()=>vb,LinearMipMapLinearFilter:()=>Tb,LinearMipMapNearestFilter:()=>jk,LinearToneMapping:()=>Yk,Loader:()=>im,LoadingManager:()=>tV,LogLuvEncoding:()=>VIe,LoopOnce:()=>use,LoopPingPong:()=>hse,LoopRepeat:()=>cse,LuminanceAlphaFormat:()=>sse,LuminanceFormat:()=>ose,MOUSE:()=>OIe,Material:()=>_r,MaterialLoader:()=>DL,Math:()=>fr,Matrix3:()=>dl,Matrix4:()=>Kt,MaxEquation:()=>uk,Mesh:()=>_n,MeshBasicMaterial:()=>jo,MeshDepthMaterial:()=>$f,MeshFaceMaterial:()=>jOe,MeshLambertMaterial:()=>ym,MeshNormalMaterial:()=>gm,MeshPhongMaterial:()=>nu,MeshPhysicalMaterial:()=>mm,MeshStandardMaterial:()=>ju,MeshToonMaterial:()=>vm,MinEquation:()=>lk,MirroredRepeatWrapping:()=>am,MixOperation:()=>qoe,MorphBlendMesh:()=>Hn,MultiMaterial:()=>mb,MultiplyBlending:()=>Vk,MultiplyOperation:()=>wb,NearestFilter:()=>bs,NearestMipMapLinearFilter:()=>RL,NearestMipMapNearestFilter:()=>CL,NeverDepth:()=>koe,NoBlending:()=>IM,NoColors:()=>bL,NoToneMapping:()=>XR,NormalBlending:()=>a_,NotEqualDepth:()=>Yoe,NumberKeyframeTrack:()=>Y0,Object3D:()=>Lt,ObjectLoader:()=>Ise,OctahedronBufferGeometry:()=>fm,OctahedronGeometry:()=>QM,OneFactor:()=>Poe,OneMinusDstAlphaFactor:()=>Ooe,OneMinusDstColorFactor:()=>Foe,OneMinusSrcAlphaFactor:()=>Xk,OneMinusSrcColorFactor:()=>Noe,OrthographicCamera:()=>w0,PCFShadowMap:()=>Uk,PCFSoftShadowMap:()=>Aoe,ParametricBufferGeometry:()=>L0,ParametricGeometry:()=>JM,Particle:()=>JOe,ParticleBasicMaterial:()=>e3e,ParticleSystem:()=>$Oe,ParticleSystemMaterial:()=>t3e,Path:()=>Cb,PerspectiveCamera:()=>ua,Plane:()=>xs,PlaneBufferGeometry:()=>um,PlaneGeometry:()=>ub,PointCloud:()=>KOe,PointCloudMaterial:()=>QOe,PointLight:()=>sL,PointLightHelper:()=>Q0,Points:()=>A0,PointsMaterial:()=>iu,PolarGridHelper:()=>xL,PolyhedronBufferGeometry:()=>Ko,PolyhedronGeometry:()=>rb,PositionalAudio:()=>Tk,Projector:()=>_3e,PropertyBinding:()=>Ii,PropertyMixer:()=>yL,QuadraticBezierCurve:()=>bm,QuadraticBezierCurve3:()=>HOe,Quaternion:()=>cn,QuaternionKeyframeTrack:()=>gb,QuaternionLinearInterpolant:()=>pL,REVISION:()=>woe,RGBADepthPacking:()=>xse,RGBAFormat:()=>qu,RGBA_PVRTC_2BPPV1_Format:()=>_k,RGBA_PVRTC_4BPPV1_Format:()=>yk,RGBA_S3TC_DXT1_Format:()=>pk,RGBA_S3TC_DXT3_Format:()=>dk,RGBA_S3TC_DXT5_Format:()=>mk,RGBDEncoding:()=>yse,RGBEEncoding:()=>mse,RGBEFormat:()=>kIe,RGBFormat:()=>x0,RGBM16Encoding:()=>gse,RGBM7Encoding:()=>vse,RGB_ETC1_Format:()=>lse,RGB_PVRTC_2BPPV1_Format:()=>gk,RGB_PVRTC_4BPPV1_Format:()=>vk,RGB_S3TC_DXT1_Format:()=>fk,RawShaderMaterial:()=>W0,Ray:()=>Qf,Raycaster:()=>Rk,RectAreaLight:()=>bk,RectAreaLightHelper:()=>e_,ReinhardToneMapping:()=>joe,RepeatWrapping:()=>Qc,ReverseSubtractEquation:()=>Loe,RingBufferGeometry:()=>z0,RingGeometry:()=>lb,Scene:()=>cm,SceneUtils:()=>XOe,ShaderChunk:()=>jr,ShaderLib:()=>b0,ShaderMaterial:()=>Na,ShadowMaterial:()=>H0,Shape:()=>nm,ShapeBufferGeometry:()=>B0,ShapeGeometry:()=>k0,ShapePath:()=>sV,ShapeUtils:()=>Gn,ShortType:()=>ese,Skeleton:()=>QR,SkeletonHelper:()=>$0,SkinnedMesh:()=>tL,SmoothShading:()=>zk,Sphere:()=>ha,SphereBufferGeometry:()=>pm,SphereGeometry:()=>sb,Spherical:()=>Pk,SphericalReflectionMapping:()=>Zk,Spline:()=>kOe,SplineCurve:()=>Sm,SplineCurve3:()=>VOe,SpotLight:()=>oL,SpotLightHelper:()=>J0,SpotLightShadow:()=>aL,Sprite:()=>qM,SpriteMaterial:()=>hm,SrcAlphaFactor:()=>Wk,SrcAlphaSaturateFactor:()=>Boe,SrcColorFactor:()=>Ioe,StereoCamera:()=>Use,StringKeyframeTrack:()=>dL,SubtractEquation:()=>Roe,SubtractiveBlending:()=>kk,TetrahedronBufferGeometry:()=>D0,TetrahedronGeometry:()=>$M,TextGeometry:()=>ob,Texture:()=>ci,TextureFilter:()=>hk,TextureLoader:()=>LL,TextureMapping:()=>$oe,TextureWrapping:()=>ck,TorusBufferGeometry:()=>O0,TorusGeometry:()=>ab,TorusKnotBufferGeometry:()=>U0,TorusKnotGeometry:()=>nb,Triangle:()=>fl,TriangleFanDrawMode:()=>pse,TriangleStripDrawMode:()=>fse,TrianglesDrawMode:()=>Jk,TubeBufferGeometry:()=>N0,TubeGeometry:()=>ib,UVMapping:()=>wL,Uint16Attribute:()=>l3e,Uint16BufferAttribute:()=>eh,Uint32Attribute:()=>c3e,Uint32BufferAttribute:()=>th,Uint8Attribute:()=>a3e,Uint8BufferAttribute:()=>GM,Uint8ClampedAttribute:()=>o3e,Uint8ClampedBufferAttribute:()=>HM,Uncharted2ToneMapping:()=>Koe,Uniform:()=>_L,UniformsLib:()=>dr,UniformsUtils:()=>Yo,UnsignedByteType:()=>KR,UnsignedInt248Type:()=>UM,UnsignedIntType:()=>Kk,UnsignedShort4444Type:()=>rse,UnsignedShort5551Type:()=>ise,UnsignedShort565Type:()=>nse,UnsignedShortType:()=>NM,Vector2:()=>Tt,Vector3:()=>oe,Vector4:()=>ii,VectorKeyframeTrack:()=>X0,Vertex:()=>r3e,VertexColors:()=>Em,VertexNormalsHelper:()=>xb,VideoTexture:()=>rL,WebGLRenderTarget:()=>o_,WebGLRenderTargetCube:()=>M0,WebGLRenderer:()=>eV,WireframeGeometry:()=>R0,WireframeHelper:()=>m3e,WrapAroundEnding:()=>zM,XHRLoader:()=>v3e,ZeroCurvatureEnding:()=>om,ZeroFactor:()=>Doe,ZeroSlopeEnding:()=>em,sRGBEncoding:()=>dse});function pl(){}function Tt(r,e){this.x=r||0,this.y=e||0}function ci(r,e,t,i,n,a,o,s,l,u){Object.defineProperty(this,"id",{value:GIe++}),this.uuid=fr.generateUUID(),this.name="",this.image=r!==void 0?r:ci.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=e!==void 0?e:ci.DEFAULT_MAPPING,this.wrapS=t!==void 0?t:Ms,this.wrapT=i!==void 0?i:Ms,this.magFilter=n!==void 0?n:qo,this.minFilter=a!==void 0?a:Tb,this.anisotropy=l!==void 0?l:1,this.format=o!==void 0?o:qu,this.type=s!==void 0?s:KR,this.offset=new Tt(0,0),this.repeat=new Tt(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u!==void 0?u:FM,this.version=0,this.onUpdate=null}function ii(r,e,t,i){this.x=r||0,this.y=e||0,this.z=t||0,this.w=i!==void 0?i:1}function o_(r,e,t){this.uuid=fr.generateUUID(),this.width=r,this.height=e,this.scissor=new ii(0,0,r,e),this.scissorTest=!1,this.viewport=new ii(0,0,r,e),t=t||{},t.minFilter===void 0&&(t.minFilter=qo),this.texture=new ci(void 0,void 0,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.depthBuffer=t.depthBuffer!==void 0?t.depthBuffer:!0,this.stencilBuffer=t.stencilBuffer!==void 0?t.stencilBuffer:!0,this.depthTexture=t.depthTexture!==void 0?t.depthTexture:null}function M0(r,e,t){o_.call(this,r,e,t),this.activeCubeFace=0,this.activeMipMapLevel=0}function cn(r,e,t,i){this._x=r||0,this._y=e||0,this._z=t||0,this._w=i!==void 0?i:1}function oe(r,e,t){this.x=r||0,this.y=e||0,this.z=t||0}function Kt(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Kf(r,e,t,i,n,a,o,s,l,u){r=r!==void 0?r:[],e=e!==void 0?e:TL,ci.call(this,r,e,t,i,n,a,o,s,l,u),this.flipY=!1}function bse(){this.seq=[],this.map={}}function s_(r,e,t){var i=r[0];if(i<=0||i>0)return r;var n=e*t,a=goe[n];if(a===void 0&&(a=new Float32Array(n),goe[n]=a),e!==0){i.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function wse(r,e){var t=yoe[e];t===void 0&&(t=new Int32Array(e),yoe[e]=t);for(var i=0;i!==e;++i)t[i]=r.allocTextureUnit();return t}function HIe(r,e){r.uniform1f(this.addr,e)}function WIe(r,e){r.uniform1i(this.addr,e)}function XIe(r,e){e.x===void 0?r.uniform2fv(this.addr,e):r.uniform2f(this.addr,e.x,e.y)}function YIe(r,e){e.x!==void 0?r.uniform3f(this.addr,e.x,e.y,e.z):e.r!==void 0?r.uniform3f(this.addr,e.r,e.g,e.b):r.uniform3fv(this.addr,e)}function qIe(r,e){e.x===void 0?r.uniform4fv(this.addr,e):r.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function ZIe(r,e){r.uniformMatrix2fv(this.addr,!1,e.elements||e)}function jIe(r,e){r.uniformMatrix3fv(this.addr,!1,e.elements||e)}function KIe(r,e){r.uniformMatrix4fv(this.addr,!1,e.elements||e)}function JIe(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTexture2D(e||Sse,i)}function $Ie(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTextureCube(e||Mse,i)}function Tse(r,e){r.uniform2iv(this.addr,e)}function Ese(r,e){r.uniform3iv(this.addr,e)}function Ase(r,e){r.uniform4iv(this.addr,e)}function QIe(r){switch(r){case 5126:return HIe;case 35664:return XIe;case 35665:return YIe;case 35666:return qIe;case 35674:return ZIe;case 35675:return jIe;case 35676:return KIe;case 35678:return JIe;case 35680:return $Ie;case 5124:case 35670:return WIe;case 35667:case 35671:return Tse;case 35668:case 35672:return Ese;case 35669:case 35673:return Ase}}function eNe(r,e){r.uniform1fv(this.addr,e)}function tNe(r,e){r.uniform1iv(this.addr,e)}function rNe(r,e){r.uniform2fv(this.addr,s_(e,this.size,2))}function iNe(r,e){r.uniform3fv(this.addr,s_(e,this.size,3))}function nNe(r,e){r.uniform4fv(this.addr,s_(e,this.size,4))}function aNe(r,e){r.uniformMatrix2fv(this.addr,!1,s_(e,this.size,4))}function oNe(r,e){r.uniformMatrix3fv(this.addr,!1,s_(e,this.size,9))}function sNe(r,e){r.uniformMatrix4fv(this.addr,!1,s_(e,this.size,16))}function lNe(r,e,t){var i=e.length,n=wse(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTexture2D(e[a]||Sse,n[a])}function uNe(r,e,t){var i=e.length,n=wse(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTextureCube(e[a]||Mse,n[a])}function cNe(r){switch(r){case 5126:return eNe;case 35664:return rNe;case 35665:return iNe;case 35666:return nNe;case 35674:return aNe;case 35675:return oNe;case 35676:return sNe;case 35678:return lNe;case 35680:return uNe;case 5124:case 35670:return tNe;case 35667:case 35671:return Tse;case 35668:case 35672:return Ese;case 35669:case 35673:return Ase}}function hNe(r,e,t){this.id=r,this.addr=t,this.setValue=QIe(e.type)}function fNe(r,e,t){this.id=r,this.addr=t,this.size=e.size,this.setValue=cNe(e.type)}function Cse(r){this.id=r,bse.call(this)}function _oe(r,e){r.seq.push(e),r.map[e.id]=e}function pNe(r,e,t){var i=r.name,n=i.length;for(ok.lastIndex=0;;){var a=ok.exec(i),o=ok.lastIndex,s=a[1],l=a[2]==="]",u=a[3];if(l&&(s=s|0),u===void 0||u==="["&&o+2===n){_oe(t,u===void 0?new hNe(s,r,e):new fNe(s,r,e));break}else{var c=t.map,h=c[s];h===void 0&&(h=new Cse(s),_oe(t,h)),t=h}}}function Jf(r,e,t){bse.call(this),this.renderer=t;for(var i=r.getProgramParameter(e,r.ACTIVE_UNIFORMS),n=0;n!==i;++n){var a=r.getActiveUniform(e,n),o=a.name,s=r.getUniformLocation(e,o);pNe(a,s,this)}}function Wt(r,e,t){return e===void 0&&t===void 0?this.set(r):this.setRGB(r,e,t)}function sm(r,e,t,i,n,a,o,s,l,u,c,h){ci.call(this,null,a,o,s,l,u,i,n,c,h),this.image={data:r,width:e,height:t},this.magFilter=l!==void 0?l:bs,this.minFilter=u!==void 0?u:bs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function BM(r,e){this.min=r!==void 0?r:new Tt(1/0,1/0),this.max=e!==void 0?e:new Tt(-1/0,-1/0)}function pOe(r,e){var t=r.context,i=r.state,n,a,o,s,l,u,c,h;function f(){var d=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),g=new Uint16Array([0,1,2,0,2,3]);n=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,g,t.STATIC_DRAW),c=t.createTexture(),h=t.createTexture(),i.bindTexture(t.TEXTURE_2D,c),t.texImage2D(t.TEXTURE_2D,0,t.RGB,16,16,0,t.RGB,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),i.bindTexture(t.TEXTURE_2D,h),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,16,16,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),o={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join(` +import{b as jL,c as VV,d as GV,e as kb}from"./chunk-QH2ADUYX.js";import{$a as oo,A as Va,Aa as ch,Ba as hh,C as Ga,Ca as fn,Ga as $a,Ia as eo,La as to,Pa as ro,Sa as io,Ua as no,V as Ha,W as OV,X as zV,Xa as ao,_ as Wa,aa as Rm,b as Fb,ba as FV,bb as so,ca as Yn,cb as BV,db as qn,e as Fa,fb as lo,gb as kV,hb as uo,jb as co,kb as Bb,la as Xa,pa as Ya,ra as qa,ta as Za,u as Ba,ua as ja,v as ka,wa as Ka,y as UV,ya as Ja}from"./chunk-WD6SV3WH.js";import{$ as bV,Ab as Mn,Bb as fi,Cb as pi,D as _V,Db as su,Eb as jt,Fb as bn,Fe as IV,Ga as BL,Ge as Xn,Ha as p_,He as NV,I as xV,Ib as RV,Jb as Ar,Ka as at,Kb as LV,La as ma,Lb as qL,Le as Ua,Ma as Ib,Mb as ZL,Me as Ub,Ne as Ob,Nf as Qa,Oa as kL,Pa as VL,Q as SV,Sb as sp,Ta as gr,U as MV,Va as rt,Wa as TV,Xa as Nb,Ya as EV,Za as AV,a as Rb,ba as zL,cc as d_,cd as PV,db as GL,dc as As,e as jse,eb as HL,f as Kse,fb as WL,g as UL,gb as ht,h as Jse,hb as ot,hf as Oa,i as $se,ia as Db,ib as er,ic as m_,j as Lb,ja as wV,jb as au,kb as ou,la as xn,lb as CV,lf as za,m as vV,na as Er,nc as lh,o as OL,oa as Pb,p as gV,pa as FL,qb as XL,ra as sh,sb as Dr,tb as Sn,tf as zb,u as f_,ub as ni,vb as op,vf as uh,w as yV,xd as v_,xf as lu,yb as YL,yc as DV,zb as Qu}from"./chunk-VDRVUQCF.js";var Fse={};UL(Fse,{AddEquation:()=>Hk,AddOperation:()=>qoe,AdditiveBlending:()=>Bk,AlphaFormat:()=>nse,AlwaysDepth:()=>koe,AmbientLight:()=>cL,AnimationClip:()=>Ss,AnimationMixer:()=>fV,AnimationObjectGroup:()=>Ek,AnimationUtils:()=>ha,ArcCurve:()=>ML,ArrowHelper:()=>Tm,Audio:()=>q0,AudioAnalyser:()=>hV,AudioContext:()=>uV,AudioListener:()=>wk,AudioLoader:()=>cV,AxisHelper:()=>SL,BackSide:()=>jf,BasicDepthPacking:()=>yse,BasicShadowMap:()=>FIe,BinaryTextureLoader:()=>rV,BlendingMode:()=>Aoe,Bone:()=>eL,BooleanKeyframeTrack:()=>mL,BoundingBoxHelper:()=>f3e,Box2:()=>BM,Box3:()=>Zu,BoxBufferGeometry:()=>lm,BoxGeometry:()=>db,BoxHelper:()=>i_,BufferAttribute:()=>Mt,BufferGeometry:()=>Vt,BufferGeometryLoader:()=>nV,ByteType:()=>$oe,Cache:()=>Mk,Camera:()=>pa,CameraHelper:()=>bb,CanvasRenderer:()=>_3e,CanvasTexture:()=>iL,CatmullRomCurve3:()=>pV,CineonToneMapping:()=>Koe,CircleBufferGeometry:()=>G0,CircleGeometry:()=>pb,ClampToEdgeWrapping:()=>Ms,Clock:()=>Dk,ClosedSplineCurve3:()=>zse,Color:()=>Wt,ColorKeyframeTrack:()=>vL,CompressedTexture:()=>C0,CompressedTextureLoader:()=>Dse,ConeBufferGeometry:()=>fb,ConeGeometry:()=>hb,CubeCamera:()=>gL,CubeGeometry:()=>db,CubeReflectionMapping:()=>TL,CubeRefractionMapping:()=>ZR,CubeTexture:()=>Kf,CubeTextureLoader:()=>iV,CubeUVReflectionMapping:()=>EL,CubeUVRefractionMapping:()=>AL,CubicBezierCurve:()=>Mm,CubicBezierCurve3:()=>VOe,CubicInterpolant:()=>hL,CullFaceBack:()=>PM,CullFaceFront:()=>Nk,CullFaceFrontBack:()=>OIe,CullFaceNone:()=>woe,Curve:()=>da,CurvePath:()=>yb,CurveUtils:()=>Ab,CustomBlending:()=>Gk,CylinderBufferGeometry:()=>ih,CylinderGeometry:()=>dm,Cylindrical:()=>Ik,DataTexture:()=>sm,DataTextureLoader:()=>FOe,DefaultLoadingManager:()=>Ts,DepthFormat:()=>tm,DepthStencilFormat:()=>S0,DepthTexture:()=>KM,DirectionalLight:()=>uL,DirectionalLightHelper:()=>r_,DirectionalLightShadow:()=>lL,DiscreteInterpolant:()=>fL,DodecahedronBufferGeometry:()=>I0,DodecahedronGeometry:()=>tb,DoubleSide:()=>n_,DstAlphaFactor:()=>Noe,DstColorFactor:()=>Ooe,DynamicBufferAttribute:()=>r3e,EdgesGeometry:()=>V0,EdgesHelper:()=>p3e,EllipseCurve:()=>nh,EqualDepth:()=>Goe,EquirectangularReflectionMapping:()=>qk,EquirectangularRefractionMapping:()=>jR,Euler:()=>ep,EventDispatcher:()=>pl,ExtrudeGeometry:()=>ml,Face3:()=>ws,Face4:()=>XOe,FaceColors:()=>Fk,FaceNormalsHelper:()=>Mb,FileLoader:()=>vl,FlatShading:()=>Ok,Float32Attribute:()=>c3e,Float32BufferAttribute:()=>Mr,Float64Attribute:()=>h3e,Float64BufferAttribute:()=>YM,FloatType:()=>_0,Fog:()=>E0,FogExp2:()=>T0,Font:()=>lV,FontLoader:()=>Ise,FrontFaceDirectionCCW:()=>zIe,FrontFaceDirectionCW:()=>Toe,FrontSide:()=>y0,Frustum:()=>kM,GammaEncoding:()=>$k,Geometry:()=>ur,GeometryIdCount:()=>Qk,GeometryUtils:()=>v3e,GreaterDepth:()=>Woe,GreaterEqualDepth:()=>Hoe,GridHelper:()=>Sb,Group:()=>jM,HalfFloatType:()=>JR,HemisphereLight:()=>nL,HemisphereLightHelper:()=>t_,IcosahedronBufferGeometry:()=>P0,IcosahedronGeometry:()=>eb,ImageLoader:()=>Eb,ImageUtils:()=>g3e,ImmediateRenderObject:()=>_b,InstancedBufferAttribute:()=>K0,InstancedBufferGeometry:()=>wm,InstancedInterleavedBuffer:()=>j0,Int16Attribute:()=>o3e,Int16BufferAttribute:()=>WM,Int32Attribute:()=>l3e,Int32BufferAttribute:()=>XM,Int8Attribute:()=>i3e,Int8BufferAttribute:()=>VM,IntType:()=>ese,InterleavedBuffer:()=>Z0,InterleavedBufferAttribute:()=>Ck,Interpolant:()=>Zo,InterpolateDiscrete:()=>OM,InterpolateLinear:()=>DM,InterpolateSmooth:()=>YR,JSONLoader:()=>aV,KeyframeTrack:()=>xm,LOD:()=>ZM,LatheBufferGeometry:()=>F0,LatheGeometry:()=>cb,Layers:()=>$R,LensFlare:()=>Sk,LessDepth:()=>Voe,LessEqualDepth:()=>qR,Light:()=>Bi,LightShadow:()=>Am,Line:()=>rh,Line3:()=>rm,LineBasicMaterial:()=>Fi,LineCurve:()=>Ku,LineCurve3:()=>HOe,LineDashedMaterial:()=>_m,LinePieces:()=>qOe,LineSegments:()=>yi,LineStrip:()=>YOe,LinearEncoding:()=>FM,LinearFilter:()=>qo,LinearInterpolant:()=>vb,LinearMipMapLinearFilter:()=>Tb,LinearMipMapNearestFilter:()=>jk,LinearToneMapping:()=>Yk,Loader:()=>im,LoadingManager:()=>tV,LogLuvEncoding:()=>kIe,LoopOnce:()=>lse,LoopPingPong:()=>cse,LoopRepeat:()=>use,LuminanceAlphaFormat:()=>ose,LuminanceFormat:()=>ase,MOUSE:()=>UIe,Material:()=>_r,MaterialLoader:()=>DL,Math:()=>fr,Matrix3:()=>dl,Matrix4:()=>Kt,MaxEquation:()=>uk,Mesh:()=>_n,MeshBasicMaterial:()=>jo,MeshDepthMaterial:()=>$f,MeshFaceMaterial:()=>ZOe,MeshLambertMaterial:()=>ym,MeshNormalMaterial:()=>gm,MeshPhongMaterial:()=>nu,MeshPhysicalMaterial:()=>mm,MeshStandardMaterial:()=>ju,MeshToonMaterial:()=>vm,MinEquation:()=>lk,MirroredRepeatWrapping:()=>am,MixOperation:()=>Yoe,MorphBlendMesh:()=>Wn,MultiMaterial:()=>mb,MultiplyBlending:()=>Vk,MultiplyOperation:()=>wb,NearestFilter:()=>bs,NearestMipMapLinearFilter:()=>RL,NearestMipMapNearestFilter:()=>CL,NeverDepth:()=>Boe,NoBlending:()=>IM,NoColors:()=>bL,NoToneMapping:()=>XR,NormalBlending:()=>a_,NotEqualDepth:()=>Xoe,NumberKeyframeTrack:()=>Y0,Object3D:()=>Lt,ObjectLoader:()=>Pse,OctahedronBufferGeometry:()=>fm,OctahedronGeometry:()=>QM,OneFactor:()=>Doe,OneMinusDstAlphaFactor:()=>Uoe,OneMinusDstColorFactor:()=>zoe,OneMinusSrcAlphaFactor:()=>Xk,OneMinusSrcColorFactor:()=>Ioe,OrthographicCamera:()=>w0,PCFShadowMap:()=>Uk,PCFSoftShadowMap:()=>Eoe,ParametricBufferGeometry:()=>L0,ParametricGeometry:()=>JM,Particle:()=>KOe,ParticleBasicMaterial:()=>QOe,ParticleSystem:()=>JOe,ParticleSystemMaterial:()=>e3e,Path:()=>Cb,PerspectiveCamera:()=>ca,Plane:()=>xs,PlaneBufferGeometry:()=>um,PlaneGeometry:()=>ub,PointCloud:()=>jOe,PointCloudMaterial:()=>$Oe,PointLight:()=>sL,PointLightHelper:()=>Q0,Points:()=>A0,PointsMaterial:()=>iu,PolarGridHelper:()=>xL,PolyhedronBufferGeometry:()=>Ko,PolyhedronGeometry:()=>rb,PositionalAudio:()=>Tk,Projector:()=>y3e,PropertyBinding:()=>Ii,PropertyMixer:()=>yL,QuadraticBezierCurve:()=>bm,QuadraticBezierCurve3:()=>GOe,Quaternion:()=>cn,QuaternionKeyframeTrack:()=>gb,QuaternionLinearInterpolant:()=>pL,REVISION:()=>boe,RGBADepthPacking:()=>_se,RGBAFormat:()=>qu,RGBA_PVRTC_2BPPV1_Format:()=>_k,RGBA_PVRTC_4BPPV1_Format:()=>yk,RGBA_S3TC_DXT1_Format:()=>pk,RGBA_S3TC_DXT3_Format:()=>dk,RGBA_S3TC_DXT5_Format:()=>mk,RGBDEncoding:()=>gse,RGBEEncoding:()=>dse,RGBEFormat:()=>BIe,RGBFormat:()=>x0,RGBM16Encoding:()=>vse,RGBM7Encoding:()=>mse,RGB_ETC1_Format:()=>sse,RGB_PVRTC_2BPPV1_Format:()=>gk,RGB_PVRTC_4BPPV1_Format:()=>vk,RGB_S3TC_DXT1_Format:()=>fk,RawShaderMaterial:()=>W0,Ray:()=>Qf,Raycaster:()=>Rk,RectAreaLight:()=>bk,RectAreaLightHelper:()=>e_,ReinhardToneMapping:()=>Zoe,RepeatWrapping:()=>Qc,ReverseSubtractEquation:()=>Roe,RingBufferGeometry:()=>z0,RingGeometry:()=>lb,Scene:()=>cm,SceneUtils:()=>WOe,ShaderChunk:()=>jr,ShaderLib:()=>b0,ShaderMaterial:()=>Na,ShadowMaterial:()=>H0,Shape:()=>nm,ShapeBufferGeometry:()=>B0,ShapeGeometry:()=>k0,ShapePath:()=>sV,ShapeUtils:()=>Hn,ShortType:()=>Qoe,Skeleton:()=>QR,SkeletonHelper:()=>$0,SkinnedMesh:()=>tL,SmoothShading:()=>zk,Sphere:()=>fa,SphereBufferGeometry:()=>pm,SphereGeometry:()=>sb,Spherical:()=>Pk,SphericalReflectionMapping:()=>Zk,Spline:()=>BOe,SplineCurve:()=>Sm,SplineCurve3:()=>kOe,SpotLight:()=>oL,SpotLightHelper:()=>J0,SpotLightShadow:()=>aL,Sprite:()=>qM,SpriteMaterial:()=>hm,SrcAlphaFactor:()=>Wk,SrcAlphaSaturateFactor:()=>Foe,SrcColorFactor:()=>Poe,StereoCamera:()=>Nse,StringKeyframeTrack:()=>dL,SubtractEquation:()=>Coe,SubtractiveBlending:()=>kk,TetrahedronBufferGeometry:()=>D0,TetrahedronGeometry:()=>$M,TextGeometry:()=>ob,Texture:()=>ci,TextureFilter:()=>hk,TextureLoader:()=>LL,TextureMapping:()=>Joe,TextureWrapping:()=>ck,TorusBufferGeometry:()=>O0,TorusGeometry:()=>ab,TorusKnotBufferGeometry:()=>U0,TorusKnotGeometry:()=>nb,Triangle:()=>fl,TriangleFanDrawMode:()=>fse,TriangleStripDrawMode:()=>hse,TrianglesDrawMode:()=>Jk,TubeBufferGeometry:()=>N0,TubeGeometry:()=>ib,UVMapping:()=>wL,Uint16Attribute:()=>s3e,Uint16BufferAttribute:()=>eh,Uint32Attribute:()=>u3e,Uint32BufferAttribute:()=>th,Uint8Attribute:()=>n3e,Uint8BufferAttribute:()=>GM,Uint8ClampedAttribute:()=>a3e,Uint8ClampedBufferAttribute:()=>HM,Uncharted2ToneMapping:()=>joe,Uniform:()=>_L,UniformsLib:()=>dr,UniformsUtils:()=>Yo,UnsignedByteType:()=>KR,UnsignedInt248Type:()=>UM,UnsignedIntType:()=>Kk,UnsignedShort4444Type:()=>tse,UnsignedShort5551Type:()=>rse,UnsignedShort565Type:()=>ise,UnsignedShortType:()=>NM,Vector2:()=>Tt,Vector3:()=>oe,Vector4:()=>ii,VectorKeyframeTrack:()=>X0,Vertex:()=>t3e,VertexColors:()=>Em,VertexNormalsHelper:()=>xb,VideoTexture:()=>rL,WebGLRenderTarget:()=>o_,WebGLRenderTargetCube:()=>M0,WebGLRenderer:()=>eV,WireframeGeometry:()=>R0,WireframeHelper:()=>d3e,WrapAroundEnding:()=>zM,XHRLoader:()=>m3e,ZeroCurvatureEnding:()=>om,ZeroFactor:()=>Loe,ZeroSlopeEnding:()=>em,sRGBEncoding:()=>pse});function pl(){}function Tt(r,e){this.x=r||0,this.y=e||0}function ci(r,e,t,i,n,a,o,s,l,u){Object.defineProperty(this,"id",{value:VIe++}),this.uuid=fr.generateUUID(),this.name="",this.image=r!==void 0?r:ci.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=e!==void 0?e:ci.DEFAULT_MAPPING,this.wrapS=t!==void 0?t:Ms,this.wrapT=i!==void 0?i:Ms,this.magFilter=n!==void 0?n:qo,this.minFilter=a!==void 0?a:Tb,this.anisotropy=l!==void 0?l:1,this.format=o!==void 0?o:qu,this.type=s!==void 0?s:KR,this.offset=new Tt(0,0),this.repeat=new Tt(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u!==void 0?u:FM,this.version=0,this.onUpdate=null}function ii(r,e,t,i){this.x=r||0,this.y=e||0,this.z=t||0,this.w=i!==void 0?i:1}function o_(r,e,t){this.uuid=fr.generateUUID(),this.width=r,this.height=e,this.scissor=new ii(0,0,r,e),this.scissorTest=!1,this.viewport=new ii(0,0,r,e),t=t||{},t.minFilter===void 0&&(t.minFilter=qo),this.texture=new ci(void 0,void 0,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.depthBuffer=t.depthBuffer!==void 0?t.depthBuffer:!0,this.stencilBuffer=t.stencilBuffer!==void 0?t.stencilBuffer:!0,this.depthTexture=t.depthTexture!==void 0?t.depthTexture:null}function M0(r,e,t){o_.call(this,r,e,t),this.activeCubeFace=0,this.activeMipMapLevel=0}function cn(r,e,t,i){this._x=r||0,this._y=e||0,this._z=t||0,this._w=i!==void 0?i:1}function oe(r,e,t){this.x=r||0,this.y=e||0,this.z=t||0}function Kt(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Kf(r,e,t,i,n,a,o,s,l,u){r=r!==void 0?r:[],e=e!==void 0?e:TL,ci.call(this,r,e,t,i,n,a,o,s,l,u),this.flipY=!1}function Mse(){this.seq=[],this.map={}}function s_(r,e,t){var i=r[0];if(i<=0||i>0)return r;var n=e*t,a=voe[n];if(a===void 0&&(a=new Float32Array(n),voe[n]=a),e!==0){i.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=t,r[o].toArray(a,s)}return a}function bse(r,e){var t=goe[e];t===void 0&&(t=new Int32Array(e),goe[e]=t);for(var i=0;i!==e;++i)t[i]=r.allocTextureUnit();return t}function GIe(r,e){r.uniform1f(this.addr,e)}function HIe(r,e){r.uniform1i(this.addr,e)}function WIe(r,e){e.x===void 0?r.uniform2fv(this.addr,e):r.uniform2f(this.addr,e.x,e.y)}function XIe(r,e){e.x!==void 0?r.uniform3f(this.addr,e.x,e.y,e.z):e.r!==void 0?r.uniform3f(this.addr,e.r,e.g,e.b):r.uniform3fv(this.addr,e)}function YIe(r,e){e.x===void 0?r.uniform4fv(this.addr,e):r.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function qIe(r,e){r.uniformMatrix2fv(this.addr,!1,e.elements||e)}function ZIe(r,e){r.uniformMatrix3fv(this.addr,!1,e.elements||e)}function jIe(r,e){r.uniformMatrix4fv(this.addr,!1,e.elements||e)}function KIe(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTexture2D(e||xse,i)}function JIe(r,e,t){var i=t.allocTextureUnit();r.uniform1i(this.addr,i),t.setTextureCube(e||Sse,i)}function wse(r,e){r.uniform2iv(this.addr,e)}function Tse(r,e){r.uniform3iv(this.addr,e)}function Ese(r,e){r.uniform4iv(this.addr,e)}function $Ie(r){switch(r){case 5126:return GIe;case 35664:return WIe;case 35665:return XIe;case 35666:return YIe;case 35674:return qIe;case 35675:return ZIe;case 35676:return jIe;case 35678:return KIe;case 35680:return JIe;case 5124:case 35670:return HIe;case 35667:case 35671:return wse;case 35668:case 35672:return Tse;case 35669:case 35673:return Ese}}function QIe(r,e){r.uniform1fv(this.addr,e)}function eNe(r,e){r.uniform1iv(this.addr,e)}function tNe(r,e){r.uniform2fv(this.addr,s_(e,this.size,2))}function rNe(r,e){r.uniform3fv(this.addr,s_(e,this.size,3))}function iNe(r,e){r.uniform4fv(this.addr,s_(e,this.size,4))}function nNe(r,e){r.uniformMatrix2fv(this.addr,!1,s_(e,this.size,4))}function aNe(r,e){r.uniformMatrix3fv(this.addr,!1,s_(e,this.size,9))}function oNe(r,e){r.uniformMatrix4fv(this.addr,!1,s_(e,this.size,16))}function sNe(r,e,t){var i=e.length,n=bse(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTexture2D(e[a]||xse,n[a])}function lNe(r,e,t){var i=e.length,n=bse(t,i);r.uniform1iv(this.addr,n);for(var a=0;a!==i;++a)t.setTextureCube(e[a]||Sse,n[a])}function uNe(r){switch(r){case 5126:return QIe;case 35664:return tNe;case 35665:return rNe;case 35666:return iNe;case 35674:return nNe;case 35675:return aNe;case 35676:return oNe;case 35678:return sNe;case 35680:return lNe;case 5124:case 35670:return eNe;case 35667:case 35671:return wse;case 35668:case 35672:return Tse;case 35669:case 35673:return Ese}}function cNe(r,e,t){this.id=r,this.addr=t,this.setValue=$Ie(e.type)}function hNe(r,e,t){this.id=r,this.addr=t,this.size=e.size,this.setValue=uNe(e.type)}function Ase(r){this.id=r,Mse.call(this)}function yoe(r,e){r.seq.push(e),r.map[e.id]=e}function fNe(r,e,t){var i=r.name,n=i.length;for(ok.lastIndex=0;;){var a=ok.exec(i),o=ok.lastIndex,s=a[1],l=a[2]==="]",u=a[3];if(l&&(s=s|0),u===void 0||u==="["&&o+2===n){yoe(t,u===void 0?new cNe(s,r,e):new hNe(s,r,e));break}else{var c=t.map,h=c[s];h===void 0&&(h=new Ase(s),yoe(t,h)),t=h}}}function Jf(r,e,t){Mse.call(this),this.renderer=t;for(var i=r.getProgramParameter(e,r.ACTIVE_UNIFORMS),n=0;n!==i;++n){var a=r.getActiveUniform(e,n),o=a.name,s=r.getUniformLocation(e,o);fNe(a,s,this)}}function Wt(r,e,t){return e===void 0&&t===void 0?this.set(r):this.setRGB(r,e,t)}function sm(r,e,t,i,n,a,o,s,l,u,c,h){ci.call(this,null,a,o,s,l,u,i,n,c,h),this.image={data:r,width:e,height:t},this.magFilter=l!==void 0?l:bs,this.minFilter=u!==void 0?u:bs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function BM(r,e){this.min=r!==void 0?r:new Tt(1/0,1/0),this.max=e!==void 0?e:new Tt(-1/0,-1/0)}function fOe(r,e){var t=r.context,i=r.state,n,a,o,s,l,u,c,h;function f(){var d=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),g=new Uint16Array([0,1,2,0,2,3]);n=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,g,t.STATIC_DRAW),c=t.createTexture(),h=t.createTexture(),i.bindTexture(t.TEXTURE_2D,c),t.texImage2D(t.TEXTURE_2D,0,t.RGB,16,16,0,t.RGB,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),i.bindTexture(t.TEXTURE_2D,h),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,16,16,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),o={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join(` `),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join(` `)},s=p(o),l={vertex:t.getAttribLocation(s,"position"),uv:t.getAttribLocation(s,"uv")},u={renderType:t.getUniformLocation(s,"renderType"),map:t.getUniformLocation(s,"map"),occlusionMap:t.getUniformLocation(s,"occlusionMap"),opacity:t.getUniformLocation(s,"opacity"),color:t.getUniformLocation(s,"color"),scale:t.getUniformLocation(s,"scale"),rotation:t.getUniformLocation(s,"rotation"),screenPosition:t.getUniformLocation(s,"screenPosition")}}this.render=function(d,g,m){if(e.length!==0){var v=new oe,_=m.w/m.z,y=m.z*.5,x=m.w*.5,M=16/m.w,S=new Tt(M*_,M),w=new oe(1,1,0),T=new Tt(1,1),C=new BM;C.min.set(m.x,m.y),C.max.set(m.x+(m.z-16),m.y+(m.w-16)),s===void 0&&f(),t.useProgram(s),i.initAttributes(),i.enableAttribute(l.vertex),i.enableAttribute(l.uv),i.disableUnusedAttributes(),t.uniform1i(u.occlusionMap,0),t.uniform1i(u.map,1),t.bindBuffer(t.ARRAY_BUFFER,n),t.vertexAttribPointer(l.vertex,2,t.FLOAT,!1,2*8,0),t.vertexAttribPointer(l.uv,2,t.FLOAT,!1,2*8,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),i.disable(t.CULL_FACE),i.setDepthWrite(!1);for(var b=0,E=e.length;b .001&&P.scale>.001&&(w.x=P.x,w.y=P.y,w.z=P.z,M=P.size*P.scale/m.w,S.x=M*_,S.y=M,t.uniform3f(u.screenPosition,w.x,w.y,w.z),t.uniform2f(u.scale,S.x,S.y),t.uniform1f(u.rotation,P.rotation),t.uniform1f(u.opacity,P.opacity),t.uniform3f(u.color,P.color.r,P.color.g,P.color.b),i.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),r.setTexture2D(P.texture,1),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0))}}}i.enable(t.CULL_FACE),i.enable(t.DEPTH_TEST),i.setDepthWrite(!0),r.resetGLState()}};function p(d){var g=t.createProgram(),m=t.createShader(t.FRAGMENT_SHADER),v=t.createShader(t.VERTEX_SHADER),_="precision "+r.getPrecision()+` float; -`;return t.shaderSource(m,_+d.fragmentShader),t.shaderSource(v,_+d.vertexShader),t.compileShader(m),t.compileShader(v),t.attachShader(g,m),t.attachShader(g,v),t.linkProgram(g),g}}function dOe(r,e){var t=r.context,i=r.state,n,a,o,s,l,u,c=new oe,h=new cn,f=new oe;function p(){var m=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),v=new Uint16Array([0,1,2,0,2,3]);n=t.createBuffer(),a=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.bufferData(t.ELEMENT_ARRAY_BUFFER,v,t.STATIC_DRAW),o=d(),s={position:t.getAttribLocation(o,"position"),uv:t.getAttribLocation(o,"uv")},l={uvOffset:t.getUniformLocation(o,"uvOffset"),uvScale:t.getUniformLocation(o,"uvScale"),rotation:t.getUniformLocation(o,"rotation"),scale:t.getUniformLocation(o,"scale"),color:t.getUniformLocation(o,"color"),map:t.getUniformLocation(o,"map"),opacity:t.getUniformLocation(o,"opacity"),modelViewMatrix:t.getUniformLocation(o,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(o,"projectionMatrix"),fogType:t.getUniformLocation(o,"fogType"),fogDensity:t.getUniformLocation(o,"fogDensity"),fogNear:t.getUniformLocation(o,"fogNear"),fogFar:t.getUniformLocation(o,"fogFar"),fogColor:t.getUniformLocation(o,"fogColor"),alphaTest:t.getUniformLocation(o,"alphaTest")};var _=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");_.width=8,_.height=8;var y=_.getContext("2d");y.fillStyle="white",y.fillRect(0,0,8,8),u=new ci(_),u.needsUpdate=!0}this.render=function(m,v){if(e.length!==0){o===void 0&&p(),t.useProgram(o),i.initAttributes(),i.enableAttribute(s.position),i.enableAttribute(s.uv),i.disableUnusedAttributes(),i.disable(t.CULL_FACE),i.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,n),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,2*8,0),t.vertexAttribPointer(s.uv,2,t.FLOAT,!1,2*8,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,a),t.uniformMatrix4fv(l.projectionMatrix,!1,v.projectionMatrix.elements),i.activeTexture(t.TEXTURE0),t.uniform1i(l.map,0);var _=0,y=0,x=m.fog;x?(t.uniform3f(l.fogColor,x.color.r,x.color.g,x.color.b),x.isFog?(t.uniform1f(l.fogNear,x.near),t.uniform1f(l.fogFar,x.far),t.uniform1i(l.fogType,1),_=1,y=1):x.isFogExp2&&(t.uniform1f(l.fogDensity,x.density),t.uniform1i(l.fogType,2),_=2,y=2)):(t.uniform1i(l.fogType,0),_=0,y=0);for(var M=0,S=e.length;M 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join(` -`)),t.compileShader(v),t.compileShader(_),t.attachShader(m,v),t.attachShader(m,_),t.linkProgram(m),m}function g(m,v){return m.renderOrder!==v.renderOrder?m.renderOrder-v.renderOrder:m.z!==v.z?v.z-m.z:v.id-m.id}}function _r(){Object.defineProperty(this,"id",{value:mOe++}),this.uuid=fr.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=a_,this.side=y0,this.shading=zk,this.vertexColors=bL,this.opacity=1,this.transparent=!1,this.blendSrc=Wk,this.blendDst=Xk,this.blendEquation=Hk,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=qR,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0}function Na(r){_r.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() { +`)),t.compileShader(v),t.compileShader(_),t.attachShader(m,v),t.attachShader(m,_),t.linkProgram(m),m}function g(m,v){return m.renderOrder!==v.renderOrder?m.renderOrder-v.renderOrder:m.z!==v.z?v.z-m.z:v.id-m.id}}function _r(){Object.defineProperty(this,"id",{value:dOe++}),this.uuid=fr.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=a_,this.side=y0,this.shading=zk,this.vertexColors=bL,this.opacity=1,this.transparent=!1,this.blendSrc=Wk,this.blendDst=Xk,this.blendEquation=Hk,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=qR,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0}function Na(r){_r.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=`void main() { gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }`,this.fragmentShader=`void main() { gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); -}`,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,r!==void 0&&(r.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(r))}function $f(r){_r.call(this),this.type="MeshDepthMaterial",this.depthPacking=_se,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(r)}function Zu(r,e){this.min=r!==void 0?r:new oe(1/0,1/0,1/0),this.max=e!==void 0?e:new oe(-1/0,-1/0,-1/0)}function ha(r,e){this.center=r!==void 0?r:new oe,this.radius=e!==void 0?e:0}function dl(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function xs(r,e){this.normal=r!==void 0?r:new oe(1,0,0),this.constant=e!==void 0?e:0}function kM(r,e,t,i,n,a){this.planes=[r!==void 0?r:new xs,e!==void 0?e:new xs,t!==void 0?t:new xs,i!==void 0?i:new xs,n!==void 0?n:new xs,a!==void 0?a:new xs]}function Rse(r,e,t,i){var n=r.context,a=r.state,o=new kM,s=new Kt,l=e.shadows,u=new Tt,c=new Tt(i.maxTextureSize,i.maxTextureSize),h=new oe,f=new oe,p=[],d=1,g=2,m=(d|g)+1,v=new Array(m),_=new Array(m),y={},x=[new oe(1,0,0),new oe(-1,0,0),new oe(0,0,1),new oe(0,0,-1),new oe(0,1,0),new oe(0,-1,0)],M=[new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,0,1),new oe(0,0,-1)],S=[new ii,new ii,new ii,new ii,new ii,new ii],w=new $f;w.depthPacking=xse,w.clipping=!0;for(var T=b0.distanceRGBA,C=Yo.clone(T.uniforms),b=0;b!==m;++b){var E=(b&d)!==0,I=(b&g)!==0,R=w.clone();R.morphTargets=E,R.skinning=I,v[b]=R;var A=new Na({defines:{USE_SHADOWMAP:""},uniforms:C,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,morphTargets:E,skinning:I,clipping:!0});_[b]=A}var P=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Uk,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(z,k){if(P.enabled!==!1&&!(P.autoUpdate===!1&&P.needsUpdate===!1)&&l.length!==0){a.buffers.color.setClear(1,1,1,1),a.disable(n.BLEND),a.setDepthTest(!0),a.setScissorTest(!1);for(var G,Y,J=0,Q=l.length;J0:J&&J.isGeometry&&(ae=J.morphTargets&&J.morphTargets.length>0));var ve=z.isSkinnedMesh&&k.skinning,ue=0;ae&&(ue|=d),ve&&(ue|=g),Q=V[ue]}if(r.localClippingEnabled&&k.clipShadows===!0&&k.clippingPlanes.length!==0){var se=Q.uuid,Ee=k.uuid,q=y[se];q===void 0&&(q={},y[se]=q);var H=q[Ee];H===void 0&&(H=Q.clone(),q[Ee]=H),Q=H}Q.visible=k.visible,Q.wireframe=k.wireframe;var We=k.side;return P.renderSingleSided&&We==n_&&(We=y0),P.renderReverseSided&&(We===y0?We=jf:We===jf&&(We=y0)),Q.side=We,Q.clipShadows=k.clipShadows,Q.clippingPlanes=k.clippingPlanes,Q.wireframeLinewidth=k.wireframeLinewidth,Q.linewidth=k.linewidth,G&&Q.uniforms.lightPos!==void 0&&Q.uniforms.lightPos.value.copy(Y),Q}function B(z,k,G){if(z.visible!==!1){var Y=(z.layers.mask&k.layers.mask)!==0;if(Y&&(z.isMesh||z.isLine||z.isPoints)&&z.castShadow&&(z.frustumCulled===!1||o.intersectsObject(z)===!0)){var J=z.material;J.visible===!0&&(z.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,z.matrixWorld),p.push(z))}for(var Q=z.children,V=0,K=Q.length;V65535?Uint32Array:Uint16Array)(l),c=new Float32Array(s*3),h=new Float32Array(s*3),f=new Float32Array(s*2),p=0,d=0,g=0,m=0,v=0;x("z","y","x",-1,-1,t,e,r,a,n,0),x("z","y","x",1,-1,t,e,-r,a,n,1),x("x","z","y",1,1,r,t,e,i,a,2),x("x","z","y",1,-1,r,t,-e,i,a,3),x("x","y","z",1,-1,r,e,t,i,n,4),x("x","y","z",-1,-1,r,e,-t,i,n,5),this.setIndex(new Mt(u,1)),this.addAttribute("position",new Mt(c,3)),this.addAttribute("normal",new Mt(h,3)),this.addAttribute("uv",new Mt(f,2));function _(M,S,w){var T=0;return T+=(M+1)*(S+1)*2,T+=(M+1)*(w+1)*2,T+=(w+1)*(S+1)*2,T}function y(M,S,w){var T=0;return T+=M*S*2,T+=M*w*2,T+=w*S*2,T*6}function x(M,S,w,T,C,b,E,I,R,A,P){for(var U=b/R,B=E/A,z=b/2,k=E/2,G=I/2,Y=R+1,J=A+1,Q=0,V=0,K=new oe,ae=0;ae 0?1:-1,h[p]=K.x,h[p+1]=K.y,h[p+2]=K.z,f[d]=ue/R,f[d+1]=1-ae/A,p+=3,d+=2,Q+=1}for(ae=0;ae65535?Uint32Array:Uint16Array)(o*s*6),v=0;v 0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function xs(r,e){this.normal=r!==void 0?r:new oe(1,0,0),this.constant=e!==void 0?e:0}function kM(r,e,t,i,n,a){this.planes=[r!==void 0?r:new xs,e!==void 0?e:new xs,t!==void 0?t:new xs,i!==void 0?i:new xs,n!==void 0?n:new xs,a!==void 0?a:new xs]}function Cse(r,e,t,i){var n=r.context,a=r.state,o=new kM,s=new Kt,l=e.shadows,u=new Tt,c=new Tt(i.maxTextureSize,i.maxTextureSize),h=new oe,f=new oe,p=[],d=1,g=2,m=(d|g)+1,v=new Array(m),_=new Array(m),y={},x=[new oe(1,0,0),new oe(-1,0,0),new oe(0,0,1),new oe(0,0,-1),new oe(0,1,0),new oe(0,-1,0)],M=[new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,1,0),new oe(0,0,1),new oe(0,0,-1)],S=[new ii,new ii,new ii,new ii,new ii,new ii],w=new $f;w.depthPacking=_se,w.clipping=!0;for(var T=b0.distanceRGBA,C=Yo.clone(T.uniforms),b=0;b!==m;++b){var E=(b&d)!==0,I=(b&g)!==0,R=w.clone();R.morphTargets=E,R.skinning=I,v[b]=R;var A=new Na({defines:{USE_SHADOWMAP:""},uniforms:C,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,morphTargets:E,skinning:I,clipping:!0});_[b]=A}var P=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Uk,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(z,k){if(P.enabled!==!1&&!(P.autoUpdate===!1&&P.needsUpdate===!1)&&l.length!==0){a.buffers.color.setClear(1,1,1,1),a.disable(n.BLEND),a.setDepthTest(!0),a.setScissorTest(!1);for(var G,Y,J=0,Q=l.length;J0:J&&J.isGeometry&&(ae=J.morphTargets&&J.morphTargets.length>0));var ve=z.isSkinnedMesh&&k.skinning,ue=0;ae&&(ue|=d),ve&&(ue|=g),Q=V[ue]}if(r.localClippingEnabled&&k.clipShadows===!0&&k.clippingPlanes.length!==0){var se=Q.uuid,Ee=k.uuid,q=y[se];q===void 0&&(q={},y[se]=q);var H=q[Ee];H===void 0&&(H=Q.clone(),q[Ee]=H),Q=H}Q.visible=k.visible,Q.wireframe=k.wireframe;var We=k.side;return P.renderSingleSided&&We==n_&&(We=y0),P.renderReverseSided&&(We===y0?We=jf:We===jf&&(We=y0)),Q.side=We,Q.clipShadows=k.clipShadows,Q.clippingPlanes=k.clippingPlanes,Q.wireframeLinewidth=k.wireframeLinewidth,Q.linewidth=k.linewidth,G&&Q.uniforms.lightPos!==void 0&&Q.uniforms.lightPos.value.copy(Y),Q}function B(z,k,G){if(z.visible!==!1){var Y=(z.layers.mask&k.layers.mask)!==0;if(Y&&(z.isMesh||z.isLine||z.isPoints)&&z.castShadow&&(z.frustumCulled===!1||o.intersectsObject(z)===!0)){var J=z.material;J.visible===!0&&(z.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,z.matrixWorld),p.push(z))}for(var Q=z.children,V=0,K=Q.length;V65535?Uint32Array:Uint16Array)(l),c=new Float32Array(s*3),h=new Float32Array(s*3),f=new Float32Array(s*2),p=0,d=0,g=0,m=0,v=0;x("z","y","x",-1,-1,t,e,r,a,n,0),x("z","y","x",1,-1,t,e,-r,a,n,1),x("x","z","y",1,1,r,t,e,i,a,2),x("x","z","y",1,-1,r,t,-e,i,a,3),x("x","y","z",1,-1,r,e,t,i,n,4),x("x","y","z",-1,-1,r,e,-t,i,n,5),this.setIndex(new Mt(u,1)),this.addAttribute("position",new Mt(c,3)),this.addAttribute("normal",new Mt(h,3)),this.addAttribute("uv",new Mt(f,2));function _(M,S,w){var T=0;return T+=(M+1)*(S+1)*2,T+=(M+1)*(w+1)*2,T+=(w+1)*(S+1)*2,T}function y(M,S,w){var T=0;return T+=M*S*2,T+=M*w*2,T+=w*S*2,T*6}function x(M,S,w,T,C,b,E,I,R,A,P){for(var U=b/R,B=E/A,z=b/2,k=E/2,G=I/2,Y=R+1,J=A+1,Q=0,V=0,K=new oe,ae=0;ae 0?1:-1,h[p]=K.x,h[p+1]=K.y,h[p+2]=K.z,f[d]=ue/R,f[d+1]=1-ae/A,p+=3,d+=2,Q+=1}for(ae=0;ae65535?Uint32Array:Uint16Array)(o*s*6),v=0;v /g;function t(i,n){var a=jr[n];if(a===void 0)throw new Error("Can not resolve #include <"+n+">");return xk(a)}return r.replace(e,t)}function Moe(r){var e=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function t(i,n,a,o){for(var s="",l=parseInt(n);l0?r.gammaFactor:1,d=TOe(a,i,r.extensions),g=EOe(o),m=n.createProgram(),v,_;t.isRawShaderMaterial?(v=[g,` +`)}function _oe(r,e,t){var i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),r.getShaderParameter(i,r.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),r.getShaderInfoLog(i)!==""&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===r.VERTEX_SHADER?"vertex":"fragment",r.getShaderInfoLog(i),xOe(t)),i}function Lse(r){switch(r){case FM:return["Linear","( value )"];case pse:return["sRGB","( value )"];case dse:return["RGBE","( value )"];case mse:return["RGBM","( value, 7.0 )"];case vse:return["RGBM","( value, 16.0 )"];case gse:return["RGBD","( value, 256.0 )"];case $k:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+r)}}function sk(r,e){var t=Lse(e);return"vec4 "+r+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function MOe(r,e){var t=Lse(e);return"vec4 "+r+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function bOe(r,e){var t;switch(e){case Yk:t="Linear";break;case Zoe:t="Reinhard";break;case joe:t="Uncharted2";break;case Koe:t="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function wOe(r,e,t){r=r||{};var i=[r.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(r.fragDepth||e.logarithmicDepthBuffer)&&t.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",r.drawBuffers&&t.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(r.shaderTextureLOD||e.envMap)&&t.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return i.filter(LM).join(` +`)}function TOe(r){var e=[];for(var t in r){var i=r[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function EOe(r,e,t){for(var i={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES),a=0;a /g;function t(i,n){var a=jr[n];if(a===void 0)throw new Error("Can not resolve #include <"+n+">");return xk(a)}return r.replace(e,t)}function Soe(r){var e=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function t(i,n,a,o){for(var s="",l=parseInt(n);l 0?r.gammaFactor:1,d=wOe(a,i,r.extensions),g=TOe(o),m=n.createProgram(),v,_;t.isRawShaderMaterial?(v=[g,` `].filter(LM).join(` `),_=[d,g,` `].filter(LM).join(` `)):(v=["precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+t.__webglShader.name,g,i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+i.maxBones,i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&r.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(LM).join(` -`),_=[d,"precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+t.__webglShader.name,g,i.alphaTest?"#define ALPHATEST "+i.alphaTest:"","#define GAMMA_FACTOR "+p,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+h:"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(i.numClippingPlanes-i.numClipIntersection),i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&r.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",i.envMap&&r.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",i.toneMapping!==XR?"#define TONE_MAPPING":"",i.toneMapping!==XR?jr.tonemapping_pars_fragment:"",i.toneMapping!==XR?wOe("toneMapping",i.toneMapping):"",i.outputEncoding||i.mapEncoding||i.envMapEncoding||i.emissiveMapEncoding?jr.encodings_pars_fragment:"",i.mapEncoding?sk("mapTexelToLinear",i.mapEncoding):"",i.envMapEncoding?sk("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMapEncoding?sk("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.outputEncoding?bOe("linearToOutputTexel",i.outputEncoding):"",i.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`),_=[d,"precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+t.__webglShader.name,g,i.alphaTest?"#define ALPHATEST "+i.alphaTest:"","#define GAMMA_FACTOR "+p,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+h:"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(i.numClippingPlanes-i.numClipIntersection),i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&r.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",i.envMap&&r.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",i.toneMapping!==XR?"#define TONE_MAPPING":"",i.toneMapping!==XR?jr.tonemapping_pars_fragment:"",i.toneMapping!==XR?bOe("toneMapping",i.toneMapping):"",i.outputEncoding||i.mapEncoding||i.envMapEncoding||i.emissiveMapEncoding?jr.encodings_pars_fragment:"",i.mapEncoding?sk("mapTexelToLinear",i.mapEncoding):"",i.envMapEncoding?sk("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMapEncoding?sk("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.outputEncoding?MOe("linearToOutputTexel",i.outputEncoding):"",i.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(LM).join(` -`)),s=xk(s,i),s=Soe(s,i),l=xk(l,i),l=Soe(l,i),t.isShaderMaterial||(s=Moe(s),l=Moe(l));var y=v+s,x=_+l,M=xoe(n,n.VERTEX_SHADER,y),S=xoe(n,n.FRAGMENT_SHADER,x);n.attachShader(m,M),n.attachShader(m,S),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):i.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m);var w=n.getProgramInfoLog(m),T=n.getShaderInfoLog(M),C=n.getShaderInfoLog(S),b=!0,E=!0;n.getProgramParameter(m,n.LINK_STATUS)===!1?(b=!1,console.error("THREE.WebGLProgram: shader error: ",n.getError(),"gl.VALIDATE_STATUS",n.getProgramParameter(m,n.VALIDATE_STATUS),"gl.getProgramInfoLog",w,T,C)):w!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",w):(T===""||C==="")&&(E=!1),E&&(this.diagnostics={runnable:b,material:t,programLog:w,vertexShader:{log:T,prefix:v},fragmentShader:{log:C,prefix:_}}),n.deleteShader(M),n.deleteShader(S);var I;this.getUniforms=function(){return I===void 0&&(I=new Jf(n,m,r)),I};var R;return this.getAttributes=function(){return R===void 0&&(R=AOe(n,m)),R},this.destroy=function(){n.deleteProgram(m),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=MOe++,this.code=e,this.usedTimes=1,this.program=m,this.vertexShader=M,this.fragmentShader=S,this}function ROe(r,e){var t=[],i={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},n=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking"];function a(s){if(e.floatVertexTextures&&s&&s.skeleton&&s.skeleton.useVertexTexture)return 1024;var l=e.maxVertexUniforms,u=Math.floor((l-20)/4),c=u;return s!==void 0&&s&&s.isSkinnedMesh&&(c=Math.min(s.skeleton.bones.length,c),c 0,shadowMapType:r.shadowMap.type,toneMapping:r.toneMapping,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,alphaTest:s.alphaTest,doubleSided:s.side===n_,flipSided:s.side===jf,depthPacking:s.depthPacking!==void 0?s.depthPacking:!1};return v},this.getProgramCode=function(s,l){var u=[];if(l.shaderID?u.push(l.shaderID):(u.push(s.fragmentShader),u.push(s.vertexShader)),s.defines!==void 0)for(var c in s.defines)u.push(c),u.push(s.defines[c]);for(var h=0;h 65535?Uint32Array:Uint16Array,C=new Mt(new T(p),1);return a(C,r.ELEMENT_ARRAY_BUFFER),f.wireframe=C,C}return{getAttributeBuffer:l,getAttributeProperties:u,getWireframeAttribute:c,update:n}}function POe(r,e,t,i,n,a,o){var s=o.memory,l=typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext;function u(R,A){if(R.width>A||R.height>A){var P=A/Math.max(R.width,R.height),U=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");U.width=Math.floor(R.width*P),U.height=Math.floor(R.height*P);var B=U.getContext("2d");return B.drawImage(R,0,0,R.width,R.height,0,0,U.width,U.height),console.warn("THREE.WebGLRenderer: image is too big ("+R.width+"x"+R.height+"). Resized to "+U.width+"x"+U.height,R),U}return R}function c(R){return fr.isPowerOfTwo(R.width)&&fr.isPowerOfTwo(R.height)}function h(R){if(R instanceof HTMLImageElement||R instanceof HTMLCanvasElement){var A=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");A.width=fr.nearestPowerOfTwo(R.width),A.height=fr.nearestPowerOfTwo(R.height);var P=A.getContext("2d");return P.drawImage(R,0,0,A.width,A.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+R.width+"x"+R.height+"). Resized to "+A.width+"x"+A.height,R),A}return R}function f(R){return R.wrapS!==Ms||R.wrapT!==Ms||R.minFilter!==bs&&R.minFilter!==qo}function p(R){return R===bs||R===CL||R===RL?r.NEAREST:r.LINEAR}function d(R){var A=R.target;A.removeEventListener("dispose",d),m(A),s.textures--}function g(R){var A=R.target;A.removeEventListener("dispose",g),v(A),s.textures--}function m(R){var A=i.get(R);if(R.image&&A.__image__webglTextureCube)r.deleteTexture(A.__image__webglTextureCube);else{if(A.__webglInit===void 0)return;r.deleteTexture(A.__webglTexture)}i.delete(R)}function v(R){var A=i.get(R),P=i.get(R.texture);if(R){if(P.__webglTexture!==void 0&&r.deleteTexture(P.__webglTexture),R.depthTexture&&R.depthTexture.dispose(),R.isWebGLRenderTargetCube)for(var U=0;U<6;U++)r.deleteFramebuffer(A.__webglFramebuffer[U]),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer[U]);else r.deleteFramebuffer(A.__webglFramebuffer),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer);i.delete(R.texture),i.delete(R)}}function _(R,A){var P=i.get(R);if(R.version>0&&P.__version!==R.version){var U=R.image;if(U===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",R);else if(U.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",R);else{S(P,R,A);return}}t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_2D,P.__webglTexture)}function y(R,A){var P=i.get(R);if(R.image.length===6)if(R.version>0&&P.__version!==R.version){P.__image__webglTextureCube||(R.addEventListener("dispose",d),P.__image__webglTextureCube=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,P.__image__webglTextureCube),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,R.flipY);for(var U=R&&R.isCompressedTexture,B=R.image[0]&&R.image[0].isDataTexture,z=[],k=0;k<6;k++)!U&&!B?z[k]=u(R.image[k],n.maxCubemapSize):z[k]=B?R.image[k].image:R.image[k];var G=z[0],Y=c(G),J=a(R.format),Q=a(R.type);M(r.TEXTURE_CUBE_MAP,R,Y);for(var k=0;k<6;k++)if(!U)B?t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,z[k].width,z[k].height,0,J,Q,z[k].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,J,Q,z[k]);else for(var V,K=z[k].mipmaps,ae=0,ve=K.length;ae -1?t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,V.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,J,Q,V.data);R.generateMipmaps&&Y&&r.generateMipmap(r.TEXTURE_CUBE_MAP),P.__version=R.version,R.onUpdate&&R.onUpdate(R)}else t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,P.__image__webglTextureCube)}function x(R,A){t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,i.get(R).__webglTexture)}function M(R,A,P){var U;if(P?(r.texParameteri(R,r.TEXTURE_WRAP_S,a(A.wrapS)),r.texParameteri(R,r.TEXTURE_WRAP_T,a(A.wrapT)),r.texParameteri(R,r.TEXTURE_MAG_FILTER,a(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,a(A.minFilter))):(r.texParameteri(R,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(R,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(A.wrapS!==Ms||A.wrapT!==Ms)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",A),r.texParameteri(R,r.TEXTURE_MAG_FILTER,p(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,p(A.minFilter)),A.minFilter!==bs&&A.minFilter!==qo&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",A)),U=e.get("EXT_texture_filter_anisotropic"),U){if(A.type===_0&&e.get("OES_texture_float_linear")===null||A.type===JR&&e.get("OES_texture_half_float_linear")===null)return;(A.anisotropy>1||i.get(A).__currentAnisotropy)&&(r.texParameterf(R,U.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,n.getMaxAnisotropy())),i.get(A).__currentAnisotropy=A.anisotropy)}}function S(R,A,P){R.__webglInit===void 0&&(R.__webglInit=!0,A.addEventListener("dispose",d),R.__webglTexture=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+P),t.bindTexture(r.TEXTURE_2D,R.__webglTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment);var U=u(A.image,n.maxTextureSize);f(A)&&c(U)===!1&&(U=h(U));var B=c(U),z=a(A.format),k=a(A.type);M(r.TEXTURE_2D,A,B);var G,Y=A.mipmaps;if(A.isDepthTexture){var J=r.DEPTH_COMPONENT;if(A.type===_0){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");J=r.DEPTH_COMPONENT32F}else l&&(J=r.DEPTH_COMPONENT16);A.format===tm&&J===r.DEPTH_COMPONENT&&A.type!==NM&&A.type!==Kk&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),A.type=NM,k=a(A.type)),A.format===S0&&(J=r.DEPTH_STENCIL,A.type!==UM&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),A.type=UM,k=a(A.type))),t.texImage2D(r.TEXTURE_2D,0,J,U.width,U.height,0,z,k,null)}else if(A.isDataTexture)if(Y.length>0&&B){for(var Q=0,V=Y.length;Q -1?t.compressedTexImage2D(r.TEXTURE_2D,Q,z,G.width,G.height,0,G.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(r.TEXTURE_2D,Q,z,G.width,G.height,0,z,k,G.data);else if(Y.length>0&&B){for(var Q=0,V=Y.length;Q =1,U=null,B={},z=new ii,k=new ii;function G($,nt,Xe){var Fe=new Uint8Array(4),we=r.createTexture();r.bindTexture($,we),r.texParameteri($,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri($,r.TEXTURE_MAG_FILTER,r.NEAREST);for(var Ie=0;Ie 0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=t.precision!==void 0?t.precision:"highp",s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=t.logarithmicDepthBuffer===!0&&!!e.get("EXT_frag_depth"),u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),c=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=r.getParameter(r.MAX_TEXTURE_SIZE),f=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),d=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),g=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),v=c>0,_=!!e.get("OES_texture_float"),y=v&&_;return{getMaxAnisotropy:n,getMaxPrecision:a,precision:o,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:c,maxTextureSize:h,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:d,maxVaryings:g,maxFragmentUniforms:m,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:y}}function OOe(r){var e={};return{get:function(t){if(e[t]!==void 0)return e[t];var i;switch(t){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":i=r.getExtension("WEBGL_compressed_texture_etc1");break;default:i=r.getExtension(t)}return i===null&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e[t]=i,i}}}function zOe(){var r=this,e=null,t=0,i=!1,n=!1,a=new xs,o=new dl,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(c,h,f){var p=c.length!==0||h||t!==0||i;return i=h,e=u(c,f,0),t=c.length,p},this.beginShadows=function(){n=!0,u(null)},this.endShadows=function(){n=!1,l()},this.setState=function(c,h,f,p,d,g){if(!i||c===null||c.length===0||n&&!f)n?u(null):l();else{var m=n?0:t,v=m*4,_=d.clippingState||null;s.value=_,_=u(c,p,v,g);for(var y=0;y!==v;++y)_[y]=e[y];d.clippingState=_,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=m}};function l(){s.value!==e&&(s.value=e,s.needsUpdate=t>0),r.numPlanes=t,r.numIntersection=0}function u(c,h,f,p){var d=c!==null?c.length:0,g=null;if(d!==0){if(g=s.value,p!==!0||g===null){var m=f+d*4,v=h.matrixWorldInverse;o.getNormalMatrix(v),(g===null||g.length 8&&($e.length=8);for(var _i=ee.morphAttributes,lt=0,Ct=$e.length;lt 0&&Ei.renderInstances(ee,np,IL):Ei.render(np,IL)}};function ct(D,W,ee,ge){var ce;if(ee&&ee.isInstancedBufferGeometry&&(ce=We.get("ANGLE_instanced_arrays"),ce===null)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}ge===void 0&&(ge=0),xe.initAttributes();var Oe=ee.attributes,Ge=W.getAttributes(),Re=D.defaultAttributeValues;for(var gt in Ge){var _t=Ge[gt];if(_t>=0){var $e=Oe[gt];if($e!==void 0){var lt=$e.normalized,Ct=$e.itemSize,je=Ne.getAttributeProperties($e),_i=je.__webglBuffer,Ft=je.type,Nr=je.bytesPerElement;if($e.isInterleavedBufferAttribute){var Yi=$e.data,Et=Yi.stride,Ei=$e.offset;Yi&&Yi.isInstancedInterleavedBuffer?(xe.enableAttributeAndDivisor(_t,Yi.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=Yi.meshPerAttribute*Yi.count)):xe.enableAttribute(_t),q.bindBuffer(q.ARRAY_BUFFER,_i),q.vertexAttribPointer(_t,Ct,Ft,lt,Et*Nr,(ge*Et+Ei)*Nr)}else $e.isInstancedBufferAttribute?(xe.enableAttributeAndDivisor(_t,$e.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=$e.meshPerAttribute*$e.count)):xe.enableAttribute(_t),q.bindBuffer(q.ARRAY_BUFFER,_i),q.vertexAttribPointer(_t,Ct,Ft,lt,0,ge*Ct*Nr)}else if(Re!==void 0){var cr=Re[gt];if(cr!==void 0)switch(cr.length){case 2:q.vertexAttrib2fv(_t,cr);break;case 3:q.vertexAttrib3fv(_t,cr);break;case 4:q.vertexAttrib4fv(_t,cr);break;default:q.vertexAttrib1fv(_t,cr)}}}}xe.disableUnusedAttributes()}function Je(D,W){return Math.abs(W[0])-Math.abs(D[0])}function Gt(D,W){return D.object.renderOrder!==W.object.renderOrder?D.object.renderOrder-W.object.renderOrder:D.material.program&&W.material.program&&D.material.program!==W.material.program?D.material.program.id-W.material.program.id:D.material.id!==W.material.id?D.material.id-W.material.id:D.z!==W.z?D.z-W.z:D.id-W.id}function X(D,W){return D.object.renderOrder!==W.object.renderOrder?D.object.renderOrder-W.object.renderOrder:D.z!==W.z?W.z-D.z:D.id-W.id}this.render=function(D,W,ee,ge){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}S="",M=-1,w=null,D.autoUpdate===!0&&D.updateMatrixWorld(),W.parent===null&&W.updateMatrixWorld(),W.matrixWorldInverse.getInverse(W.matrixWorld),K.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),G.setFromMatrix(K),u.length=0,h=-1,p=-1,g.length=0,m.length=0,Q=this.localClippingEnabled,J=Y.init(this.clippingPlanes,Q,W),wt(D,W),c.length=h+1,f.length=p+1,v.sortObjects===!0&&(c.sort(Gt),f.sort(X)),J&&Y.beginShadows(),O(u),at.render(D,W),j(u,W),J&&Y.endShadows(),Ee.calls=0,Ee.vertices=0,Ee.faces=0,Ee.points=0,ee===void 0&&(ee=null),this.setRenderTarget(ee);var ce=D.background;if(ce===null?xe.buffers.color.setClear(I.r,I.g,I.b,R,s):ce&&ce.isColor&&(xe.buffers.color.setClear(ce.r,ce.g,ce.b,1,s),ge=!0),(this.autoClear||ge)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),ce&&ce.isCubeTexture?(le.projectionMatrix.copy(W.projectionMatrix),le.matrixWorld.extractRotation(W.matrixWorld),le.matrixWorldInverse.getInverse(le.matrixWorld),et.material.uniforms.tCube.value=ce,et.modelViewMatrix.multiplyMatrices(le.matrixWorldInverse,et.matrixWorld),Ne.update(et),v.renderBufferDirect(le,null,et.geometry,et.material,et,null)):ce&&ce.isTexture&&(me.material.map=ce,Ne.update(me),v.renderBufferDirect(ne,null,me.geometry,me.material,me,null)),D.overrideMaterial){var Oe=D.overrideMaterial;kt(c,D,W,Oe),kt(f,D,W,Oe)}else xe.setBlending(IM),kt(c,D,W),kt(f,D,W);$.render(D,W),nt.render(D,W,b),ee&&Ue.updateRenderTargetMipmap(ee),xe.setDepthTest(!0),xe.setDepthWrite(!0),xe.setColorWrite(!0)};function Te(D,W,ee,ge,ce){var Oe,Ge;ee.transparent?(Oe=f,Ge=++p):(Oe=c,Ge=++h);var Re=Oe[Ge];Re!==void 0?(Re.id=D.id,Re.object=D,Re.geometry=W,Re.material=ee,Re.z=ae.z,Re.group=ce):(Re={id:D.id,object:D,geometry:W,material:ee,z:ae.z,group:ce},Oe.push(Re))}function te(D){var W=D.geometry;return W.boundingSphere===null&&W.computeBoundingSphere(),V.copy(W.boundingSphere).applyMatrix4(D.matrixWorld),De(V)}function Me(D){return V.center.set(0,0,0),V.radius=.7071067811865476,V.applyMatrix4(D.matrixWorld),De(V)}function De(D){if(!G.intersectsSphere(D))return!1;var W=Y.numPlanes;if(W===0)return!0;var ee=v.clippingPlanes,ge=D.center,ce=-D.radius,Oe=0;do if(ee[Oe].distanceToPoint(ge) =0&&D.numSupportedMorphTargets++}if(D.morphNormals){D.numSupportedMorphNormals=0;for(var $e=0;$e =0&&D.numSupportedMorphNormals++}var lt=ge.__webglShader.uniforms;(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(ge.numClippingPlanes=Y.numPlanes,ge.numIntersection=Y.numIntersection,lt.clippingPlanes=Y.uniform),ge.fog=W,ge.lightsHash=se.hash,D.lights&&(lt.ambientLightColor.value=se.ambient,lt.directionalLights.value=se.directional,lt.spotLights.value=se.spot,lt.rectAreaLights.value=se.rectArea,lt.pointLights.value=se.point,lt.hemisphereLights.value=se.hemi,lt.directionalShadowMap.value=se.directionalShadowMap,lt.directionalShadowMatrix.value=se.directionalShadowMatrix,lt.spotShadowMap.value=se.spotShadowMap,lt.spotShadowMatrix.value=se.spotShadowMatrix,lt.pointShadowMap.value=se.pointShadowMap,lt.pointShadowMatrix.value=se.pointShadowMatrix);var Ct=ge.program.getUniforms(),je=Jf.seqWithValue(Ct.seq,lt);ge.uniformsList=je}function $r(D){D.side===n_?xe.disable(q.CULL_FACE):xe.enable(q.CULL_FACE),xe.setFlipSided(D.side===jf),D.transparent===!0?xe.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst,D.blendEquationAlpha,D.blendSrcAlpha,D.blendDstAlpha,D.premultipliedAlpha):xe.setBlending(IM),xe.setDepthFunc(D.depthFunc),xe.setDepthTest(D.depthTest),xe.setDepthWrite(D.depthWrite),xe.setColorWrite(D.colorWrite),xe.setPolygonOffset(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits)}function Ht(D,W,ee,ge){E=0;var ce=Le.get(ee);if(J&&(Q||D!==w)){var Oe=D===w&&ee.id===M;Y.setState(ee.clippingPlanes,ee.clipIntersection,ee.clipShadows,D,ce,Oe)}ee.needsUpdate===!1&&(ce.program===void 0||ee.fog&&ce.fog!==W||ee.lights&&ce.lightsHash!==se.hash||ce.numClippingPlanes!==void 0&&(ce.numClippingPlanes!==Y.numPlanes||ce.numIntersection!==Y.numIntersection))&&(ee.needsUpdate=!0),ee.needsUpdate&&(Tr(ee,W,ge),ee.needsUpdate=!1);var Ge=!1,Re=!1,gt=!1,_t=ce.program,$e=_t.getUniforms(),lt=ce.__webglShader.uniforms;if(_t.id!==_&&(q.useProgram(_t.program),_=_t.id,Ge=!0,Re=!0,gt=!0),ee.id!==M&&(M=ee.id,Re=!0),Ge||D!==w){if($e.set(q,D,"projectionMatrix"),_e.logarithmicDepthBuffer&&$e.setValue(q,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),D!==w&&(w=D,Re=!0,gt=!0),ee.isShaderMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.envMap){var Ct=$e.map.cameraPosition;Ct!==void 0&&Ct.setValue(q,ae.setFromMatrixPosition(D.matrixWorld))}(ee.isMeshPhongMaterial||ee.isMeshLambertMaterial||ee.isMeshBasicMaterial||ee.isMeshStandardMaterial||ee.isShaderMaterial||ee.skinning)&&$e.setValue(q,"viewMatrix",D.matrixWorldInverse),$e.set(q,v,"toneMappingExposure"),$e.set(q,v,"toneMappingWhitePoint")}if(ee.skinning){$e.setOptional(q,ge,"bindMatrix"),$e.setOptional(q,ge,"bindMatrixInverse");var je=ge.skeleton;je&&(_e.floatVertexTextures&&je.useVertexTexture?($e.set(q,je,"boneTexture"),$e.set(q,je,"boneTextureWidth"),$e.set(q,je,"boneTextureHeight")):$e.setOptional(q,je,"boneMatrices"))}return Re&&(ee.lights&&h_(lt,gt),W&&ee.fog&&gl(lt,W),(ee.isMeshBasicMaterial||ee.isMeshLambertMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.isMeshNormalMaterial||ee.isMeshDepthMaterial)&&Or(lt,ee),ee.isLineBasicMaterial?hi(lt,ee):ee.isLineDashedMaterial?(hi(lt,ee),tp(lt,ee)):ee.isPointsMaterial?l_(lt,ee):ee.isMeshLambertMaterial?rp(lt,ee):ee.isMeshToonMaterial?ip(lt,ee):ee.isMeshPhongMaterial?Es(lt,ee):ee.isMeshPhysicalMaterial?u_(lt,ee):ee.isMeshStandardMaterial?oh(lt,ee):ee.isMeshDepthMaterial?ee.displacementMap&&(lt.displacementMap.value=ee.displacementMap,lt.displacementScale.value=ee.displacementScale,lt.displacementBias.value=ee.displacementBias):ee.isMeshNormalMaterial&&c_(lt,ee),lt.ltcMat!==void 0&&(lt.ltcMat.value=THREE.UniformsLib.LTC_MAT_TEXTURE),lt.ltcMag!==void 0&&(lt.ltcMag.value=THREE.UniformsLib.LTC_MAG_TEXTURE),Jf.upload(q,ce.uniformsList,lt,v)),$e.set(q,ge,"modelViewMatrix"),$e.set(q,ge,"normalMatrix"),$e.setValue(q,"modelMatrix",ge.matrixWorld),_t}function Or(D,W){D.opacity.value=W.opacity,D.diffuse.value=W.color,W.emissive&&D.emissive.value.copy(W.emissive).multiplyScalar(W.emissiveIntensity),D.map.value=W.map,D.specularMap.value=W.specularMap,D.alphaMap.value=W.alphaMap,W.lightMap&&(D.lightMap.value=W.lightMap,D.lightMapIntensity.value=W.lightMapIntensity),W.aoMap&&(D.aoMap.value=W.aoMap,D.aoMapIntensity.value=W.aoMapIntensity);var ee;if(W.map?ee=W.map:W.specularMap?ee=W.specularMap:W.displacementMap?ee=W.displacementMap:W.normalMap?ee=W.normalMap:W.bumpMap?ee=W.bumpMap:W.roughnessMap?ee=W.roughnessMap:W.metalnessMap?ee=W.metalnessMap:W.alphaMap?ee=W.alphaMap:W.emissiveMap&&(ee=W.emissiveMap),ee!==void 0){ee.isWebGLRenderTarget&&(ee=ee.texture);var ge=ee.offset,ce=ee.repeat;D.offsetRepeat.value.set(ge.x,ge.y,ce.x,ce.y)}D.envMap.value=W.envMap,D.flipEnvMap.value=W.envMap&&W.envMap.isCubeTexture?-1:1,D.reflectivity.value=W.reflectivity,D.refractionRatio.value=W.refractionRatio}function hi(D,W){D.diffuse.value=W.color,D.opacity.value=W.opacity}function tp(D,W){D.dashSize.value=W.dashSize,D.totalSize.value=W.dashSize+W.gapSize,D.scale.value=W.scale}function l_(D,W){if(D.diffuse.value=W.color,D.opacity.value=W.opacity,D.size.value=W.size*U,D.scale.value=P*.5,D.map.value=W.map,W.map!==null){var ee=W.map.offset,ge=W.map.repeat;D.offsetRepeat.value.set(ee.x,ee.y,ge.x,ge.y)}}function gl(D,W){D.fogColor.value=W.color,W.isFog?(D.fogNear.value=W.near,D.fogFar.value=W.far):W.isFogExp2&&(D.fogDensity.value=W.density)}function rp(D,W){W.emissiveMap&&(D.emissiveMap.value=W.emissiveMap)}function Es(D,W){D.specular.value=W.specular,D.shininess.value=Math.max(W.shininess,1e-4),W.emissiveMap&&(D.emissiveMap.value=W.emissiveMap),W.bumpMap&&(D.bumpMap.value=W.bumpMap,D.bumpScale.value=W.bumpScale),W.normalMap&&(D.normalMap.value=W.normalMap,D.normalScale.value.copy(W.normalScale)),W.displacementMap&&(D.displacementMap.value=W.displacementMap,D.displacementScale.value=W.displacementScale,D.displacementBias.value=W.displacementBias)}function ip(D,W){Es(D,W),W.gradientMap&&(D.gradientMap.value=W.gradientMap)}function oh(D,W){D.roughness.value=W.roughness,D.metalness.value=W.metalness,W.roughnessMap&&(D.roughnessMap.value=W.roughnessMap),W.metalnessMap&&(D.metalnessMap.value=W.metalnessMap),W.emissiveMap&&(D.emissiveMap.value=W.emissiveMap),W.bumpMap&&(D.bumpMap.value=W.bumpMap,D.bumpScale.value=W.bumpScale),W.normalMap&&(D.normalMap.value=W.normalMap,D.normalScale.value.copy(W.normalScale)),W.displacementMap&&(D.displacementMap.value=W.displacementMap,D.displacementScale.value=W.displacementScale,D.displacementBias.value=W.displacementBias),W.envMap&&(D.envMapIntensity.value=W.envMapIntensity)}function u_(D,W){D.clearCoat.value=W.clearCoat,D.clearCoatRoughness.value=W.clearCoatRoughness,oh(D,W)}function c_(D,W){W.bumpMap&&(D.bumpMap.value=W.bumpMap,D.bumpScale.value=W.bumpScale),W.normalMap&&(D.normalMap.value=W.normalMap,D.normalScale.value.copy(W.normalScale)),W.displacementMap&&(D.displacementMap.value=W.displacementMap,D.displacementScale.value=W.displacementScale,D.displacementBias.value=W.displacementBias)}function h_(D,W){D.ambientLightColor.needsUpdate=W,D.directionalLights.needsUpdate=W,D.pointLights.needsUpdate=W,D.spotLights.needsUpdate=W,D.rectAreaLights.needsUpdate=W,D.hemisphereLights.needsUpdate=W}function O(D){for(var W=0,ee=0,ge=D.length;ee =_e.maxTextures&&console.warn("WebGLRenderer: trying to use "+D+" texture units while this GPU supports only "+_e.maxTextures),E+=1,D}this.allocTextureUnit=re,this.setTexture2D=function(){var D=!1;return function(ee,ge){ee&&ee.isWebGLRenderTarget&&(D||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),D=!0),ee=ee.texture),Ue.setTexture2D(ee,ge)}}(),this.setTexture=function(){var D=!1;return function(ee,ge){D||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),D=!0),Ue.setTexture2D(ee,ge)}}(),this.setTextureCube=function(){var D=!1;return function(ee,ge){ee&&ee.isWebGLRenderTargetCube&&(D||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),D=!0),ee=ee.texture),ee&&ee.isCubeTexture||Array.isArray(ee.image)&&ee.image.length===6?Ue.setTextureCube(ee,ge):Ue.setTextureCubeDynamic(ee,ge)}}(),this.getCurrentRenderTarget=function(){return y},this.setRenderTarget=function(D){y=D,D&&Le.get(D).__webglFramebuffer===void 0&&Ue.setupRenderTarget(D);var W=D&&D.isWebGLRenderTargetCube,ee;if(D){var ge=Le.get(D);W?ee=ge.__webglFramebuffer[D.activeCubeFace]:ee=ge.__webglFramebuffer,T.copy(D.scissor),C=D.scissorTest,b.copy(D.viewport)}else ee=null,T.copy(B).multiplyScalar(U),C=z,b.copy(k).multiplyScalar(U);if(x!==ee&&(q.bindFramebuffer(q.FRAMEBUFFER,ee),x=ee),xe.scissor(T),xe.setScissorTest(C),xe.viewport(b),W){var ce=Le.get(D.texture);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,q.TEXTURE_CUBE_MAP_POSITIVE_X+D.activeCubeFace,ce.__webglTexture,D.activeMipMapLevel)}},this.readRenderTargetPixels=function(D,W,ee,ge,ce,Oe){if((D&&D.isWebGLRenderTarget)===!1){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}var Ge=Le.get(D).__webglFramebuffer;if(Ge){var Re=!1;Ge!==x&&(q.bindFramebuffer(q.FRAMEBUFFER,Ge),Re=!0);try{var gt=D.texture,_t=gt.format,$e=gt.type;if(_t!==qu&&ie(_t)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if($e!==KR&&ie($e)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_TYPE)&&!($e===_0&&(We.get("OES_texture_float")||We.get("WEBGL_color_buffer_float")))&&!($e===JR&&We.get("EXT_color_buffer_half_float"))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?W>=0&&W<=D.width-ge&&ee>=0&&ee<=D.height-ce&&q.readPixels(W,ee,ge,ce,ie(_t),ie($e),Oe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{Re&&q.bindFramebuffer(q.FRAMEBUFFER,x)}}};function ie(D){var W;if(D===Qc)return q.REPEAT;if(D===Ms)return q.CLAMP_TO_EDGE;if(D===am)return q.MIRRORED_REPEAT;if(D===bs)return q.NEAREST;if(D===CL)return q.NEAREST_MIPMAP_NEAREST;if(D===RL)return q.NEAREST_MIPMAP_LINEAR;if(D===qo)return q.LINEAR;if(D===jk)return q.LINEAR_MIPMAP_NEAREST;if(D===Tb)return q.LINEAR_MIPMAP_LINEAR;if(D===KR)return q.UNSIGNED_BYTE;if(D===rse)return q.UNSIGNED_SHORT_4_4_4_4;if(D===ise)return q.UNSIGNED_SHORT_5_5_5_1;if(D===nse)return q.UNSIGNED_SHORT_5_6_5;if(D===Qoe)return q.BYTE;if(D===ese)return q.SHORT;if(D===NM)return q.UNSIGNED_SHORT;if(D===tse)return q.INT;if(D===Kk)return q.UNSIGNED_INT;if(D===_0)return q.FLOAT;if(D===JR&&(W=We.get("OES_texture_half_float"),W!==null))return W.HALF_FLOAT_OES;if(D===ase)return q.ALPHA;if(D===x0)return q.RGB;if(D===qu)return q.RGBA;if(D===ose)return q.LUMINANCE;if(D===sse)return q.LUMINANCE_ALPHA;if(D===tm)return q.DEPTH_COMPONENT;if(D===S0)return q.DEPTH_STENCIL;if(D===Hk)return q.FUNC_ADD;if(D===Roe)return q.FUNC_SUBTRACT;if(D===Loe)return q.FUNC_REVERSE_SUBTRACT;if(D===Doe)return q.ZERO;if(D===Poe)return q.ONE;if(D===Ioe)return q.SRC_COLOR;if(D===Noe)return q.ONE_MINUS_SRC_COLOR;if(D===Wk)return q.SRC_ALPHA;if(D===Xk)return q.ONE_MINUS_SRC_ALPHA;if(D===Uoe)return q.DST_ALPHA;if(D===Ooe)return q.ONE_MINUS_DST_ALPHA;if(D===zoe)return q.DST_COLOR;if(D===Foe)return q.ONE_MINUS_DST_COLOR;if(D===Boe)return q.SRC_ALPHA_SATURATE;if((D===fk||D===pk||D===dk||D===mk)&&(W=We.get("WEBGL_compressed_texture_s3tc"),W!==null)){if(D===fk)return W.COMPRESSED_RGB_S3TC_DXT1_EXT;if(D===pk)return W.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(D===dk)return W.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(D===mk)return W.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((D===vk||D===gk||D===yk||D===_k)&&(W=We.get("WEBGL_compressed_texture_pvrtc"),W!==null)){if(D===vk)return W.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(D===gk)return W.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(D===yk)return W.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(D===_k)return W.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(D===lse&&(W=We.get("WEBGL_compressed_texture_etc1"),W!==null))return W.COMPRESSED_RGB_ETC1_WEBGL;if((D===lk||D===uk)&&(W=We.get("EXT_blend_minmax"),W!==null)){if(D===lk)return W.MIN_EXT;if(D===uk)return W.MAX_EXT}return D===UM&&(W=We.get("WEBGL_depth_texture"),W!==null)?W.UNSIGNED_INT_24_8_WEBGL:0}}function T0(r,e){this.name="",this.color=new Wt(r),this.density=e!==void 0?e:25e-5}function E0(r,e,t){this.name="",this.color=new Wt(r),this.near=e!==void 0?e:1,this.far=t!==void 0?t:1e3}function cm(){Lt.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Sk(r,e,t,i,n){Lt.call(this),this.lensFlares=[],this.positionScreen=new oe,this.customUpdateCallback=void 0,r!==void 0&&this.add(r,e,t,i,n)}function hm(r){_r.call(this),this.type="SpriteMaterial",this.color=new Wt(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(r)}function qM(r){Lt.call(this),this.type="Sprite",this.material=r!==void 0?r:new hm}function ZM(){Lt.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function QR(r,e,t){if(this.useVertexTexture=t!==void 0?t:!0,this.identityMatrix=new Kt,r=r||[],this.bones=r.slice(0),this.useVertexTexture){var i=Math.sqrt(this.bones.length*4);i=fr.nextPowerOfTwo(Math.ceil(i)),i=Math.max(i,4),this.boneTextureWidth=i,this.boneTextureHeight=i,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new sm(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,qu,_0)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(e===void 0)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var n=0,a=this.bones.length;n=r.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}c()}function C0(r,e,t,i,n,a,o,s,l,u,c,h){ci.call(this,null,a,o,s,l,u,i,n,c,h),this.image={width:e,height:t},this.mipmaps=r,this.flipY=!1,this.generateMipmaps=!1}function iL(r,e,t,i,n,a,o,s,l){ci.call(this,r,e,t,i,n,a,o,s,l),this.needsUpdate=!0}function KM(r,e,t,i,n,a,o,s,l,u){if(u=u!==void 0?u:tm,u!==tm&&u!==S0)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");t===void 0&&u===tm&&(t=NM),t===void 0&&u===S0&&(t=UM),ci.call(this,null,i,n,a,o,s,u,t,l),this.image={width:r,height:e},this.magFilter=o!==void 0?o:bs,this.minFilter=s!==void 0?s:bs,this.flipY=!1,this.generateMipmaps=!1}function R0(r){Vt.call(this);var e=[0,0],t={};function i(I,R){return I-R}var n=["a","b","c"];if(r&&r.isGeometry){for(var a=r.vertices,o=r.faces,s=0,l=new Uint32Array(6*o.length),u=0,c=o.length;u 65535?th:eh)(h,1)),this.addAttribute("position",new Mr(i,3)),this.addAttribute("uv",new Mr(n,2)),this.computeVertexNormals()}function JM(r,e,t){ur.call(this),this.type="ParametricGeometry",this.parameters={func:r,slices:e,stacks:t},this.fromBufferGeometry(new L0(r,e,t)),this.mergeVertices()}function Ko(r,e,t,i){Vt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:r,indices:e,radius:t,detail:i},t=t||1,i=i||0;var n=[],a=[];o(i),l(t),u(),this.addAttribute("position",new Mr(n,3)),this.addAttribute("normal",new Mr(n.slice(),3)),this.addAttribute("uv",new Mr(a,2)),this.normalizeNormals(),this.boundingSphere=new ha(new oe,t);function o(v){for(var _=new oe,y=new oe,x=new oe,M=0;M .9&&S<.1&&(_<.2&&(a[v+0]+=1),y<.2&&(a[v+2]+=1),x<.2&&(a[v+4]+=1))}}function h(v){n.push(v.x,v.y,v.z)}function f(v,_){var y=v*3;_.x=r[y+0],_.y=r[y+1],_.z=r[y+2]}function p(){for(var v=new oe,_=new oe,y=new oe,x=new oe,M=new Tt,S=new Tt,w=new Tt,T=0,C=0;T 65535?th:eh)(d,1)),this.addAttribute("position",new Mr(h,3)),this.addAttribute("normal",new Mr(f,3)),this.addAttribute("uv",new Mr(p,2));function g(){for(u=0;u 65535?Uint32Array:Uint16Array)(s),1),u=new Mt(new Float32Array(o*3),3),c=new Mt(new Float32Array(o*3),3),h=new Mt(new Float32Array(o*2),2),f,p,d=0,g=0,m=new oe,v=new oe,_=new Tt,y=new oe,x=new oe,M=new oe,S=new oe,w=new oe;for(f=0;f<=t;++f){var T=f/t*n*Math.PI*2;for(U(T,n,a,r,y),U(T+.01,n,a,r,x),S.subVectors(x,y),w.addVectors(x,y),M.crossVectors(S,w),w.crossVectors(M,S),M.normalize(),w.normalize(),p=0;p<=i;++p){var C=p/i*Math.PI*2,b=-e*Math.cos(C),E=e*Math.sin(C);m.x=y.x+(b*w.x+E*M.x),m.y=y.y+(b*w.y+E*M.y),m.z=y.z+(b*w.z+E*M.z),u.setXYZ(d,m.x,m.y,m.z),v.subVectors(m,y).normalize(),c.setXYZ(d,v.x,v.y,v.z),_.x=f/t,_.y=p/i,h.setXY(d,_.x,_.y),d++}}for(p=1;p<=t;p++)for(f=1;f<=i;f++){var I=(i+1)*(p-1)+(f-1),R=(i+1)*p+(f-1),A=(i+1)*p+f,P=(i+1)*(p-1)+f;l.setX(g,I),g++,l.setX(g,R),g++,l.setX(g,P),g++,l.setX(g,R),g++,l.setX(g,A),g++,l.setX(g,P),g++}this.setIndex(l),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",h);function U(B,z,k,G,Y){var J=Math.cos(B),Q=Math.sin(B),V=k/z*B,K=Math.cos(V);Y.x=G*(2+K)*.5*J,Y.y=G*(2+K)*Q*.5,Y.z=G*Math.sin(V)*.5}}function nb(r,e,t,i,n,a,o){ur.call(this),this.type="TorusKnotGeometry",this.parameters={radius:r,tube:e,tubularSegments:t,radialSegments:i,p:n,q:a},o!==void 0&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new U0(r,e,t,i,n,a)),this.mergeVertices()}function O0(r,e,t,i,n){Vt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},r=r||100,e=e||40,t=Math.floor(t)||8,i=Math.floor(i)||6,n=n||Math.PI*2;var a=(t+1)*(i+1),o=t*i*2*3,s=new(o>65535?Uint32Array:Uint16Array)(o),l=new Float32Array(a*3),u=new Float32Array(a*3),c=new Float32Array(a*2),h=0,f=0,p=0,d=new oe,g=new oe,m=new oe,v,_;for(v=0;v<=t;v++)for(_=0;_<=i;_++){var y=_/i*n,x=v/t*Math.PI*2;g.x=(r+e*Math.cos(x))*Math.cos(y),g.y=(r+e*Math.cos(x))*Math.sin(y),g.z=e*Math.sin(x),l[h]=g.x,l[h+1]=g.y,l[h+2]=g.z,d.x=r*Math.cos(y),d.y=r*Math.sin(y),m.subVectors(g,d).normalize(),u[h]=m.x,u[h+1]=m.y,u[h+2]=m.z,c[f]=_/i,c[f+1]=v/t,h+=3,f+=2}for(v=1;v<=t;v++)for(_=1;_<=i;_++){var M=(i+1)*v+_-1,S=(i+1)*(v-1)+_-1,w=(i+1)*(v-1)+_,T=(i+1)*v+_;s[p]=M,s[p+1]=S,s[p+2]=T,s[p+3]=S,s[p+4]=w,s[p+5]=T,p+=6}this.setIndex(new Mt(s,1)),this.addAttribute("position",new Mt(l,3)),this.addAttribute("normal",new Mt(u,3)),this.addAttribute("uv",new Mt(c,2))}function ab(r,e,t,i,n){ur.call(this),this.type="TorusGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},this.fromBufferGeometry(new O0(r,e,t,i,n))}function ml(r,e){if(typeof r>"u"){r=[];return}ur.call(this),this.type="ExtrudeGeometry",r=Array.isArray(r)?r:[r],this.addShapeList(r,e),this.computeFaceNormals()}function ob(r,e){e=e||{};var t=e.font;if((t&&t.isFont)===!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ur;var i=t.generateShapes(r,e.size,e.curveSegments);e.amount=e.height!==void 0?e.height:50,e.bevelThickness===void 0&&(e.bevelThickness=10),e.bevelSize===void 0&&(e.bevelSize=8),e.bevelEnabled===void 0&&(e.bevelEnabled=!1),ml.call(this,i,e),this.type="TextGeometry"}function pm(r,e,t,i,n,a,o){Vt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},r=r||50,e=Math.max(3,Math.floor(e)||8),t=Math.max(2,Math.floor(t)||6),i=i!==void 0?i:0,n=n!==void 0?n:Math.PI*2,a=a!==void 0?a:0,o=o!==void 0?o:Math.PI;for(var s=a+o,l=(e+1)*(t+1),u=new Mt(new Float32Array(l*3),3),c=new Mt(new Float32Array(l*3),3),h=new Mt(new Float32Array(l*2),2),f=0,p=[],d=new oe,g=0;g<=t;g++){for(var m=[],v=g/t,_=0;_<=e;_++){var y=_/e,x=-r*Math.cos(i+y*n)*Math.sin(a+v*o),M=r*Math.cos(a+v*o),S=r*Math.sin(i+y*n)*Math.sin(a+v*o);d.set(x,M,S).normalize(),u.setXYZ(f,x,M,S),c.setXYZ(f,d.x,d.y,d.z),h.setXY(f,y,1-v),m.push(f),f++}p.push(m)}for(var w=[],g=0;g 0)&&w.push(T,C,E),(g!==t-1||s 65535?th:eh)(w,1)),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",h),this.boundingSphere=new ha(new oe,r)}function sb(r,e,t,i,n,a,o){ur.call(this),this.type="SphereGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new pm(r,e,t,i,n,a,o))}function z0(r,e,t,i,n,a){Vt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:r,outerRadius:e,thetaSegments:t,phiSegments:i,thetaStart:n,thetaLength:a},r=r||20,e=e||50,n=n!==void 0?n:0,a=a!==void 0?a:Math.PI*2,t=t!==void 0?Math.max(3,t):8,i=i!==void 0?Math.max(1,i):1;var o=(t+1)*(i+1),s=t*i*2*3,l=new Mt(new(s>65535?Uint32Array:Uint16Array)(s),1),u=new Mt(new Float32Array(o*3),3),c=new Mt(new Float32Array(o*3),3),h=new Mt(new Float32Array(o*2),2),f=0,p=0,d,g=r,m=(e-r)/i,v=new oe,_=new Tt,y,x;for(y=0;y<=i;y++){for(x=0;x<=t;x++)d=n+x/t*a,v.x=g*Math.cos(d),v.y=g*Math.sin(d),u.setXYZ(f,v.x,v.y,v.z),c.setXYZ(f,0,0,1),_.x=(v.x/e+1)/2,_.y=(v.y/e+1)/2,h.setXY(f,_.x,_.y),f++;g+=m}for(y=0;y65535?Uint32Array:Uint16Array)(a),1),s=new Mt(new Float32Array(n*3),3),l=new Mt(new Float32Array(n*2),2),u=0,c=0,h,f=1/e,p=new oe,d=new Tt,g,m;for(g=0;g<=e;g++){var v=t+g*f*i,_=Math.sin(v),y=Math.cos(v);for(m=0;m<=r.length-1;m++)p.x=r[m].x*_,p.y=r[m].y,p.z=r[m].x*y,s.setXYZ(u,p.x,p.y,p.z),d.x=g/e,d.y=m/(r.length-1),l.setXY(u,d.x,d.y),u++}for(g=0;g 65535?th:eh)(a,1)),this.addAttribute("position",new Mr(t,3)),this.addAttribute("normal",new Mr(i,3)),this.addAttribute("uv",new Mr(n,2));function u(c){var h,f,p,d=t.length/3,g=c.extractPoints(e),m=g.shape,v=g.holes;if(Gn.isClockWise(m)===!1)for(m=m.reverse(),h=0,f=v.length;h 0&&u++,e>0&&u++);var c=M(),h=S(),f=new Mt(new(h>65535?Uint32Array:Uint16Array)(h),1),p=new Mt(new Float32Array(c*3),3),d=new Mt(new Float32Array(c*3),3),g=new Mt(new Float32Array(c*2),2),m=0,v=0,_=[],y=t/2,x=0;w(),a===!1&&(r>0&&T(!0),e>0&&T(!1)),this.setIndex(f),this.addAttribute("position",p),this.addAttribute("normal",d),this.addAttribute("uv",g);function M(){var C=(i+1)*(n+1);return a===!1&&(C+=(i+1)*u+i*u),C}function S(){var C=i*n*2*3;return a===!1&&(C+=i*u*3),C}function w(){var C,b,E=new oe,I=new oe,R=0,A=(e-r)/t;for(b=0;b<=n;b++){var P=[],U=b/n,B=U*(e-r)+r;for(C=0;C<=i;C++){var z=C/i,k=z*s+o,G=Math.sin(k),Y=Math.cos(k);I.x=B*G,I.y=-U*t+y,I.z=B*Y,p.setXYZ(m,I.x,I.y,I.z),E.set(G,A,Y).normalize(),d.setXYZ(m,E.x,E.y,E.z),g.setXY(m,z,1-U),P.push(m),m++}_.push(P)}for(C=0;Cthis.points.length-2?this.points.length-1:n+1,e[3]=n>this.points.length-3?this.points.length-1:n+2,l=this.points[e[0]],u=this.points[e[1]],c=this.points[e[2]],h=this.points[e[3]],o=a*a,s=a*o,t.x=f(l.x,u.x,c.x,h.x,a,o,s),t.y=f(l.y,u.y,c.y,h.y,a,o,s),t.z=f(l.z,u.z,c.z,h.z,a,o,s),t},this.getControlPointsArray=function(){var p,d,g=this.points.length,m=[];for(p=0;p {"use strict";Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52));Math.sign===void 0&&(Math.sign=function(r){return r<0?-1:r>0?1:+r});Function.prototype.name===void 0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}});Object.assign===void 0&&function(){Object.assign=function(r){"use strict";if(r==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(r),t=1;t >4,e[a]=r[a===19?i&3|8:i]);return e.join("")}}(),clamp:function(r,e,t){return Math.max(e,Math.min(t,r))},euclideanModulo:function(r,e){return(r%e+e)%e},mapLinear:function(r,e,t,i,n){return i+(r-e)*(n-i)/(t-e)},lerp:function(r,e,t){return(1-t)*r+t*e},smoothstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))},smootherstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))},randInt:function(r,e){return r+Math.floor(Math.random()*(e-r+1))},randFloat:function(r,e){return r+Math.random()*(e-r)},randFloatSpread:function(r){return r*(.5-Math.random())},degToRad:function(r){return r*fr.DEG2RAD},radToDeg:function(r){return r*fr.RAD2DEG},isPowerOfTwo:function(r){return(r&r-1)===0&&r!==0},nearestPowerOfTwo:function(r){return Math.pow(2,Math.round(Math.log(r)/Math.LN2))},nextPowerOfTwo:function(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}};Tt.prototype={constructor:Tt,isVector2:!0,get width(){return this.x},set width(r){this.x=r},get height(){return this.y},set height(r){this.y=r},set:function(r,e){return this.x=r,this.y=e,this},setScalar:function(r){return this.x=r,this.y=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(r){return this.x=r.x,this.y=r.y,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this)},addScalar:function(r){return this.x+=r,this.y+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this)},subScalar:function(r){return this.x-=r,this.y-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this},multiply:function(r){return this.x*=r.x,this.y*=r.y,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r):(this.x=0,this.y=0),this},divide:function(r){return this.x/=r.x,this.y/=r.y,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new Tt,e=new Tt),r.set(i,i),e.set(n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(r){return this.x*r.x+this.y*r.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var r=Math.atan2(this.y,this.x);return r<0&&(r+=2*Math.PI),r},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y;return e*e+t*t},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},equals:function(r){return r.x===this.x&&r.y===this.y},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this},rotateAround:function(r,e){var t=Math.cos(e),i=Math.sin(e),n=this.x-r.x,a=this.y-r.y;return this.x=n*t-a*i+r.x,this.y=n*i+a*t+r.y,this}};GIe=0;ci.DEFAULT_IMAGE=void 0;ci.DEFAULT_MAPPING=wL;ci.prototype={constructor:ci,isTexture:!0,set needsUpdate(r){r===!0&&this.version++},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.image=r.image,this.mipmaps=r.mipmaps.slice(0),this.mapping=r.mapping,this.wrapS=r.wrapS,this.wrapT=r.wrapT,this.magFilter=r.magFilter,this.minFilter=r.minFilter,this.anisotropy=r.anisotropy,this.format=r.format,this.type=r.type,this.offset.copy(r.offset),this.repeat.copy(r.repeat),this.generateMipmaps=r.generateMipmaps,this.premultiplyAlpha=r.premultiplyAlpha,this.flipY=r.flipY,this.unpackAlignment=r.unpackAlignment,this.encoding=r.encoding,this},toJSON:function(r){if(r.textures[this.uuid]!==void 0)return r.textures[this.uuid];function e(n){var a;return n.toDataURL!==void 0?a=n:(a=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),a.width=n.width,a.height=n.height,a.getContext("2d").drawImage(n,0,0,n.width,n.height)),a.width>2048||a.height>2048?a.toDataURL("image/jpeg",.6):a.toDataURL("image/png")}var t={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(this.image!==void 0){var i=this.image;i.uuid===void 0&&(i.uuid=fr.generateUUID()),r.images[i.uuid]===void 0&&(r.images[i.uuid]={uuid:i.uuid,url:e(i)}),t.image=i.uuid}return r.textures[this.uuid]=t,t},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(r){if(this.mapping===wL){if(r.multiply(this.repeat),r.add(this.offset),r.x<0||r.x>1)switch(this.wrapS){case Qc:r.x=r.x-Math.floor(r.x);break;case Ms:r.x=r.x<0?0:1;break;case am:Math.abs(Math.floor(r.x)%2)===1?r.x=Math.ceil(r.x)-r.x:r.x=r.x-Math.floor(r.x);break}if(r.y<0||r.y>1)switch(this.wrapT){case Qc:r.y=r.y-Math.floor(r.y);break;case Ms:r.y=r.y<0?0:1;break;case am:Math.abs(Math.floor(r.y)%2)===1?r.y=Math.ceil(r.y)-r.y:r.y=r.y-Math.floor(r.y);break}this.flipY&&(r.y=1-r.y)}}};Object.assign(ci.prototype,pl.prototype);ii.prototype={constructor:ii,isVector4:!0,set:function(r,e,t,i){return this.x=r,this.y=e,this.z=t,this.w=i,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this.w=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setW:function(r){return this.w=r,this},setComponent:function(r,e){switch(r){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: "+r)}return this},getComponent:function(r){switch(r){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: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this.w=r.w!==void 0?r.w:1,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this.w+=r.w,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this.w+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this.w=r.w+e.w,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this.w+=r.w*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this.w-=r.w,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this.w-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this.w=r.w-e.w,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r,this.w*=r):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=this.w,a=r.elements;return this.x=a[0]*e+a[4]*t+a[8]*i+a[12]*n,this.y=a[1]*e+a[5]*t+a[9]*i+a[13]*n,this.z=a[2]*e+a[6]*t+a[10]*i+a[14]*n,this.w=a[3]*e+a[7]*t+a[11]*i+a[15]*n,this},divideScalar:function(r){return this.multiplyScalar(1/r)},setAxisAngleFromQuaternion:function(r){this.w=2*Math.acos(r.w);var e=Math.sqrt(1-r.w*r.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=r.x/e,this.y=r.y/e,this.z=r.z/e),this},setAxisAngleFromRotationMatrix:function(r){var e,t,i,n,a=.01,o=.1,s=r.elements,l=s[0],u=s[4],c=s[8],h=s[1],f=s[5],p=s[9],d=s[2],g=s[6],m=s[10];if(Math.abs(u-h)_&&v>y?vy?_0?(f=.5/Math.sqrt(h+1),this._w=.25/f,this._x=(u-s)*f,this._y=(n-l)*f,this._z=(a-i)*f):t>o&&t>c?(f=2*Math.sqrt(1+t-o-c),this._w=(u-s)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(n+l)/f):o>c?(f=2*Math.sqrt(1+o-t-c),this._w=(n-l)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(s+u)/f):(f=2*Math.sqrt(1+c-t-o),this._w=(a-i)/f,this._x=(n+l)/f,this._y=(s+u)/f,this._z=.25*f),this.onChangeCallback(),this},setFromUnitVectors:function(){var r,e,t=1e-6;return function(n,a){return r===void 0&&(r=new oe),e=n.dot(a)+1,e Math.abs(n.z)?r.set(-n.y,n.x,0):r.set(0,-n.z,n.y)):r.crossVectors(n,a),this._x=r.x,this._y=r.y,this._z=r.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(r){return this._x*r._x+this._y*r._y+this._z*r._z+this._w*r._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var r=this.length();return r===0?(this._x=0,this._y=0,this._z=0,this._w=1):(r=1/r,this._x=this._x*r,this._y=this._y*r,this._z=this._z*r,this._w=this._w*r),this.onChangeCallback(),this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(r,e)):this.multiplyQuaternions(this,r)},premultiply:function(r){return this.multiplyQuaternions(r,this)},multiplyQuaternions:function(r,e){var t=r._x,i=r._y,n=r._z,a=r._w,o=e._x,s=e._y,l=e._z,u=e._w;return this._x=t*u+a*o+i*l-n*s,this._y=i*u+a*s+n*o-t*l,this._z=n*u+a*l+t*s-i*o,this._w=a*u-t*o-i*s-n*l,this.onChangeCallback(),this},slerp:function(r,e){if(e===0)return this;if(e===1)return this.copy(r);var t=this._x,i=this._y,n=this._z,a=this._w,o=a*r._w+t*r._x+i*r._y+n*r._z;if(o<0?(this._w=-r._w,this._x=-r._x,this._y=-r._y,this._z=-r._z,o=-o):this.copy(r),o>=1)return this._w=a,this._x=t,this._y=i,this._z=n,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(t+this._x),this._y=.5*(i+this._y),this._z=.5*(n+this._z),this;var l=Math.atan2(s,o),u=Math.sin((1-e)*l)/s,c=Math.sin(e*l)/s;return this._w=a*u+this._w*c,this._x=t*u+this._x*c,this._y=i*u+this._y*c,this._z=n*u+this._z*c,this.onChangeCallback(),this},equals:function(r){return r._x===this._x&&r._y===this._y&&r._z===this._z&&r._w===this._w},fromArray:function(r,e){return e===void 0&&(e=0),this._x=r[e],this._y=r[e+1],this._z=r[e+2],this._w=r[e+3],this.onChangeCallback(),this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this._x,r[e+1]=this._y,r[e+2]=this._z,r[e+3]=this._w,r},onChange:function(r){return this.onChangeCallback=r,this},onChangeCallback:function(){}};Object.assign(cn,{slerp:function(r,e,t,i){return t.copy(r).slerp(e,i)},slerpFlat:function(r,e,t,i,n,a,o){var s=t[i+0],l=t[i+1],u=t[i+2],c=t[i+3],h=n[a+0],f=n[a+1],p=n[a+2],d=n[a+3];if(c!==d||s!==h||l!==f||u!==p){var g=1-o,m=s*h+l*f+u*p+c*d,v=m>=0?1:-1,_=1-m*m;if(_>Number.EPSILON){var y=Math.sqrt(_),x=Math.atan2(y,m*v);g=Math.sin(g*x)/y,o=Math.sin(o*x)/y}var M=o*v;if(s=s*g+h*M,l=l*g+f*M,u=u*g+p*M,c=c*g+d*M,g===1-o){var S=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=S,l*=S,u*=S,c*=S}}r[e]=s,r[e+1]=l,r[e+2]=u,r[e+3]=c}});oe.prototype={constructor:oe,isVector3:!0,set:function(r,e,t){return this.x=r,this.y=e,this.z=t,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(r,e)):(this.x*=r.x,this.y*=r.y,this.z*=r.z,this)},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(r,e){return this.x=r.x*e.x,this.y=r.y*e.y,this.z=r.z*e.z,this},applyEuler:function(){var r;return function(t){return(t&&t.isEuler)===!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),r===void 0&&(r=new cn),this.applyQuaternion(r.setFromEuler(t))}}(),applyAxisAngle:function(){var r;return function(t,i){return r===void 0&&(r=new cn),this.applyQuaternion(r.setFromAxisAngle(t,i))}}(),applyMatrix3:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[3]*t+n[6]*i,this.y=n[1]*e+n[4]*t+n[7]*i,this.z=n[2]*e+n[5]*t+n[8]*i,this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i+n[12],this.y=n[1]*e+n[5]*t+n[9]*i+n[13],this.z=n[2]*e+n[6]*t+n[10]*i+n[14],this},applyProjection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements,a=1/(n[3]*e+n[7]*t+n[11]*i+n[15]);return this.x=(n[0]*e+n[4]*t+n[8]*i+n[12])*a,this.y=(n[1]*e+n[5]*t+n[9]*i+n[13])*a,this.z=(n[2]*e+n[6]*t+n[10]*i+n[14])*a,this},applyQuaternion:function(r){var e=this.x,t=this.y,i=this.z,n=r.x,a=r.y,o=r.z,s=r.w,l=s*e+a*i-o*t,u=s*t+o*e-n*i,c=s*i+n*t-a*e,h=-n*e-a*t-o*i;return this.x=l*s+h*-n+u*-o-c*-a,this.y=u*s+h*-a+c*-n-l*-o,this.z=c*s+h*-o+l*-a-u*-n,this},project:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.multiplyMatrices(t.projectionMatrix,r.getInverse(t.matrixWorld)),this.applyProjection(r)}}(),unproject:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.multiplyMatrices(t.matrixWorld,r.getInverse(t.projectionMatrix)),this.applyProjection(r)}}(),transformDirection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i,this.y=n[1]*e+n[5]*t+n[9]*i,this.z=n[2]*e+n[6]*t+n[10]*i,this.normalize()},divide:function(r){return this.x/=r.x,this.y/=r.y,this.z/=r.z,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this.z=Math.min(this.z,r.z),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this.z=Math.max(this.z,r.z),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this.z=Math.max(r.z,Math.min(e.z,this.z)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new oe,e=new oe),r.set(i,i,i),e.set(n,n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(r){return this.x*r.x+this.y*r.y+this.z*r.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this.z+=(r.z-this.z)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},cross:function(r,e){if(e!==void 0)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(r,e);var t=this.x,i=this.y,n=this.z;return this.x=i*r.z-n*r.y,this.y=n*r.x-t*r.z,this.z=t*r.y-i*r.x,this},crossVectors:function(r,e){var t=r.x,i=r.y,n=r.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-n*o,this.y=n*a-t*s,this.z=t*o-i*a,this},projectOnVector:function(r){var e=r.dot(this)/r.lengthSq();return this.copy(r).multiplyScalar(e)},projectOnPlane:function(){var r;return function(t){return r===void 0&&(r=new oe),r.copy(this).projectOnVector(t),this.sub(r)}}(),reflect:function(){var r;return function(t){return r===void 0&&(r=new oe),this.sub(r.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(r){var e=this.dot(r)/Math.sqrt(this.lengthSq()*r.lengthSq());return Math.acos(fr.clamp(e,-1,1))},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y,i=this.z-r.z;return e*e+t*t+i*i},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)+Math.abs(this.z-r.z)},setFromSpherical:function(r){var e=Math.sin(r.phi)*r.radius;return this.x=e*Math.sin(r.theta),this.y=Math.cos(r.phi)*r.radius,this.z=e*Math.cos(r.theta),this},setFromCylindrical:function(r){return this.x=r.radius*Math.sin(r.theta),this.y=r.y,this.z=r.radius*Math.cos(r.theta),this},setFromMatrixPosition:function(r){return this.setFromMatrixColumn(r,3)},setFromMatrixScale:function(r){var e=this.setFromMatrixColumn(r,0).length(),t=this.setFromMatrixColumn(r,1).length(),i=this.setFromMatrixColumn(r,2).length();return this.x=e,this.y=t,this.z=i,this},setFromMatrixColumn:function(r,e){if(typeof r=="number"){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var t=r;r=e,e=t}return this.fromArray(r.elements,e*4)},equals:function(r){return r.x===this.x&&r.y===this.y&&r.z===this.z},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this.z=r[e+2],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r[e+2]=this.z,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this.z=r.getZ(e),this}};Kt.prototype={constructor:Kt,isMatrix4:!0,set:function(r,e,t,i,n,a,o,s,l,u,c,h,f,p,d,g){var m=this.elements;return m[0]=r,m[4]=e,m[8]=t,m[12]=i,m[1]=n,m[5]=a,m[9]=o,m[13]=s,m[2]=l,m[6]=u,m[10]=c,m[14]=h,m[3]=f,m[7]=p,m[11]=d,m[15]=g,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return new Kt().fromArray(this.elements)},copy:function(r){return this.elements.set(r.elements),this},copyPosition:function(r){var e=this.elements,t=r.elements;return e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(r,e,t){return r.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),t.setFromMatrixColumn(this,2),this},makeBasis:function(r,e,t){return this.set(r.x,e.x,t.x,0,r.y,e.y,t.y,0,r.z,e.z,t.z,0,0,0,0,1),this},extractRotation:function(){var r;return function(t){r===void 0&&(r=new oe);var i=this.elements,n=t.elements,a=1/r.setFromMatrixColumn(t,0).length(),o=1/r.setFromMatrixColumn(t,1).length(),s=1/r.setFromMatrixColumn(t,2).length();return i[0]=n[0]*a,i[1]=n[1]*a,i[2]=n[2]*a,i[4]=n[4]*o,i[5]=n[5]*o,i[6]=n[6]*o,i[8]=n[8]*s,i[9]=n[9]*s,i[10]=n[10]*s,this}}(),makeRotationFromEuler:function(r){(r&&r.isEuler)===!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,t=r.x,i=r.y,n=r.z,a=Math.cos(t),o=Math.sin(t),s=Math.cos(i),l=Math.sin(i),u=Math.cos(n),c=Math.sin(n);if(r.order==="XYZ"){var h=a*u,f=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=-s*c,e[8]=l,e[1]=f+p*l,e[5]=h-d*l,e[9]=-o*s,e[2]=d-h*l,e[6]=p+f*l,e[10]=a*s}else if(r.order==="YXZ"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g+_*o,e[4]=v*o-m,e[8]=a*l,e[1]=a*c,e[5]=a*u,e[9]=-o,e[2]=m*o-v,e[6]=_+g*o,e[10]=a*s}else if(r.order==="ZXY"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g-_*o,e[4]=-a*c,e[8]=v+m*o,e[1]=m+v*o,e[5]=a*u,e[9]=_-g*o,e[2]=-a*l,e[6]=o,e[10]=a*s}else if(r.order==="ZYX"){var h=a*u,f=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=p*l-f,e[8]=h*l+d,e[1]=s*c,e[5]=d*l+h,e[9]=f*l-p,e[2]=-l,e[6]=o*s,e[10]=a*s}else if(r.order==="YZX"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=S-y*c,e[8]=M*c+x,e[1]=c,e[5]=a*u,e[9]=-o*u,e[2]=-l*u,e[6]=x*c+M,e[10]=y-S*c}else if(r.order==="XZY"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=-c,e[8]=l*u,e[1]=y*c+S,e[5]=a*u,e[9]=x*c-M,e[2]=M*c-x,e[6]=o*u,e[10]=S*c+y}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(r){var e=this.elements,t=r.x,i=r.y,n=r.z,a=r.w,o=t+t,s=i+i,l=n+n,u=t*o,c=t*s,h=t*l,f=i*s,p=i*l,d=n*l,g=a*o,m=a*s,v=a*l;return e[0]=1-(f+d),e[4]=c-v,e[8]=h+m,e[1]=c+v,e[5]=1-(u+d),e[9]=p-g,e[2]=h-m,e[6]=p+g,e[10]=1-(u+f),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var r,e,t;return function(n,a,o){r===void 0&&(r=new oe,e=new oe,t=new oe);var s=this.elements;return t.subVectors(n,a).normalize(),t.lengthSq()===0&&(t.z=1),r.crossVectors(o,t).normalize(),r.lengthSq()===0&&(t.z+=1e-4,r.crossVectors(o,t).normalize()),e.crossVectors(t,r),s[0]=r.x,s[4]=e.x,s[8]=t.x,s[1]=r.y,s[5]=e.y,s[9]=t.y,s[2]=r.z,s[6]=e.z,s[10]=t.z,this}}(),multiply:function(r,e){return e!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(r,e)):this.multiplyMatrices(this,r)},premultiply:function(r){return this.multiplyMatrices(r,this)},multiplyMatrices:function(r,e){var t=r.elements,i=e.elements,n=this.elements,a=t[0],o=t[4],s=t[8],l=t[12],u=t[1],c=t[5],h=t[9],f=t[13],p=t[2],d=t[6],g=t[10],m=t[14],v=t[3],_=t[7],y=t[11],x=t[15],M=i[0],S=i[4],w=i[8],T=i[12],C=i[1],b=i[5],E=i[9],I=i[13],R=i[2],A=i[6],P=i[10],U=i[14],B=i[3],z=i[7],k=i[11],G=i[15];return n[0]=a*M+o*C+s*R+l*B,n[4]=a*S+o*b+s*A+l*z,n[8]=a*w+o*E+s*P+l*k,n[12]=a*T+o*I+s*U+l*G,n[1]=u*M+c*C+h*R+f*B,n[5]=u*S+c*b+h*A+f*z,n[9]=u*w+c*E+h*P+f*k,n[13]=u*T+c*I+h*U+f*G,n[2]=p*M+d*C+g*R+m*B,n[6]=p*S+d*b+g*A+m*z,n[10]=p*w+d*E+g*P+m*k,n[14]=p*T+d*I+g*U+m*G,n[3]=v*M+_*C+y*R+x*B,n[7]=v*S+_*b+y*A+x*z,n[11]=v*w+_*E+y*P+x*k,n[15]=v*T+_*I+y*U+x*G,this},multiplyToArray:function(r,e,t){var i=this.elements;return this.multiplyMatrices(r,e),t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this},multiplyScalar:function(r){var e=this.elements;return e[0]*=r,e[4]*=r,e[8]*=r,e[12]*=r,e[1]*=r,e[5]*=r,e[9]*=r,e[13]*=r,e[2]*=r,e[6]*=r,e[10]*=r,e[14]*=r,e[3]*=r,e[7]*=r,e[11]*=r,e[15]*=r,this},applyToVector3Array:function(){var r;return function(t,i,n){r===void 0&&(r=new oe),i===void 0&&(i=0),n===void 0&&(n=t.length);for(var a=0,o=i;a 0,shadowMapType:r.shadowMap.type,toneMapping:r.toneMapping,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,alphaTest:s.alphaTest,doubleSided:s.side===n_,flipSided:s.side===jf,depthPacking:s.depthPacking!==void 0?s.depthPacking:!1};return v},this.getProgramCode=function(s,l){var u=[];if(l.shaderID?u.push(l.shaderID):(u.push(s.fragmentShader),u.push(s.vertexShader)),s.defines!==void 0)for(var c in s.defines)u.push(c),u.push(s.defines[c]);for(var h=0;h 65535?Uint32Array:Uint16Array,C=new Mt(new T(p),1);return a(C,r.ELEMENT_ARRAY_BUFFER),f.wireframe=C,C}return{getAttributeBuffer:l,getAttributeProperties:u,getWireframeAttribute:c,update:n}}function DOe(r,e,t,i,n,a,o){var s=o.memory,l=typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext;function u(R,A){if(R.width>A||R.height>A){var P=A/Math.max(R.width,R.height),U=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");U.width=Math.floor(R.width*P),U.height=Math.floor(R.height*P);var B=U.getContext("2d");return B.drawImage(R,0,0,R.width,R.height,0,0,U.width,U.height),console.warn("THREE.WebGLRenderer: image is too big ("+R.width+"x"+R.height+"). Resized to "+U.width+"x"+U.height,R),U}return R}function c(R){return fr.isPowerOfTwo(R.width)&&fr.isPowerOfTwo(R.height)}function h(R){if(R instanceof HTMLImageElement||R instanceof HTMLCanvasElement){var A=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");A.width=fr.nearestPowerOfTwo(R.width),A.height=fr.nearestPowerOfTwo(R.height);var P=A.getContext("2d");return P.drawImage(R,0,0,A.width,A.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+R.width+"x"+R.height+"). Resized to "+A.width+"x"+A.height,R),A}return R}function f(R){return R.wrapS!==Ms||R.wrapT!==Ms||R.minFilter!==bs&&R.minFilter!==qo}function p(R){return R===bs||R===CL||R===RL?r.NEAREST:r.LINEAR}function d(R){var A=R.target;A.removeEventListener("dispose",d),m(A),s.textures--}function g(R){var A=R.target;A.removeEventListener("dispose",g),v(A),s.textures--}function m(R){var A=i.get(R);if(R.image&&A.__image__webglTextureCube)r.deleteTexture(A.__image__webglTextureCube);else{if(A.__webglInit===void 0)return;r.deleteTexture(A.__webglTexture)}i.delete(R)}function v(R){var A=i.get(R),P=i.get(R.texture);if(R){if(P.__webglTexture!==void 0&&r.deleteTexture(P.__webglTexture),R.depthTexture&&R.depthTexture.dispose(),R.isWebGLRenderTargetCube)for(var U=0;U<6;U++)r.deleteFramebuffer(A.__webglFramebuffer[U]),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer[U]);else r.deleteFramebuffer(A.__webglFramebuffer),A.__webglDepthbuffer&&r.deleteRenderbuffer(A.__webglDepthbuffer);i.delete(R.texture),i.delete(R)}}function _(R,A){var P=i.get(R);if(R.version>0&&P.__version!==R.version){var U=R.image;if(U===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",R);else if(U.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",R);else{S(P,R,A);return}}t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_2D,P.__webglTexture)}function y(R,A){var P=i.get(R);if(R.image.length===6)if(R.version>0&&P.__version!==R.version){P.__image__webglTextureCube||(R.addEventListener("dispose",d),P.__image__webglTextureCube=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,P.__image__webglTextureCube),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,R.flipY);for(var U=R&&R.isCompressedTexture,B=R.image[0]&&R.image[0].isDataTexture,z=[],k=0;k<6;k++)!U&&!B?z[k]=u(R.image[k],n.maxCubemapSize):z[k]=B?R.image[k].image:R.image[k];var G=z[0],Y=c(G),J=a(R.format),Q=a(R.type);M(r.TEXTURE_CUBE_MAP,R,Y);for(var k=0;k<6;k++)if(!U)B?t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,z[k].width,z[k].height,0,J,Q,z[k].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,0,J,J,Q,z[k]);else for(var V,K=z[k].mipmaps,ae=0,ve=K.length;ae -1?t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,V.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+k,ae,J,V.width,V.height,0,J,Q,V.data);R.generateMipmaps&&Y&&r.generateMipmap(r.TEXTURE_CUBE_MAP),P.__version=R.version,R.onUpdate&&R.onUpdate(R)}else t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,P.__image__webglTextureCube)}function x(R,A){t.activeTexture(r.TEXTURE0+A),t.bindTexture(r.TEXTURE_CUBE_MAP,i.get(R).__webglTexture)}function M(R,A,P){var U;if(P?(r.texParameteri(R,r.TEXTURE_WRAP_S,a(A.wrapS)),r.texParameteri(R,r.TEXTURE_WRAP_T,a(A.wrapT)),r.texParameteri(R,r.TEXTURE_MAG_FILTER,a(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,a(A.minFilter))):(r.texParameteri(R,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(R,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(A.wrapS!==Ms||A.wrapT!==Ms)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",A),r.texParameteri(R,r.TEXTURE_MAG_FILTER,p(A.magFilter)),r.texParameteri(R,r.TEXTURE_MIN_FILTER,p(A.minFilter)),A.minFilter!==bs&&A.minFilter!==qo&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",A)),U=e.get("EXT_texture_filter_anisotropic"),U){if(A.type===_0&&e.get("OES_texture_float_linear")===null||A.type===JR&&e.get("OES_texture_half_float_linear")===null)return;(A.anisotropy>1||i.get(A).__currentAnisotropy)&&(r.texParameterf(R,U.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,n.getMaxAnisotropy())),i.get(A).__currentAnisotropy=A.anisotropy)}}function S(R,A,P){R.__webglInit===void 0&&(R.__webglInit=!0,A.addEventListener("dispose",d),R.__webglTexture=r.createTexture(),s.textures++),t.activeTexture(r.TEXTURE0+P),t.bindTexture(r.TEXTURE_2D,R.__webglTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,A.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,A.unpackAlignment);var U=u(A.image,n.maxTextureSize);f(A)&&c(U)===!1&&(U=h(U));var B=c(U),z=a(A.format),k=a(A.type);M(r.TEXTURE_2D,A,B);var G,Y=A.mipmaps;if(A.isDepthTexture){var J=r.DEPTH_COMPONENT;if(A.type===_0){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");J=r.DEPTH_COMPONENT32F}else l&&(J=r.DEPTH_COMPONENT16);A.format===tm&&J===r.DEPTH_COMPONENT&&A.type!==NM&&A.type!==Kk&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),A.type=NM,k=a(A.type)),A.format===S0&&(J=r.DEPTH_STENCIL,A.type!==UM&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),A.type=UM,k=a(A.type))),t.texImage2D(r.TEXTURE_2D,0,J,U.width,U.height,0,z,k,null)}else if(A.isDataTexture)if(Y.length>0&&B){for(var Q=0,V=Y.length;Q -1?t.compressedTexImage2D(r.TEXTURE_2D,Q,z,G.width,G.height,0,G.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(r.TEXTURE_2D,Q,z,G.width,G.height,0,z,k,G.data);else if(Y.length>0&&B){for(var Q=0,V=Y.length;Q =1,U=null,B={},z=new ii,k=new ii;function G($,nt,Xe){var Fe=new Uint8Array(4),we=r.createTexture();r.bindTexture($,we),r.texParameteri($,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri($,r.TEXTURE_MAG_FILTER,r.NEAREST);for(var Ie=0;Ie 0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=t.precision!==void 0?t.precision:"highp",s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=t.logarithmicDepthBuffer===!0&&!!e.get("EXT_frag_depth"),u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),c=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=r.getParameter(r.MAX_TEXTURE_SIZE),f=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),d=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),g=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),v=c>0,_=!!e.get("OES_texture_float"),y=v&&_;return{getMaxAnisotropy:n,getMaxPrecision:a,precision:o,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:c,maxTextureSize:h,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:d,maxVaryings:g,maxFragmentUniforms:m,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:y}}function UOe(r){var e={};return{get:function(t){if(e[t]!==void 0)return e[t];var i;switch(t){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":i=r.getExtension("WEBGL_compressed_texture_etc1");break;default:i=r.getExtension(t)}return i===null&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e[t]=i,i}}}function OOe(){var r=this,e=null,t=0,i=!1,n=!1,a=new xs,o=new dl,s={value:null,needsUpdate:!1};this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(c,h,f){var p=c.length!==0||h||t!==0||i;return i=h,e=u(c,f,0),t=c.length,p},this.beginShadows=function(){n=!0,u(null)},this.endShadows=function(){n=!1,l()},this.setState=function(c,h,f,p,d,g){if(!i||c===null||c.length===0||n&&!f)n?u(null):l();else{var m=n?0:t,v=m*4,_=d.clippingState||null;s.value=_,_=u(c,p,v,g);for(var y=0;y!==v;++y)_[y]=e[y];d.clippingState=_,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=m}};function l(){s.value!==e&&(s.value=e,s.needsUpdate=t>0),r.numPlanes=t,r.numIntersection=0}function u(c,h,f,p){var d=c!==null?c.length:0,g=null;if(d!==0){if(g=s.value,p!==!0||g===null){var m=f+d*4,v=h.matrixWorldInverse;o.getNormalMatrix(v),(g===null||g.length 8&&($e.length=8);for(var _i=ee.morphAttributes,lt=0,Ct=$e.length;lt 0&&Ei.renderInstances(ee,np,IL):Ei.render(np,IL)}};function ct(D,W,ee,ge){var ce;if(ee&&ee.isInstancedBufferGeometry&&(ce=We.get("ANGLE_instanced_arrays"),ce===null)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}ge===void 0&&(ge=0),xe.initAttributes();var Oe=ee.attributes,Ge=W.getAttributes(),Re=D.defaultAttributeValues;for(var gt in Ge){var _t=Ge[gt];if(_t>=0){var $e=Oe[gt];if($e!==void 0){var lt=$e.normalized,Ct=$e.itemSize,je=Ne.getAttributeProperties($e),_i=je.__webglBuffer,Ft=je.type,Nr=je.bytesPerElement;if($e.isInterleavedBufferAttribute){var Yi=$e.data,Et=Yi.stride,Ei=$e.offset;Yi&&Yi.isInstancedInterleavedBuffer?(xe.enableAttributeAndDivisor(_t,Yi.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=Yi.meshPerAttribute*Yi.count)):xe.enableAttribute(_t),q.bindBuffer(q.ARRAY_BUFFER,_i),q.vertexAttribPointer(_t,Ct,Ft,lt,Et*Nr,(ge*Et+Ei)*Nr)}else $e.isInstancedBufferAttribute?(xe.enableAttributeAndDivisor(_t,$e.meshPerAttribute,ce),ee.maxInstancedCount===void 0&&(ee.maxInstancedCount=$e.meshPerAttribute*$e.count)):xe.enableAttribute(_t),q.bindBuffer(q.ARRAY_BUFFER,_i),q.vertexAttribPointer(_t,Ct,Ft,lt,0,ge*Ct*Nr)}else if(Re!==void 0){var cr=Re[gt];if(cr!==void 0)switch(cr.length){case 2:q.vertexAttrib2fv(_t,cr);break;case 3:q.vertexAttrib3fv(_t,cr);break;case 4:q.vertexAttrib4fv(_t,cr);break;default:q.vertexAttrib1fv(_t,cr)}}}}xe.disableUnusedAttributes()}function Je(D,W){return Math.abs(W[0])-Math.abs(D[0])}function Gt(D,W){return D.object.renderOrder!==W.object.renderOrder?D.object.renderOrder-W.object.renderOrder:D.material.program&&W.material.program&&D.material.program!==W.material.program?D.material.program.id-W.material.program.id:D.material.id!==W.material.id?D.material.id-W.material.id:D.z!==W.z?D.z-W.z:D.id-W.id}function X(D,W){return D.object.renderOrder!==W.object.renderOrder?D.object.renderOrder-W.object.renderOrder:D.z!==W.z?W.z-D.z:D.id-W.id}this.render=function(D,W,ee,ge){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}S="",M=-1,w=null,D.autoUpdate===!0&&D.updateMatrixWorld(),W.parent===null&&W.updateMatrixWorld(),W.matrixWorldInverse.getInverse(W.matrixWorld),K.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),G.setFromMatrix(K),u.length=0,h=-1,p=-1,g.length=0,m.length=0,Q=this.localClippingEnabled,J=Y.init(this.clippingPlanes,Q,W),wt(D,W),c.length=h+1,f.length=p+1,v.sortObjects===!0&&(c.sort(Gt),f.sort(X)),J&&Y.beginShadows(),O(u),st.render(D,W),j(u,W),J&&Y.endShadows(),Ee.calls=0,Ee.vertices=0,Ee.faces=0,Ee.points=0,ee===void 0&&(ee=null),this.setRenderTarget(ee);var ce=D.background;if(ce===null?xe.buffers.color.setClear(I.r,I.g,I.b,R,s):ce&&ce.isColor&&(xe.buffers.color.setClear(ce.r,ce.g,ce.b,1,s),ge=!0),(this.autoClear||ge)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),ce&&ce.isCubeTexture?(le.projectionMatrix.copy(W.projectionMatrix),le.matrixWorld.extractRotation(W.matrixWorld),le.matrixWorldInverse.getInverse(le.matrixWorld),et.material.uniforms.tCube.value=ce,et.modelViewMatrix.multiplyMatrices(le.matrixWorldInverse,et.matrixWorld),Ne.update(et),v.renderBufferDirect(le,null,et.geometry,et.material,et,null)):ce&&ce.isTexture&&(me.material.map=ce,Ne.update(me),v.renderBufferDirect(ne,null,me.geometry,me.material,me,null)),D.overrideMaterial){var Oe=D.overrideMaterial;kt(c,D,W,Oe),kt(f,D,W,Oe)}else xe.setBlending(IM),kt(c,D,W),kt(f,D,W);$.render(D,W),nt.render(D,W,b),ee&&Ue.updateRenderTargetMipmap(ee),xe.setDepthTest(!0),xe.setDepthWrite(!0),xe.setColorWrite(!0)};function Te(D,W,ee,ge,ce){var Oe,Ge;ee.transparent?(Oe=f,Ge=++p):(Oe=c,Ge=++h);var Re=Oe[Ge];Re!==void 0?(Re.id=D.id,Re.object=D,Re.geometry=W,Re.material=ee,Re.z=ae.z,Re.group=ce):(Re={id:D.id,object:D,geometry:W,material:ee,z:ae.z,group:ce},Oe.push(Re))}function te(D){var W=D.geometry;return W.boundingSphere===null&&W.computeBoundingSphere(),V.copy(W.boundingSphere).applyMatrix4(D.matrixWorld),De(V)}function Me(D){return V.center.set(0,0,0),V.radius=.7071067811865476,V.applyMatrix4(D.matrixWorld),De(V)}function De(D){if(!G.intersectsSphere(D))return!1;var W=Y.numPlanes;if(W===0)return!0;var ee=v.clippingPlanes,ge=D.center,ce=-D.radius,Oe=0;do if(ee[Oe].distanceToPoint(ge) =0&&D.numSupportedMorphTargets++}if(D.morphNormals){D.numSupportedMorphNormals=0;for(var $e=0;$e =0&&D.numSupportedMorphNormals++}var lt=ge.__webglShader.uniforms;(!D.isShaderMaterial&&!D.isRawShaderMaterial||D.clipping===!0)&&(ge.numClippingPlanes=Y.numPlanes,ge.numIntersection=Y.numIntersection,lt.clippingPlanes=Y.uniform),ge.fog=W,ge.lightsHash=se.hash,D.lights&&(lt.ambientLightColor.value=se.ambient,lt.directionalLights.value=se.directional,lt.spotLights.value=se.spot,lt.rectAreaLights.value=se.rectArea,lt.pointLights.value=se.point,lt.hemisphereLights.value=se.hemi,lt.directionalShadowMap.value=se.directionalShadowMap,lt.directionalShadowMatrix.value=se.directionalShadowMatrix,lt.spotShadowMap.value=se.spotShadowMap,lt.spotShadowMatrix.value=se.spotShadowMatrix,lt.pointShadowMap.value=se.pointShadowMap,lt.pointShadowMatrix.value=se.pointShadowMatrix);var Ct=ge.program.getUniforms(),je=Jf.seqWithValue(Ct.seq,lt);ge.uniformsList=je}function $r(D){D.side===n_?xe.disable(q.CULL_FACE):xe.enable(q.CULL_FACE),xe.setFlipSided(D.side===jf),D.transparent===!0?xe.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst,D.blendEquationAlpha,D.blendSrcAlpha,D.blendDstAlpha,D.premultipliedAlpha):xe.setBlending(IM),xe.setDepthFunc(D.depthFunc),xe.setDepthTest(D.depthTest),xe.setDepthWrite(D.depthWrite),xe.setColorWrite(D.colorWrite),xe.setPolygonOffset(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits)}function Ht(D,W,ee,ge){E=0;var ce=Le.get(ee);if(J&&(Q||D!==w)){var Oe=D===w&&ee.id===M;Y.setState(ee.clippingPlanes,ee.clipIntersection,ee.clipShadows,D,ce,Oe)}ee.needsUpdate===!1&&(ce.program===void 0||ee.fog&&ce.fog!==W||ee.lights&&ce.lightsHash!==se.hash||ce.numClippingPlanes!==void 0&&(ce.numClippingPlanes!==Y.numPlanes||ce.numIntersection!==Y.numIntersection))&&(ee.needsUpdate=!0),ee.needsUpdate&&(Tr(ee,W,ge),ee.needsUpdate=!1);var Ge=!1,Re=!1,gt=!1,_t=ce.program,$e=_t.getUniforms(),lt=ce.__webglShader.uniforms;if(_t.id!==_&&(q.useProgram(_t.program),_=_t.id,Ge=!0,Re=!0,gt=!0),ee.id!==M&&(M=ee.id,Re=!0),Ge||D!==w){if($e.set(q,D,"projectionMatrix"),_e.logarithmicDepthBuffer&&$e.setValue(q,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),D!==w&&(w=D,Re=!0,gt=!0),ee.isShaderMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.envMap){var Ct=$e.map.cameraPosition;Ct!==void 0&&Ct.setValue(q,ae.setFromMatrixPosition(D.matrixWorld))}(ee.isMeshPhongMaterial||ee.isMeshLambertMaterial||ee.isMeshBasicMaterial||ee.isMeshStandardMaterial||ee.isShaderMaterial||ee.skinning)&&$e.setValue(q,"viewMatrix",D.matrixWorldInverse),$e.set(q,v,"toneMappingExposure"),$e.set(q,v,"toneMappingWhitePoint")}if(ee.skinning){$e.setOptional(q,ge,"bindMatrix"),$e.setOptional(q,ge,"bindMatrixInverse");var je=ge.skeleton;je&&(_e.floatVertexTextures&&je.useVertexTexture?($e.set(q,je,"boneTexture"),$e.set(q,je,"boneTextureWidth"),$e.set(q,je,"boneTextureHeight")):$e.setOptional(q,je,"boneMatrices"))}return Re&&(ee.lights&&h_(lt,gt),W&&ee.fog&&gl(lt,W),(ee.isMeshBasicMaterial||ee.isMeshLambertMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.isMeshNormalMaterial||ee.isMeshDepthMaterial)&&Or(lt,ee),ee.isLineBasicMaterial?hi(lt,ee):ee.isLineDashedMaterial?(hi(lt,ee),tp(lt,ee)):ee.isPointsMaterial?l_(lt,ee):ee.isMeshLambertMaterial?rp(lt,ee):ee.isMeshToonMaterial?ip(lt,ee):ee.isMeshPhongMaterial?Es(lt,ee):ee.isMeshPhysicalMaterial?u_(lt,ee):ee.isMeshStandardMaterial?oh(lt,ee):ee.isMeshDepthMaterial?ee.displacementMap&&(lt.displacementMap.value=ee.displacementMap,lt.displacementScale.value=ee.displacementScale,lt.displacementBias.value=ee.displacementBias):ee.isMeshNormalMaterial&&c_(lt,ee),lt.ltcMat!==void 0&&(lt.ltcMat.value=THREE.UniformsLib.LTC_MAT_TEXTURE),lt.ltcMag!==void 0&&(lt.ltcMag.value=THREE.UniformsLib.LTC_MAG_TEXTURE),Jf.upload(q,ce.uniformsList,lt,v)),$e.set(q,ge,"modelViewMatrix"),$e.set(q,ge,"normalMatrix"),$e.setValue(q,"modelMatrix",ge.matrixWorld),_t}function Or(D,W){D.opacity.value=W.opacity,D.diffuse.value=W.color,W.emissive&&D.emissive.value.copy(W.emissive).multiplyScalar(W.emissiveIntensity),D.map.value=W.map,D.specularMap.value=W.specularMap,D.alphaMap.value=W.alphaMap,W.lightMap&&(D.lightMap.value=W.lightMap,D.lightMapIntensity.value=W.lightMapIntensity),W.aoMap&&(D.aoMap.value=W.aoMap,D.aoMapIntensity.value=W.aoMapIntensity);var ee;if(W.map?ee=W.map:W.specularMap?ee=W.specularMap:W.displacementMap?ee=W.displacementMap:W.normalMap?ee=W.normalMap:W.bumpMap?ee=W.bumpMap:W.roughnessMap?ee=W.roughnessMap:W.metalnessMap?ee=W.metalnessMap:W.alphaMap?ee=W.alphaMap:W.emissiveMap&&(ee=W.emissiveMap),ee!==void 0){ee.isWebGLRenderTarget&&(ee=ee.texture);var ge=ee.offset,ce=ee.repeat;D.offsetRepeat.value.set(ge.x,ge.y,ce.x,ce.y)}D.envMap.value=W.envMap,D.flipEnvMap.value=W.envMap&&W.envMap.isCubeTexture?-1:1,D.reflectivity.value=W.reflectivity,D.refractionRatio.value=W.refractionRatio}function hi(D,W){D.diffuse.value=W.color,D.opacity.value=W.opacity}function tp(D,W){D.dashSize.value=W.dashSize,D.totalSize.value=W.dashSize+W.gapSize,D.scale.value=W.scale}function l_(D,W){if(D.diffuse.value=W.color,D.opacity.value=W.opacity,D.size.value=W.size*U,D.scale.value=P*.5,D.map.value=W.map,W.map!==null){var ee=W.map.offset,ge=W.map.repeat;D.offsetRepeat.value.set(ee.x,ee.y,ge.x,ge.y)}}function gl(D,W){D.fogColor.value=W.color,W.isFog?(D.fogNear.value=W.near,D.fogFar.value=W.far):W.isFogExp2&&(D.fogDensity.value=W.density)}function rp(D,W){W.emissiveMap&&(D.emissiveMap.value=W.emissiveMap)}function Es(D,W){D.specular.value=W.specular,D.shininess.value=Math.max(W.shininess,1e-4),W.emissiveMap&&(D.emissiveMap.value=W.emissiveMap),W.bumpMap&&(D.bumpMap.value=W.bumpMap,D.bumpScale.value=W.bumpScale),W.normalMap&&(D.normalMap.value=W.normalMap,D.normalScale.value.copy(W.normalScale)),W.displacementMap&&(D.displacementMap.value=W.displacementMap,D.displacementScale.value=W.displacementScale,D.displacementBias.value=W.displacementBias)}function ip(D,W){Es(D,W),W.gradientMap&&(D.gradientMap.value=W.gradientMap)}function oh(D,W){D.roughness.value=W.roughness,D.metalness.value=W.metalness,W.roughnessMap&&(D.roughnessMap.value=W.roughnessMap),W.metalnessMap&&(D.metalnessMap.value=W.metalnessMap),W.emissiveMap&&(D.emissiveMap.value=W.emissiveMap),W.bumpMap&&(D.bumpMap.value=W.bumpMap,D.bumpScale.value=W.bumpScale),W.normalMap&&(D.normalMap.value=W.normalMap,D.normalScale.value.copy(W.normalScale)),W.displacementMap&&(D.displacementMap.value=W.displacementMap,D.displacementScale.value=W.displacementScale,D.displacementBias.value=W.displacementBias),W.envMap&&(D.envMapIntensity.value=W.envMapIntensity)}function u_(D,W){D.clearCoat.value=W.clearCoat,D.clearCoatRoughness.value=W.clearCoatRoughness,oh(D,W)}function c_(D,W){W.bumpMap&&(D.bumpMap.value=W.bumpMap,D.bumpScale.value=W.bumpScale),W.normalMap&&(D.normalMap.value=W.normalMap,D.normalScale.value.copy(W.normalScale)),W.displacementMap&&(D.displacementMap.value=W.displacementMap,D.displacementScale.value=W.displacementScale,D.displacementBias.value=W.displacementBias)}function h_(D,W){D.ambientLightColor.needsUpdate=W,D.directionalLights.needsUpdate=W,D.pointLights.needsUpdate=W,D.spotLights.needsUpdate=W,D.rectAreaLights.needsUpdate=W,D.hemisphereLights.needsUpdate=W}function O(D){for(var W=0,ee=0,ge=D.length;ee =_e.maxTextures&&console.warn("WebGLRenderer: trying to use "+D+" texture units while this GPU supports only "+_e.maxTextures),E+=1,D}this.allocTextureUnit=re,this.setTexture2D=function(){var D=!1;return function(ee,ge){ee&&ee.isWebGLRenderTarget&&(D||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),D=!0),ee=ee.texture),Ue.setTexture2D(ee,ge)}}(),this.setTexture=function(){var D=!1;return function(ee,ge){D||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),D=!0),Ue.setTexture2D(ee,ge)}}(),this.setTextureCube=function(){var D=!1;return function(ee,ge){ee&&ee.isWebGLRenderTargetCube&&(D||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),D=!0),ee=ee.texture),ee&&ee.isCubeTexture||Array.isArray(ee.image)&&ee.image.length===6?Ue.setTextureCube(ee,ge):Ue.setTextureCubeDynamic(ee,ge)}}(),this.getCurrentRenderTarget=function(){return y},this.setRenderTarget=function(D){y=D,D&&Le.get(D).__webglFramebuffer===void 0&&Ue.setupRenderTarget(D);var W=D&&D.isWebGLRenderTargetCube,ee;if(D){var ge=Le.get(D);W?ee=ge.__webglFramebuffer[D.activeCubeFace]:ee=ge.__webglFramebuffer,T.copy(D.scissor),C=D.scissorTest,b.copy(D.viewport)}else ee=null,T.copy(B).multiplyScalar(U),C=z,b.copy(k).multiplyScalar(U);if(x!==ee&&(q.bindFramebuffer(q.FRAMEBUFFER,ee),x=ee),xe.scissor(T),xe.setScissorTest(C),xe.viewport(b),W){var ce=Le.get(D.texture);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,q.TEXTURE_CUBE_MAP_POSITIVE_X+D.activeCubeFace,ce.__webglTexture,D.activeMipMapLevel)}},this.readRenderTargetPixels=function(D,W,ee,ge,ce,Oe){if((D&&D.isWebGLRenderTarget)===!1){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}var Ge=Le.get(D).__webglFramebuffer;if(Ge){var Re=!1;Ge!==x&&(q.bindFramebuffer(q.FRAMEBUFFER,Ge),Re=!0);try{var gt=D.texture,_t=gt.format,$e=gt.type;if(_t!==qu&&ie(_t)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if($e!==KR&&ie($e)!==q.getParameter(q.IMPLEMENTATION_COLOR_READ_TYPE)&&!($e===_0&&(We.get("OES_texture_float")||We.get("WEBGL_color_buffer_float")))&&!($e===JR&&We.get("EXT_color_buffer_half_float"))){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?W>=0&&W<=D.width-ge&&ee>=0&&ee<=D.height-ce&&q.readPixels(W,ee,ge,ce,ie(_t),ie($e),Oe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{Re&&q.bindFramebuffer(q.FRAMEBUFFER,x)}}};function ie(D){var W;if(D===Qc)return q.REPEAT;if(D===Ms)return q.CLAMP_TO_EDGE;if(D===am)return q.MIRRORED_REPEAT;if(D===bs)return q.NEAREST;if(D===CL)return q.NEAREST_MIPMAP_NEAREST;if(D===RL)return q.NEAREST_MIPMAP_LINEAR;if(D===qo)return q.LINEAR;if(D===jk)return q.LINEAR_MIPMAP_NEAREST;if(D===Tb)return q.LINEAR_MIPMAP_LINEAR;if(D===KR)return q.UNSIGNED_BYTE;if(D===tse)return q.UNSIGNED_SHORT_4_4_4_4;if(D===rse)return q.UNSIGNED_SHORT_5_5_5_1;if(D===ise)return q.UNSIGNED_SHORT_5_6_5;if(D===$oe)return q.BYTE;if(D===Qoe)return q.SHORT;if(D===NM)return q.UNSIGNED_SHORT;if(D===ese)return q.INT;if(D===Kk)return q.UNSIGNED_INT;if(D===_0)return q.FLOAT;if(D===JR&&(W=We.get("OES_texture_half_float"),W!==null))return W.HALF_FLOAT_OES;if(D===nse)return q.ALPHA;if(D===x0)return q.RGB;if(D===qu)return q.RGBA;if(D===ase)return q.LUMINANCE;if(D===ose)return q.LUMINANCE_ALPHA;if(D===tm)return q.DEPTH_COMPONENT;if(D===S0)return q.DEPTH_STENCIL;if(D===Hk)return q.FUNC_ADD;if(D===Coe)return q.FUNC_SUBTRACT;if(D===Roe)return q.FUNC_REVERSE_SUBTRACT;if(D===Loe)return q.ZERO;if(D===Doe)return q.ONE;if(D===Poe)return q.SRC_COLOR;if(D===Ioe)return q.ONE_MINUS_SRC_COLOR;if(D===Wk)return q.SRC_ALPHA;if(D===Xk)return q.ONE_MINUS_SRC_ALPHA;if(D===Noe)return q.DST_ALPHA;if(D===Uoe)return q.ONE_MINUS_DST_ALPHA;if(D===Ooe)return q.DST_COLOR;if(D===zoe)return q.ONE_MINUS_DST_COLOR;if(D===Foe)return q.SRC_ALPHA_SATURATE;if((D===fk||D===pk||D===dk||D===mk)&&(W=We.get("WEBGL_compressed_texture_s3tc"),W!==null)){if(D===fk)return W.COMPRESSED_RGB_S3TC_DXT1_EXT;if(D===pk)return W.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(D===dk)return W.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(D===mk)return W.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((D===vk||D===gk||D===yk||D===_k)&&(W=We.get("WEBGL_compressed_texture_pvrtc"),W!==null)){if(D===vk)return W.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(D===gk)return W.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(D===yk)return W.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(D===_k)return W.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(D===sse&&(W=We.get("WEBGL_compressed_texture_etc1"),W!==null))return W.COMPRESSED_RGB_ETC1_WEBGL;if((D===lk||D===uk)&&(W=We.get("EXT_blend_minmax"),W!==null)){if(D===lk)return W.MIN_EXT;if(D===uk)return W.MAX_EXT}return D===UM&&(W=We.get("WEBGL_depth_texture"),W!==null)?W.UNSIGNED_INT_24_8_WEBGL:0}}function T0(r,e){this.name="",this.color=new Wt(r),this.density=e!==void 0?e:25e-5}function E0(r,e,t){this.name="",this.color=new Wt(r),this.near=e!==void 0?e:1,this.far=t!==void 0?t:1e3}function cm(){Lt.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Sk(r,e,t,i,n){Lt.call(this),this.lensFlares=[],this.positionScreen=new oe,this.customUpdateCallback=void 0,r!==void 0&&this.add(r,e,t,i,n)}function hm(r){_r.call(this),this.type="SpriteMaterial",this.color=new Wt(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(r)}function qM(r){Lt.call(this),this.type="Sprite",this.material=r!==void 0?r:new hm}function ZM(){Lt.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function QR(r,e,t){if(this.useVertexTexture=t!==void 0?t:!0,this.identityMatrix=new Kt,r=r||[],this.bones=r.slice(0),this.useVertexTexture){var i=Math.sqrt(this.bones.length*4);i=fr.nextPowerOfTwo(Math.ceil(i)),i=Math.max(i,4),this.boneTextureWidth=i,this.boneTextureHeight=i,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new sm(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,qu,_0)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(e===void 0)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var n=0,a=this.bones.length;n=r.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}c()}function C0(r,e,t,i,n,a,o,s,l,u,c,h){ci.call(this,null,a,o,s,l,u,i,n,c,h),this.image={width:e,height:t},this.mipmaps=r,this.flipY=!1,this.generateMipmaps=!1}function iL(r,e,t,i,n,a,o,s,l){ci.call(this,r,e,t,i,n,a,o,s,l),this.needsUpdate=!0}function KM(r,e,t,i,n,a,o,s,l,u){if(u=u!==void 0?u:tm,u!==tm&&u!==S0)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");t===void 0&&u===tm&&(t=NM),t===void 0&&u===S0&&(t=UM),ci.call(this,null,i,n,a,o,s,u,t,l),this.image={width:r,height:e},this.magFilter=o!==void 0?o:bs,this.minFilter=s!==void 0?s:bs,this.flipY=!1,this.generateMipmaps=!1}function R0(r){Vt.call(this);var e=[0,0],t={};function i(I,R){return I-R}var n=["a","b","c"];if(r&&r.isGeometry){for(var a=r.vertices,o=r.faces,s=0,l=new Uint32Array(6*o.length),u=0,c=o.length;u 65535?th:eh)(h,1)),this.addAttribute("position",new Mr(i,3)),this.addAttribute("uv",new Mr(n,2)),this.computeVertexNormals()}function JM(r,e,t){ur.call(this),this.type="ParametricGeometry",this.parameters={func:r,slices:e,stacks:t},this.fromBufferGeometry(new L0(r,e,t)),this.mergeVertices()}function Ko(r,e,t,i){Vt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:r,indices:e,radius:t,detail:i},t=t||1,i=i||0;var n=[],a=[];o(i),l(t),u(),this.addAttribute("position",new Mr(n,3)),this.addAttribute("normal",new Mr(n.slice(),3)),this.addAttribute("uv",new Mr(a,2)),this.normalizeNormals(),this.boundingSphere=new fa(new oe,t);function o(v){for(var _=new oe,y=new oe,x=new oe,M=0;M .9&&S<.1&&(_<.2&&(a[v+0]+=1),y<.2&&(a[v+2]+=1),x<.2&&(a[v+4]+=1))}}function h(v){n.push(v.x,v.y,v.z)}function f(v,_){var y=v*3;_.x=r[y+0],_.y=r[y+1],_.z=r[y+2]}function p(){for(var v=new oe,_=new oe,y=new oe,x=new oe,M=new Tt,S=new Tt,w=new Tt,T=0,C=0;T 65535?th:eh)(d,1)),this.addAttribute("position",new Mr(h,3)),this.addAttribute("normal",new Mr(f,3)),this.addAttribute("uv",new Mr(p,2));function g(){for(u=0;u 65535?Uint32Array:Uint16Array)(s),1),u=new Mt(new Float32Array(o*3),3),c=new Mt(new Float32Array(o*3),3),h=new Mt(new Float32Array(o*2),2),f,p,d=0,g=0,m=new oe,v=new oe,_=new Tt,y=new oe,x=new oe,M=new oe,S=new oe,w=new oe;for(f=0;f<=t;++f){var T=f/t*n*Math.PI*2;for(U(T,n,a,r,y),U(T+.01,n,a,r,x),S.subVectors(x,y),w.addVectors(x,y),M.crossVectors(S,w),w.crossVectors(M,S),M.normalize(),w.normalize(),p=0;p<=i;++p){var C=p/i*Math.PI*2,b=-e*Math.cos(C),E=e*Math.sin(C);m.x=y.x+(b*w.x+E*M.x),m.y=y.y+(b*w.y+E*M.y),m.z=y.z+(b*w.z+E*M.z),u.setXYZ(d,m.x,m.y,m.z),v.subVectors(m,y).normalize(),c.setXYZ(d,v.x,v.y,v.z),_.x=f/t,_.y=p/i,h.setXY(d,_.x,_.y),d++}}for(p=1;p<=t;p++)for(f=1;f<=i;f++){var I=(i+1)*(p-1)+(f-1),R=(i+1)*p+(f-1),A=(i+1)*p+f,P=(i+1)*(p-1)+f;l.setX(g,I),g++,l.setX(g,R),g++,l.setX(g,P),g++,l.setX(g,R),g++,l.setX(g,A),g++,l.setX(g,P),g++}this.setIndex(l),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",h);function U(B,z,k,G,Y){var J=Math.cos(B),Q=Math.sin(B),V=k/z*B,K=Math.cos(V);Y.x=G*(2+K)*.5*J,Y.y=G*(2+K)*Q*.5,Y.z=G*Math.sin(V)*.5}}function nb(r,e,t,i,n,a,o){ur.call(this),this.type="TorusKnotGeometry",this.parameters={radius:r,tube:e,tubularSegments:t,radialSegments:i,p:n,q:a},o!==void 0&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new U0(r,e,t,i,n,a)),this.mergeVertices()}function O0(r,e,t,i,n){Vt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},r=r||100,e=e||40,t=Math.floor(t)||8,i=Math.floor(i)||6,n=n||Math.PI*2;var a=(t+1)*(i+1),o=t*i*2*3,s=new(o>65535?Uint32Array:Uint16Array)(o),l=new Float32Array(a*3),u=new Float32Array(a*3),c=new Float32Array(a*2),h=0,f=0,p=0,d=new oe,g=new oe,m=new oe,v,_;for(v=0;v<=t;v++)for(_=0;_<=i;_++){var y=_/i*n,x=v/t*Math.PI*2;g.x=(r+e*Math.cos(x))*Math.cos(y),g.y=(r+e*Math.cos(x))*Math.sin(y),g.z=e*Math.sin(x),l[h]=g.x,l[h+1]=g.y,l[h+2]=g.z,d.x=r*Math.cos(y),d.y=r*Math.sin(y),m.subVectors(g,d).normalize(),u[h]=m.x,u[h+1]=m.y,u[h+2]=m.z,c[f]=_/i,c[f+1]=v/t,h+=3,f+=2}for(v=1;v<=t;v++)for(_=1;_<=i;_++){var M=(i+1)*v+_-1,S=(i+1)*(v-1)+_-1,w=(i+1)*(v-1)+_,T=(i+1)*v+_;s[p]=M,s[p+1]=S,s[p+2]=T,s[p+3]=S,s[p+4]=w,s[p+5]=T,p+=6}this.setIndex(new Mt(s,1)),this.addAttribute("position",new Mt(l,3)),this.addAttribute("normal",new Mt(u,3)),this.addAttribute("uv",new Mt(c,2))}function ab(r,e,t,i,n){ur.call(this),this.type="TorusGeometry",this.parameters={radius:r,tube:e,radialSegments:t,tubularSegments:i,arc:n},this.fromBufferGeometry(new O0(r,e,t,i,n))}function ml(r,e){if(typeof r>"u"){r=[];return}ur.call(this),this.type="ExtrudeGeometry",r=Array.isArray(r)?r:[r],this.addShapeList(r,e),this.computeFaceNormals()}function ob(r,e){e=e||{};var t=e.font;if((t&&t.isFont)===!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ur;var i=t.generateShapes(r,e.size,e.curveSegments);e.amount=e.height!==void 0?e.height:50,e.bevelThickness===void 0&&(e.bevelThickness=10),e.bevelSize===void 0&&(e.bevelSize=8),e.bevelEnabled===void 0&&(e.bevelEnabled=!1),ml.call(this,i,e),this.type="TextGeometry"}function pm(r,e,t,i,n,a,o){Vt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},r=r||50,e=Math.max(3,Math.floor(e)||8),t=Math.max(2,Math.floor(t)||6),i=i!==void 0?i:0,n=n!==void 0?n:Math.PI*2,a=a!==void 0?a:0,o=o!==void 0?o:Math.PI;for(var s=a+o,l=(e+1)*(t+1),u=new Mt(new Float32Array(l*3),3),c=new Mt(new Float32Array(l*3),3),h=new Mt(new Float32Array(l*2),2),f=0,p=[],d=new oe,g=0;g<=t;g++){for(var m=[],v=g/t,_=0;_<=e;_++){var y=_/e,x=-r*Math.cos(i+y*n)*Math.sin(a+v*o),M=r*Math.cos(a+v*o),S=r*Math.sin(i+y*n)*Math.sin(a+v*o);d.set(x,M,S).normalize(),u.setXYZ(f,x,M,S),c.setXYZ(f,d.x,d.y,d.z),h.setXY(f,y,1-v),m.push(f),f++}p.push(m)}for(var w=[],g=0;g 0)&&w.push(T,C,E),(g!==t-1||s 65535?th:eh)(w,1)),this.addAttribute("position",u),this.addAttribute("normal",c),this.addAttribute("uv",h),this.boundingSphere=new fa(new oe,r)}function sb(r,e,t,i,n,a,o){ur.call(this),this.type="SphereGeometry",this.parameters={radius:r,widthSegments:e,heightSegments:t,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new pm(r,e,t,i,n,a,o))}function z0(r,e,t,i,n,a){Vt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:r,outerRadius:e,thetaSegments:t,phiSegments:i,thetaStart:n,thetaLength:a},r=r||20,e=e||50,n=n!==void 0?n:0,a=a!==void 0?a:Math.PI*2,t=t!==void 0?Math.max(3,t):8,i=i!==void 0?Math.max(1,i):1;var o=(t+1)*(i+1),s=t*i*2*3,l=new Mt(new(s>65535?Uint32Array:Uint16Array)(s),1),u=new Mt(new Float32Array(o*3),3),c=new Mt(new Float32Array(o*3),3),h=new Mt(new Float32Array(o*2),2),f=0,p=0,d,g=r,m=(e-r)/i,v=new oe,_=new Tt,y,x;for(y=0;y<=i;y++){for(x=0;x<=t;x++)d=n+x/t*a,v.x=g*Math.cos(d),v.y=g*Math.sin(d),u.setXYZ(f,v.x,v.y,v.z),c.setXYZ(f,0,0,1),_.x=(v.x/e+1)/2,_.y=(v.y/e+1)/2,h.setXY(f,_.x,_.y),f++;g+=m}for(y=0;y65535?Uint32Array:Uint16Array)(a),1),s=new Mt(new Float32Array(n*3),3),l=new Mt(new Float32Array(n*2),2),u=0,c=0,h,f=1/e,p=new oe,d=new Tt,g,m;for(g=0;g<=e;g++){var v=t+g*f*i,_=Math.sin(v),y=Math.cos(v);for(m=0;m<=r.length-1;m++)p.x=r[m].x*_,p.y=r[m].y,p.z=r[m].x*y,s.setXYZ(u,p.x,p.y,p.z),d.x=g/e,d.y=m/(r.length-1),l.setXY(u,d.x,d.y),u++}for(g=0;g 65535?th:eh)(a,1)),this.addAttribute("position",new Mr(t,3)),this.addAttribute("normal",new Mr(i,3)),this.addAttribute("uv",new Mr(n,2));function u(c){var h,f,p,d=t.length/3,g=c.extractPoints(e),m=g.shape,v=g.holes;if(Hn.isClockWise(m)===!1)for(m=m.reverse(),h=0,f=v.length;h 0&&u++,e>0&&u++);var c=M(),h=S(),f=new Mt(new(h>65535?Uint32Array:Uint16Array)(h),1),p=new Mt(new Float32Array(c*3),3),d=new Mt(new Float32Array(c*3),3),g=new Mt(new Float32Array(c*2),2),m=0,v=0,_=[],y=t/2,x=0;w(),a===!1&&(r>0&&T(!0),e>0&&T(!1)),this.setIndex(f),this.addAttribute("position",p),this.addAttribute("normal",d),this.addAttribute("uv",g);function M(){var C=(i+1)*(n+1);return a===!1&&(C+=(i+1)*u+i*u),C}function S(){var C=i*n*2*3;return a===!1&&(C+=i*u*3),C}function w(){var C,b,E=new oe,I=new oe,R=0,A=(e-r)/t;for(b=0;b<=n;b++){var P=[],U=b/n,B=U*(e-r)+r;for(C=0;C<=i;C++){var z=C/i,k=z*s+o,G=Math.sin(k),Y=Math.cos(k);I.x=B*G,I.y=-U*t+y,I.z=B*Y,p.setXYZ(m,I.x,I.y,I.z),E.set(G,A,Y).normalize(),d.setXYZ(m,E.x,E.y,E.z),g.setXY(m,z,1-U),P.push(m),m++}_.push(P)}for(C=0;Cthis.points.length-2?this.points.length-1:n+1,e[3]=n>this.points.length-3?this.points.length-1:n+2,l=this.points[e[0]],u=this.points[e[1]],c=this.points[e[2]],h=this.points[e[3]],o=a*a,s=a*o,t.x=f(l.x,u.x,c.x,h.x,a,o,s),t.y=f(l.y,u.y,c.y,h.y,a,o,s),t.z=f(l.z,u.z,c.z,h.z,a,o,s),t},this.getControlPointsArray=function(){var p,d,g=this.points.length,m=[];for(p=0;p {"use strict";Number.EPSILON===void 0&&(Number.EPSILON=Math.pow(2,-52));Math.sign===void 0&&(Math.sign=function(r){return r<0?-1:r>0?1:+r});Function.prototype.name===void 0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}});Object.assign===void 0&&function(){Object.assign=function(r){"use strict";if(r==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(r),t=1;t >4,e[a]=r[a===19?i&3|8:i]);return e.join("")}}(),clamp:function(r,e,t){return Math.max(e,Math.min(t,r))},euclideanModulo:function(r,e){return(r%e+e)%e},mapLinear:function(r,e,t,i,n){return i+(r-e)*(n-i)/(t-e)},lerp:function(r,e,t){return(1-t)*r+t*e},smoothstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))},smootherstep:function(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))},randInt:function(r,e){return r+Math.floor(Math.random()*(e-r+1))},randFloat:function(r,e){return r+Math.random()*(e-r)},randFloatSpread:function(r){return r*(.5-Math.random())},degToRad:function(r){return r*fr.DEG2RAD},radToDeg:function(r){return r*fr.RAD2DEG},isPowerOfTwo:function(r){return(r&r-1)===0&&r!==0},nearestPowerOfTwo:function(r){return Math.pow(2,Math.round(Math.log(r)/Math.LN2))},nextPowerOfTwo:function(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}};Tt.prototype={constructor:Tt,isVector2:!0,get width(){return this.x},set width(r){this.x=r},get height(){return this.y},set height(r){this.y=r},set:function(r,e){return this.x=r,this.y=e,this},setScalar:function(r){return this.x=r,this.y=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(r){return this.x=r.x,this.y=r.y,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this)},addScalar:function(r){return this.x+=r,this.y+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this)},subScalar:function(r){return this.x-=r,this.y-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this},multiply:function(r){return this.x*=r.x,this.y*=r.y,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r):(this.x=0,this.y=0),this},divide:function(r){return this.x/=r.x,this.y/=r.y,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new Tt,e=new Tt),r.set(i,i),e.set(n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(r){return this.x*r.x+this.y*r.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var r=Math.atan2(this.y,this.x);return r<0&&(r+=2*Math.PI),r},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y;return e*e+t*t},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},equals:function(r){return r.x===this.x&&r.y===this.y},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this},rotateAround:function(r,e){var t=Math.cos(e),i=Math.sin(e),n=this.x-r.x,a=this.y-r.y;return this.x=n*t-a*i+r.x,this.y=n*i+a*t+r.y,this}};VIe=0;ci.DEFAULT_IMAGE=void 0;ci.DEFAULT_MAPPING=wL;ci.prototype={constructor:ci,isTexture:!0,set needsUpdate(r){r===!0&&this.version++},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.image=r.image,this.mipmaps=r.mipmaps.slice(0),this.mapping=r.mapping,this.wrapS=r.wrapS,this.wrapT=r.wrapT,this.magFilter=r.magFilter,this.minFilter=r.minFilter,this.anisotropy=r.anisotropy,this.format=r.format,this.type=r.type,this.offset.copy(r.offset),this.repeat.copy(r.repeat),this.generateMipmaps=r.generateMipmaps,this.premultiplyAlpha=r.premultiplyAlpha,this.flipY=r.flipY,this.unpackAlignment=r.unpackAlignment,this.encoding=r.encoding,this},toJSON:function(r){if(r.textures[this.uuid]!==void 0)return r.textures[this.uuid];function e(n){var a;return n.toDataURL!==void 0?a=n:(a=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),a.width=n.width,a.height=n.height,a.getContext("2d").drawImage(n,0,0,n.width,n.height)),a.width>2048||a.height>2048?a.toDataURL("image/jpeg",.6):a.toDataURL("image/png")}var t={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(this.image!==void 0){var i=this.image;i.uuid===void 0&&(i.uuid=fr.generateUUID()),r.images[i.uuid]===void 0&&(r.images[i.uuid]={uuid:i.uuid,url:e(i)}),t.image=i.uuid}return r.textures[this.uuid]=t,t},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(r){if(this.mapping===wL){if(r.multiply(this.repeat),r.add(this.offset),r.x<0||r.x>1)switch(this.wrapS){case Qc:r.x=r.x-Math.floor(r.x);break;case Ms:r.x=r.x<0?0:1;break;case am:Math.abs(Math.floor(r.x)%2)===1?r.x=Math.ceil(r.x)-r.x:r.x=r.x-Math.floor(r.x);break}if(r.y<0||r.y>1)switch(this.wrapT){case Qc:r.y=r.y-Math.floor(r.y);break;case Ms:r.y=r.y<0?0:1;break;case am:Math.abs(Math.floor(r.y)%2)===1?r.y=Math.ceil(r.y)-r.y:r.y=r.y-Math.floor(r.y);break}this.flipY&&(r.y=1-r.y)}}};Object.assign(ci.prototype,pl.prototype);ii.prototype={constructor:ii,isVector4:!0,set:function(r,e,t,i){return this.x=r,this.y=e,this.z=t,this.w=i,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this.w=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setW:function(r){return this.w=r,this},setComponent:function(r,e){switch(r){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: "+r)}return this},getComponent:function(r){switch(r){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: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this.w=r.w!==void 0?r.w:1,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this.w+=r.w,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this.w+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this.w=r.w+e.w,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this.w+=r.w*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this.w-=r.w,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this.w-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this.w=r.w-e.w,this},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r,this.w*=r):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=this.w,a=r.elements;return this.x=a[0]*e+a[4]*t+a[8]*i+a[12]*n,this.y=a[1]*e+a[5]*t+a[9]*i+a[13]*n,this.z=a[2]*e+a[6]*t+a[10]*i+a[14]*n,this.w=a[3]*e+a[7]*t+a[11]*i+a[15]*n,this},divideScalar:function(r){return this.multiplyScalar(1/r)},setAxisAngleFromQuaternion:function(r){this.w=2*Math.acos(r.w);var e=Math.sqrt(1-r.w*r.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=r.x/e,this.y=r.y/e,this.z=r.z/e),this},setAxisAngleFromRotationMatrix:function(r){var e,t,i,n,a=.01,o=.1,s=r.elements,l=s[0],u=s[4],c=s[8],h=s[1],f=s[5],p=s[9],d=s[2],g=s[6],m=s[10];if(Math.abs(u-h)_&&v>y?vy?_0?(f=.5/Math.sqrt(h+1),this._w=.25/f,this._x=(u-s)*f,this._y=(n-l)*f,this._z=(a-i)*f):t>o&&t>c?(f=2*Math.sqrt(1+t-o-c),this._w=(u-s)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(n+l)/f):o>c?(f=2*Math.sqrt(1+o-t-c),this._w=(n-l)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(s+u)/f):(f=2*Math.sqrt(1+c-t-o),this._w=(a-i)/f,this._x=(n+l)/f,this._y=(s+u)/f,this._z=.25*f),this.onChangeCallback(),this},setFromUnitVectors:function(){var r,e,t=1e-6;return function(n,a){return r===void 0&&(r=new oe),e=n.dot(a)+1,e Math.abs(n.z)?r.set(-n.y,n.x,0):r.set(0,-n.z,n.y)):r.crossVectors(n,a),this._x=r.x,this._y=r.y,this._z=r.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(r){return this._x*r._x+this._y*r._y+this._z*r._z+this._w*r._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var r=this.length();return r===0?(this._x=0,this._y=0,this._z=0,this._w=1):(r=1/r,this._x=this._x*r,this._y=this._y*r,this._z=this._z*r,this._w=this._w*r),this.onChangeCallback(),this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(r,e)):this.multiplyQuaternions(this,r)},premultiply:function(r){return this.multiplyQuaternions(r,this)},multiplyQuaternions:function(r,e){var t=r._x,i=r._y,n=r._z,a=r._w,o=e._x,s=e._y,l=e._z,u=e._w;return this._x=t*u+a*o+i*l-n*s,this._y=i*u+a*s+n*o-t*l,this._z=n*u+a*l+t*s-i*o,this._w=a*u-t*o-i*s-n*l,this.onChangeCallback(),this},slerp:function(r,e){if(e===0)return this;if(e===1)return this.copy(r);var t=this._x,i=this._y,n=this._z,a=this._w,o=a*r._w+t*r._x+i*r._y+n*r._z;if(o<0?(this._w=-r._w,this._x=-r._x,this._y=-r._y,this._z=-r._z,o=-o):this.copy(r),o>=1)return this._w=a,this._x=t,this._y=i,this._z=n,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(t+this._x),this._y=.5*(i+this._y),this._z=.5*(n+this._z),this;var l=Math.atan2(s,o),u=Math.sin((1-e)*l)/s,c=Math.sin(e*l)/s;return this._w=a*u+this._w*c,this._x=t*u+this._x*c,this._y=i*u+this._y*c,this._z=n*u+this._z*c,this.onChangeCallback(),this},equals:function(r){return r._x===this._x&&r._y===this._y&&r._z===this._z&&r._w===this._w},fromArray:function(r,e){return e===void 0&&(e=0),this._x=r[e],this._y=r[e+1],this._z=r[e+2],this._w=r[e+3],this.onChangeCallback(),this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this._x,r[e+1]=this._y,r[e+2]=this._z,r[e+3]=this._w,r},onChange:function(r){return this.onChangeCallback=r,this},onChangeCallback:function(){}};Object.assign(cn,{slerp:function(r,e,t,i){return t.copy(r).slerp(e,i)},slerpFlat:function(r,e,t,i,n,a,o){var s=t[i+0],l=t[i+1],u=t[i+2],c=t[i+3],h=n[a+0],f=n[a+1],p=n[a+2],d=n[a+3];if(c!==d||s!==h||l!==f||u!==p){var g=1-o,m=s*h+l*f+u*p+c*d,v=m>=0?1:-1,_=1-m*m;if(_>Number.EPSILON){var y=Math.sqrt(_),x=Math.atan2(y,m*v);g=Math.sin(g*x)/y,o=Math.sin(o*x)/y}var M=o*v;if(s=s*g+h*M,l=l*g+f*M,u=u*g+p*M,c=c*g+d*M,g===1-o){var S=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=S,l*=S,u*=S,c*=S}}r[e]=s,r[e+1]=l,r[e+2]=u,r[e+3]=c}});oe.prototype={constructor:oe,isVector3:!0,set:function(r,e,t){return this.x=r,this.y=e,this.z=t,this},setScalar:function(r){return this.x=r,this.y=r,this.z=r,this},setX:function(r){return this.x=r,this},setY:function(r){return this.y=r,this},setZ:function(r){return this.z=r,this},setComponent:function(r,e){switch(r){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+r)}return this},getComponent:function(r){switch(r){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+r)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(r){return this.x=r.x,this.y=r.y,this.z=r.z,this},add:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(r,e)):(this.x+=r.x,this.y+=r.y,this.z+=r.z,this)},addScalar:function(r){return this.x+=r,this.y+=r,this.z+=r,this},addVectors:function(r,e){return this.x=r.x+e.x,this.y=r.y+e.y,this.z=r.z+e.z,this},addScaledVector:function(r,e){return this.x+=r.x*e,this.y+=r.y*e,this.z+=r.z*e,this},sub:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(r,e)):(this.x-=r.x,this.y-=r.y,this.z-=r.z,this)},subScalar:function(r){return this.x-=r,this.y-=r,this.z-=r,this},subVectors:function(r,e){return this.x=r.x-e.x,this.y=r.y-e.y,this.z=r.z-e.z,this},multiply:function(r,e){return e!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(r,e)):(this.x*=r.x,this.y*=r.y,this.z*=r.z,this)},multiplyScalar:function(r){return isFinite(r)?(this.x*=r,this.y*=r,this.z*=r):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(r,e){return this.x=r.x*e.x,this.y=r.y*e.y,this.z=r.z*e.z,this},applyEuler:function(){var r;return function(t){return(t&&t.isEuler)===!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),r===void 0&&(r=new cn),this.applyQuaternion(r.setFromEuler(t))}}(),applyAxisAngle:function(){var r;return function(t,i){return r===void 0&&(r=new cn),this.applyQuaternion(r.setFromAxisAngle(t,i))}}(),applyMatrix3:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[3]*t+n[6]*i,this.y=n[1]*e+n[4]*t+n[7]*i,this.z=n[2]*e+n[5]*t+n[8]*i,this},applyMatrix4:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i+n[12],this.y=n[1]*e+n[5]*t+n[9]*i+n[13],this.z=n[2]*e+n[6]*t+n[10]*i+n[14],this},applyProjection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements,a=1/(n[3]*e+n[7]*t+n[11]*i+n[15]);return this.x=(n[0]*e+n[4]*t+n[8]*i+n[12])*a,this.y=(n[1]*e+n[5]*t+n[9]*i+n[13])*a,this.z=(n[2]*e+n[6]*t+n[10]*i+n[14])*a,this},applyQuaternion:function(r){var e=this.x,t=this.y,i=this.z,n=r.x,a=r.y,o=r.z,s=r.w,l=s*e+a*i-o*t,u=s*t+o*e-n*i,c=s*i+n*t-a*e,h=-n*e-a*t-o*i;return this.x=l*s+h*-n+u*-o-c*-a,this.y=u*s+h*-a+c*-n-l*-o,this.z=c*s+h*-o+l*-a-u*-n,this},project:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.multiplyMatrices(t.projectionMatrix,r.getInverse(t.matrixWorld)),this.applyProjection(r)}}(),unproject:function(){var r;return function(t){return r===void 0&&(r=new Kt),r.multiplyMatrices(t.matrixWorld,r.getInverse(t.projectionMatrix)),this.applyProjection(r)}}(),transformDirection:function(r){var e=this.x,t=this.y,i=this.z,n=r.elements;return this.x=n[0]*e+n[4]*t+n[8]*i,this.y=n[1]*e+n[5]*t+n[9]*i,this.z=n[2]*e+n[6]*t+n[10]*i,this.normalize()},divide:function(r){return this.x/=r.x,this.y/=r.y,this.z/=r.z,this},divideScalar:function(r){return this.multiplyScalar(1/r)},min:function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this.z=Math.min(this.z,r.z),this},max:function(r){return this.x=Math.max(this.x,r.x),this.y=Math.max(this.y,r.y),this.z=Math.max(this.z,r.z),this},clamp:function(r,e){return this.x=Math.max(r.x,Math.min(e.x,this.x)),this.y=Math.max(r.y,Math.min(e.y,this.y)),this.z=Math.max(r.z,Math.min(e.z,this.z)),this},clampScalar:function(){var r,e;return function(i,n){return r===void 0&&(r=new oe,e=new oe),r.set(i,i,i),e.set(n,n,n),this.clamp(r,e)}}(),clampLength:function(r,e){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(e,t))/t)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(r){return this.x*r.x+this.y*r.y+this.z*r.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(r){return this.multiplyScalar(r/this.length())},lerp:function(r,e){return this.x+=(r.x-this.x)*e,this.y+=(r.y-this.y)*e,this.z+=(r.z-this.z)*e,this},lerpVectors:function(r,e,t){return this.subVectors(e,r).multiplyScalar(t).add(r)},cross:function(r,e){if(e!==void 0)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(r,e);var t=this.x,i=this.y,n=this.z;return this.x=i*r.z-n*r.y,this.y=n*r.x-t*r.z,this.z=t*r.y-i*r.x,this},crossVectors:function(r,e){var t=r.x,i=r.y,n=r.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-n*o,this.y=n*a-t*s,this.z=t*o-i*a,this},projectOnVector:function(r){var e=r.dot(this)/r.lengthSq();return this.copy(r).multiplyScalar(e)},projectOnPlane:function(){var r;return function(t){return r===void 0&&(r=new oe),r.copy(this).projectOnVector(t),this.sub(r)}}(),reflect:function(){var r;return function(t){return r===void 0&&(r=new oe),this.sub(r.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(r){var e=this.dot(r)/Math.sqrt(this.lengthSq()*r.lengthSq());return Math.acos(fr.clamp(e,-1,1))},distanceTo:function(r){return Math.sqrt(this.distanceToSquared(r))},distanceToSquared:function(r){var e=this.x-r.x,t=this.y-r.y,i=this.z-r.z;return e*e+t*t+i*i},distanceToManhattan:function(r){return Math.abs(this.x-r.x)+Math.abs(this.y-r.y)+Math.abs(this.z-r.z)},setFromSpherical:function(r){var e=Math.sin(r.phi)*r.radius;return this.x=e*Math.sin(r.theta),this.y=Math.cos(r.phi)*r.radius,this.z=e*Math.cos(r.theta),this},setFromCylindrical:function(r){return this.x=r.radius*Math.sin(r.theta),this.y=r.y,this.z=r.radius*Math.cos(r.theta),this},setFromMatrixPosition:function(r){return this.setFromMatrixColumn(r,3)},setFromMatrixScale:function(r){var e=this.setFromMatrixColumn(r,0).length(),t=this.setFromMatrixColumn(r,1).length(),i=this.setFromMatrixColumn(r,2).length();return this.x=e,this.y=t,this.z=i,this},setFromMatrixColumn:function(r,e){if(typeof r=="number"){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var t=r;r=e,e=t}return this.fromArray(r.elements,e*4)},equals:function(r){return r.x===this.x&&r.y===this.y&&r.z===this.z},fromArray:function(r,e){return e===void 0&&(e=0),this.x=r[e],this.y=r[e+1],this.z=r[e+2],this},toArray:function(r,e){return r===void 0&&(r=[]),e===void 0&&(e=0),r[e]=this.x,r[e+1]=this.y,r[e+2]=this.z,r},fromAttribute:function(r,e,t){return t!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromAttribute()."),this.x=r.getX(e),this.y=r.getY(e),this.z=r.getZ(e),this}};Kt.prototype={constructor:Kt,isMatrix4:!0,set:function(r,e,t,i,n,a,o,s,l,u,c,h,f,p,d,g){var m=this.elements;return m[0]=r,m[4]=e,m[8]=t,m[12]=i,m[1]=n,m[5]=a,m[9]=o,m[13]=s,m[2]=l,m[6]=u,m[10]=c,m[14]=h,m[3]=f,m[7]=p,m[11]=d,m[15]=g,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return new Kt().fromArray(this.elements)},copy:function(r){return this.elements.set(r.elements),this},copyPosition:function(r){var e=this.elements,t=r.elements;return e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(r,e,t){return r.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),t.setFromMatrixColumn(this,2),this},makeBasis:function(r,e,t){return this.set(r.x,e.x,t.x,0,r.y,e.y,t.y,0,r.z,e.z,t.z,0,0,0,0,1),this},extractRotation:function(){var r;return function(t){r===void 0&&(r=new oe);var i=this.elements,n=t.elements,a=1/r.setFromMatrixColumn(t,0).length(),o=1/r.setFromMatrixColumn(t,1).length(),s=1/r.setFromMatrixColumn(t,2).length();return i[0]=n[0]*a,i[1]=n[1]*a,i[2]=n[2]*a,i[4]=n[4]*o,i[5]=n[5]*o,i[6]=n[6]*o,i[8]=n[8]*s,i[9]=n[9]*s,i[10]=n[10]*s,this}}(),makeRotationFromEuler:function(r){(r&&r.isEuler)===!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,t=r.x,i=r.y,n=r.z,a=Math.cos(t),o=Math.sin(t),s=Math.cos(i),l=Math.sin(i),u=Math.cos(n),c=Math.sin(n);if(r.order==="XYZ"){var h=a*u,f=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=-s*c,e[8]=l,e[1]=f+p*l,e[5]=h-d*l,e[9]=-o*s,e[2]=d-h*l,e[6]=p+f*l,e[10]=a*s}else if(r.order==="YXZ"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g+_*o,e[4]=v*o-m,e[8]=a*l,e[1]=a*c,e[5]=a*u,e[9]=-o,e[2]=m*o-v,e[6]=_+g*o,e[10]=a*s}else if(r.order==="ZXY"){var g=s*u,m=s*c,v=l*u,_=l*c;e[0]=g-_*o,e[4]=-a*c,e[8]=v+m*o,e[1]=m+v*o,e[5]=a*u,e[9]=_-g*o,e[2]=-a*l,e[6]=o,e[10]=a*s}else if(r.order==="ZYX"){var h=a*u,f=a*c,p=o*u,d=o*c;e[0]=s*u,e[4]=p*l-f,e[8]=h*l+d,e[1]=s*c,e[5]=d*l+h,e[9]=f*l-p,e[2]=-l,e[6]=o*s,e[10]=a*s}else if(r.order==="YZX"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=S-y*c,e[8]=M*c+x,e[1]=c,e[5]=a*u,e[9]=-o*u,e[2]=-l*u,e[6]=x*c+M,e[10]=y-S*c}else if(r.order==="XZY"){var y=a*s,x=a*l,M=o*s,S=o*l;e[0]=s*u,e[4]=-c,e[8]=l*u,e[1]=y*c+S,e[5]=a*u,e[9]=x*c-M,e[2]=M*c-x,e[6]=o*u,e[10]=S*c+y}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(r){var e=this.elements,t=r.x,i=r.y,n=r.z,a=r.w,o=t+t,s=i+i,l=n+n,u=t*o,c=t*s,h=t*l,f=i*s,p=i*l,d=n*l,g=a*o,m=a*s,v=a*l;return e[0]=1-(f+d),e[4]=c-v,e[8]=h+m,e[1]=c+v,e[5]=1-(u+d),e[9]=p-g,e[2]=h-m,e[6]=p+g,e[10]=1-(u+f),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var r,e,t;return function(n,a,o){r===void 0&&(r=new oe,e=new oe,t=new oe);var s=this.elements;return t.subVectors(n,a).normalize(),t.lengthSq()===0&&(t.z=1),r.crossVectors(o,t).normalize(),r.lengthSq()===0&&(t.z+=1e-4,r.crossVectors(o,t).normalize()),e.crossVectors(t,r),s[0]=r.x,s[4]=e.x,s[8]=t.x,s[1]=r.y,s[5]=e.y,s[9]=t.y,s[2]=r.z,s[6]=e.z,s[10]=t.z,this}}(),multiply:function(r,e){return e!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(r,e)):this.multiplyMatrices(this,r)},premultiply:function(r){return this.multiplyMatrices(r,this)},multiplyMatrices:function(r,e){var t=r.elements,i=e.elements,n=this.elements,a=t[0],o=t[4],s=t[8],l=t[12],u=t[1],c=t[5],h=t[9],f=t[13],p=t[2],d=t[6],g=t[10],m=t[14],v=t[3],_=t[7],y=t[11],x=t[15],M=i[0],S=i[4],w=i[8],T=i[12],C=i[1],b=i[5],E=i[9],I=i[13],R=i[2],A=i[6],P=i[10],U=i[14],B=i[3],z=i[7],k=i[11],G=i[15];return n[0]=a*M+o*C+s*R+l*B,n[4]=a*S+o*b+s*A+l*z,n[8]=a*w+o*E+s*P+l*k,n[12]=a*T+o*I+s*U+l*G,n[1]=u*M+c*C+h*R+f*B,n[5]=u*S+c*b+h*A+f*z,n[9]=u*w+c*E+h*P+f*k,n[13]=u*T+c*I+h*U+f*G,n[2]=p*M+d*C+g*R+m*B,n[6]=p*S+d*b+g*A+m*z,n[10]=p*w+d*E+g*P+m*k,n[14]=p*T+d*I+g*U+m*G,n[3]=v*M+_*C+y*R+x*B,n[7]=v*S+_*b+y*A+x*z,n[11]=v*w+_*E+y*P+x*k,n[15]=v*T+_*I+y*U+x*G,this},multiplyToArray:function(r,e,t){var i=this.elements;return this.multiplyMatrices(r,e),t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this},multiplyScalar:function(r){var e=this.elements;return e[0]*=r,e[4]*=r,e[8]*=r,e[12]*=r,e[1]*=r,e[5]*=r,e[9]*=r,e[13]*=r,e[2]*=r,e[6]*=r,e[10]*=r,e[14]*=r,e[3]*=r,e[7]*=r,e[11]*=r,e[15]*=r,this},applyToVector3Array:function(){var r;return function(t,i,n){r===void 0&&(r=new oe),i===void 0&&(i=0),n===void 0&&(n=t.length);for(var a=0,o=i;a 0.0 ) { #if defined ( PHYSICALLY_CORRECT_LIGHTS ) float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); @@ -283,7 +283,7 @@ float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { float BlinnExponentToGGXRoughness( const in float blinnExponent ) { return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); } -`,MNe=`#ifdef USE_BUMPMAP +`,SNe=`#ifdef USE_BUMPMAP uniform sampler2D bumpMap; uniform float bumpScale; vec2 dHdxy_fwd() { @@ -305,7 +305,7 @@ float BlinnExponentToGGXRoughness( const in float blinnExponent ) { return normalize( abs( fDet ) * surf_norm - vGrad ); } #endif -`,bNe=`#if NUM_CLIPPING_PLANES > 0 +`,MNe=`#if NUM_CLIPPING_PLANES > 0 for ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) { vec4 plane = clippingPlanes[ i ]; if ( dot( vViewPosition, plane.xyz ) > plane.w ) discard; @@ -321,28 +321,28 @@ float BlinnExponentToGGXRoughness( const in float blinnExponent ) { #endif #endif -`,wNe=`#if NUM_CLIPPING_PLANES > 0 +`,bNe=`#if NUM_CLIPPING_PLANES > 0 #if ! defined( PHYSICAL ) && ! defined( PHONG ) varying vec3 vViewPosition; #endif uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif -`,TNe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) +`,wNe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) varying vec3 vViewPosition; #endif -`,ENe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) +`,TNe=`#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) vViewPosition = - mvPosition.xyz; #endif -`,ANe=`#ifdef USE_COLOR +`,ENe=`#ifdef USE_COLOR diffuseColor.rgb *= vColor; -#endif`,CNe=`#ifdef USE_COLOR +#endif`,ANe=`#ifdef USE_COLOR varying vec3 vColor; #endif -`,RNe=`#ifdef USE_COLOR +`,CNe=`#ifdef USE_COLOR varying vec3 vColor; -#endif`,LNe=`#ifdef USE_COLOR +#endif`,RNe=`#ifdef USE_COLOR vColor.xyz = color.xyz; -#endif`,DNe=`#define PI 3.14159265359 +#endif`,LNe=`#define PI 3.14159265359 #define PI2 6.28318530718 #define PI_HALF 1.5707963267949 #define RECIPROCAL_PI 0.31830988618 @@ -399,7 +399,7 @@ mat3 transpose( const in mat3 v ) { tmp[2] = vec3(v[0].z, v[1].z, v[2].z); return tmp; } -`,PNe=`#ifdef ENVMAP_TYPE_CUBE_UV +`,DNe=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_textureSize (1024.0) int getFaceFromDirection(vec3 direction) { vec3 absDirection = abs(direction); @@ -503,28 +503,28 @@ vec4 textureCubeUV(vec3 reflectedDirection, float roughness ) { return vec4(result.rgb, 1.0); } #endif -`,INe=`#ifdef FLIP_SIDED +`,PNe=`#ifdef FLIP_SIDED objectNormal = -objectNormal; #endif vec3 transformedNormal = normalMatrix * objectNormal; -`,NNe=`#ifdef USE_DISPLACEMENTMAP +`,INe=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif -`,UNe=`#ifdef USE_DISPLACEMENTMAP +`,NNe=`#ifdef USE_DISPLACEMENTMAP transformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias ); #endif -`,ONe=`#ifdef USE_EMISSIVEMAP +`,UNe=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; totalEmissiveRadiance *= emissiveColor.rgb; #endif -`,zNe=`#ifdef USE_EMISSIVEMAP +`,ONe=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif -`,FNe=` gl_FragColor = linearToOutputTexel( gl_FragColor ); -`,BNe=` +`,zNe=` gl_FragColor = linearToOutputTexel( gl_FragColor ); +`,FNe=` vec4 LinearToLinear( in vec4 value ) { return value; } @@ -587,7 +587,7 @@ vec4 LogLuvToLinear( in vec4 value ) { vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM; return vec4( max(vRGB, 0.0), 1.0 ); } -`,kNe=`#ifdef USE_ENVMAP +`,BNe=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition ); vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -621,7 +621,7 @@ vec4 LogLuvToLinear( in vec4 value ) { outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif -`,VNe=`#if defined( USE_ENVMAP ) || defined( PHYSICAL ) +`,kNe=`#if defined( USE_ENVMAP ) || defined( PHYSICAL ) uniform float reflectivity; uniform float envMapIntensity; #endif @@ -641,7 +641,7 @@ vec4 LogLuvToLinear( in vec4 value ) { varying vec3 vReflect; #endif #endif -`,GNe=`#ifdef USE_ENVMAP +`,VNe=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) varying vec3 vWorldPosition; #else @@ -649,7 +649,7 @@ vec4 LogLuvToLinear( in vec4 value ) { uniform float refractionRatio; #endif #endif -`,HNe=`#ifdef USE_ENVMAP +`,GNe=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) vWorldPosition = worldPosition.xyz; #else @@ -662,7 +662,7 @@ vec4 LogLuvToLinear( in vec4 value ) { #endif #endif #endif -`,WNe=`#ifdef USE_FOG +`,HNe=`#ifdef USE_FOG #ifdef USE_LOGDEPTHBUF_EXT float depth = gl_FragDepthEXT / gl_FragCoord.w; #else @@ -675,7 +675,7 @@ vec4 LogLuvToLinear( in vec4 value ) { #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif -`,XNe=`#ifdef USE_FOG +`,WNe=`#ifdef USE_FOG uniform vec3 fogColor; #ifdef FOG_EXP2 uniform float fogDensity; @@ -683,7 +683,7 @@ vec4 LogLuvToLinear( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,YNe=`#ifdef TOON +#endif`,XNe=`#ifdef TOON uniform sampler2D gradientMap; vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); @@ -695,13 +695,13 @@ vec4 LogLuvToLinear( in vec4 value ) { #endif } #endif -`,qNe=`#ifdef USE_LIGHTMAP +`,YNe=`#ifdef USE_LIGHTMAP reflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; #endif -`,ZNe=`#ifdef USE_LIGHTMAP +`,qNe=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,jNe=`vec3 diffuse = vec3( 1.0 ); +#endif`,ZNe=`vec3 diffuse = vec3( 1.0 ); GeometricContext geometry; geometry.position = mvPosition.xyz; geometry.normal = normalize( transformedNormal ); @@ -762,7 +762,7 @@ vec3 directLightColor_Diffuse; #endif } #endif -`,KNe=`uniform vec3 ambientLightColor; +`,jNe=`uniform vec3 ambientLightColor; vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; #ifndef PHYSICALLY_CORRECT_LIGHTS @@ -930,12 +930,12 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { return envMapColor.rgb * envMapIntensity; } #endif -`,JNe=`BlinnPhongMaterial material; +`,KNe=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength; -`,$Ne=`varying vec3 vViewPosition; +`,JNe=`varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; #endif @@ -983,7 +983,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in Geometric #define RE_Direct_RectArea RE_Direct_RectArea_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong #define Material_LightProbeLOD( material ) (0) -`,QNe=`PhysicalMaterial material; +`,$Ne=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 ); #ifdef STANDARD @@ -992,7 +992,7 @@ material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 ); material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor ); material.clearCoat = saturate( clearCoat ); material.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 ); #endif -`,eUe=`struct PhysicalMaterial { +`,QNe=`struct PhysicalMaterial { vec3 diffuseColor; float specularRoughness; vec3 specularColor; @@ -1066,7 +1066,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCo float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); } -`,tUe=` +`,eUe=` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; @@ -1141,20 +1141,20 @@ IncidentLight directLight; RE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight ); #endif -`,rUe=`#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT) +`,tUe=`#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT) gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5; -#endif`,iUe=`#ifdef USE_LOGDEPTHBUF +#endif`,rUe=`#ifdef USE_LOGDEPTHBUF uniform float logDepthBufFC; #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; #endif #endif -`,nUe=`#ifdef USE_LOGDEPTHBUF +`,iUe=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; #endif uniform float logDepthBufFC; -#endif`,aUe=`#ifdef USE_LOGDEPTHBUF +#endif`,nUe=`#ifdef USE_LOGDEPTHBUF gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC; #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; @@ -1162,42 +1162,42 @@ IncidentLight directLight; gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w; #endif #endif -`,oUe=`#ifdef USE_MAP +`,aUe=`#ifdef USE_MAP vec4 texelColor = texture2D( map, vUv ); texelColor = mapTexelToLinear( texelColor ); diffuseColor *= texelColor; #endif -`,sUe=`#ifdef USE_MAP +`,oUe=`#ifdef USE_MAP uniform sampler2D map; #endif -`,lUe=`#ifdef USE_MAP +`,sUe=`#ifdef USE_MAP vec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy ); diffuseColor *= mapTexelToLinear( mapTexel ); #endif -`,uUe=`#ifdef USE_MAP +`,lUe=`#ifdef USE_MAP uniform vec4 offsetRepeat; uniform sampler2D map; #endif -`,cUe=`float metalnessFactor = metalness; +`,uUe=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.r; #endif -`,hUe=`#ifdef USE_METALNESSMAP +`,cUe=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,fUe=`#ifdef USE_MORPHNORMALS +#endif`,hUe=`#ifdef USE_MORPHNORMALS objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ]; objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ]; objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ]; objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ]; #endif -`,pUe=`#ifdef USE_MORPHTARGETS +`,fUe=`#ifdef USE_MORPHTARGETS #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif -#endif`,dUe=`#ifdef USE_MORPHTARGETS +#endif`,pUe=`#ifdef USE_MORPHTARGETS transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ]; transformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ]; transformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ]; @@ -1209,12 +1209,12 @@ IncidentLight directLight; transformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ]; #endif #endif -`,mUe=`#ifdef DOUBLE_SIDED +`,dUe=`#ifdef DOUBLE_SIDED float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 ); #else float flipNormal = 1.0; #endif -`,vUe=`#ifdef FLAT_SHADED +`,mUe=`#ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); vec3 normal = normalize( cross( fdx, fdy ) ); @@ -1226,7 +1226,7 @@ IncidentLight directLight; #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() ); #endif -`,gUe=`#ifdef USE_NORMALMAP +`,vUe=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) { @@ -1243,7 +1243,7 @@ IncidentLight directLight; return normalize( tsn * mapN ); } #endif -`,yUe=`vec3 packNormalToRGB( const in vec3 normal ) { +`,gUe=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1272,23 +1272,23 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); } -`,_Ue=`#ifdef PREMULTIPLIED_ALPHA +`,yUe=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif -`,xUe=`#ifdef USE_SKINNING +`,_Ue=`#ifdef USE_SKINNING vec4 mvPosition = modelViewMatrix * skinned; #else vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 ); #endif gl_Position = projectionMatrix * mvPosition; -`,SUe=`float roughnessFactor = roughness; +`,xUe=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.r; #endif -`,MUe=`#ifdef USE_ROUGHNESSMAP +`,SUe=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,bUe=`#ifdef USE_SHADOWMAP +#endif`,MUe=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHTS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ]; @@ -1412,7 +1412,7 @@ gl_Position = projectionMatrix * mvPosition; #endif } #endif -`,wUe=`#ifdef USE_SHADOWMAP +`,bUe=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHTS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ]; @@ -1428,7 +1428,7 @@ gl_Position = projectionMatrix * mvPosition; #if NUM_RECT_AREA_LIGHTS > 0 #endif #endif -`,TUe=`#ifdef USE_SHADOWMAP +`,wUe=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHTS > 0 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition; @@ -1447,7 +1447,7 @@ gl_Position = projectionMatrix * mvPosition; #if NUM_RECT_AREA_LIGHTS > 0 #endif #endif -`,EUe=`float getShadowMask() { +`,TUe=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHTS > 0 @@ -1476,12 +1476,12 @@ gl_Position = projectionMatrix * mvPosition; #endif return shadow; } -`,AUe=`#ifdef USE_SKINNING +`,EUe=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,CUe=`#ifdef USE_SKINNING +#endif`,AUe=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; #ifdef BONE_TEXTURE @@ -1510,7 +1510,7 @@ gl_Position = projectionMatrix * mvPosition; } #endif #endif -`,RUe=`#ifdef USE_SKINNING +`,CUe=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -1519,7 +1519,7 @@ gl_Position = projectionMatrix * mvPosition; skinned += boneMatW * skinVertex * skinWeight.w; skinned = bindMatrixInverse * skinned; #endif -`,LUe=`#ifdef USE_SKINNING +`,RUe=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -1528,18 +1528,18 @@ gl_Position = projectionMatrix * mvPosition; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #endif -`,DUe=`float specularStrength; +`,LUe=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,PUe=`#ifdef USE_SPECULARMAP +#endif`,DUe=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,IUe=`#if defined( TONE_MAPPING ) +#endif`,PUe=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif -`,NUe=`#define saturate(a) clamp( a, 0.0, 1.0 ) +`,IUe=`#define saturate(a) clamp( a, 0.0, 1.0 ) uniform float toneMappingExposure; uniform float toneMappingWhitePoint; vec3 LinearToneMapping( vec3 color ) { @@ -1559,29 +1559,29 @@ vec3 OptimizedCineonToneMapping( vec3 color ) { color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } -`,UUe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) +`,NUe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) varying vec2 vUv; -#endif`,OUe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) +#endif`,UUe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) varying vec2 vUv; uniform vec4 offsetRepeat; #endif -`,zUe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) +`,OUe=`#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) vUv = uv * offsetRepeat.zw + offsetRepeat.xy; -#endif`,FUe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,zUe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; -#endif`,BUe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,FUe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; -#endif`,kUe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,BUe=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = uv2; -#endif`,VUe=`#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP ) +#endif`,kUe=`#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP ) #ifdef USE_SKINNING vec4 worldPosition = modelMatrix * skinned; #else vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 ); #endif #endif -`,GUe=`uniform samplerCube tCube; +`,VUe=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldPosition; @@ -1590,14 +1590,14 @@ void main() { gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) ); gl_FragColor.a *= opacity; } -`,HUe=`varying vec3 vWorldPosition; +`,GUe=`varying vec3 vWorldPosition; #include void main() { vWorldPosition = transformDirection( position, modelMatrix ); #include #include } -`,WUe=`#if DEPTH_PACKING == 3200 +`,HUe=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -1623,7 +1623,7 @@ void main() { gl_FragColor = packDepthToRGBA( gl_FragCoord.z ); #endif } -`,XUe=`#include +`,WUe=`#include #include #include #include @@ -1641,7 +1641,7 @@ void main() { #include #include } -`,YUe=`uniform vec3 lightPos; +`,XUe=`uniform vec3 lightPos; varying vec4 vWorldPosition; #include #include @@ -1650,7 +1650,7 @@ void main () { #include gl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 ); } -`,qUe=`varying vec4 vWorldPosition; +`,YUe=`varying vec4 vWorldPosition; #include #include #include @@ -1665,7 +1665,7 @@ void main() { #include vWorldPosition = worldPosition; } -`,ZUe=`uniform sampler2D tEquirect; +`,qUe=`uniform sampler2D tEquirect; uniform float tFlip; varying vec3 vWorldPosition; #include @@ -1676,14 +1676,14 @@ void main() { sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5; gl_FragColor = texture2D( tEquirect, sampleUV ); } -`,jUe=`varying vec3 vWorldPosition; +`,ZUe=`varying vec3 vWorldPosition; #include void main() { vWorldPosition = transformDirection( position, modelMatrix ); #include #include } -`,KUe=`uniform vec3 diffuse; +`,jUe=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -1709,7 +1709,7 @@ void main() { #include #include } -`,JUe=`uniform float scale; +`,KUe=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -1724,7 +1724,7 @@ void main() { #include #include } -`,$Ue=`uniform vec3 diffuse; +`,JUe=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -1768,7 +1768,7 @@ void main() { #include #include } -`,QUe=`#include +`,$Ue=`#include #include #include #include @@ -1797,7 +1797,7 @@ void main() { #include #include } -`,eOe=`uniform vec3 diffuse; +`,QUe=`uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; varying vec3 vLightFront; @@ -1854,7 +1854,7 @@ void main() { #include #include } -`,tOe=`#define LAMBERT +`,eOe=`#define LAMBERT varying vec3 vLightFront; #ifdef DOUBLE_SIDED varying vec3 vLightBack; @@ -1891,7 +1891,7 @@ void main() { #include #include } -`,rOe=`#define PHONG +`,tOe=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -1944,7 +1944,7 @@ void main() { #include #include } -`,iOe=`#define PHONG +`,rOe=`#define PHONG varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -1984,7 +1984,7 @@ void main() { #include #include } -`,nOe=`#define PHYSICAL +`,iOe=`#define PHYSICAL uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; @@ -2047,7 +2047,7 @@ void main() { #include #include } -`,aOe=`#define PHYSICAL +`,nOe=`#define PHYSICAL varying vec3 vViewPosition; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2086,7 +2086,7 @@ void main() { #include #include } -`,oOe=`#define NORMAL +`,aOe=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) varying vec3 vViewPosition; @@ -2107,7 +2107,7 @@ void main() { #include #include } -`,sOe=`#define NORMAL +`,oOe=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) varying vec3 vViewPosition; #endif @@ -2139,7 +2139,7 @@ void main() { vViewPosition = - mvPosition.xyz; #endif } -`,lOe=`uniform vec3 diffuse; +`,sOe=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -2164,7 +2164,7 @@ void main() { #include #include } -`,uOe=`uniform float size; +`,lOe=`uniform float size; uniform float scale; #include #include @@ -2185,7 +2185,7 @@ void main() { #include #include } -`,cOe=`uniform float opacity; +`,uOe=`uniform float opacity; #include #include #include @@ -2195,60 +2195,60 @@ void main() { void main() { gl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) ); } -`,hOe=`#include +`,cOe=`#include void main() { #include #include #include #include } -`,jr={alphamap_fragment:dNe,alphamap_pars_fragment:mNe,alphatest_fragment:vNe,aomap_fragment:gNe,aomap_pars_fragment:yNe,begin_vertex:_Ne,beginnormal_vertex:xNe,bsdfs:SNe,bumpmap_pars_fragment:MNe,clipping_planes_fragment:bNe,clipping_planes_pars_fragment:wNe,clipping_planes_pars_vertex:TNe,clipping_planes_vertex:ENe,color_fragment:ANe,color_pars_fragment:CNe,color_pars_vertex:RNe,color_vertex:LNe,common:DNe,cube_uv_reflection_fragment:PNe,defaultnormal_vertex:INe,displacementmap_pars_vertex:NNe,displacementmap_vertex:UNe,emissivemap_fragment:ONe,emissivemap_pars_fragment:zNe,encodings_fragment:FNe,encodings_pars_fragment:BNe,envmap_fragment:kNe,envmap_pars_fragment:VNe,envmap_pars_vertex:GNe,envmap_vertex:HNe,fog_fragment:WNe,fog_pars_fragment:XNe,gradientmap_pars_fragment:YNe,lightmap_fragment:qNe,lightmap_pars_fragment:ZNe,lights_lambert_vertex:jNe,lights_pars:KNe,lights_phong_fragment:JNe,lights_phong_pars_fragment:$Ne,lights_physical_fragment:QNe,lights_physical_pars_fragment:eUe,lights_template:tUe,logdepthbuf_fragment:rUe,logdepthbuf_pars_fragment:iUe,logdepthbuf_pars_vertex:nUe,logdepthbuf_vertex:aUe,map_fragment:oUe,map_pars_fragment:sUe,map_particle_fragment:lUe,map_particle_pars_fragment:uUe,metalnessmap_fragment:cUe,metalnessmap_pars_fragment:hUe,morphnormal_vertex:fUe,morphtarget_pars_vertex:pUe,morphtarget_vertex:dUe,normal_flip:mUe,normal_fragment:vUe,normalmap_pars_fragment:gUe,packing:yUe,premultiplied_alpha_fragment:_Ue,project_vertex:xUe,roughnessmap_fragment:SUe,roughnessmap_pars_fragment:MUe,shadowmap_pars_fragment:bUe,shadowmap_pars_vertex:wUe,shadowmap_vertex:TUe,shadowmask_pars_fragment:EUe,skinbase_vertex:AUe,skinning_pars_vertex:CUe,skinning_vertex:RUe,skinnormal_vertex:LUe,specularmap_fragment:DUe,specularmap_pars_fragment:PUe,tonemapping_fragment:IUe,tonemapping_pars_fragment:NUe,uv_pars_fragment:UUe,uv_pars_vertex:OUe,uv_vertex:zUe,uv2_pars_fragment:FUe,uv2_pars_vertex:BUe,uv2_vertex:kUe,worldpos_vertex:VUe,cube_frag:GUe,cube_vert:HUe,depth_frag:WUe,depth_vert:XUe,distanceRGBA_frag:YUe,distanceRGBA_vert:qUe,equirect_frag:ZUe,equirect_vert:jUe,linedashed_frag:KUe,linedashed_vert:JUe,meshbasic_frag:$Ue,meshbasic_vert:QUe,meshlambert_frag:eOe,meshlambert_vert:tOe,meshphong_frag:rOe,meshphong_vert:iOe,meshphysical_frag:nOe,meshphysical_vert:aOe,normal_frag:oOe,normal_vert:sOe,points_frag:lOe,points_vert:uOe,shadow_frag:cOe,shadow_vert:hOe};Wt.prototype={constructor:Wt,isColor:!0,r:1,g:1,b:1,set:function(r){return r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r),this},setScalar:function(r){return this.r=r,this.g=r,this.b=r,this},setHex:function(r){return r=Math.floor(r),this.r=(r>>16&255)/255,this.g=(r>>8&255)/255,this.b=(r&255)/255,this},setRGB:function(r,e,t){return this.r=r,this.g=e,this.b=t,this},setHSL:function(){function r(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*6*(2/3-i):e}return function(t,i,n){if(t=fr.euclideanModulo(t,1),i=fr.clamp(i,0,1),n=fr.clamp(n,0,1),i===0)this.r=this.g=this.b=n;else{var a=n<=.5?n*(1+i):n+i-n*i,o=2*n-a;this.r=r(o,a,t+1/3),this.g=r(o,a,t),this.b=r(o,a,t-1/3)}return this}}(),setStyle:function(r){function e(h){h!==void 0&&parseFloat(h)<1&&console.warn("THREE.Color: Alpha component of "+r+" will be ignored.")}var t;if(t=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(r)){var i,n=t[1],a=t[2];switch(n){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(o,s,l)}break}}else if(t=/^\#([A-Fa-f0-9]+)$/.exec(r)){var u=t[1],c=u.length;if(c===3)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(c===6)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}if(r&&r.length>0){var u=fOe[r];u!==void 0?this.setHex(u):console.warn("THREE.Color: Unknown color "+r)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(r){return this.r=r.r,this.g=r.g,this.b=r.b,this},copyGammaToLinear:function(r,e){return e===void 0&&(e=2),this.r=Math.pow(r.r,e),this.g=Math.pow(r.g,e),this.b=Math.pow(r.b,e),this},copyLinearToGamma:function(r,e){e===void 0&&(e=2);var t=e>0?1/e:1;return this.r=Math.pow(r.r,t),this.g=Math.pow(r.g,t),this.b=Math.pow(r.b,t),this},convertGammaToLinear:function(){var r=this.r,e=this.g,t=this.b;return this.r=r*r,this.g=e*e,this.b=t*t,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return this.r*255<<16^this.g*255<<8^this.b*255<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(r){var e=r||{h:0,s:0,l:0},t=this.r,i=this.g,n=this.b,a=Math.max(t,i,n),o=Math.min(t,i,n),s,l,u=(o+a)/2;if(o===a)s=0,l=0;else{var c=a-o;switch(l=u<=.5?c/(a+o):c/(2-a-o),a){case t:s=(i-n)/c+(i this.max.x||r.y this.max.y)},containsBox:function(r){return this.min.x<=r.min.x&&r.max.x<=this.max.x&&this.min.y<=r.min.y&&r.max.y<=this.max.y},getParameter:function(r,e){var t=e||new Tt;return t.set((r.x-this.min.x)/(this.max.x-this.min.x),(r.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(r){return!(r.max.x this.max.x||r.max.y this.max.y)},clampPoint:function(r,e){var t=e||new Tt;return t.copy(r).clamp(this.min,this.max)},distanceToPoint:function(){var r=new Tt;return function(t){var i=r.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(r){return this.min.max(r.min),this.max.min(r.max),this},union:function(r){return this.min.min(r.min),this.max.max(r.max),this},translate:function(r){return this.min.add(r),this.max.add(r),this},equals:function(r){return r.min.equals(this.min)&&r.max.equals(this.max)}};mOe=0;_r.prototype={constructor:_r,isMaterial:!0,get needsUpdate(){return this._needsUpdate},set needsUpdate(r){r===!0&&this.update(),this._needsUpdate=r},setValues:function(r){if(r!==void 0)for(var e in r){var t=r[e];if(t===void 0){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}var i=this[e];if(i===void 0){console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.");continue}i&&i.isColor?i.set(t):i&&i.isVector3&&t&&t.isVector3?i.copy(t):e==="overdraw"?this[e]=Number(t):this[e]=t}},toJSON:function(r){var e=r===void 0;e&&(r={textures:{},images:{}});var t={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.color&&this.color.isColor&&(t.color=this.color.getHex()),this.roughness!==void 0&&(t.roughness=this.roughness),this.metalness!==void 0&&(t.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(t.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(t.specular=this.specular.getHex()),this.shininess!==void 0&&(t.shininess=this.shininess),this.clearCoat!==void 0&&(t.clearCoat=this.clearCoat),this.clearCoatRoughness!==void 0&&(t.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(t.map=this.map.toJSON(r).uuid),this.alphaMap&&this.alphaMap.isTexture&&(t.alphaMap=this.alphaMap.toJSON(r).uuid),this.lightMap&&this.lightMap.isTexture&&(t.lightMap=this.lightMap.toJSON(r).uuid),this.bumpMap&&this.bumpMap.isTexture&&(t.bumpMap=this.bumpMap.toJSON(r).uuid,t.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(t.normalMap=this.normalMap.toJSON(r).uuid,t.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(t.displacementMap=this.displacementMap.toJSON(r).uuid,t.displacementScale=this.displacementScale,t.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(t.roughnessMap=this.roughnessMap.toJSON(r).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(t.metalnessMap=this.metalnessMap.toJSON(r).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(t.emissiveMap=this.emissiveMap.toJSON(r).uuid),this.specularMap&&this.specularMap.isTexture&&(t.specularMap=this.specularMap.toJSON(r).uuid),this.envMap&&this.envMap.isTexture&&(t.envMap=this.envMap.toJSON(r).uuid,t.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(t.gradientMap=this.gradientMap.toJSON(r).uuid),this.size!==void 0&&(t.size=this.size),this.sizeAttenuation!==void 0&&(t.sizeAttenuation=this.sizeAttenuation),this.blending!==a_&&(t.blending=this.blending),this.shading!==zk&&(t.shading=this.shading),this.side!==y0&&(t.side=this.side),this.vertexColors!==bL&&(t.vertexColors=this.vertexColors),this.opacity<1&&(t.opacity=this.opacity),this.transparent===!0&&(t.transparent=this.transparent),t.depthFunc=this.depthFunc,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,this.alphaTest>0&&(t.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(t.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(t.wireframe=this.wireframe),this.wireframeLinewidth>1&&(t.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(t.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(t.wireframeLinejoin=this.wireframeLinejoin),t.skinning=this.skinning,t.morphTargets=this.morphTargets;function i(o){var s=[];for(var l in o){var u=o[l];delete u.metadata,s.push(u)}return s}if(e){var n=i(r.textures),a=i(r.images);n.length>0&&(t.textures=n),a.length>0&&(t.images=a)}return t},clone:function(){return new this.constructor().copy(this)},copy:function(r){this.name=r.name,this.fog=r.fog,this.lights=r.lights,this.blending=r.blending,this.side=r.side,this.shading=r.shading,this.vertexColors=r.vertexColors,this.opacity=r.opacity,this.transparent=r.transparent,this.blendSrc=r.blendSrc,this.blendDst=r.blendDst,this.blendEquation=r.blendEquation,this.blendSrcAlpha=r.blendSrcAlpha,this.blendDstAlpha=r.blendDstAlpha,this.blendEquationAlpha=r.blendEquationAlpha,this.depthFunc=r.depthFunc,this.depthTest=r.depthTest,this.depthWrite=r.depthWrite,this.colorWrite=r.colorWrite,this.precision=r.precision,this.polygonOffset=r.polygonOffset,this.polygonOffsetFactor=r.polygonOffsetFactor,this.polygonOffsetUnits=r.polygonOffsetUnits,this.alphaTest=r.alphaTest,this.premultipliedAlpha=r.premultipliedAlpha,this.overdraw=r.overdraw,this.visible=r.visible,this.clipShadows=r.clipShadows,this.clipIntersection=r.clipIntersection;var e=r.clippingPlanes,t=null;if(e!==null){var i=e.length;t=new Array(i);for(var n=0;n!==i;++n)t[n]=e[n].clone()}return this.clippingPlanes=t,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};Object.assign(_r.prototype,pl.prototype);Na.prototype=Object.create(_r.prototype);Na.prototype.constructor=Na;Na.prototype.isShaderMaterial=!0;Na.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.fragmentShader=r.fragmentShader,this.vertexShader=r.vertexShader,this.uniforms=Yo.clone(r.uniforms),this.defines=r.defines,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this.lights=r.lights,this.clipping=r.clipping,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.morphNormals=r.morphNormals,this.extensions=r.extensions,this};Na.prototype.toJSON=function(r){var e=_r.prototype.toJSON.call(this,r);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e};$f.prototype=Object.create(_r.prototype);$f.prototype.constructor=$f;$f.prototype.isMeshDepthMaterial=!0;$f.prototype.copy=function(r){return _r.prototype.copy.call(this,r),this.depthPacking=r.depthPacking,this.skinning=r.skinning,this.morphTargets=r.morphTargets,this.map=r.map,this.alphaMap=r.alphaMap,this.displacementMap=r.displacementMap,this.displacementScale=r.displacementScale,this.displacementBias=r.displacementBias,this.wireframe=r.wireframe,this.wireframeLinewidth=r.wireframeLinewidth,this};Zu.prototype={constructor:Zu,isBox3:!0,set:function(r,e){return this.min.copy(r),this.max.copy(e),this},setFromArray:function(r){for(var e=1/0,t=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=0,l=r.length;s n&&(n=u),c>a&&(a=c),h>o&&(o=h)}this.min.set(e,t,i),this.max.set(n,a,o)},setFromBufferAttribute:function(r){for(var e=1/0,t=1/0,i=1/0,n=-1/0,a=-1/0,o=-1/0,s=0,l=r.count;s n&&(n=u),c>a&&(a=c),h>o&&(o=h)}this.min.set(e,t,i),this.max.set(n,a,o)},setFromPoints:function(r){this.makeEmpty();for(var e=0,t=r.length;e this.max.x||r.y this.max.y||r.z this.max.z)},containsBox:function(r){return this.min.x<=r.min.x&&r.max.x<=this.max.x&&this.min.y<=r.min.y&&r.max.y<=this.max.y&&this.min.z<=r.min.z&&r.max.z<=this.max.z},getParameter:function(r,e){var t=e||new oe;return t.set((r.x-this.min.x)/(this.max.x-this.min.x),(r.y-this.min.y)/(this.max.y-this.min.y),(r.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(r){return!(r.max.x this.max.x||r.max.y this.max.y||r.max.z this.max.z)},intersectsSphere:function(){var r;return function(t){return r===void 0&&(r=new oe),this.clampPoint(t.center,r),r.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(r){var e,t;return r.normal.x>0?(e=r.normal.x*this.min.x,t=r.normal.x*this.max.x):(e=r.normal.x*this.max.x,t=r.normal.x*this.min.x),r.normal.y>0?(e+=r.normal.y*this.min.y,t+=r.normal.y*this.max.y):(e+=r.normal.y*this.max.y,t+=r.normal.y*this.min.y),r.normal.z>0?(e+=r.normal.z*this.min.z,t+=r.normal.z*this.max.z):(e+=r.normal.z*this.max.z,t+=r.normal.z*this.min.z),e<=r.constant&&t>=r.constant},clampPoint:function(r,e){var t=e||new oe;return t.copy(r).clamp(this.min,this.max)},distanceToPoint:function(){var r=new oe;return function(t){var i=r.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var r=new oe;return function(t){var i=t||new ha;return this.getCenter(i.center),i.radius=this.getSize(r).length()*.5,i}}(),intersect:function(r){return this.min.max(r.min),this.max.min(r.max),this.isEmpty()&&this.makeEmpty(),this},union:function(r){return this.min.min(r.min),this.max.max(r.max),this},applyMatrix4:function(){var r=[new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe];return function(t){return this.isEmpty()?this:(r[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),r[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),r[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),r[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),r[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),r[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),r[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),r[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(r),this)}}(),translate:function(r){return this.min.add(r),this.max.add(r),this},equals:function(r){return r.min.equals(this.min)&&r.max.equals(this.max)}};ha.prototype={constructor:ha,set:function(r,e){return this.center.copy(r),this.radius=e,this},setFromPoints:function(){var r=new Zu;return function(t,i){var n=this.center;i!==void 0?n.copy(i):r.setFromPoints(t).getCenter(n);for(var a=0,o=0,s=t.length;o this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(r){var e=r||new Zu;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(r){return this.center.applyMatrix4(r),this.radius=this.radius*r.getMaxScaleOnAxis(),this},translate:function(r){return this.center.add(r),this},equals:function(r){return r.center.equals(this.center)&&r.radius===this.radius}};dl.prototype={constructor:dl,isMatrix3:!0,set:function(r,e,t,i,n,a,o,s,l){var u=this.elements;return u[0]=r,u[1]=i,u[2]=o,u[3]=e,u[4]=n,u[5]=s,u[6]=t,u[7]=a,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return new this.constructor().fromArray(this.elements)},copy:function(r){var e=r.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this},setFromMatrix4:function(r){var e=r.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToVector3Array:function(){var r;return function(t,i,n){r===void 0&&(r=new oe),i===void 0&&(i=0),n===void 0&&(n=t.length);for(var a=0,o=i;a1))return n.copy(a).multiplyScalar(s).add(t.start)}}(),intersectsLine:function(r){var e=this.distanceToPoint(r.start),t=this.distanceToPoint(r.end);return e<0&&t>0||t<0&&e>0},intersectsBox:function(r){return r.intersectsPlane(this)},intersectsSphere:function(r){return r.intersectsPlane(this)},coplanarPoint:function(r){var e=r||new oe;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var r=new oe,e=new dl;return function(i,n){var a=this.coplanarPoint(r).applyMatrix4(i),o=n||e.getNormalMatrix(i),s=this.normal.applyMatrix3(o).normalize();return this.constant=-a.dot(s),this}}(),translate:function(r){return this.constant=this.constant-r.dot(this.normal),this},equals:function(r){return r.normal.equals(this.normal)&&r.constant===this.constant}};kM.prototype={constructor:kM,set:function(r,e,t,i,n,a){var o=this.planes;return o[0].copy(r),o[1].copy(e),o[2].copy(t),o[3].copy(i),o[4].copy(n),o[5].copy(a),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){for(var e=this.planes,t=0;t<6;t++)e[t].copy(r.planes[t]);return this},setFromMatrix:function(r){var e=this.planes,t=r.elements,i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=t[9],p=t[10],d=t[11],g=t[12],m=t[13],v=t[14],_=t[15];return e[0].setComponents(o-i,c-s,d-h,_-g).normalize(),e[1].setComponents(o+i,c+s,d+h,_+g).normalize(),e[2].setComponents(o+n,c+l,d+f,_+m).normalize(),e[3].setComponents(o-n,c-l,d-f,_-m).normalize(),e[4].setComponents(o-a,c-u,d-p,_-v).normalize(),e[5].setComponents(o+a,c+u,d+p,_+v).normalize(),this},intersectsObject:function(){var r=new ha;return function(t){var i=t.geometry;return i.boundingSphere===null&&i.computeBoundingSphere(),r.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(r)}}(),intersectsSprite:function(){var r=new ha;return function(t){return r.center.set(0,0,0),r.radius=.7071067811865476,r.applyMatrix4(t.matrixWorld),this.intersectsSphere(r)}}(),intersectsSphere:function(r){for(var e=this.planes,t=r.center,i=-r.radius,n=0;n<6;n++){var a=e[n].distanceToPoint(t);if(a0?i.min.x:i.max.x,e.x=o.normal.x>0?i.max.x:i.min.x,r.y=o.normal.y>0?i.min.y:i.max.y,e.y=o.normal.y>0?i.max.y:i.min.y,r.z=o.normal.z>0?i.min.z:i.max.z,e.z=o.normal.z>0?i.max.z:i.min.z;var s=o.distanceToPoint(r),l=o.distanceToPoint(e);if(s<0&&l<0)return!1}return!0}}(),containsPoint:function(r){for(var e=this.planes,t=0;t<6;t++)if(e[t].distanceToPoint(r)<0)return!1;return!0}};Qf.prototype={constructor:Qf,set:function(r,e){return this.origin.copy(r),this.direction.copy(e),this},clone:function(){return new this.constructor().copy(this)},copy:function(r){return this.origin.copy(r.origin),this.direction.copy(r.direction),this},at:function(r,e){var t=e||new oe;return t.copy(this.direction).multiplyScalar(r).add(this.origin)},lookAt:function(r){return this.direction.copy(r).sub(this.origin).normalize(),this},recast:function(){var r=new oe;return function(t){return this.origin.copy(this.at(t,r)),this}}(),closestPointToPoint:function(r,e){var t=e||new oe;t.subVectors(r,this.origin);var i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(r){return Math.sqrt(this.distanceSqToPoint(r))},distanceSqToPoint:function(){var r=new oe;return function(t){var i=r.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(r.copy(this.direction).multiplyScalar(i).add(this.origin),r.distanceToSquared(t))}}(),distanceSqToSegment:function(){var r=new oe,e=new oe,t=new oe;return function(n,a,o,s){r.copy(n).add(a).multiplyScalar(.5),e.copy(a).sub(n).normalize(),t.copy(this.origin).sub(r);var l=n.distanceTo(a)*.5,u=-this.direction.dot(e),c=t.dot(this.direction),h=-t.dot(e),f=t.lengthSq(),p=Math.abs(1-u*u),d,g,m,v;if(p>0)if(d=u*h-c,g=u*c-h,v=l*p,d>=0)if(g>=-v)if(g<=v){var _=1/p;d*=_,g*=_,m=d*(d+u*g+2*c)+g*(u*d+g+2*h)+f}else g=l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*h)+f;else g=-l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*h)+f;else g<=-v?(d=Math.max(0,-(-u*l+c)),g=d>0?-l:Math.min(Math.max(-l,-h),l),m=-d*d+g*(g+2*h)+f):g<=v?(d=0,g=Math.min(Math.max(-l,-h),l),m=g*(g+2*h)+f):(d=Math.max(0,-(u*l+c)),g=d>0?l:Math.min(Math.max(-l,-h),l),m=-d*d+g*(g+2*h)+f);else g=u>0?-l:l,d=Math.max(0,-(u*g+c)),m=-d*d+g*(g+2*h)+f;return o&&o.copy(this.direction).multiplyScalar(d).add(this.origin),s&&s.copy(e).multiplyScalar(g).add(r),m}}(),intersectSphere:function(){var r=new oe;return function(t,i){r.subVectors(t.center,this.origin);var n=r.dot(this.direction),a=r.dot(r)-n*n,o=t.radius*t.radius;if(a>o)return null;var s=Math.sqrt(o-a),l=n-s,u=n+s;return l<0&&u<0?null:l<0?this.at(u,i):this.at(l,i)}}(),intersectsSphere:function(r){return this.distanceToPoint(r.center)<=r.radius},distanceToPlane:function(r){var e=r.normal.dot(this.direction);if(e===0)return r.distanceToPoint(this.origin)===0?0:null;var t=-(this.origin.dot(r.normal)+r.constant)/e;return t>=0?t:null},intersectPlane:function(r,e){var t=this.distanceToPlane(r);return t===null?null:this.at(t,e)},intersectsPlane:function(r){var e=r.distanceToPoint(this.origin);if(e===0)return!0;var t=r.normal.dot(this.direction);return t*e<0},intersectBox:function(r,e){var t,i,n,a,o,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return l>=0?(t=(r.min.x-h.x)*l,i=(r.max.x-h.x)*l):(t=(r.max.x-h.x)*l,i=(r.min.x-h.x)*l),u>=0?(n=(r.min.y-h.y)*u,a=(r.max.y-h.y)*u):(n=(r.max.y-h.y)*u,a=(r.min.y-h.y)*u),t>a||n>i||((n>t||t!==t)&&(t=n),(a