(self.webpackchunk_n_e=self.webpackchunk_n_e||[]).push([[888],{8626:function(e,n,r){"use strict";let i;r.d(n,{l:function(){return en}});var a=r(9477);let s=new weakmap;class o extends a.loader{constructor(e){super(e),this.decoderpath="",this.decoderconfig={},this.decoderbinary=null,this.decoderpending=null,this.workerlimit=4,this.workerpool=[],this.workernexttaskid=1,this.workersourceurl="",this.defaultattributeids={position:"position",normal:"normal",color:"color",uv:"tex_coord"},this.defaultattributetypes={position:"float32array",normal:"float32array",color:"float32array",uv:"float32array"}}setdecoderpath(e){return this.decoderpath=e,this}setdecoderconfig(e){return this.decoderconfig=e,this}setworkerlimit(e){return this.workerlimit=e,this}load(e,n,r,i){let s=new a.fileloader(this.manager);s.setpath(this.path),s.setresponsetype("arraybuffer"),s.setrequestheader(this.requestheader),s.setwithcredentials(this.withcredentials),s.load(e,e=>{let r={attributeids:this.defaultattributeids,attributetypes:this.defaultattributetypes,useuniqueids:!1};this.decodegeometry(e,r).then(n).catch(i)},r,i)}decodedracofile(e,n,r,i){let a={attributeids:r||this.defaultattributeids,attributetypes:i||this.defaultattributetypes,useuniqueids:!!r};this.decodegeometry(e,a).then(n)}decodegeometry(e,n){let r;for(let e in n.attributetypes){let r=n.attributetypes[e];void 0!==r.bytes_per_element&&(n.attributetypes[e]=r.name)}let i=json.stringify(n);if(s.has(e)){let n=s.get(e);if(n.key===i)return n.promise;if(0===e.bytelength)throw error("three.dracoloader: unable to re-decode a buffer with different settings. buffer has already been transferred.")}let a=this.workernexttaskid++,o=e.bytelength,l=this._getworker(a,o).then(i=>(r=i,new promise((i,s)=>{r._callbacks[a]={resolve:i,reject:s},r.postmessage({type:"decode",id:a,taskconfig:n,buffer:e},[e])}))).then(e=>this._creategeometry(e.geometry));return l.catch(()=>!0).then(()=>{r&&a&&this._releasetask(r,a)}),s.set(e,{key:i,promise:l}),l}_creategeometry(e){let n=new a.buffergeometry;e.index&&n.setindex(new a.bufferattribute(e.index.array,1));for(let r=0;r{r.load(e,n,void 0,i)})}preload(){return this._initdecoder(),this}_initdecoder(){if(this.decoderpending)return this.decoderpending;let e="object"!=typeof webassembly||"js"===this.decoderconfig.type,n=[];return e?n.push(this._loadlibrary("draco_decoder.js","text")):(n.push(this._loadlibrary("draco_wasm_wrapper.js","text")),n.push(this._loadlibrary("draco_decoder.wasm","arraybuffer"))),this.decoderpending=promise.all(n).then(n=>{let r=n[0];e||(this.decoderconfig.wasmbinary=n[1]);let i=l.tostring(),a=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexof("{")+1,i.lastindexof("}"))].join("\n");this.workersourceurl=url.createobjecturl(new blob([a]))}),this.decoderpending}_getworker(e,n){return this._initdecoder().then(()=>{if(this.workerpool.lengthn._taskload?-1:1});let r=this.workerpool[this.workerpool.length-1];return r._taskcosts[e]=n,r._taskload+=n,r})}_releasetask(e,n){e._taskload-=e._taskcosts[n],delete e._callbacks[n],delete e._taskcosts[n]}debug(){console.log("task load: ",this.workerpool.map(e=>e._taskload))}dispose(){for(let e=0;e{let n=e.draco,r=new n.decoder,o=new n.decoderbuffer;o.init(new int8array(a),a.bytelength);try{let e=function(e,n,r,i){let a,s;let o=i.attributeids,l=i.attributetypes,u=n.getencodedgeometrytype(r);if(u===e.triangular_mesh)a=new e.mesh,s=n.decodebuffertomesh(r,a);else if(u===e.point_cloud)a=new e.pointcloud,s=n.decodebuffertopointcloud(r,a);else throw error("three.dracoloader: unexpected geometry type.");if(!s.ok()||0===a.ptr)throw error("three.dracoloader: decoding failed: "+s.error_msg());let c={index:null,attributes:[]};for(let r in o){let s,u;let h=self[l[r]];if(i.useuniqueids)u=o[r],s=n.getattributebyuniqueid(a,u);else{if(-1===(u=n.getattributeid(a,e[o[r]])))continue;s=n.getattribute(a,u)}c.attributes.push(function(e,n,r,i,a,s){let o=s.num_components(),l=r.num_points(),u=l*o,c=u*a.bytes_per_element,h=function(e,n){switch(n){case float32array:return e.dt_float32;case int8array:return e.dt_int8;case int16array:return e.dt_int16;case int32array:return e.dt_int32;case uint8array:return e.dt_uint8;case uint16array:return e.dt_uint16;case uint32array:return e.dt_uint32}}(e,a),d=e._malloc(c);n.getattributedataarrayforallpoints(r,s,h,c,d);let p=new a(e.heapf32.buffer,d,u).slice();return e._free(d),{name:i,array:p,itemsize:o}}(e,n,a,r,h,s))}return u===e.triangular_mesh&&(c.index=function(e,n,r){let i=r.num_faces(),a=3*i,s=4*a,o=e._malloc(s);n.gettrianglesuint32array(r,s,o);let l=new uint32array(e.heapf32.buffer,o,a).slice();return e._free(o),{array:l,itemsize:1}}(e,n,a)),e.destroy(a),c}(n,r,o,s),a=e.attributes.map(e=>e.array.buffer);e.index&&a.push(e.index.array.buffer),self.postmessage({type:"decode",id:i.id,geometry:e},a)}catch(e){console.error(e),self.postmessage({type:"error",id:i.id,error:e.message})}finally{n.destroy(o),n.destroy(r)}})}}}let u=()=>{let e;if(i)return i;let n=new uint8array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),r=new uint8array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof webassembly)return{supported:!1};let a="b9h9z9tfbbbf8fl9gbb9glaaaaafa9geaaab9gfafa9geaaafaemcbfffgggeiiilf9wffflefbfknfafcx/ifmo/lfvk9tv9t9vq95gbt9f9f939h9z9t9f9j9h9s9s9f9jw9vq9zbbp9tv9z9o9v9ww9f9kv9j9v9kv9wvqwv94h919m9mvqbf8z9tv9z9o9v9ww9f9kv9j9v9kv9j9u9kv94h919m9mvqbgy9tv9z9o9v9ww9f9kv9j9v9kv9j9u9kv949tvz91v9u9jvben9tv9z9o9v9ww9f9kv9j9v9kv69p9swvq9p9jwbii9tv9z9o9v9ww9f9kv9j9v9kv69p9swvq9r919hwbln9tv9z9o9v9ww9f9kv9j9v9kv69p9swvq9f949wbki9z9iqlboc+x8ycgbm/qqfta8juuuubcu/eblhl8kuuuubc9+rkgxagcfjai9lqbcarkae2bbc+gf9hqbalaeaijhoaglagtkuuubrncuobag9uc/wgbzhkcugakcug9jyrvaecfjricbrcgxexacaf9pqfavafaclacavjaf9jyrmgxgxag9fqbamcbjhkc9wzrsakcircejcgrrqancugjrfcbrbairtexgxaoatlaq9pqbcbrisemataqjrigxas9fqbcbrtcbreexgxaoailci9pqbcbrislmancu/cbjaejrkgxgxgxgxgxataeckrj2bbatckzrcezfibfgebmakhb83ebakcnjhb83ebsemakai2biai2bbhmckrhyayce6hyy86bbakcfjaicijayjhy2bbamcircezhpapce6hpy86bbakcgjayapjhy2bbamcgrcezhpapce6hpy86bbakcejayapjhy2bbamcezhmamce6hmy86bbakcijayamjhy2bbai2bfhmckrhpapce6hpy86bbakcljayapjhy2bbamcircezhpapce6hpy86bbakckjayapjhy2bbamcgrcezhpapce6hpy86bbakcojayapjhy2bbamcezhmamce6hmy86bbakcnjayamjhy2bbai2bghmckrhpapce6hpy86bbakcvjayapjhy2bbamcircezhpapce6hpy86bbakccjayapjhy2bbamcgrcezhpapce6hpy86bbakcmjayapjhy2bbamcezhmamce6hmy86bbakcsjayamjhm2bbai2behickrhyayce6hyy86bbakcqjamayjhm2bbaicircezhyayce6hyy86bbakcfjamayjhm2bbaicgrcezhyayce6hyy86bbakcbjamayjhk2bbaicezhiaice6hiy86bbakaijrisgmakai2bnai2bbhmcirhyaycb6hyy86bbakcfjaicnjayjhy2bbamcbzhmamcb6hmy86bbakcgjayamjhm2bbai2bfhycirhpapcb6hpy86bbakcejamapjhm2bbaycbzhyaycb6hyy86bbakcijamayjhm2bbai2bghycirhpapcb6hpy86bbakcljamapjhm2bbaycbzhyaycb6hyy86bbakckjamayjhm2bbai2behycirhpapcb6hpy86bbakcojamapjhm2bbaycbzhyaycb6hyy86bbakcnjamayjhm2bbai2bihycirhpapcb6hpy86bbakcvjamapjhm2bbaycbzhyaycb6hyy86bbakccjamayjhm2bbai2blhycirhpapcb6hpy86bbakcmjamapjhm2bbaycbzhyaycb6hyy86bbakcsjamayjhm2bbai2bkhycirhpapcb6hpy86bbakcqjamapjhm2bbaycbzhyaycb6hyy86bbakcfjamayjhm2bbai2bohicirhyaycb6hyy86bbakcbjamayjhk2bbaicbzhiaicb6hiy86bbakaijrisfmakai8pbb83bbakcnjaicnj8pbb83bbaictjrimatcgjrtaectjheas9jqbmmgxaiqbcbrisemgxam9fqbanabj2bbrtcbrkafreexaeancu/cbjakj2bbhtcfrcbatcfzl9zatjht86bbaeagjreakcfjhkam9hqbmmafcfjrfairtabcfjhbag9hqbmmabacag9sjancugjamag9stkuuubpanancugjamcajag9sjagtkuuubpmamcbaiyacjrcaiqbmc9+rksfmcbc99aoailagcaagca9ly6yrkmalcu/ebj8kuuuubakm+omfta8juuuubcoflhl8kuuuubc9+rkgxafce9uhoctjai9lqbcarkae2bbhnc/wfzc/gf9hqbancbzhvcf9lqbalcobjcgfcuft+juuubpalc84jha83ebalc8wjha83ebalc8ojha83ebalcajha83ebalcijha83ebalctjha83ebalha83enalha83ebaeaijc9wjrcaecfjhnaojrmgxaf9fqbcqcbavcf6yrsabrecbrvcbrqcbrfcbricbrkexgxamacuqbc9+rksemgxgxan2bbhoc/vf9lqbalcobjaocirca9zakjcbzcewjhb8ogirtab8ogbrtgxaocbzhbas9pqbalaoca9zaijcbzcgwj8ogbavabyroab9frbgxgxagcg9hqbabat87fbabcijao87fbabcgjat87fbsfmaeatjgbaecnjaojgbaecijatjgbmavabjrvalcobjakcewjhmaojgbamatjgialaicgwjaojgbalcobjakcfjcbzhkcewjhtatjgbataojgiaiabjriakcfjrksgmgxgxabcb6qbaqabjabc989zjcfjrqsfmam1bbhbcgfzrogxgxabca9mqbamcfjrmsfmam1bfhbcgbzcowaocgbzqrogxabca9mqbamcgjrmsfmam1bghbcgbzcfwaoqrogxabca9mqbamcejrmsfmam1behbcgbzcdwaoqrogxabca9mqbamcijrmsfmam2bic8cwaoqroamcljrmmaocfrcbaocfzl9zaqjrqmgxgxagcg9hqbabat87fbabcijaq87fbabcgjat87fbsfmaeatjgbaecnjaqjgbaecijatjgbmalcobjakcewjhoaqjgbaoatjgialaicgwjaqjgbalcobjakcfjcbzhkcewjhoatjgbaoaqjgiaicfjriakcfjrksfmgxaocdf9lqbalaiacaocbzj2bbhbcirhtlcbzcgwj8ogbavcfjhtatyroalaiablcbzcgwj8ogbatat9fhmjhtabcbzhtyrbat9frtgxgxagcg9hqbabav87fbabcijab87fbabcgjao87fbsfmaeavjgbaecnjabjgbaecijaojgbmalaicgwjavjgbalcobjakcewjhyaojgbayavjgialaicfjhicbzcgwjaojgbalcobjakcfjcbzcewjhyabjgbayaojgialaiamjcbzhicgwjabjgbalcobjakcgjcbzhkcewjhoavjgbaoabjgiakcfjrkaiatjriatatjrvsfmavcbam2bbhyyhtaoc/+f6hpjroaycbzrtgxgxaycirhmqbaocfjrbsfmaorbalaiamlcbzcgwj8ogbromgxgxatqbabcfjrvsfmabrvalaiaylcbzcgwj8ogbrbmgxgxap9fqbamcfjrysfmam1bfhycgfzrtgxgxayca9mqbamcgjrysfmam1bghycgbzcowatcgbzqrtgxayca9mqbamcejrysfmam1behycgbzcfwatqrtgxayca9mqbamcijrysfmam1bihycgbzcdwatqrtgxayca9mqbamcljrysfmamckjryam2blc8cwatqrtmatcfrcbatcfzl9zaqjhqrtmgxgxamcb6qbayrpsfmay1bbhmcgfzrogxgxamca9mqbaycfjrpsfmay1bfhmcgbzcowaocgbzqrogxamca9mqbaycgjrpsfmay1bghmcgbzcfwaoqrogxamca9mqbaycejrpsfmay1behmcgbzcdwaoqrogxamca9mqbaycijrpsfmaycljrpay2bic8cwaoqromaocfrcbaocfzl9zaqjhqromgxgxatcb6qbaprmsfmap1bbhmcgfzrbgxgxamca9mqbapcfjrmsfmap1bfhmcgbzcowabcgbzqrbgxamca9mqbapcgjrmsfmap1bghmcgbzcfwabqrbgxamca9mqbapcejrmsfmap1behmcgbzcdwabqrbgxamca9mqbapcijrmsfmapcljrmap2bic8cwabqrbmabcfrcbabcfzl9zaqjhqrbmgxgxagcg9hqbabat87fbabcijab87fbabcgjao87fbsfmaeatjgbaecnjabjgbaecijaojgbmalcobjakcewjhyaojgbayatjgialaicgwjatjgbalcobjakcfjcbzcewjhyabjgbayaojgialaicfjhicbzcgwjaojgbalcobjakcgjcbzcewjhoatjgbaoabjgialaiam9famcb6qjhicbzcgwjabjgbaiat9fatcb6qjriakcejrkmancfjrnabckjrbaecsjreakcbzrkaicbzriafcejhfaf9jqbmmcbc99amac6yrkmalcofj8kuuuubakm/tifga8juuuubctlrlc9+rkgxafcljai9lqbcarkae2bbc/+fzc/qf9hqbalhb83enaecfjrkaeaijc98jregxaf9fqbgxagcg6qbexgxakae9jqbc9+bmak1bbhgcgfzrigxgxagca9mqbakcfjrksfmak1bfhgcgbzcowaicgbzqrigxagca9mqbakcgjrksfmak1bghgcgbzcfwaiqrigxagca9mqbakcejrksfmak1behgcgbzcdwaiqrigxagca9mqbakcijrksfmak2bic8cwaiqriakcljrkmalcnjaicfzcgwqhgaicgrcbaicfrcfzl9zag8ogbjhijgbabaijgbabcijrbafcajhfqbsgmmexgxakae9jqbc9+bmak1bbhgcgfzrigxgxagca9mqbakcfjrksfmak1bfhgcgbzcowaicgbzqrigxagca9mqbakcgjrksfmak1bghgcgbzcfwaiqrigxagca9mqbakcejrksfmak1behgcgbzcdwaiqrigxagca9mqbakcijrksfmak2bic8cwaiqriakcljrkmabaicgrcbaicfrcfzl9zalcnjaicfzcgwqhi8ogbjhg87fbaiagjgbabcgjrbafcajhfqbmmcbc99akae6yrkmakm+llkfaf99gag99fag99gxgxagci9hqbaf9fqfexgxgx9dbbb8/9dbbb+/abcgjhg1bb+yab1bbhe+yhi+l+tabcfjhl1bbhk+yho+l+thn9dbbbb9ghvyan9dbb/+hanan+u9dbbbbanavyhcac+mhmaeca3yai+shiai+uacamakca3yao+shcac+u+s+s+r+vho+u+shn+l9dbbb9p9d9fqban+oresfmcuuuu94remagae86bbgxgx9dbbb8/9dbbb+/ac9dbbbb9gyacao+u+shn+l9dbbb9p9d9fqban+orgsfmcuuuu94rgmalag86bbgxgx9dbbb8/9dbbb+/ai9dbbbb9gyaiao+u+shn+l9dbbb9p9d9fqban+orgsfmcuuuu94rgmabag86bbabcijrbafcajhfqbsgmmaf9fqbexgxgx9dbbb8/9dbbb+/abcijhg8ufb+yab8ufbhe+yhi+l+tabcgjhl8ufbhk+yho+l+thn9dbbbb9ghvyan9db/+g6anan+u9dbbbbanavyhcac+mhmaeca3yai+shiai+uacamakca3yao+shcac+u+s+s+r+vho+u+shn+l9dbbb9p9d9fqban+oresfmcuuuu94remagae87fbgxgx9dbbb8/9dbbb+/ac9dbbbb9gyacao+u+shn+l9dbbb9p9d9fqban+orgsfmcuuuu94rgmalag87fbgxgx9dbbb8/9dbbb+/ai9dbbbb9gyaiao+u+shn+l9dbbb9p9d9fqban+orgsfmcuuuu94rgmabag87fbabcnjrbafcajhfqbmmm/seieae99eaf99gxaf9fqbcbreabriexgxgx9d/zi818/aickj8ufbhlceq+y+vhkai8ufb+y+uho9db/+g6+u9dbbb8/9dbbb+/ao9dbbbb9gy+shn+l9dbbb9p9d9fqban+orvsfmcuuuu94rvmaicij8ufbrcaicgj8ufbrmabalcfjcezaeqcfwjav87fbgxgxakam+y+uhn9db/+g6+u9dbbb8/9dbbb+/an9dbbbb9gy+shs+l9dbbb9p9d9fqbas+ormsfmcuuuu94rmmabalcgjcezaeqcfwjam87fbgxgxakac+y+uhk9db/+g6+u9dbbb8/9dbbb+/ak9dbbbb9gy+shs+l9dbbb9p9d9fqbas+orcsfmcuuuu94rcmabalcajcezaeqcfwjac87fbgxgx9dbbu8/aoao+u+tanan+u+takak+u+tho9dbbbbao9dbbbb9gy+r9db/+g6+u9dbbb8/+sho+l9dbbb9p9d9fqbao+orcsfmcuuuu94rcmabalcezaeqcfwjac87fbaicnjriaecijreafcajhfqbmmm9jbgxagcgraf9shf9fqbexabab8ogbhgcnwcn91+yagci91cnwcuuu/8ej+++u84gbabcijrbafcajhfqbmmm9tfeacbcb8ogukuubhfabcejc98zjhbjgukuubgxgxab8/bctwhguqbcareabaglcggejctrxbca6qfmafremaem/lfffagxgxafabqcez9fqbabresfmgxgxagct9pqbabresfmabreexaeaf8ogbjgbaecijafcij8ogbjgbaecnjafcnj8ogbjgbaecsjafcsj8ogbjgbaectjreafctjrfagc9wjhgcb9lqbmmagci9jqbexaeaf8ogbjgbafcijrfaecijreagc98jhgce9lqbmmgxag9fqbexaeaf2bb86bbaecfjreafcfjrfagcajhgqbmmabmoffgagxgxabcez9fqbabresfmafcgfzc+bwsn9srigxgxagct9pqbabresfmabreexaeaijgbaecsjaijgbaecnjaijgbaecijaijgbaectjreagc9wjhgcb9lqbmmagci9jqbexaeaijgbaecijreagc98jhgce9lqbmmgxag9fqbexaeaf86bbaecfjreagcajhgqbmmabmmmfbcunmit9kbb";webassembly.validate(n)&&(a="b9h9z9tfbbbfii9gbb9glaaaaafa9geaaab9gfafaemcbbfbffgggeilf9wffflefbfknfafcx/afmo/lfvk9tv9t9vq95gbt9f9f939h9z9t9f9j9h9s9s9f9jw9vq9zbbp9tv9z9o9v9ww9f9kv9j9v9kv9wvqwv94h919m9mvqbg8z9tv9z9o9v9ww9f9kv9j9v9kv9j9u9kv94h919m9mvqbiy9tv9z9o9v9ww9f9kv9j9v9kv9j9u9kv949tvz91v9u9jvbln9tv9z9o9v9ww9f9kv9j9v9kv69p9swvq9p9jwbki9tv9z9o9v9ww9f9kv9j9v9kv69p9swvq9r919hwbon9tv9z9o9v9ww9f9kv9j9v9kv69p9swvq9f949wbni9z9iqlbvc+n9icibtem9+fla8juuuubctlrbcbrfexcbrgcbreexabcnjagjaecuaafagrcfzhiy86bbaeaijreagcfjhgcn9hqbmafcx+yuubjae86bbafcewcxkuubjab8pen83ebafcfjhfcug9hqbmmk8llbae97f9+fal978juuuubcu/kblhl8kuuuubc9+rkgxagcfjai9lqbcarkae2bbc+gf9hqbalaeaijhoaglag/8cbbcuobag9uc/wgbzhkcugakcug9jyrnaecfjrkcbrvgxexavaf9pqfanafavlavanjaf9jyrcgxgxag9fqbaccbjhic9wzhmce9srsamcfwrqaicircejcgrrfcbrbexakrtcbrtgxexgxaoatlaf9pqbcbrkslmalcu/cbjatam9sjrmatafjrkcbregxamcob9jqbaoaklc/gb9jqbcbriexamaijregxgxgxgxgxataickrj2bbhycezfibfgebmaecbdtdmibsemaeakdbbiakdbbbhpcid+mfapdqbtftgmeyipldkeonhpcgd+mfapdqbtftgmeyipldkeonc0+g+midtd9ohdcedbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhicewcxkuubjdbebaicx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhicewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmibakcijaedebjaicx+yuubj2bbjrksgmaeakdbbnakdbbbhpcid+mfapdqbtftgmeyipldkeonc+p+e+8/4bdtd9ohdcbdbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhicewcxkuubjdbebaicx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhicewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmibakcnjaedebjaicx+yuubj2bbjrksfmaeakdbbbdmibakctjrkmgxgxgxgxgxaycgrcezfibfgebmaecbdtdmitsemaeakdbbiakdbbbhpcid+mfapdqbtftgmeyipldkeonhpcgd+mfapdqbtftgmeyipldkeonc0+g+midtd9ohdcedbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhicewcxkuubjdbebaicx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhicewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmitakcijaedebjaicx+yuubj2bbjrksgmaeakdbbnakdbbbhpcid+mfapdqbtftgmeyipldkeonc+p+e+8/4bdtd9ohdcbdbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhicewcxkuubjdbebaicx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhicewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmitakcnjaedebjaicx+yuubj2bbjrksfmaeakdbbbdmitakctjrkmgxgxgxgxgxaycircezfibfgebmaecbdtdmiasemaeakdbbiakdbbbhpcid+mfapdqbtftgmeyipldkeonhpcgd+mfapdqbtftgmeyipldkeonc0+g+midtd9ohdcedbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhicewcxkuubjdbebaicx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhicewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmiaakcijaedebjaicx+yuubj2bbjrksgmaeakdbbnakdbbbhpcid+mfapdqbtftgmeyipldkeonc+p+e+8/4bdtd9ohdcbdbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhicewcxkuubjdbebaicx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhicewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmiaakcnjaedebjaicx+yuubj2bbjrksfmaeakdbbbdmiaakctjrkmgxgxgxgxgxayckrfibfgebmaecbdtdmi8wsemaeakdbbiakdbbbhpcid+mfapdqbtftgmeyipldkeonhpcgd+mfapdqbtftgmeyipldkeonc0+g+midtd9ohdcedbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhycewcxkuubjdbebaycx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhycewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmi8wakcijaedebjaycx+yuubj2bbjrksgmaeakdbbnakdbbbhpcid+mfapdqbtftgmeyipldkeonc+p+e+8/4bdtd9ohdcbdbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhycewcxkuubjdbebaycx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhycewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmi8wakcnjaedebjaycx+yuubj2bbjrksfmaeakdbbbdmi8wakctjrkmaicobjreaicufjam9lqfaeriaoaklc/fb9lqbmmgxaeam9pqbaecerriexgxaoaklci9pqbcbrksomamaejrygxgxgxgxgxataeckrj2bbaickzrcezfibfgebmaycbdtdmibsemayakdbbiakdbbbhpcid+mfapdqbtftgmeyipldkeonhpcgd+mfapdqbtftgmeyipldkeonc0+g+midtd9ohdcedbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhicewcxkuubjdbebaicx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhicewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmibakcijaedebjaicx+yuubj2bbjrksgmayakdbbnakdbbbhpcid+mfapdqbtftgmeyipldkeonc+p+e+8/4bdtd9ohdcbdbd8jhpapdqbfgenvcmilkosqfbhed8dbh+bsxoxouwn0aed8dfhxouwkwk+gua0shnhtkanshnhnkanshn7cgfzhicewcxkuubjdbebaicx+yuubjdbbbheaedqbbbbbbbbbbbbbbbbanhak7cgfzhicewcxkuubjdbebd9udqbfgeilkottmypdendfadapd9sdmibakcnjaedebjaicx+yuubj2bbjrksfmayakdbbbdmibakctjrkmaicgjriaectjheam9jqbmmgxak9fqbakrtatcfjhtci6qgsfmmcbrksemgxam9fqbalcugjabjrealabjdbgbrecbryexaealcu/cbjayjhidbibhdcfd9tadcfdbhpd9od9hd9rhdaiamjdbibh8zcfd9ta8zapd9od9hd9rh8zdqbtftgmeyipldkeonhpaiaqjdbibhycfd9tayapd9od9hd9rhyaiasjdbibh8ccfd9ta8capd9od9hd9rh8cdqbtftgmeyipldkeonh8ddqbfttgemyilpdkoenhpapdqbfgebfgebfgebfgeaed9uhedybjgbaeagjhiaeapapdqilkoilkoilkoilkod9uhedybjgbaiagjhiaeapapdqnvcmnvcmnvcmnvcmd9uhedybjgbaiagjhiaeapapdqsqfbsqfbsqfbsqfbd9uhedybjgbaiagjhiaeapa8ddqnvi8zcmpysq8c8dfb8e8fhpapdqbfgebfgebfgebfged9uhedybjgbaiagjhiaeapapdqilkoilkoilkoilkod9uhedybjgbaiagjhiaeapapdqnvcmnvcmnvcmnvcmd9uhedybjgbaiagjhiaeapapdqsqfbsqfbsqfbsqfbd9uhedybjgbaiagjhiaeada8zdqniv8zcpmys8cq8df8eb8fhdaya8cdqniv8zcpmys8cq8df8eb8fh8zdqbfttgemyilpdkoenhpapdqbfgebfgebfgebfged9uhedybjgbaiagjhiaeapapdqilkoilkoilkoilkod9uhedybjgbaiagjhiaeapapdqnvcmnvcmnvcmnvcmd9uhedybjgbaiagjhiaeapapdqsqfbsqfbsqfbsqfbd9uhedybjgbaiagjhiaeada8zdqnvi8zcmpysq8c8dfb8e8fhpapdqbfgebfgebfgebfged9uhedybjgbaiagjhiaeapapdqilkoilkoilkoilkod9uhedybjgbaiagjhiaeapapdqnvcmnvcmnvcmnvcmd9uhedybjgbaiagjhiaeapapdqsqfbsqfbsqfbsqfbd9uhedybjgbaiagjreayctjhyam9jqbmmabcijhbag9jqbmmabavag9sjalcugjacag9s/8cbbalalcugjaccajag9sjag/8cbbmaccbakyavjrvakqbmc9+rksfmcbc99aoaklagcaagca9ly6yrkmalcu/kbj8kuuuubakmnbt+buuubm+kmfta8juuuubcoflhl8kuuuubc9+rkgxafce9uhoctjai9lqbcarkae2bbhnc/wfzc/gf9hqbancbzhvcf9lqbalcobjcgfcuf/8mbalc84jha83ebalc8wjha83ebalc8ojha83ebalcajha83ebalcijha83ebalctjha83ebalha83enalha83ebaeaijc9wjrcaecfjhnaojrmgxaf9fqbcqcbavcf6yrsabrecbrvcbrqcbrfcbricbrkexgxamacuqbc9+rksemgxgxan2bbhoc/vf9lqbalcobjaocirca9zakjcbzcewjhb8ogirtab8ogbrtgxaocbzhbas9pqbalaoca9zaijcbzcgwj8ogbavabyroab9frbgxgxagcg9hqbabat87fbabcijao87fbabcgjat87fbsfmaeatjgbaecnjaojgbaecijatjgbmavabjrvalcobjakcewjhmaojgbamatjgialaicgwjaojgbalcobjakcfjcbzhkcewjhtatjgbataojgiaiabjriakcfjrksgmgxgxabcb6qbaqabjabc989zjcfjrqsfmam1bbhbcgfzrogxgxabca9mqbamcfjrmsfmam1bfhbcgbzcowaocgbzqrogxabca9mqbamcgjrmsfmam1bghbcgbzcfwaoqrogxabca9mqbamcejrmsfmam1behbcgbzcdwaoqrogxabca9mqbamcijrmsfmam2bic8cwaoqroamcljrmmaocfrcbaocfzl9zaqjrqmgxgxagcg9hqbabat87fbabcijaq87fbabcgjat87fbsfmaeatjgbaecnjaqjgbaecijatjgbmalcobjakcewjhoaqjgbaoatjgialaicgwjaqjgbalcobjakcfjcbzhkcewjhoatjgbaoaqjgiaicfjriakcfjrksfmgxaocdf9lqbalaiacaocbzj2bbhbcirhtlcbzcgwj8ogbavcfjhtatyroalaiablcbzcgwj8ogbatat9fhmjhtabcbzhtyrbat9frtgxgxagcg9hqbabav87fbabcijab87fbabcgjao87fbsfmaeavjgbaecnjabjgbaecijaojgbmalaicgwjavjgbalcobjakcewjhyaojgbayavjgialaicfjhicbzcgwjaojgbalcobjakcfjcbzcewjhyabjgbayaojgialaiamjcbzhicgwjabjgbalcobjakcgjcbzhkcewjhoavjgbaoabjgiakcfjrkaiatjriatatjrvsfmavcbam2bbhyyhtaoc/+f6hpjroaycbzrtgxgxaycirhmqbaocfjrbsfmaorbalaiamlcbzcgwj8ogbromgxgxatqbabcfjrvsfmabrvalaiaylcbzcgwj8ogbrbmgxgxap9fqbamcfjrysfmam1bfhycgfzrtgxgxayca9mqbamcgjrysfmam1bghycgbzcowatcgbzqrtgxayca9mqbamcejrysfmam1behycgbzcfwatqrtgxayca9mqbamcijrysfmam1bihycgbzcdwatqrtgxayca9mqbamcljrysfmamckjryam2blc8cwatqrtmatcfrcbatcfzl9zaqjhqrtmgxgxamcb6qbayrpsfmay1bbhmcgfzrogxgxamca9mqbaycfjrpsfmay1bfhmcgbzcowaocgbzqrogxamca9mqbaycgjrpsfmay1bghmcgbzcfwaoqrogxamca9mqbaycejrpsfmay1behmcgbzcdwaoqrogxamca9mqbaycijrpsfmaycljrpay2bic8cwaoqromaocfrcbaocfzl9zaqjhqromgxgxatcb6qbaprmsfmap1bbhmcgfzrbgxgxamca9mqbapcfjrmsfmap1bfhmcgbzcowabcgbzqrbgxamca9mqbapcgjrmsfmap1bghmcgbzcfwabqrbgxamca9mqbapcejrmsfmap1behmcgbzcdwabqrbgxamca9mqbapcijrmsfmapcljrmap2bic8cwabqrbmabcfrcbabcfzl9zaqjhqrbmgxgxagcg9hqbabat87fbabcijab87fbabcgjao87fbsfmaeatjgbaecnjabjgbaecijaojgbmalcobjakcewjhyaojgbayatjgialaicgwjatjgbalcobjakcfjcbzcewjhyabjgbayaojgialaicfjhicbzcgwjaojgbalcobjakcgjcbzcewjhoatjgbaoabjgialaiam9famcb6qjhicbzcgwjabjgbaiat9fatcb6qjriakcejrkmancfjrnabckjrbaecsjreakcbzrkaicbzriafcejhfaf9jqbmmcbc99amac6yrkmalcofj8kuuuubakm/tifga8juuuubctlrlc9+rkgxafcljai9lqbcarkae2bbc/+fzc/qf9hqbalhb83enaecfjrkaeaijc98jregxaf9fqbgxagcg6qbexgxakae9jqbc9+bmak1bbhgcgfzrigxgxagca9mqbakcfjrksfmak1bfhgcgbzcowaicgbzqrigxagca9mqbakcgjrksfmak1bghgcgbzcfwaiqrigxagca9mqbakcejrksfmak1behgcgbzcdwaiqrigxagca9mqbakcijrksfmak2bic8cwaiqriakcljrkmalcnjaicfzcgwqhgaicgrcbaicfrcfzl9zag8ogbjhijgbabaijgbabcijrbafcajhfqbsgmmexgxakae9jqbc9+bmak1bbhgcgfzrigxgxagca9mqbakcfjrksfmak1bfhgcgbzcowaicgbzqrigxagca9mqbakcgjrksfmak1bghgcgbzcfwaiqrigxagca9mqbakcejrksfmak1behgcgbzcdwaiqrigxagca9mqbakcijrksfmak2bic8cwaiqriakcljrkmabaicgrcbaicfrcfzl9zalcnjaicfzcgwqhi8ogbjhg87fbaiagjgbabcgjrbafcajhfqbmmcbc99akae6yrkmakm/dlek97faf97gxgxagci9hqbaf9fqfcbrgexababdbbbhecid+rfcid+sfd/6fhiaecnd+rfcid+sfd/6faid/gfaectd+rfcid+sfd/6fhld/gfd/kfd/lfhkcbdtd+2fhoaicuuuu94dthnd9od9rd/kfhi9dbb/+hdyaiaid/mfakakd/mfalaoaland9od9rd/kfhiaid/mfd/kfd/kfd/jfd/nfhld/mf9dbbx9ldyhod/kfcgfdtd9oaecuuu94dtd9od9qaiald/mfaod/kfcnd+rfcu/+edtd9od9qakald/mfaod/kfctd+rfcuu/8odtd9od9qdmbbabctjrbagcijhgaf9jqbsgmmaf9fqbcbrgexabctjhvavdbbbhecbdthocuu98d8cfcuu98d8cehnd9oabdbbbhkaedqilkosqfbpden8c8d8e8fcggfdtd9od/6fakaedqbfgenvcmttmyi8zpyhectd+sfd/6fhid/gfaectd+rfctd+sfd/6fhld/gfd/kfd/lfhe9db/+g6dyalaeaod+2fhoalcuuuu94dthcd9od9rd/kfhlald/mfaeaed/mfaiaoaiacd9od9rd/kfheaed/mfd/kfd/kfd/jfd/nfhid/mf9dbbx9ldyhod/kfctd+rfalaid/mfaod/kfcggedtd9od9qhlaeaid/mfaod/kfcadbcbdngcbdnecbdnkcbdnocbdnccbdnmcbdnfcbdnbd9ohedqnvi8zcmpysq8c8dfb8e8fd9qdmbbabakand9oalaedqbfttgemyilpdkoend9qdmbbabcajrbagcijhgaf9jqbmmm/heigaf97fal978juuuubctlregxaf9fqbcbriexaeabdbbbhlabctjhkdbbbhodqilkosqfbpden8c8d8e8fhnctd+sfhvcid+rfdmibab9dbbu8/dy9d/zi818/dyavcedtd9qd/6fd/nfhvalaodqbfgenvcmttmyi8zpyhlctd+rfctd+sfd/6fd/mfhoaod/mfavalctd+sfd/6fd/mfhcacd/mfavanctd+rfctd+sfd/6fd/mfhnand/mfd/kfd/kfd/lfcbdtd+4fd/jf9db/+g6dyhvd/mf9dbbx9ldyhld/kfcggedthmd9oacavd/mfald/kfctd+rfd9qhcanavd/mfald/kfctd+rfaoavd/mfald/kfamd9od9qhvdqbfttgemyilpdkoenhld8dbaedbibdyb+t+j83ebabcnjald8dfaedbibdyf+t+j83ebakacavdqnvi8zcmpysq8c8dfb8e8fhvd8dbaedbibdyg+t+j83ebabcijavd8dfaedbibdye+t+j83ebabcajrbaicijhiaf9jqbmmm9jff97gxagcgraf9shg9fqbcbrfexababdbbbhecnd+rfcnd+sfd/6faecid+sfcnd+rfcuuu/8edtd+ufd/mfdmbbabctjrbafcijhfag9jqbmmm9tfeacbcb8ogukuubhfabcejc98zjhbjgukuubgxgxab8/bctwhguqbcareabaglcggejctrxbca6qfmafremaemmmfbcunmit9tbb");let s=webassembly.instantiate(function(e){let n=new uint8array(e.length);for(let r=0;r96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let i=0;for(let a=0;a{(e=n.instance).exports.__wasm_call_ctors()});function o(n,r,i,a,s,o){let l=e.exports.sbrk,u=i+3&-4,c=l(u*a),h=l(s.length),d=new uint8array(e.exports.memory.buffer);d.set(s,h);let p=n(c,i,a,h,s.length);if(0===p&&o&&o(c,u,a),r.set(d.subarray(c,c+i*a)),l(c-l(0)),0!==p)throw error(`malformed buffer data: ${p}`)}let l={0:"",1:"meshopt_decodefilteroct",2:"meshopt_decodefilterquat",3:"meshopt_decodefilterexp",none:"",octahedral:"meshopt_decodefilteroct",quaternion:"meshopt_decodefilterquat",exponential:"meshopt_decodefilterexp"},u={0:"meshopt_decodevertexbuffer",1:"meshopt_decodeindexbuffer",2:"meshopt_decodeindexsequence",attributes:"meshopt_decodevertexbuffer",triangles:"meshopt_decodeindexbuffer",indices:"meshopt_decodeindexsequence"};return i={ready:s,supported:!0,decodevertexbuffer(n,r,i,a,s){o(e.exports.meshopt_decodevertexbuffer,n,r,i,a,e.exports[l[s]])},decodeindexbuffer(n,r,i,a){o(e.exports.meshopt_decodeindexbuffer,n,r,i,a)},decodeindexsequence(n,r,i,a){o(e.exports.meshopt_decodeindexsequence,n,r,i,a)},decodegltfbuffer(n,r,i,a,s,c){o(e.exports[u[s]],n,r,i,a,e.exports[l[c]])}}};class c extends a.loader{constructor(e){super(e),this.dracoloader=null,this.ktx2loader=null,this.meshoptdecoder=null,this.plugincallbacks=[],this.register(function(e){return new g(e)}),this.register(function(e){return new m(e)}),this.register(function(e){return new s(e)}),this.register(function(e){return new y(e)}),this.register(function(e){return new x(e)}),this.register(function(e){return new _(e)}),this.register(function(e){return new a(e)}),this.register(function(e){return new m(e)}),this.register(function(e){return new b(e)}),this.register(function(e){return new v(e)}),this.register(function(e){return new p(e)}),this.register(function(e){return new w(e)})}load(e,n,r,i){let s;let o=this;s=""!==this.resourcepath?this.resourcepath:""!==this.path?this.path:a.loaderutils.extracturlbase(e),this.manager.itemstart(e);let l=function(n){i?i(n):console.error(n),o.manager.itemerror(e),o.manager.itemend(e)},u=new a.fileloader(this.manager);u.setpath(this.path),u.setresponsetype("arraybuffer"),u.setrequestheader(this.requestheader),u.setwithcredentials(this.withcredentials),u.load(e,function(r){try{o.parse(r,s,function(r){n(r),o.manager.itemend(e)},l)}catch(e){l(e)}},r,l)}setdracoloader(e){return this.dracoloader=e,this}setddsloader(){throw error('three.gltfloader: "msft_texture_dds" no longer supported. please update to "khr_texture_basisu".')}setktx2loader(e){return this.ktx2loader=e,this}setmeshoptdecoder(e){return this.meshoptdecoder=e,this}register(e){return -1===this.plugincallbacks.indexof(e)&&this.plugincallbacks.push(e),this}unregister(e){return -1!==this.plugincallbacks.indexof(e)&&this.plugincallbacks.splice(this.plugincallbacks.indexof(e),1),this}parse(e,n,r,i){let s;let o={},l={};if("string"==typeof e)s=e;else{let n=a.loaderutils.decodetext(new uint8array(e,0,4));if(n===c){try{o[d.khr_binary_gltf]=new t(e)}catch(e){i&&i(e);return}s=o[d.khr_binary_gltf].content}else s=a.loaderutils.decodetext(new uint8array(e))}let u=json.parse(s);if(void 0===u.asset||u.asset.version[0]<2){i&&i(error("three.gltfloader: unsupported asset. gltf versions >=2.0 are supported."));return}let c=new q(u,{path:n||this.resourcepath||"",crossorigin:this.crossorigin,requestheader:this.requestheader,manager:this.manager,ktx2loader:this.ktx2loader,meshoptdecoder:this.meshoptdecoder});c.fileloader.setrequestheader(this.requestheader);for(let e=0;e=0&&void 0===l[n]&&console.warn('three.gltfloader: unknown extension "'+n+'".')}}c.setextensions(o),c.setplugins(l),c.parse(r,i)}parseasync(e,n){let r=this;return new promise(function(i,a){r.parse(e,n,i,a)})}}function h(){let e={};return{get:function(n){return e[n]},add:function(n,r){e[n]=r},remove:function(n){delete e[n]},removeall:function(){e={}}}}let d={khr_binary_gltf:"khr_binary_gltf",khr_draco_mesh_compression:"khr_draco_mesh_compression",khr_lights_punctual:"khr_lights_punctual",khr_materials_clearcoat:"khr_materials_clearcoat",khr_materials_ior:"khr_materials_ior",khr_materials_pbr_specular_glossiness:"khr_materials_pbrspecularglossiness",khr_materials_sheen:"khr_materials_sheen",khr_materials_specular:"khr_materials_specular",khr_materials_transmission:"khr_materials_transmission",khr_materials_iridescence:"khr_materials_iridescence",khr_materials_unlit:"khr_materials_unlit",khr_materials_volume:"khr_materials_volume",khr_texture_basisu:"khr_texture_basisu",khr_texture_transform:"khr_texture_transform",khr_mesh_quantization:"khr_mesh_quantization",khr_materials_emissive_strength:"khr_materials_emissive_strength",ext_texture_webp:"ext_texture_webp",ext_meshopt_compression:"ext_meshopt_compression"};class p{constructor(e){this.parser=e,this.name=d.khr_lights_punctual,this.cache={refs:{},uses:{}}}_markdefs(){let e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0))return null;throw error("three.gltfloader: setktx2loader must be called before loading ktx2 textures")}return n.loadtextureimage(e,a.source,s)}}class s{constructor(e){this.parser=e,this.name=d.ext_texture_webp,this.issupported=null}loadtexture(e){let n=this.name,r=this.parser,i=r.json,a=i.textures[e];if(!a.extensions||!a.extensions[n])return null;let s=a.extensions[n],o=i.images[s.source],l=r.textureloader;if(o.uri){let e=r.options.manager.gethandler(o.uri);null!==e&&(l=e)}return this.detectsupport().then(function(a){if(a)return r.loadtextureimage(e,s.source,l);if(i.extensionsrequired&&i.extensionsrequired.indexof(n)>=0)throw error("three.gltfloader: webp required by asset but unsupported.");return r.loadtexture(e)})}detectsupport(){return this.issupported||(this.issupported=new promise(function(e){let n=new image;n.src="data:image/webp;base64,uklgriiaaabxrujqvla4ibyaaaawaqcdasobaaeadsd+jaqaa3aaaaaa",n.onload=n.onerror=function(){e(1===n.height)}})),this.issupported}}class w{constructor(e){this.name=d.ext_meshopt_compression,this.parser=e}loadbufferview(e){let n=this.parser.json,r=n.bufferviews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],i=this.parser.getdependency("buffer",e.buffer),a=this.parser.options.meshoptdecoder;if(!a||!a.supported){if(!(n.extensionsrequired&&n.extensionsrequired.indexof(this.name)>=0))return null;throw error("three.gltfloader: setmeshoptdecoder must be called before loading compressed files")}return i.then(function(n){let r=e.byteoffset||0,i=e.bytelength||0,s=e.count,o=e.bytestride,l=new uint8array(n,r,i);return a.decodegltfbufferasync?a.decodegltfbufferasync(s,o,l,e.mode,e.filter).then(function(e){return e.buffer}):a.ready.then(function(){let n=new arraybuffer(s*o);return a.decodegltfbuffer(new uint8array(n),s,o,l,e.mode,e.filter),n})})}}}let c="gltf",e={json:1313821514,bin:5130562};class t{constructor(e){this.name=d.khr_binary_gltf,this.content=null,this.body=null;let n=new dataview(e,0,12);if(this.header={magic:a.loaderutils.decodetext(new uint8array(e.slice(0,4))),version:n.getuint32(4,!0),length:n.getuint32(8,!0)},this.header.magic!==c)throw error("three.gltfloader: unsupported gltf-binary header.");if(this.header.version<2)throw error("three.gltfloader: legacy binary file detected.");let r=this.header.length-12,i=new dataview(e,12),s=0;for(;s","#ifdef use_specularmap\n uniform sampler2d specularmap;\n#endif").replace("#include ","#ifdef use_glossinessmap\n uniform sampler2d glossinessmap;\n#endif").replace("#include ","vec3 specularfactor = specular;\n#ifdef use_specularmap\n vec4 texelspecular = texture2d( specularmap, vuv );\n // reads channel rgb, compatible with a gltf specular-glossiness (rgba) texture\n specularfactor *= texelspecular.rgb;\n#endif").replace("#include ","float glossinessfactor = glossiness;\n#ifdef use_glossinessmap\n vec4 texelglossiness = texture2d( glossinessmap, vuv );\n // reads channel a, compatible with a gltf specular-glossiness (rgba) texture\n glossinessfactor *= texelglossiness.a;\n#endif").replace("#include ","physicalmaterial material;\nmaterial.diffusecolor = diffusecolor.rgb * ( 1. - max( specularfactor.r, max( specularfactor.g, specularfactor.b ) ) );\nvec3 dxy = max( abs( dfdx( geometrynormal ) ), abs( dfdy( geometrynormal ) ) );\nfloat geometryroughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( 1.0 - glossinessfactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.roughness += geometryroughness;\nmaterial.roughness = min( material.roughness, 1.0 );\nmaterial.specularcolor = specularfactor;")},object.defineproperties(this,{specular:{get:function(){return n.specular.value},set:function(e){n.specular.value=e}},specularmap:{get:function(){return n.specularmap.value},set:function(e){n.specularmap.value=e,e?this.defines.use_specularmap="":delete this.defines.use_specularmap}},glossiness:{get:function(){return n.glossiness.value},set:function(e){n.glossiness.value=e}},glossinessmap:{get:function(){return n.glossinessmap.value},set:function(e){n.glossinessmap.value=e,e?(this.defines.use_glossinessmap="",this.defines.use_uv=""):(delete this.defines.use_glossinessmap,delete this.defines.use_uv)}}}),delete this.metalness,delete this.roughness,delete this.metalnessmap,delete this.roughnessmap,this.setvalues(e)}copy(e){return super.copy(e),this.specularmap=e.specularmap,this.specular.copy(e.specular),this.glossinessmap=e.glossinessmap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessmap,delete this.roughnessmap,this}}class l{constructor(){this.name=d.khr_materials_pbr_specular_glossiness,this.specularglossinessparams=["color","map","lightmap","lightmapintensity","aomap","aomapintensity","emissive","emissiveintensity","emissivemap","bumpmap","bumpscale","normalmap","normalmaptype","displacementmap","displacementscale","displacementbias","specularmap","specular","glossinessmap","glossiness","alphamap","envmap","envmapintensity","refractionratio"]}getmaterialtype(){return r}extendparams(e,n,r){let i=n.extensions[this.name];e.color=new a.color(1,1,1),e.opacity=1;let s=[];if(array.isarray(i.diffusefactor)){let n=i.diffusefactor;e.color.fromarray(n),e.opacity=n[3]}if(void 0!==i.diffusetexture&&s.push(r.assigntexture(e,"map",i.diffusetexture,a.srgbencoding)),e.emissive=new a.color(0,0,0),e.glossiness=void 0!==i.glossinessfactor?i.glossinessfactor:1,e.specular=new a.color(1,1,1),array.isarray(i.specularfactor)&&e.specular.fromarray(i.specularfactor),void 0!==i.specularglossinesstexture){let n=i.specularglossinesstexture;s.push(r.assigntexture(e,"glossinessmap",n)),s.push(r.assigntexture(e,"specularmap",n,a.srgbencoding))}return promise.all(s)}creatematerial(e){let n=new r(e);return n.fog=!0,n.color=e.color,n.map=void 0===e.map?null:e.map,n.lightmap=null,n.lightmapintensity=1,n.aomap=void 0===e.aomap?null:e.aomap,n.aomapintensity=1,n.emissive=e.emissive,n.emissiveintensity=void 0===e.emissiveintensity?1:e.emissiveintensity,n.emissivemap=void 0===e.emissivemap?null:e.emissivemap,n.bumpmap=void 0===e.bumpmap?null:e.bumpmap,n.bumpscale=1,n.normalmap=void 0===e.normalmap?null:e.normalmap,n.normalmaptype=a.tangentspacenormalmap,e.normalscale&&(n.normalscale=e.normalscale),n.displacementmap=null,n.displacementscale=1,n.displacementbias=0,n.specularmap=void 0===e.specularmap?null:e.specularmap,n.specular=e.specular,n.glossinessmap=void 0===e.glossinessmap?null:e.glossinessmap,n.glossiness=e.glossiness,n.alphamap=null,n.envmap=void 0===e.envmap?null:e.envmap,n.envmapintensity=1,n.refractionratio=.98,n}}class i{constructor(){this.name=d.khr_mesh_quantization}}class d extends a.interpolant{constructor(e,n,r,i){super(e,n,r,i)}copysamplevalue_(e){let n=this.resultbuffer,r=this.samplevalues,i=this.valuesize,a=e*i*3+i;for(let e=0;e!==i;e++)n[e]=r[a+e];return n}interpolate_(e,n,r,i){let a=this.resultbuffer,s=this.samplevalues,o=this.valuesize,l=2*o,u=3*o,c=i-n,h=(r-n)/c,d=h*h,p=d*h,f=e*u,m=f-u,g=-2*p+3*d,v=p-d,y=1-g,x=v-d+h;for(let e=0;e!==o;e++){let n=s[m+e+o],r=s[m+e+l]*c,i=s[f+e+o],u=s[f+e]*c;a[e]=y*n+x*r+g*i+v*u}return a}}let f=new a.quaternion;class o extends d{interpolate_(e,n,r,i){let a=super.interpolate_(e,n,r,i);return f.fromarray(a).normalize().toarray(a),a}}let n={float:5126,float_mat3:35675,float_mat4:35676,float_vec2:35664,float_vec3:35665,float_vec4:35666,linear:9729,repeat:10497,sampler_2d:35678,points:0,lines:1,line_loop:2,line_strip:3,triangles:4,triangle_strip:5,triangle_fan:6,unsigned_byte:5121,unsigned_short:5123},k={5120:int8array,5121:uint8array,5122:int16array,5123:uint16array,5125:uint32array,5126:float32array},h={9728:a.nearestfilter,9729:a.linearfilter,9984:a.nearestmipmapnearestfilter,9985:a.linearmipmapnearestfilter,9986:a.nearestmipmaplinearfilter,9987:a.linearmipmaplinearfilter},g={33071:a.clamptoedgewrapping,33648:a.mirroredrepeatwrapping,10497:a.repeatwrapping},u={scalar:1,vec2:2,vec3:3,vec4:4,mat2:4,mat3:9,mat4:16},z={position:"position",normal:"normal",tangent:"tangent",texcoord_0:"uv",texcoord_1:"uv2",color_0:"color",weights_0:"skinweight",joints_0:"skinindex"},v={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphtargetinfluences"},j={cubicspline:void 0,linear:a.interpolatelinear,step:a.interpolatediscrete},w={opaque:"opaque",mask:"mask",blend:"blend"};function j(e,n,r){for(let i in r.extensions)void 0===e[i]&&(n.userdata.gltfextensions=n.userdata.gltfextensions||{},n.userdata.gltfextensions[i]=r.extensions[i])}function x(e,n){void 0!==n.extras&&("object"==typeof n.extras?object.assign(e.userdata,n.extras):console.warn("three.gltfloader: ignoring primitive type .extras, "+n.extras))}function k(e){let n="",r=object.keys(e).sort();for(let i=0,a=r.length;i-1,l="undefined"!=typeof navigator&&o?null===(i=navigator.useragent)||void 0===i?void 0:i.match(/firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createimagebitmap||s||o&&l<98?this.textureloader=new a.textureloader(this.options.manager):this.textureloader=new a.imagebitmaploader(this.options.manager),this.textureloader.setcrossorigin(this.options.crossorigin),this.textureloader.setrequestheader(this.options.requestheader),this.fileloader=new a.fileloader(this.options.manager),this.fileloader.setresponsetype("arraybuffer"),"use-credentials"===this.options.crossorigin&&this.fileloader.setwithcredentials(!0)}setextensions(e){this.extensions=e}setplugins(e){this.plugins=e}parse(e,n){let r=this,i=this.json,a=this.extensions;this.cache.removeall(),this._invokeall(function(e){return e._markdefs&&e._markdefs()}),promise.all(this._invokeall(function(e){return e.beforeroot&&e.beforeroot()})).then(function(){return promise.all([r.getdependencies("scene"),r.getdependencies("animation"),r.getdependencies("camera")])}).then(function(n){let s={scene:n[0][i.scene||0],scenes:n[0],animations:n[1],cameras:n[2],asset:i.asset,parser:r,userdata:{}};j(a,s,i),x(s,i),promise.all(r._invokeall(function(e){return e.afterroot&&e.afterroot(s)})).then(function(){e(s)})}).catch(n)}_markdefs(){let e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let r=0,i=n.length;r{let r=this.associations.get(e);for(let[i,s]of(null!=r&&this.associations.set(n,r),e.children.entries()))a(s,n.children[i])};return a(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeone(e){let n=object.values(this.plugins);n.push(this);for(let r=0;r=2&&o.sety(n,p[e*u+1]),u>=3&&o.setz(n,p[e*u+2]),u>=4&&o.setw(n,p[e*u+3]),u>=5)throw error("three.gltfloader: unsupported itemsize in sparse bufferattribute.")}}return o})}loadtexture(e){let n=this.json,r=this.options,i=n.textures[e],a=i.source,s=n.images[a],o=this.textureloader;if(s.uri){let e=r.manager.gethandler(s.uri);null!==e&&(o=e)}return this.loadtextureimage(e,a,o)}loadtextureimage(e,n,r){let i=this,s=this.json,o=s.textures[e],l=s.images[n],u=(l.uri||l.bufferview)+":"+o.sampler;if(this.texturecache[u])return this.texturecache[u];let c=this.loadimagesource(n,r).then(function(n){n.flipy=!1,o.name&&(n.name=o.name);let r=s.samplers||{},l=r[o.sampler]||{};return n.magfilter=h[l.magfilter]||a.linearfilter,n.minfilter=h[l.minfilter]||a.linearmipmaplinearfilter,n.wraps=g[l.wraps]||a.repeatwrapping,n.wrapt=g[l.wrapt]||a.repeatwrapping,i.associations.set(n,{textures:e}),n}).catch(function(){return null});return this.texturecache[u]=c,c}loadimagesource(e,n){let r=this.json,i=this.options;if(void 0!==this.sourcecache[e])return this.sourcecache[e].then(e=>e.clone());let s=r.images[e],o=self.url||self.webkiturl,l=s.uri||"",u=!1;if(void 0!==s.bufferview)l=this.getdependency("bufferview",s.bufferview).then(function(e){u=!0;let n=new blob([e],{type:s.mimetype});return l=o.createobjecturl(n)});else if(void 0===s.uri)throw error("three.gltfloader: image "+e+" is missing uri and bufferview");let c=promise.resolve(l).then(function(e){return new promise(function(r,s){let o=r;!0===n.isimagebitmaploader&&(o=function(e){let n=new a.texture(e);n.needsupdate=!0,r(n)}),n.load(a.loaderutils.resolveurl(e,i.path),o,void 0,s)})}).then(function(e){var n;return!0===u&&o.revokeobjecturl(l),e.userdata.mimetype=s.mimetype||((n=s.uri).search(/\.jpe?g($|\?)/i)>0||0===n.search(/^data\:image\/jpeg/)?"image/jpeg":n.search(/\.webp($|\?)/i)>0||0===n.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("three.gltfloader: couldn't load texture",l),e});return this.sourcecache[e]=c,c}assigntexture(e,n,r,i){let a=this;return this.getdependency("texture",r.index).then(function(s){if(void 0===r.texcoord||0==r.texcoord||"aomap"===n&&1==r.texcoord||console.warn("three.gltfloader: custom uv set "+r.texcoord+" for texture "+n+" not yet supported."),a.extensions[d.khr_texture_transform]){let e=void 0!==r.extensions?r.extensions[d.khr_texture_transform]:void 0;if(e){let n=a.associations.get(s);s=a.extensions[d.khr_texture_transform].extendtexture(s,e),a.associations.set(s,n)}}return void 0!==i&&(s.encoding=i),e[n]=s,s})}assignfinalmaterial(e){let n=e.geometry,r=e.material,i=void 0===n.attributes.tangent,s=void 0!==n.attributes.color,o=void 0===n.attributes.normal;if(e.ispoints){let e="pointsmaterial:"+r.uuid,n=this.cache.get(e);n||(n=new a.pointsmaterial,a.material.prototype.copy.call(n,r),n.color.copy(r.color),n.map=r.map,n.sizeattenuation=!1,this.cache.add(e,n)),r=n}else if(e.isline){let e="linebasicmaterial:"+r.uuid,n=this.cache.get(e);n||(n=new a.linebasicmaterial,a.material.prototype.copy.call(n,r),n.color.copy(r.color),this.cache.add(e,n)),r=n}if(i||s||o){let e="clonedmaterial:"+r.uuid+":";r.isgltfspecularglossinessmaterial&&(e+="specular-glossiness:"),i&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),o&&(e+="flat-shading:");let n=this.cache.get(e);n||(n=r.clone(),s&&(n.vertexcolors=!0),o&&(n.flatshading=!0),i&&(n.normalscale&&(n.normalscale.y*=-1),n.clearcoatnormalscale&&(n.clearcoatnormalscale.y*=-1)),this.cache.add(e,n),this.associations.set(n,this.associations.get(r))),r=n}r.aomap&&void 0===n.attributes.uv2&&void 0!==n.attributes.uv&&n.setattribute("uv2",n.attributes.uv),e.material=r}getmaterialtype(){return a.meshstandardmaterial}loadmaterial(e){let n;let r=this,i=this.json,s=this.extensions,o=i.materials[e],l={},u=o.extensions||{},c=[];if(u[d.khr_materials_pbr_specular_glossiness]){let e=s[d.khr_materials_pbr_specular_glossiness];n=e.getmaterialtype(),c.push(e.extendparams(l,o,r))}else if(u[d.khr_materials_unlit]){let e=s[d.khr_materials_unlit];n=e.getmaterialtype(),c.push(e.extendparams(l,o,r))}else{let i=o.pbrmetallicroughness||{};if(l.color=new a.color(1,1,1),l.opacity=1,array.isarray(i.basecolorfactor)){let e=i.basecolorfactor;l.color.fromarray(e),l.opacity=e[3]}void 0!==i.basecolortexture&&c.push(r.assigntexture(l,"map",i.basecolortexture,a.srgbencoding)),l.metalness=void 0!==i.metallicfactor?i.metallicfactor:1,l.roughness=void 0!==i.roughnessfactor?i.roughnessfactor:1,void 0!==i.metallicroughnesstexture&&(c.push(r.assigntexture(l,"metalnessmap",i.metallicroughnesstexture)),c.push(r.assigntexture(l,"roughnessmap",i.metallicroughnesstexture))),n=this._invokeone(function(n){return n.getmaterialtype&&n.getmaterialtype(e)}),c.push(promise.all(this._invokeall(function(n){return n.extendmaterialparams&&n.extendmaterialparams(e,l)})))}!0===o.doublesided&&(l.side=a.doubleside);let h=o.alphamode||w.opaque;if(h===w.blend?(l.transparent=!0,l.depthwrite=!1):(l.transparent=!1,h===w.mask&&(l.alphatest=void 0!==o.alphacutoff?o.alphacutoff:.5)),void 0!==o.normaltexture&&n!==a.meshbasicmaterial&&(c.push(r.assigntexture(l,"normalmap",o.normaltexture)),l.normalscale=new a.vector2(1,1),void 0!==o.normaltexture.scale)){let e=o.normaltexture.scale;l.normalscale.set(e,e)}return void 0!==o.occlusiontexture&&n!==a.meshbasicmaterial&&(c.push(r.assigntexture(l,"aomap",o.occlusiontexture)),void 0!==o.occlusiontexture.strength&&(l.aomapintensity=o.occlusiontexture.strength)),void 0!==o.emissivefactor&&n!==a.meshbasicmaterial&&(l.emissive=new a.color().fromarray(o.emissivefactor)),void 0!==o.emissivetexture&&n!==a.meshbasicmaterial&&c.push(r.assigntexture(l,"emissivemap",o.emissivetexture,a.srgbencoding)),promise.all(c).then(function(){let i;return i=n===r?s[d.khr_materials_pbr_specular_glossiness].creatematerial(l):new n(l),o.name&&(i.name=o.name),x(i,o),r.associations.set(i,{materials:e}),o.extensions&&j(s,i,o),i})}createuniquename(e){let n=a.propertybinding.sanitizenodename(e||""),r=n;for(let e=1;this.nodenamesused[r];++e)r=n+"_"+e;return this.nodenamesused[r]=!0,r}loadgeometries(e){let n=this,r=this.extensions,i=this.primitivecache,s=[];for(let o=0,l=e.length;o0&&function(e,n){if(e.updatemorphtargets(),void 0!==n.weights)for(let r=0,i=n.weights.length;r1?new a.group:1===n.length?n[0]:new a.object3d)!==n[0])for(let e=0,r=n.length;e{let n=new map;for(let[e,r]of s.associations)(e instanceof a.material||e instanceof a.texture)&&n.set(e,r);return e.traverse(e=>{let r=s.associations.get(e);null!=r&&n.set(e,r)}),n})(o),o})}}function q(e,n,r){let i=n.attributes,s=[];for(let n in i){let a=z[n]||n.tolowercase();a in e.attributes||s.push(function(n,i){return r.getdependency("accessor",n).then(function(n){e.setattribute(i,n)})}(i[n],a))}if(void 0!==n.indices&&!e.index){let i=r.getdependency("accessor",n.indices).then(function(n){e.setindex(n)});s.push(i)}return x(e,n),!function(e,n,r){let i=n.attributes,s=new a.box3;if(void 0===i.position)return;{let e=r.json.accessors[i.position],n=e.min,o=e.max;if(void 0!==n&&void 0!==o){if(s.set(new a.vector3(n[0],n[1],n[2]),new a.vector3(o[0],o[1],o[2])),e.normalized){let n=y(k[e.componenttype]);s.min.multiplyscalar(n),s.max.multiplyscalar(n)}}else{console.warn("three.gltfloader: missing min/max properties for accessor position.");return}}let o=n.targets;if(void 0!==o){let e=new a.vector3,n=new a.vector3;for(let i=0,a=o.length;i{r&&r(i),e&&(ee||(ee=new o),ee.setdecoderpath("string"==typeof e?e:"https://www.gstatic.com/draco/versioned/decoders/1.5.5/"),i.setdracoloader(ee)),n&&i.setmeshoptdecoder("function"==typeof u?u():u)}}function en(e,n=!0,r=!0,i){let a=(0,$.d)(c,e,et(n,r,i));return a}en.preload=(e,n=!0,r=!0,i)=>$.d.preload(c,e,et(n,r,i)),en.clear=e=>$.d.clear(c,e)},4251:function(e,n,r){"use strict";let i,a,s;r.d(n,{a:function(){return eo},b:function(){return t},d:function(){return eu},e:function(){return b},a:function(){return ev},b:function(){return c},c:function(){return x},d:function(){return ex},e:function(){return y},i:function(){return w},u:function(){return e},z:function(){return es}});var o,l,u=r(9477),c=r(7294),h=r(2576);let d="undefined"==typeof window||!window.navigator||/serversiderendering|^deno\//.test(window.navigator.useragent),p=d?c.useeffect:c.uselayouteffect;var f=r(6525),m=r.n(f),g=r(5431);function v(e,n,r=(e,n)=>e===n){if(e===n)return!0;if(!e||!n)return!1;let i=e.length;if(n.length!==i)return!1;for(let a=0;aa.response=e).then(()=>{i.lifespan&&i.lifespan>0&&settimeout(()=>{let e=y.indexof(a);-1!==e&&y.splice(e,1)},i.lifespan)}).catch(e=>a.error=e)};if(y.push(a),!r)throw a.promise}let _=(e,n,r)=>x(e,n,!1,r),a=(e,n,r)=>void x(e,n,!0,r),b=e=>{if(void 0===e||0===e.length)y.splice(0,y.length);else{let n=y.find(n=>v(e,n.keys,n.equal));if(n){let e=y.indexof(n);-1!==e&&y.splice(e,1)}}},m=((e,...n)=>n.reduce((e,n)=>null==e?void 0:e[n],e))(u,"colormanagement")||null,s=e=>e&&e.isorthographiccamera,w=e=>e&&e.hasownproperty("current"),c="undefined"!=typeof window&&(null!=(o=window.document)&&o.createelement||(null==(l=window.navigator)?void 0:l.product)==="reactnative")?c.uselayouteffect:c.useeffect;function e(e){let n=c.useref(e);return c(()=>void(n.current=e),[e]),n}function t({set:e}){return c(()=>(e(new promise(()=>null)),()=>e(!1)),[e]),null}class b extends c.component{constructor(...e){super(...e),this.state={error:!1}}componentdidcatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}b.getderivedstatefromerror=()=>({error:!0});let p="__default",r=new map,l=e=>e&&!!e.memoized&&!!e.changes;function i(e){let n="undefined"!=typeof window?window.devicepixelratio:1;return array.isarray(e)?math.min(math.max(e[0],n),e[1]):e}let d=e=>{var n;return null==(n=e.__r3f)?void 0:n.root.getstate()},f={obj:e=>e===object(e)&&!f.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,boo:e=>"boolean"==typeof e,und:e=>void 0===e,arr:e=>array.isarray(e),equ(e,n,{arrays:r="shallow",objects:i="reference",strict:a=!0}={}){let s;if(typeof e!=typeof n||!!e!=!!n)return!1;if(f.str(e)||f.num(e))return e===n;let o=f.obj(e);if(o&&"reference"===i)return e===n;let l=f.arr(e);if(l&&"reference"===r)return e===n;if((l||o)&&e===n)return!0;for(s in e)if(!(s in n))return!1;for(s in a?n:e)if(e[s]!==n[s])return!1;if(f.und(s)){if(l&&0===e.length&&0===n.length||o&&0===object.keys(e).length&&0===object.keys(n).length)return!0;if(e!==n)return!1}return!0}};function o(e,n){let r=e;return(null!=n&&n.primitive||!r.__r3f)&&(r.__r3f={type:"",root:null,previousattach:null,memoizedprops:{},eventcount:0,handlers:{},objects:[],parent:null,...n}),e}function n(e,n){let r=e;if(!n.includes("-"))return{target:r,key:n};{let i=n.split("-"),a=i.pop();return{target:r=i.reduce((e,n)=>e[n],e),key:a}}}let k=/-\d+$/;function h(e,n,r){if(f.str(r)){if(k.test(r)){let n=r.replace(k,""),{target:i,key:a}=n(e,n);array.isarray(i[a])||(i[a]=[])}let{target:i,key:a}=n(e,r);n.__r3f.previousattach=i[a],i[a]=n}else n.__r3f.previousattach=r(e,n)}function g(e,n,r){var i,a;if(f.str(r)){let{target:i,key:a}=n(e,r),s=n.__r3f.previousattach;void 0===s?delete i[a]:i[a]=s}else null==(i=n.__r3f)||null==i.previousattach||i.previousattach(e,n);null==(a=n.__r3f)||delete a.previousattach}function u(e,{children:n,key:r,ref:i,...a},{children:s,key:o,ref:l,...u}={},c=!1){var h;let d=null!=(h=null==e?void 0:e.__r3f)?h:{},p=object.entries(a),f=[];if(c){let e=object.keys(u);for(let n=0;n{var i;if(null!=(i=e.__r3f)&&i.primitive&&"object"===n||f.equ(r,u[n]))return;if(/^on(pointer|click|doubleclick|contextmenu|wheel)/.test(n))return f.push([n,r,!0,[]]);let s=[];for(let e in n.includes("-")&&(s=n.split("-")),f.push([n,r,!1,s]),a){let r=a[e];e.startswith(`${n}-`)&&f.push([e,r,!1,e.split("-")])}});let m={...a};return d.memoizedprops&&d.memoizedprops.args&&(m.args=d.memoizedprops.args),d.memoizedprops&&d.memoizedprops.attach&&(m.attach=d.memoizedprops.attach),{memoized:m,changes:f}}function z(e,n){var r,i,a;let s=null!=(r=e.__r3f)?r:{},o=s.root,l=null!=(i=null==o?void 0:null==o.getstate?void 0:o.getstate())?i:{},{memoized:c,changes:h}=l(n)?n:u(e,n),d=s.eventcount;e.__r3f&&(e.__r3f.memoizedprops=c);for(let n=0;ne[n],e))&&d.set)){let[n,...i]=o.reverse();c=i.reverse().reduce((e,n)=>e[n],e),r=n}if(i===p+"remove"){if(c.constructor){let e=r.get(c.constructor);e||(e=new c.constructor,r.set(c.constructor,e)),i=e[r]}else i=0}if(a)i?s.handlers[r]=i:delete s.handlers[r],s.eventcount=object.keys(s.handlers).length;else if(d&&d.set&&(d.copy||d instanceof u.layers)){if(array.isarray(i))d.fromarray?d.fromarray(i):d.set(...i);else if(d.copy&&i&&i.constructor&&d.constructor===i.constructor)d.copy(i);else if(void 0!==i){let e=d instanceof u.color;!e&&d.setscalar?d.setscalar(i):d instanceof u.layers&&i instanceof u.layers?d.mask=i.mask:d.set(i),m||l.linear||!e||d.convertsrgbtolinear()}}else c[r]=i,!l.linear&&c[r]instanceof u.texture&&c[r].format===u.rgbaformat&&c[r].type===u.unsignedbytetype&&(c[r].encoding=u.srgbencoding);v(e)}if(s.parent&&l.internal&&e.raycast&&d!==s.eventcount){let n=l.internal.interaction.indexof(e);n>-1&&l.internal.interaction.splice(n,1),s.eventcount&&l.internal.interaction.push(e)}let p=1===h.length&&"onupdate"===h[0][0];return!p&&h.length&&null!=(a=e.__r3f)&&a.parent&&j(e),e}function v(e){var n,r;let i=null==(n=e.__r3f)?void 0:null==(r=n.root)?void 0:null==r.getstate?void 0:r.getstate();i&&0===i.internal.frames&&i.invalidate()}function j(e){null==e.onupdate||e.onupdate(e)}function w(e){return(e.eventobject||e.object).uuid+"/"+e.index+e.instanceid}function j(e,n,r,i){let a=r.get(n);a&&(r.delete(n),0===r.size&&(e.delete(i),a.target.releasepointercapture(i)))}function x(e){function n(e){return e.filter(e=>["move","over","enter","out","leave"].some(n=>{var r;return null==(r=e.__r3f)?void 0:r.handlers["onpointer"+n]}))}function r(n){let{internal:r}=e.getstate();for(let e of r.hovered.values())if(!n.length||!n.find(n=>n.object===e.object&&n.index===e.index&&n.instanceid===e.instanceid)){let i=e.eventobject,a=i.__r3f,s=null==a?void 0:a.handlers;if(r.hovered.delete(w(e)),null!=a&&a.eventcount){let r={...e,intersections:n};null==s.onpointerout||s.onpointerout(r),null==s.onpointerleave||s.onpointerleave(r)}}}function i(e,n){for(let r=0;rr([]);case"onlostpointercapture":return n=>{let{internal:i}=e.getstate();"pointerid"in n&&i.capturedmap.has(n.pointerid)&&(i.capturedmap.delete(n.pointerid),r([]))}}return function(s){let{onpointermissed:o,internal:l}=e.getstate();l.lastevent.current=s;let c="onpointermove"===a,h="onclick"===a||"oncontextmenu"===a||"ondoubleclick"===a,d=function(n,r){let i=e.getstate(),a=new set,s=[],o=r?r(i.internal.interaction):i.internal.interaction;for(let e=0;e{let r=d(e.object),i=d(n.object);return r&&i&&i.events.priority-r.events.priority||e.distance-n.distance}).filter(e=>{let n=w(e);return!a.has(n)&&(a.add(n),!0)});for(let e of(i.events.filter&&(l=i.events.filter(l,i)),l)){let n=e.object;for(;n;){var u;null!=(u=n.__r3f)&&u.eventcount&&s.push({...e,eventobject:n}),n=n.parent}}if("pointerid"in n&&i.internal.capturedmap.has(n.pointerid))for(let e of i.internal.capturedmap.get(n.pointerid).values())a.has(w(e.intersection))||s.push(e.intersection);return s}(s,c?n:void 0),p=h?function(n){let{internal:r}=e.getstate(),i=n.offsetx-r.initialclick[0],a=n.offsety-r.initialclick[1];return math.round(math.sqrt(i*i+a*a))}(s):0;"onpointerdown"===a&&(l.initialclick=[s.offsetx,s.offsety],l.initialhits=d.map(e=>e.eventobject)),h&&!d.length&&p<=2&&(i(s,l.interaction),o&&o(s)),c&&r(d),function(n,i,a,s){let o=e.getstate();if(n.length){let e={stopped:!1};for(let l of n){let c=d(l.object)||o,{raycaster:h,pointer:d,camera:p,internal:f}=c,m=new u.vector3(d.x,d.y,0).unproject(p),g=e=>{var n,r;return null!=(n=null==(r=f.capturedmap.get(e))?void 0:r.has(l.eventobject))&&n},v=e=>{let n={intersection:l,target:i.target};f.capturedmap.has(e)?f.capturedmap.get(e).set(l.eventobject,n):f.capturedmap.set(e,new map([[l.eventobject,n]])),i.target.setpointercapture(e)},y=e=>{let n=f.capturedmap.get(e);n&&j(f.capturedmap,l.eventobject,n,e)},x={};for(let e in i){let n=i[e];"function"!=typeof n&&(x[e]=n)}let _={...l,...x,pointer:d,intersections:n,stopped:e.stopped,delta:a,unprojectedpoint:m,ray:h.ray,camera:p,stoppropagation(){let a="pointerid"in i&&f.capturedmap.get(i.pointerid);if((!a||a.has(l.eventobject))&&(_.stopped=e.stopped=!0,f.hovered.size&&array.from(f.hovered.values()).find(e=>e.eventobject===l.eventobject))){let e=n.slice(0,n.indexof(l));r([...e,l])}},target:{haspointercapture:g,setpointercapture:v,releasepointercapture:y},currenttarget:{haspointercapture:g,setpointercapture:v,releasepointercapture:y},nativeevent:i};if(s(_),!0===e.stopped)break}}}(d,s,p,function(e){let n=e.eventobject,r=n.__r3f,o=null==r?void 0:r.handlers;if(null!=r&&r.eventcount){if(c){if(o.onpointerover||o.onpointerenter||o.onpointerout||o.onpointerleave){let n=w(e),r=l.hovered.get(n);r?r.stopped&&e.stoppropagation():(l.hovered.set(n,e),null==o.onpointerover||o.onpointerover(e),null==o.onpointerenter||o.onpointerenter(e))}null==o.onpointermove||o.onpointermove(e)}else{let r=o[a];r?(!h||l.initialhits.includes(n))&&(i(s,l.interaction.filter(e=>!l.initialhits.includes(e))),r(e)):h&&l.initialhits.includes(n)&&i(s,l.interaction.filter(e=>!l.initialhits.includes(e)))}}})}}}}let k={},y=e=>void(k={...k,...e}),q=e=>!!(null!=e&&e.render),q=c.createcontext(null),z=(e,n)=>{let r=function(e){let n="function"==typeof e?function(e){let n;let r=new set,i=(e,i)=>{let a="function"==typeof e?e(n):e;if(a!==n){let e=n;n=i?a:object.assign({},n,a),r.foreach(r=>r(n,e))}},a=()=>n,s=(e,i=a,s=object.is)=>{console.warn("[deprecated] please use `subscribewithselector` middleware");let o=i(n);function l(){let r=i(n);if(!s(o,r)){let n=o;e(o=r,n)}}return r.add(l),()=>r.delete(l)},o=(e,n,i)=>n||i?s(e,n,i):(r.add(e),()=>r.delete(e)),l=()=>r.clear(),u={setstate:i,getstate:a,subscribe:o,destroy:l};return n=e(i,a,u),u}(e):e,r=(e=n.getstate,r=object.is)=>{let i;let[,a]=(0,c.usereducer)(e=>e+1,0),s=n.getstate(),o=(0,c.useref)(s),l=(0,c.useref)(e),u=(0,c.useref)(r),h=(0,c.useref)(!1),d=(0,c.useref)();void 0===d.current&&(d.current=e(s));let f=!1;(o.current!==s||l.current!==e||u.current!==r||h.current)&&(i=e(s),f=!r(d.current,i)),p(()=>{f&&(d.current=i),o.current=s,l.current=e,u.current=r,h.current=!1});let m=(0,c.useref)(s);p(()=>{let e=()=>{try{let e=n.getstate(),r=l.current(e);u.current(d.current,r)||(o.current=e,d.current=r,a())}catch(e){h.current=!0,a()}},r=n.subscribe(e);return n.getstate()!==m.current&&e(),r},[]);let g=f?i:d.current;return(0,c.usedebugvalue)(g),g};return object.assign(r,n),r[symbol.iterator]=function(){console.warn("[usestore, api] = create() is deprecated and will be removed in v4");let e=[r,n];return{next(){let n=e.length<=0;return{value:e.shift(),done:n}}}},r}((r,i)=>{let a;let s=new u.vector3,o=new u.vector3,l=new u.vector3;function h(e=i().camera,n=o,r=i().size){let{width:a,height:c,top:h,left:d}=r,p=a/c;n instanceof u.vector3?l.copy(n):l.set(...n);let f=e.getworldposition(s).distanceto(l);if(s(e))return{width:a/e.zoom,height:c/e.zoom,top:h,left:d,factor:1,distance:f,aspect:p};{let n=e.fov*math.pi/180,r=2*math.tan(n/2)*f,i=r*(a/c);return{width:i,height:r,top:h,left:d,factor:a/i,distance:f,aspect:p}}}let d=e=>r(n=>({performance:{...n.performance,current:e}})),p=new u.vector2,f={set:r,get:i,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,invalidate:(n=1)=>e(i(),n),advance:(e,r)=>n(e,r,i()),legacy:!1,linear:!1,flat:!1,scene:o(new u.scene),controls:null,clock:new u.clock,pointer:p,mouse:p,frameloop:"always",onpointermissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=i();a&&cleartimeout(a),e.performance.current!==e.performance.min&&d(e.performance.min),a=settimeout(()=>d(i().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updatestyle:!1},viewport:{initialdpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getcurrentviewport:h},setevents:e=>r(n=>({...n,events:{...n.events,...e}})),setsize:(e,n,a,s,l)=>{let u=i().camera,c={width:e,height:n,top:s||0,left:l||0,updatestyle:a};r(e=>({size:c,viewport:{...e.viewport,...h(u,o,c)}}))},setdpr:e=>r(n=>{let r=i(e);return{viewport:{...n.viewport,dpr:r,initialdpr:n.viewport.initialdpr||r}}}),setframeloop:(e="always")=>{let n=i().clock;n.stop(),n.elapsedtime=0,"never"!==e&&(n.start(),n.elapsedtime=0),r(()=>({frameloop:e}))},previousroot:void 0,internal:{active:!1,priority:0,frames:0,lastevent:c.createref(),interaction:[],hovered:new map,subscribers:[],initialclick:[0,0],initialhits:[],capturedmap:new map,subscribe:(e,n,r)=>{let a=i().internal;return a.priority=a.priority+(n>0?1:0),a.subscribers.push({ref:e,priority:n,store:r}),a.subscribers=a.subscribers.sort((e,n)=>e.priority-n.priority),()=>{let r=i().internal;null!=r&&r.subscribers&&(r.priority=r.priority-(n>0?1:0),r.subscribers=r.subscribers.filter(n=>n.ref!==e))}}}};return f}),i=r.getstate(),a=i.size,s=i.viewport.dpr,o=i.camera;return r.subscribe(()=>{let{camera:e,size:n,viewport:i,gl:l,set:u}=r.getstate();if(n!==a||i.dpr!==s){var c,h;a=n,s=i.dpr,(h=e).manual||(s(h)?(h.left=-(n.width/2),h.right=n.width/2,h.top=n.height/2,h.bottom=-(n.height/2)):h.aspect=n.width/n.height,h.updateprojectionmatrix(),h.updatematrixworld()),l.setpixelratio(i.dpr);let r=null!=(c=n.updatestyle)?c:"undefined"!=typeof htmlcanvaselement&&l.domelement instanceof htmlcanvaselement;l.setsize(n.width,n.height,r)}e!==o&&(o=e,u(n=>({viewport:{...n.viewport,...n.viewport.getcurrentviewport(e)}})))}),r.subscribe(n=>e(n)),r},$=new set,ee=new set,et=new set;function en(e,n){if(e.size)for(let{callback:r}of e.values())r(n)}function er(e,n){switch(e){case"before":return en($,n);case"after":return en(ee,n);case"tail":return en(et,n)}}function ei(e,n,r){let o=n.clock.getdelta();for("never"===n.frameloop&&"number"==typeof e&&(o=e-n.clock.elapsedtime,n.clock.oldtime=n.clock.elapsedtime,n.clock.elapsedtime=e),a=n.internal.subscribers,i=0;ie,n){return ea()(e,n)}function eo(e,n=0){let r=ea(),i=r.getstate().internal.subscribe,a=e(e);return c(()=>i(a,n,r),[n,i,r]),null}function el(e,n){return function(r,...i){let a=new r;return e&&e(a),promise.all(i.map(e=>new promise((r,i)=>a.load(e,e=>{e.scene&&object.assign(e,function(e){let n={nodes:{},materials:{}};return e&&e.traverse(e=>{e.name&&(n.nodes[e.name]=e),e.material&&!n.materials[e.material.name]&&(n.materials[e.material.name]=e.material)}),n}(e.scene)),r(e)},n,n=>i(error(`could not load ${e}: ${n.message})`))))))}}function eu(e,n,r,i){let a=array.isarray(n)?n:[n],s=_(el(r,i),[e,...a],{equal:f.equ});return array.isarray(n)?s:s[0]}eu.preload=function(e,n,r){let i=array.isarray(n)?n:[n];return a(el(r),[e,...i])},eu.clear=function(e,n){let r=array.isarray(n)?n:[n];return b([e,...r])};let ec=new map,{invalidate:eh,advance:ed}=function(e){let n,r,i,a=!1;function s(o){for(let u of(r=requestanimationframe(s),a=!0,n=0,er("before",o),e.values())){var l;(i=u.store.getstate()).internal.active&&("always"===i.frameloop||i.internal.frames>0)&&!(null!=(l=i.gl.xr)&&l.ispresenting)&&(n+=ei(o,i))}if(er("after",o),0===n)return er("tail",o),a=!1,cancelanimationframe(r)}return{loop:s,invalidate:function n(r,i=1){var o;if(!r)return e.foreach(e=>n(e.store.getstate()),i);null!=(o=r.gl.xr)&&o.ispresenting||!r.internal.active||"never"===r.frameloop||(r.internal.frames=math.min(60,r.internal.frames+i),a||(a=!0,requestanimationframe(s)))},advance:function(n,r=!0,i,a){if(r&&er("before",n),i)ei(n,i,a);else for(let r of e.values())ei(n,r.store.getstate());r&&er("after",n)}}}(ec),{reconciler:ep,applyprops:ef}=function(e,n){function r(e,{args:n=[],attach:r,...i},a){let s,o=`${e[0].touppercase()}${e.slice(1)}`;if("primitive"===e){if(void 0===i.object)throw error("r3f: primitives without 'object' are invalid!");let n=i.object;s=o(n,{type:e,root:a,attach:r,primitive:!0})}else{let i=k[o];if(!i)throw error(`r3f: ${o} is not part of the three namespace! did you forget to extend? see: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!array.isarray(n))throw error("r3f: the args prop must be an array!");s=o(new i(...n),{type:e,root:a,attach:r,memoizedprops:{args:n}})}return void 0===s.__r3f.attach&&(s instanceof u.buffergeometry?s.__r3f.attach="geometry":s instanceof u.material&&(s.__r3f.attach="material")),"inject"!==o&&z(s,i),s}function i(e,n){let r=!1;if(n){var i,a;null!=(i=n.__r3f)&&i.attach?h(e,n,n.__r3f.attach):n.isobject3d&&e.isobject3d&&(e.add(n),r=!0),r||null==(a=e.__r3f)||a.objects.push(n),n.__r3f||o(n,{}),n.__r3f.parent=e,j(n),v(n)}}function a(e,n,r){let i=!1;if(n){var a,s;if(null!=(a=n.__r3f)&&a.attach)h(e,n,n.__r3f.attach);else if(n.isobject3d&&e.isobject3d){n.parent=e,n.dispatchevent({type:"added"});let a=e.children.filter(e=>e!==n),s=a.indexof(r);e.children=[...a.slice(0,s),n,...a.slice(s)],i=!0}i||null==(s=e.__r3f)||s.objects.push(n),n.__r3f||o(n,{}),n.__r3f.parent=e,j(n),v(n)}}function s(e,n,r=!1){e&&[...e].foreach(e=>o(n,e,r))}function o(e,n,r){if(n){var i,a,o,l,u;n.__r3f&&(n.__r3f.parent=null),null!=(i=e.__r3f)&&i.objects&&(e.__r3f.objects=e.__r3f.objects.filter(e=>e!==n)),null!=(a=n.__r3f)&&a.attach?g(e,n,n.__r3f.attach):n.isobject3d&&e.isobject3d&&(e.remove(n),null!=(l=n.__r3f)&&l.root&&function(e,n){let{internal:r}=e.getstate();r.interaction=r.interaction.filter(e=>e!==n),r.initialhits=r.initialhits.filter(e=>e!==n),r.hovered.foreach((e,i)=>{(e.eventobject===n||e.object===n)&&r.hovered.delete(i)}),r.capturedmap.foreach((e,i)=>{j(r.capturedmap,n,e,i)})}(n.__r3f.root,n));let c=null==(o=n.__r3f)?void 0:o.primitive,h=void 0===r?null!==n.dispose&&!c:r;c||(s(null==(u=n.__r3f)?void 0:u.objects,n,h),s(n.children,n,h)),n.__r3f&&(delete n.__r3f.root,delete n.__r3f.objects,delete n.__r3f.handlers,delete n.__r3f.memoizedprops,c||delete n.__r3f),h&&n.dispose&&"scene"!==n.type&&(0,g.unstable_schedulecallback)(g.unstable_idlepriority,()=>{try{n.dispose()}catch(e){}}),v(e)}}let l=()=>console.warn("text is not allowed in the r3f tree! this could be stray whitespace or characters."),c=m()({createinstance:r,removechild:o,appendchild:i,appendinitialchild:i,insertbefore:a,supportsmutation:!0,isprimaryrenderer:!1,supportspersistence:!1,supportshydration:!1,notimeout:-1,appendchildtocontainer:(e,n)=>{if(!n)return;let r=e.getstate().scene;r.__r3f&&(r.__r3f.root=e,i(r,n))},removechildfromcontainer:(e,n)=>{n&&o(e.getstate().scene,n)},insertincontainerbefore:(e,n,r)=>{if(!n||!r)return;let i=e.getstate().scene;i.__r3f&&a(i,n,r)},getroothostcontext:()=>null,getchildhostcontext:e=>e,finalizeinitialchildren(e){var n;let r=null!=(n=null==e?void 0:e.__r3f)?n:{};return boolean(r.handlers)},prepareupdate(e,n,r,i){if(e.__r3f.primitive&&i.object&&i.object!==e)return[!0];{let{args:n=[],children:a,...s}=i,{args:o=[],children:l,...u}=r;if(!array.isarray(n))throw error("r3f: the args prop must be an array!");if(n.some((e,n)=>e!==o[n]))return[!0];let c=u(e,s,u,!0);return c.changes.length?[!1,c]:null}},commitupdate(e,[n,a],s,l,u,c){n?function(e,n,a,s){var l;let u=null==(l=e.__r3f)?void 0:l.parent;if(!u)return;let c=r(n,a,e.__r3f.root);if(e.children){for(let n of e.children)n.__r3f&&i(c,n);e.children=e.children.filter(e=>!e.__r3f)}if(e.__r3f.objects.foreach(e=>i(c,e)),e.__r3f.objects=[],e.__r3f.autoremovedbeforeappend||o(u,e),c.parent&&(c.__r3f.autoremovedbeforeappend=!0),i(u,c),c.raycast&&c.__r3f.eventcount){let e=c.__r3f.root.getstate();e.internal.interaction.push(c)}[s,s.alternate].foreach(e=>{null!==e&&(e.statenode=c,e.ref&&("function"==typeof e.ref?e.ref(c):e.ref.current=c))})}(e,s,u,c):z(e,a)},commitmount(e,n,r,i){var a;let s=null!=(a=e.__r3f)?a:{};e.raycast&&s.handlers&&s.eventcount&&e.__r3f.root.getstate().internal.interaction.push(e)},getpublicinstance:e=>e,prepareforcommit:()=>null,prepareportalmount:e=>o(e.getstate().scene),resetaftercommit:()=>{},shouldsettextcontent:()=>!1,clearcontainer:()=>!1,hideinstance(e){var n;let{attach:r,parent:i}=null!=(n=e.__r3f)?n:{};r&&i&&g(i,e,r),e.isobject3d&&(e.visible=!1),v(e)},unhideinstance(e,n){var r;let{attach:i,parent:a}=null!=(r=e.__r3f)?r:{};i&&a&&h(a,e,i),(e.isobject3d&&null==n.visible||n.visible)&&(e.visible=!0),v(e)},createtextinstance:l,hidetextinstance:l,unhidetextinstance:l,getcurrenteventpriority:()=>n?n():h.defaulteventpriority,beforeactiveinstanceblur:()=>{},afteractiveinstanceblur:()=>{},detachdeletedinstance:()=>{},now:"undefined"!=typeof performance&&f.fun(performance.now)?performance.now:f.fun(date.now)?date.now:()=>0,scheduletimeout:f.fun(settimeout)?settimeout:void 0,canceltimeout:f.fun(cleartimeout)?cleartimeout:void 0});return{reconciler:c,applyprops:z}}(0,function(){var e;let n="undefined"!=typeof self&&self||"undefined"!=typeof window&&window;if(!n)return h.defaulteventpriority;let r=null==(e=n.event)?void 0:e.type;switch(r){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return h.discreteeventpriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return h.continuouseventpriority;default:return h.defaulteventpriority}}),em={objects:"shallow",strict:!1},eg=(e,n)=>{let r="function"==typeof e?e(n):e;return q(r)?r:new u.webglrenderer({powerpreference:"high-performance",canvas:n,antialias:!0,alpha:!0,...e})};function ev(e){let n;let r=ec.get(e),i=null==r?void 0:r.fiber,a=null==r?void 0:r.store;r&&console.warn("r3f.createroot should only be called once!");let s="function"==typeof reporterror?reporterror:console.error,o=a||z(eh,ed),l=i||ep.createcontainer(o,h.concurrentroot,null,!1,null,"",s,null);r||ec.set(e,{fiber:l,store:o});let d=!1;return{configure(r={}){let{gl:i,size:a,events:s,oncreated:l,shadows:c=!1,linear:h=!1,flat:p=!1,legacy:f=!1,orthographic:m=!1,frameloop:g="always",dpr:v=[1,2],performance:y,raycaster:x,camera:_,onpointermissed:a}=r,b=o.getstate(),s=b.gl;b.gl||b.set({gl:s=eg(i,e)});let w=b.raycaster;w||b.set({raycaster:w=new u.raycaster});let{params:c,...e}=x||{};if(f.equ(e,w,em)||ef(w,{...e}),f.equ(c,w.params,em)||ef(w,{params:{...w.params,...c}}),!b.camera){let e=_ instanceof u.camera,n=e?_:m?new u.orthographiccamera(0,0,0,0,.1,1e3):new u.perspectivecamera(75,0,.1,1e3);e||(n.position.z=5,_&&ef(n,_),null!=_&&_.rotation||n.lookat(0,0,0)),b.set({camera:n})}if(!b.xr){let e=(e,n)=>{let r=o.getstate();"never"!==r.frameloop&&ed(e,!0,r,n)},n=()=>{let n=o.getstate();n.gl.xr.enabled=n.gl.xr.ispresenting,n.gl.xr.setanimationloop(n.gl.xr.ispresenting?e:null),n.gl.xr.ispresenting||eh(n)},r={connect(){let e=o.getstate().gl;e.xr.addeventlistener("sessionstart",n),e.xr.addeventlistener("sessionend",n)},disconnect(){let e=o.getstate().gl;e.xr.removeeventlistener("sessionstart",n),e.xr.removeeventlistener("sessionend",n)}};s.xr&&r.connect(),b.set({xr:r})}if(s.shadowmap){let e=s.shadowmap.enabled,n=s.shadowmap.type;if(s.shadowmap.enabled=!!c,f.boo(c))s.shadowmap.type=u.pcfsoftshadowmap;else if(f.str(c)){var t;let e={basic:u.basicshadowmap,percentage:u.pcfshadowmap,soft:u.pcfsoftshadowmap,variance:u.vsmshadowmap};s.shadowmap.type=null!=(t=e[c])?t:u.pcfsoftshadowmap}else f.obj(c)&&object.assign(s.shadowmap,c);(e!==s.shadowmap.enabled||n!==s.shadowmap.type)&&(s.shadowmap.needsupdate=!0)}m&&("enabled"in m?m.enabled=!f:"legacymode"in m&&(m.legacymode=f));let b=h?u.linearencoding:u.srgbencoding,p=p?u.notonemapping:u.acesfilmictonemapping;s.outputencoding!==b&&(s.outputencoding=b),s.tonemapping!==p&&(s.tonemapping=p),b.legacy!==f&&b.set(()=>({legacy:f})),b.linear!==h&&b.set(()=>({linear:h})),b.flat!==p&&b.set(()=>({flat:p})),!i||f.fun(i)||q(i)||f.equ(i,s,em)||ef(s,i),s&&!b.events.handlers&&b.set({events:s(o)});let r=function(e,n){if(n)return n;if("undefined"!=typeof htmlcanvaselement&&e instanceof htmlcanvaselement&&e.parentelement){let{width:n,height:r,top:i,left:a}=e.parentelement.getboundingclientrect();return{width:n,height:r,top:i,left:a}}return"undefined"!=typeof offscreencanvas&&e instanceof offscreencanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0}}(e,a);return f.equ(r,b.size,em)||b.setsize(r.width,r.height,r.updatestyle,r.top,r.left),v&&b.viewport.dpr!==i(v)&&b.setdpr(v),b.frameloop!==g&&b.setframeloop(g),b.onpointermissed||b.set({onpointermissed:a}),y&&!f.equ(y,b.performance,em)&&b.set(e=>({performance:{...e.performance,...y}})),n=l,d=!0,this},render(r){return d||this.configure(),ep.updatecontainer(c.createelement(ey,{store:o,children:r,oncreated:n,rootelement:e}),l,null,()=>void 0),o},unmount(){ex(e)}}}function ey({store:e,children:n,oncreated:r,rootelement:i}){return c(()=>{let n=e.getstate();n.set(e=>({internal:{...e.internal,active:!0}})),r&&r(n),e.getstate().events.connected||null==n.events.connect||n.events.connect(i)},[]),c.createelement(q.provider,{value:e},n)}function ex(e,n){let r=ec.get(e),i=null==r?void 0:r.fiber;if(i){let a=null==r?void 0:r.store.getstate();a&&(a.internal.active=!1),ep.updatecontainer(null,i,null,()=>{a&&settimeout(()=>{try{var r,i,s,o;null==a.events.disconnect||a.events.disconnect(),null==(r=a.gl)||null==(i=r.renderlists)||null==i.dispose||i.dispose(),null==(s=a.gl)||null==s.forcecontextloss||s.forcecontextloss(),null!=(o=a.gl)&&o.xr&&a.xr.disconnect(),function(e){for(let n in e.dispose&&"scene"!==e.type&&e.dispose(),e)null==n.dispose||n.dispose(),delete e[n]}(a),ec.delete(e),n&&n(e)}catch(e){}},500)})}}ep.injectintodevtools({bundletype:0,rendererpackagename:"@react-three/fiber",version:c.version}),c.unstable_act},1906:function(e,n){"use strict";/** * @license react * scheduler.production.min.js * * copyright (c) facebook, inc. and its affiliates. * * this source code is licensed under the mit license found in the * license file in the root directory of this source tree. */function r(e,n){var r=e.length;e.push(n);e:for(;0>>1,a=e[i];if(0>>1;is(u,r))cs(h,u)?(e[i]=h,e[c]=r,i=c):(e[i]=u,e[l]=r,i=l);else if(cs(h,r))e[i]=h,e[c]=r,i=c;else break e}}return n}function s(e,n){var r=e.sortindex-n.sortindex;return 0!==r?r:e.id-n.id}if("object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,y=!1,x="function"==typeof settimeout?settimeout:null,_="function"==typeof cleartimeout?cleartimeout:null,a="undefined"!=typeof setimmediate?setimmediate:null;function b(e){for(var n=i(d);null!==n;){if(null===n.callback)a(d);else if(n.starttime<=e)a(d),n.sortindex=n.expirationtime,r(h,n);else break;n=i(d)}}function m(e){if(y=!1,b(e),!v){if(null!==i(h))v=!0,d(s);else{var n=i(d);null!==n&&f(m,n.starttime-e)}}}function s(e,r){v=!1,y&&(y=!1,_(e),e=-1),g=!0;var s=m;try{for(b(r),f=i(h);null!==f&&(!(f.expirationtime>r)||e&&!p());){var o=f.callback;if("function"==typeof o){f.callback=null,m=f.prioritylevel;var l=o(f.expirationtime<=r);r=n.unstable_now(),"function"==typeof l?f.callback=l:f===i(h)&&a(h),b(r)}else a(h);f=i(h)}if(null!==f)var u=!0;else{var c=i(d);null!==c&&f(m,c.starttime-r),u=!1}return u}finally{f=null,m=s,g=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isinputpending&&navigator.scheduling.isinputpending.bind(navigator.scheduling);var w=!1,c=null,e=-1,t=5,b=-1;function p(){return!(n.unstable_now()-be||125o?(e.sortindex=s,r(d,e),null===i(h)&&e===i(d)&&(y?(_(e),e=-1):y=!0,f(m,s-o))):(e.sortindex=l,r(h,e),v||g||(v=!0,d(s))),e},n.unstable_shouldyield=p,n.unstable_wrapcallback=function(e){var n=m;return function(){var r=m;m=n;try{return e.apply(this,arguments)}finally{m=r}}}},5431:function(e,n,r){"use strict";e.exports=r(1906)},6246:function(e,n,r){"use strict";var i,a,s=r(7294);function o(){return(o=object.assign?object.assign.bind():function(e){for(var n=1;n=n?e:""+array(n+1-i.length).join(r)+e},(g={})[m="en"]={name:"en",weekdays:"sunday_monday_tuesday_wednesday_thursday_friday_saturday".split("_"),months:"january_february_march_april_may_june_july_august_september_october_november_december".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],r=e%100;return"["+e+(n[(r-20)%10]||n[r]||"th")+"]"}},v=function(e){return e instanceof a},y=function e(n,r,i){var a;if(!n)return m;if("string"==typeof n){var s=n.tolowercase();g[s]&&(a=s),r&&(g[s]=r,a=s);var o=n.split("-");if(!a&&o.length>1)return e(o[0])}else{var l=n.name;g[l]=n,a=l}return!i&&a&&(m=a),a||!i&&m},x=function(e,n){if(v(e))return e.clone();var r="object"==typeof n?n:{};return r.date=e,r.args=arguments,new a(r)},(_={s:f,z:function(e){var n=-e.utcoffset(),r=math.abs(n);return(n<=0?"+":"-")+f(math.floor(r/60),2,"0")+":"+f(r%60,2,"0")},m:function e(n,r){if(n.date()!0;function o(){return{width:s()?window.innerwidth:void 0,height:s()?window.innerheight:void 0}}var l=function(){let[e,n]=(0,a.usestate)(()=>o());return(0,a.useeffect)(()=>{function e(){n(o())}return window.addeventlistener("resize",e),e(),()=>{window.removeeventlistener("resize",e)}},[]),e};let u=a.createcontext({ismobile:!1,istablet:!1,isdesktop:!1,islargedesktop:!1});function c(e){let{children:n}=e,[r,s]=(0,a.usestate)({ismobile:!1,istablet:!1,isdesktop:!1,islargedesktop:!1}),{width:o=0}=l(),c=o<768,h=o>=768&&o<1024,d=o>=1024&&o<1280,p=o>=1280;return(0,a.useeffect)(()=>{s({ismobile:c,istablet:h,isdesktop:d,islargedesktop:p})},[c,h,d,p]),(0,i.jsx)(u.provider,{value:r,children:n})}function h(){let e=a.usecontext(u);if(void 0===e)throw error("usemediaquery must be used within a mediaqueryprovider");return e}},5829:function(e,n,r){"use strict";r.d(n,{t:function(){return g},m:function(){return v}});var i=r(5893),a=r(1163),s=r(7294),o=r(8048),l=r(3683),u=r.n(l);let c=["#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#0a39ae","#365ff2","#0a39ae","#0a39ae","#365ff2","#181e64"],h=e=>{let{size:n}=e,[r,a]=(0,s.usestate)(()=>c[(0,o.xf)(0,c.length-1)]);return(0,s.useeffect)(()=>{settimeout(()=>{a(c[0])},(0,o.xf)(10,500))},[]),(0,i.jsx)("div",{classname:u().pixel,style:{background:r,height:n,width:n}})};var d=s.memo(h);let p=e=>{let{isactive:n,delay:r,total:a,pixelsize:l,oncomplete:c}=e,h=(0,s.useref)(null),[p,f]=(0,s.usestate)(0);return(0,s.useeffect)(()=>{let e=!1;if(!n||!h.current)return;let i=h.current.offsetwidth,u=math.ceil(i/l),d=0,p=[1,10],m=async n=>{if(n>0&&d>=u||n<0&&d<=0){null==c||c();return}(0,s.starttransition)(()=>{f(e=>{let r=math.max(0,math.min(u,e+n));return d=r,r})}),await (0,o.dc)((0,o.xf)(...p)),n>0&&e||m(n)};return promise.resolve((0,o.dc)(10*r)).then(()=>{e||m(1)}),()=>{e=!0,promise.resolve((0,o.dc)((a-r)*10)).then(()=>{m(-1)})}},[n,r,a,l,c]),(0,i.jsx)("div",{ref:h,classname:u().row,children:[...array(p)].map((e,n)=>(0,i.jsx)(d,{size:l},n))})},f=s.forwardref((e,n)=>{let{}=e,r=(0,s.useref)(null),a=(0,s.useref)(null),[l,c]=(0,s.usestate)(!1),[h]=(0,s.usestate)(15),[d,f]=(0,s.usestate)(48);(0,s.useimperativehandle)(n,()=>({fill:async()=>new promise(e=>{a.current=e,c(!0)}),clear:async()=>new promise(e=>{a.current=e,c(!1)})})),(0,s.useeffect)(()=>{let e=()=>{if(!r.current)return;let e=r.current.offsetheight;f(math.ceil(e/h))};return e(),window.addeventlistener("resize",e),()=>{window.removeeventlistener("resize",e)}},[h]);let m=(0,s.usecallback)(async()=>{var e;await (0,o.dc)(500),null===(e=a.current)||void 0===e||e.call(a)},[]);return(0,i.jsx)("div",{ref:r,classname:u().canvas,children:[...array(h)].map((e,n)=>(0,i.jsx)("div",{style:{position:"absolute",left:0,top:n*d,height:d,right:0},children:(0,i.jsx)(p,{isactive:l,delay:n,total:h,pixelsize:d,oncomplete:n+1===h?m:void 0})},n))})});f.displayname="pixelcanvas";let m=s.createcontext({showtransition:()=>new promise(()=>{}),pushroutewithanimation:()=>new promise(()=>{})});function g(e){let{children:n}=e,r=(0,a.userouter)(),o=(0,s.useref)(null),l=(0,s.useref)(null);(0,s.useeffect)(()=>{let e=()=>{promise.resolve(l.current).then(()=>{var e;null===(e=o.current)||void 0===e||e.clear()})};return r.events.on("routechangecomplete",e),r.events.on("routechangeerror",e),()=>{r.events.off("routechangecomplete",e),r.events.off("routechangeerror",e)}},[r.events]);let u=(0,s.usecallback)(()=>o.current?(l.current=o.current.fill(),l.current):new promise(()=>{}),[]),c=(0,s.usecallback)(async e=>{await u(),r.push(e)},[u,r]),h=(0,s.usememo)(()=>({showtransition:u,pushroutewithanimation:c}),[u,c]);return(0,i.jsxs)(m.provider,{value:h,children:[(0,i.jsx)(f,{ref:o}),n]})}function v(){let e=s.usecontext(m);if(void 0===e)throw error("useroutetransition must be used within a routetransitionprovider");return e}},4362:function(e,n,r){"use strict";var i=r(5893),a=r(1664),s=r.n(a),o=r(1163),l=r(7294),u=r(5829);let c=l.forwardref((e,n)=>{let{href:r,onclick:a,children:c,...h}=e,d=(0,o.userouter)(),{showtransition:p}=(0,u.m)(),f=h.legacybehavior?c.props.onclick:a,m=async e=>{if(e.preventdefault(),f&&f(),r===d.pathname){window.location.reload();return}await p(),d.push(r)};return h.legacybehavior?(0,i.jsx)(s(),{...h,href:r,children:l.cloneelement(c,{onclick:m})}):(0,i.jsx)(s(),{...h,href:r,onclick:m,children:c})});c.displayname="linkwithanimation",n.z=c},4518:function(e,n,r){"use strict";r.d(n,{z:function(){return v}});var i=r(5893),a=r(6010),s=r(7294),o=r(6246),l=r(5151),u=r.n(l),c=r(2193),h=r(8048),d=r(7098);let p=()=>{let[e,n]=(0,s.usestate)(()=>d.v9[(0,h.xf)(0,2)]);return(0,s.useeffect)(()=>{settimeout(()=>{n(d.v9[0])},(0,h.xf)(10,500))},[]),(0,i.jsx)("div",{classname:u().pixel,style:{background:e}})};var f=s.memo(p);let m=e=>{let{isactive:n}=e,{ismobile:r}=(0,c.a)(),a=(0,s.useref)(null),[o,l]=(0,s.usestate)(0);return(0,s.useeffect)(()=>{let e=!1;if(!n||!a.current)return;let i=a.current.offsetwidth,o=a.current.offsetheight,u=math.ceil(i/o),c=0,d=r?[0,20]:[20,50],p=async n=>{n>0&&c>=u||n<0&&c<=0||((0,s.starttransition)(()=>{l(e=>{let r=math.max(0,math.min(u,e+n));return c=r,r})}),await (0,h.dc)((0,h.xf)(...d)),n>0&&e||p(n))};return p(1),()=>{e=!0,p(-1)}},[n,r]),(0,i.jsx)("div",{ref:a,classname:u().pixelrow,children:[...array(o)].map((e,n)=>(0,i.jsx)(f,{},n))})},g=e=>{let{mode:n="dark",text:r,onclick:l,style:c,classname:h,compactonmobile:d=!0,...p}=e,f=(0,s.useref)(0),g=(0,s.useref)(null),[v,y]=(0,s.usestate)(!1);return(0,i.jsxs)("div",{classname:(0,a.z)(u().container,u()[n],h,{[u().ishover]:v,[u().compactonmobile]:d}),style:c,onclick:l,ontouchstart:e=>{f.current=date.now(),y(!0)},ontouchend:()=>{f.current=date.now(),y(!1)},onmouseenter:()=>{date.now()-f.current<100||y(!0)},onmouseleave:()=>{date.now()-f.current<100||y(!1)},...p,children:[(0,i.jsxs)("div",{ref:g,classname:u().label,children:[(0,i.jsxs)("div",{classname:u().bg,children:[(0,i.jsx)(m,{isactive:v}),(0,i.jsx)(m,{isactive:v})]}),(0,i.jsx)("span",{children:r})]}),(0,i.jsx)("div",{classname:u().suffix,children:(0,i.jsx)(o.z,{style:{width:16,height:16}})})]})};var v=g},7098:function(e,n,r){"use strict";r.d(n,{v9:function(){return h},xx:function(){return d},ll:function(){return f},dk:function(){return p}});var i={src:"/_next/static/media/thumbnail-01.ebc8bf64.jpg",height:1e3,width:1600,blurdataurl:"data:image/jpeg;base64,/9j/2wbdaaohbwghbgoicaglcgoldhgqdg0ndh0vfheyix8ljcifiiemkzcvjik0kseimeexndk7pj4+js5esum8sdc9pjv/2wbdaqolcw4ndhwqebw7kcioozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozv/waarcaafaagdasiaahebaxeb/8qafqabaqaaaaaaaaaaaaaaaaaaaax/xaadeaabbaidaaaaaaaaaaaaaaaaaqieeqobbsex/8qafqebaqaaaaaaaaaaaaaaaaaaagp/xaaxeqadaqaaaaaaaaaaaaaaaaaaauec/9oadambaairaxeapwcry8dqyzmvpvsy9lvr3yagqt1d/9k=",blurwidth:8,blurheight:5},a={src:"/_next/static/media/thumbnail-02.d2f0f51d.jpg",height:1e3,width:1600,blurdataurl:"data:image/jpeg;base64,/9j/2wbdaaohbwghbgoicaglcgoldhgqdg0ndh0vfheyix8ljcifiiemkzcvjik0kseimeexndk7pj4+js5esum8sdc9pjv/2wbdaqolcw4ndhwqebw7kcioozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozv/waarcaafaagdasiaahebaxeb/8qafqabaqaaaaaaaaaaaaaaaaaaaab/xaaaeaabbqeaaaaaaaaaaaaaaaacaaedesee/8qafqebaqaaaaaaaaaaaaaaaaaaaql/xaaveqebaaaaaaaaaaaaaaaaaaaaaf/aaawdaqaceqmrad8am5jqroe4mjgjsdraburejsf/2q==",blurwidth:8,blurheight:5},s={src:"/_next/static/media/thumbnail-03.0e720352.jpg",height:1e3,width:1600,blurdataurl:"data:image/jpeg;base64,/9j/2wbdaaohbwghbgoicaglcgoldhgqdg0ndh0vfheyix8ljcifiiemkzcvjik0kseimeexndk7pj4+js5esum8sdc9pjv/2wbdaqolcw4ndhwqebw7kcioozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozv/waarcaafaagdasiaahebaxeb/8qafqabaqaaaaaaaaaaaaaaaaaaaax/xaabeaacagmbaaaaaaaaaaaaaaabawaebreskf/eabqbaqaaaaaaaaaaaaaaaaaaaah/xaaveqebaaaaaaaaaaaaaaaaaaaaaf/aaawdaqaceqmrad8amrq124bj2gljahwcz1odzpsreik//9k=",blurwidth:8,blurheight:5},o={src:"/_next/static/media/landing-1.586dfb78.jpg",height:1600,width:2560,blurdataurl:"data:image/jpeg;base64,/9j/2wbdaaohbwghbgoicaglcgoldhgqdg0ndh0vfheyix8ljcifiiemkzcvjik0kseimeexndk7pj4+js5esum8sdc9pjv/2wbdaqolcw4ndhwqebw7kcioozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozv/waarcaafaagdasiaahebaxeb/8qafqabaqaaaaaaaaaaaaaaaaaaaat/xaafeaabbaefaqaaaaaaaaaaaaabaaideqyebrmhmtl/xaauaqeaaaaaaaaaaaaaaaaaaaab/8qafxeaaweaaaaaaaaaaaaaaaaaaaexif/aaawdaqaceqmrad8av3niepdi55dfhk+sij7lrt3fpuvab6retreq/9k=",blurwidth:8,blurheight:5},l={src:"/_next/static/media/landing-2.db374c31.jpg",height:1600,width:2560,blurdataurl:"data:image/jpeg;base64,/9j/2wbdaaohbwghbgoicaglcgoldhgqdg0ndh0vfheyix8ljcifiiemkzcvjik0kseimeexndk7pj4+js5esum8sdc9pjv/2wbdaqolcw4ndhwqebw7kcioozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozv/waarcaafaagdasiaahebaxeb/8qafqabaqaaaaaaaaaaaaaaaaaaaab/xaaeeaacagefaqaaaaaaaaaaaaabawaceqqfitfbyf/eabubaqeaaaaaaaaaaaaaaaaaaaab/8qafrebaqaaaaaaaaaaaaaaaaaaaah/2gamaweaahedeqa/ainxtonbyyqfkhvqsryc27z4fsrehx//2q==",blurwidth:8,blurheight:5},u={src:"/_next/static/media/landing-3.6c930fc5.jpg",height:1600,width:2560,blurdataurl:"data:image/jpeg;base64,/9j/2wbdaaohbwghbgoicaglcgoldhgqdg0ndh0vfheyix8ljcifiiemkzcvjik0kseimeexndk7pj4+js5esum8sdc9pjv/2wbdaqolcw4ndhwqebw7kcioozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozv/waarcaafaagdasiaahebaxeb/8qafqabaqaaaaaaaaaaaaaaaaaaaab/xaageaabbaibbqaaaaaaaaaaaaabaaidbausbhetitfb/8qafqebaqaaaaaaaaaaaaaaaaaaaal/xaaweqebaqaaaaaaaaaaaaaaaaabach/2gamaweaahedeqa/aj+3jy47hp8ebdrqnnlmpcne28aep+knx09oikxggl//2q==",blurwidth:8,blurheight:5},c={src:"/_next/static/media/banner-01.9ba2eb15.jpg",height:450,width:1600,blurdataurl:"data:image/jpeg;base64,/9j/2wbdaaohbwghbgoicaglcgoldhgqdg0ndh0vfheyix8ljcifiiemkzcvjik0kseimeexndk7pj4+js5esum8sdc9pjv/2wbdaqolcw4ndhwqebw7kcioozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozs7ozv/waarcaacaagdasiaahebaxeb/8qafqabaqaaaaaaaaaaaaaaaaaaaab/xaaceaacagidaaaaaaaaaaaaaaaaaqirawqsith/xaauaqeaaaaaaaaaaaaaaaaaaaaf/8qafxebaamaaaaaaaaaaaaaaaaaaaexqf/aaawdaqaceqmrad8ag9akmsvnkvyjvfdeaawwdfv/2q==",blurwidth:8,blurheight:2};let h=["#0a39ae","#365ff2","#181e64"],d=e=>[{id:"1",image:c,subtitle:"join the magic trip",title:e("home_banner_1_title"),linkto:"/career"}],p=e=>[{title:e("about_us_the_voice_1_title"),name:e("about_us_the_voice_1_name"),quote:e("about_us_the_voice_1_quote"),video:[{url:"/assets/about-us/about-us-02.webm",type:"video/webm"},{url:"/assets/about-us/about-us-02.mp4",type:"video/mp4"}],posterurl:"/assets/about-us/thumbnail-02.jpg",posterimage:a,duration:62},{title:e("about_us_the_voice_2_title"),name:e("about_us_the_voice_2_name"),quote:e("about_us_the_voice_2_quote"),video:[{url:"/assets/about-us/about-us-03.webm",type:"video/webm"},{url:"/assets/about-us/about-us-03.mp4",type:"video/mp4"}],posterurl:"/assets/about-us/thumbnail-03.jpg",posterimage:s,duration:43},{title:e("about_us_the_voice_3_title"),name:e("about_us_the_voice_3_name"),quote:e("about_us_the_voice_3_quote"),video:[{url:"/assets/about-us/about-us-01.webm",type:"video/webm"},{url:"/assets/about-us/about-us-01.mp4",type:"video/mp4"}],posterurl:"/assets/about-us/thumbnail-01.jpg",posterimage:i,duration:67}],f=e=>[{image:o,tag:e("career_quote_1_tag"),pixelpositions:[{top:0,right:0},{top:1,right:1}],staffs:[{name:e("career_quote_1_name"),position:e("career_quote_1_position"),quote:e("career_quote_1_quote"),quotestyle:{left:"33.33%"}}]},{image:l,tag:e("career_quote_2_tag"),pixelpositions:[{top:0,right:2},{top:2,right:2},{top:3,right:3}],staffs:[{name:e("career_quote_2_1_name"),position:e("career_quote_2_1_position"),quote:e("career_quote_2_1_quote"),quotestyle:{right:"66.66%"}},{name:e("career_quote_2_2_name"),position:e("career_quote_2_2_position"),quote:e("career_quote_2_2_quote"),quotestyle:{left:"66.66%"}}]},{image:u,tag:e("career_quote_3_tag"),pixelpositions:[{top:0,right:0},{top:1,right:1}],staffs:[{name:e("career_quote_3_name"),position:e("career_quote_3_position"),quote:e("career_quote_3_quote"),quotestyle:{right:"33.33%"}}]}]},227:function(e,n,r){"use strict";object.defineproperty(n,"__esmodule",{value:!0}),n.getdomainlocale=function(e,n,i,a){{let s=r(2554).normalizelocalepath,o=r(4643).detectdomainlocale,l=n||s(e,i).detectedlocale,u=o(a,void 0,l);if(u){let n="http".concat(u.http?"":"s","://"),r=l===u.defaultlocale?"":"/".concat(l);return"".concat(n).concat(u.domain).concat("").concat(r).concat(e)}return!1}},("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esmodule&&(object.defineproperty(n.default,"__esmodule",{value:!0}),object.assign(n.default,n),e.exports=n.default)},9749:function(e,n,r){"use strict";object.defineproperty(n,"__esmodule",{value:!0}),n.default=void 0;var i=r(6495).z,a=r(2648).z,s=r(1598).z,o=r(7273).z,l=s(r(7294)),u=a(r(3121)),c=r(2675),h=r(139),d=r(8730);r(7238);var p=a(r(9824));let f={devicesizes:[640,750,828,1080,1200,1920,2048,3840],imagesizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyallowsvg:!1,unoptimized:!1};function m(e){return void 0!==e.default}function g(e){return"number"==typeof e||void 0===e?e:"string"==typeof e&&/^[0-9]+$/.test(e)?parseint(e,10):nan}function v(e,n,r,a,s,o,l){if(!e||e["data-loaded-src"]===n)return;e["data-loaded-src"]=n;let u="decode"in e?e.decode():promise.resolve();u.catch(()=>{}).then(()=>{if(e.parentnode){if("blur"===r&&o(!0),null==a?void 0:a.current){let n=new event("load");object.defineproperty(n,"target",{writable:!1,value:e});let r=!1,s=!1;a.current(i({},n,{nativeevent:n,currenttarget:e,target:e,isdefaultprevented:()=>r,ispropagationstopped:()=>s,persist:()=>{},preventdefault:()=>{r=!0,n.preventdefault()},stoppropagation:()=>{s=!0,n.stoppropagation()}}))}(null==s?void 0:s.current)&&s.current(e)}})}let y=l.forwardref((e,n)=>{var{imgattributes:r,heightint:a,widthint:s,qualityint:u,classname:c,imgstyle:h,blurstyle:d,islazy:p,fill:f,placeholder:m,loading:g,srcstring:y,config:x,unoptimized:_,loader:a,onloadref:b,onloadingcompleteref:m,setblurcomplete:s,setshowalttext:w,onload:c,onerror:e}=e,t=o(e,["imgattributes","heightint","widthint","qualityint","classname","imgstyle","blurstyle","islazy","fill","placeholder","loading","srcstring","config","unoptimized","loader","onloadref","onloadingcompleteref","setblurcomplete","setshowalttext","onload","onerror"]);return g=p?"lazy":g,l.default.createelement(l.default.fragment,null,l.default.createelement("img",object.assign({},t,{loading:g,width:s,height:a,decoding:"async","data-nimg":f?"fill":"1",classname:c,style:i({},h,d)},r,{ref:l.usecallback(e=>{n&&("function"==typeof n?n(e):"object"==typeof n&&(n.current=e)),e&&(e&&(e.src=e.src),e.complete&&v(e,y,m,b,m,s,_))},[y,m,b,m,s,e,_,n]),onload:e=>{let n=e.currenttarget;v(n,y,m,b,m,s,_)},onerror:e=>{w(!0),"blur"===m&&s(!0),e&&e(e)}})))}),x=l.forwardref((e,n)=>{let r,a;var s,{src:v,sizes:x,unoptimized:_=!1,priority:a=!1,loading:b,classname:m,quality:s,width:w,height:c,fill:e,style:t,onload:b,onloadingcomplete:p,placeholder:r="empty",blurdataurl:l,layout:i,objectfit:d,objectposition:f,lazyboundary:o,lazyroot:n}=e,k=o(e,["src","sizes","unoptimized","priority","loading","classname","quality","width","height","fill","style","onload","onloadingcomplete","placeholder","blurdataurl","layout","objectfit","objectposition","lazyboundary","lazyroot"]);let h=l.usecontext(d.imageconfigcontext),g=l.usememo(()=>{let e=f||h||h.imageconfigdefault,n=[...e.devicesizes,...e.imagesizes].sort((e,n)=>e-n),r=e.devicesizes.sort((e,n)=>e-n);return i({},e,{allsizes:n,devicesizes:r})},[h]),u=k,z=u.loader||p.default;delete u.loader;let v="__next_img_default"in z;if(v){if("custom"===g.loader)throw error('image with src "'.concat(v,'" is missing "loader" prop.')+"\nread more: https://nextjs.org/docs/messages/next-image-missing-loader")}else{let e=z;z=n=>{let{config:r}=n,i=o(n,["config"]);return e(i)}}if(i){"fill"===i&&(e=!0);let e={intrinsic:{maxwidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[i];e&&(t=i({},t,e));let n={responsive:"100vw",fill:"100vw"}[i];n&&!x&&(x=n)}let j="",w=g(w),j=g(c);if("object"==typeof(s=v)&&(m(s)||void 0!==s.src)){let e=m(v)?v.default:v;if(!e.src)throw error("an object should only be passed to the image component src parameter if it comes from a static image import. it must include src. received ".concat(json.stringify(e)));if(!e.height||!e.width)throw error("an object should only be passed to the image component src parameter if it comes from a static image import. it must include height and width. received ".concat(json.stringify(e)));if(r=e.blurwidth,a=e.blurheight,l=l||e.blurdataurl,j=e.src,!e){if(w||j){if(w&&!j){let n=w/e.width;j=math.round(e.height*n)}else if(!w&&j){let n=j/e.height;w=math.round(e.width*n)}}else w=e.width,j=e.height}}let x=!a&&("lazy"===b||void 0===b);((v="string"==typeof v?v:j).startswith("data:")||v.startswith("blob:"))&&(_=!0,x=!1),g.unoptimized&&(_=!0),v&&v.endswith(".svg")&&!g.dangerouslyallowsvg&&(_=!0);let[k,y]=l.usestate(!1),[q,q]=l.usestate(!1),z=g(s),$=object.assign(e?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectfit:d,objectposition:f}:{},q?{}:{color:"transparent"},t),ee="blur"===r&&l&&!k?{backgroundsize:$.objectfit||"cover",backgroundposition:$.objectposition||"50% 50%",backgroundrepeat:"no-repeat",backgroundimage:'url("data:image/svg+xml;charset=utf-8,'.concat(c.getimageblursvg({widthint:w,heightint:j,blurwidth:r,blurheight:a,blurdataurl:l,objectfit:$.objectfit}),'")')}:{},et=function(e){let{config:n,src:r,unoptimized:i,width:a,quality:s,sizes:o,loader:l}=e;if(i)return{src:r,srcset:void 0,sizes:void 0};let{widths:u,kind:c}=function(e,n,r){let{devicesizes:i,allsizes:a}=e;if(r){let e=/(^|\s)(1?\d?\d)vw/g,n=[];for(let i;i=e.exec(r);i)n.push(parseint(i[2]));if(n.length){let e=.01*math.min(...n);return{widths:a.filter(n=>n>=i[0]*e),kind:"w"}}return{widths:a,kind:"w"}}if("number"!=typeof n)return{widths:i,kind:"w"};let s=[...new set([n,2*n].map(e=>a.find(n=>n>=e)||a[a.length-1]))];return{widths:s,kind:"x"}}(n,a,o),h=u.length-1;return{sizes:o||"w"!==c?o:"100vw",srcset:u.map((e,i)=>"".concat(l({config:n,src:r,quality:s,width:e})," ").concat("w"===c?e:i+1).concat(c)).join(", "),src:l({config:n,src:r,quality:s,width:u[h]})}}({config:g,src:v,unoptimized:_,width:w,quality:z,sizes:x,loader:z}),en=v,er={imagesrcset:et.srcset,imagesizes:et.sizes,crossorigin:u.crossorigin},ei=l.useref(b);l.useeffect(()=>{ei.current=b},[b]);let ea=l.useref(p);l.useeffect(()=>{ea.current=p},[p]);let es=i({islazy:x,imgattributes:et,heightint:j,widthint:w,qualityint:z,classname:m,imgstyle:$,blurstyle:ee,loading:b,config:g,fill:e,unoptimized:_,placeholder:r,loader:z,srcstring:en,onloadref:ei,onloadingcompleteref:ea,setblurcomplete:y,setshowalttext:q},u);return l.default.createelement(l.default.fragment,null,l.default.createelement(y,object.assign({},es,{ref:n})),a?l.default.createelement(u.default,null,l.default.createelement("link",object.assign({key:"__nimg-"+et.src+et.srcset+et.sizes,rel:"preload",as:"image",href:et.srcset?void 0:et.src},er))):null)});n.default=x,("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esmodule&&(object.defineproperty(n.default,"__esmodule",{value:!0}),object.assign(n.default,n),e.exports=n.default)},1551:function(e,n,r){"use strict";object.defineproperty(n,"__esmodule",{value:!0}),n.default=void 0;var i=r(2648).z,a=r(7273).z,s=i(r(7294)),o=r(1978),l=r(2139),u=r(7795),c=r(670),h=r(4465),d=r(2692),p=r(8245),f=r(9246),m=r(227),g=r(3468);let v=new set;function y(e,n,r,i,a){if(a||l.islocalurl(n)){if(!i.bypassprefetchedcheck){let a=void 0!==i.locale?i.locale:"locale"in e?e.locale:void 0,s=n+"%"+r+"%"+a;if(v.has(s))return;v.add(s)}promise.resolve(e.prefetch(n,r,i)).catch(e=>{})}}function x(e){return"string"==typeof e?e:u.formaturl(e)}let _=s.default.forwardref(function(e,n){let r,i;let{href:u,as:v,children:_,prefetch:a,passhref:b,replace:m,shallow:s,scroll:w,locale:c,onclick:e,onmouseenter:t,ontouchstart:b,legacybehavior:p=!1}=e,r=a(e,["href","as","children","prefetch","passhref","replace","shallow","scroll","locale","onclick","onmouseenter","ontouchstart","legacybehavior"]);r=_,p&&("string"==typeof r||"number"==typeof r)&&(r=s.default.createelement("a",null,r));let l=!1!==a,i=s.default.usecontext(d.routercontext),d=s.default.usecontext(p.approutercontext),f=null!=i?i:d,o=!i,{href:n,as:k}=s.default.usememo(()=>{if(!i){let e=x(u);return{href:e,as:v?x(v):e}}let[e,n]=o.resolvehref(i,u,!0);return{href:e,as:v?o.resolvehref(i,v):n||e}},[i,u,v]),h=s.default.useref(n),g=s.default.useref(k);p&&(i=s.default.children.only(r));let u=p?i&&"object"==typeof i&&i.ref:n,[z,v,j]=f.useintersection({rootmargin:"200px"}),w=s.default.usecallback(e=>{(g.current!==k||h.current!==n)&&(j(),g.current=k,h.current=n),z(e),u&&("function"==typeof u?u(e):"object"==typeof u&&(u.current=e))},[k,u,n,j,z]);s.default.useeffect(()=>{f&&v&&l&&y(f,n,k,{locale:c},o)},[k,n,v,c,l,null==i?void 0:i.locale,f,o]);let j={ref:w,onclick(e){p||"function"!=typeof e||e(e),p&&i.props&&"function"==typeof i.props.onclick&&i.props.onclick(e),f&&!e.defaultprevented&&function(e,n,r,i,a,o,u,c,h,d){let{nodename:p}=e.currenttarget,f="a"===p.touppercase();if(f&&(function(e){let n=e.currenttarget,r=n.getattribute("target");return r&&"_self"!==r||e.metakey||e.ctrlkey||e.shiftkey||e.altkey||e.nativeevent&&2===e.nativeevent.which}(e)||!h&&!l.islocalurl(r)))return;e.preventdefault();let m=()=>{"beforepopstate"in n?n[a?"replace":"push"](r,i,{shallow:o,locale:c,scroll:u}):n[a?"replace":"push"](i||r,{forceoptimisticnavigation:!d})};h?s.default.starttransition(m):m()}(e,f,n,k,m,s,w,c,o,l)},onmouseenter(e){p||"function"!=typeof t||t(e),p&&i.props&&"function"==typeof i.props.onmouseenter&&i.props.onmouseenter(e),f&&(l||!o)&&y(f,n,k,{locale:c,priority:!0,bypassprefetchedcheck:!0},o)},ontouchstart(e){p||"function"!=typeof b||b(e),p&&i.props&&"function"==typeof i.props.ontouchstart&&i.props.ontouchstart(e),f&&(l||!o)&&y(f,n,k,{locale:c,priority:!0,bypassprefetchedcheck:!0},o)}};if(c.isabsoluteurl(k))j.href=k;else if(!p||b||"a"===i.type&&!("href"in i.props)){let e=void 0!==c?c:null==i?void 0:i.locale,n=(null==i?void 0:i.islocaledomain)&&m.getdomainlocale(k,e,null==i?void 0:i.locales,null==i?void 0:i.domainlocales);j.href=n||g.addbasepath(h.addlocale(k,e,null==i?void 0:i.defaultlocale))}return p?s.default.cloneelement(i,j):s.default.createelement("a",object.assign({},r,j),r)});n.default=_,("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esmodule&&(object.defineproperty(n.default,"__esmodule",{value:!0}),object.assign(n.default,n),e.exports=n.default)},2554:function(e,n,r){"use strict";object.defineproperty(n,"__esmodule",{value:!0}),n.normalizelocalepath=void 0;let i=(e,n)=>r(4769).normalizelocalepath(e,n);n.normalizelocalepath=i,("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esmodule&&(object.defineproperty(n.default,"__esmodule",{value:!0}),object.assign(n.default,n),e.exports=n.default)},9246:function(e,n,r){"use strict";object.defineproperty(n,"__esmodule",{value:!0}),n.useintersection=function(e){let{rootref:n,rootmargin:r,disabled:u}=e,c=u||!s,[h,d]=i.usestate(!1),p=i.useref(null),f=i.usecallback(e=>{p.current=e},[]);i.useeffect(()=>{if(s){if(c||h)return;let e=p.current;if(e&&e.tagname){let i=function(e,n,r){let{id:i,observer:a,elements:s}=function(e){let n;let r={root:e.root||null,margin:e.rootmargin||""},i=l.find(e=>e.root===r.root&&e.margin===r.margin);if(i&&(n=o.get(i)))return n;let a=new map,s=new intersectionobserver(e=>{e.foreach(e=>{let n=a.get(e.target),r=e.isintersecting||e.intersectionratio>0;n&&r&&n(r)})},e);return n={id:r,observer:s,elements:a},l.push(r),o.set(r,n),n}(r);return s.set(e,n),a.observe(e),function(){if(s.delete(e),a.unobserve(e),0===s.size){a.disconnect(),o.delete(i);let e=l.findindex(e=>e.root===i.root&&e.margin===i.margin);e>-1&&l.splice(e,1)}}}(e,e=>e&&d(e),{root:null==n?void 0:n.current,rootmargin:r});return i}}else if(!h){let e=a.requestidlecallback(()=>d(!0));return()=>a.cancelidlecallback(e)}},[c,r,n,h,p.current]);let m=i.usecallback(()=>{d(!1)},[]);return[f,h,m]};var i=r(7294),a=r(4686);let s="function"==typeof intersectionobserver,o=new map,l=[];("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esmodule&&(object.defineproperty(n.default,"__esmodule",{value:!0}),object.assign(n.default,n),e.exports=n.default)},2675:function(e,n){"use strict";object.defineproperty(n,"__esmodule",{value:!0}),n.getimageblursvg=function(e){let{widthint:n,heightint:r,blurwidth:i,blurheight:a,blurdataurl:s,objectfit:o}=e,l=i||n,u=a||r,c=s.startswith("data:image/jpeg")?"%3cfecomponenttransfer%3e%3cfefunca type='discrete' tablevalues='1 1'/%3e%3c/fecomponenttransfer%3e%":"";return l&&u?"%3csvg xmlns='http%3a//www.w3.org/2000/svg' viewbox='0 0 ".concat(l," ").concat(u,"'%3e%3cfilter id='b' color-interpolation-filters='srgb'%3e%3cfegaussianblur stddeviation='").concat(i&&a?"1":"20","'/%3e").concat(c,"%3c/filter%3e%3cimage preserveaspectratio='none' filter='url(%23b)' x='0' y='0' height='100%25' width='100%25' href='").concat(s,"'/%3e%3c/svg%3e"):"%3csvg xmlns='http%3a//www.w3.org/2000/svg'%3e%3cimage style='filter:blur(20px)' preserveaspectratio='".concat("contain"===o?"xmidymid":"cover"===o?"xmidymid slice":"none","' x='0' y='0' height='100%25' width='100%25' href='").concat(s,"'/%3e%3c/svg%3e")}},9824:function(e,n){"use strict";function r(e){let{config:n,src:r,width:i,quality:a}=e;return"".concat(n.path,"?url=").concat(encodeuricomponent(r),"&w=").concat(i,"&q=").concat(a||75)}object.defineproperty(n,"__esmodule",{value:!0}),n.default=void 0,r.__next_img_default=!0,n.default=r},7863:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return ef}});var i,a,s=r(5893),o=r(8626),l=r(7484),u=r.n(l),c=r(1646),h=r.n(c);function d(){return(d=object.assign||function(e){for(var n=1;n=0||(a[r]=e[r]);return a}(e,_),a=null==(n=(0,p.userouter)())?void 0:n.locale;if(!r&&a&&(r=a),!r)throw error(void 0);return f.createelement(x,d({locale:r},i))}var b=r(4298),m=r.n(b),s=r(1782);/*! js-cookie v3.0.1 | mit */function w(e){for(var n=1;n{let e=(0,e.z)(),n=function(){let e=(0,f.usecontext)(h);if(void 0===e)throw error("usecookieconsentdispatch must be used within cookieprovider");return e}();return(0,s.jsxs)("div",{classname:i().container,children:[(0,s.jsx)("div",{classname:i().closebutton,onclick:()=>{n({type:"closepopup"})},children:(0,s.jsx)(b(),{src:"/assets/close.svg",alt:"close",width:24,height:24})}),(0,s.jsxs)("div",{classname:i().body,children:[(0,s.jsx)("div",{classname:i().title,children:e("home_cookie_title")}),(0,s.jsxs)("div",{classname:i().paragraph,children:[e("home_cookie_body"),"\xa0",(0,s.jsx)(p.z,{href:"/privacy-cookie-policy",children:e("home_learn_more")})]})]}),(0,s.jsx)(r.z,{text:e("home_cookie_accept"),style:{width:"100%"},compactonmobile:!1,onclick:()=>{n({type:"accept"})}})]})},f="consent",o={isset:0},n={...o,popupvisible:boolean(o.isset)},k=(0,f.createcontext)(n),h=(0,f.createcontext)(()=>{});function g(e){let{children:n}=e,[r,i]=(0,f.usereducer)((e,n)=>{switch(n.type){case"receiveinitialstate":return{...e,isset:n.payload.isset,popupvisible:!n.payload.isset};case"accept":return{...e,isset:1,popupvisible:!1};case"closepopup":return{...e,popupvisible:!1};default:throw error()}},n);return(0,f.useeffect)(()=>{i({type:"receiveinitialstate",payload:function(){try{let e=c.get(f);if(!e)throw error();return json.parse(e)}catch(e){return{isset:0}}}()})},[]),(0,f.useeffect)(()=>{r.isset&&c.set(f,json.stringify({isset:r.isset}),{expires:365})},[r.isset]),(0,s.jsx)(k.provider,{value:r,children:(0,s.jsxs)(h.provider,{value:i,children:[r.popupvisible&&(0,s.jsx)(d,{}),n]})})}var u=r(2193),z=r(5829),v=r(9008),j=r.n(v);let w=()=>{let e=(0,e.z)();return(0,s.jsxs)(j(),{children:[(0,s.jsx)("title",{children:"wizard quant"}),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"}),(0,s.jsx)("meta",{name:"description",content:e("common_meta_description")}),(0,s.jsx)("link",{rel:"apple-touch-icon",sizes:"180x180",href:"/apple-touch-icon.png"}),(0,s.jsx)("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicon-32x32.png"}),(0,s.jsx)("link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicon-16x16.png"}),(0,s.jsx)("link",{rel:"preload",href:"/assets/disk-bg.svg",as:"image"}),(0,s.jsx)("link",{rel:"preload",href:"/assets/disk.svg",as:"image"}),(0,s.jsx)("link",{rel:"preload",href:"/assets/disk-group.svg",as:"image"}),(0,s.jsx)("link",{rel:"preload",href:"/assets/middle-disk-1.png",as:"image"}),(0,s.jsx)("link",{rel:"preload",href:"/assets/small-disk-1.png",as:"image"}),(0,s.jsx)("link",{rel:"preload",href:"/assets/cloud-1.png",as:"image"}),(0,s.jsx)("link",{rel:"preload",href:"/assets/cloud-2.png",as:"image"})]})};var j=r(6010),x=r(8048),k=r(7816),y=r.n(k);let q=()=>{let e=(0,e.z)(),n=(0,p.userouter)(),{ismobile:r,istablet:i}=(0,u.a)(),a=(0,f.usememo)(()=>[{city:e("common_shanghai"),address:e("common_shanghai_address")},{city:e("common_beijing"),address:e("common_beijing_address")}],[e]);return(0,s.jsxs)("div",{classname:y().container,children:[(0,s.jsxs)("div",{classname:y().grid,children:[(0,s.jsx)("div",{classname:y().logocontainer,children:(0,s.jsx)(p.z,{href:"/",children:(0,s.jsx)(b(),{src:"/assets/logo-with-text.svg",alt:"wizard quant",height:(i?.8:1)*80,width:(i?.8:1)*229})})}),(0,s.jsxs)("div",{classname:y().body,children:[(0,s.jsx)("div",{classname:y().column,children:(0,s.jsxs)("div",{classname:y().topgrid,children:[(0,s.jsxs)("div",{classname:y().topgriditem,children:[(0,s.jsx)("div",{classname:y().item,children:(0,s.jsx)(p.z,{href:"/technologies",classname:y().link,children:e("technologies_title")})}),(0,s.jsx)("div",{classname:y().item,children:(0,s.jsx)(p.z,{href:"/about-us",classname:y().link,children:e("common_about_us")})}),(0,s.jsx)("div",{classname:y().item,children:(0,s.jsx)(p.z,{href:"/career",classname:y().link,children:e("common_career")})}),(0,s.jsx)("div",{classname:y().item,children:(0,s.jsx)(p.z,{href:"/blog",classname:y().link,children:e("common_wizard_blog")})})]}),r||i||(0,s.jsx)("div",{classname:y().divider}),(0,s.jsxs)("div",{classname:y().topgriditem,children:[(0,s.jsx)("div",{classname:y().item,children:(0,s.jsx)("a",{href:"http://183.234.21.121:12618/login",target:"_blank",rel:"noreferrer",classname:y().link,children:e("common_investor_login")})}),(0,s.jsx)("div",{classname:y().item,children:(0,s.jsx)(p.z,{href:"/privacy-cookie-policy",classname:y().link,children:e("common_privacy_cookies_policy")})}),(0,s.jsx)("div",{classname:y().item,children:(0,s.jsx)(p.z,{href:"/terms-of-use",classname:y().link,children:e("common_terms_of_use")})})]})]})}),(r||i)&&(0,s.jsx)("div",{classname:y().divider}),(0,s.jsxs)("div",{classname:y().column,children:[(0,s.jsxs)("div",{classname:y().item,children:[(0,s.jsx)("div",{classname:y().label,children:e("common_business_contact")}),(0,s.jsx)("div",{classname:y().sublabel,children:(0,s.jsx)("a",{href:"tel:021-61639673",children:"021-61639673"})})]}),(0,s.jsxs)("div",{classname:y().item,children:[(0,s.jsx)("div",{classname:y().label,children:e("common_media_inquiry")}),(0,s.jsx)("div",{classname:y().sublabel,children:(0,s.jsx)("a",{href:"mailto:media@wizardquant.com",children:"media@wizardquant.com"})})]}),(0,s.jsx)("div",{classname:y().divider}),a.map(e=>(0,s.jsxs)("div",{classname:y().item,children:[(0,s.jsx)("div",{classname:y().label,children:e.city}),(0,s.jsxs)("div",{classname:(0,j.z)(y().sublabel,y().address),onclick:()=>{(0,x.te)(e.address)},children:[(0,s.jsx)("span",{children:e.address}),(0,s.jsx)(b(),{src:"/assets/copy.svg",alt:"copy",height:16,width:16})]})]},e.city)),r||(0,s.jsx)("div",{classname:y().divider}),(0,s.jsxs)("div",{classname:y().sociallinks,children:[r&&(0,s.jsx)(p.z,{href:"/",style:{marginright:"auto"},children:(0,s.jsx)(b(),{src:"/assets/logo-with-text.svg",alt:"wizard quant",height:40,width:114})}),(0,s.jsxs)("div",{classname:(0,j.z)(y().tooltipwrapper,y().sociallink),children:[(0,s.jsx)("div",{classname:y().tooltip,children:(0,s.jsx)(b(),{src:"/assets/others/footer-wechat.jpg",alt:"wechat",height:176,width:176})}),(0,s.jsx)(b(),{src:"/assets/wechat.svg",alt:"wechat",height:48,width:48})]}),(0,s.jsx)("a",{href:"https://www.linkedin.com/company/wizardquant/",target:"_blank",rel:"noreferrer",classname:y().sociallink,children:(0,s.jsx)(b(),{src:"/assets/linkedin.svg",alt:"linkedin",height:48,width:48})})]})]})]})]}),(0,s.jsxs)("div",{classname:y().meta,children:[(0,s.jsxs)("div",{classname:y().metaitem,children:["\xa92013-",u()().format("yyyy")," wizard-quant all rights reserved."]}),(0,s.jsx)("div",{classname:y().metaitem,children:(0,s.jsx)("a",{href:"https://beian.miit.gov.cn/",target:"_blank",rel:"noreferrer",children:"沪icp备2023000089号"})}),(0,s.jsx)("div",{classname:y().metaitem,children:(0,s.jsxs)("a",{href:"https://www.beian.gov.cn/portal/registersysteminfo?recordcode=31011502019483",target:"_blank",rel:"noreferrer",children:[(0,s.jsx)(b(),{src:"/assets/beian.png",alt:"beian",height:22,width:20,style:{marginright:4,verticalalign:"middle"}}),(0,s.jsx)("span",{style:{verticalalign:"middle"},children:"沪公网安备31011502019483号"})]})}),"zh"===n.locale?(0,s.jsxs)("a",{href:"https://xyt.xcc.cn/getpcinfo?sn=1574605230576644096&language=cn&certtype=8&url=*.wizardquant.com",target:"_blank",style:{position:"relative"},classname:y().sslbutton,rel:"noreferrer",children:[(0,s.jsx)("div",{style:{width:"100%",height:"100%",position:"absolute",top:0,left:0}}),(0,s.jsx)("embed",{style:{display:"block"},src:"https://program.xinchacha.com/web/1574605230576644096=*.wizardquant.com.svg",width:"85",height:"26",type:"image/svg+xml",pluginspage:"//www.adobe.com/svg/viewer/install/"})]}):(0,s.jsxs)("a",{href:"https://xyt.xcc.cn/getpcinfo?sn=1574605230576644096&language=en&certtype=8&url=*.wizardquant.com",target:"_blank",style:{position:"relative"},classname:y().sslbutton,rel:"noreferrer",children:[(0,s.jsx)("div",{style:{width:"100%",height:"100%",position:"absolute",top:0,left:0}}),(0,s.jsx)("embed",{src:"https://program.xinchacha.com/web/1574605230576644096=*.wizardquant.comen.svg",width:"85",height:"26",type:"image/svg+xml",pluginspage:"//www.adobe.com/svg/viewer/install/"})]})]})]})};var q=r(5204),z=r(1526),$=r(3778);function ee(){return(ee=object.assign?object.assign.bind():function(e){for(var n=1;n{let{ismobile:n=!1,onselect:r}=e,i=(0,p.userouter)(),{showtransition:a}=(0,z.m)(),o=async e=>{r&&r(e);let{pathname:n,aspath:s,query:o}=i;await a(),i.push({pathname:n,query:o},s,{locale:e})};return(0,s.jsxs)("div",{classname:(0,j.z)(er().container,{[er().ismobile]:n}),children:[(0,s.jsx)("div",{classname:(0,j.z)(er().lang,er().zh,{[er().isactive]:"zh"===i.locale}),onclick:()=>o("zh"),children:"中"}),(0,s.jsx)("div",{classname:(0,j.z)(er().lang,{[er().isactive]:"en"===i.locale}),onclick:()=>o("en"),children:"e"})]})};var ea=r(7098),es=r(3221),eo=r.n(es);let el=e=>{let{enabled:n}=e,[r,i]=(0,f.usestate)({});return(0,f.useeffect)(()=>{if(!n)return;let e=0,r=(0,x.tv)([...array(9).keys()]),a=setinterval(()=>{let n=0;n=e<9?r[e]:(0,x.xf)(0,8);let a=(0,x.xf)(0,2);i(e=>({...e,[n]:ea.v9[a]})),e++},50);return()=>{a&&clearinterval(a),i({})}},[n]),(0,s.jsx)("div",{classname:eo().container,children:[...array(9)].map((e,n)=>(0,s.jsx)("div",{classname:eo().pixel,style:{backgroundcolor:r[n]||"transparent"}},n))})};var eu=r(4538),ec=r.n(eu);let eh={hidden:{height:0},show:{height:"auto",transition:{staggerchildren:.05,delaychildren:.2,stiffness:50}}},ed={hidden:{opacity:0,y:20},show:{opacity:1,y:0,transition:{duration:.3,ease:"easeout"}}},ep=e=>{let{transparentattop:n=!1,lightmode:r=!1}=e,i=(0,e.z)(),[a,o]=(0,f.usestate)(!0),[l,u]=(0,f.usestate)(!1),[c,h]=(0,f.usestate)(!1),{scrolly:d}=(0,q.v)();return(0,f.useeffect)(()=>(o(0===window.scrolly),d.onchange(e=>{o(0===e)})),[d]),(0,s.jsxs)("div",{classname:ec().container,children:[(0,s.jsx)("div",{id:"nav-top",classname:ec().accessories}),(0,s.jsxs)("div",{classname:(0,j.z)(ec().mobilecontainer,{[ec().lightmode]:r}),children:[(0,s.jsx)(p.z,{href:"/",classname:ec().mobilelogocontainer,onclick:()=>u(!1),children:(0,s.jsx)(b(),{src:r?"/assets/logo-with-text-color.svg":"/assets/logo-with-text-white.svg",alt:"wizard quant",width:92,height:32})}),(0,s.jsx)("div",{classname:(0,j.z)(ec().drawertoggle,{[ec().isactive]:l}),onclick:()=>{u(e=>!e)}}),(0,s.jsx)(z.m,{children:l&&(0,s.jsxs)($.e.div,{variants:eh,initial:"hidden",animate:"show",exit:"hidden",classname:ec().drawer,children:[(0,s.jsx)(p.z,{href:"/technologies",passhref:!0,legacybehavior:!0,children:(0,s.jsx)($.e.a,{classname:ec().mobilelink,variants:ed,onclick:()=>u(!1),children:i("technologies_title")})}),(0,s.jsx)(p.z,{href:"/about-us",passhref:!0,legacybehavior:!0,children:(0,s.jsx)($.e.a,{classname:ec().mobilelink,variants:ed,onclick:()=>u(!1),children:i("common_about_us")})}),(0,s.jsx)(p.z,{href:"/career",passhref:!0,legacybehavior:!0,children:(0,s.jsx)($.e.a,{classname:ec().mobilelink,variants:ed,onclick:()=>u(!1),children:i("common_career")})}),(0,s.jsx)(p.z,{href:"/blog",passhref:!0,legacybehavior:!0,children:(0,s.jsx)($.e.a,{classname:ec().mobilelink,variants:ed,onclick:()=>u(!1),children:i("common_wizard_blog")})}),(0,s.jsx)($.e.div,{classname:ec().mobiledivider,variants:ed}),(0,s.jsx)($.e.a,{href:"http://183.234.21.121:12618/login",classname:ec().mobilelink,variants:ed,onclick:()=>u(!1),target:"_blank",rel:"noreferrer",children:i("common_investor_login")}),(0,s.jsx)(p.z,{href:"/privacy-cookie-policy",passhref:!0,legacybehavior:!0,children:(0,s.jsx)($.e.a,{classname:ec().mobilelink,variants:ed,onclick:()=>u(!1),children:i("common_privacy_cookies_policy")})}),(0,s.jsx)(p.z,{href:"/terms-of-use",passhref:!0,legacybehavior:!0,children:(0,s.jsx)($.e.a,{classname:ec().mobilelink,variants:ed,onclick:()=>u(!1),children:i("common_terms_of_use")})}),(0,s.jsx)("div",{classname:ec().languagepicker,children:(0,s.jsx)(ei,{ismobile:!0,onselect:()=>u(!1)})})]})})]}),(0,s.jsxs)("div",{classname:(0,j.z)(ec().desktopcontainer,{[ec().havebg]:!n||!a,[ec().lightmode]:r}),children:[(0,s.jsxs)(p.z,{href:"/",classname:ec().logocontainer,onmouseenter:()=>h(!0),onmouseleave:()=>h(!1),children:[(0,s.jsx)(el,{enabled:c}),(0,s.jsx)(et,{style:{height:32,width:38}})]}),(0,s.jsxs)("div",{classname:ec().navitemcontainer,children:[(0,s.jsx)(p.z,{href:"/technologies",classname:ec().navitem,children:i("technologies_title")}),(0,s.jsx)(p.z,{href:"/about-us",classname:ec().navitem,children:i("common_about_us")}),(0,s.jsx)(p.z,{href:"/career",classname:ec().navitem,children:i("common_career")}),(0,s.jsx)(p.z,{href:"/blog",classname:ec().navitem,children:i("common_wizard_blog")})]}),(0,s.jsxs)("div",{classname:ec().actionscontainer,children:[(0,s.jsx)("a",{href:"http://183.234.21.121:12618/login",classname:(0,j.z)(ec().link,"color-brand-2"),style:{marginright:16},target:"_blank",rel:"noreferrer",children:i("common_investor_login")}),(0,s.jsx)(ei,{})]})]}),(0,s.jsx)("div",{id:"nav-bottom",classname:ec().accessories})]})};r(301),r(1712),u().extend(h());var ef=function(e){let{component:n,pageprops:r}=e,i=(0,p.userouter)();(0,f.useeffect)(()=>{o.l.preload("/assets/earth.glb","/draco-gltf/")},[]);let a=(0,f.usememo)(()=>!("/"===i.pathname||"/technologies"===i.pathname||i.pathname.startswith("/about-us")||i.pathname.startswith("/404")||i.pathname.startswith("/500")),[i.pathname]),l=(0,f.usememo)(()=>"/"===i.pathname||"/technologies"===i.pathname,[i.pathname]),u=(0,f.usememo)(()=>"/404"!==i.pathname&&"/500"!==i.pathname,[i.pathname]);return(0,f.useeffect)(()=>{"/404"===i.pathname||"/500"===i.pathname?document.documentelement.classlist.add("dark-bg"):document.documentelement.classlist.remove("dark-bg")},[i.pathname]),(0,s.jsxs)(s.fragment,{children:[(0,s.jsx)(m(),{src:"https://www.googletagmanager.com/gtag/js?id=g-7hde1rvg8g",strategy:"afterinteractive"}),(0,s.jsx)(m(),{id:"google-analytics",strategy:"afterinteractive",children:"\n window.datalayer = window.datalayer || [];\n function gtag(){window.datalayer.push(arguments);}\n gtag('js', new date());\n\n gtag('config', 'g-7hde1rvg8g');\n "}),(0,s.jsx)(a,{messages:r.messages,children:(0,s.jsx)(z.t,{children:(0,s.jsx)(g,{children:(0,s.jsx)(u.j,{children:(0,s.jsxs)(s.z,{children:[(0,s.jsx)(w,{}),(0,s.jsx)(ep,{lightmode:a,transparentattop:l}),(0,s.jsx)(n,{...r}),u&&(0,s.jsx)(q,{})]})})})})})]})}},8048:function(e,n,r){"use strict";function i(e,n){return e=math.ceil(e),math.floor(math.random()*((n=math.floor(n))-e+1))+e}function a(e){let n=e.length,r;for(;0!=n;)r=math.floor(math.random()*n),n--,[e[n],e[r]]=[e[r],e[n]];return e}function s(e){if(!navigator.clipboard){!function(e){var n=document.createelement("textarea");n.value=e,n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendchild(n),n.focus(),n.select();try{var r=document.execcommand("copy");console.log("fallback: copying text command was "+(r?"successful":"unsuccessful"))}catch(e){console.error("fallback: oops, unable to copy",e)}document.body.removechild(n)}(e);return}navigator.clipboard.writetext(e).then(function(){console.log("async: copying to clipboard was successful!")},function(e){console.error("async: could not copy text: ",e)})}r.d(n,{dc:function(){return u},nu:function(){return l},te:function(){return s},tv:function(){return a},xf:function(){return i},gb:function(){return h},nd:function(){return c},oh:function(){return d},uv:function(){return p}});let o=(e,n)=>math.abs(e)*n;function l(e,n,r){let{offset:i,velocity:a}=e,s=o(i.x,a.x);s<-1e4?r():s>1e4&&n()}let u=e=>new promise(n=>settimeout(n,e));function c(e,n){let r=e.getboundingclientrect(),i={height:e.clientheight,width:e.clientwidth},a=n.getboundingclientrect(),s=a.top>=r.top&&a.bottom<=r.top+i.height;s||(e.scrolltop+=a.top-r.top-r.height/2+a.height/2)}function h(e){let n=0==e?0:math.floor(math.log(e)/math.log(1024));return number((e/math.pow(1024,n)).tofixed(2))+" "+["b","kb","mb","gb","tb"][n]}function d(e){return string(e).tolowercase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-za-z\-0-9]+\.)+[a-za-z]{2,}))$/)}let p=(e,n,r)=>new promise((i,a)=>{let s=new xmlhttprequest;s.responsetype="json",s.upload.addeventlistener("progress",e=>r(e.loaded/e.total*100)),s.addeventlistener("load",()=>i({status:s.status,json:s.response})),s.addeventlistener("error",()=>a(error("file upload failed"))),s.addeventlistener("abort",()=>a(error("file upload aborted"))),s.open("put",e,!0),s.send(n)})},301:function(){},1712:function(){},7816:function(e){e.exports={container:"footer_container__jtcra",grid:"footer_grid__f0xsk",logocontainer:"footer_logocontainer__kliow",body:"footer_body__f19ov",column:"footer_column__vpqry",item:"footer_item__arf_s",link:"footer_link__gkikn",label:"footer_label__wewn9",sublabel:"footer_sublabel__c2uqu",divider:"footer_divider__odrzv",meta:"footer_meta__3hrh_",metaitem:"footer_metaitem__o5dpv",sslbutton:"footer_sslbutton__57iig",topgrid:"footer_topgrid___97ok",topgriditem:"footer_topgriditem__ldtfl",address:"footer_address__rjveg",sociallinks:"footer_sociallinks__h0mcf",sociallink:"footer_sociallink__n_ilb",tooltipwrapper:"footer_tooltipwrapper__zexlr",tooltip:"footer_tooltip__8atg0"}},11:function(e){e.exports={container:"languagepicker_container__pt7pp",ismobile:"languagepicker_ismobile__hz608",lang:"languagepicker_lang__x3cl0",zh:"languagepicker_zh__koiug",isactive:"languagepicker_isactive__pxs9x"}},3221:function(e){e.exports={container:"navlogoanimation_container__huvoi",pixel:"navlogoanimation_pixel__0cjpe"}},4538:function(e){e.exports={container:"navbar_container__hki0p",desktopcontainer:"navbar_desktopcontainer__vjt1l",havebg:"navbar_havebg__idqpx",lightmode:"navbar_lightmode__0sr5d",logocontainer:"navbar_logocontainer__pudkd",navitemcontainer:"navbar_navitemcontainer__ngkjv",navitem:"navbar_navitem__uuc9n",actionscontainer:"navbar_actionscontainer__ceorr",divider:"navbar_divider__nruqy",link:"navbar_link__m2i_h",mobilecontainer:"navbar_mobilecontainer__3w2w4",mobilelogocontainer:"navbar_mobilelogocontainer__o3_jy",drawertoggle:"navbar_drawertoggle__5o41p",isactive:"navbar_isactive__n7sjs",drawer:"navbar_drawer__f1ukk",mobiledivider:"navbar_mobiledivider__4_prw",mobilelink:"navbar_mobilelink__r0pwo",accessories:"navbar_accessories__ogo5z",languagepicker:"navbar_languagepicker__fawok"}},5151:function(e){e.exports={container:"pixelbutton_container__azbve",ishover:"pixelbutton_ishover__iawt1",label:"pixelbutton_label__xi8cn",compactonmobile:"pixelbutton_compactonmobile__ukro5",light:"pixelbutton_light__fudop",suffix:"pixelbutton_suffix__sapnw",bg:"pixelbutton_bg__zhxzs",pixelrow:"pixelbutton_pixelrow__d1c7y",pixel:"pixelbutton_pixel__j_9nu"}},3683:function(e){e.exports={canvas:"pixelcanvas_canvas__wjete",row:"pixelcanvas_row__bsm1g",pixel:"pixelcanvas_pixel__ipsjk"}},9969:function(e){e.exports={container:"cookieconsent_container__9drl1",closebutton:"cookieconsent_closebutton__q5xq_",body:"cookieconsent_body__8tkqh",title:"cookieconsent_title__hwbw3",paragraph:"cookieconsent_paragraph__ojghp"}},9008:function(e,n,r){e.exports=r(3121)},5675:function(e,n,r){e.exports=r(9749)},1664:function(e,n,r){e.exports=r(1551)},1163:function(e,n,r){e.exports=r(880)},4298:function(e,n,r){e.exports=r(3573)},6511:function(e,n){"use strict";/** * @license react * react-reconciler-constants.production.min.js * * copyright (c) facebook, inc. and its affiliates. * * this source code is licensed under the mit license found in the * license file in the root directory of this source tree. */n.concurrentroot=1,n.continuouseventpriority=4,n.defaulteventpriority=16,n.discreteeventpriority=1},7287:function(e,n,r){/** * @license react * react-reconciler.production.min.js * * copyright (c) facebook, inc. and its affiliates. * * this source code is licensed under the mit license found in the * license file in the root directory of this source tree. */e.exports=function(e){"use strict";var n,i,a,s,o,l={},u=r(7294),c=r(373),h=object.assign;function d(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r--l||a[o]!==s[l]){var u="\n"+a[o].replace(" at new "," at ");return e.displayname&&u.includes("")&&(u=u.replace("",e.displayname)),u}while(1<=o&&0<=l);break}}}finally{e4=!1,error.preparestacktrace=r}return(e=e?e.displayname||e.name:"")?e3(e):""}var e5=object.prototype.hasownproperty,e9=[],e8=-1;function e7(e){return{current:e}}function te(e){0>e8||(e.current=e9[e8],e9[e8]=null,e8--)}function tt(e,n){e9[++e8]=e.current,e.current=n}var tn={},tr=e7(tn),ti=e7(!1),ta=tn;function ts(e,n){var r=e.type.contexttypes;if(!r)return tn;var i=e.statenode;if(i&&i.__reactinternalmemoizedunmaskedchildcontext===n)return i.__reactinternalmemoizedmaskedchildcontext;var a,s={};for(a in r)s[a]=n[a];return i&&((e=e.statenode).__reactinternalmemoizedunmaskedchildcontext=n,e.__reactinternalmemoizedmaskedchildcontext=s),s}function to(e){return null!=(e=e.childcontexttypes)}function tl(){te(ti),te(tr)}function tu(e,n,r){if(tr.current!==tn)throw error(d(168));tt(tr,n),tt(ti,r)}function tc(e,n,r){var i=e.statenode;if(n=n.childcontexttypes,"function"!=typeof i.getchildcontext)return r;for(var a in i=i.getchildcontext())if(!(a in n))throw error(d(108,function(e){var n=e.type;switch(e.tag){case 24:return"cache";case 9:return(n.displayname||"context")+".consumer";case 10:return(n._context.displayname||"context")+".provider";case 18:return"dehydratedfragment";case 11:return e=(e=n.render).displayname||e.name||"",n.displayname||(""!==e?"forwardref("+e+")":"forwardref");case 7:return"fragment";case 5:return n;case 4:return"portal";case 3:return"root";case 6:return"text";case 16:return b(n);case 8:return n===v?"strictmode":"mode";case 22:return"offscreen";case 12:return"profiler";case 21:return"scope";case 13:return"suspense";case 19:return"suspenselist";case 25:return"tracingmarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof n)return n.displayname||n.name||null;if("string"==typeof n)return n}return null}(e)||"unknown",a));return h({},r,i)}function th(e){return e=(e=e.statenode)&&e.__reactinternalmemoizedmergedchildcontext||tn,ta=tr.current,tt(tr,e),tt(ti,ti.current),!0}function td(e,n,r){var i=e.statenode;if(!i)throw error(d(169));r?(e=tc(e,n,ta),i.__reactinternalmemoizedmergedchildcontext=e,te(ti),te(tr),tt(tr,e)):te(ti),tt(ti,r)}var tp=math.clz32?math.clz32:function(e){return 0==(e>>>=0)?32:31-(tf(e)/tm|0)|0},tf=math.log,tm=math.ln2,tg=64,tv=4194304;function ty(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function tx(e,n){var r=e.pendinglanes;if(0===r)return 0;var i=0,a=e.suspendedlanes,s=e.pingedlanes,o=268435455&r;if(0!==o){var l=o&~a;0!==l?i=ty(l):0!=(s&=o)&&(i=ty(s))}else 0!=(o=r&~a)?i=ty(o):0!==s&&(i=ty(s));if(0===i)return 0;if(0!==n&&n!==i&&0==(n&a)&&((a=i&-i)>=(s=n&-n)||16===a&&0!=(4194240&s)))return n;if(0!=(4&i)&&(i|=16&r),0!==(n=e.entangledlanes))for(e=e.entanglements,n&=i;0r;r++)n.push(e);return n}function tb(e,n,r){e.pendinglanes|=n,536870912!==n&&(e.suspendedlanes=0,e.pingedlanes=0),(e=e.eventtimes)[n=31-tp(n)]=r}function tm(e,n){var r=e.entangledlanes|=n;for(e=e.entanglements;r;){var i=31-tp(r),a=1<>=o,a-=o,nm=1<<32-tp(n)+a|r<f?(m=d,d=null):m=d.sibling;var g=v(a,d,l[f],u);if(null===g){null===d&&(d=m);break}e&&d&&null===g.alternate&&n(a,d),o=s(g,o,f),null===h?c=g:h.sibling=g,h=g,d=m}if(f===l.length)return r(a,d),nm&&nv(a,f),c;if(null===d){for(;fm?(g=f,f=null):g=f.sibling;var _=v(a,f,x.value,u);if(null===_){null===f&&(f=g);break}e&&f&&null===_.alternate&&n(a,f),o=s(_,o,m),null===h?c=_:h.sibling=_,h=_,f=g}if(x.done)return r(a,f),nm&&nv(a,m),c;if(null===f){for(;!x.done;m++,x=l.next())null!==(x=p(a,x.value,u))&&(o=s(x,o,m),null===h?c=x:h.sibling=x,h=x);return nm&&nv(a,m),c}for(f=i(a,f);!x.done;m++,x=l.next())null!==(x=y(f,a,m,x.value,u))&&(e&&null!==x.alternate&&f.delete(null===x.key?m:x.key),o=s(x,o,m),null===h?c=x:h.sibling=x,h=x);return e&&f.foreach(function(e){return n(a,e)}),nm&&nv(a,m),c}(u,c,h,x);nf(u,h)}return"string"==typeof h&&""!==h||"number"==typeof h?(h=""+h,null!==c&&6===c.tag?(r(u,c.sibling),(c=a(c,h)).return=u,u=c):(r(u,c),(c=aw(h,u.mode,x)).return=u,u=c),o(u)):r(u,c)}}var nk=nn(!0),nh=nn(!1),ng={},nu=e7(ng),nz=e7(ng),nv=e7(ng);function nj(e){if(e===ng)throw error(d(174));return e}function nw(e,n){tt(nv,n),tt(nz,e),tt(nu,ng),e=n(n),te(nu),tt(nu,e)}function nj(){te(nu),te(nz),te(nv)}function nx(e){var n=nj(nv.current),r=nj(nu.current);n=k(r,e.type,n),r!==n&&(tt(nz,e),tt(nu,n))}function nk(e){nz.current===e&&(te(nu),te(nz))}var ny=e7(0);function nq(e){for(var n=e;null!==n;){if(13===n.tag){var r=n.memoizedstate;if(null!==r&&(null===(r=r.dehydrated)||eh(r)||eg(r)))return n}else if(19===n.tag&&void 0!==n.memoizedprops.revealorder){if(0!=(128&n.flags))return n}else if(null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var nq=[];function nz(){for(var e=0;er?r:4,e(!0);var i=n0.transition;n0.transition={};try{e(!1),n()}finally{ts=r,n0.transition=i}}function rb(){return ri().memoizedstate}function rp(e,n,r){var i=ad(e);r={lane:i,action:r,haseagerstate:!1,eagerstate:null,next:null},rl(e)?ri(n,r):(rd(e,n,r),null!==(e=ap(e,i,r=ah()))&&rf(e,n,i))}function rr(e,n,r){var i=ad(e),a={lane:i,action:r,haseagerstate:!1,eagerstate:null,next:null};if(rl(e))ri(n,a);else{rd(e,n,a);var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=n.lastrenderedreducer))try{var o=n.lastrenderedstate,l=s(o,r);if(a.haseagerstate=!0,a.eagerstate=l,tn(l,o))return}catch(e){}finally{}null!==(e=ap(e,i,r=ah()))&&rf(e,n,i)}}function rl(e){var n=e.alternate;return e===n2||null!==n&&n===n2}function ri(e,n){n5=n6=!0;var r=e.pending;null===r?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function rd(e,n,r){null!==iq&&0!=(1&e.mode)&&0==(2&iy)?(null===(e=n.interleaved)?(r.next=r,null===t1?t1=[n]:t1.push(n)):(r.next=e.next,e.next=r),n.interleaved=r):(null===(e=n.pending)?r.next=r:(r.next=e.next,e.next=r),n.pending=r)}function rf(e,n,r){if(0!=(4194240&r)){var i=n.lanes;i&=e.pendinglanes,r|=i,n.lanes=r,tm(e,r)}}var ro={readcontext:t0,usecallback:n7,usecontext:n7,useeffect:n7,useimperativehandle:n7,useinsertioneffect:n7,uselayouteffect:n7,usememo:n7,usereducer:n7,useref:n7,usestate:n7,usedebugvalue:n7,usedeferredvalue:n7,usetransition:n7,usemutablesource:n7,usesyncexternalstore:n7,useid:n7,unstable_isnewreconciler:!1},rn={readcontext:t0,usecallback:function(e,n){return rr().memoizedstate=[e,void 0===n?null:n],e},usecontext:t0,useeffect:rx,useimperativehandle:function(e,n,r){return r=null!=r?r.concat([e]):null,rv(4194308,4,rm.bind(null,n,e),r)},uselayouteffect:function(e,n){return rv(4194308,4,e,n)},useinsertioneffect:function(e,n){return rv(4,2,e,n)},usememo:function(e,n){var r=rr();return n=void 0===n?null:n,e=e(),r.memoizedstate=[e,n],e},usereducer:function(e,n,r){var i=rr();return n=void 0!==r?r(n):n,i.memoizedstate=i.basestate=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastrenderedreducer:e,lastrenderedstate:n},i.queue=e,e=e.dispatch=rp.bind(null,n2,e),[i.memoizedstate,e]},useref:function(e){return e={current:e},rr().memoizedstate=e},usestate:rf,usedebugvalue:rw,usedeferredvalue:function(e){var n=rf(e),r=n[0],i=n[1];return rx(function(){var n=n0.transition;n0.transition={};try{i(e)}finally{n0.transition=n}},[e]),r},usetransition:function(){var e=rf(!1),n=e[0];return e=rt.bind(null,e[1]),rr().memoizedstate=e,[n,e]},usemutablesource:function(){},usesyncexternalstore:function(e,n,r){var i=n2,a=rr();if(nm){if(void 0===r)throw error(d(407));r=r()}else{if(r=n(),null===iq)throw error(d(349));0!=(30&n1)||rc(i,n,r)}a.memoizedstate=r;var s={value:r,getsnapshot:n};return a.queue=s,rx(rd.bind(null,i,s,e),[e]),i.flags|=2048,rm(9,rh.bind(null,i,s,r,n),void 0,null),r},useid:function(){var e=rr(),n=iq.identifierprefix;if(nm){var r=ng,i=nm;n=":"+n+"r"+(r=(i&~(1<<32-tp(i)-1)).tostring(32)+r),0<(r=n9++)&&(n+="h"+r.tostring(32)),n+=":"}else n=":"+n+"r"+(r=n8++).tostring(32)+":";return e.memoizedstate=n},unstable_isnewreconciler:!1},rk={readcontext:t0,usecallback:rc,usecontext:t0,useeffect:r_,useimperativehandle:rs,useinsertioneffect:ra,uselayouteffect:rb,usememo:re,usereducer:rs,useref:rg,usestate:function(){return rs(ra)},usedebugvalue:rw,usedeferredvalue:function(e){var n=rs(ra),r=n[0],i=n[1];return r_(function(){var n=n0.transition;n0.transition={};try{i(e)}finally{n0.transition=n}},[e]),r},usetransition:function(){return[rs(ra)[0],ri().memoizedstate]},usemutablesource:rl,usesyncexternalstore:ru,useid:rb,unstable_isnewreconciler:!1},rh={readcontext:t0,usecallback:rc,usecontext:t0,useeffect:r_,useimperativehandle:rs,useinsertioneffect:ra,uselayouteffect:rb,usememo:re,usereducer:ro,useref:rg,usestate:function(){return ro(ra)},usedebugvalue:rw,usedeferredvalue:function(e){var n=ro(ra),r=n[0],i=n[1];return r_(function(){var n=n0.transition;n0.transition={};try{i(e)}finally{n0.transition=n}},[e]),r},usetransition:function(){return[ro(ra)[0],ri().memoizedstate]},usemutablesource:rl,usesyncexternalstore:ru,useid:rb,unstable_isnewreconciler:!1};function rg(e,n){try{var r="",i=n;do r+=function(e){switch(e.tag){case 5:return e3(e.type);case 16:return e3("lazy");case 13:return e3("suspense");case 19:return e3("suspenselist");case 0:case 2:case 15:return e=e6(e.type,!1);case 11:return e=e6(e.type.render,!1);case 1:return e=e6(e.type,!0);default:return""}}(i),i=i.return;while(i);var a=r}catch(e){a="\nerror generating stack: "+e.message+"\n"+e.stack}return{value:e,source:n,stack:a}}function ru(e,n){try{console.error(n.value)}catch(e){settimeout(function(){throw e})}}var rz="function"==typeof weakmap?weakmap:map;function rv(e,n,r){(r=t6(-1,r)).tag=3,r.payload={element:null};var i=n.value;return r.callback=function(){at||(at=!0,an=i),ru(e,n)},r}function rj(e,n,r){(r=t6(-1,r)).tag=3;var i=e.type.getderivedstatefromerror;if("function"==typeof i){var a=n.value;r.payload=function(){return i(a)},r.callback=function(){ru(e,n)}}var s=e.statenode;return null!==s&&"function"==typeof s.componentdidcatch&&(r.callback=function(){ru(e,n),"function"!=typeof i&&(null===ar?ar=new set([this]):ar.add(this));var r=n.stack;this.componentdidcatch(n.value,{componentstack:null!==r?r:""})}),r}function rw(e,n,r){var i=e.pingcache;if(null===i){i=e.pingcache=new rz;var a=new set;i.set(n,a)}else void 0===(a=i.get(n))&&(a=new set,i.set(n,a));a.has(r)||(a.add(r),e=ad.bind(null,e,n,r),n.then(e,e))}function rj(e){do{var n;if((n=13===e.tag)&&(n=null===(n=e.memoizedstate)||null!==n.dehydrated),n)return e;e=e.return}while(null!==e);return null}function rx(e,n,r,i,a){return 0==(1&e.mode)?(e===n?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((n=t6(-1,1)).tag=2,t5(r,n))),r.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}function rk(e){e.flags|=4}function ry(e,n){if(null!==e&&e.child===n.child)return!0;if(0!=(16&n.flags))return!1;for(e=n.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeflags))return!1;e=e.sibling}return!0}if(q)n=function(e,n){for(var r=n.child;null!==r;){if(5===r.tag||6===r.tag)z(e,r.statenode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===n)break;for(;null===r.sibling;){if(null===r.return||r.return===n)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},i=function(){},a=function(e,n,r,i,a){(e=e.memoizedprops)!==i&&(r=j(n.statenode,r,e,i,a,nj(nu.current)),(n.updatequeue=r)&&rk(n))},s=function(e,n,r,i){r!==i&&rk(n)};else if(z){n=function(e,r,i,a){for(var s=r.child;null!==s;){if(5===s.tag){var o=s.statenode;i&&a&&(o=ed(o,s.type,s.memoizedprops,s)),z(e,o)}else if(6===s.tag)o=s.statenode,i&&a&&(o=ef(o,s.memoizedprops,s)),z(e,o);else if(4!==s.tag){if(22===s.tag&&null!==s.memoizedstate)null!==(o=s.child)&&(o.return=s),n(e,s,!0,!0);else if(null!==s.child){s.child.return=s,s=s.child;continue}}if(s===r)break;for(;null===s.sibling;){if(null===s.return||s.return===r)return;s=s.return}s.sibling.return=s.return,s=s.sibling}};var rq=function(e,n,r,i){for(var a=n.child;null!==a;){if(5===a.tag){var s=a.statenode;r&&i&&(s=ed(s,a.type,a.memoizedprops,a)),er(e,s)}else if(6===a.tag)s=a.statenode,r&&i&&(s=ef(s,a.memoizedprops,a)),er(e,s);else if(4!==a.tag){if(22===a.tag&&null!==a.memoizedstate)null!==(s=a.child)&&(s.return=a),rq(e,a,!0,!0);else if(null!==a.child){a.child.return=a,a=a.child;continue}}if(a===n)break;for(;null===a.sibling;){if(null===a.return||a.return===n)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};i=function(e,n){var r=n.statenode;if(!ry(e,n)){var i=ep(e=r.containerinfo);rq(i,n,!1,!1),r.pendingchildren=i,rk(n),el(e,i)}},a=function(e,r,i,a,s){var o=e.statenode,l=e.memoizedprops;if((e=ry(e,r))&&l===a)r.statenode=o;else{var u=r.statenode,c=nj(nu.current),h=null;l!==a&&(h=j(u,i,l,a,s,c)),e&&null===h?r.statenode=o:(v(o=eb(o,h,i,l,a,r,e,u),i,a,s,c)&&rk(r),r.statenode=o,e?rk(r):n(o,r,!1,!1))}},s=function(e,n,r,i){r!==i?(e=nj(nv.current),r=nj(nu.current),n.statenode=j(i,e,r,n),rk(n)):n.statenode=e.statenode}}else i=function(){},a=function(){},s=function(){};function rq(e,n){if(!nm)switch(e.tailmode){case"hidden":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;null!==r;)null!==r.alternate&&(i=r),r=r.sibling;null===i?n||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null}}function rz(e){var n=null!==e.alternate&&e.alternate.child===e.child,r=0,i=0;if(n)for(var a=e.child;null!==a;)r|=a.lanes|a.childlanes,i|=14680064&a.subtreeflags,i|=14680064&a.flags,a.return=e,a=a.sibling;else for(a=e.child;null!==a;)r|=a.lanes|a.childlanes,i|=a.subtreeflags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeflags|=i,e.childlanes=r,n}var r$=p.reactcurrentowner,r0=!1;function r1(e,n,r,i){n.child=null===e?nh(n,null,r,i):nk(n,e.child,r,i)}function r2(e,n,r,i,a){r=r.render;var s=n.ref;return(t$(n,a),i=rt(e,n,r,i,s,a),r=rn(),null===e||r0)?(nm&&r&&nx(n),n.flags|=1,r1(e,n,i,a),n.child):(n.updatequeue=e.updatequeue,n.flags&=-2053,e.lanes&=~a,ih(e,n,a))}function r3(e,n,r,i,a){if(null===e){var s=r.type;return"function"!=typeof s||ag(s)||void 0!==s.defaultprops||null!==r.compare||void 0!==r.defaultprops?((e=az(r.type,null,i,n,n.mode,a)).ref=n.ref,e.return=n,n.child=e):(n.tag=15,n.type=s,r4(e,n,s,i,a))}if(s=e.child,0==(e.lanes&a)){var o=s.memoizedprops;if((r=null!==(r=r.compare)?r:tv)(o,i)&&e.ref===n.ref)return ih(e,n,a)}return n.flags|=1,(e=au(s,i)).ref=n.ref,e.return=n,n.child=e}function r4(e,n,r,i,a){if(null!==e&&tv(e.memoizedprops,i)&&e.ref===n.ref){if(r0=!1,0==(e.lanes&a))return n.lanes=e.lanes,ih(e,n,a);0!=(131072&e.flags)&&(r0=!0)}return r9(e,n,r,i,a)}function r6(e,n,r){var i=n.pendingprops,a=i.children,s=null!==e?e.memoizedstate:null;if("hidden"===i.mode){if(0==(1&n.mode))n.memoizedstate={baselanes:0,cachepool:null},tt(i0,i$),i$|=r;else{if(0==(1073741824&r))return e=null!==s?s.baselanes|r:r,n.lanes=n.childlanes=1073741824,n.memoizedstate={baselanes:e,cachepool:null},n.updatequeue=null,tt(i0,i$),i$|=e,null;n.memoizedstate={baselanes:0,cachepool:null},i=null!==s?s.baselanes:r,tt(i0,i$),i$|=i}}else null!==s?(i=s.baselanes|r,n.memoizedstate=null):i=r,tt(i0,i$),i$|=i;return r1(e,n,a,r),n.child}function r5(e,n){var r=n.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(n.flags|=512,n.flags|=2097152)}function r9(e,n,r,i,a){var s=to(r)?ta:tr.current;return(s=ts(n,s),t$(n,a),r=rt(e,n,r,i,s,a),i=rn(),null===e||r0)?(nm&&i&&nx(n),n.flags|=1,r1(e,n,r,a),n.child):(n.updatequeue=e.updatequeue,n.flags&=-2053,e.lanes&=~a,ih(e,n,a))}function r8(e,n,r,i,a){if(to(r)){var s=!0;th(n)}else s=!1;if(t$(n,a),null===n.statenode)null!==e&&(e.alternate=null,n.alternate=null,n.flags|=2),na(n,r,i),no(n,r,i,a),i=!0;else if(null===e){var o=n.statenode,l=n.memoizedprops;o.props=l;var u=o.context,c=r.contexttype;c="object"==typeof c&&null!==c?t0(c):ts(n,c=to(r)?ta:tr.current);var h=r.getderivedstatefromprops,d="function"==typeof h||"function"==typeof o.getsnapshotbeforeupdate;d||"function"!=typeof o.unsafe_componentwillreceiveprops&&"function"!=typeof o.componentwillreceiveprops||(l!==i||u!==c)&&ns(n,o,i,c),t2=!1;var p=n.memoizedstate;o.state=p,t7(n,i,o,a),u=n.memoizedstate,l!==i||p!==u||ti.current||t2?("function"==typeof h&&(nn(n,r,h,i),u=n.memoizedstate),(l=t2||ni(n,r,l,i,p,u,c))?(d||"function"!=typeof o.unsafe_componentwillmount&&"function"!=typeof o.componentwillmount||("function"==typeof o.componentwillmount&&o.componentwillmount(),"function"==typeof o.unsafe_componentwillmount&&o.unsafe_componentwillmount()),"function"==typeof o.componentdidmount&&(n.flags|=4194308)):("function"==typeof o.componentdidmount&&(n.flags|=4194308),n.memoizedprops=i,n.memoizedstate=u),o.props=i,o.state=u,o.context=c,i=l):("function"==typeof o.componentdidmount&&(n.flags|=4194308),i=!1)}else{o=n.statenode,t4(e,n),l=n.memoizedprops,c=n.type===n.elementtype?l:tj(n.type,l),o.props=c,d=n.pendingprops,p=o.context,u="object"==typeof(u=r.contexttype)&&null!==u?t0(u):ts(n,u=to(r)?ta:tr.current);var f=r.getderivedstatefromprops;(h="function"==typeof f||"function"==typeof o.getsnapshotbeforeupdate)||"function"!=typeof o.unsafe_componentwillreceiveprops&&"function"!=typeof o.componentwillreceiveprops||(l!==d||p!==u)&&ns(n,o,i,u),t2=!1,p=n.memoizedstate,o.state=p,t7(n,i,o,a);var m=n.memoizedstate;l!==d||p!==m||ti.current||t2?("function"==typeof f&&(nn(n,r,f,i),m=n.memoizedstate),(c=t2||ni(n,r,c,i,p,m,u)||!1)?(h||"function"!=typeof o.unsafe_componentwillupdate&&"function"!=typeof o.componentwillupdate||("function"==typeof o.componentwillupdate&&o.componentwillupdate(i,m,u),"function"==typeof o.unsafe_componentwillupdate&&o.unsafe_componentwillupdate(i,m,u)),"function"==typeof o.componentdidupdate&&(n.flags|=4),"function"==typeof o.getsnapshotbeforeupdate&&(n.flags|=1024)):("function"!=typeof o.componentdidupdate||l===e.memoizedprops&&p===e.memoizedstate||(n.flags|=4),"function"!=typeof o.getsnapshotbeforeupdate||l===e.memoizedprops&&p===e.memoizedstate||(n.flags|=1024),n.memoizedprops=i,n.memoizedstate=m),o.props=i,o.state=m,o.context=u,i=c):("function"!=typeof o.componentdidupdate||l===e.memoizedprops&&p===e.memoizedstate||(n.flags|=4),"function"!=typeof o.getsnapshotbeforeupdate||l===e.memoizedprops&&p===e.memoizedstate||(n.flags|=1024),i=!1)}return r7(e,n,r,i,s,a)}function r7(e,n,r,i,a,s){r5(e,n);var o=0!=(128&n.flags);if(!i&&!o)return a&&td(n,r,!1),ih(e,n,s);i=n.statenode,r$.current=n;var l=o&&"function"!=typeof r.getderivedstatefromerror?null:i.render();return n.flags|=1,null!==e&&o?(n.child=nk(n,e.child,null,s),n.child=nk(n,null,l,s)):r1(e,n,l,s),n.memoizedstate=i.state,a&&td(n,r,!0),n.child}function ie(e){var n=e.statenode;n.pendingcontext?tu(e,n.pendingcontext,n.pendingcontext!==n.context):n.context&&tu(e,n.context,!1),nw(e,n.containerinfo)}function it(e,n,r,i,a){return nl(),ni(a),n.flags|=256,r1(e,n,r,i),n.child}var ir={dehydrated:null,treecontext:null,retrylane:0};function ii(e){return{baselanes:e,cachepool:null}}function ia(e,n,r){var i,a,s,o,l,u,c,h,p,f,m,g,v,y,x=n.pendingprops,_=ny.current,a=!1,b=0!=(128&n.flags);if((y=b)||(y=(null===e||null!==e.memoizedstate)&&0!=(2&_)),y?(a=!0,n.flags&=-129):(null===e||null!==e.memoizedstate)&&(_|=1),tt(ny,1&_),null===e)return(nb(n),null!==(e=n.memoizedstate)&&null!==(e=e.dehydrated))?(0==(1&n.mode)?n.lanes=1:eg(e)?n.lanes=8:n.lanes=1073741824,null):(_=x.children,e=x.fallback,a?(x=n.mode,a=n.child,_={mode:"hidden",children:_},0==(1&x)&&null!==a?(a.childlanes=0,a.pendingprops=_):a=aj(_,x,0,null),e=av(e,x,r,null),a.return=n,e.return=n,a.sibling=e,n.child=a,n.child.memoizedstate=ii(r),n.memoizedstate=ir,e):is(n,_));if(null!==(_=e.memoizedstate)&&null!==(y=_.dehydrated)){if(b)return 256&n.flags?(n.flags&=-257,io(e,n,r,error(d(422)))):null!==n.memoizedstate?(n.child=e.child,n.flags|=128,null):(a=x.fallback,_=n.mode,x=aj({mode:"visible",children:x.children},_,0,null),a=av(a,_,r,null),a.flags|=2,x.return=n,a.return=n,x.sibling=a,n.child=x,0!=(1&n.mode)&&nk(n,e.child,null,r),n.child.memoizedstate=ii(r),n.memoizedstate=ir,a);if(0==(1&n.mode))n=io(e,n,r,null);else if(eg(y))n=io(e,n,r,error(d(419)));else if(x=0!=(r&e.childlanes),r0||x){if(null!==(x=iq)){switch(r&-r){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(x=0!=(a&(x.suspendedlanes|r))?0:a)&&x!==_.retrylane&&(_.retrylane=x,ap(e,x,-1))}ac(),n=io(e,n,r,error(d(421)))}else eh(y)?(n.flags|=128,n.child=e.child,eu(y,n=ao.bind(null,e)),n=null):(r=_.treecontext,$&&(nb=ew(y),na=n,nm=!0,nw=null,ns=!1,null!==r&&(nd[np++]=nm,nd[np++]=ng,nd[np++]=nf,nm=r.id,ng=r.overflow,nf=n)),n=is(n,n.pendingprops.children),n.flags|=4096);return n}return a?(i=e,a=n,s=x.children,o=x.fallback,l=r,u=a.mode,c=(i=i.child).sibling,h={mode:"hidden",children:s},0==(1&u)&&a.child!==i?((s=a.child).childlanes=0,s.pendingprops=h,a.deletions=null):(s=au(i,h)).subtreeflags=14680064&i.subtreeflags,null!==c?o=au(c,o):(o=av(o,u,l,null),o.flags|=2),o.return=a,s.return=a,s.sibling=o,a.child=s,x=o,a=n.child,_=e.child.memoizedstate,a.memoizedstate=null===_?ii(r):{baselanes:_.baselanes|r,cachepool:null},a.childlanes=e.childlanes&~r,n.memoizedstate=ir,x):(p=e,f=n,m=x.children,g=r,p=(v=p.child).sibling,m=au(v,{mode:"visible",children:m}),0==(1&f.mode)&&(m.lanes=g),m.return=f,m.sibling=null,null!==p&&(null===(g=f.deletions)?(f.deletions=[p],f.flags|=16):g.push(p)),r=f.child=m,n.memoizedstate=null,r)}function is(e,n){return(n=aj({mode:"visible",children:n},e.mode,0,null)).return=e,e.child=n}function io(e,n,r,i){return null!==i&&ni(i),nk(n,e.child,null,r),e=is(n,n.pendingprops.children),e.flags|=2,n.memoizedstate=null,e}function il(e,n,r){e.lanes|=n;var i=e.alternate;null!==i&&(i.lanes|=n),tz(e.return,n,r)}function iu(e,n,r,i,a){var s=e.memoizedstate;null===s?e.memoizedstate={isbackwards:n,rendering:null,renderingstarttime:0,last:i,tail:r,tailmode:a}:(s.isbackwards=n,s.rendering=null,s.renderingstarttime=0,s.last=i,s.tail=r,s.tailmode=a)}function ic(e,n,r){var i=n.pendingprops,a=i.revealorder,s=i.tail;if(r1(e,n,i.children,r),0!=(2&(i=ny.current)))i=1&i|2,n.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=n.child;null!==e;){if(13===e.tag)null!==e.memoizedstate&&il(e,r,n);else if(19===e.tag)il(e,r,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(tt(ny,i),0==(1&n.mode))n.memoizedstate=null;else switch(a){case"forwards":for(a=null,r=n.child;null!==r;)null!==(e=r.alternate)&&null===nq(e)&&(a=r),r=r.sibling;null===(r=a)?(a=n.child,n.child=null):(a=r.sibling,r.sibling=null),iu(n,!1,a,r,s);break;case"backwards":for(r=null,a=n.child,n.child=null;null!==a;){if(null!==(e=a.alternate)&&null===nq(e)){n.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}iu(n,!0,r,null,s);break;case"together":iu(n,!1,null,null,void 0);break;default:n.memoizedstate=null}return n.child}function ih(e,n,r){if(null!==e&&(n.dependencies=e.dependencies),i3|=n.lanes,0==(r&n.childlanes))return null;if(null!==e&&n.child!==e.child)throw error(d(153));if(null!==n.child){for(r=au(e=n.child,e.pendingprops),n.child=r,r.return=n;null!==e.sibling;)e=e.sibling,(r=r.sibling=au(e,e.pendingprops)).return=n;r.sibling=null}return n.child}var id=!1,ip=!1,im="function"==typeof weakset?weakset:set,ig=null;function iv(e,n){var r=e.ref;if(null!==r){if("function"==typeof r)try{r(null)}catch(r){ai(e,n,r)}else r.current=null}}function iy(e,n,r){try{r()}catch(r){ai(e,n,r)}}var ix=!1;function i_(e,n,r){var i=n.updatequeue;if(null!==(i=null!==i?i.lasteffect:null)){var a=i=i.next;do{if((a.tag&e)===e){var s=a.destroy;a.destroy=void 0,void 0!==s&&iy(n,r,s)}a=a.next}while(a!==i)}}function ia(e,n){if(null!==(n=null!==(n=n.updatequeue)?n.lasteffect:null)){var r=n=n.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==n)}}function ib(e){var n=e.ref;if(null!==n){var r=e.statenode;e=5===e.tag?o(r):r,"function"==typeof n?n(e):n.current=e}}function im(e,n,r){if(to&&"function"==typeof to.oncommitfiberunmount)try{to.oncommitfiberunmount(tf,n)}catch(e){}switch(n.tag){case 0:case 11:case 14:case 15:if(null!==(e=n.updatequeue)&&null!==(e=e.lasteffect)){var i=e=e.next;do{var a=i,s=a.destroy;a=a.tag,void 0!==s&&(0!=(2&a)?iy(n,r,s):0!=(4&a)&&iy(n,r,s)),i=i.next}while(i!==e)}break;case 1:if(iv(n,r),"function"==typeof(e=n.statenode).componentwillunmount)try{e.props=n.memoizedprops,e.state=n.memoizedstate,e.componentwillunmount()}catch(e){ai(n,r,e)}break;case 5:iv(n,r);break;case 4:q?it(e,n,r):z&&z&&(r=ep(n=n.statenode.containerinfo),ei(n,r))}}function is(e,n,r){for(var i=n;;)if(im(e,i,r),null===i.child||q&&4===i.tag){if(i===n)break;for(;null===i.sibling;){if(null===i.return||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}else i.child.return=i,i=i.child}function iw(e){return 5===e.tag||3===e.tag||4===e.tag}function ic(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||iw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags||null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.statenode}}function ie(e){if(q){e:{for(var n=e.return;null!==n;){if(iw(n))break e;n=n.return}throw error(d(160))}var r=n;switch(r.tag){case 5:n=r.statenode,32&r.flags&&(em(n),r.flags&=-33),r=ic(e),function e(n,r,i){var a=n.tag;if(5===a||6===a)n=n.statenode,r?ex(i,n,r):ef(i,n);else if(4!==a&&null!==(n=n.child))for(e(n,r,i),n=n.sibling;null!==n;)e(n,r,i),n=n.sibling}(e,r,n);break;case 3:case 4:n=r.statenode.containerinfo,r=ic(e),function e(n,r,i){var a=n.tag;if(5===a||6===a)n=n.statenode,r?e_(i,n,r):em(i,n);else if(4!==a&&null!==(n=n.child))for(e(n,r,i),n=n.sibling;null!==n;)e(n,r,i),n=n.sibling}(e,r,n);break;default:throw error(d(161))}}}function it(e,n,r){for(var i,a,s=n,o=!1;;){if(!o){o=s.return;e:for(;;){if(null===o)throw error(d(160));switch(i=o.statenode,o.tag){case 5:a=!1;break e;case 3:case 4:i=i.containerinfo,a=!0;break e}o=o.return}o=!0}if(5===s.tag||6===s.tag)is(e,s,r),a?eb(i,s.statenode):ea(i,s.statenode);else if(18===s.tag)a?e$(i,s.statenode):ez(i,s.statenode);else if(4===s.tag){if(null!==s.child){i=s.statenode.containerinfo,a=!0,s.child.return=s,s=s.child;continue}}else if(im(e,s,r),null!==s.child){s.child.return=s,s=s.child;continue}if(s===n)break;for(;null===s.sibling;){if(null===s.return||s.return===n)return;4===(s=s.return).tag&&(o=!1)}s.sibling.return=s.return,s=s.sibling}}function ib(e,n){if(q){switch(n.tag){case 0:case 11:case 14:case 15:i_(3,n,n.return),ia(3,n),i_(5,n,n.return);return;case 1:case 12:case 17:return;case 5:var r=n.statenode;if(null!=r){var i=n.memoizedprops;e=null!==e?e.memoizedprops:i;var a=n.type,s=n.updatequeue;n.updatequeue=null,null!==s&&ey(r,s,a,e,i,n)}return;case 6:if(null===n.statenode)throw error(d(162));r=n.memoizedprops,eg(n.statenode,null!==e?e.memoizedprops:r,r);return;case 3:$&&null!==e&&e.memoizedstate.isdehydrated&&eq(n.statenode.containerinfo);return;case 13:case 19:ip(n);return}throw error(d(163))}switch(n.tag){case 0:case 11:case 14:case 15:i_(3,n,n.return),ia(3,n),i_(5,n,n.return);return;case 12:case 22:case 23:return;case 13:case 19:ip(n);return;case 3:$&&null!==e&&e.memoizedstate.isdehydrated&&eq(n.statenode.containerinfo)}e:if(z){switch(n.tag){case 1:case 5:case 6:break e;case 3:case 4:ei((n=n.statenode).containerinfo,n.pendingchildren);break e}throw error(d(163))}}function ip(e){var n=e.updatequeue;if(null!==n){e.updatequeue=null;var r=e.statenode;null===r&&(r=e.statenode=new im),n.foreach(function(n){var i=an.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ir(e){for(;null!==ig;){var n=ig;if(0!=(8772&n.flags)){var r=n.alternate;try{if(0!=(8772&n.flags))switch(n.tag){case 0:case 11:case 15:ip||ia(5,n);break;case 1:var i=n.statenode;if(4&n.flags&&!ip){if(null===r)i.componentdidmount();else{var a=n.elementtype===n.type?r.memoizedprops:tj(n.type,r.memoizedprops);i.componentdidupdate(a,r.memoizedstate,i.__reactinternalsnapshotbeforeupdate)}}var s=n.updatequeue;null!==s&&ne(n,s,i);break;case 3:var o=n.updatequeue;if(null!==o){if(r=null,null!==n.child)switch(n.child.tag){case 5:r=o(n.child.statenode);break;case 1:r=n.child.statenode}ne(n,o,r)}break;case 5:var l=n.statenode;null===r&&4&n.flags&&ev(l,n.type,n.memoizedprops,n);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:break;case 13:if($&&null===n.memoizedstate){var u=n.alternate;if(null!==u){var c=u.memoizedstate;if(null!==c){var h=c.dehydrated;null!==h&&eq(h)}}}break;default:throw error(d(163))}ip||512&n.flags&&ib(n)}catch(e){ai(n,n.return,e)}}if(n===e){ig=null;break}if(null!==(r=n.sibling)){r.return=n.return,ig=r;break}ig=n.return}}function il(e){for(;null!==ig;){var n=ig;if(n===e){ig=null;break}var r=n.sibling;if(null!==r){r.return=n.return,ig=r;break}ig=n.return}}function ii(e){for(;null!==ig;){var n=ig;try{switch(n.tag){case 0:case 11:case 15:var r=n.return;try{ia(4,n)}catch(e){ai(n,r,e)}break;case 1:var i=n.statenode;if("function"==typeof i.componentdidmount){var a=n.return;try{i.componentdidmount()}catch(e){ai(n,a,e)}}var s=n.return;try{ib(n)}catch(e){ai(n,s,e)}break;case 5:var o=n.return;try{ib(n)}catch(e){ai(n,o,e)}}}catch(e){ai(n,n.return,e)}if(n===e){ig=null;break}var l=n.sibling;if(null!==l){l.return=n.return,ig=l;break}ig=n.return}}var id=0,if=1,io=2,in=3,ik=4;if("function"==typeof symbol&&symbol.for){var ih=symbol.for;id=ih("selector.component"),if=ih("selector.has_pseudo_class"),io=ih("selector.role"),in=ih("selector.test_id"),ik=ih("selector.text")}function ig(e){var n=ee(e);if(null!=n){if("string"!=typeof n.memoizedprops["data-testname"])throw error(d(364));return n}if(null===(e=eo(e)))throw error(d(362));return e.statenode.current}function iu(e,n){switch(n.$$typeof){case id:if(e.type===n.value)return!0;break;case if:e:{n=n.value,e=[e,0];for(var r=0;r";case if:return":has("+(iz(e)||"")+")";case io:return'[role="'+e.value+'"]';case ik:return'"'+e.value+'"';case in:return'[data-testname="'+e.value+'"]';default:throw error(d(365))}}function iv(e,n){var r=[];e=[e,0];for(var i=0;ia&&(a=o),i&=~s}if(i=a,10<(i=(120>(i=tp()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*iw(i/1960))-i)){e.timeouthandle=x(ap.bind(null,e,i9),i);break}ap(e,i9);break;default:throw error(d(329))}}}return am(e,tp()),e.callbacknode===r?ag.bind(null,e):null}function av(e,n){var r=i5;return e.current.memoizedstate.isdehydrated&&(am(e,n).flags|=256),2!==(e=ae(e,n))&&(n=i9,i9=r,null!==n&&ay(n)),e}function ay(e){null===i9?i9=e:i9.push.apply(i9,e)}function ax(e,n){for(n&=~i6,n&=~i4,e.suspendedlanes|=n,e.pingedlanes&=~n,e=e.expirationtimes;0i7&&(r.flags|=128,l=!0,rq(u,!1),r.lanes=4194304)}}else{if(!l){if(null!==(e=nq(c))){if(r.flags|=128,l=!0,null!==(e=e.updatequeue)&&(r.updatequeue=e,r.flags|=4),rq(u,!0),null===u.tail&&"hidden"===u.tailmode&&!c.alternate&&!nm)return rz(r),null}else 2*tp()-u.renderingstarttime>i7&&1073741824!==o&&(r.flags|=128,l=!0,rq(u,!1),r.lanes=4194304)}u.isbackwards?(c.sibling=r.child,r.child=c):(null!==(e=u.last)?e.sibling=c:r.child=c,u.last=c)}if(null!==u.tail)return r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingstarttime=tp(),r.sibling=null,e=ny.current,tt(ny,l?1&e|2:1&e),r;return rz(r),null;case 22:case 23:return ab(),l=null!==r.memoizedstate,null!==e&&null!==e.memoizedstate!==l&&(r.flags|=8192),l&&0!=(1&r.mode)?0!=(1073741824&i$)&&(rz(r),q&&6&r.subtreeflags&&(r.flags|=8192)):rz(r),null;case 24:case 25:return null}throw error(d(156,r.tag))}(o,r,i$))){iq=o;return}}else{if(null!==(o=function(e,n){switch(n_(n),n.tag){case 1:return to(n.type)&&tl(),65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 3:return nj(),te(ti),te(tr),nz(),0!=(65536&(e=n.flags))&&0==(128&e)?(n.flags=-65537&e|128,n):null;case 5:return nk(n),null;case 13:if(te(ny),null!==(e=n.memoizedstate)&&null!==e.dehydrated){if(null===n.alternate)throw error(d(340));nl()}return 65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 19:return te(ny),null;case 4:return nj(),null;case 10:return tq(n.type._context),null;case 22:case 23:return ab(),null;default:return null}}(o,r))){o.flags&=32767,iq=o;return}if(null!==e)e.flags|=32768,e.subtreeflags=0,e.deletions=null;else{i1=6,iq=null;return}}if(null!==(r=r.sibling)){iq=r;return}iq=r=e}while(null!==r);0===i1&&(i1=5)}function ap(e,n){var r=ts,i=ik.transition;try{ik.transition=null,ts=1,function(e,n,r){do ar();while(null!==aa);if(0!=(6&iy))throw error(d(327));var i=e.finishedwork,a=e.finishedlanes;if(null!==i){if(e.finishedwork=null,e.finishedlanes=0,i===e.current)throw error(d(177));e.callbacknode=null,e.callbackpriority=0;var s=i.lanes|i.childlanes;if(function(e,n){var r=e.pendinglanes&~n;e.pendinglanes=n,e.suspendedlanes=0,e.pingedlanes=0,e.expiredlanes&=n,e.mutablereadlanes&=n,e.entangledlanes&=n,n=e.entanglements;var i=e.eventtimes;for(e=e.expirationtimes;0e?16:e,null===aa)var i=!1;else{if(e=aa,aa=null,as=0,0!=(6&iy))throw error(d(331));var a=iy;for(iy|=4,ig=e.current;null!==ig;){var s=ig,o=s.child;if(0!=(16&ig.flags)){var l=s.deletions;if(null!==l){for(var u=0;utp()-i8?am(e,0):i6|=r),am(e,n)}function af(e,n){0===n&&(0==(1&e.mode)?n=1:(n=tv,0==(130023424&(tv<<=1))&&(tv=4194304)));var r=ah();null!==(e=af(e,n))&&(tb(e,n,r),am(e,r))}function ao(e){var n=e.memoizedstate,r=0;null!==n&&(r=n.retrylane),af(e,r)}function an(e,n){var r=0;switch(e.tag){case 13:var i=e.statenode,a=e.memoizedstate;null!==a&&(r=a.retrylane);break;case 19:i=e.statenode;break;default:throw error(d(314))}null!==i&&i.delete(n),af(e,r)}function ak(e,n,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.statenode=this.type=this.elementtype=null,this.index=0,this.ref=null,this.pendingprops=n,this.dependencies=this.memoizedstate=this.updatequeue=this.memoizedprops=null,this.mode=i,this.subtreeflags=this.flags=0,this.deletions=null,this.childlanes=this.lanes=0,this.alternate=null}function ah(e,n,r,i){return new ak(e,n,r,i)}function ag(e){return!(!(e=e.prototype)||!e.isreactcomponent)}function au(e,n){var r=e.alternate;return null===r?((r=ah(e.tag,n,e.key,e.mode)).elementtype=e.elementtype,r.type=e.type,r.statenode=e.statenode,r.alternate=e,e.alternate=r):(r.pendingprops=n,r.type=e.type,r.flags=0,r.subtreeflags=0,r.deletions=null),r.flags=14680064&e.flags,r.childlanes=e.childlanes,r.lanes=e.lanes,r.child=e.child,r.memoizedprops=e.memoizedprops,r.memoizedstate=e.memoizedstate,r.updatequeue=e.updatequeue,n=e.dependencies,r.dependencies=null===n?null:{lanes:n.lanes,firstcontext:n.firstcontext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function az(e,n,r,i,a,s){var o=2;if(i=e,"function"==typeof e)ag(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case g:return av(r.children,a,s,n);case v:o=8,a|=8;break;case y:return(e=ah(12,r,n,2|a)).elementtype=y,e.lanes=s,e;case b:return(e=ah(13,r,n,a)).elementtype=b,e.lanes=s,e;case m:return(e=ah(19,r,n,a)).elementtype=m,e.lanes=s,e;case c:return aj(r,a,s,n);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case x:o=10;break e;case _:o=9;break e;case a:o=11;break e;case s:o=14;break e;case w:o=16,i=null;break e}throw error(d(130,null==e?e:typeof e,""))}return(n=ah(o,r,n,a)).elementtype=e,n.type=i,n.lanes=s,n}function av(e,n,r,i){return(e=ah(7,e,i,n)).lanes=r,e}function aj(e,n,r,i){return(e=ah(22,e,i,n)).elementtype=c,e.lanes=r,e.statenode={},e}function aw(e,n,r){return(e=ah(6,e,null,n)).lanes=r,e}function aj(e,n,r){return(n=ah(4,null!==e.children?e.children:[],e.key,n)).lanes=r,n.statenode={containerinfo:e.containerinfo,pendingchildren:null,implementation:e.implementation},n}function ax(e,n,r,i,a){this.tag=n,this.containerinfo=e,this.finishedwork=this.pingcache=this.current=this.pendingchildren=null,this.timeouthandle=y,this.callbacknode=this.pendingcontext=this.context=null,this.callbackpriority=0,this.eventtimes=ta(0),this.expirationtimes=ta(-1),this.entangledlanes=this.finishedlanes=this.mutablereadlanes=this.expiredlanes=this.pingedlanes=this.suspendedlanes=this.pendinglanes=0,this.entanglements=ta(0),this.identifierprefix=i,this.onrecoverableerror=a,$&&(this.mutablesourceeagerhydrationdata=null)}function ak(e,n,r,i,a,s,o,l,u){return e=new ax(e,n,r,l,u),1===n?(n=1,!0===s&&(n|=8)):n=0,s=ah(3,null,null,n),e.current=s,s.statenode=e,s.memoizedstate={element:i,isdehydrated:r,cache:null,transitions:null},t3(s),e}function ay(e){if(!e)return tn;e=e._reactinternals;e:{if(p(e)!==e||1!==e.tag)throw error(d(170));var n=e;do{switch(n.tag){case 3:n=n.statenode.context;break e;case 1:if(to(n.type)){n=n.statenode.__reactinternalmemoizedmergedchildcontext;break e}}n=n.return}while(null!==n);throw error(d(171))}if(1===e.tag){var r=e.type;if(to(r))return tc(e,r,n)}return n}function aq(e){var n=e._reactinternals;if(void 0===n){if("function"==typeof e.render)throw error(d(188));throw error(d(268,e=object.keys(e).join(",")))}return null===(e=i(n))?null:e.statenode}function aq(e,n){if(null!==(e=e.memoizedstate)&&null!==e.dehydrated){var r=e.retrylane;e.retrylane=0!==r&&r=c&&s>=p&&a<=h&&o<=f){e.splice(n,1);break}if(i!==c||r.width!==u.width||fo){if(!(s!==p||r.height!==u.height||ha)){c>i&&(u.width+=c-i,u.x=i),hs&&(u.height+=p-s,u.y=s),fr&&(r=o)),o ")+"\n\nno matching component was found for:\n "+e.join(" > ")}return null},l.getpublicrootinstance=function(e){return(e=e.current).child?5===e.child.tag?o(e.child.statenode):e.child.statenode:null},l.injectintodevtools=function(e){if(e={bundletype:e.bundletype,version:e.version,rendererpackagename:e.rendererpackagename,rendererconfig:e.rendererconfig,overridehookstate:null,overridehookstatedeletepath:null,overridehookstaterenamepath:null,overrideprops:null,overridepropsdeletepath:null,overridepropsrenamepath:null,seterrorhandler:null,setsuspensehandler:null,scheduleupdate:null,currentdispatcherref:p.reactcurrentdispatcher,findhostinstancebyfiber:a$,findfiberbyhostinstance:e.findfiberbyhostinstance||a0,findhostinstancesforrefresh:null,schedulerefresh:null,scheduleroot:null,setrefreshhandler:null,getcurrentfiber:null,reconcilerversion:"18.0.0-fc46dba67-20220329"},"undefined"==typeof __react_devtools_global_hook__)e=!1;else{var n=__react_devtools_global_hook__;if(n.isdisabled||!n.supportsfiber)e=!0;else{try{tf=n.inject(e),to=n}catch(e){}e=!!n.checkdce}}return e},l.isalreadyrendering=function(){return!1},l.observevisiblerects=function(e,n,r,i){if(!es)throw error(d(363));var a=ep(e=ij(e,n),r,i).disconnect;return{disconnect:function(){a()}}},l.registermutablesourceforhydration=function(e,n){var r=n._getversion;r=r(n._source),null==e.mutablesourceeagerhydrationdata?e.mutablesourceeagerhydrationdata=[n,r]:e.mutablesourceeagerhydrationdata.push(n,r)},l.runwithpriority=function(e,n){var r=ts;try{return ts=e,n()}finally{ts=r}},l.shoulderror=function(){return null},l.shouldsuspend=function(){return!1},l.updatecontainer=function(e,n,r,i){var a=n.current,s=ah(),o=ad(a);return r=ay(r),null===n.context?n.context=r:n.pendingcontext=r,(n=t6(s,o)).payload={element:e},null!==(i=void 0===i?null:i)&&(n.callback=i),t5(a,n),null!==(e=ap(a,o,s))&&t9(e,a,o),o},l}},2576:function(e,n,r){"use strict";e.exports=r(6511)},6525:function(e,n,r){"use strict";e.exports=r(7287)},2546:function(e,n){"use strict";/** * @license react * scheduler.production.min.js * * copyright (c) facebook, inc. and its affiliates. * * this source code is licensed under the mit license found in the * license file in the root directory of this source tree. */function r(e,n){var r=e.length;e.push(n);e:for(;0>>1,a=e[i];if(0>>1;is(u,r))cs(h,u)?(e[i]=h,e[c]=r,i=c):(e[i]=u,e[l]=r,i=l);else if(cs(h,r))e[i]=h,e[c]=r,i=c;else break e}}return n}function s(e,n){var r=e.sortindex-n.sortindex;return 0!==r?r:e.id-n.id}if("object"==typeof performance&&"function"==typeof performance.now){var o,l=performance;n.unstable_now=function(){return l.now()}}else{var u=date,c=u.now();n.unstable_now=function(){return u.now()-c}}var h=[],d=[],p=1,f=null,m=3,g=!1,v=!1,y=!1,x="function"==typeof settimeout?settimeout:null,_="function"==typeof cleartimeout?cleartimeout:null,a="undefined"!=typeof setimmediate?setimmediate:null;function b(e){for(var n=i(d);null!==n;){if(null===n.callback)a(d);else if(n.starttime<=e)a(d),n.sortindex=n.expirationtime,r(h,n);else break;n=i(d)}}function m(e){if(y=!1,b(e),!v){if(null!==i(h))v=!0,d(s);else{var n=i(d);null!==n&&f(m,n.starttime-e)}}}function s(e,r){v=!1,y&&(y=!1,_(e),e=-1),g=!0;var s=m;try{for(b(r),f=i(h);null!==f&&(!(f.expirationtime>r)||e&&!p());){var o=f.callback;if("function"==typeof o){f.callback=null,m=f.prioritylevel;var l=o(f.expirationtime<=r);r=n.unstable_now(),"function"==typeof l?f.callback=l:f===i(h)&&a(h),b(r)}else a(h);f=i(h)}if(null!==f)var u=!0;else{var c=i(d);null!==c&&f(m,c.starttime-r),u=!1}return u}finally{f=null,m=s,g=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isinputpending&&navigator.scheduling.isinputpending.bind(navigator.scheduling);var w=!1,c=null,e=-1,t=5,b=-1;function p(){return!(n.unstable_now()-be||125o?(e.sortindex=s,r(d,e),null===i(h)&&e===i(d)&&(y?(_(e),e=-1):y=!0,f(m,s-o))):(e.sortindex=l,r(h,e),v||g||(v=!0,d(s))),e},n.unstable_shouldyield=p,n.unstable_wrapcallback=function(e){var n=m;return function(){var r=m;m=n;try{return e.apply(this,arguments)}finally{m=r}}}},373:function(e,n,r){"use strict";e.exports=r(2546)},655:function(e,n,r){"use strict";r.d(n,{zt:function(){return a},_t:function(){return o},ev:function(){return u},mg:function(){return l},pi:function(){return s}});var i=function(e,n){return(i=object.setprototypeof||({__proto__:[]})instanceof array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)object.prototype.hasownproperty.call(n,r)&&(e[r]=n[r])})(e,n)};function a(e,n){if("function"!=typeof n&&null!==n)throw typeerror("class extends value "+string(n)+" is not a constructor or null");function r(){this.constructor=e}i(e,n),e.prototype=null===n?object.create(n):(r.prototype=n.prototype,new r)}var s=function(){return(s=object.assign||function(e){for(var n,r=1,i=arguments.length;rn.indexof(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof object.getownpropertysymbols)for(var a=0,i=object.getownpropertysymbols(e);an.indexof(i[a])&&object.prototype.propertyisenumerable.call(e,i[a])&&(r[i[a]]=e[i[a]]);return r}function l(e,n,r,i){return new(r||(r=promise))(function(a,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function l(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var n;e.done?a(e.value):((n=e.value)instanceof r?n:new r(function(e){e(n)})).then(o,l)}u((i=i.apply(e,n||[])).next())})}function u(e,n,r){if(r||2==arguments.length)for(var i,a=0,s=n.length;a=0||(a[r]=e[r]);return a}r.d(n,{ul:function(){return a},gk:function(){return c},gy:function(){return i},wm:function(){return u}})},1954:function(e,n,r){"use strict";function i(e){return[e.namespace,e.key].filter(function(e){return null!=e}).join(".")}function a(e){console.error(e)}r.d(n,{h:function(){return a},i:function(){return i}})},5270:function(e,n,r){"use strict";r.d(n,{z:function(){return eb}});var i,a,s,o,l,u,c,h,d,p,f,m,g,v,y=r(7294),x=r(1733);function _(){var e=(0,y.usecontext)(x.z);if(!e)throw error(void 0);return e}var a=r(79),b=r(655);function m(e){return e.type===h.literal}function s(e){return e.type===h.number}function w(e){return e.type===h.date}function c(e){return e.type===h.time}function e(e){return e.type===h.select}function t(e){return e.type===h.plural}function b(e){return e.type===h.tag}function p(e){return!!(e&&"object"==typeof e&&e.type===d.number)}function r(e){return!!(e&&"object"==typeof e&&e.type===d.datetime)}(i=c||(c={}))[i.expect_argument_closing_brace=1]="expect_argument_closing_brace",i[i.empty_argument=2]="empty_argument",i[i.malformed_argument=3]="malformed_argument",i[i.expect_argument_type=4]="expect_argument_type",i[i.invalid_argument_type=5]="invalid_argument_type",i[i.expect_argument_style=6]="expect_argument_style",i[i.invalid_number_skeleton=7]="invalid_number_skeleton",i[i.invalid_date_time_skeleton=8]="invalid_date_time_skeleton",i[i.expect_number_skeleton=9]="expect_number_skeleton",i[i.expect_date_time_skeleton=10]="expect_date_time_skeleton",i[i.unclosed_quote_in_argument_style=11]="unclosed_quote_in_argument_style",i[i.expect_select_argument_options=12]="expect_select_argument_options",i[i.expect_plural_argument_offset_value=13]="expect_plural_argument_offset_value",i[i.invalid_plural_argument_offset_value=14]="invalid_plural_argument_offset_value",i[i.expect_select_argument_selector=15]="expect_select_argument_selector",i[i.expect_plural_argument_selector=16]="expect_plural_argument_selector",i[i.expect_select_argument_selector_fragment=17]="expect_select_argument_selector_fragment",i[i.expect_plural_argument_selector_fragment=18]="expect_plural_argument_selector_fragment",i[i.invalid_plural_argument_selector=19]="invalid_plural_argument_selector",i[i.duplicate_plural_argument_selector=20]="duplicate_plural_argument_selector",i[i.duplicate_select_argument_selector=21]="duplicate_select_argument_selector",i[i.missing_other_clause=22]="missing_other_clause",i[i.invalid_tag=23]="invalid_tag",i[i.invalid_tag_name=25]="invalid_tag_name",i[i.unmatched_closing_tag=26]="unmatched_closing_tag",i[i.unclosed_tag=27]="unclosed_tag",(a=h||(h={}))[a.literal=0]="literal",a[a.argument=1]="argument",a[a.number=2]="number",a[a.date=3]="date",a[a.time=4]="time",a[a.select=5]="select",a[a.plural=6]="plural",a[a.pound=7]="pound",a[a.tag=8]="tag",(s=d||(d={}))[s.number=0]="number",s[s.datetime=1]="datetime";var l=/[ \xa0\u1680\u2000-\u200a\u202f\u205f\u3000]/,i=/(?:[eec]{1,6}|g{1,5}|[qq]{1,5}|(?:[yyur]+|u{1,5})|[ml]{1,5}|d{1,2}|d{1,3}|f{1}|[abb]{1,5}|[hkhk]{1,2}|w{1,2}|w{1}|m{1,2}|s{1,2}|[zzovvxx]{1,4})(?=([^']*'[^']*')*[^']*$)/g,d=/[\t-\r \x85\u200e\u200f\u2028\u2029]/i,f=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,o=/^(@+)?(\+|#+)?[rs]?$/g,n=/(\*)(0+)|(#+)(0+)|(0+)/g,k=/^(0+)$/;function h(e){var n={};return"r"===e[e.length-1]?n.roundingpriority="moreprecision":"s"===e[e.length-1]&&(n.roundingpriority="lessprecision"),e.replace(o,function(e,r,i){return"string"!=typeof i?(n.minimumsignificantdigits=r.length,n.maximumsignificantdigits=r.length):"+"===i?n.minimumsignificantdigits=r.length:"#"===r[0]?n.maximumsignificantdigits=r.length:(n.minimumsignificantdigits=r.length,n.maximumsignificantdigits=r.length+("string"==typeof i?i.length:0)),""}),n}function g(e){switch(e){case"sign-auto":return{signdisplay:"auto"};case"sign-accounting":case"()":return{currencysign:"accounting"};case"sign-always":case"+!":return{signdisplay:"always"};case"sign-accounting-always":case"()!":return{signdisplay:"always",currencysign:"accounting"};case"sign-except-zero":case"+?":return{signdisplay:"exceptzero"};case"sign-accounting-except-zero":case"()?":return{signdisplay:"exceptzero",currencysign:"accounting"};case"sign-never":case"+_":return{signdisplay:"never"}}}function u(e){return g(e)||{}}var z={ax:["h"],bq:["h"],cp:["h"],cz:["h"],dk:["h"],fi:["h"],id:["h"],is:["h"],ml:["h"],ne:["h"],ru:["h"],se:["h"],sj:["h"],sk:["h"],as:["h","h"],bt:["h","h"],dj:["h","h"],er:["h","h"],gh:["h","h"],in:["h","h"],ls:["h","h"],pg:["h","h"],pw:["h","h"],so:["h","h"],to:["h","h"],vu:["h","h"],ws:["h","h"],"001":["h","h"],al:["h","h","hb"],td:["h","h","hb"],"ca-es":["h","h","hb"],cf:["h","h","hb"],cm:["h","h","hb"],"fr-ca":["h","h","hb"],"gl-es":["h","h","hb"],"it-ch":["h","h","hb"],"it-it":["h","h","hb"],lu:["h","h","hb"],np:["h","h","hb"],pf:["h","h","hb"],sc:["h","h","hb"],sm:["h","h","hb"],sn:["h","h","hb"],tf:["h","h","hb"],va:["h","h","hb"],cy:["h","h","hb","hb"],gr:["h","h","hb","hb"],co:["h","h","hb","hb"],do:["h","h","hb","hb"],kp:["h","h","hb","hb"],kr:["h","h","hb","hb"],na:["h","h","hb","hb"],pa:["h","h","hb","hb"],pr:["h","h","hb","hb"],ve:["h","h","hb","hb"],ac:["h","h","hb","hb"],ai:["h","h","hb","hb"],bw:["h","h","hb","hb"],bz:["h","h","hb","hb"],cc:["h","h","hb","hb"],ck:["h","h","hb","hb"],cx:["h","h","hb","hb"],dg:["h","h","hb","hb"],fk:["h","h","hb","hb"],gb:["h","h","hb","hb"],gg:["h","h","hb","hb"],gi:["h","h","hb","hb"],ie:["h","h","hb","hb"],im:["h","h","hb","hb"],io:["h","h","hb","hb"],je:["h","h","hb","hb"],lt:["h","h","hb","hb"],mk:["h","h","hb","hb"],mn:["h","h","hb","hb"],ms:["h","h","hb","hb"],nf:["h","h","hb","hb"],ng:["h","h","hb","hb"],nr:["h","h","hb","hb"],nu:["h","h","hb","hb"],pn:["h","h","hb","hb"],sh:["h","h","hb","hb"],sx:["h","h","hb","hb"],ta:["h","h","hb","hb"],za:["h","h","hb","hb"],"af-za":["h","h","hb","hb"],ar:["h","h","hb","hb"],cl:["h","h","hb","hb"],cr:["h","h","hb","hb"],cu:["h","h","hb","hb"],ea:["h","h","hb","hb"],"es-bo":["h","h","hb","hb"],"es-br":["h","h","hb","hb"],"es-ec":["h","h","hb","hb"],"es-es":["h","h","hb","hb"],"es-gq":["h","h","hb","hb"],"es-pe":["h","h","hb","hb"],gt:["h","h","hb","hb"],hn:["h","h","hb","hb"],ic:["h","h","hb","hb"],kg:["h","h","hb","hb"],km:["h","h","hb","hb"],lk:["h","h","hb","hb"],ma:["h","h","hb","hb"],mx:["h","h","hb","hb"],ni:["h","h","hb","hb"],py:["h","h","hb","hb"],sv:["h","h","hb","hb"],uy:["h","h","hb","hb"],jp:["h","h","k"],ad:["h","hb"],am:["h","hb"],ao:["h","hb"],at:["h","hb"],aw:["h","hb"],be:["h","hb"],bf:["h","hb"],bj:["h","hb"],bl:["h","hb"],br:["h","hb"],cg:["h","hb"],ci:["h","hb"],cv:["h","hb"],de:["h","hb"],ee:["h","hb"],fr:["h","hb"],ga:["h","hb"],gf:["h","hb"],gn:["h","hb"],gp:["h","hb"],gw:["h","hb"],hr:["h","hb"],il:["h","hb"],it:["h","hb"],kz:["h","hb"],mc:["h","hb"],md:["h","hb"],mf:["h","hb"],mq:["h","hb"],mz:["h","hb"],nc:["h","hb"],nl:["h","hb"],pm:["h","hb"],pt:["h","hb"],re:["h","hb"],ro:["h","hb"],si:["h","hb"],sr:["h","hb"],st:["h","hb"],tg:["h","hb"],tr:["h","hb"],wf:["h","hb"],yt:["h","hb"],bd:["h","hb","h"],pk:["h","hb","h"],az:["h","hb","h"],ba:["h","hb","h"],bg:["h","hb","h"],ch:["h","hb","h"],ge:["h","hb","h"],li:["h","hb","h"],me:["h","hb","h"],rs:["h","hb","h"],ua:["h","hb","h"],uz:["h","hb","h"],xk:["h","hb","h"],ag:["h","hb","h","hb"],au:["h","hb","h","hb"],bb:["h","hb","h","hb"],bm:["h","hb","h","hb"],bs:["h","hb","h","hb"],ca:["h","hb","h","hb"],dm:["h","hb","h","hb"],"en-001":["h","hb","h","hb"],fj:["h","hb","h","hb"],fm:["h","hb","h","hb"],gd:["h","hb","h","hb"],gm:["h","hb","h","hb"],gu:["h","hb","h","hb"],gy:["h","hb","h","hb"],jm:["h","hb","h","hb"],ki:["h","hb","h","hb"],kn:["h","hb","h","hb"],ky:["h","hb","h","hb"],lc:["h","hb","h","hb"],lr:["h","hb","h","hb"],mh:["h","hb","h","hb"],mp:["h","hb","h","hb"],mw:["h","hb","h","hb"],nz:["h","hb","h","hb"],sb:["h","hb","h","hb"],sg:["h","hb","h","hb"],sl:["h","hb","h","hb"],ss:["h","hb","h","hb"],sz:["h","hb","h","hb"],tc:["h","hb","h","hb"],tt:["h","hb","h","hb"],um:["h","hb","h","hb"],us:["h","hb","h","hb"],vc:["h","hb","h","hb"],vg:["h","hb","h","hb"],vi:["h","hb","h","hb"],zm:["h","hb","h","hb"],bo:["h","hb","h","hb"],ec:["h","hb","h","hb"],es:["h","hb","h","hb"],gq:["h","hb","h","hb"],pe:["h","hb","h","hb"],ae:["h","hb","hb","h"],"ar-001":["h","hb","hb","h"],bh:["h","hb","hb","h"],dz:["h","hb","hb","h"],eg:["h","hb","hb","h"],eh:["h","hb","hb","h"],hk:["h","hb","hb","h"],iq:["h","hb","hb","h"],jo:["h","hb","hb","h"],kw:["h","hb","hb","h"],lb:["h","hb","hb","h"],ly:["h","hb","hb","h"],mo:["h","hb","hb","h"],mr:["h","hb","hb","h"],om:["h","hb","hb","h"],ph:["h","hb","hb","h"],ps:["h","hb","hb","h"],qa:["h","hb","hb","h"],sa:["h","hb","hb","h"],sd:["h","hb","hb","h"],sy:["h","hb","hb","h"],tn:["h","hb","hb","h"],ye:["h","hb","hb","h"],af:["h","hb","hb","h"],la:["h","hb","hb","h"],cn:["h","hb","hb","h"],lv:["h","hb","hb","h"],tl:["h","hb","hb","h"],"zu-za":["h","hb","hb","h"],cd:["hb","h"],ir:["hb","h"],"hi-in":["hb","h","h"],"kn-in":["hb","h","h"],"ml-in":["hb","h","h"],"te-in":["hb","h","h"],kh:["hb","h","h","hb"],"ta-in":["hb","h","hb","h"],bn:["hb","hb","h","h"],my:["hb","hb","h","h"],et:["hb","hb","h","h"],"gu-in":["hb","hb","h","h"],"mr-in":["hb","hb","h","h"],"pa-in":["hb","hb","h","h"],tw:["hb","hb","h","h"],ke:["hb","hb","h","h"],mm:["hb","hb","h","h"],tz:["hb","hb","h","h"],ug:["hb","hb","h","h"]},v=regexp("^".concat(l.source,"*")),j=regexp("".concat(l.source,"*$"));function w(e,n){return{start:e,end:n}}var j=!!string.prototype.startswith,x=!!string.fromcodepoint,k=!!object.fromentries,y=!!string.prototype.codepointat,q=!!string.prototype.trimstart,q=!!string.prototype.trimend,z=number.issafeinteger?number.issafeinteger:function(e){return"number"==typeof e&&isfinite(e)&&math.floor(e)===e&&9007199254740991>=math.abs(e)},$=!0;try{var ee=regexp("([^\\p{white_space}\\p{pattern_syntax}]*)","yu");$=(null===(p=ee.exec("a"))||void 0===p?void 0:p[0])==="a"}catch(e){$=!1}var et=j?function(e,n,r){return e.startswith(n,r)}:function(e,n,r){return e.slice(r,r+n.length)===n},en=x?string.fromcodepoint:function(){for(var e,n=[],r=0;rs;){if((e=n[s++])>1114111)throw rangeerror(e+" is not a valid code point");i+=e<65536?string.fromcharcode(e):string.fromcharcode(((e-=65536)>>10)+55296,e%1024+56320)}return i},er=k?object.fromentries:function(e){for(var n={},r=0;r=i)){var a=e.charcodeat(n);return a<55296||a>56319||n+1===i||(r=e.charcodeat(n+1))<56320||r>57343?a:(a-55296<<10)+(r-56320)+65536}},ea=q?function(e){return e.trimstart()}:function(e){return e.replace(v,"")},es=q?function(e){return e.trimend()}:function(e){return e.replace(j,"")};if($){var eo=regexp("([^\\p{white_space}\\p{pattern_syntax}]*)","yu");f=function(e,n){var r;return eo.lastindex=n,null!==(r=eo.exec(e)[1])&&void 0!==r?r:""}}else f=function(e,n){for(var r=[];;){var i,a=ei(e,n);if(void 0===a||ec(a)||(i=a)>=33&&i<=35||36===i||i>=37&&i<=39||40===i||41===i||42===i||43===i||44===i||45===i||i>=46&&i<=47||i>=58&&i<=59||i>=60&&i<=62||i>=63&&i<=64||91===i||92===i||93===i||94===i||96===i||123===i||124===i||125===i||126===i||161===i||i>=162&&i<=165||166===i||167===i||169===i||171===i||172===i||174===i||176===i||177===i||182===i||187===i||191===i||215===i||247===i||i>=8208&&i<=8213||i>=8214&&i<=8215||8216===i||8217===i||8218===i||i>=8219&&i<=8220||8221===i||8222===i||8223===i||i>=8224&&i<=8231||i>=8240&&i<=8248||8249===i||8250===i||i>=8251&&i<=8254||i>=8257&&i<=8259||8260===i||8261===i||8262===i||i>=8263&&i<=8273||8274===i||8275===i||i>=8277&&i<=8286||i>=8592&&i<=8596||i>=8597&&i<=8601||i>=8602&&i<=8603||i>=8604&&i<=8607||8608===i||i>=8609&&i<=8610||8611===i||i>=8612&&i<=8613||8614===i||i>=8615&&i<=8621||8622===i||i>=8623&&i<=8653||i>=8654&&i<=8655||i>=8656&&i<=8657||8658===i||8659===i||8660===i||i>=8661&&i<=8691||i>=8692&&i<=8959||i>=8960&&i<=8967||8968===i||8969===i||8970===i||8971===i||i>=8972&&i<=8991||i>=8992&&i<=8993||i>=8994&&i<=9e3||9001===i||9002===i||i>=9003&&i<=9083||9084===i||i>=9085&&i<=9114||i>=9115&&i<=9139||i>=9140&&i<=9179||i>=9180&&i<=9185||i>=9186&&i<=9254||i>=9255&&i<=9279||i>=9280&&i<=9290||i>=9291&&i<=9311||i>=9472&&i<=9654||9655===i||i>=9656&&i<=9664||9665===i||i>=9666&&i<=9719||i>=9720&&i<=9727||i>=9728&&i<=9838||9839===i||i>=9840&&i<=10087||10088===i||10089===i||10090===i||10091===i||10092===i||10093===i||10094===i||10095===i||10096===i||10097===i||10098===i||10099===i||10100===i||10101===i||i>=10132&&i<=10175||i>=10176&&i<=10180||10181===i||10182===i||i>=10183&&i<=10213||10214===i||10215===i||10216===i||10217===i||10218===i||10219===i||10220===i||10221===i||10222===i||10223===i||i>=10224&&i<=10239||i>=10240&&i<=10495||i>=10496&&i<=10626||10627===i||10628===i||10629===i||10630===i||10631===i||10632===i||10633===i||10634===i||10635===i||10636===i||10637===i||10638===i||10639===i||10640===i||10641===i||10642===i||10643===i||10644===i||10645===i||10646===i||10647===i||10648===i||i>=10649&&i<=10711||10712===i||10713===i||10714===i||10715===i||i>=10716&&i<=10747||10748===i||10749===i||i>=10750&&i<=11007||i>=11008&&i<=11055||i>=11056&&i<=11076||i>=11077&&i<=11078||i>=11079&&i<=11084||i>=11085&&i<=11123||i>=11124&&i<=11125||i>=11126&&i<=11157||11158===i||i>=11159&&i<=11263||i>=11776&&i<=11777||11778===i||11779===i||11780===i||11781===i||i>=11782&&i<=11784||11785===i||11786===i||11787===i||11788===i||11789===i||i>=11790&&i<=11798||11799===i||i>=11800&&i<=11801||11802===i||11803===i||11804===i||11805===i||i>=11806&&i<=11807||11808===i||11809===i||11810===i||11811===i||11812===i||11813===i||11814===i||11815===i||11816===i||11817===i||i>=11818&&i<=11822||11823===i||i>=11824&&i<=11833||i>=11834&&i<=11835||i>=11836&&i<=11839||11840===i||11841===i||11842===i||i>=11843&&i<=11855||i>=11856&&i<=11857||11858===i||i>=11859&&i<=11903||i>=12289&&i<=12291||12296===i||12297===i||12298===i||12299===i||12300===i||12301===i||12302===i||12303===i||12304===i||12305===i||i>=12306&&i<=12307||12308===i||12309===i||12310===i||12311===i||12312===i||12313===i||12314===i||12315===i||12316===i||12317===i||i>=12318&&i<=12319||12320===i||12336===i||64830===i||64831===i||i>=65093&&i<=65094)break;r.push(a),n+=a>=65536?2:1}return en.apply(void 0,r)};var el=function(){function e(e,n){void 0===n&&(n={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoretag=!!n.ignoretag,this.locale=n.locale,this.requiresotherclause=!!n.requiresotherclause,this.shouldparseskeletons=!!n.shouldparseskeletons}return e.prototype.parse=function(){if(0!==this.offset())throw error("parser can only be used once");return this.parsemessage(0,"",!1)},e.prototype.parsemessage=function(e,n,r){for(var i=[];!this.iseof();){var a=this.char();if(123===a){var s=this.parseargument(e,r);if(s.err)return s;i.push(s.val)}else if(125===a&&e>0)break;else if(35===a&&("plural"===n||"selectordinal"===n)){var o=this.cloneposition();this.bump(),i.push({type:h.pound,location:w(o,this.cloneposition())})}else if(60!==a||this.ignoretag||47!==this.peek()){if(60===a&&!this.ignoretag&&eu(this.peek()||0)){var s=this.parsetag(e,n);if(s.err)return s;i.push(s.val)}else{var s=this.parseliteral(e,n);if(s.err)return s;i.push(s.val)}}else{if(!r)return this.error(c.unmatched_closing_tag,w(this.cloneposition(),this.cloneposition()));break}}return{val:i,err:null}},e.prototype.parsetag=function(e,n){var r=this.cloneposition();this.bump();var i=this.parsetagname();if(this.bumpspace(),this.bumpif("/>"))return{val:{type:h.literal,value:"<".concat(i,"/>"),location:w(r,this.cloneposition())},err:null};if(!this.bumpif(">"))return this.error(c.invalid_tag,w(r,this.cloneposition()));var a=this.parsemessage(e+1,n,!0);if(a.err)return a;var s=a.val,o=this.cloneposition();if(!this.bumpif(""))?{val:{type:h.tag,value:i,children:s,location:w(r,this.cloneposition())},err:null}:this.error(c.invalid_tag,w(o,this.cloneposition()))},e.prototype.parsetagname=function(){var e,n=this.offset();for(this.bump();!this.iseof()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(n,this.offset())},e.prototype.parseliteral=function(e,n){for(var r=this.cloneposition(),i="";;){var a=this.tryparsequote(n);if(a){i+=a;continue}var s=this.tryparseunquoted(e,n);if(s){i+=s;continue}var o=this.tryparseleftanglebracket();if(o){i+=o;continue}break}var l=w(r,this.cloneposition());return{val:{type:h.literal,value:i,location:l},err:null}},e.prototype.tryparseleftanglebracket=function(){var e;return this.iseof()||60!==this.char()||!this.ignoretag&&(eu(e=this.peek()||0)||47===e)?null:(this.bump(),"<")},e.prototype.tryparsequote=function(e){if(this.iseof()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.iseof();){var r=this.char();if(39===r){if(39===this.peek())n.push(39),this.bump();else{this.bump();break}}else n.push(r);this.bump()}return en.apply(void 0,n)},e.prototype.tryparseunquoted=function(e,n){if(this.iseof())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===n||"selectordinal"===n)||125===r&&e>0?null:(this.bump(),en(r))},e.prototype.parseargument=function(e,n){var r=this.cloneposition();if(this.bump(),this.bumpspace(),this.iseof())return this.error(c.expect_argument_closing_brace,w(r,this.cloneposition()));if(125===this.char())return this.bump(),this.error(c.empty_argument,w(r,this.cloneposition()));var i=this.parseidentifierifpossible().value;if(!i)return this.error(c.malformed_argument,w(r,this.cloneposition()));if(this.bumpspace(),this.iseof())return this.error(c.expect_argument_closing_brace,w(r,this.cloneposition()));switch(this.char()){case 125:return this.bump(),{val:{type:h.argument,value:i,location:w(r,this.cloneposition())},err:null};case 44:if(this.bump(),this.bumpspace(),this.iseof())return this.error(c.expect_argument_closing_brace,w(r,this.cloneposition()));return this.parseargumentoptions(e,n,i,r);default:return this.error(c.malformed_argument,w(r,this.cloneposition()))}},e.prototype.parseidentifierifpossible=function(){var e=this.cloneposition(),n=this.offset(),r=f(this.message,n),i=n+r.length;return this.bumpto(i),{value:r,location:w(e,this.cloneposition())}},e.prototype.parseargumentoptions=function(e,n,r,i){var a,s=this.cloneposition(),o=this.parseidentifierifpossible().value,l=this.cloneposition();switch(o){case"":return this.error(c.expect_argument_type,w(s,l));case"number":case"date":case"time":this.bumpspace();var u=null;if(this.bumpif(",")){this.bumpspace();var p=this.cloneposition(),f=this.parsesimpleargstyleifpossible();if(f.err)return f;var m=es(f.val);if(0===m.length)return this.error(c.expect_argument_style,w(this.cloneposition(),this.cloneposition()));u={style:m,stylelocation:w(p,this.cloneposition())}}var g=this.tryparseargumentclose(i);if(g.err)return g;var v=w(i,this.cloneposition());if(u&&et(null==u?void 0:u.style,"::",0)){var y,x=ea(u.style.slice(2));if("number"===o){var f=this.parsenumberskeletonfromstring(x,u.stylelocation);if(f.err)return f;return{val:{type:h.number,value:r,location:v,style:f.val},err:null}}if(0===x.length)return this.error(c.expect_date_time_skeleton,v);var _=x;this.locale&&(_=function(e,n){for(var r="",i=0;i>1),u=function(e){var n,r=e.hourcycle;if(void 0===r&&e.hourcycles&&e.hourcycles.length&&(r=e.hourcycles[0]),r)switch(r){case"h24":return"k";case"h23":return"h";case"h12":return"h";case"h11":return"k";default:throw error("invalid hourcycle")}var i=e.language;return"root"!==i&&(n=e.maximize().region),(z[n||""]||z[i||""]||z["".concat(i,"-001")]||z["001"])[0]}(n);for(("h"==u||"k"==u)&&(l=0);l-- >0;)r+="a";for(;o-- >0;)r=u+r}else"j"===a?r+="h":r+=a}return r}(x,this.locale));var m={type:d.datetime,pattern:_,location:u.stylelocation,parsedoptions:this.shouldparseskeletons?(y={},_.replace(i,function(e){var n=e.length;switch(e[0]){case"g":y.era=4===n?"long":5===n?"narrow":"short";break;case"y":y.year=2===n?"2-digit":"numeric";break;case"y":case"u":case"u":case"r":throw rangeerror("`y/u/u/r` (year) patterns are not supported, use `y` instead");case"q":case"q":throw rangeerror("`q/q` (quarter) patterns are not supported");case"m":case"l":y.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"w":throw rangeerror("`w/w` (week) patterns are not supported");case"d":y.day=["numeric","2-digit"][n-1];break;case"d":case"f":case"g":throw rangeerror("`d/f/g` (day) patterns are not supported, use `d` instead");case"e":y.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw rangeerror("`e..eee` (weekday) patterns are not supported");y.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw rangeerror("`c..ccc` (weekday) patterns are not supported");y.weekday=["short","long","narrow","short"][n-4];break;case"a":y.hour12=!0;break;case"b":case"b":throw rangeerror("`b/b` (period) patterns are not supported, use `a` instead");case"h":y.hourcycle="h12",y.hour=["numeric","2-digit"][n-1];break;case"h":y.hourcycle="h23",y.hour=["numeric","2-digit"][n-1];break;case"k":y.hourcycle="h11",y.hour=["numeric","2-digit"][n-1];break;case"k":y.hourcycle="h24",y.hour=["numeric","2-digit"][n-1];break;case"j":case"j":case"c":throw rangeerror("`j/j/c` (hour) patterns are not supported, use `h/h/k/k` instead");case"m":y.minute=["numeric","2-digit"][n-1];break;case"s":y.second=["numeric","2-digit"][n-1];break;case"s":case"a":throw rangeerror("`s/a` (second) patterns are not supported, use `s` instead");case"z":y.timezonename=n<4?"short":"long";break;case"z":case"o":case"v":case"v":case"x":case"x":throw rangeerror("`z/o/v/v/x/x` (timezone) patterns are not supported, use `z` instead")}return""}),y):{}};return{val:{type:"date"===o?h.date:h.time,value:r,location:v,style:m},err:null}}return{val:{type:"number"===o?h.number:"date"===o?h.date:h.time,value:r,location:v,style:null!==(a=null==u?void 0:u.style)&&void 0!==a?a:null},err:null};case"plural":case"selectordinal":case"select":var a=this.cloneposition();if(this.bumpspace(),!this.bumpif(","))return this.error(c.expect_select_argument_options,w(a,(0,b.pi)({},a)));this.bumpspace();var m=this.parseidentifierifpossible(),s=0;if("select"!==o&&"offset"===m.value){if(!this.bumpif(":"))return this.error(c.expect_plural_argument_offset_value,w(this.cloneposition(),this.cloneposition()));this.bumpspace();var f=this.tryparsedecimalinteger(c.expect_plural_argument_offset_value,c.invalid_plural_argument_offset_value);if(f.err)return f;this.bumpspace(),m=this.parseidentifierifpossible(),s=f.val}var w=this.tryparsepluralorselectoptions(e,o,n,m);if(w.err)return w;var g=this.tryparseargumentclose(i);if(g.err)return g;var c=w(i,this.cloneposition());if("select"===o)return{val:{type:h.select,value:r,options:er(w.val),location:c},err:null};return{val:{type:h.plural,value:r,options:er(w.val),offset:s,pluraltype:"plural"===o?"cardinal":"ordinal",location:c},err:null};default:return this.error(c.invalid_argument_type,w(s,l))}},e.prototype.tryparseargumentclose=function(e){return this.iseof()||125!==this.char()?this.error(c.expect_argument_closing_brace,w(e,this.cloneposition())):(this.bump(),{val:!0,err:null})},e.prototype.parsesimpleargstyleifpossible=function(){for(var e=0,n=this.cloneposition();!this.iseof();)switch(this.char()){case 39:this.bump();var r=this.cloneposition();if(!this.bumpuntil("'"))return this.error(c.unclosed_quote_in_argument_style,w(r,this.cloneposition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(n.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parsenumberskeletonfromstring=function(e,n){var r=[];try{r=function(e){if(0===e.length)throw error("number skeleton cannot be empty");for(var n=e.split(d).filter(function(e){return e.length>0}),r=[],i=0;i1)throw rangeerror("integer-width stems only accept a single optional option");i.options[0].replace(n,function(e,r,i,a,s,o){if(r)n.minimumintegerdigits=i.length;else if(a&&s)throw error("we currently do not support maximum integer digits");else if(o)throw error("we currently do not support exact integer digits");return""});continue}if(k.test(i.stem)){n.minimumintegerdigits=i.stem.length;continue}if(f.test(i.stem)){if(i.options.length>1)throw rangeerror("fraction-precision stems only accept a single optional option");i.stem.replace(f,function(e,r,i,a,s,o){return"*"===i?n.minimumfractiondigits=r.length:a&&"#"===a[0]?n.maximumfractiondigits=a.length:s&&o?(n.minimumfractiondigits=s.length,n.maximumfractiondigits=s.length+o.length):(n.minimumfractiondigits=r.length,n.maximumfractiondigits=r.length),""});var a=i.options[0];"w"===a?n=(0,b.pi)((0,b.pi)({},n),{trailingzerodisplay:"stripifinteger"}):a&&(n=(0,b.pi)((0,b.pi)({},n),h(a)));continue}if(o.test(i.stem)){n=(0,b.pi)((0,b.pi)({},n),h(i.stem));continue}var s=g(i.stem);s&&(n=(0,b.pi)((0,b.pi)({},n),s));var o=function(e){var n;if("e"===e[0]&&"e"===e[1]?(n={notation:"engineering"},e=e.slice(2)):"e"===e[0]&&(n={notation:"scientific"},e=e.slice(1)),n){var r=e.slice(0,2);if("+!"===r?(n.signdisplay="always",e=e.slice(2)):"+?"===r&&(n.signdisplay="exceptzero",e=e.slice(2)),!k.test(e))throw error("malformed concise eng/scientific notation");n.minimumintegerdigits=e.length}return n}(i.stem);o&&(n=(0,b.pi)((0,b.pi)({},n),o))}return n}(r):{}},err:null}},e.prototype.tryparsepluralorselectoptions=function(e,n,r,i){for(var a,s=!1,o=[],l=new set,u=i.value,h=i.location;;){if(0===u.length){var d=this.cloneposition();if("select"!==n&&this.bumpif("=")){var p=this.tryparsedecimalinteger(c.expect_plural_argument_selector,c.invalid_plural_argument_selector);if(p.err)return p;h=w(d,this.cloneposition()),u=this.message.slice(d.offset,this.offset())}else break}if(l.has(u))return this.error("select"===n?c.duplicate_select_argument_selector:c.duplicate_plural_argument_selector,h);"other"===u&&(s=!0),this.bumpspace();var f=this.cloneposition();if(!this.bumpif("{"))return this.error("select"===n?c.expect_select_argument_selector_fragment:c.expect_plural_argument_selector_fragment,w(this.cloneposition(),this.cloneposition()));var m=this.parsemessage(e+1,n,r);if(m.err)return m;var g=this.tryparseargumentclose(f);if(g.err)return g;o.push([u,{value:m.val,location:w(f,this.cloneposition())}]),l.add(u),this.bumpspace(),u=(a=this.parseidentifierifpossible()).value,h=a.location}return 0===o.length?this.error("select"===n?c.expect_select_argument_selector:c.expect_plural_argument_selector,w(this.cloneposition(),this.cloneposition())):this.requiresotherclause&&!s?this.error(c.missing_other_clause,w(this.cloneposition(),this.cloneposition())):{val:o,err:null}},e.prototype.tryparsedecimalinteger=function(e,n){var r=1,i=this.cloneposition();this.bumpif("+")||this.bumpif("-")&&(r=-1);for(var a=!1,s=0;!this.iseof();){var o=this.char();if(o>=48&&o<=57)a=!0,s=10*s+(o-48),this.bump();else break}var l=w(i,this.cloneposition());return a?z(s*=r)?{val:s,err:null}:this.error(n,l):this.error(e,l)},e.prototype.offset=function(){return this.position.offset},e.prototype.iseof=function(){return this.offset()===this.message.length},e.prototype.cloneposition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw error("out of bound");var n=ei(this.message,e);if(void 0===n)throw error("offset ".concat(e," is at invalid utf-16 code unit boundary"));return n},e.prototype.error=function(e,n){return{val:null,err:{kind:e,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.iseof()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpif=function(e){if(et(this.message,e,this.offset())){for(var n=0;n=0?(this.bumpto(r),!0):(this.bumpto(this.message.length),!1)},e.prototype.bumpto=function(e){if(this.offset()>e)throw error("targetoffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=math.min(e,this.message.length);;){var n=this.offset();if(n===e)break;if(n>e)throw error("targetoffset ".concat(e," is at invalid utf-16 code unit boundary"));if(this.bump(),this.iseof())break}},e.prototype.bumpspace=function(){for(;!this.iseof()&&ec(this.char());)this.bump()},e.prototype.peek=function(){if(this.iseof())return null;var e=this.char(),n=this.offset(),r=this.message.charcodeat(n+(e>=65536?2:1));return null!=r?r:null},e}();function eu(e){return e>=97&&e<=122||e>=65&&e<=90}function ec(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function eh(e,n){void 0===n&&(n={}),n=(0,b.pi)({shouldparseskeletons:!0,requiresotherclause:!0},n);var r=new el(e,n).parse();if(r.err){var i=syntaxerror(c[r.err.kind]);throw i.location=r.err.location,i.originalmessage=r.err.message,i}return(null==n?void 0:n.capturelocation)||function e(n){n.foreach(function(n){if(delete n.location,e(n)||t(n))for(var r in n.options)delete n.options[r].location,e(n.options[r].value);else s(n)&&p(n.style)?delete n.style.location:(w(n)||c(n))&&r(n.style)?delete n.style.location:b(n)&&e(n.children)})}(r.val),r.val}function ed(e,n){var r=n&&n.cache?n.cache:ey,i=n&&n.serializer?n.serializer:eg;return(n&&n.strategy?n.strategy:em)(e,{cache:r,serializer:i})}function ep(e,n,r,i){var a=null==i||"number"==typeof i||"boolean"==typeof i?i:r(i),s=n.get(a);return void 0===s&&(s=e.call(this,i),n.set(a,s)),s}function ef(e,n,r){var i=array.prototype.slice.call(arguments,3),a=r(i),s=n.get(a);return void 0===s&&(s=e.apply(this,i),n.set(a,s)),s}function em(e,n){var r,i,a=1===e.length?ep:ef;return r=n.cache.create(),i=n.serializer,a.bind(this,e,r,i)}var eg=function(){return json.stringify(arguments)};function ev(){this.cache=object.create(null)}ev.prototype.get=function(e){return this.cache[e]},ev.prototype.set=function(e,n){this.cache[e]=n};var ey={create:function(){return new ev}},ex={variadic:function(e,n){var r,i;return r=n.cache.create(),i=n.serializer,ef.bind(this,e,r,i)},monadic:function(e,n){var r,i;return r=n.cache.create(),i=n.serializer,ep.bind(this,e,r,i)}};(o=m||(m={})).missing_value="missing_value",o.invalid_value="invalid_value",o.missing_intl_api="missing_intl_api";var e_=function(e){function n(n,r,i){var a=e.call(this,n)||this;return a.code=r,a.originalmessage=i,a}return(0,b.zt)(n,e),n.prototype.tostring=function(){return"[formatjs error: ".concat(this.code,"] ").concat(this.message)},n}(error),ea=function(e){function n(n,r,i,a){return e.call(this,'invalid values for "'.concat(n,'": "').concat(r,'". options are "').concat(object.keys(i).join('", "'),'"'),m.invalid_value,a)||this}return(0,b.zt)(n,e),n}(e_),eb=function(e){function n(n,r,i){return e.call(this,'value for "'.concat(n,'" must be of type ').concat(r),m.invalid_value,i)||this}return(0,b.zt)(n,e),n}(e_),em=function(e){function n(n,r){return e.call(this,'the intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),m.missing_value,r)||this}return(0,b.zt)(n,e),n}(e_);function es(e){return{create:function(){return{get:function(n){return e[n]},set:function(n,r){e[n]=r}}}}}(l=g||(g={}))[l.literal=0]="literal",l[l.object=1]="object";var ew=function(){function e(n,r,i,a){var s,o,l=this;if(void 0===r&&(r=e.defaultlocale),this.formattercache={number:{},datetime:{},pluralrules:{}},this.format=function(e){var n=l.formattoparts(e);if(1===n.length)return n[0].value;var r=n.reduce(function(e,n){return e.length&&n.type===g.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=n.value:e.push(n.value),e},[]);return r.length<=1?r[0]||"":r},this.formattoparts=function(e){return function e(n,r,i,a,s,o,l){if(1===n.length&&m(n[0]))return[{type:g.literal,value:n[0].value}];for(var u=[],c=0;c0?n[0]:"string"==typeof e?e:e[0])},e.__parse=eh,e.formats={number:{integer:{maximumfractiondigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timezonename:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timezonename:"short"}}},e}();(u=v||(v={})).missing_message="missing_message",u.missing_format="missing_format",u.insufficient_path="insufficient_path",u.invalid_message="invalid_message",u.invalid_key="invalid_key",u.formatting_error="formatting_error";var ec=function(e){function n(n,r){var i,a=n;return r&&(a+=": "+r),(i=e.call(this,a)||this).code=void 0,i.originalmessage=void 0,i.code=n,r&&(i.originalmessage=r),i}return(0,a.ul)(n,e),n}((0,a.wm)(error)),ee=r(1954);function et(e,n,r){if(!e)throw error(void 0);var i=e;return n.split(".").foreach(function(e){var n=i[e];if(null==e||null==n)throw error(void 0);i=n}),i}function eb(e){var n,r,i,a,s,o,l,u,c,h,d,p;return n={"!":_().messages},r=e?"!."+e:"!",a=(i=_()).defaulttranslationvalues,s=i.formats,o=i.getmessagefallback,l=i.locale,u=i.onerror,c=i.timezone,n=n["!"],r="!"===(h=r)?void 0:h.slice(2),d=(0,y.useref)({}),p=(0,y.usememo)(function(){return function(e){var n=e.messages,r=e.namespace,i=e.onerror,a=void 0===i?ee.h:i;try{if(!n)throw error(void 0);var s=r?et(n,r):n;if(!s)throw error(void 0);return s}catch(e){var o=new ec(v.missing_message,e.message);return a(o),o}}({messages:n,namespace:r,onerror:u})},[n,r,u]),(0,y.usememo)(function(){return function(e){var n=e.cachedformatsbylocale,r=e.defaulttranslationvalues,i=e.formats,a=e.getmessagefallback,s=void 0===a?ee.i:a,o=e.locale,l=e.messagesorerror,u=e.namespace,c=e.onerror,h=e.timezone;function d(e,n,r){var i=new ec(n,r);return c(i),s({error:i,key:e,namespace:u})}function p(e,a,c){if(l instanceof ec)return s({error:l,key:e,namespace:u});var p,f,m,g,x,_,b=[u,e].filter(function(e){return null!=e}).join(".");if(null!=n&&null!=(p=n[o])&&p[b])f=null==n?void 0:n[o][b];else{try{m=et(l,e,u)}catch(n){return d(e,v.missing_message,n.message)}if("object"==typeof m)return d(e,v.insufficient_path,void 0);try{f=new ew(m,o,(g=(0,a.gy)({},i,c),_=h?(0,a.gy)({},g,{datetime:(x=g.datetime)?object.keys(x).reduce(function(e,n){return e[n]=(0,a.gy)({timezone:h},x[n]),e},{}):x}):g,(0,a.gy)({},_,{date:null==_?void 0:_.datetime,time:null==_?void 0:_.datetime})))}catch(n){return d(e,v.invalid_message,n.message)}n&&(n[o]||(n[o]={}),n[o][b]=f)}try{var m=f.format(function(e){if(0!==object.keys(e).length){var n={};return object.keys(e).foreach(function(r){var i,a=0,s=e[r];i="function"==typeof s?function(e){var n=s(e);return(0,y.isvalidelement)(n)?(0,y.cloneelement)(n,{key:r+a++}):n}:s,n[r]=i}),n}}((0,a.gy)({},r,a)));if(null==m)throw error(void 0);return(0,y.isvalidelement)(m)||array.isarray(m)||"string"==typeof m?m:string(m)}catch(n){return d(e,v.formatting_error,n.message)}}function f(e,n,r){var i=p(e,n,r);return"string"!=typeof i?d(e,v.invalid_message,void 0):i}return f.rich=p,f.raw=function(e){if(l instanceof ec)return s({error:l,key:e,namespace:u});try{return et(l,e,u)}catch(n){return d(e,v.missing_message,n.message)}},f}({cachedformatsbylocale:d.current,getmessagefallback:o,messagesorerror:p,defaulttranslationvalues:a,namespace:r,onerror:u,formats:s,locale:l,timezone:c})},[o,p,a,r,u,s,l,c])}},1733:function(e,n,r){"use strict";r.d(n,{z:function(){return i}});var i=(0,r(7294).createcontext)(void 0)},8046:function(e,n,r){"use strict";r.d(n,{z:function(){return er}});var i=r(5487),a=r(6917);let s={current:!1};var o=r(404),l=r(415),u=r(5129);let c=e=>e*e,h=(0,u.m)(c),d=(0,l.o)(c);var p=r(4606),f=r(533),m=r(1662);let g=(e,n,r)=>(((1-3*r+3*n)*e+(3*r-6*n))*e+3*n)*e;function v(e,n,r,i){if(e===n&&r===i)return m.z;let a=n=>(function(e,n,r,i,a){let s,o;let l=0;do(s=g(o=n+(r-n)/2,i,a)-e)>0?r=o:n=o;while(math.abs(s)>1e-7&&++l<12);return o})(n,0,1,e,r);return e=>0===e||1===e?e:g(a(e),n,i)}var y=r(7255);let x=v(.33,1.53,.69,.99),_=(0,u.m)(x),a=(0,l.o)(_),b=e=>(e*=2)<1?.5*_(e):.5*(2-math.pow(2,-10*(e-1))),m={linear:m.z,easein:c,easeinout:d,easeout:h,circin:y.z7,circinout:y.x7,circout:y.bn,backin:_,backinout:a,backout:x,anticipate:b},s=e=>{if(array.isarray(e)){(0,i.k)(4===e.length,"cubic bezier arrays must contain four numerical values.");let[n,r,a,s]=e;return v(n,r,a,s)}return"string"==typeof e?((0,i.k)(void 0!==m[e],`invalid easing type '${e}'`),m[e]):e},w=e=>array.isarray(e)&&"number"!=typeof e[0];function c({keyframes:e,ease:n=d,times:r,duration:i=300}){e=[...e];let a=w(n)?n.map(s):s(n),s={done:!1,value:e[0]},o=(r&&r.length===e.length?r:(0,f.y)(e)).map(e=>e*i);function l(){var n;return(0,p.s)(o,e,{ease:array.isarray(a)?a:(n=e).map(()=>a||d).splice(0,n.length-1)})}let u=l();return{next:e=>(s.value=u(e),s.done=e>=i,s),fliptarget:()=>{e.reverse(),u=l()}}}var e=r(4169);function t(e,n){return e*math.sqrt(1-n*n)}var b=r(3038);let p=["duration","bounce"],r=["stiffness","damping","mass"];function l(e,n){return n.some(n=>void 0!==e[n])}function i({keyframes:e,restdelta:n,restspeed:r,...a}){let s=e[0],o=e[e.length-1],l={done:!1,value:s},{stiffness:u,damping:c,mass:h,velocity:d,duration:p,isresolvedfromduration:f}=function(e){let n={velocity:0,stiffness:100,damping:10,mass:1,isresolvedfromduration:!1,...e};if(!l(e,r)&&l(e,p)){let r=function({duration:e=800,bounce:n=.25,velocity:r=0,mass:a=1}){let s,o;(0,i.k)(e<=1e4,"spring duration must be 10 seconds or less");let l=1-n;l=(0,e.u)(.05,1,l),e=(0,e.u)(.01,10,e/1e3),l<1?(s=n=>{let i=n*l,a=i*e,s=t(n,l);return .001-(i-r)/s*math.exp(-a)},o=n=>{let i=n*l,a=i*e,o=math.pow(l,2)*math.pow(n,2)*e,u=t(math.pow(n,2),l),c=-s(n)+.001>0?-1:1;return c*((a*r+r-o)*math.exp(-a))/u}):(s=n=>{let i=math.exp(-n*e),a=(n-r)*e+1;return -.001+i*a},o=n=>{let i=math.exp(-n*e),a=(r-n)*(e*e);return i*a});let u=5/e,c=function(e,n,r){let i=r;for(let r=1;r<12;r++)i-=e(i)/n(i);return i}(s,o,u);if(e*=1e3,isnan(c))return{stiffness:100,damping:10,duration:e};{let n=math.pow(c,2)*a;return{stiffness:n,damping:2*l*math.sqrt(a*n),duration:e}}}(e);(n={...n,...r,velocity:0,mass:1}).isresolvedfromduration=!0}return n}(a),m=d,g=d?-(d/1e3):0,v=c/(2*math.sqrt(u*h));function y(){let e=o-s,i=math.sqrt(u/h)/1e3,a=5>math.abs(e);if(r||(r=a?.01:2),n||(n=a?.005:.5),v<1){let n=t(i,v);m=r=>o-math.exp(-v*i*r)*((g+v*i*e)/n*math.sin(n*r)+e*math.cos(n*r))}else if(1===v)m=n=>o-math.exp(-i*n)*(e+(g+i*e)*n);else{let n=i*math.sqrt(v*v-1);m=r=>{let a=math.min(n*r,300);return o-math.exp(-v*i*r)*((g+v*i*e)*math.sinh(a)+n*e*math.cosh(a))/n}}}return y(),{next:e=>{let i=m(e);if(f)l.done=e>=p;else{let a=g;if(0!==e){if(v<1){let n=math.max(0,e-5);a=(0,b.r)(i-m(n),e-n)}else a=0}let s=math.abs(a)<=r,u=math.abs(o-i)<=n;l.done=s&&u}return l.value=l.done?o:i,l},fliptarget:()=>{g=-g,[s,o]=[o,s],y()}}}i.needsinterpolation=(e,n)=>"string"==typeof e||"string"==typeof n;let d=e=>0,f={decay:function({keyframes:e=[0],velocity:n=0,power:r=.8,timeconstant:i=350,restdelta:a=.5,modifytarget:s}){let o=e[0],l={done:!1,value:o},u=r*n,c=o+u,h=void 0===s?c:s(c);return h!==c&&(u=h-o),{next:e=>{let n=-u*math.exp(-e/i);return l.done=!(n>a||n<-a),l.value=l.done?h:h+n,l},fliptarget:()=>{}}},keyframes:c,tween:c,spring:i};function o(e,n,r=0){return e-n-r}let n=e=>{let n=({delta:n})=>e(n);return{start:()=>o.z_.update(n,!0),stop:()=>o.qy.update(n)}};function k({duration:e,driver:n=n,elapsed:r=0,repeat:i=0,repeattype:a="loop",repeatdelay:s=0,keyframes:o,autoplay:l=!0,onplay:u,onstop:c,oncomplete:h,onrepeat:d,onupdate:f,type:m="keyframes",...g}){let v,y;let x=r,_=0,a=e,b=!1,m=!0,s=f[o.length>2?"keyframes":m]||c,w=o[0],e=o[o.length-1],t={done:!1,value:w},{needsinterpolation:b}=s;b&&b(w,e)&&(y=(0,p.s)([0,100],[w,e],{clamp:!1}),o=[0,100]);let p=s({...g,duration:e,keyframes:o});function r(e){if(m||(e=-e),r+=e,b||(t=p.next(math.max(0,r)),y&&(t.value=y(t.value)),b=m?t.done:r<=0),f&&f(t.value),b){if(0===_&&(a=void 0!==a?a:r),_=o+s:n<=-s)&&(_++,"reverse"===a?r=function(e,n=0,r=0,i=!0){return i?o(n+-e,n,r):n-(e-n)+r}(r,a,s,m=_%2==0):(r=o(r,a,s),"mirror"===a&&p.fliptarget()),b=!1,d&&d())}else v&&v.stop(),h&&h()}}return l&&(u&&u(),(v=n(r)).start()),{stop:()=>{c&&c(),v&&v.stop()},set currenttime(t){r=x,r(t)},sample:n=>{r=x;let i=e&&"number"==typeof e?math.max(.5*e,50):50,a=0;for(r(0);a<=n;){let e=n-a;r(math.min(e,i)),a+=i}return t}}}let h=([e,n,r,i])=>`cubic-bezier(${e}, ${n}, ${r}, ${i})`,g={linear:"linear",ease:"ease",easein:"ease-in",easeout:"ease-out",easeinout:"ease-in-out",circin:h([0,.65,.55,1]),circout:h([.55,0,1,.45]),backin:h([.31,.01,.66,-.59]),backout:h([.33,1.53,.69,.99])},u={waapi:()=>object.hasownproperty.call(element.prototype,"animate")},z={},v={};for(let e in u)v[e]=()=>(void 0===z[e]&&(z[e]=u[e]()),z[e]);let j=new set(["opacity","clippath","filter","transform"]);var w=r(3378),j=r(7367),x=r(4714);let k={type:"spring",stiffness:500,damping:25,restspeed:10},y=e=>({type:"spring",stiffness:550,damping:0===e?2*math.sqrt(550):30,restspeed:10}),q={type:"keyframes",duration:.8},q={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},z=(e,{keyframes:n})=>n.length>2?q:x.g.has(e)?e.startswith("scale")?y(n[1]):k:q;var $=r(1550);let ee=(e,n)=>"zindex"!==e&&!!("number"==typeof n||array.isarray(n)||"string"==typeof n&&$.p.test(n)&&!n.startswith("url("));var et=r(9135),en=r(1056);let er=(e,n,r,l={})=>u=>{let c=(0,en.ev)(l,e)||{},h=c.delay||l.delay||0,{elapsed:d=0}=l;d-=(0,a.w)(h);let p=function(e,n,r,i){let a=ee(n,r),s=void 0!==i.from?i.from:e.get();return("none"===s&&a&&"string"==typeof r?s=(0,et.t)(n,r):(0,en.fr)(s)&&"string"==typeof r?s=(0,en.gz)(r):!array.isarray(r)&&(0,en.fr)(r)&&"string"==typeof s&&(r=(0,en.gz)(s)),array.isarray(r))?(null===r[0]&&(r[0]=s),r):[s,r]}(n,e,r,c),f=p[0],m=p[p.length-1],g=ee(e,f),v=ee(e,m);(0,i.k)(g===v,`you are trying to animate ${e} from "${f}" to "${m}". ${f} is not an animatable value - to enable this animation set ${f} to a value animatable to ${m} via the \`style\` property.`);let y={keyframes:p,velocity:n.getvelocity(),...c,elapsed:d,onupdate:e=>{n.set(e),c.onupdate&&c.onupdate(e)},oncomplete:()=>{u(),c.oncomplete&&c.oncomplete()}};if(!g||!v||s.current||!1===c.type)return function({keyframes:e,elapsed:n,onupdate:r,oncomplete:i}){let a=()=>{r&&r(e[e.length-1]),i&&i()};return n?{stop:(0,w.g)(a,-n)}:a()}(y);if("inertia"===c.type)return function({keyframes:e,velocity:n=0,min:r,max:i,power:a=.8,timeconstant:s=750,bouncestiffness:o=500,bouncedamping:l=10,restdelta:u=1,modifytarget:c,driver:h,onupdate:d,oncomplete:p,onstop:f}){let m;let g=e[0];function v(e){return void 0!==r&&ei}function y(e){return void 0===r?i:void 0===i?r:math.abs(r-e){d&&d(n),e.onupdate&&e.onupdate(n)},oncomplete:p,onstop:f})}function _(e){x({type:"spring",stiffness:o,damping:l,restdelta:u,...e})}if(v(g))_({velocity:n,keyframes:[g,y(g)]});else{let e,i,o=a*n+g;void 0!==c&&(o=c(o));let l=y(o),h=l===r?-1:1,d=r=>{e=i,i=r,n=(0,b.r)(r-e,j.w.delta),(1===h&&r>l||-1===h&&rm&&m.stop()}}(y);if((0,en.rw)(c)||(y={...y,...z(e,y)}),y.duration&&(y.duration=(0,a.w)(y.duration)),y.repeatdelay&&(y.repeatdelay=(0,a.w)(y.repeatdelay)),n.owner&&n.owner.current instanceof htmlelement&&!n.owner.getprops().onupdate){let r=function(e,n,{onupdate:r,oncomplete:i,...a}){var s;let l=v.waapi()&&j.has(n)&&!a.repeatdelay&&"mirror"!==a.repeattype&&0!==a.damping;if(!l)return!1;let{keyframes:u,duration:c=300,elapsed:h=0,ease:d}=a;if("spring"===a.type||!(!(s=a.ease)||array.isarray(s)||"string"==typeof s&&g[s])){if(a.repeat===1/0)return;let e=k({...a,elapsed:0}),n={done:!1,value:u[0]},r=[],i=0;for(;!n.done&&i<2e4;)r.push((n=e.sample(i)).value),i+=10;u=r,c=i-10,d="linear"}let p=function(e,n,r,{delay:i=0,duration:a,repeat:s=0,repeattype:o="loop",ease:l,times:u}={}){return e.animate({[n]:r,offset:u},{delay:i,duration:a,easing:function(e){if(e)return array.isarray(e)?h(e):g[e]}(l),fill:"both",iterations:s+1,direction:"reverse"===o?"alternate":"normal"})}(e.owner.current,n,u,{...a,delay:-h,duration:c,ease:d});return p.onfinish=()=>{e.set(function(e,{repeat:n,repeattype:r="loop"}){let i=n&&"loop"!==r&&n%2==1?0:e.length-1;return e[i]}(u,a)),o.z_.update(()=>p.cancel()),i&&i()},{get currenttime(){return p.currenttime||0},set currenttime(t){p.currenttime=t},stop:()=>{let{currenttime:n}=p;if(n){let r=k({...a,autoplay:!1});e.setwithvelocity(r.sample(n-10).value,r.sample(n).value,10)}o.z_.update(()=>p.cancel())}}}(n,e,y);if(r)return r}return k(y)}},2445:function(e,n,r){"use strict";function i(e){return"object"==typeof e&&"function"==typeof e.start}r.d(n,{h:function(){return i}})},8488:function(e,n,r){"use strict";r.d(n,{c:function(){return i}});let i=e=>array.isarray(e)},1056:function(e,n,r){"use strict";r.d(n,{fr:function(){return s},gz:function(){return o},ev:function(){return l},rw:function(){return a}});var i=r(9135);function a({when:e,delay:n,delaychildren:r,staggerchildren:i,staggerdirection:a,repeat:s,repeattype:o,repeatdelay:l,from:u,elapsed:c,...h}){return!!object.keys(h).length}function s(e){return 0===e||"string"==typeof e&&0===parsefloat(e)&&-1===e.indexof(" ")}function o(e){return"number"==typeof e?0:(0,i.t)("",e)}function l(e,n){return e[n]||e.default||e}},1526:function(e,n,r){"use strict";r.d(n,{m:function(){return g}});var i=r(7294),a=r(404),s=r(8868);function o(){let e=(0,i.useref)(!1);return(0,s.l)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var l=r(240),u=r(6681);class c extends i.component{getsnapshotbeforeupdate(e){let n=this.props.childref.current;if(n&&e.ispresent&&!this.props.ispresent){let e=this.props.sizeref.current;e.height=n.offsetheight||0,e.width=n.offsetwidth||0,e.top=n.offsettop,e.left=n.offsetleft}return null}componentdidupdate(){}render(){return this.props.children}}function h({children:e,ispresent:n}){let r=(0,i.useid)(),a=(0,i.useref)(null),s=(0,i.useref)({width:0,height:0,top:0,left:0});return(0,i.useinsertioneffect)(()=>{let{width:e,height:i,top:o,left:l}=s.current;if(n||!a.current||!e||!i)return;a.current.dataset.motionpopid=r;let u=document.createelement("style");return document.head.appendchild(u),u.sheet&&u.sheet.insertrule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${e}px !important; height: ${i}px !important; top: ${o}px !important; left: ${l}px !important; } `),()=>{document.head.removechild(u)}},[n]),i.createelement(c,{ispresent:n,childref:a,sizeref:s},i.cloneelement(e,{ref:a}))}let d=({children:e,initial:n,ispresent:r,onexitcomplete:a,custom:s,presenceaffectslayout:o,mode:c})=>{let d=(0,u.h)(p),f=(0,i.useid)(),m=(0,i.usememo)(()=>({id:f,initial:n,ispresent:r,custom:s,onexitcomplete:e=>{for(let n of(d.set(e,!0),d.values()))if(!n)return;a&&a()},register:e=>(d.set(e,!1),()=>d.delete(e))}),o?void 0:[r]);return(0,i.usememo)(()=>{d.foreach((e,n)=>d.set(n,!1))},[r]),i.useeffect(()=>{r||d.size||!a||a()},[r]),"poplayout"===c&&(e=i.createelement(h,{ispresent:r},e)),i.createelement(l.o.provider,{value:m},e)};function p(){return new map}var f=r(5364);let m=e=>e.key||"",g=({children:e,custom:n,initial:r=!0,onexitcomplete:l,exitbeforeenter:u,presenceaffectslayout:c=!0,mode:h="sync"})=>{var p;u&&(h="wait");let[g]=function(){let e=o(),[n,r]=(0,i.usestate)(0),s=(0,i.usecallback)(()=>{e.current&&r(n+1)},[n]),l=(0,i.usecallback)(()=>a.z_.postrender(s),[s]);return[l,n]}(),v=(0,i.usecontext)(f.p).forcerender;v&&(g=v);let y=o(),x=function(e){let n=[];return i.children.foreach(e,e=>{(0,i.isvalidelement)(e)&&n.push(e)}),n}(e),_=x,a=new set,b=(0,i.useref)(_),m=(0,i.useref)(new map).current,s=(0,i.useref)(!0);if((0,s.l)(()=>{s.current=!1,function(e,n){e.foreach(e=>{let r=m(e);n.set(r,e)})}(x,m),b.current=_}),p=()=>{s.current=!0,m.clear(),a.clear()},(0,i.useeffect)(()=>()=>p(),[]),s.current)return i.createelement(i.fragment,null,_.map(e=>i.createelement(d,{key:m(e),ispresent:!0,initial:!!r&&void 0,presenceaffectslayout:c,mode:h},e)));_=[..._];let w=b.current.map(m),c=x.map(m),e=w.length;for(let e=0;e{if(-1!==c.indexof(e))return;let r=m.get(e);if(!r)return;let a=w.indexof(e),s=()=>{m.delete(e),a.delete(e);let n=b.current.findindex(n=>n.key===e);if(b.current.splice(n,1),!a.size){if(b.current=x,!1===y.current)return;g(),l&&l()}};_.splice(a,0,i.createelement(d,{key:m(r),ispresent:!1,onexitcomplete:s,custom:n,presenceaffectslayout:c,mode:h},r))}),_=_.map(e=>{let n=e.key;return a.has(n)?e:i.createelement(d,{key:m(e),ispresent:!0,presenceaffectslayout:c,mode:h},e)}),i.createelement(i.fragment,null,a.size?_:_.map(e=>(0,i.cloneelement)(e)))}},5947:function(e,n,r){"use strict";r.d(n,{ho:function(){return o},oo:function(){return s}});var i=r(7294),a=r(240);function s(){let e=(0,i.usecontext)(a.o);if(null===e)return[!0,null];let{ispresent:n,onexitcomplete:r,register:s}=e,o=(0,i.useid)();(0,i.useeffect)(()=>s(o),[]);let l=()=>r&&r(o);return!n&&r?[!1,l]:[!0]}function o(){var e;return null===(e=(0,i.usecontext)(a.o))||e.ispresent}},5364:function(e,n,r){"use strict";r.d(n,{p:function(){return a}});var i=r(7294);let a=(0,i.createcontext)({})},6014:function(e,n,r){"use strict";r.d(n,{_:function(){return a}});var i=r(7294);let a=(0,i.createcontext)({transformpagepoint:e=>e,isstatic:!1,reducedmotion:"never"})},4451:function(e,n,r){"use strict";r.d(n,{b:function(){return s},v:function(){return a}});var i=r(7294);let a=(0,i.createcontext)({});function s(){return(0,i.usecontext)(a).visualelement}},240:function(e,n,r){"use strict";r.d(n,{o:function(){return a}});var i=r(7294);let a=(0,i.createcontext)(null)},1705:function(e,n,r){"use strict";r.d(n,{g:function(){return a}});var i=r(7294);let a=(0,i.createcontext)({})},7255:function(e,n,r){"use strict";r.d(n,{bn:function(){return o},x7:function(){return l},z7:function(){return s}});var i=r(415),a=r(5129);let s=e=>1-math.sin(math.acos(e)),o=(0,a.m)(s),l=(0,i.o)(o)},415:function(e,n,r){"use strict";r.d(n,{o:function(){return i}});let i=e=>n=>n<=.5?e(2*n)/2:(2-e(2*(1-n)))/2},5129:function(e,n,r){"use strict";r.d(n,{m:function(){return i}});let i=e=>n=>1-e(1-n)},8456:function(e,n,r){"use strict";function i(e,n,r,i={passive:!0}){return e.addeventlistener(n,r,i),()=>e.removeeventlistener(n,r)}r.d(n,{e:function(){return i}})},486:function(e,n,r){"use strict";r.d(n,{a:function(){return s}});var i=r(8456),a=r(8148);function s(e,n,r,s){return(0,i.e)(e,n,(0,a.s)(r),s)}},8148:function(e,n,r){"use strict";r.d(n,{q:function(){return a},s:function(){return s}});var i=r(9403);function a(e,n="page"){return{point:{x:e[n+"x"],y:e[n+"y"]}}}let s=e=>n=>(0,i.d)(n)&&e(n,a(n))},9403:function(e,n,r){"use strict";r.d(n,{d:function(){return i}});let i=e=>"mouse"===e.pointertype?"number"!=typeof e.button||e.button<=0:!1!==e.isprimary},7367:function(e,n,r){"use strict";r.d(n,{w:function(){return i}});let i={delta:0,timestamp:0}},404:function(e,n,r){"use strict";r.d(n,{qy:function(){return f},iw:function(){return m},z_:function(){return p}});let i=1/60*1e3,a="undefined"!=typeof performance?()=>performance.now():()=>date.now(),s="undefined"!=typeof window?e=>window.requestanimationframe(e):e=>settimeout(()=>e(a()),i);var o=r(7367);let l=!0,u=!1,c=!1,h=["read","update","prerender","render","postrender"],d=h.reduce((e,n)=>(e[n]=function(e){let n=[],r=[],i=0,a=!1,s=!1,o=new weakset,l={schedule:(e,s=!1,l=!1)=>{let u=l&&a,c=u?n:r;return s&&o.add(e),-1===c.indexof(e)&&(c.push(e),u&&a&&(i=n.length)),e},cancel:e=>{let n=r.indexof(e);-1!==n&&r.splice(n,1),o.delete(e)},process:u=>{if(a){s=!0;return}if(a=!0,[n,r]=[r,n],r.length=0,i=n.length)for(let r=0;ru=!0),e),{}),p=h.reduce((e,n)=>{let r=d[n];return e[n]=(e,n=!1,i=!1)=>(u||y(),r.schedule(e,n,i)),e},{}),f=h.reduce((e,n)=>(e[n]=d[n].cancel,e),{}),m=h.reduce((e,n)=>(e[n]=()=>d[n].process(o.w),e),{}),g=e=>d[e].process(o.w),v=e=>{u=!1,o.w.delta=l?i:math.max(math.min(e-o.w.timestamp,40),1),o.w.timestamp=e,c=!0,h.foreach(g),c=!1,u&&(l=!1,s(v))},y=()=>{u=!0,l=!0,c||s(v)}},7544:function(e,n,r){"use strict";function i(e){let n=null;return()=>{let r=()=>{n=null};return null===n&&(n=e,r)}}r.d(n,{fj:function(){return o},gd:function(){return l}});let a=i("draghorizontal"),s=i("dragvertical");function o(e){let n=!1;if("y"===e)n=s();else if("x"===e)n=a();else{let e=a(),r=s();e&&r?n=()=>{e(),r()}:(e&&e(),r&&r())}return n}function l(){let e=o(!0);return!e||(e(),!1)}},806:function(e,n,r){"use strict";r.d(n,{l:function(){return i}});class i{constructor(e){this.ismounted=!1,this.node=e}update(){}}},1376:function(e,n,r){"use strict";r.d(n,{s:function(){return e}});var i=r(2445),a=r(8488);function s(e,n){if(!array.isarray(n))return!1;let r=n.length;if(r!==e.length)return!1;for(let i=0;ig(e,i,r):()=>promise.resolve(),o=e.variantchildren&&e.variantchildren.size?(i=0)=>{let{delaychildren:s=0,staggerchildren:o,staggerdirection:l}=a;return function(e,n,r=0,i=0,a=1,s){let o=[],l=(e.variantchildren.size-1)*i,u=1===a?(e=0)=>e*i:(e=0)=>l-e*i;return array.from(e.variantchildren).sort(v).foreach((e,i)=>{e.notify("animationstart",n),o.push(m(e,n,{...s,delay:r+u(i)}).then(()=>e.notify("animationcomplete",n)))}),promise.all(o)}(e,n,s+i,o,l,r)}:()=>promise.resolve(),{when:u}=a;if(!u)return promise.all([s(),o(r.delay)]);{let[e,n]="beforechildren"===u?[s,o]:[o,s];return e().then(n)}}function g(e,n,{delay:r=0,transitionoverride:i,type:a}={}){let{transition:s=e.getdefaulttransition(),transitionend:l,...h}=e.maketargetanimatable(n),m=e.getvalue("willchange");i&&(s=i);let g=[],v=a&&e.animationstate&&e.animationstate.getstate()[a];for(let n in h){let i=e.getvalue(n),a=h[n];if(!i||void 0===a||v&&function({protectedkeys:e,needsanimating:n},r){let i=e.hasownproperty(r)&&!0!==n[r];return n[r]=!1,i}(v,n))continue;let o={delay:r,elapsed:0,...s};if(window.handoffappearanimations&&!i.hasanimated){let r=e.getprops()[d];r&&(o.elapsed=window.handoffappearanimations(r,n,i,f.z_))}let l=i.start((0,p.z)(n,i,a,e.shouldreducemotion&&u.g.has(n)?{type:!1}:o));(0,c.l)(m)&&(m.add(n),l=l.then(()=>m.remove(n))),g.push(l)}return promise.all(g).then(()=>{l&&(0,o.cd)(e,l)})}function v(e,n){return e.sortnodeposition(n)}var y=r(7732),x=r(2963);let _=[...x.e].reverse(),a=x.e.length;function b(e=!1){return{isactive:e,protectedkeys:{},needsanimating:{},prevresolvedvalues:{}}}var m=r(806);class s extends m.l{constructor(e){super(e),e.animationstate||(e.animationstate=function(e){let n=n=>promise.all(n.map(({animation:n,options:r})=>(function(e,n,r={}){let i;if(e.notify("animationstart",n),array.isarray(n)){let a=n.map(n=>m(e,n,r));i=promise.all(a)}else if("string"==typeof n)i=m(e,n,r);else{let a="function"==typeof n?(0,l.x)(e,n,r.custom):n;i=g(e,a,r)}return i.then(()=>e.notify("animationcomplete",n))})(e,n,r))),r={animate:b(!0),whileinview:b(),whilehover:b(),whiletap:b(),whiledrag:b(),whilefocus:b(),exit:b()},o=!0,u=(n,r)=>{let i=(0,l.x)(e,r);if(i){let{transition:e,transitionend:r,...a}=i;n={...n,...a,...r}}return n};function c(l,c){let h=e.getprops(),d=e.getvariantcontext(!0)||{},p=[],f=new set,m={},g=1/0;for(let n=0;ng&&m,t=array.isarray(b)?b:[b],b=t.reduce(u,{});!1===s&&(b={});let{prevresolvedvalues:p={}}=a,r={...p,...b},l=e=>{e=!0,f.delete(e),a.needsanimating[e]=!0};for(let e in r){let n=b[e],r=p[e];m.hasownproperty(e)||(n!==r?(0,a.c)(n)&&(0,a.c)(r)?!s(n,r)||c?l(e):a.protectedkeys[e]=!0:void 0!==n?l(e):f.add(e):void 0!==n&&f.has(e)?l(e):a.protectedkeys[e]=!0)}a.prevprop=b,a.prevresolvedvalues=b,a.isactive&&(m={...m,...b}),o&&e.blockinitialanimation&&(e=!1),e&&!w&&p.push(...t.map(e=>({animation:e,options:{type:x,...l}})))}if(f.size){let n={};f.foreach(r=>{let i=e.getbasetarget(r);void 0!==i&&(n[r]=i)}),p.push({animation:n})}let x=boolean(p.length);return o&&!1===h.initial&&!e.manuallyanimateonmount&&(x=!1),o=!1,x?n(p):promise.resolve()}return{animatechanges:c,setactive:function(n,i,a){var s;if(r[n].isactive===i)return promise.resolve();null===(s=e.variantchildren)||void 0===s||s.foreach(e=>{var r;return null===(r=e.animationstate)||void 0===r?void 0:r.setactive(n,i)}),r[n].isactive=i;let o=c(a,n);for(let e in r)r[e].protectedkeys={};return o},setanimatefunction:function(r){n=r(e)},getstate:()=>r}}(e))}updateanimationcontrolssubscription(){let{animate:e}=this.node.getprops();this.unmount(),(0,i.h)(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateanimationcontrolssubscription()}update(){let{animate:e}=this.node.getprops(),{animate:n}=this.node.prevprops||{};e!==n&&this.updateanimationcontrolssubscription()}unmount(){}}let w=0;class c extends m.l{constructor(){super(...arguments),this.id=w++}update(){if(!this.node.presencecontext)return;let{ispresent:e,onexitcomplete:n,custom:r}=this.node.presencecontext,{ispresent:i}=this.node.prevpresencecontext||{};if(!this.node.animationstate||e===i)return;let a=this.node.animationstate.setactive("exit",!e,{custom:null!=r?r:this.node.getprops().custom});n&&!e&&a.then(()=>n(this.id))}mount(){let{register:e}=this.node.presencecontext||{};e&&(this.unmount=e(this.id))}unmount(){}}let e={animation:{feature:s},exit:{feature:c}}},9442:function(e,n,r){"use strict";r.d(n,{a:function(){return a}});let i={animation:["animate","exit","variants","whilehover","whiletap","whilefocus","whiledrag","whileinview"],exit:["exit"],drag:["drag","dragcontrols"],focus:["whilefocus"],hover:["whilehover","onhoverstart","onhoverend"],tap:["whiletap","ontap","ontapstart","ontapcancel"],pan:["onpan","onpanstart","onpansessionstart","onpanend"],inview:["whileinview","onviewportenter","onviewportleave"],layout:["layout","layoutid"]},a={};for(let e in i)a[e]={isenabled:n=>i[e].some(e=>!!n[e])}},2556:function(e,n,r){"use strict";r.d(n,{f:function(){return b}});var i=r(7294),a=r(6014),s=r(4451),o=r(240),l=r(8868);let u=(0,i.createcontext)({strict:!1});var c=r(1804),h=r(7732),d=r(7504);function p(e){return array.isarray(e)?e.join(" "):e}var f=r(9442),m=r(1741),g=r(6681),v=r(3083);let y=1;var x=r(5364),_=r(1705);let a=symbol.for("motioncomponentsymbol");function b({preloadedfeatures:e,createvisualelement:n,userender:r,usevisualstate:b,component:m}){e&&function(e){for(let n in e)f.a[n]={...f.a[n],...e[n]}}(e);let s=(0,i.forwardref)(function(f,a){var s,w;let c;let e={...(0,i.usecontext)(a._),...f,layoutid:function({layoutid:e}){let n=(0,i.usecontext)(x.p).id;return n&&void 0!==e?n+"-"+e:e}(f)},{isstatic:t}=e,b=function(e){let{initial:n,animate:r}=function(e,n){if((0,d.g)(e)){let{initial:n,animate:r}=e;return{initial:!1===n||(0,h.$)(n)?n:void 0,animate:(0,h.$)(r)?r:void 0}}return!1!==e.inherit?n:{}}(e,(0,i.usecontext)(s.v));return(0,i.usememo)(()=>({initial:n,animate:r}),[p(n),p(r)])}(f),p=t?void 0:(0,g.h)(()=>{if(v.v.haseverupdated)return y++}),r=b(f,t);if(!t&&m.j){b.visualelement=function(e,n,r,c){let h=(0,s.b)(),d=(0,i.usecontext)(u),p=(0,i.usecontext)(o.o),f=(0,i.usecontext)(a._).reducedmotion,m=(0,i.useref)();c=c||d.renderer,!m.current&&c&&(m.current=c(e,{visualstate:n,parent:h,props:r,presencecontext:p,blockinitialanimation:!!p&&!1===p.initial,reducedmotionconfig:f}));let g=m.current;(0,i.useinsertioneffect)(()=>{g&&g.update(r,p)}),(0,l.l)(()=>{g&&g.render()}),(0,i.useeffect)(()=>{g&&g.updatefeatures()});let v=window.handoffappearanimations?l.l:i.useeffect;return v(()=>{g&&g.animationstate&&g.animationstate.animatechanges()}),g}(m,r,e,n);let r=(0,i.usecontext)(_.g),c=(0,i.usecontext)(u).strict;b.visualelement&&(c=b.visualelement.loadfeatures(e,c,e,p,r))}return i.createelement(s.v.provider,{value:b},c&&b.visualelement?i.createelement(c,{visualelement:b.visualelement,...e}):null,r(m,f,p,(s=b.visualelement,w=a,(0,i.usecallback)(e=>{e&&r.mount&&r.mount(e),s&&(e?s.mount(e):s.unmount()),w&&("function"==typeof w?w(e):(0,c.i)(w)&&(w.current=e))},[s])),r,t,b.visualelement))});return s[a]=m,s}},5180:function(e,n,r){"use strict";r.d(n,{t:function(){return d}});var i=r(7294),a=r(2445),s=r(240),o=r(9432),l=r(6681),u=r(6399),c=r(4451),h=r(7504);let d=e=>(n,r)=>{let d=(0,i.usecontext)(c.v),p=(0,i.usecontext)(s.o),f=()=>(function({scrapemotionvaluesfromprops:e,createrenderstate:n,onmount:r},i,s,l){let c={latestvalues:function(e,n,r,i){let s={},l=i(e,{});for(let e in l)s[e]=(0,u.b)(l[e]);let{initial:c,animate:d}=e,p=(0,h.g)(e),f=(0,h.m)(e);n&&f&&!p&&!1!==e.inherit&&(void 0===c&&(c=n.initial),void 0===d&&(d=n.animate));let m=!!r&&!1===r.initial;m=m||!1===c;let g=m?d:c;if(g&&"boolean"!=typeof g&&!(0,a.h)(g)){let n=array.isarray(g)?g:[g];n.foreach(n=>{let r=(0,o.o)(e,n);if(!r)return;let{transitionend:i,transition:a,...l}=r;for(let e in l){let n=l[e];if(array.isarray(n)){let e=m?n.length-1:0;n=n[e]}null!==n&&(s[e]=n)}for(let e in i)s[e]=i[e]})}return s}(i,s,l,e),renderstate:n()};return r&&(c.mount=e=>r(i,e,c)),c})(e,n,d,p);return r?f():(0,l.h)(f)}},1512:function(e,n,r){"use strict";r.d(n,{do:function(){return o},wc:function(){return a}});let i=()=>({translate:0,scale:1,origin:0,originpoint:0}),a=()=>({x:i(),y:i()}),s=()=>({min:0,max:0}),o=()=>({x:s(),y:s()})},3083:function(e,n,r){"use strict";r.d(n,{v:function(){return i}});let i={hasanimatedsinceresize:!0,haseverupdated:!1}},1303:function(e,n,r){"use strict";r.d(n,{l:function(){return s}});var i=r(404),a=r(1512),s=r(1804),o=r(1741);let l={current:null},u={current:!1};var c=r(1560),h=r(3234),d=r(2490),p=r(406),f=r(4714),m=r(7504),g=r(7732),v=r(9432),y=r(9442),x=r(2963);let _=object.keys(y.a),a=_.length,b=["animationstart","animationcomplete","update","beforelayoutmeasure","layoutmeasure","layoutanimationstart","layoutanimationcomplete"],m=x.v.length;class s{constructor({parent:e,props:n,presencecontext:r,reducedmotionconfig:a,visualstate:s},o={}){this.current=null,this.children=new set,this.isvariantnode=!1,this.iscontrollingvariants=!1,this.shouldreducemotion=null,this.values=new map,this.features={},this.valuesubscriptions=new map,this.prevmotionvalues={},this.events={},this.propeventsubscriptions={},this.notifyupdate=()=>this.notify("update",this.latestvalues),this.render=()=>{this.current&&(this.triggerbuild(),this.renderinstance(this.current,this.renderstate,this.props.style,this.projection))},this.schedulerender=()=>i.z_.render(this.render,!1,!0);let{latestvalues:l,renderstate:u}=s;this.latestvalues=l,this.basetarget={...l},this.initialvalues=n.initial?{...l}:{},this.renderstate=u,this.parent=e,this.props=n,this.presencecontext=r,this.depth=e?e.depth+1:0,this.reducedmotionconfig=a,this.options=o,this.iscontrollingvariants=(0,m.g)(n),this.isvariantnode=(0,m.m)(n),this.isvariantnode&&(this.variantchildren=new set),this.manuallyanimateonmount=boolean(e&&e.current);let{willchange:c,...h}=this.scrapemotionvaluesfromprops(n,{});for(let e in h){let n=h[e];void 0!==l[e]&&(0,p.i)(n)&&(n.set(l[e],!1),(0,d.l)(c)&&c.add(e))}}scrapemotionvaluesfromprops(e,n){return{}}mount(e){this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isvariantnode&&!this.iscontrollingvariants&&(this.removefromvarianttree=this.parent.addvariantchild(this)),this.values.foreach((e,n)=>this.bindtomotionvalue(n,e)),u.current||function(){if(u.current=!0,o.j){if(window.matchmedia){let e=window.matchmedia("(prefers-reduced-motion)"),n=()=>l.current=e.matches;e.addlistener(n),n()}else l.current=!1}}(),this.shouldreducemotion="never"!==this.reducedmotionconfig&&("always"===this.reducedmotionconfig||l.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presencecontext)}unmount(){for(let e in this.projection&&this.projection.unmount(),i.qy.update(this.notifyupdate),i.qy.render(this.render),this.valuesubscriptions.foreach(e=>e()),this.removefromvarianttree&&this.removefromvarianttree(),this.parent&&this.parent.children.delete(this),this.events)this.events[e].clear();for(let e in this.features)this.features[e].unmount();this.current=null}bindtomotionvalue(e,n){let r=f.g.has(e),a=n.on("change",n=>{this.latestvalues[e]=n,this.props.onupdate&&i.z_.update(this.notifyupdate,!1,!0),r&&this.projection&&(this.projection.istransformdirty=!0)}),s=n.on("renderrequest",this.schedulerender);this.valuesubscriptions.set(e,()=>{a(),s()})}sortnodeposition(e){return this.current&&this.sortinstancenodeposition&&this.type===e.type?this.sortinstancenodeposition(this.current,e.current):0}loadfeatures({children:e,...n},r,i,a,o){let l,u;for(let e=0;ethis.schedulerender(),animationtype:"string"==typeof r?r:"both",initialpromotionconfig:o,layoutscroll:c,layoutroot:h})}return u}updatefeatures(){for(let e in this.features){let n=this.features[e];n.ismounted?n.update(this.props,this.prevprops):(n.mount(),n.ismounted=!0)}}triggerbuild(){this.build(this.renderstate,this.latestvalues,this.options,this.props)}measureviewportbox(){return this.current?this.measureinstanceviewportbox(this.current,this.props):(0,a.do)()}getstaticvalue(e){return this.latestvalues[e]}setstaticvalue(e,n){this.latestvalues[e]=n}maketargetanimatable(e,n=!0){return this.maketargetanimatablefrominstance(e,this.props,n)}update(e,n){(e.transformtemplate||this.props.transformtemplate)&&this.schedulerender(),this.prevprops=this.props,this.props=e,this.prevpresencecontext=this.presencecontext,this.presencecontext=n;for(let n=0;nn.variantchildren.delete(e)}addvalue(e,n){n!==this.values.get(e)&&(this.removevalue(e),this.bindtomotionvalue(e,n)),this.values.set(e,n),this.latestvalues[e]=n.get()}removevalue(e){this.values.delete(e);let n=this.valuesubscriptions.get(e);n&&(n(),this.valuesubscriptions.delete(e)),delete this.latestvalues[e],this.removevaluefromrenderstate(e,this.renderstate)}hasvalue(e){return this.values.has(e)}getvalue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==n&&(r=(0,h.b)(n,{owner:this}),this.addvalue(e,r)),r}readvalue(e){return void 0===this.latestvalues[e]&&this.current?this.readvaluefrominstance(this.current,e,this.options):this.latestvalues[e]}setbasetarget(e,n){this.basetarget[e]=n}getbasetarget(e){var n;let{initial:r}=this.props,i="string"==typeof r||"object"==typeof r?null===(n=(0,v.o)(this.props,r))||void 0===n?void 0:n[e]:void 0;if(r&&void 0!==i)return i;let a=this.getbasetargetfromprops(this.props,e);return void 0===a||(0,p.i)(a)?void 0!==this.initialvalues[e]&&void 0===i?void 0:this.basetarget[e]:a}on(e,n){return this.events[e]||(this.events[e]=new c.l),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}},3778:function(e,n,r){"use strict";r.d(n,{e:function(){return n_}});var i=r(2556);let a=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function s(e){if("string"!=typeof e||e.includes("-"));else if(a.indexof(e)>-1||/[a-z]/.test(e))return!0;return!1}var o=r(7294);let l={};var u=r(4714);function c(e,{layout:n,layoutid:r}){return u.g.has(e)||e.startswith("origin")||(n||void 0!==r)&&(!!l[e]||"opacity"===e)}var h=r(406);let d={x:"translatex",y:"translatey",z:"translatez",transformperspective:"perspective"},p=u._.length;var f=r(7630);let m=(e,n)=>n&&"number"==typeof e?n.transform(e):e;var g=r(6173);function v(e,n,r,i){let{style:a,vars:s,transform:o,transformorigin:l}=e,c=!1,h=!1,v=!0;for(let e in n){let r=n[e];if((0,f.f)(e)){s[e]=r;continue}let i=g.j[e],d=m(r,i);if(u.g.has(e)){if(c=!0,o[e]=d,!v)continue;r!==(i.default||0)&&(v=!1)}else e.startswith("origin")?(h=!0,l[e]=d):a[e]=d}if(!n.transform&&(c||i?a.transform=function(e,{enablehardwareacceleration:n=!0,allowtransformnone:r=!0},i,a){let s="";for(let n=0;n({style:{},transform:{},transformorigin:{},vars:{}});function x(e,n,r){for(let i in n)(0,h.i)(n[i])||c(i,r)||(e[i]=n[i])}function _(e,n,r){let i={},a=function(e,n,r){let i=e.style||{},a={};return x(a,i,e),object.assign(a,function({transformtemplate:e},n,r){return(0,o.usememo)(()=>{let i=y();return v(i,n,{enablehardwareacceleration:!r},e),object.assign({},i.vars,i.style)},[n])}(e,n,r)),e.transformvalues?e.transformvalues(a):a}(e,n,r);return e.drag&&!1!==e.draglistener&&(i.draggable=!1,a.userselect=a.webkituserselect=a.webkittouchcallout="none",a.touchaction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabindex&&(e.ontap||e.ontapstart||e.whiletap)&&(i.tabindex=0),i.style=a,i}var a=r(1492),b=r(6190);function m(e,n,r){return"string"==typeof e?e:b.px.transform(n+r*e)}let s={offset:"stroke-dashoffset",array:"stroke-dasharray"},w={offset:"strokedashoffset",array:"strokedasharray"};function c(e,{attrx:n,attry:r,originx:i,originy:a,pathlength:s,pathspacing:o=1,pathoffset:l=0,...u},c,h,d){if(v(e,u,c,d),h){e.style.viewbox&&(e.attrs.viewbox=e.style.viewbox);return}e.attrs=e.style,e.style={};let{attrs:p,style:f,dimensions:m}=e;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==i||void 0!==a||f.transform)&&(f.transformorigin=function(e,n,r){let i=m(n,e.x,e.width),a=m(r,e.y,e.height);return`${i} ${a}`}(m,void 0!==i?i:.5,void 0!==a?a:.5)),void 0!==n&&(p.x=n),void 0!==r&&(p.y=r),void 0!==s&&function(e,n,r=1,i=0,a=!0){e.pathlength=1;let s=a?s:w;e[s.offset]=b.px.transform(-i);let o=b.px.transform(n),l=b.px.transform(r);e[s.array]=`${o} ${l}`}(p,s,o,l,!1)}let e=()=>({...y(),attrs:{}}),t=e=>"string"==typeof e&&"svg"===e.tolowercase();function b(e,n,r,i){let a=(0,o.usememo)(()=>{let r=e();return c(r,n,{enablehardwareacceleration:!1},t(i),e.transformtemplate),{...r.attrs,style:{...r.style}}},[n]);if(e.style){let n={};x(n,e.style,e),a.style={...n,...a.style}}return a}var p=r(3193);function r(e,{style:n,vars:r},i,a){for(let s in object.assign(e.style,n,a&&a.getprojectionstyles(i)),r)e.style.setproperty(s,r[s])}let l=new set(["basefrequency","diffuseconstant","kernelmatrix","kernelunitlength","keysplines","keytimes","limitingconeangle","markerheight","markerwidth","numoctaves","targetx","targety","surfacescale","specularconstant","specularexponent","stddeviation","tablevalues","viewbox","gradienttransform","pathlength","startoffset","textlength","lengthadjust"]);function i(e,n,r,i){for(let r in r(e,n,void 0,i),n.attrs)e.setattribute(l.has(r)?r:(0,p.d)(r),n.attrs[r])}function d(e,n){let{style:r}=e,i={};for(let a in r)((0,h.i)(r[a])||n.style&&(0,h.i)(n.style[a])||c(a,e))&&(i[a]=r[a]);return i}function f(e,n){let r=d(e,n);for(let i in e)if((0,h.i)(e[i])||(0,h.i)(n[i])){let n="x"===i||"y"===i?"attr"+i.touppercase():i;r[n]=e[i]}return r}var o=r(5180);let n={usevisualstate:(0,o.t)({scrapemotionvaluesfromprops:f,createrenderstate:e,onmount:(e,n,{renderstate:r,latestvalues:i})=>{try{r.dimensions="function"==typeof n.getbbox?n.getbbox():n.getboundingclientrect()}catch(e){r.dimensions={x:0,y:0,width:0,height:0}}c(r,i,{enablehardwareacceleration:!1},t(n.tagname),e.transformtemplate),i(n,r)}})},k={usevisualstate:(0,o.t)({scrapemotionvaluesfromprops:d,createrenderstate:y})};var h=r(486),g=r(3624),u=r(7544),z=r(806);function v(e,n){let r="onhover"+(n?"start":"end"),i=(i,a)=>{if("touch"===i.type||(0,u.gd)())return;let s=e.getprops();e.animationstate&&s.whilehover&&e.animationstate.setactive("whilehover",n),s[r]&&s[r](i,a)};return(0,h.a)(e.current,"pointer"+(n?"enter":"leave"),i,{passive:!e.getprops()[r]})}class j extends z.l{mount(){this.unmount=(0,g.z)(v(this.node,!0),v(this.node,!1))}unmount(){}}var w=r(8456);class j extends z.l{constructor(){super(...arguments),this.isactive=!1}onfocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(n){e=!0}e&&this.node.animationstate&&(this.node.animationstate.setactive("whilefocus",!0),this.isactive=!0)}onblur(){this.isactive&&this.node.animationstate&&(this.node.animationstate.setactive("whilefocus",!1),this.isactive=!1)}mount(){this.unmount=(0,g.z)((0,w.e)(this.node.current,"focus",()=>this.onfocus()),(0,w.e)(this.node.current,"blur",()=>this.onblur()))}unmount(){}}var x=r(8148);let k=(e,n)=>!!n&&(e===n||k(e,n.parentelement));var y=r(1662);function q(e,n){if(!n)return;let r=new pointerevent("pointer"+e);n(r,(0,x.q)(r))}class q extends z.l{constructor(){super(...arguments),this.removestartlisteners=y.z,this.removeendlisteners=y.z,this.removeaccessiblelisteners=y.z,this.startpointerpress=(e,n)=>{if(this.removeendlisteners(),this.ispressing)return;let r=this.node.getprops(),i=(e,n)=>{if(!this.checkpressend())return;let{ontap:r,ontapcancel:i}=this.node.getprops();k(this.node.current,e.target)?r&&r(e,n):i&&i(e,n)},a=(0,h.a)(window,"pointerup",i,{passive:!(r.ontap||r.onpointerup)}),s=(0,h.a)(window,"pointercancel",(e,n)=>this.cancelpress(e,n),{passive:!(r.ontapcancel||r.onpointercancel)});this.removeendlisteners=(0,g.z)(a,s),this.startpress(e,n)},this.startaccessiblepress=()=>{let e=e=>{if("enter"!==e.key||this.ispressing)return;let n=e=>{"enter"===e.key&&this.checkpressend()&&q("up",this.node.getprops().ontap)};this.removeendlisteners(),this.removeendlisteners=(0,w.e)(this.node.current,"keyup",n),q("down",(e,n)=>{this.startpress(e,n)})},n=(0,w.e)(this.node.current,"keydown",e),r=()=>{this.ispressing&&q("cancel",(e,n)=>this.cancelpress(e,n))},i=(0,w.e)(this.node.current,"blur",r);this.removeaccessiblelisteners=(0,g.z)(n,i)}}startpress(e,n){this.ispressing=!0;let{ontapstart:r,whiletap:i}=this.node.getprops();i&&this.node.animationstate&&this.node.animationstate.setactive("whiletap",!0),r&&r(e,n)}checkpressend(){this.removeendlisteners(),this.ispressing=!1;let e=this.node.getprops();return e.whiletap&&this.node.animationstate&&this.node.animationstate.setactive("whiletap",!1),!(0,u.gd)()}cancelpress(e,n){if(!this.checkpressend())return;let{ontapcancel:r}=this.node.getprops();r&&r(e,n)}mount(){let e=this.node.getprops(),n=(0,h.a)(this.node.current,"pointerdown",this.startpointerpress,{passive:!(e.ontapstart||e.onpointerstart)}),r=(0,w.e)(this.node.current,"focus",this.startaccessiblepress);this.removestartlisteners=(0,g.z)(n,r)}unmount(){this.removestartlisteners(),this.removeendlisteners(),this.removeaccessiblelisteners()}}let z=new weakmap,$=new weakmap,ee=e=>{let n=z.get(e.target);n&&n(e)},et=e=>{e.foreach(ee)},en={some:0,all:1};class er extends z.l{constructor(){super(...arguments),this.hasenteredview=!1,this.isinview=!1}viewportfallback(){requestanimationframe(()=>{this.hasenteredview=!0;let{onviewportenter:e}=this.node.getprops();e&&e(null),this.node.animationstate&&this.node.animationstate.setactive("whileinview",!0)})}startobserver(){this.unmount();let{viewport:e={}}=this.node.getprops(),{root:n,margin:r,amount:i="some",once:a,fallback:s=!0}=e;if("undefined"==typeof intersectionobserver){s&&this.viewportfallback();return}let o={root:n?n.current:void 0,rootmargin:r,threshold:"number"==typeof i?i:en[i]},l=e=>{let{isintersecting:n}=e;if(this.isinview===n||(this.isinview=n,a&&!n&&this.hasenteredview))return;n&&(this.hasenteredview=!0),this.node.animationstate&&this.node.animationstate.setactive("whileinview",n);let{onviewportenter:r,onviewportleave:i}=this.node.getprops(),s=n?r:i;s&&s(e)};return function(e,n,r){let i=function({root:e,...n}){let r=e||document;$.has(r)||$.set(r,{});let i=$.get(r),a=json.stringify(n);return i[a]||(i[a]=new intersectionobserver(et,{root:e,...n})),i[a]}(n);return z.set(e,r),i.observe(e),()=>{z.delete(e),i.unobserve(e)}}(this.node.current,o,l)}mount(){this.startobserver()}update(){if("undefined"==typeof intersectionobserver)return;let{props:e,prevprops:n}=this.node,r=["amount","margin","root"].some(function({viewport:e={}},{viewport:n={}}={}){return r=>e[r]!==n[r]}(e,n));r&&this.startobserver()}unmount(){}}var ei=r(1376),ea=r(5487),es=r(404),eo=r(6917);let el=(e,n)=>math.abs(e-n);var eu=r(7367),ec=r(9403);class eh{constructor(e,n,{transformpagepoint:r}={}){if(this.startevent=null,this.lastmoveevent=null,this.lastmoveeventinfo=null,this.handlers={},this.updatepoint=()=>{if(!(this.lastmoveevent&&this.lastmoveeventinfo))return;let e=ef(this.lastmoveeventinfo,this.history),n=null!==this.startevent,r=function(e,n){let r=el(e.x,n.x),i=el(e.y,n.y);return math.sqrt(r**2+i**2)}(e.offset,{x:0,y:0})>=3;if(!n&&!r)return;let{point:i}=e,{timestamp:a}=eu.w;this.history.push({...i,timestamp:a});let{onstart:s,onmove:o}=this.handlers;n||(s&&s(this.lastmoveevent,e),this.startevent=this.lastmoveevent),o&&o(this.lastmoveevent,e)},this.handlepointermove=(e,n)=>{this.lastmoveevent=e,this.lastmoveeventinfo=ed(n,this.transformpagepoint),es.z_.update(this.updatepoint,!0)},this.handlepointerup=(e,n)=>{if(this.end(),!(this.lastmoveevent&&this.lastmoveeventinfo))return;let{onend:r,onsessionend:i}=this.handlers,a=ef("pointercancel"===e.type?this.lastmoveeventinfo:ed(n,this.transformpagepoint),this.history);this.startevent&&r&&r(e,a),i&&i(e,a)},!(0,ec.d)(e))return;this.handlers=n,this.transformpagepoint=r;let i=(0,x.q)(e),a=ed(i,this.transformpagepoint),{point:s}=a,{timestamp:o}=eu.w;this.history=[{...s,timestamp:o}];let{onsessionstart:l}=n;l&&l(e,ef(a,this.history)),this.removelisteners=(0,g.z)((0,h.a)(window,"pointermove",this.handlepointermove),(0,h.a)(window,"pointerup",this.handlepointerup),(0,h.a)(window,"pointercancel",this.handlepointerup))}updatehandlers(e){this.handlers=e}end(){this.removelisteners&&this.removelisteners(),es.qy.update(this.updatepoint)}}function ed(e,n){return n?{point:n(e.point)}:e}function ep(e,n){return{x:e.x-n.x,y:e.y-n.y}}function ef({point:e},n){return{point:e,delta:ep(e,em(n)),offset:ep(e,n[0]),velocity:function(e,n){if(e.length<2)return{x:0,y:0};let r=e.length-1,i=null,a=em(e);for(;r>=0&&(i=e[r],!(a.timestamp-i.timestamp>(0,eo.w)(.1)));)r--;if(!i)return{x:0,y:0};let s=(a.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};let o={x:(a.x-i.x)/s,y:(a.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}(n,0)}}function em(e){return e[e.length-1]}var eg=r(1804),ev=r(3967),ey=r(22);function ex(e){return e.max-e.min}function e_(e,n=0,r=.01){return math.abs(e-n)<=r}function ea(e,n,r,i=.5){e.origin=i,e.originpoint=(0,ey.c)(n.min,n.max,e.origin),e.scale=ex(r)/ex(n),(e_(e.scale,1,1e-4)||isnan(e.scale))&&(e.scale=1),e.translate=(0,ey.c)(r.min,r.max,e.origin)-e.originpoint,(e_(e.translate)||isnan(e.translate))&&(e.translate=0)}function eb(e,n,r,i){ea(e.x,n.x,r.x,i?i.originx:void 0),ea(e.y,n.y,r.y,i?i.originy:void 0)}function em(e,n,r){e.min=r.min+n.min,e.max=e.min+ex(n)}function es(e,n,r){e.min=n.min-r.min,e.max=e.min+ex(n)}function ew(e,n,r){es(e.x,n.x,r.x),es(e.y,n.y,r.y)}var ec=r(4169);function ee(e,n,r){return{min:void 0!==n?e.min+n:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function et(e,n){let r=n.min-e.min,i=n.max-e.max;return n.max-n.min1.0000000000001||e<.999999999999?e:1}function ez(e,n){e.min=e.min+n,e.max=e.max+n}function ev(e,n,[r,i,a]){let s=void 0!==n[a]?n[a]:.5,o=(0,ey.c)(e.min,e.max,s);eh(e,n[r],n[i],o,n.scale)}let ej=["x","scalex","originx"],ew=["y","scaley","originy"];function ej(e,n){ev(e.x,n,ej),ev(e.y,n,ew)}function ex(e,n){return ei(function(e,n){if(!n)return e;let r=n({x:e.left,y:e.top}),i=n({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:i.y,right:i.x}}(e.getboundingclientrect(),n))}var ek=r(8046);let ey=new weakmap;class eq{constructor(e){this.opengloballock=null,this.isdragging=!1,this.currentdirection=null,this.originpoint={x:0,y:0},this.constraints=!1,this.hasmutatedconstraints=!1,this.elastic=(0,er.do)(),this.visualelement=e}start(e,{snaptocursor:n=!1}={}){let{presencecontext:r}=this.visualelement;if(r&&!1===r.ispresent)return;let i=e=>{this.stopanimation(),n&&this.snaptocursor((0,x.q)(e,"page").point)},a=(e,n)=>{let{drag:r,dragpropagation:i,ondragstart:a}=this.getprops();if(r&&!i&&(this.opengloballock&&this.opengloballock(),this.opengloballock=(0,u.fj)(r),!this.opengloballock))return;this.isdragging=!0,this.currentdirection=null,this.resolveconstraints(),this.visualelement.projection&&(this.visualelement.projection.isanimationblocked=!0,this.visualelement.projection.target=void 0),el(e=>{let n=this.getaxismotionvalue(e).get()||0;if(b.aq.test(n)){let{projection:r}=this.visualelement;if(r&&r.layout){let i=r.layout.layoutbox[e];if(i){let e=ex(i);n=e*(parsefloat(n)/100)}}}this.originpoint[e]=n}),a&&a(e,n);let{animationstate:s}=this.visualelement;s&&s.setactive("whiledrag",!0)},s=(e,n)=>{let{dragpropagation:r,dragdirectionlock:i,ondirectionlock:a,ondrag:s}=this.getprops();if(!r&&!this.opengloballock)return;let{offset:o}=n;if(i&&null===this.currentdirection){this.currentdirection=function(e,n=10){let r=null;return math.abs(e.y)>n?r="y":math.abs(e.x)>n&&(r="x"),r}(o),null!==this.currentdirection&&a&&a(this.currentdirection);return}this.updateaxis("x",n.point,o),this.updateaxis("y",n.point,o),this.visualelement.render(),s&&s(e,n)},o=(e,n)=>this.stop(e,n);this.pansession=new eh(e,{onsessionstart:i,onstart:a,onmove:s,onsessionend:o},{transformpagepoint:this.visualelement.gettransformpagepoint()})}stop(e,n){let r=this.isdragging;if(this.cancel(),!r)return;let{velocity:i}=n;this.startanimation(i);let{ondragend:a}=this.getprops();a&&a(e,n)}cancel(){this.isdragging=!1;let{projection:e,animationstate:n}=this.visualelement;e&&(e.isanimationblocked=!1),this.pansession&&this.pansession.end(),this.pansession=void 0;let{dragpropagation:r}=this.getprops();!r&&this.opengloballock&&(this.opengloballock(),this.opengloballock=null),n&&n.setactive("whiledrag",!1)}updateaxis(e,n,r){let{drag:i}=this.getprops();if(!r||!eq(e,i,this.currentdirection))return;let a=this.getaxismotionvalue(e),s=this.originpoint[e]+r[e];this.constraints&&this.constraints[e]&&(s=function(e,{min:n,max:r},i){return void 0!==n&&er&&(e=i?(0,ey.c)(r,e,i.max):math.min(e,r)),e}(s,this.constraints[e],this.elastic[e])),a.set(s)}resolveconstraints(){let{dragconstraints:e,dragelastic:n}=this.getprops(),{layout:r}=this.visualelement.projection||{},i=this.constraints;e&&(0,eg.i)(e)?this.constraints||(this.constraints=this.resolverefconstraints()):e&&r?this.constraints=function(e,{top:n,left:r,bottom:i,right:a}){return{x:ee(e.x,r,a),y:ee(e.y,n,i)}}(r.layoutbox,e):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:eb(e,"left","right"),y:eb(e,"top","bottom")}}(n),i!==this.constraints&&r&&this.constraints&&!this.hasmutatedconstraints&&el(e=>{this.getaxismotionvalue(e)&&(this.constraints[e]=function(e,n){let r={};return void 0!==n.min&&(r.min=n.min-e.min),void 0!==n.max&&(r.max=n.max-e.min),r}(r.layoutbox[e],this.constraints[e]))})}resolverefconstraints(){var e;let{dragconstraints:n,onmeasuredragconstraints:r}=this.getprops();if(!n||!(0,eg.i)(n))return!1;let i=n.current;(0,ea.k)(null!==i,"if `dragconstraints` is set as a react ref, that ref must be passed to another component's `ref` prop.");let{projection:a}=this.visualelement;if(!a||!a.layout)return!1;let s=function(e,n,r){let i=ex(e,r),{scroll:a}=n;return a&&(ez(i.x,a.offset.x),ez(i.y,a.offset.y)),i}(i,a.root,this.visualelement.gettransformpagepoint()),o={x:et((e=a.layout.layoutbox).x,s.x),y:et(e.y,s.y)};if(r){let e=r(function({x:e,y:n}){return{top:n.min,right:e.max,bottom:n.max,left:e.min}}(o));this.hasmutatedconstraints=!!e,e&&(o=ei(e))}return o}startanimation(e){let{drag:n,dragmomentum:r,dragelastic:i,dragtransition:a,dragsnaptoorigin:s,ondragtransitionend:o}=this.getprops(),l=this.constraints||{},u=el(o=>{if(!eq(o,n,this.currentdirection))return;let u=l&&l[o]||{};s&&(u={min:0,max:0});let c={type:"inertia",velocity:r?e[o]:0,bouncestiffness:i?200:1e6,bouncedamping:i?40:1e7,timeconstant:750,restdelta:1,restspeed:10,...a,...u};return this.startaxisvalueanimation(o,c)});return promise.all(u).then(o)}startaxisvalueanimation(e,n){let r=this.getaxismotionvalue(e);return r.start((0,ek.z)(e,r,0,n))}stopanimation(){el(e=>this.getaxismotionvalue(e).stop())}getaxismotionvalue(e){let n="_drag"+e.touppercase(),r=this.visualelement.getprops(),i=r[n];return i||this.visualelement.getvalue(e,(r.initial?r.initial[e]:void 0)||0)}snaptocursor(e){el(n=>{let{drag:r}=this.getprops();if(!eq(n,r,this.currentdirection))return;let{projection:i}=this.visualelement,a=this.getaxismotionvalue(n);if(i&&i.layout){let{min:r,max:s}=i.layout.layoutbox[n];a.set(e[n]-(0,ey.c)(r,s,.5))}})}scalepositionwithinconstraints(){if(!this.visualelement.current)return;let{drag:e,dragconstraints:n}=this.getprops(),{projection:r}=this.visualelement;if(!(0,eg.i)(n)||!r||!this.constraints)return;this.stopanimation();let i={x:0,y:0};el(e=>{let n=this.getaxismotionvalue(e);if(n){let r=n.get();i[e]=function(e,n){let r=.5,i=ex(e),a=ex(n);return a>i?r=(0,ev.y)(n.min,n.max-i,e.min):i>a&&(r=(0,ev.y)(e.min,e.max-a,n.min)),(0,ec.u)(0,1,r)}({min:r,max:r},this.constraints[e])}});let{transformtemplate:a}=this.visualelement.getprops();this.visualelement.current.style.transform=a?a({},""):"none",r.root&&r.root.updatescroll(),r.updatelayout(),this.resolveconstraints(),el(n=>{if(!eq(n,e,null))return;let r=this.getaxismotionvalue(n),{min:a,max:s}=this.constraints[n];r.set((0,ey.c)(a,s,i[n]))})}addlisteners(){if(!this.visualelement.current)return;ey.set(this.visualelement,this);let e=this.visualelement.current,n=(0,h.a)(e,"pointerdown",e=>{let{drag:n,draglistener:r=!0}=this.getprops();n&&r&&this.start(e)}),r=()=>{let{dragconstraints:e}=this.getprops();(0,eg.i)(e)&&(this.constraints=this.resolverefconstraints())},{projection:i}=this.visualelement,a=i.addeventlistener("measure",r);i&&!i.layout&&(i.root&&i.root.updatescroll(),i.updatelayout()),r();let s=(0,w.e)(window,"resize",()=>this.scalepositionwithinconstraints()),o=i.addeventlistener("didupdate",({delta:e,haslayoutchanged:n})=>{this.isdragging&&n&&(el(n=>{let r=this.getaxismotionvalue(n);r&&(this.originpoint[n]+=e[n].translate,r.set(r.get()+e[n].translate))}),this.visualelement.render())});return()=>{s(),n(),a(),o&&o()}}getprops(){let e=this.visualelement.getprops(),{drag:n=!1,dragdirectionlock:r=!1,dragpropagation:i=!1,dragconstraints:a=!1,dragelastic:s=.35,dragmomentum:o=!0}=e;return{...e,drag:n,dragdirectionlock:r,dragpropagation:i,dragconstraints:a,dragelastic:s,dragmomentum:o}}}function eq(e,n,r){return(!0===n||n===e)&&(null===r||r===e)}class ez extends z.l{constructor(e){super(e),this.removegroupcontrols=y.z,this.removelisteners=y.z,this.controls=new eq(e)}mount(){let{dragcontrols:e}=this.node.getprops();e&&(this.removegroupcontrols=e.subscribe(this.controls)),this.removelisteners=this.controls.addlisteners()||y.z}unmount(){this.removegroupcontrols(),this.removelisteners()}}class e$ extends z.l{constructor(){super(...arguments),this.removepointerdownlistener=y.z}onpointerdown(e){this.session=new eh(e,this.createpanhandlers(),{transformpagepoint:this.node.gettransformpagepoint()})}createpanhandlers(){let{onpansessionstart:e,onpanstart:n,onpan:r,onpanend:i}=this.node.getprops();return{onsessionstart:e,onstart:n,onmove:r,onend:(e,n)=>{delete this.session,i&&i(e,n)}}}mount(){this.removepointerdownlistener=(0,h.a)(this.node.current,"pointerdown",e=>this.onpointerdown(e))}update(){this.session&&this.session.updatehandlers(this.createpanhandlers())}unmount(){this.removepointerdownlistener(),this.session&&this.session.end()}}var e0=r(5947),e1=r(5364),e2=r(1705),e3=r(3083);function e4(e,n){return n.max===n.min?0:e/(n.max-n.min)*100}let e6={correct:(e,n)=>{if(!n.target)return e;if("string"==typeof e){if(!b.px.test(e))return e;e=parsefloat(e)}let r=e4(e,n.target.x),i=e4(e,n.target.y);return`${r}% ${i}%`}},e5=/var\((--[a-za-z0-9-_]+),? ?([a-za-z0-9 ()%#.,-]+)?\)/;function e9(e,n,r=1){(0,ea.k)(r<=4,`max css variable fallback depth detected in property "${e}". this may indicate a circular fallback dependency.`);let[i,a]=function(e){let n=e5.exec(e);if(!n)return[,];let[,r,i]=n;return[r,i]}(e);if(!i)return;let s=window.getcomputedstyle(n).getpropertyvalue(i);return s?s.trim():(0,f.t)(a)?e9(a,n,r+1):a}var e8=r(1550);let e7="_$css",te={correct:(e,{treescale:n,projectiondelta:r})=>{let i=e,a=e.includes("var("),s=[];a&&(e=e.replace(e5,e=>(s.push(e),e7)));let o=e8.p.parse(e);if(o.length>5)return i;let l=e8.p.createtransformer(e),u="number"!=typeof o[0]?1:0,c=r.x.scale*n.x,h=r.y.scale*n.y;o[0+u]/=c,o[1+u]/=h;let d=(0,ey.c)(c,h,.5);"number"==typeof o[2+u]&&(o[2+u]/=d),"number"==typeof o[3+u]&&(o[3+u]/=d);let p=l(o);if(a){let e=0;p=p.replace(e7,()=>{let n=s[e];return e++,n})}return p}};class tt extends o.component{componentdidmount(){let{visualelement:e,layoutgroup:n,switchlayoutgroup:r,layoutid:i}=this.props,{projection:a}=e;object.assign(l,tr),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didupdate(),a.addeventlistener("animationcomplete",()=>{this.safetoremove()}),a.setoptions({...a.options,onexitcomplete:()=>this.safetoremove()})),e3.v.haseverupdated=!0}getsnapshotbeforeupdate(e){let{layoutdependency:n,visualelement:r,drag:i,ispresent:a}=this.props,s=r.projection;return s&&(s.ispresent=a,i||e.layoutdependency!==n||void 0===n?s.willupdate():this.safetoremove(),e.ispresent===a||(a?s.promote():s.relegate()||es.z_.postrender(()=>{let e=s.getstack();e&&e.members.length||this.safetoremove()}))),null}componentdidupdate(){let{projection:e}=this.props.visualelement;e&&(e.root.didupdate(),!e.currentanimation&&e.islead()&&this.safetoremove())}componentwillunmount(){let{visualelement:e,layoutgroup:n,switchlayoutgroup:r}=this.props,{projection:i}=e;i&&(i.schedulecheckafterunmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safetoremove(){let{safetoremove:e}=this.props;e&&e()}render(){return null}}function tn(e){let[n,r]=(0,e0.oo)(),i=(0,o.usecontext)(e1.p);return o.createelement(tt,{...e,layoutgroup:i,switchlayoutgroup:(0,o.usecontext)(e2.g),ispresent:n,safetoremove:r})}let tr={borderradius:{...e6,applyto:["bordertopleftradius","bordertoprightradius","borderbottomleftradius","borderbottomrightradius"]},bordertopleftradius:e6,bordertoprightradius:e6,borderbottomleftradius:e6,borderbottomrightradius:e6,boxshadow:te};var ti=r(3234),ta=r(1560),ts=r(7255);let to=["topleft","topright","bottomleft","bottomright"],tl=to.length,tu=e=>"string"==typeof e?parsefloat(e):e,tc=e=>"number"==typeof e||b.px.test(e);function th(e,n){return void 0!==e[n]?e[n]:e.borderradius}let td=tf(0,.5,ts.bn),tp=tf(.5,.95,y.z);function tf(e,n,r){return i=>in?1:r((0,ev.y)(e,n,i))}function tm(e,n){e.min=n.min,e.max=n.max}function tg(e,n){tm(e.x,n.x),tm(e.y,n.y)}function tv(e,n,r,i,a){return e-=n,e=i+1/r*(e-i),void 0!==a&&(e=i+1/a*(e-i)),e}function ty(e,n,[r,i,a],s,o){!function(e,n=0,r=1,i=.5,a,s=e,o=e){if(b.aq.test(n)){n=parsefloat(n);let e=(0,ey.c)(o.min,o.max,n/100);n=e-o.min}if("number"!=typeof n)return;let l=(0,ey.c)(s.min,s.max,i);e===s&&(l-=n),e.min=tv(e.min,n,r,l,a),e.max=tv(e.max,n,r,l,a)}(e,n[r],n[i],n[a],n.scale,s,o)}let tx=["x","scalex","originx"],t_=["y","scaley","originy"];function ta(e,n,r,i){ty(e.x,n,tx,r?r.x:void 0,i?i.x:void 0),ty(e.y,n,t_,r?r.y:void 0,i?i.y:void 0)}var tb=r(1056);function tm(e){return 0===e.translate&&1===e.scale}function ts(e){return tm(e.x)&&tm(e.y)}function tw(e,n){return e.x.min===n.x.min&&e.x.max===n.x.max&&e.y.min===n.y.min&&e.y.max===n.y.max}function tc(e){return ex(e.x)/ex(e.y)}var te=r(10);class tt{constructor(){this.members=[]}add(e){(0,te.y4)(this.members,e),e.schedulerender()}remove(e){if((0,te.cl)(this.members,e),e===this.prevlead&&(this.prevlead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let n;let r=this.members.findindex(n=>e===n);if(0===r)return!1;for(let e=r;e>=0;e--){let r=this.members[e];if(!1!==r.ispresent){n=r;break}}return!!n&&(this.promote(n),!0)}promote(e,n){let r=this.lead;if(e!==r&&(this.prevlead=r,this.lead=e,e.show(),r)){r.instance&&r.schedulerender(),e.schedulerender(),e.resumefrom=r,n&&(e.resumefrom.preserveopacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestvalues=r.animationvalues||r.latestvalues),e.root&&e.root.isupdating&&(e.islayoutdirty=!0);let{crossfade:i}=e.options;!1===i&&r.hide()}}exitanimationcomplete(){this.members.foreach(e=>{let{options:n,resumingfrom:r}=e;n.onexitcomplete&&n.onexitcomplete(),r&&r.options.onexitcomplete&&r.options.onexitcomplete()})}schedulerender(){this.members.foreach(e=>{e.instance&&e.schedulerender(!1)})}removeleadsnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function tb(e,n,r){let i="",a=e.x.translate/n.x,s=e.y.translate/n.y;if((a||s)&&(i=`translate3d(${a}px, ${s}px, 0) `),(1!==n.x||1!==n.y)&&(i+=`scale(${1/n.x}, ${1/n.y}) `),r){let{rotate:e,rotatex:n,rotatey:a}=r;e&&(i+=`rotate(${e}deg) `),n&&(i+=`rotatex(${n}deg) `),a&&(i+=`rotatey(${a}deg) `)}let o=e.x.scale*n.x,l=e.y.scale*n.y;return(1!==o||1!==l)&&(i+=`scale(${o}, ${l})`),i||"none"}let tp=(e,n)=>e.depth-n.depth;class tr{constructor(){this.children=[],this.isdirty=!1}add(e){(0,te.y4)(this.children,e),this.isdirty=!0}remove(e){(0,te.cl)(this.children,e),this.isdirty=!0}foreach(e){this.isdirty&&this.children.sort(tp),this.isdirty=!1,this.children.foreach(e)}}var tl=r(6399),ti=r(3378);let td=["","x","y","z"],tf=0,to={type:"projectionframe",totalnodes:0,resolvedtargetdeltas:0,recalculatedprojection:0};function tn({attachresizelistener:e,defaultparent:n,measurescroll:r,checkisscrollroot:i,resettransform:a}){return class{constructor(e,r={},i=null==n?void 0:n()){this.id=tf++,this.animationid=0,this.children=new set,this.options={},this.istreeanimating=!1,this.isanimationblocked=!1,this.islayoutdirty=!1,this.isprojectiondirty=!1,this.issharedprojectiondirty=!1,this.istransformdirty=!1,this.updatemanuallyblocked=!1,this.updateblockedbyresize=!1,this.isupdating=!1,this.issvg=!1,this.needsreset=!1,this.shouldresettransform=!1,this.treescale={x:1,y:1},this.eventhandlers=new map,this.potentialnodes=new map,this.checkupdatefailed=()=>{this.isupdating&&(this.isupdating=!1,this.clearallsnapshots())},this.updateprojection=()=>{to.totalnodes=to.resolvedtargetdeltas=to.recalculatedprojection=0,this.nodes.foreach(tg),this.nodes.foreach(tj),this.nodes.foreach(tx),this.nodes.foreach(tu),window.motiondebug&&window.motiondebug.record(to)},this.hasprojected=!1,this.isvisible=!0,this.animationprogress=0,this.sharednodes=new map,this.elementid=e,this.latestvalues=r,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0,e&&this.root.registerpotentialnode(e,this);for(let e=0;ethis.root.updateblockedbyresize=!1;e(n,()=>{this.root.updateblockedbyresize=!0,r&&r(),r=(0,ti.g)(i,250),e3.v.hasanimatedsinceresize&&(e3.v.hasanimatedsinceresize=!1,this.nodes.foreach(tw))})}i&&this.root.registersharednode(i,this),!1!==this.options.animate&&s&&(i||a)&&this.addeventlistener("didupdate",({delta:e,haslayoutchanged:n,hasrelativetargetchanged:r,layout:i})=>{if(this.istreeanimationblocked()){this.target=void 0,this.relativetarget=void 0;return}let a=this.options.transition||s.getdefaulttransition()||t$,{onlayoutanimationstart:o,onlayoutanimationcomplete:l}=s.getprops(),u=!this.targetlayout||!tw(this.targetlayout,i)||r,c=!n&&r;if(this.options.layoutroot||this.resumefrom&&this.resumefrom.instance||c||n&&(u||!this.currentanimation)){this.resumefrom&&(this.resumingfrom=this.resumefrom,this.resumingfrom.resumingfrom=void 0),this.setanimationorigin(e,c);let n={...(0,tb.ev)(a,"layout"),onplay:o,oncomplete:l};(s.shouldreducemotion||this.options.layoutroot)&&(n.delay=0,n.type=!1),this.startanimation(n)}else n||0!==this.animationprogress||tw(this),this.islead()&&this.options.onexitcomplete&&this.options.onexitcomplete();this.targetlayout=i})}unmount(){this.options.layoutid&&this.willupdate(),this.root.nodes.remove(this);let e=this.getstack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,es.qy.prerender(this.updateprojection)}blockupdate(){this.updatemanuallyblocked=!0}unblockupdate(){this.updatemanuallyblocked=!1}isupdateblocked(){return this.updatemanuallyblocked||this.updateblockedbyresize}istreeanimationblocked(){return this.isanimationblocked||this.parent&&this.parent.istreeanimationblocked()||!1}startupdate(){!this.isupdateblocked()&&(this.isupdating=!0,this.nodes&&this.nodes.foreach(tk),this.animationid++)}gettransformtemplate(){let{visualelement:e}=this.options;return e&&e.getprops().transformtemplate}willupdate(e=!0){if(this.root.isupdateblocked()){this.options.onexitcomplete&&this.options.onexitcomplete();return}if(this.root.isupdating||this.root.startupdate(),this.islayoutdirty)return;this.islayoutdirty=!0;for(let e=0;e{this.islayoutdirty?this.root.didupdate():this.root.checkupdatefailed()})}updatesnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updatelayout(){if(!this.instance||(this.updatescroll(),!(this.options.alwaysmeasurelayout&&this.islead())&&!this.islayoutdirty))return;if(this.resumefrom&&!this.resumefrom.instance)for(let e=0;e{var i,u;let c=n/1e3;tq(o.x,e.x,c),tq(o.y,e.y,c),this.settargetdelta(o),this.relativetarget&&this.relativetargetorigin&&this.layout&&this.relativeparent&&this.relativeparent.layout&&(ew(l,this.layout.layoutbox,this.relativeparent.layout.layoutbox),i=this.relativetarget,u=this.relativetargetorigin,tq(i.x,u.x,l.x,c),tq(i.y,u.y,l.y,c),r&&tw(this.relativetarget,r)&&(this.isprojectiondirty=!1),r||(r=(0,er.do)()),tg(r,this.relativetarget)),h&&(this.animationvalues=s,function(e,n,r,i,a,s){a?(e.opacity=(0,ey.c)(0,void 0!==r.opacity?r.opacity:1,td(i)),e.opacityexit=(0,ey.c)(void 0!==n.opacity?n.opacity:1,0,tp(i))):s&&(e.opacity=(0,ey.c)(void 0!==n.opacity?n.opacity:1,void 0!==r.opacity?r.opacity:1,i));for(let a=0;a{e3.v.hasanimatedsinceresize=!0,this.currentanimation=function(e,n,r={}){let i=(0,h.i)(e)?e:(0,ti.b)(e);return i.start((0,ek.z)("",i,1e3,r)),{stop:()=>i.stop(),isanimating:()=>i.isanimating()}}(0,0,{...e,onupdate:n=>{this.mixtargetdelta(n),e.onupdate&&e.onupdate(n)},oncomplete:()=>{e.oncomplete&&e.oncomplete(),this.completeanimation()}}),this.resumingfrom&&(this.resumingfrom.currentanimation=this.currentanimation),this.pendinganimation=void 0})}completeanimation(){this.resumingfrom&&(this.resumingfrom.currentanimation=void 0,this.resumingfrom.preserveopacity=void 0);let e=this.getstack();e&&e.exitanimationcomplete(),this.resumingfrom=this.currentanimation=this.animationvalues=void 0,this.notifylisteners("animationcomplete")}finishanimation(){this.currentanimation&&(this.mixtargetdelta&&this.mixtargetdelta(1e3),this.currentanimation.stop()),this.completeanimation()}applytransformstotarget(){let e=this.getlead(),{targetwithtransforms:n,target:r,layout:i,latestvalues:a}=e;if(n&&r&&i){if(this!==e&&this.layout&&i&&t2(this.options.animationtype,this.layout.layoutbox,i.layoutbox)){r=this.target||(0,er.do)();let n=ex(this.layout.layoutbox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+n;let i=ex(this.layout.layoutbox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+i}tg(n,r),ej(n,a),eb(this.projectiondeltawithtransform,this.layoutcorrected,n,a)}}registersharednode(e,n){this.sharednodes.has(e)||this.sharednodes.set(e,new tt);let r=this.sharednodes.get(e);r.add(n);let i=n.options.initialpromotionconfig;n.promote({transition:i?i.transition:void 0,preservefollowopacity:i&&i.shouldpreservefollowopacity?i.shouldpreservefollowopacity(n):void 0})}islead(){let e=this.getstack();return!e||e.lead===this}getlead(){var e;let{layoutid:n}=this.options;return n&&(null===(e=this.getstack())||void 0===e?void 0:e.lead)||this}getprevlead(){var e;let{layoutid:n}=this.options;return n?null===(e=this.getstack())||void 0===e?void 0:e.prevlead:void 0}getstack(){let{layoutid:e}=this.options;if(e)return this.root.sharednodes.get(e)}promote({needsreset:e,transition:n,preservefollowopacity:r}={}){let i=this.getstack();i&&i.promote(this,r),e&&(this.projectiondelta=void 0,this.needsreset=!0),n&&this.setoptions({transition:n})}relegate(){let e=this.getstack();return!!e&&e.relegate(this)}resetrotation(){let{visualelement:e}=this.options;if(!e)return;let n=!1,{latestvalues:r}=e;if((r.rotate||r.rotatex||r.rotatey||r.rotatez)&&(n=!0),!n)return;let i={};for(let n=0;n{var n;return null===(n=e.currentanimation)||void 0===n?void 0:n.stop()}),this.root.nodes.foreach(tv),this.root.sharednodes.clear()}}}function tk(e){e.updatelayout()}function th(e){var n;let r=(null===(n=e.resumefrom)||void 0===n?void 0:n.snapshot)||e.snapshot;if(e.islead()&&e.layout&&r&&e.haslisteners("didupdate")){let{layoutbox:n,measuredbox:i}=e.layout,{animationtype:a}=e.options,s=r.source!==e.layout.source;"size"===a?el(e=>{let i=s?r.measuredbox[e]:r.layoutbox[e],a=ex(i);i.min=n[e].min,i.max=i.min+a}):t2(a,r.layoutbox,n)&&el(e=>{let i=s?r.measuredbox[e]:r.layoutbox[e],a=ex(n[e]);i.max=i.min+a});let o=(0,er.wc)();eb(o,n,r.layoutbox);let l=(0,er.wc)();s?eb(l,e.applytransform(i,!0),r.measuredbox):eb(l,n,r.layoutbox);let u=!ts(o),c=!1;if(!e.resumefrom){let i=e.getclosestprojectingparent();if(i&&!i.resumefrom){let{snapshot:a,layout:s}=i;if(a&&s){let o=(0,er.do)();ew(o,r.layoutbox,a.layoutbox);let l=(0,er.do)();ew(l,n,s.layoutbox),tw(o,l)||(c=!0),i.options.layoutroot&&(e.relativetarget=l,e.relativetargetorigin=o,e.relativeparent=i)}}}e.notifylisteners("didupdate",{layout:n,snapshot:r,delta:l,layoutdelta:o,haslayoutchanged:u,hasrelativetargetchanged:c})}else if(e.islead()){let{onexitcomplete:n}=e.options;n&&n()}e.options.transition=void 0}function tg(e){to.totalnodes++,e.parent&&(e.isprojecting()||(e.isprojectiondirty=e.parent.isprojectiondirty),e.issharedprojectiondirty||(e.issharedprojectiondirty=boolean(e.isprojectiondirty||e.parent.isprojectiondirty||e.parent.issharedprojectiondirty)),e.istransformdirty||(e.istransformdirty=e.parent.istransformdirty))}function tu(e){e.isprojectiondirty=e.issharedprojectiondirty=e.istransformdirty=!1}function tz(e){e.clearsnapshot()}function tv(e){e.clearmeasurements()}function tj(e){let{visualelement:n}=e.options;n&&n.getprops().onbeforelayoutmeasure&&n.notify("beforelayoutmeasure"),e.resettransform()}function tw(e){e.finishanimation(),e.targetdelta=e.relativetarget=e.target=void 0}function tj(e){e.resolvetargetdelta()}function tx(e){e.calcprojection()}function tk(e){e.resetrotation()}function ty(e){e.removeleadsnapshot()}function tq(e,n,r){e.translate=(0,ey.c)(n.translate,0,r),e.scale=(0,ey.c)(n.scale,1,r),e.origin=n.origin,e.originpoint=n.originpoint}function tq(e,n,r,i){e.min=(0,ey.c)(n.min,r.min,i),e.max=(0,ey.c)(n.max,r.max,i)}function tz(e){return e.animationvalues&&void 0!==e.animationvalues.opacityexit}let t$={duration:.45,ease:[.4,0,.1,1]};function t0(e,n){let r=e.root;for(let n=e.path.length-1;n>=0;n--)if(boolean(e.path[n].instance)){r=e.path[n];break}let i=r&&r!==e.root?r.instance:document,a=i.queryselector(`[data-projection-id="${n}"]`);a&&e.mount(a,!0)}function t1(e){e.min=math.round(e.min),e.max=math.round(e.max)}function t2(e,n,r){return"position"===e||"preserve-aspect"===e&&!e_(tc(n),tc(r),.2)}let t3=tn({attachresizelistener:(e,n)=>(0,w.e)(e,"resize",n),measurescroll:()=>({x:document.documentelement.scrollleft||document.body.scrollleft,y:document.documentelement.scrolltop||document.body.scrolltop}),checkisscrollroot:()=>!0}),t4={current:void 0},t6=tn({measurescroll:e=>({x:e.scrollleft,y:e.scrolltop}),defaultparent:()=>{if(!t4.current){let e=new t3(0,{});e.mount(window),e.setoptions({layoutscroll:!0}),t4.current=e}return t4.current},resettransform:(e,n)=>{e.style.transform=void 0!==n?n:"none"},checkisscrollroot:e=>boolean("fixed"===window.getcomputedstyle(e).position)});var t5=r(2728),t9=r(5759),t8=r(8488),t7=r(6440),ne=r(1741),nt=r(1649);let nn=new set(["width","height","top","left","right","bottom","x","y"]),nr=e=>nn.has(e),ni=e=>object.keys(e).some(nr),na=e=>e===nt.rx||e===b.px,ns=(e,n)=>parsefloat(e.split(", ")[n]),no=(e,n)=>(r,{transform:i})=>{if("none"===i||!i)return 0;let a=i.match(/^matrix3d\((.+)\)$/);if(a)return ns(a[1],n);{let n=i.match(/^matrix\((.+)\)$/);return n?ns(n[1],e):0}},nl=new set(["x","y","z"]),nu=u._.filter(e=>!nl.has(e)),nc={width:({x:e},{paddingleft:n="0",paddingright:r="0"})=>e.max-e.min-parsefloat(n)-parsefloat(r),height:({y:e},{paddingtop:n="0",paddingbottom:r="0"})=>e.max-e.min-parsefloat(n)-parsefloat(r),top:(e,{top:n})=>parsefloat(n),left:(e,{left:n})=>parsefloat(n),bottom:({y:e},{top:n})=>parsefloat(n)+(e.max-e.min),right:({x:e},{left:n})=>parsefloat(n)+(e.max-e.min),x:no(4,13),y:no(5,14)},nh=(e,n,r)=>{let i=n.measureviewportbox(),a=n.current,s=getcomputedstyle(a),{display:o}=s,l={};"none"===o&&n.setstaticvalue("display",e.display||"block"),r.foreach(e=>{l[e]=nc[e](i,s)}),n.render();let u=n.measureviewportbox();return r.foreach(r=>{let i=n.getvalue(r);i&&i.jump(l[r]),e[r]=nc[r](u,s)}),e},nd=(e,n,r={},i={})=>{n={...n},i={...i};let a=object.keys(n).filter(nr),s=[],o=!1,l=[];if(a.foreach(a=>{let u;let c=e.getvalue(a);if(!e.hasvalue(a))return;let h=r[a],d=(0,t7.c)(h),p=n[a];if((0,t8.c)(p)){let e=p.length,n=null===p[0]?1:0;h=p[n],d=(0,t7.c)(h);for(let r=n;r{let i=e.getvalue(r);void 0!==i&&(n.push([r,i.get()]),i.set(r.startswith("scale")?1:0))}),n.length&&e.render(),n}(e),o=!0),l.push(a),i[a]=void 0!==i[a]?i[a]:n[a],c.jump(p))}}),!l.length)return{target:n,transitionend:i};{let r=l.indexof("height")>=0?window.pageyoffset:null,a=nh(n,e,l);return s.length&&s.foreach(([n,r])=>{e.getvalue(n).set(r)}),e.render(),ne.j&&null!==r&&window.scrollto({top:r}),{target:a,transitionend:i}}},np=(e,n,r,i)=>{var a,s;let o=function(e,{...n},r){let i=e.current;if(!(i instanceof element))return{target:n,transitionend:r};for(let a in r&&(r={...r}),e.values.foreach(e=>{let n=e.get();if(!(0,f.t)(n))return;let r=e9(n,i);r&&e.set(r)}),n){let e=n[a];if(!(0,f.t)(e))continue;let s=e9(e,i);s&&(n[a]=s,r&&void 0===r[a]&&(r[a]=e))}return{target:n,transitionend:r}}(e,n,i);return n=o.target,i=o.transitionend,a=n,s=i,ni(a)?nd(e,a,r,s):{target:a,transitionend:s}};var nf=r(1303);class nm extends nf.l{sortinstancenodeposition(e,n){return 2&e.comparedocumentposition(n)?1:-1}getbasetargetfromprops(e,n){return e.style?e.style[n]:void 0}removevaluefromrenderstate(e,{vars:n,style:r}){delete n[e],delete r[e]}maketargetanimatablefrominstance({transition:e,transitionend:n,...r},{transformvalues:i},a){let s=(0,t9.p$)(r,e||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),s&&(s=i(s))),a){(0,t9.gj)(this,r,s);let e=np(this,r,s,n);n=e.transitionend,r=e.target}return{transition:e,transitionend:n,...r}}}class ng extends nm{readvaluefrominstance(e,n){if(u.g.has(n)){let e=(0,t5.a)(n);return e&&e.default||0}{let r=window.getcomputedstyle(e),i=((0,f.f)(n)?r.getpropertyvalue(n):r[n])||0;return"string"==typeof i?i.trim():i}}measureinstanceviewportbox(e,{transformpagepoint:n}){return ex(e,n)}build(e,n,r,i){v(e,n,r,i.transformtemplate)}scrapemotionvaluesfromprops(e,n){return d(e,n)}handlechildmotionvalue(){this.childsubscription&&(this.childsubscription(),delete this.childsubscription);let{children:e}=this.props;(0,h.i)(e)&&(this.childsubscription=e.on("change",e=>{this.current&&(this.current.textcontent=`${e}`)}))}renderinstance(e,n,r,i){r(e,n,r,i)}}class nv extends nm{constructor(){super(...arguments),this.issvgtag=!1}getbasetargetfromprops(e,n){return e[n]}readvaluefrominstance(e,n){if(u.g.has(n)){let e=(0,t5.a)(n);return e&&e.default||0}return n=l.has(n)?n:(0,p.d)(n),e.getattribute(n)}measureinstanceviewportbox(){return(0,er.do)()}scrapemotionvaluesfromprops(e,n){return f(e,n)}build(e,n,r,i){c(e,n,r,this.issvgtag,i.transformtemplate)}renderinstance(e,n,r,i){i(e,n,r,i)}mount(e){this.issvgtag=t(e.tagname),super.mount(e)}}let ny=(e,n)=>s(e)?new nv(n,{enablehardwareacceleration:!1}):new ng(n,{enablehardwareacceleration:!0}),nx={...ei.s,inview:{feature:er},tap:{feature:q},focus:{feature:j},hover:{feature:j},pan:{feature:e$},drag:{feature:ez,projectionnode:t6,measurelayout:tn},layout:{projectionnode:t6,measurelayout:tn}},n_=function(e){function n(n,r={}){return(0,i.f)(e(n,r))}if("undefined"==typeof proxy)return n;let r=new map;return new proxy(n,{get:(e,i)=>(r.has(i)||r.set(i,n(i)),r.get(i))})}((e,n)=>(function(e,{forwardmotionprops:n=!1},r,i){let a=s(e)?n:k;return{...a,preloadedfeatures:r,userender:function(e=!1){let n=(n,r,i,a,{latestvalues:l},u)=>{let c=s(n)?b:_,d=c(r,l,u,n),p=(0,a.l)(r,"string"==typeof n,e),f={...p,...d,ref:a},{children:m}=r,g=(0,o.usememo)(()=>(0,h.i)(m)?m.get():m,[m]);return i&&(f["data-projection-id"]=i),(0,o.createelement)(n,{...f,children:g})};return n}(n),createvisualelement:i,component:e}})(e,n,nx,ny))},3193:function(e,n,r){"use strict";r.d(n,{d:function(){return i}});let i=e=>e.replace(/([a-z])([a-z])/g,"$1-$2").tolowercase()},1492:function(e,n,r){"use strict";r.d(n,{l:function(){return l},k:function(){return o}});let i=new set(["animate","exit","variants","initial","style","values","variants","transition","transformtemplate","transformvalues","custom","inherit","onlayoutanimationstart","onlayoutanimationcomplete","onlayoutmeasure","onbeforelayoutmeasure","onanimationstart","onanimationcomplete","onupdate","ondragstart","ondrag","ondragend","onmeasuredragconstraints","ondirectionlock","ondragtransitionend","_dragx","_dragy","onhoverstart","onhoverend","onviewportenter","onviewportleave","ignorestrict","viewport"]);function a(e){return e.startswith("while")||e.startswith("drag")&&"draggable"!==e||e.startswith("layout")||e.startswith("ontap")||e.startswith("onpan")||i.has(e)}let s=e=>!a(e);function o(e){e&&(s=n=>n.startswith("on")?!a(n):e(n))}try{o(require("@emotion/is-prop-valid").default)}catch(e){}function l(e,n,r){let i={};for(let o in e)("values"!==o||"object"!=typeof e.values)&&(s(o)||!0===r&&a(o)||!n&&!a(o)||e.draggable&&o.startswith("ondrag"))&&(i[o]=e[o]);return i}},7630:function(e,n,r){"use strict";r.d(n,{f:function(){return a},t:function(){return s}});let i=e=>n=>"string"==typeof n&&n.startswith(e),a=i("--"),s=i("var(--")},7301:function(e,n,r){"use strict";function i(e,n){var r;return"string"==typeof e?n?(null!==(r=n[e])&&void 0!==r||(n[e]=document.queryselectorall(e)),e=n[e]):e=document.queryselectorall(e):e instanceof element&&(e=[e]),array.from(e||[])}r.d(n,{i:function(){return i}})},9135:function(e,n,r){"use strict";r.d(n,{t:function(){return o}});var i=r(1550),a=r(7197),s=r(2728);function o(e,n){let r=(0,s.a)(e);return r!==a.h&&(r=i.p),r.getanimatablenone?r.getanimatablenone(n):void 0}},2728:function(e,n,r){"use strict";r.d(n,{a:function(){return l}});var i=r(5385),a=r(7197),s=r(6173);let o={...s.j,color:i.$,backgroundcolor:i.$,outlinecolor:i.$,fill:i.$,stroke:i.$,bordercolor:i.$,bordertopcolor:i.$,borderrightcolor:i.$,borderbottomcolor:i.$,borderleftcolor:i.$,filter:a.h,webkitfilter:a.h},l=e=>o[e]},6440:function(e,n,r){"use strict";r.d(n,{$:function(){return o},c:function(){return l}});var i=r(1649),a=r(6190),s=r(8340);let o=[i.rx,a.px,a.aq,a.rw,a.vw,a.vh,{test:e=>"auto"===e,parse:e=>e}],l=e=>o.find((0,s.l)(e))},6173:function(e,n,r){"use strict";r.d(n,{j:function(){return o}});var i=r(1649),a=r(6190);let s={...i.rx,transform:math.round},o={borderwidth:a.px,bordertopwidth:a.px,borderrightwidth:a.px,borderbottomwidth:a.px,borderleftwidth:a.px,borderradius:a.px,radius:a.px,bordertopleftradius:a.px,bordertoprightradius:a.px,borderbottomrightradius:a.px,borderbottomleftradius:a.px,width:a.px,maxwidth:a.px,height:a.px,maxheight:a.px,size:a.px,top:a.px,right:a.px,bottom:a.px,left:a.px,padding:a.px,paddingtop:a.px,paddingright:a.px,paddingbottom:a.px,paddingleft:a.px,margin:a.px,margintop:a.px,marginright:a.px,marginbottom:a.px,marginleft:a.px,rotate:a.rw,rotatex:a.rw,rotatey:a.rw,rotatez:a.rw,scale:i.ba,scalex:i.ba,scaley:i.ba,scalez:i.ba,skew:a.rw,skewx:a.rw,skewy:a.rw,distance:a.px,translatex:a.px,translatey:a.px,translatez:a.px,x:a.px,y:a.px,z:a.px,perspective:a.px,transformperspective:a.px,opacity:i.fq,originx:a.$c,originy:a.$c,originz:a.px,zindex:s,fillopacity:i.fq,strokeopacity:i.fq,numoctaves:s}},8340:function(e,n,r){"use strict";r.d(n,{l:function(){return i}});let i=e=>n=>n.test(e)},4714:function(e,n,r){"use strict";r.d(n,{g:function(){return a},_:function(){return i}});let i=["transformperspective","x","y","z","translatex","translatey","translatez","scale","scalex","scaley","rotate","rotatex","rotatey","rotatez","skew","skewx","skewy"],a=new set(i)},7504:function(e,n,r){"use strict";r.d(n,{g:function(){return o},m:function(){return l}});var i=r(2445),a=r(7732),s=r(2963);function o(e){return(0,i.h)(e.animate)||s.v.some(n=>(0,a.$)(e[n]))}function l(e){return boolean(o(e)||e.variants)}},7732:function(e,n,r){"use strict";function i(e){return"string"==typeof e||array.isarray(e)}r.d(n,{$:function(){return i}})},2248:function(e,n,r){"use strict";r.d(n,{x:function(){return a}});var i=r(9432);function a(e,n,r){let a=e.getprops();return(0,i.o)(a,n,void 0!==r?r:a.custom,function(e){let n={};return e.values.foreach((e,r)=>n[r]=e.get()),n}(e),function(e){let n={};return e.values.foreach((e,r)=>n[r]=e.getvelocity()),n}(e))}},9432:function(e,n,r){"use strict";function i(e,n,r,i={},a={}){return"function"==typeof n&&(n=n(void 0!==r?r:e.custom,i,a)),"string"==typeof n&&(n=e.variants&&e.variants[n]),"function"==typeof n&&(n=n(void 0!==r?r:e.custom,i,a)),n}r.d(n,{o:function(){return i}})},5759:function(e,n,r){"use strict";r.d(n,{gj:function(){return v},p$:function(){return y},cd:function(){return g}});let i=e=>/^\-?\d*\.?\d+$/.test(e),a=e=>/^0[^.\s]+$/.test(e);var s=r(8715),o=r(3234),l=r(1550),u=r(9135),c=r(5385),h=r(6440),d=r(8340);let p=[...h.$,c.$,l.p],f=e=>p.find((0,d.l)(e));var m=r(2248);function g(e,n){let r=(0,m.x)(e,n),{transitionend:i={},transition:a={},...l}=r?e.maketargetanimatable(r,!1):{};for(let n in l={...l,...i}){var u;let r=(0,s.y)(l[n]);u=n,e.hasvalue(u)?e.getvalue(u).set(r):e.addvalue(u,(0,o.b)(r))}}function v(e,n,r){var s,c;let h=object.keys(n).filter(n=>!e.hasvalue(n)),d=h.length;if(d)for(let p=0;p-1&&e.splice(r,1)}r.d(n,{cl:function(){return a},y4:function(){return i}})},4169:function(e,n,r){"use strict";r.d(n,{u:function(){return i}});let i=(e,n,r)=>math.min(math.max(r,e),n)},3378:function(e,n,r){"use strict";r.d(n,{g:function(){return a}});var i=r(404);function a(e,n){let r=performance.now(),a=({timestamp:s})=>{let o=s-r;o>=n&&(i.qy.read(a),e(o-n))};return i.z_.read(a,!0),()=>i.qy.read(a)}},5487:function(e,n,r){"use strict";r.d(n,{k:function(){return a},k:function(){return s}});var i=r(1662);let a=i.z,s=i.z},4606:function(e,n,r){"use strict";r.d(n,{s:function(){return w}});var i=r(5487),a=r(5385),s=r(4169),o=r(22);function l(e,n,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(n-e)*6*r:r<.5?n:r<2/3?e+(n-e)*(2/3-r)*6:e}var u=r(6382),c=r(819),h=r(3184);let d=(e,n,r)=>{let i=e*e;return math.sqrt(math.max(0,r*(n*n-i)+i))},p=[u.$,c.m,h.j],f=e=>p.find(n=>n.test(e));function m(e){let n=f(e);(0,i.k)(boolean(n),`'${e}' is not an animatable color. use the equivalent color code instead.`);let r=n.parse(e);return n===h.j&&(r=function({hue:e,saturation:n,lightness:r,alpha:i}){e/=360,r/=100;let a=0,s=0,o=0;if(n/=100){let i=r<.5?r*(1+n):r+n-r*n,u=2*r-i;a=l(u,i,e+1/3),s=l(u,i,e),o=l(u,i,e-1/3)}else a=s=o=r;return{red:math.round(255*a),green:math.round(255*s),blue:math.round(255*o),alpha:i}}(r)),r}let g=(e,n)=>{let r=m(e),i=m(n),a={...r};return e=>(a.red=d(r.red,i.red,e),a.green=d(r.green,i.green,e),a.blue=d(r.blue,i.blue,e),a.alpha=(0,o.c)(r.alpha,i.alpha,e),c.m.transform(a))};var v=r(3624),y=r(1550);function x(e,n){return"number"==typeof e?r=>(0,o.c)(e,n,r):a.$.test(e)?g(e,n):b(e,n)}let _=(e,n)=>{let r=[...e],i=r.length,a=e.map((e,r)=>x(e,n[r]));return e=>{for(let n=0;n{let r={...e,...n},i={};for(let a in r)void 0!==e[a]&&void 0!==n[a]&&(i[a]=x(e[a],n[a]));return e=>{for(let n in i)r[n]=i[n](e);return r}},b=(e,n)=>{let r=y.p.createtransformer(n),a=(0,y.v)(e),s=(0,y.v)(n),o=a.numcolors===s.numcolors&&a.numnumbers>=s.numnumbers;return o?(0,v.z)(_(a.values,s.values),r):((0,i.k)(!0,`complex values '${e}' and '${n}' too different to mix. ensure all colors are of the same type, and that each contains the same quantity of number and color values. falling back to instant transition.`),r=>`${r>0?n:e}`)};var m=r(3967);let s=(e,n)=>r=>(0,o.c)(e,n,r);function w(e,n,{clamp:r=!0,ease:o,mixer:l}={}){let u=e.length;(0,i.k)(u===n.length,"both input and output ranges must be the same length"),(0,i.k)(!o||!array.isarray(o)||o.length===u-1,"array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),e[0]>e[u-1]&&(e=[...e].reverse(),n=[...n].reverse());let c=function(e,n,r){let i=[],s=r||function(e){if("number"==typeof e);else if("string"==typeof e)return a.$.test(e)?g:b;else if(array.isarray(e))return _;else if("object"==typeof e)return a;return s}(e[0]),o=e.length-1;for(let r=0;r{let r=0;if(h>1)for(;rd((0,s.u)(e[0],e[u-1],n)):d}},1741:function(e,n,r){"use strict";r.d(n,{j:function(){return i}});let i="undefined"!=typeof document},1804:function(e,n,r){"use strict";function i(e){return"object"==typeof e&&object.prototype.hasownproperty.call(e,"current")}r.d(n,{i:function(){return i}})},22:function(e,n,r){"use strict";r.d(n,{c:function(){return i}});let i=(e,n,r)=>-r*e+r*n+e},1662:function(e,n,r){"use strict";r.d(n,{z:function(){return i}});let i=e=>e},533:function(e,n,r){"use strict";r.d(n,{y:function(){return s}});var i=r(22),a=r(3967);function s(e){let n=[0];return!function(e,n){let r=e[e.length-1];for(let s=1;s<=n;s++){let o=(0,a.y)(0,n,s);e.push((0,i.c)(r,1,o))}}(n,e.length-1),n}},3624:function(e,n,r){"use strict";r.d(n,{z:function(){return a}});let i=(e,n)=>r=>n(e(r)),a=(...e)=>e.reduce(i)},3967:function(e,n,r){"use strict";r.d(n,{y:function(){return i}});let i=(e,n,r)=>{let i=n-e;return 0===i?1:(r-e)/i}},8715:function(e,n,r){"use strict";r.d(n,{y:function(){return s},p:function(){return a}});var i=r(8488);let a=e=>boolean(e&&"object"==typeof e&&e.mix&&e.tovalue),s=e=>(0,i.c)(e)?e[e.length-1]||0:e},1560:function(e,n,r){"use strict";r.d(n,{l:function(){return a}});var i=r(10);class a{constructor(){this.subscriptions=[]}add(e){return(0,i.y4)(this.subscriptions,e),()=>(0,i.cl)(this.subscriptions,e)}notify(e,n,r){let i=this.subscriptions.length;if(i){if(1===i)this.subscriptions[0](e,n,r);else for(let a=0;a1e3*e},6681:function(e,n,r){"use strict";r.d(n,{h:function(){return a}});var i=r(7294);function a(e){let n=(0,i.useref)(null);return null===n.current&&(n.current=e()),n.current}},8868:function(e,n,r){"use strict";r.d(n,{l:function(){return s}});var i=r(7294),a=r(1741);let s=a.j?i.uselayouteffect:i.useeffect},3038:function(e,n,r){"use strict";function i(e,n){return n?e*(1e3/n):0}r.d(n,{r:function(){return i}})},3234:function(e,n,r){"use strict";r.d(n,{b:function(){return c},h:function(){return u}});var i=r(7367),a=r(404),s=r(1560),o=r(3038);let l=e=>!isnan(parsefloat(e));class u{constructor(e,n={}){this.version="9.1.7",this.timedelta=0,this.lastupdated=0,this.cantrackvelocity=!1,this.events={},this.updateandnotify=(e,n=!0)=>{this.prev=this.current,this.current=e;let{delta:r,timestamp:s}=i.w;this.lastupdated!==s&&(this.timedelta=r,this.lastupdated=s,a.z_.postrender(this.schedulevelocitycheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocitychange&&this.events.velocitychange.notify(this.getvelocity()),n&&this.events.renderrequest&&this.events.renderrequest.notify(this.current)},this.schedulevelocitycheck=()=>a.z_.postrender(this.velocitycheck),this.velocitycheck=({timestamp:e})=>{e!==this.lastupdated&&(this.prev=this.current,this.events.velocitychange&&this.events.velocitychange.notify(this.getvelocity()))},this.hasanimated=!1,this.prev=this.current=e,this.cantrackvelocity=l(this.current),this.owner=n.owner}onchange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new s.l);let r=this.events[e].add(n);return"change"===e?()=>{r(),a.z_.read(()=>{this.events.change.getsize()||this.stop()})}:r}clearlisteners(){for(let e in this.events)this.events[e].clear()}attach(e,n){this.passiveeffect=e,this.stoppassiveeffect=n}set(e,n=!0){n&&this.passiveeffect?this.passiveeffect(e,this.updateandnotify):this.updateandnotify(e,n)}setwithvelocity(e,n,r){this.set(n),this.prev=e,this.timedelta=r}jump(e){this.updateandnotify(e),this.prev=e,this.stop(),this.stoppassiveeffect&&this.stoppassiveeffect()}get(){return this.current}getprevious(){return this.prev}getvelocity(){return this.cantrackvelocity?(0,o.r)(parsefloat(this.current)-parsefloat(this.prev),this.timedelta):0}start(e){return this.stop(),new promise(n=>{this.hasanimated=!0,this.animation=e(n)||null,this.events.animationstart&&this.events.animationstart.notify()}).then(()=>{this.events.animationcomplete&&this.events.animationcomplete.notify(),this.clearanimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationcancel&&this.events.animationcancel.notify()),this.clearanimation()}isanimating(){return!!this.animation}clearanimation(){this.animation=null}destroy(){this.clearlisteners(),this.stop(),this.stoppassiveeffect&&this.stoppassiveeffect()}}function c(e,n){return new u(e,n)}},6382:function(e,n,r){"use strict";r.d(n,{$:function(){return s}});var i=r(819),a=r(8834);let s={test:(0,a.i)("#"),parse:function(e){let n="",r="",i="",a="";return e.length>5?(n=e.substring(1,3),r=e.substring(3,5),i=e.substring(5,7),a=e.substring(7,9)):(n=e.substring(1,2),r=e.substring(2,3),i=e.substring(3,4),a=e.substring(4,5),n+=n,r+=r,i+=i,a+=a),{red:parseint(n,16),green:parseint(r,16),blue:parseint(i,16),alpha:a?parseint(a,16)/255:1}},transform:i.m.transform}},3184:function(e,n,r){"use strict";r.d(n,{j:function(){return l}});var i=r(1649),a=r(6190),s=r(6430),o=r(8834);let l={test:(0,o.i)("hsl","hue"),parse:(0,o.d)("hue","saturation","lightness"),transform:({hue:e,saturation:n,lightness:r,alpha:o=1})=>"hsla("+math.round(e)+", "+a.aq.transform((0,s.nw)(n))+", "+a.aq.transform((0,s.nw)(r))+", "+(0,s.nw)(i.fq.transform(o))+")"}},5385:function(e,n,r){"use strict";r.d(n,{$:function(){return l}});var i=r(6430),a=r(6382),s=r(3184),o=r(819);let l={test:e=>o.m.test(e)||a.$.test(e)||s.j.test(e),parse:e=>o.m.test(e)?o.m.parse(e):s.j.test(e)?s.j.parse(e):a.$.parse(e),transform:e=>(0,i.hd)(e)?e:e.hasownproperty("red")?o.m.transform(e):s.j.transform(e)}},819:function(e,n,r){"use strict";r.d(n,{m:function(){return c}});var i=r(4169),a=r(1649),s=r(6430),o=r(8834);let l=e=>(0,i.u)(0,255,e),u={...a.rx,transform:e=>math.round(l(e))},c={test:(0,o.i)("rgb","red"),parse:(0,o.d)("red","green","blue"),transform:({red:e,green:n,blue:r,alpha:i=1})=>"rgba("+u.transform(e)+", "+u.transform(n)+", "+u.transform(r)+", "+(0,s.nw)(a.fq.transform(i))+")"}},8834:function(e,n,r){"use strict";r.d(n,{d:function(){return s},i:function(){return a}});var i=r(6430);let a=(e,n)=>r=>boolean((0,i.hd)(r)&&i.mj.test(r)&&r.startswith(e)||n&&object.prototype.hasownproperty.call(r,n)),s=(e,n,r)=>a=>{if(!(0,i.hd)(a))return a;let[s,o,l,u]=a.match(i.kp);return{[e]:parsefloat(s),[n]:parsefloat(o),[r]:parsefloat(l),alpha:void 0!==u?parsefloat(u):1}}},7197:function(e,n,r){"use strict";r.d(n,{h:function(){return u}});var i=r(1550),a=r(6430);let s=new set(["brightness","contrast","saturate","opacity"]);function o(e){let[n,r]=e.slice(0,-1).split("(");if("drop-shadow"===n)return e;let[i]=r.match(a.kp)||[];if(!i)return e;let o=r.replace(i,""),l=s.has(n)?1:0;return i!==r&&(l*=100),n+"("+l+o+")"}let l=/([a-z-]*)\(.*?\)/g,u={...i.p,getanimatablenone:e=>{let n=e.match(l);return n?n.map(o).join(" "):e}}},1550:function(e,n,r){"use strict";r.d(n,{p:function(){return p},v:function(){return u}});var i=r(5385),a=r(1649),s=r(6430);let o="${c}",l="${n}";function u(e){"number"==typeof e&&(e=`${e}`);let n=[],r=0,u=0,c=e.match(s.da);c&&(r=c.length,e=e.replace(s.da,o),n.push(...c.map(i.$.parse)));let h=e.match(s.kp);return h&&(u=h.length,e=e.replace(s.kp,l),n.push(...h.map(a.rx.parse))),{values:n,numcolors:r,numnumbers:u,tokenised:e}}function c(e){return u(e).values}function h(e){let{values:n,numcolors:r,tokenised:a}=u(e),c=n.length;return e=>{let n=a;for(let a=0;a"number"==typeof e?0:e,p={test:function(e){var n,r;return isnan(e)&&(0,s.hd)(e)&&((null===(n=e.match(s.kp))||void 0===n?void 0:n.length)||0)+((null===(r=e.match(s.da))||void 0===r?void 0:r.length)||0)>0},parse:c,createtransformer:h,getanimatablenone:function(e){let n=c(e),r=h(e);return r(n.map(d))}}},1649:function(e,n,r){"use strict";r.d(n,{fq:function(){return s},rx:function(){return a},ba:function(){return o}});var i=r(4169);let a={test:e=>"number"==typeof e,parse:parsefloat,transform:e=>e},s={...a,transform:e=>(0,i.u)(0,1,e)},o={...a,default:1}},6190:function(e,n,r){"use strict";r.d(n,{$c:function(){return h},rw:function(){return s},aq:function(){return o},px:function(){return l},vh:function(){return u},vw:function(){return c}});var i=r(6430);let a=e=>({test:n=>(0,i.hd)(n)&&n.endswith(e)&&1===n.split(" ").length,parse:parsefloat,transform:n=>`${n}${e}`}),s=a("deg"),o=a("%"),l=a("px"),u=a("vh"),c=a("vw"),h={...o,parse:e=>o.parse(e)/100,transform:e=>o.transform(100*e)}},6430:function(e,n,r){"use strict";r.d(n,{hd:function(){return l},kp:function(){return a},nw:function(){return i},da:function(){return s},mj:function(){return o}});let i=e=>math.round(1e5*e)/1e5,a=/(-)?([\d]*\.?[\d])+/g,s=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,o=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function l(e){return"string"==typeof e}},5204:function(e,n,r){"use strict";let i,a;r.d(n,{v:function(){return f}});var s=r(3234),o=r(6681),l=r(7294),u=r(5487),c=r(7301);let h=new weakmap;function d({target:e,contentrect:n,borderboxsize:r}){var i;null===(i=h.get(e))||void 0===i||i.foreach(i=>{i({target:e,contentsize:n,get size(){return function(e,n){if(n){let{inlinesize:e,blocksize:r}=n[0];return{width:e,height:r}}return e instanceof svgelement&&"getbbox"in e?e.getbbox():{width:e.offsetwidth,height:e.offsetheight}}(e,r)}})})}function p(e){e.foreach(d)}let f=new set;var m=r(3967),g=r(3038);let v=()=>({current:0,offset:[],progress:0,scrolllength:0,targetoffset:0,targetlength:0,containerlength:0,velocity:0}),y=()=>({time:0,x:v(),y:v()}),x={x:{length:"width",position:"left"},y:{length:"height",position:"top"}};function _(e,n,r,i){let a=r[n],{length:s,position:o}=x[n],l=a.current,u=r.time;a.current=e["scroll"+o],a.scrolllength=e["scroll"+s]-e["client"+s],a.offset.length=0,a.offset[0]=0,a.offset[1]=a.scrolllength,a.progress=(0,m.y)(0,a.scrolllength,a.current);let c=i-u;a.velocity=c>50?0:(0,g.r)(a.current-l,c)}let a={enter:[[0,1],[1,1]],exit:[[0,0],[1,0]],any:[[1,0],[0,1]],all:[[0,0],[1,1]]},b={start:0,center:.5,end:1};function m(e,n,r=0){let i=0;if(void 0!==b[e]&&(e=b[e]),"string"==typeof e){let n=parsefloat(e);e.endswith("px")?i=n:e.endswith("%")?e=n/100:e.endswith("vw")?i=n/100*document.documentelement.clientwidth:e.endswith("vh")?i=n/100*document.documentelement.clientheight:e=n}return"number"==typeof e&&(i=n*e),r+i}let s=[0,0];var w=r(4606),c=r(533);let e={x:0,y:0},t=new weakmap,b=new weakmap,p=new weakmap,r=e=>e===document.documentelement?window:e;var l=r(8868);function i(e,n){(0,u.k)(boolean(!n||n.current),`you have defined a ${e} options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. try calling usescroll() in the same component as the ref, or setting its \`layouteffect: false\` option.`)}let d=()=>({scrollx:(0,s.b)(0),scrolly:(0,s.b)(0),scrollxprogress:(0,s.b)(0),scrollyprogress:(0,s.b)(0)});function f({container:e,target:n,layouteffect:r=!0,...s}={}){let u=(0,o.h)(d),d=r?l.l:l.useeffect;return d(()=>(i("target",n),i("container",e),function(e,{container:n=document.documentelement,...r}={}){let s=p.get(n);s||(s=new set,p.set(n,s));let o=y(),l=function(e,n,r,i={}){return{measure:()=>(function(e,n=e,r){if(r.x.targetoffset=0,r.y.targetoffset=0,n!==e){let i=n;for(;i&&i!==e;)r.x.targetoffset+=i.offsetleft,r.y.targetoffset+=i.offsettop,i=i.offsetparent}r.x.targetlength=n===e?n.scrollwidth:n.clientwidth,r.y.targetlength=n===e?n.scrollheight:n.clientheight,r.x.containerlength=e.clientwidth,r.y.containerlength=e.clientheight})(e,i.target,r),update:n=>{var a;_(e,"x",a=r,n),_(e,"y",a,n),a.time=n,(i.offset||i.target)&&function(e,n,r){let{offset:i=a.all}=r,{target:a=e,axis:s="y"}=r,o="y"===s?"height":"width",l=a!==e?function(e,n){let r={x:0,y:0},i=e;for(;i&&i!==n;)if(i instanceof htmlelement)r.x+=i.offsetleft,r.y+=i.offsettop,i=i.offsetparent;else if(i instanceof svggraphicselement&&"getbbox"in i){let{top:e,left:n}=i.getbbox();for(r.x+=n,r.y+=e;i&&"svg"!==i.tagname;)i=i.parentnode}return r}(a,e):e,u=a===e?{width:e.scrollwidth,height:e.scrollheight}:{width:a.clientwidth,height:a.clientheight},c={width:e.clientwidth,height:e.clientheight};n[s].offset.length=0;let h=!n[s].interpolate,d=i.length;for(let e=0;en(r)}}(n,e,o,r);if(s.add(l),!t.has(n)){let e=()=>{let e=performance.now();for(let e of s)e.measure();for(let n of s)n.update(e);for(let e of s)e.notify()};t.set(n,e);let r=r(n);window.addeventlistener("resize",e,{passive:!0}),n!==document.documentelement&&b.set(n,"function"==typeof n?(f.add(n),a||(a=()=>{let e={width:window.innerwidth,height:window.innerheight},n={target:window,size:e,contentsize:e};f.foreach(e=>e(n))},window.addeventlistener("resize",a)),()=>{f.delete(n),!f.size&&a&&(a=void 0)}):function(e,n){i||"undefined"==typeof resizeobserver||(i=new resizeobserver(p));let r=(0,c.i)(e);return r.foreach(e=>{let r=h.get(e);r||(r=new set,h.set(e,r)),r.add(n),null==i||i.observe(e)}),()=>{r.foreach(e=>{let r=h.get(e);null==r||r.delete(n),(null==r?void 0:r.size)||null==i||i.unobserve(e)})}}(n,e)),r.addeventlistener("scroll",e,{passive:!0})}let u=t.get(n),d=requestanimationframe(u);return()=>{var e;cancelanimationframe(d);let r=p.get(n);if(!r||(r.delete(l),r.size))return;let i=t.get(n);t.delete(n),i&&(r(n).removeeventlistener("scroll",i),null===(e=b.get(n))||void 0===e||e(),window.removeeventlistener("resize",i))}}(({x:e,y:n})=>{u.scrollx.set(e.current),u.scrollxprogress.set(e.progress),u.scrolly.set(n.current),u.scrollyprogress.set(n.progress)},{...s,container:(null==e?void 0:e.current)||void 0,target:(null==n?void 0:n.current)||void 0})),[]),u}},2490:function(e,n,r){"use strict";r.d(n,{l:function(){return a}});var i=r(406);function a(e){return boolean((0,i.i)(e)&&e.add)}},406:function(e,n,r){"use strict";r.d(n,{i:function(){return i}});let i=e=>boolean(e&&e.getvelocity)},6399:function(e,n,r){"use strict";r.d(n,{b:function(){return s}});var i=r(8715),a=r(406);function s(e){let n=(0,a.i)(e)?e.get():e;return(0,i.p)(n)?n.tovalue():n}},1782:function(e,n,r){"use strict";r.d(n,{z:function(){return p},z:function(){return d}});var i=r(7294),a="__wrap_b",s="__wrap_o",o="undefined"==typeof window?i.useeffect:i.uselayouteffect,l=(e,n,r)=>{let i=(r=r||document.queryselector(`[data-br="${e}"]`)).parentelement,a=e=>r.style.maxwidth=e+"px";r.style.maxwidth="";let s=i.clientwidth,o=i.clientheight,l=s/2-.25,u=s+.5,c;if(s){for(;l+1{self.__wrap_b(0,+r.dataset.brr,r)})).observe(i)},u=l.tostring(),c=(e,n="")=>i.createelement("script",{suppresshydrationwarning:!0,dangerouslysetinnerhtml:{__html:(e?"":`self.${a}=${u};`)+n}}),h=i.createcontext(!1),d=({children:e})=>i.createelement(h.provider,{value:!0},c(!1),e),p=({as:e="span",ratio:n=1,children:r,...u})=>{let d=i.useid(),p=i.useref(),f=i.usecontext(h);return o(()=>{p.current&&(self[a]=l)(0,n,p.current)},[r,n]),o(()=>()=>{if(!p.current)return;let e=p.current[s];e&&(e.disconnect(),delete p.current[s])},[]),i.createelement(i.fragment,null,i.createelement(e,{...u,"data-br":d,"data-brr":n,ref:p,style:{display:"inline-block",verticalalign:"top",textdecoration:"inherit"},suppresshydrationwarning:!0},r),c(f,`self.${a}("${d}",${n})`))}},9477:function(e,n,r){"use strict";let i,a,s,o,l;r.r(n),r.d(n,{acesfilmictonemapping:function(){return eo},addequation:function(){return p},addoperation:function(){return en},additiveanimationblendmode:function(){return tc},additiveblending:function(){return c},alphaformat:function(){return eh},alwaysdepth:function(){return x},alwaysstencilfunc:function(){return t0},ambientlight:function(){return u2},ambientlightprobe:function(){return cl},animationclip:function(){return ue},animationloader:function(){return uf},animationmixer:function(){return cz},animationobjectgroup:function(){return ch},animationutils:function(){return uf},arccurve:function(){return o5},arraycamera:function(){return sx},arrowhelper:function(){return h_},audio:function(){return c_},audioanalyser:function(){return cc},audiocontext:function(){return ca},audiolistener:function(){return cx},audioloader:function(){return cs},axeshelper:function(){return ha},backside:function(){return a},basicdepthpacking:function(){return tl},basicshadowmap:function(){return g},bone:function(){return om},booleankeyframetrack:function(){return u_},box2:function(){return c0},box3:function(){return nz},box3helper:function(){return hv},boxbuffergeometry:function(){return hw},boxgeometry:function(){return ib},boxhelper:function(){return hg},bufferattribute:function(){return r3},buffergeometry:function(){return id},buffergeometryloader:function(){return u7},bytetype:function(){return eb},cache:function(){return ut},camera:function(){return if},camerahelper:function(){return hp},canvastexture:function(){return o3},capsulebuffergeometry:function(){return hc},capsulegeometry:function(){return lv},catmullromcurve3:function(){return ln},cineontonemapping:function(){return es},circlebuffergeometry:function(){return he},circlegeometry:function(){return ly},clamptoedgewrapping:function(){return eg},clock:function(){return cp},color:function(){return nf},colorkeyframetrack:function(){return ua},colormanagement:function(){return nt},compressedarraytexture:function(){return o2},compressedtexture:function(){return o1},compressedtextureloader:function(){return uo},conebuffergeometry:function(){return ht},conegeometry:function(){return l_},cubecamera:function(){return in},cubereflectionmapping:function(){return ec},cuberefractionmapping:function(){return eh},cubetexture:function(){return ik},cubetextureloader:function(){return uk},cubeuvreflectionmapping:function(){return ef},cubicbeziercurve:function(){return ls},cubicbeziercurve3:function(){return lo},cubicinterpolant:function(){return ug},cullfaceback:function(){return p},cullfacefront:function(){return f},cullfacefrontback:function(){return m},cullfacenone:function(){return d},curve:function(){return o4},curvepath:function(){return lf},customblending:function(){return b},customtonemapping:function(){return el},cylinderbuffergeometry:function(){return hb},cylindergeometry:function(){return lx},cylindrical:function(){return cz},data3dtexture:function(){return nw},dataarraytexture:function(){return nv},datatexture:function(){return os},datatextureloader:function(){return uh},datautils:function(){return hs},decrementstencilop:function(){return tv},decrementwrapstencilop:function(){return tw},defaultloadingmanager:function(){return up},depthformat:function(){return ev},depthstencilformat:function(){return ej},depthtexture:function(){return sq},directionallight:function(){return u1},directionallighthelper:function(){return hc},discreteinterpolant:function(){return uy},dodecahedronbuffergeometry:function(){return hp},dodecahedrongeometry:function(){return lb},doubleside:function(){return b},dstalphafactor:function(){return u},dstcolorfactor:function(){return v},dynamiccopyusage:function(){return t8},dynamicdrawusage:function(){return t2},dynamicreadusage:function(){return t6},edgesgeometry:function(){return le},ellipsecurve:function(){return o6},equaldepth:function(){return q},equalstencilfunc:function(){return ty},equirectangularreflectionmapping:function(){return ed},equirectangularrefractionmapping:function(){return ep},euler:function(){return rw},eventdispatcher:function(){return nr},extrudebuffergeometry:function(){return hr},extrudegeometry:function(){return lk},fileloader:function(){return ud},float16bufferattribute:function(){return it},float32bufferattribute:function(){return ir},float64bufferattribute:function(){return ii},floattype:function(){return ed},fog:function(){return s4},fogexp2:function(){return s3},framebuffertexture:function(){return o0},frontside:function(){return _},frustum:function(){return ij},glbufferattribute:function(){return cx},glsl1:function(){return ne},glsl3:function(){return nt},greaterdepth:function(){return z},greaterequaldepth:function(){return q},greaterequalstencilfunc:function(){return t$},greaterstencilfunc:function(){return tq},gridhelper:function(){return ha},group:function(){return sk},halffloattype:function(){return ef},hemispherelight:function(){return uz},hemispherelighthelper:function(){return hi},hemispherelightprobe:function(){return co},icosahedronbuffergeometry:function(){return hl},icosahedrongeometry:function(){return lq},imagebitmaploader:function(){return ci},imageloader:function(){return un},imageutils:function(){return no},incrementstencilop:function(){return tz},incrementwrapstencilop:function(){return tj},instancedbufferattribute:function(){return ot},instancedbuffergeometry:function(){return u8},instancedinterleavedbuffer:function(){return cj},instancedmesh:function(){return od},int16bufferattribute:function(){return r9},int32bufferattribute:function(){return r7},int8bufferattribute:function(){return r4},inttype:function(){return el},interleavedbuffer:function(){return s5},interleavedbufferattribute:function(){return s8},interpolant:function(){return um},interpolatediscrete:function(){return tx},interpolatelinear:function(){return t_},interpolatesmooth:function(){return ta},invertstencilop:function(){return tj},keepstencilop:function(){return tg},keyframetrack:function(){return ux},lod:function(){return og},lathebuffergeometry:function(){return hi},lathegeometry:function(){return lg},layers:function(){return rc},lessdepth:function(){return k},lessequaldepth:function(){return y},lessequalstencilfunc:function(){return tq},lessstencilfunc:function(){return tk},light:function(){return uu},lightprobe:function(){return u6},line:function(){return ou},line3:function(){return c3},linebasicmaterial:function(){return of},linecurve:function(){return ll},linecurve3:function(){return lu},linedashedmaterial:function(){return uo},lineloop:function(){return ow},linesegments:function(){return oj},linearencoding:function(){return tp},linearfilter:function(){return em},linearinterpolant:function(){return uv},linearmipmaplinearfilter:function(){return ee},linearmipmapnearestfilter:function(){return ew},linearmipmaplinearfilter:function(){return ec},linearmipmapnearestfilter:function(){return es},linearsrgbcolorspace:function(){return tk},lineartonemapping:function(){return ei},loader:function(){return ur},loaderutils:function(){return u9},loadingmanager:function(){return ub},looponce:function(){return tg},looppingpong:function(){return ty},looprepeat:function(){return tv},luminancealphaformat:function(){return ez},luminanceformat:function(){return eu},mouse:function(){return c},material:function(){return r$},materialloader:function(){return u5},mathutils:function(){return nv},matrix3:function(){return nx},matrix4:function(){return rm},maxequation:function(){return d},mesh:function(){return ie},meshbasicmaterial:function(){return r0},meshdepthmaterial:function(){return su},meshdistancematerial:function(){return sz},meshlambertmaterial:function(){return ua},meshmatcapmaterial:function(){return us},meshnormalmaterial:function(){return ui},meshphongmaterial:function(){return un},meshphysicalmaterial:function(){return ut},meshstandardmaterial:function(){return ue},meshtoonmaterial:function(){return ur},minequation:function(){return i},mirroredrepeatwrapping:function(){return ev},mixoperation:function(){return et},multiplyblending:function(){return t},multiplyoperation:function(){return ee},nearestfilter:function(){return ey},nearestmipmaplinearfilter:function(){return eb},nearestmipmapnearestfilter:function(){return e_},nearestmipmaplinearfilter:function(){return ea},nearestmipmapnearestfilter:function(){return ex},neverdepth:function(){return j},neverstencilfunc:function(){return tx},noblending:function(){return s},nocolorspace:function(){return to},notonemapping:function(){return er},normalanimationblendmode:function(){return tw},normalblending:function(){return w},notequaldepth:function(){return $},notequalstencilfunc:function(){return tz},numberkeyframetrack:function(){return ub},object3d:function(){return rg},objectloader:function(){return ce},objectspacenormalmap:function(){return tf},octahedronbuffergeometry:function(){return hd},octahedrongeometry:function(){return lq},onefactor:function(){return o},oneminusdstalphafactor:function(){return z},oneminusdstcolorfactor:function(){return j},oneminussrcalphafactor:function(){return g},oneminussrccolorfactor:function(){return k},orthographiccamera:function(){return i5},pcfshadowmap:function(){return v},pcfsoftshadowmap:function(){return y},pmremgenerator:function(){return ai},path:function(){return lm},perspectivecamera:function(){return io},plane:function(){return iv},planebuffergeometry:function(){return hf},planegeometry:function(){return iy},planehelper:function(){return hy},pointlight:function(){return u$},pointlighthelper:function(){return he},points:function(){return oq},pointsmaterial:function(){return oj},polargridhelper:function(){return hs},polyhedronbuffergeometry:function(){return ho},polyhedrongeometry:function(){return la},positionalaudio:function(){return cw},propertybinding:function(){return ck},propertymixer:function(){return ce},quadraticbeziercurve:function(){return lc},quadraticbeziercurve3:function(){return lh},quaternion:function(){return nk},quaternionkeyframetrack:function(){return us},quaternionlinearinterpolant:function(){return um},red_green_rgtc2_format:function(){return tf},red_rgtc1_format:function(){return td},revision:function(){return u},rgbadepthpacking:function(){return ti},rgbaformat:function(){return eg},rgbaintegerformat:function(){return ey},rgba_astc_10x10_format:function(){return tl},rgba_astc_10x5_format:function(){return ta},rgba_astc_10x6_format:function(){return ts},rgba_astc_10x8_format:function(){return to},rgba_astc_12x10_format:function(){return tu},rgba_astc_12x12_format:function(){return tc},rgba_astc_4x4_format:function(){return e9},rgba_astc_5x4_format:function(){return e8},rgba_astc_5x5_format:function(){return e7},rgba_astc_6x5_format:function(){return te},rgba_astc_6x6_format:function(){return tt},rgba_astc_8x5_format:function(){return tn},rgba_astc_8x6_format:function(){return tr},rgba_astc_8x8_format:function(){return ti},rgba_bptc_format:function(){return th},rgba_etc2_eac_format:function(){return e5},rgba_pvrtc_2bppv1_format:function(){return e3},rgba_pvrtc_4bppv1_format:function(){return e2},rgba_s3tc_dxt1_format:function(){return eq},rgba_s3tc_dxt3_format:function(){return ez},rgba_s3tc_dxt5_format:function(){return e$},rgb_etc1_format:function(){return e4},rgb_etc2_format:function(){return e6},rgb_pvrtc_2bppv1_format:function(){return e1},rgb_pvrtc_4bppv1_format:function(){return e0},rgb_s3tc_dxt1_format:function(){return eq},rgformat:function(){return ex},rgintegerformat:function(){return ek},rawshadermaterial:function(){return l7},ray:function(){return rf},raycaster:function(){return ck},rectarealight:function(){return u3},redformat:function(){return ew},redintegerformat:function(){return ej},reinhardtonemapping:function(){return ea},repeatwrapping:function(){return em},replacestencilop:function(){return tu},reversesubtractequation:function(){return l},ringbuffergeometry:function(){return hn},ringgeometry:function(){return lz},signed_red_green_rgtc2_format:function(){return tm},signed_red_rgtc1_format:function(){return tp},srgbcolorspace:function(){return tn},scene:function(){return s6},shaderchunk:function(){return iq},shaderlib:function(){return iz},shadermaterial:function(){return id},shadowmaterial:function(){return l8},shape:function(){return lt},shapebuffergeometry:function(){return hk},shapegeometry:function(){return l$},shapepath:function(){return hb},shapeutils:function(){return lw},shorttype:function(){return ep},skeleton:function(){return oe},skeletonhelper:function(){return c7},skinnedmesh:function(){return ob},source:function(){return nn},sphere:function(){return rs},spherebuffergeometry:function(){return hh},spheregeometry:function(){return l0},spherical:function(){return cq},sphericalharmonics3:function(){return u4},splinecurve:function(){return ld},spotlight:function(){return uk},spotlighthelper:function(){return c6},sprite:function(){return od},spritematerial:function(){return s7},srcalphafactor:function(){return h},srcalphasaturatefactor:function(){return w},srccolorfactor:function(){return n},staticcopyusage:function(){return t9},staticdrawusage:function(){return t1},staticreadusage:function(){return t4},stereocamera:function(){return cd},streamcopyusage:function(){return t7},streamdrawusage:function(){return t3},streamreadusage:function(){return t5},stringkeyframetrack:function(){return uw},subtractequation:function(){return r},subtractiveblending:function(){return e},touch:function(){return h},tangentspacenormalmap:function(){return td},tetrahedronbuffergeometry:function(){return hg},tetrahedrongeometry:function(){return l1},texture:function(){return ng},textureloader:function(){return ug},torusbuffergeometry:function(){return hu},torusgeometry:function(){return l2},torusknotbuffergeometry:function(){return hz},torusknotgeometry:function(){return l3},triangle:function(){return rq},trianglefandrawmode:function(){return tb},trianglestripdrawmode:function(){return tt},trianglesdrawmode:function(){return te},tubebuffergeometry:function(){return hv},tubegeometry:function(){return l4},twopassdoubleside:function(){return m},uvmapping:function(){return eu},uint16bufferattribute:function(){return r8},uint32bufferattribute:function(){return ie},uint8bufferattribute:function(){return r6},uint8clampedbufferattribute:function(){return r5},uniform:function(){return cv},uniformsgroup:function(){return cw},uniformslib:function(){return iq},uniformsutils:function(){return ii},unsignedbytetype:function(){return et},unsignedint248type:function(){return ek},unsignedinttype:function(){return ei},unsignedshort4444type:function(){return eo},unsignedshort5551type:function(){return en},unsignedshorttype:function(){return er},vsmshadowmap:function(){return x},vector2:function(){return ny},vector3:function(){return ny},vector4:function(){return nu},vectorkeyframetrack:function(){return uc},videotexture:function(){return o$},webgl1renderer:function(){return s2},webgl3drendertarget:function(){return nj},webglarrayrendertarget:function(){return nj},webglcuberendertarget:function(){return ih},webglmultiplerendertargets:function(){return nx},webglrendertarget:function(){return nz},webglrenderer:function(){return s1},webglutils:function(){return sj},wireframegeometry:function(){return l6},wraparoundending:function(){return ts},zerocurvatureending:function(){return tb},zerofactor:function(){return f},zeroslopeending:function(){return tm},zerostencilop:function(){return th},_srgbaformat:function(){return nn},srgbencoding:function(){return tr}});/** * @license * copyright 2010-2023 three.js authors * spdx-license-identifier: mit */let u="149",c={left:0,middle:1,right:2,rotate:0,dolly:1,pan:2},h={rotate:0,pan:1,dolly_pan:2,dolly_rotate:3},d=0,p=1,f=2,m=3,g=0,v=1,y=2,x=3,_=0,a=1,b=2,m=2,s=0,w=1,c=2,e=3,t=4,b=5,p=100,r=101,l=102,i=103,d=104,f=200,o=201,n=202,k=203,h=204,g=205,u=206,z=207,v=208,j=209,w=210,j=0,x=1,k=2,y=3,q=4,q=5,z=6,$=7,ee=0,et=1,en=2,er=0,ei=1,ea=2,es=3,eo=4,el=5,eu=300,ec=301,eh=302,ed=303,ep=304,ef=306,em=1e3,eg=1001,ev=1002,ey=1003,ex=1004,e_=1004,ea=1005,eb=1005,em=1006,es=1007,ew=1007,ec=1008,ee=1008,et=1009,eb=1010,ep=1011,er=1012,el=1013,ei=1014,ed=1015,ef=1016,eo=1017,en=1018,ek=1020,eh=1021,eg=1023,eu=1024,ez=1025,ev=1026,ej=1027,ew=1028,ej=1029,ex=1030,ek=1031,ey=1033,eq=33776,eq=33777,ez=33778,e$=33779,e0=35840,e1=35841,e2=35842,e3=35843,e4=36196,e6=37492,e5=37496,e9=37808,e8=37809,e7=37810,te=37811,tt=37812,tn=37813,tr=37814,ti=37815,ta=37816,ts=37817,to=37818,tl=37819,tu=37820,tc=37821,th=36492,td=36283,tp=36284,tf=36285,tm=36286,tg=2200,tv=2201,ty=2202,tx=2300,t_=2301,ta=2302,tb=2400,tm=2401,ts=2402,tw=2500,tc=2501,te=0,tt=1,tb=2,tp=3e3,tr=3001,tl=3200,ti=3201,td=0,tf=1,to="",tn="srgb",tk="srgb-linear",th=0,tg=7680,tu=7681,tz=7682,tv=7683,tj=34055,tw=34056,tj=5386,tx=512,tk=513,ty=514,tq=515,tq=516,tz=517,t$=518,t0=519,t1=35044,t2=35048,t3=35040,t4=35045,t6=35049,t5=35041,t9=35046,t8=35050,t7=35042,ne="100",nt="300 es",nn=1035;class nr{addeventlistener(e,n){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexof(n)&&r[e].push(n)}haseventlistener(e,n){if(void 0===this._listeners)return!1;let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexof(n)}removeeventlistener(e,n){if(void 0===this._listeners)return;let r=this._listeners,i=r[e];if(void 0!==i){let e=i.indexof(n);-1!==e&&i.splice(e,1)}}dispatchevent(e){if(void 0===this._listeners)return;let n=this._listeners,r=n[e.type];if(void 0!==r){e.target=this;let n=r.slice(0);for(let r=0,i=n.length;r>8&255]+ni[e>>16&255]+ni[e>>24&255]+"-"+ni[255&n]+ni[n>>8&255]+"-"+ni[n>>16&15|64]+ni[n>>24&255]+"-"+ni[63&r|128]+ni[r>>8&255]+"-"+ni[r>>16&255]+ni[r>>24&255]+ni[255&i]+ni[i>>8&255]+ni[i>>16&255]+ni[i>>24&255];return a.tolowercase()}function nu(e,n,r){return math.max(n,math.min(r,e))}function nc(e,n){return(e%n+n)%n}function nh(e,n,r){return(1-r)*e+r*n}function nd(e){return(e&e-1)==0&&0!==e}function np(e){return math.pow(2,math.ceil(math.log(e)/math.ln2))}function nf(e){return math.pow(2,math.floor(math.log(e)/math.ln2))}function nm(e,n){switch(n.constructor){case float32array:return e;case uint16array:return e/65535;case uint8array:return e/255;case int16array:return math.max(e/32767,-1);case int8array:return math.max(e/127,-1);default:throw error("invalid component type.")}}function ng(e,n){switch(n.constructor){case float32array:return e;case uint16array:return math.round(65535*e);case uint8array:return math.round(255*e);case int16array:return math.round(32767*e);case int8array:return math.round(127*e);default:throw error("invalid component type.")}}var nv=object.freeze({__proto__:null,deg2rad:ns,rad2deg:no,ceilpoweroftwo:np,clamp:nu,damp:function(e,n,r,i){return nh(e,n,1-math.exp(-r*i))},degtorad:function(e){return e*ns},denormalize:nm,euclideanmodulo:nc,floorpoweroftwo:nf,generateuuid:nl,inverselerp:function(e,n,r){return e!==n?(r-e)/(n-e):0},ispoweroftwo:nd,lerp:nh,maplinear:function(e,n,r,i,a){return i+(e-n)*(a-i)/(r-n)},normalize:ng,pingpong:function(e,n=1){return n-math.abs(nc(e,2*n)-n)},radtodeg:function(e){return e*no},randfloat:function(e,n){return e+math.random()*(n-e)},randfloatspread:function(e){return e*(.5-math.random())},randint:function(e,n){return e+math.floor(math.random()*(n-e+1))},seededrandom:function(e){void 0!==e&&(na=e);let n=na+=1831565813;return n=math.imul(n^n>>>15,1|n),(((n^=n+math.imul(n^n>>>7,61|n))^n>>>14)>>>0)/4294967296},setquaternionfrompropereuler:function(e,n,r,i,a){let s=math.cos,o=math.sin,l=s(r/2),u=o(r/2),c=s((n+i)/2),h=o((n+i)/2),d=s((n-i)/2),p=o((n-i)/2),f=s((i-n)/2),m=o((i-n)/2);switch(a){case"xyx":e.set(l*h,u*d,u*p,l*c);break;case"yzy":e.set(u*p,l*h,u*d,l*c);break;case"zxz":e.set(u*d,u*p,l*h,l*c);break;case"xzx":e.set(l*h,u*m,u*f,l*c);break;case"yxy":e.set(u*f,l*h,u*m,l*c);break;case"zyz":e.set(u*m,u*f,l*h,l*c);break;default:console.warn("three.mathutils: .setquaternionfrompropereuler() encountered an unknown order: "+a)}},smootherstep:function(e,n,r){return e<=n?0:e>=r?1:(e=(e-n)/(r-n))*e*e*(e*(6*e-15)+10)},smoothstep:function(e,n,r){return e<=n?0:e>=r?1:(e=(e-n)/(r-n))*e*(3-2*e)}});class ny{constructor(e=0,n=0){ny.prototype.isvector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setscalar(e){return this.x=e,this.y=e,this}setx(e){return this.x=e,this}sety(e){return this.y=e,this}setcomponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw error("index is out of range: "+e)}return this}getcomponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addscalar(e){return this.x+=e,this.y+=e,this}addvectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addscaledvector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subscalar(e){return this.x-=e,this.y-=e,this}subvectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyscalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}dividescalar(e){return this.multiplyscalar(1/e)}applymatrix3(e){let n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=math.min(this.x,e.x),this.y=math.min(this.y,e.y),this}max(e){return this.x=math.max(this.x,e.x),this.y=math.max(this.y,e.y),this}clamp(e,n){return this.x=math.max(e.x,math.min(n.x,this.x)),this.y=math.max(e.y,math.min(n.y,this.y)),this}clampscalar(e,n){return this.x=math.max(e,math.min(n,this.x)),this.y=math.max(e,math.min(n,this.y)),this}clamplength(e,n){let r=this.length();return this.dividescalar(r||1).multiplyscalar(math.max(e,math.min(n,r)))}floor(){return this.x=math.floor(this.x),this.y=math.floor(this.y),this}ceil(){return this.x=math.ceil(this.x),this.y=math.ceil(this.y),this}round(){return this.x=math.round(this.x),this.y=math.round(this.y),this}roundtozero(){return this.x=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(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthsq(){return this.x*this.x+this.y*this.y}length(){return math.sqrt(this.x*this.x+this.y*this.y)}manhattanlength(){return math.abs(this.x)+math.abs(this.y)}normalize(){return this.dividescalar(this.length()||1)}angle(){let e=math.atan2(-this.y,-this.x)+math.pi;return e}distanceto(e){return math.sqrt(this.distancetosquared(e))}distancetosquared(e){let n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattandistanceto(e){return math.abs(this.x-e.x)+math.abs(this.y-e.y)}setlength(e){return this.normalize().multiplyscalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpvectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromarray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toarray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}frombufferattribute(e,n){return this.x=e.getx(n),this.y=e.gety(n),this}rotatearound(e,n){let r=math.cos(n),i=math.sin(n),a=this.x-e.x,s=this.y-e.y;return this.x=a*r-s*i+e.x,this.y=a*i+s*r+e.y,this}random(){return this.x=math.random(),this.y=math.random(),this}*[symbol.iterator](){yield this.x,yield this.y}}class nx{constructor(){nx.prototype.ismatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,n,r,i,a,s,o,l,u){let c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=n,c[4]=a,c[5]=l,c[6]=r,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractbasis(e,n,r){return e.setfrommatrix3column(this,0),n.setfrommatrix3column(this,1),r.setfrommatrix3column(this,2),this}setfrommatrix4(e){let n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplymatrices(this,e)}premultiply(e){return this.multiplymatrices(e,this)}multiplymatrices(e,n){let r=e.elements,i=n.elements,a=this.elements,s=r[0],o=r[3],l=r[6],u=r[1],c=r[4],h=r[7],d=r[2],p=r[5],f=r[8],m=i[0],g=i[3],v=i[6],y=i[1],x=i[4],_=i[7],a=i[2],b=i[5],m=i[8];return a[0]=s*m+o*y+l*a,a[3]=s*g+o*x+l*b,a[6]=s*v+o*_+l*m,a[1]=u*m+c*y+h*a,a[4]=u*g+c*x+h*b,a[7]=u*v+c*_+h*m,a[2]=d*m+p*y+f*a,a[5]=d*g+p*x+f*b,a[8]=d*v+p*_+f*m,this}multiplyscalar(e){let n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){let e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8];return n*s*c-n*o*u-r*a*c+r*o*l+i*a*u-i*s*l}invert(){let e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=c*s-o*u,d=o*l-c*a,p=u*a-s*l,f=n*h+r*d+i*p;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);let m=1/f;return e[0]=h*m,e[1]=(i*u-c*r)*m,e[2]=(o*r-i*s)*m,e[3]=d*m,e[4]=(c*n-i*l)*m,e[5]=(i*a-o*n)*m,e[6]=p*m,e[7]=(r*l-u*n)*m,e[8]=(s*n-r*a)*m,this}transpose(){let e;let n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getnormalmatrix(e){return this.setfrommatrix4(e).invert().transpose()}transposeintoarray(e){let n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setuvtransform(e,n,r,i,a,s,o){let l=math.cos(a),u=math.sin(a);return this.set(r*l,r*u,-r*(l*s+u*o)+s+e,-i*u,i*l,-i*(-u*s+l*o)+o+n,0,0,1),this}scale(e,n){return this.premultiply(n_.makescale(e,n)),this}rotate(e){return this.premultiply(n_.makerotation(-e)),this}translate(e,n){return this.premultiply(n_.maketranslation(e,n)),this}maketranslation(e,n){return this.set(1,0,e,0,1,n,0,0,1),this}makerotation(e){let n=math.cos(e),r=math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makescale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){let n=this.elements,r=e.elements;for(let e=0;e<9;e++)if(n[e]!==r[e])return!1;return!0}fromarray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toarray(e=[],n=0){let r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromarray(this.elements)}}let n_=new nx;function na(e){for(let n=e.length-1;n>=0;--n)if(e[n]>=65535)return!0;return!1}let nb={int8array:int8array,uint8array:uint8array,uint8clampedarray:uint8clampedarray,int16array:int16array,uint16array:uint16array,int32array:int32array,uint32array:uint32array,float32array:float32array,float64array:float64array};function nm(e,n){return new nb[e](n)}function ns(e){return document.createelementns("http://www.w3.org/1999/xhtml",e)}function nw(e){return e<.04045?.0773993808*e:math.pow(.9478672986*e+.0521327014,2.4)}function nc(e){return e<.0031308?12.92*e:1.055*math.pow(e,.41666)-.055}let ne={[tn]:{[tk]:nw},[tk]:{[tn]:nc}},nt={legacymode:!0,get workingcolorspace(){return tk},set workingcolorspace(colorspace){console.warn("three.colormanagement: .workingcolorspace is readonly.")},convert:function(e,n,r){if(this.legacymode||n===r||!n||!r)return e;if(ne[n]&&void 0!==ne[n][r]){let i=ne[n][r];return e.r=i(e.r),e.g=i(e.g),e.b=i(e.b),e}throw error("unsupported color space conversion.")},fromworkingcolorspace:function(e,n){return this.convert(e,this.workingcolorspace,n)},toworkingcolorspace:function(e,n){return this.convert(e,n,this.workingcolorspace)}},nb={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},np={r:0,g:0,b:0},nr={h:0,s:0,l:0},nl={h:0,s:0,l:0};function ni(e,n,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(n-e)*6*r:r<.5?n:r<2/3?e+(n-e)*6*(2/3-r):e}function nd(e,n){return n.r=e.r,n.g=e.g,n.b=e.b,n}class nf{constructor(e,n,r){if(this.iscolor=!0,this.r=1,this.g=1,this.b=1,void 0===n&&void 0===r)return this.set(e);return this.setrgb(e,n,r)}set(e){return e&&e.iscolor?this.copy(e):"number"==typeof e?this.sethex(e):"string"==typeof e&&this.setstyle(e),this}setscalar(e){return this.r=e,this.g=e,this.b=e,this}sethex(e,n=tn){return e=math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,nt.toworkingcolorspace(this,n),this}setrgb(e,n,r,i=nt.workingcolorspace){return this.r=e,this.g=n,this.b=r,nt.toworkingcolorspace(this,i),this}sethsl(e,n,r,i=nt.workingcolorspace){if(e=nc(e,1),n=nu(n,0,1),r=nu(r,0,1),0===n)this.r=this.g=this.b=r;else{let i=r<=.5?r*(1+n):r+n-r*n,a=2*r-i;this.r=ni(a,i,e+1/3),this.g=ni(a,i,e),this.b=ni(a,i,e-1/3)}return nt.toworkingcolorspace(this,i),this}setstyle(e,n=tn){let r;function i(n){void 0!==n&&1>parsefloat(n)&&console.warn("three.color: alpha component of "+e+" will be ignored.")}if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;let a=r[1],s=r[2];switch(a){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=math.min(255,parseint(e[1],10))/255,this.g=math.min(255,parseint(e[2],10))/255,this.b=math.min(255,parseint(e[3],10))/255,nt.toworkingcolorspace(this,n),i(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=math.min(100,parseint(e[1],10))/100,this.g=math.min(100,parseint(e[2],10))/100,this.b=math.min(100,parseint(e[3],10))/100,nt.toworkingcolorspace(this,n),i(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){let r=parsefloat(e[1])/360,a=parsefloat(e[2])/100,s=parsefloat(e[3])/100;return i(e[4]),this.sethsl(r,a,s,n)}}}else if(r=/^\#([a-fa-f\d]+)$/.exec(e)){let e=r[1],i=e.length;if(3===i)return this.r=parseint(e.charat(0)+e.charat(0),16)/255,this.g=parseint(e.charat(1)+e.charat(1),16)/255,this.b=parseint(e.charat(2)+e.charat(2),16)/255,nt.toworkingcolorspace(this,n),this;if(6===i)return this.r=parseint(e.charat(0)+e.charat(1),16)/255,this.g=parseint(e.charat(2)+e.charat(3),16)/255,this.b=parseint(e.charat(4)+e.charat(5),16)/255,nt.toworkingcolorspace(this,n),this}return e&&e.length>0?this.setcolorname(e,n):this}setcolorname(e,n=tn){let r=nb[e.tolowercase()];return void 0!==r?this.sethex(r,n):console.warn("three.color: unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copysrgbtolinear(e){return this.r=nw(e.r),this.g=nw(e.g),this.b=nw(e.b),this}copylineartosrgb(e){return this.r=nc(e.r),this.g=nc(e.g),this.b=nc(e.b),this}convertsrgbtolinear(){return this.copysrgbtolinear(this),this}convertlineartosrgb(){return this.copylineartosrgb(this),this}gethex(e=tn){return nt.fromworkingcolorspace(nd(this,np),e),nu(255*np.r,0,255)<<16^nu(255*np.g,0,255)<<8^nu(255*np.b,0,255)<<0}gethexstring(e=tn){return("000000"+this.gethex(e).tostring(16)).slice(-6)}gethsl(e,n=nt.workingcolorspace){let r,i;nt.fromworkingcolorspace(nd(this,np),n);let a=np.r,s=np.g,o=np.b,l=math.max(a,s,o),u=math.min(a,s,o),c=(u+l)/2;if(u===l)r=0,i=0;else{let e=l-u;switch(i=c<=.5?e/(l+u):e/(2-l-u),l){case a:r=(s-o)/e+(s2048||n.height>2048?(console.warn("three.imageutils.getdataurl: image converted to jpg for performance reasons",e),n.todataurl("image/jpeg",.6)):n.todataurl("image/png")}static srgbtolinear(e){if("undefined"!=typeof htmlimageelement&&e instanceof htmlimageelement||"undefined"!=typeof htmlcanvaselement&&e instanceof htmlcanvaselement||"undefined"!=typeof imagebitmap&&e instanceof imagebitmap){let n=ns("canvas");n.width=e.width,n.height=e.height;let r=n.getcontext("2d");r.drawimage(e,0,0,e.width,e.height);let i=r.getimagedata(0,0,e.width,e.height),a=i.data;for(let e=0;e0&&(r.userdata=this.userdata),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchevent({type:"dispose"})}transformuv(e){if(this.mapping!==eu)return e;if(e.applymatrix3(this.matrix),e.x<0||e.x>1)switch(this.wraps){case em:e.x=e.x-math.floor(e.x);break;case eg:e.x=e.x<0?0:1;break;case ev:1===math.abs(math.floor(e.x)%2)?e.x=math.ceil(e.x)-e.x:e.x=e.x-math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapt){case em:e.y=e.y-math.floor(e.y);break;case eg:e.y=e.y<0?0:1;break;case ev:1===math.abs(math.floor(e.y)%2)?e.y=math.ceil(e.y)-e.y:e.y=e.y-math.floor(e.y)}return this.flipy&&(e.y=1-e.y),e}set needsupdate(e){!0===e&&(this.version++,this.source.needsupdate=!0)}}ng.default_image=null,ng.default_mapping=eu,ng.default_anisotropy=1;class nu{constructor(e=0,n=0,r=0,i=1){nu.prototype.isvector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setscalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setx(e){return this.x=e,this}sety(e){return this.y=e,this}setz(e){return this.z=e,this}setw(e){return this.w=e,this}setcomponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw error("index is out of range: "+e)}return this}getcomponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addscalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addvectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addscaledvector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subscalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subvectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyscalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applymatrix4(e){let n=this.x,r=this.y,i=this.z,a=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*a,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*a,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*a,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*a,this}dividescalar(e){return this.multiplyscalar(1/e)}setaxisanglefromquaternion(e){this.w=2*math.acos(e.w);let n=math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setaxisanglefromrotationmatrix(e){let n,r,i;let a=e.elements,s=a[0],o=a[4],l=a[8],u=a[1],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(.01>math.abs(o-u)&&.01>math.abs(l-d)&&.01>math.abs(h-p)){if(.1>math.abs(o+u)&&.1>math.abs(l+d)&&.1>math.abs(h+p)&&.1>math.abs(s+c+f-3))return this.set(1,0,0,0),this;let e=(s+1)/2,a=(c+1)/2,m=(f+1)/2,g=(o+u)/4,v=(l+d)/4,y=(h+p)/4;return e>a&&e>m?e<.01?(n=0,r=.707106781,i=.707106781):(r=g/(n=math.sqrt(e)),i=v/n):a>m?a<.01?(n=.707106781,r=0,i=.707106781):(n=g/(r=math.sqrt(a)),i=y/r):m<.01?(n=.707106781,r=.707106781,i=0):(n=v/(i=math.sqrt(m)),r=y/i),this.set(n,r,i,math.pi),this}let m=math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-o)*(u-o));return .001>math.abs(m)&&(m=1),this.x=(p-h)/m,this.y=(l-d)/m,this.z=(u-o)/m,this.w=math.acos((s+c+f-1)/2),this}min(e){return this.x=math.min(this.x,e.x),this.y=math.min(this.y,e.y),this.z=math.min(this.z,e.z),this.w=math.min(this.w,e.w),this}max(e){return this.x=math.max(this.x,e.x),this.y=math.max(this.y,e.y),this.z=math.max(this.z,e.z),this.w=math.max(this.w,e.w),this}clamp(e,n){return this.x=math.max(e.x,math.min(n.x,this.x)),this.y=math.max(e.y,math.min(n.y,this.y)),this.z=math.max(e.z,math.min(n.z,this.z)),this.w=math.max(e.w,math.min(n.w,this.w)),this}clampscalar(e,n){return this.x=math.max(e,math.min(n,this.x)),this.y=math.max(e,math.min(n,this.y)),this.z=math.max(e,math.min(n,this.z)),this.w=math.max(e,math.min(n,this.w)),this}clamplength(e,n){let r=this.length();return this.dividescalar(r||1).multiplyscalar(math.max(e,math.min(n,r)))}floor(){return this.x=math.floor(this.x),this.y=math.floor(this.y),this.z=math.floor(this.z),this.w=math.floor(this.w),this}ceil(){return this.x=math.ceil(this.x),this.y=math.ceil(this.y),this.z=math.ceil(this.z),this.w=math.ceil(this.w),this}round(){return this.x=math.round(this.x),this.y=math.round(this.y),this.z=math.round(this.z),this.w=math.round(this.w),this}roundtozero(){return this.x=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.w=this.w<0?math.ceil(this.w):math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthsq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanlength(){return math.abs(this.x)+math.abs(this.y)+math.abs(this.z)+math.abs(this.w)}normalize(){return this.dividescalar(this.length()||1)}setlength(e){return this.normalize().multiplyscalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpvectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromarray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toarray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}frombufferattribute(e,n){return this.x=e.getx(n),this.y=e.gety(n),this.z=e.getz(n),this.w=e.getw(n),this}random(){return this.x=math.random(),this.y=math.random(),this.z=math.random(),this.w=math.random(),this}*[symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class nz extends nr{constructor(e=1,n=1,r={}){super(),this.iswebglrendertarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new nu(0,0,e,n),this.scissortest=!1,this.viewport=new nu(0,0,e,n),this.texture=new ng({width:e,height:n,depth:1},r.mapping,r.wraps,r.wrapt,r.magfilter,r.minfilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isrendertargettexture=!0,this.texture.flipy=!1,this.texture.generatemipmaps=void 0!==r.generatemipmaps&&r.generatemipmaps,this.texture.internalformat=void 0!==r.internalformat?r.internalformat:null,this.texture.minfilter=void 0!==r.minfilter?r.minfilter:em,this.depthbuffer=void 0===r.depthbuffer||r.depthbuffer,this.stencilbuffer=void 0!==r.stencilbuffer&&r.stencilbuffer,this.depthtexture=void 0!==r.depthtexture?r.depthtexture:null,this.samples=void 0!==r.samples?r.samples:0}setsize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isrendertargettexture=!0;let n=object.assign({},e.texture.image);return this.texture.source=new nn(n),this.depthbuffer=e.depthbuffer,this.stencilbuffer=e.stencilbuffer,null!==e.depthtexture&&(this.depthtexture=e.depthtexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchevent({type:"dispose"})}}class nv extends ng{constructor(e=null,n=1,r=1,i=1){super(null),this.isdataarraytexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magfilter=ey,this.minfilter=ey,this.wrapr=eg,this.generatemipmaps=!1,this.flipy=!1,this.unpackalignment=1}}class nj extends nz{constructor(e=1,n=1,r=1){super(e,n),this.iswebglarrayrendertarget=!0,this.depth=r,this.texture=new nv(null,e,n,r),this.texture.isrendertargettexture=!0}}class nw extends ng{constructor(e=null,n=1,r=1,i=1){super(null),this.isdata3dtexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magfilter=ey,this.minfilter=ey,this.wrapr=eg,this.generatemipmaps=!1,this.flipy=!1,this.unpackalignment=1}}class nj extends nz{constructor(e=1,n=1,r=1){super(e,n),this.iswebgl3drendertarget=!0,this.depth=r,this.texture=new nw(null,e,n,r),this.texture.isrendertargettexture=!0}}class nx extends nz{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.iswebglmultiplerendertargets=!0;let a=this.texture;this.texture=[];for(let e=0;e=0?1:-1,i=1-n*n;if(i>number.epsilon){let a=math.sqrt(i),s=math.atan2(a,n*r);e=math.sin(e*s)/a,o=math.sin(o*s)/a}let a=o*r;if(l=l*e+d*a,u=u*e+p*a,c=c*e+f*a,h=h*e+m*a,e===1-o){let e=1/math.sqrt(l*l+u*u+c*c+h*h);l*=e,u*=e,c*=e,h*=e}}e[n]=l,e[n+1]=u,e[n+2]=c,e[n+3]=h}static multiplyquaternionsflat(e,n,r,i,a,s){let o=r[i],l=r[i+1],u=r[i+2],c=r[i+3],h=a[s],d=a[s+1],p=a[s+2],f=a[s+3];return e[n]=o*f+c*h+l*p-u*d,e[n+1]=l*f+c*d+u*h-o*p,e[n+2]=u*f+c*p+o*d-l*h,e[n+3]=c*f-o*h-l*d-u*p,e}get x(){return this._x}set x(e){this._x=e,this._onchangecallback()}get y(){return this._y}set y(e){this._y=e,this._onchangecallback()}get z(){return this._z}set z(e){this._z=e,this._onchangecallback()}get w(){return this._w}set w(e){this._w=e,this._onchangecallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onchangecallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onchangecallback(),this}setfromeuler(e,n){let r=e._x,i=e._y,a=e._z,s=e._order,o=math.cos,l=math.sin,u=o(r/2),c=o(i/2),h=o(a/2),d=l(r/2),p=l(i/2),f=l(a/2);switch(s){case"xyz":this._x=d*c*h+u*p*f,this._y=u*p*h-d*c*f,this._z=u*c*f+d*p*h,this._w=u*c*h-d*p*f;break;case"yxz":this._x=d*c*h+u*p*f,this._y=u*p*h-d*c*f,this._z=u*c*f-d*p*h,this._w=u*c*h+d*p*f;break;case"zxy":this._x=d*c*h-u*p*f,this._y=u*p*h+d*c*f,this._z=u*c*f+d*p*h,this._w=u*c*h-d*p*f;break;case"zyx":this._x=d*c*h-u*p*f,this._y=u*p*h+d*c*f,this._z=u*c*f-d*p*h,this._w=u*c*h+d*p*f;break;case"yzx":this._x=d*c*h+u*p*f,this._y=u*p*h+d*c*f,this._z=u*c*f-d*p*h,this._w=u*c*h-d*p*f;break;case"xzy":this._x=d*c*h-u*p*f,this._y=u*p*h-d*c*f,this._z=u*c*f+d*p*h,this._w=u*c*h+d*p*f;break;default:console.warn("three.quaternion: .setfromeuler() encountered an unknown order: "+s)}return!1!==n&&this._onchangecallback(),this}setfromaxisangle(e,n){let r=n/2,i=math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=math.cos(r),this._onchangecallback(),this}setfromrotationmatrix(e){let n=e.elements,r=n[0],i=n[4],a=n[8],s=n[1],o=n[5],l=n[9],u=n[2],c=n[6],h=n[10],d=r+o+h;if(d>0){let e=.5/math.sqrt(d+1);this._w=.25/e,this._x=(c-l)*e,this._y=(a-u)*e,this._z=(s-i)*e}else if(r>o&&r>h){let e=2*math.sqrt(1+r-o-h);this._w=(c-l)/e,this._x=.25*e,this._y=(i+s)/e,this._z=(a+u)/e}else if(o>h){let e=2*math.sqrt(1+o-r-h);this._w=(a-u)/e,this._x=(i+s)/e,this._y=.25*e,this._z=(l+c)/e}else{let e=2*math.sqrt(1+h-r-o);this._w=(s-i)/e,this._x=(a+u)/e,this._y=(l+c)/e,this._z=.25*e}return this._onchangecallback(),this}setfromunitvectors(e,n){let r=e.dot(n)+1;return rmath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleto(e){return 2*math.acos(math.abs(nu(this.dot(e),-1,1)))}rotatetowards(e,n){let r=this.angleto(e);return 0===r||this.slerp(e,math.min(1,n/r)),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onchangecallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthsq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onchangecallback(),this}multiply(e){return this.multiplyquaternions(this,e)}premultiply(e){return this.multiplyquaternions(e,this)}multiplyquaternions(e,n){let r=e._x,i=e._y,a=e._z,s=e._w,o=n._x,l=n._y,u=n._z,c=n._w;return this._x=r*c+s*o+i*u-a*l,this._y=i*c+s*l+a*o-r*u,this._z=a*c+s*u+r*l-i*o,this._w=s*c-r*o-i*l-a*u,this._onchangecallback(),this}slerp(e,n){if(0===n)return this;if(1===n)return this.copy(e);let r=this._x,i=this._y,a=this._z,s=this._w,o=s*e._w+r*e._x+i*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=r,this._y=i,this._z=a,this;let l=1-o*o;if(l<=number.epsilon){let e=1-n;return this._w=e*s+n*this._w,this._x=e*r+n*this._x,this._y=e*i+n*this._y,this._z=e*a+n*this._z,this.normalize(),this._onchangecallback(),this}let u=math.sqrt(l),c=math.atan2(u,o),h=math.sin((1-n)*c)/u,d=math.sin(n*c)/u;return this._w=s*h+this._w*d,this._x=r*h+this._x*d,this._y=i*h+this._y*d,this._z=a*h+this._z*d,this._onchangecallback(),this}slerpquaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){let e=math.random(),n=math.sqrt(1-e),r=math.sqrt(e),i=2*math.pi*math.random(),a=2*math.pi*math.random();return this.set(n*math.cos(i),r*math.sin(a),r*math.cos(a),n*math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromarray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onchangecallback(),this}toarray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}frombufferattribute(e,n){return this._x=e.getx(n),this._y=e.gety(n),this._z=e.getz(n),this._w=e.getw(n),this}_onchange(e){return this._onchangecallback=e,this}_onchangecallback(){}*[symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ny{constructor(e=0,n=0,r=0){ny.prototype.isvector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return void 0===r&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setscalar(e){return this.x=e,this.y=e,this.z=e,this}setx(e){return this.x=e,this}sety(e){return this.y=e,this}setz(e){return this.z=e,this}setcomponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw error("index is out of range: "+e)}return this}getcomponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addscalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addvectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addscaledvector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subscalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subvectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyscalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyvectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyeuler(e){return this.applyquaternion(nq.setfromeuler(e))}applyaxisangle(e,n){return this.applyquaternion(nq.setfromaxisangle(e,n))}applymatrix3(e){let n=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*n+a[3]*r+a[6]*i,this.y=a[1]*n+a[4]*r+a[7]*i,this.z=a[2]*n+a[5]*r+a[8]*i,this}applynormalmatrix(e){return this.applymatrix3(e).normalize()}applymatrix4(e){let n=this.x,r=this.y,i=this.z,a=e.elements,s=1/(a[3]*n+a[7]*r+a[11]*i+a[15]);return this.x=(a[0]*n+a[4]*r+a[8]*i+a[12])*s,this.y=(a[1]*n+a[5]*r+a[9]*i+a[13])*s,this.z=(a[2]*n+a[6]*r+a[10]*i+a[14])*s,this}applyquaternion(e){let n=this.x,r=this.y,i=this.z,a=e.x,s=e.y,o=e.z,l=e.w,u=l*n+s*i-o*r,c=l*r+o*n-a*i,h=l*i+a*r-s*n,d=-a*n-s*r-o*i;return this.x=u*l+-(d*a)+-(c*o)- -(h*s),this.y=c*l+-(d*s)+-(h*a)- -(u*o),this.z=h*l+-(d*o)+-(u*s)- -(c*a),this}project(e){return this.applymatrix4(e.matrixworldinverse).applymatrix4(e.projectionmatrix)}unproject(e){return this.applymatrix4(e.projectionmatrixinverse).applymatrix4(e.matrixworld)}transformdirection(e){let n=this.x,r=this.y,i=this.z,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i,this.y=a[1]*n+a[5]*r+a[9]*i,this.z=a[2]*n+a[6]*r+a[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}dividescalar(e){return this.multiplyscalar(1/e)}min(e){return this.x=math.min(this.x,e.x),this.y=math.min(this.y,e.y),this.z=math.min(this.z,e.z),this}max(e){return this.x=math.max(this.x,e.x),this.y=math.max(this.y,e.y),this.z=math.max(this.z,e.z),this}clamp(e,n){return this.x=math.max(e.x,math.min(n.x,this.x)),this.y=math.max(e.y,math.min(n.y,this.y)),this.z=math.max(e.z,math.min(n.z,this.z)),this}clampscalar(e,n){return this.x=math.max(e,math.min(n,this.x)),this.y=math.max(e,math.min(n,this.y)),this.z=math.max(e,math.min(n,this.z)),this}clamplength(e,n){let r=this.length();return this.dividescalar(r||1).multiplyscalar(math.max(e,math.min(n,r)))}floor(){return this.x=math.floor(this.x),this.y=math.floor(this.y),this.z=math.floor(this.z),this}ceil(){return this.x=math.ceil(this.x),this.y=math.ceil(this.y),this.z=math.ceil(this.z),this}round(){return this.x=math.round(this.x),this.y=math.round(this.y),this.z=math.round(this.z),this}roundtozero(){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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthsq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanlength(){return math.abs(this.x)+math.abs(this.y)+math.abs(this.z)}normalize(){return this.dividescalar(this.length()||1)}setlength(e){return this.normalize().multiplyscalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpvectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossvectors(this,e)}crossvectors(e,n){let r=e.x,i=e.y,a=e.z,s=n.x,o=n.y,l=n.z;return this.x=i*l-a*o,this.y=a*s-r*l,this.z=r*o-i*s,this}projectonvector(e){let n=e.lengthsq();if(0===n)return this.set(0,0,0);let r=e.dot(this)/n;return this.copy(e).multiplyscalar(r)}projectonplane(e){return nq.copy(this).projectonvector(e),this.sub(nq)}reflect(e){return this.sub(nq.copy(e).multiplyscalar(2*this.dot(e)))}angleto(e){let n=math.sqrt(this.lengthsq()*e.lengthsq());if(0===n)return math.pi/2;let r=this.dot(e)/n;return math.acos(nu(r,-1,1))}distanceto(e){return math.sqrt(this.distancetosquared(e))}distancetosquared(e){let n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattandistanceto(e){return math.abs(this.x-e.x)+math.abs(this.y-e.y)+math.abs(this.z-e.z)}setfromspherical(e){return this.setfromsphericalcoords(e.radius,e.phi,e.theta)}setfromsphericalcoords(e,n,r){let i=math.sin(n)*e;return this.x=i*math.sin(r),this.y=math.cos(n)*e,this.z=i*math.cos(r),this}setfromcylindrical(e){return this.setfromcylindricalcoords(e.radius,e.theta,e.y)}setfromcylindricalcoords(e,n,r){return this.x=e*math.sin(n),this.y=r,this.z=e*math.cos(n),this}setfrommatrixposition(e){let n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setfrommatrixscale(e){let n=this.setfrommatrixcolumn(e,0).length(),r=this.setfrommatrixcolumn(e,1).length(),i=this.setfrommatrixcolumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setfrommatrixcolumn(e,n){return this.fromarray(e.elements,4*n)}setfrommatrix3column(e,n){return this.fromarray(e.elements,3*n)}setfromeuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromarray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toarray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}frombufferattribute(e,n){return this.x=e.getx(n),this.y=e.gety(n),this.z=e.getz(n),this}random(){return this.x=math.random(),this.y=math.random(),this.z=math.random(),this}randomdirection(){let e=(math.random()-.5)*2,n=math.random()*math.pi*2,r=math.sqrt(1-e**2);return this.x=r*math.cos(n),this.y=r*math.sin(n),this.z=e,this}*[symbol.iterator](){yield this.x,yield this.y,yield this.z}}let nq=new ny,nq=new nk;class nz{constructor(e=new ny(infinity,infinity,infinity),n=new ny(-1/0,-1/0,-1/0)){this.isbox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setfromarray(e){let n=infinity,r=infinity,i=infinity,a=-1/0,s=-1/0,o=-1/0;for(let l=0,u=e.length;la&&(a=u),c>s&&(s=c),h>o&&(o=h)}return this.min.set(n,r,i),this.max.set(a,s,o),this}setfrombufferattribute(e){let n=infinity,r=infinity,i=infinity,a=-1/0,s=-1/0,o=-1/0;for(let l=0,u=e.count;la&&(a=u),c>s&&(s=c),h>o&&(o=h)}return this.min.set(n,r,i),this.max.set(a,s,o),this}setfrompoints(e){this.makeempty();for(let n=0,r=e.length;nthis.max.x)&&!(e.ythis.max.y)&&!(e.zthis.max.z)}containsbox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getparameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsbox(e){return!(e.max.xthis.max.x)&&!(e.max.ythis.max.y)&&!(e.max.zthis.max.z)}intersectssphere(e){return this.clamppoint(e.center,n0),n0.distancetosquared(e.center)<=e.radius*e.radius}intersectsplane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectstriangle(e){if(this.isempty())return!1;this.getcenter(n8),n7.subvectors(this.max,n8),n2.subvectors(e.a,n8),n3.subvectors(e.b,n8),n4.subvectors(e.c,n8),n6.subvectors(n3,n2),n5.subvectors(n4,n3),n9.subvectors(n2,n4);let n=[0,-n6.z,n6.y,0,-n5.z,n5.y,0,-n9.z,n9.y,n6.z,0,-n6.x,n5.z,0,-n5.x,n9.z,0,-n9.x,-n6.y,n6.x,0,-n5.y,n5.x,0,-n9.y,n9.x,0];return!!(rn(n,n2,n3,n4,n7)&&rn(n=[1,0,0,0,1,0,0,0,1],n2,n3,n4,n7))&&(re.crossvectors(n6,n5),rn(n=[re.x,re.y,re.z],n2,n3,n4,n7))}clamppoint(e,n){return n.copy(e).clamp(this.min,this.max)}distancetopoint(e){let n=n0.copy(e).clamp(this.min,this.max);return n.sub(e).length()}getboundingsphere(e){return this.getcenter(e.center),e.radius=.5*this.getsize(n0).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isempty()&&this.makeempty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applymatrix4(e){return this.isempty()||(n$[0].set(this.min.x,this.min.y,this.min.z).applymatrix4(e),n$[1].set(this.min.x,this.min.y,this.max.z).applymatrix4(e),n$[2].set(this.min.x,this.max.y,this.min.z).applymatrix4(e),n$[3].set(this.min.x,this.max.y,this.max.z).applymatrix4(e),n$[4].set(this.max.x,this.min.y,this.min.z).applymatrix4(e),n$[5].set(this.max.x,this.min.y,this.max.z).applymatrix4(e),n$[6].set(this.max.x,this.max.y,this.min.z).applymatrix4(e),n$[7].set(this.max.x,this.max.y,this.max.z).applymatrix4(e),this.setfrompoints(n$)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}let n$=[new ny,new ny,new ny,new ny,new ny,new ny,new ny,new ny],n0=new ny,n1=new nz,n2=new ny,n3=new ny,n4=new ny,n6=new ny,n5=new ny,n9=new ny,n8=new ny,n7=new ny,re=new ny,rt=new ny;function rn(e,n,r,i,a){for(let s=0,o=e.length-3;s<=o;s+=3){rt.fromarray(e,s);let o=a.x*math.abs(rt.x)+a.y*math.abs(rt.y)+a.z*math.abs(rt.z),l=n.dot(rt),u=r.dot(rt),c=i.dot(rt);if(math.max(-math.max(l,u,c),math.min(l,u,c))>o)return!1}return!0}let rr=new nz,ri=new ny,ra=new ny;class rs{constructor(e=new ny,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setfrompoints(e,n){let r=this.center;void 0!==n?r.copy(n):rr.setfrompoints(e).getcenter(r);let i=0;for(let n=0,a=e.length;nthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyscalar(this.radius).add(this.center)),n}getboundingbox(e){return this.isempty()?(e.makeempty(),e):(e.set(this.center,this.center),e.expandbyscalar(this.radius),e)}applymatrix4(e){return this.center.applymatrix4(e),this.radius=this.radius*e.getmaxscaleonaxis(),this}translate(e){return this.center.add(e),this}expandbypoint(e){if(this.isempty())return this.center.copy(e),this.radius=0,this;ri.subvectors(e,this.center);let n=ri.lengthsq();if(n>this.radius*this.radius){let e=math.sqrt(n),r=(e-this.radius)*.5;this.center.addscaledvector(ri,r/e),this.radius+=r}return this}union(e){return e.isempty()?this:this.isempty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=math.max(this.radius,e.radius):(ra.subvectors(e.center,this.center).setlength(e.radius),this.expandbypoint(ri.copy(e.center).add(ra)),this.expandbypoint(ri.copy(e.center).sub(ra))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}let ro=new ny,rl=new ny,ru=new ny,rc=new ny,rh=new ny,rd=new ny,rp=new ny;class rf{constructor(e=new ny,n=new ny(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.direction).multiplyscalar(e).add(this.origin)}lookat(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ro)),this}closestpointtopoint(e,n){n.subvectors(e,this.origin);let r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyscalar(r).add(this.origin)}distancetopoint(e){return math.sqrt(this.distancesqtopoint(e))}distancesqtopoint(e){let n=ro.subvectors(e,this.origin).dot(this.direction);return n<0?this.origin.distancetosquared(e):(ro.copy(this.direction).multiplyscalar(n).add(this.origin),ro.distancetosquared(e))}distancesqtosegment(e,n,r,i){let a,s,o,l;rl.copy(e).add(n).multiplyscalar(.5),ru.copy(n).sub(e).normalize(),rc.copy(this.origin).sub(rl);let u=.5*e.distanceto(n),c=-this.direction.dot(ru),h=rc.dot(this.direction),d=-rc.dot(ru),p=rc.lengthsq(),f=math.abs(1-c*c);if(f>0){if(a=c*d-h,s=c*h-d,l=u*f,a>=0){if(s>=-l){if(s<=l){let e=1/f;a*=e,s*=e,o=a*(a+c*s+2*h)+s*(c*a+s+2*d)+p}else o=-(a=math.max(0,-(c*(s=u)+h)))*a+s*(s+2*d)+p}else o=-(a=math.max(0,-(c*(s=-u)+h)))*a+s*(s+2*d)+p}else s<=-l?(s=(a=math.max(0,-(-c*u+h)))>0?-u:math.min(math.max(-u,-d),u),o=-a*a+s*(s+2*d)+p):s<=l?(a=0,o=(s=math.min(math.max(-u,-d),u))*(s+2*d)+p):(s=(a=math.max(0,-(c*u+h)))>0?u:math.min(math.max(-u,-d),u),o=-a*a+s*(s+2*d)+p)}else s=c>0?-u:u,o=-(a=math.max(0,-(c*s+h)))*a+s*(s+2*d)+p;return r&&r.copy(this.direction).multiplyscalar(a).add(this.origin),i&&i.copy(ru).multiplyscalar(s).add(rl),o}intersectsphere(e,n){ro.subvectors(e.center,this.origin);let r=ro.dot(this.direction),i=ro.dot(ro)-r*r,a=e.radius*e.radius;if(i>a)return null;let s=math.sqrt(a-i),o=r-s,l=r+s;return o<0&&l<0?null:o<0?this.at(l,n):this.at(o,n)}intersectssphere(e){return this.distancesqtopoint(e.center)<=e.radius*e.radius}distancetoplane(e){let n=e.normal.dot(this.direction);if(0===n)return 0===e.distancetopoint(this.origin)?0:null;let r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectplane(e,n){let r=this.distancetoplane(e);return null===r?null:this.at(r,n)}intersectsplane(e){let n=e.distancetopoint(this.origin);if(0===n)return!0;let r=e.normal.dot(this.direction);return r*n<0}intersectbox(e,n){let r,i,a,s,o,l;let u=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,d=this.origin;return(u>=0?(r=(e.min.x-d.x)*u,i=(e.max.x-d.x)*u):(r=(e.max.x-d.x)*u,i=(e.min.x-d.x)*u),c>=0?(a=(e.min.y-d.y)*c,s=(e.max.y-d.y)*c):(a=(e.max.y-d.y)*c,s=(e.min.y-d.y)*c),r>s||a>i)?null:((a>r||isnan(r))&&(r=a),(s=0?(o=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(o=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),r>l||o>i)?null:((o>r||r!=r)&&(r=o),(l=0?r:i,n)}intersectsbox(e){return null!==this.intersectbox(e,ro)}intersecttriangle(e,n,r,i,a){let s;rh.subvectors(n,e),rd.subvectors(r,e),rp.crossvectors(rh,rd);let o=this.direction.dot(rp);if(o>0){if(i)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}rc.subvectors(this.origin,e);let l=s*this.direction.dot(rd.crossvectors(rc,rd));if(l<0)return null;let u=s*this.direction.dot(rh.cross(rc));if(u<0||l+u>o)return null;let c=-s*rc.dot(rp);return c<0?null:this.at(c/o,a)}applymatrix4(e){return this.origin.applymatrix4(e),this.direction.transformdirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class rm{constructor(){rm.prototype.ismatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,n,r,i,a,s,o,l,u,c,h,d,p,f,m,g){let v=this.elements;return v[0]=e,v[4]=n,v[8]=r,v[12]=i,v[1]=a,v[5]=s,v[9]=o,v[13]=l,v[2]=u,v[6]=c,v[10]=h,v[14]=d,v[3]=p,v[7]=f,v[11]=m,v[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new rm().fromarray(this.elements)}copy(e){let n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyposition(e){let n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setfrommatrix3(e){let n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractbasis(e,n,r){return e.setfrommatrixcolumn(this,0),n.setfrommatrixcolumn(this,1),r.setfrommatrixcolumn(this,2),this}makebasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractrotation(e){let n=this.elements,r=e.elements,i=1/rg.setfrommatrixcolumn(e,0).length(),a=1/rg.setfrommatrixcolumn(e,1).length(),s=1/rg.setfrommatrixcolumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*a,n[5]=r[5]*a,n[6]=r[6]*a,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makerotationfromeuler(e){let n=this.elements,r=e.x,i=e.y,a=e.z,s=math.cos(r),o=math.sin(r),l=math.cos(i),u=math.sin(i),c=math.cos(a),h=math.sin(a);if("xyz"===e.order){let e=s*c,r=s*h,i=o*c,a=o*h;n[0]=l*c,n[4]=-l*h,n[8]=u,n[1]=r+i*u,n[5]=e-a*u,n[9]=-o*l,n[2]=a-e*u,n[6]=i+r*u,n[10]=s*l}else if("yxz"===e.order){let e=l*c,r=l*h,i=u*c,a=u*h;n[0]=e+a*o,n[4]=i*o-r,n[8]=s*u,n[1]=s*h,n[5]=s*c,n[9]=-o,n[2]=r*o-i,n[6]=a+e*o,n[10]=s*l}else if("zxy"===e.order){let e=l*c,r=l*h,i=u*c,a=u*h;n[0]=e-a*o,n[4]=-s*h,n[8]=i+r*o,n[1]=r+i*o,n[5]=s*c,n[9]=a-e*o,n[2]=-s*u,n[6]=o,n[10]=s*l}else if("zyx"===e.order){let e=s*c,r=s*h,i=o*c,a=o*h;n[0]=l*c,n[4]=i*u-r,n[8]=e*u+a,n[1]=l*h,n[5]=a*u+e,n[9]=r*u-i,n[2]=-u,n[6]=o*l,n[10]=s*l}else if("yzx"===e.order){let e=s*l,r=s*u,i=o*l,a=o*u;n[0]=l*c,n[4]=a-e*h,n[8]=i*h+r,n[1]=h,n[5]=s*c,n[9]=-o*c,n[2]=-u*c,n[6]=r*h+i,n[10]=e-a*h}else if("xzy"===e.order){let e=s*l,r=s*u,i=o*l,a=o*u;n[0]=l*c,n[4]=-h,n[8]=u*c,n[1]=e*h+a,n[5]=s*c,n[9]=r*h-i,n[2]=i*h-r,n[6]=o*c,n[10]=a*h+e}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makerotationfromquaternion(e){return this.compose(ry,e,rx)}lookat(e,n,r){let i=this.elements;return rb.subvectors(e,n),0===rb.lengthsq()&&(rb.z=1),rb.normalize(),r_.crossvectors(r,rb),0===r_.lengthsq()&&(1===math.abs(r.z)?rb.x+=1e-4:rb.z+=1e-4,rb.normalize(),r_.crossvectors(r,rb)),r_.normalize(),ra.crossvectors(rb,r_),i[0]=r_.x,i[4]=ra.x,i[8]=rb.x,i[1]=r_.y,i[5]=ra.y,i[9]=rb.y,i[2]=r_.z,i[6]=ra.z,i[10]=rb.z,this}multiply(e){return this.multiplymatrices(this,e)}premultiply(e){return this.multiplymatrices(e,this)}multiplymatrices(e,n){let r=e.elements,i=n.elements,a=this.elements,s=r[0],o=r[4],l=r[8],u=r[12],c=r[1],h=r[5],d=r[9],p=r[13],f=r[2],m=r[6],g=r[10],v=r[14],y=r[3],x=r[7],_=r[11],a=r[15],b=i[0],m=i[4],s=i[8],w=i[12],c=i[1],e=i[5],t=i[9],b=i[13],p=i[2],r=i[6],l=i[10],i=i[14],d=i[3],f=i[7],o=i[11],n=i[15];return a[0]=s*b+o*c+l*p+u*d,a[4]=s*m+o*e+l*r+u*f,a[8]=s*s+o*t+l*l+u*o,a[12]=s*w+o*b+l*i+u*n,a[1]=c*b+h*c+d*p+p*d,a[5]=c*m+h*e+d*r+p*f,a[9]=c*s+h*t+d*l+p*o,a[13]=c*w+h*b+d*i+p*n,a[2]=f*b+m*c+g*p+v*d,a[6]=f*m+m*e+g*r+v*f,a[10]=f*s+m*t+g*l+v*o,a[14]=f*w+m*b+g*i+v*n,a[3]=y*b+x*c+_*p+a*d,a[7]=y*m+x*e+_*r+a*f,a[11]=y*s+x*t+_*l+a*o,a[15]=y*w+x*b+_*i+a*n,this}multiplyscalar(e){let n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){let e=this.elements,n=e[0],r=e[4],i=e[8],a=e[12],s=e[1],o=e[5],l=e[9],u=e[13],c=e[2],h=e[6],d=e[10],p=e[14],f=e[3],m=e[7],g=e[11],v=e[15];return f*(+a*l*h-i*u*h-a*o*d+r*u*d+i*o*p-r*l*p)+m*(+n*l*p-n*u*d+a*s*d-i*s*p+i*u*c-a*l*c)+g*(+n*u*h-n*o*p-a*s*h+r*s*p+a*o*c-r*u*c)+v*(-i*o*c-n*l*h+n*o*d+i*s*h-r*s*d+r*l*c)}transpose(){let e;let n=this.elements;return e=n[1],n[1]=n[4],n[4]=e,e=n[2],n[2]=n[8],n[8]=e,e=n[6],n[6]=n[9],n[9]=e,e=n[3],n[3]=n[12],n[12]=e,e=n[7],n[7]=n[13],n[13]=e,e=n[11],n[11]=n[14],n[14]=e,this}setposition(e,n,r){let i=this.elements;return e.isvector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){let e=this.elements,n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],v=e[15],y=h*g*u-m*d*u+m*l*p-o*g*p-h*l*v+o*d*v,x=f*d*u-c*g*u-f*l*p+s*g*p+c*l*v-s*d*v,_=c*m*u-f*h*u+f*o*p-s*m*p-c*o*v+s*h*v,a=f*h*l-c*m*l-f*o*d+s*m*d+c*o*g-s*h*g,b=n*y+r*x+i*_+a*a;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let m=1/b;return e[0]=y*m,e[1]=(m*d*a-h*g*a-m*i*p+r*g*p+h*i*v-r*d*v)*m,e[2]=(o*g*a-m*l*a+m*i*u-r*g*u-o*i*v+r*l*v)*m,e[3]=(h*l*a-o*d*a-h*i*u+r*d*u+o*i*p-r*l*p)*m,e[4]=x*m,e[5]=(c*g*a-f*d*a+f*i*p-n*g*p-c*i*v+n*d*v)*m,e[6]=(f*l*a-s*g*a-f*i*u+n*g*u+s*i*v-n*l*v)*m,e[7]=(s*d*a-c*l*a+c*i*u-n*d*u-s*i*p+n*l*p)*m,e[8]=_*m,e[9]=(f*h*a-c*m*a-f*r*p+n*m*p+c*r*v-n*h*v)*m,e[10]=(s*m*a-f*o*a+f*r*u-n*m*u-s*r*v+n*o*v)*m,e[11]=(c*o*a-s*h*a-c*r*u+n*h*u+s*r*p-n*o*p)*m,e[12]=a*m,e[13]=(c*m*i-f*h*i+f*r*d-n*m*d-c*r*g+n*h*g)*m,e[14]=(f*o*i-s*m*i-f*r*l+n*m*l+s*r*g-n*o*g)*m,e[15]=(s*h*i-c*o*i+c*r*l-n*h*l-s*r*d+n*o*d)*m,this}scale(e){let n=this.elements,r=e.x,i=e.y,a=e.z;return n[0]*=r,n[4]*=i,n[8]*=a,n[1]*=r,n[5]*=i,n[9]*=a,n[2]*=r,n[6]*=i,n[10]*=a,n[3]*=r,n[7]*=i,n[11]*=a,this}getmaxscaleonaxis(){let e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return math.sqrt(math.max(n,r,i))}maketranslation(e,n,r){return this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makerotationx(e){let n=math.cos(e),r=math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makerotationy(e){let n=math.cos(e),r=math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makerotationz(e){let n=math.cos(e),r=math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makerotationaxis(e,n){let r=math.cos(n),i=math.sin(n),a=1-r,s=e.x,o=e.y,l=e.z,u=a*s,c=a*o;return this.set(u*s+r,u*o-i*l,u*l+i*o,0,u*o+i*l,c*o+r,c*l-i*s,0,u*l-i*o,c*l+i*s,a*l*l+r,0,0,0,0,1),this}makescale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeshear(e,n,r,i,a,s){return this.set(1,r,a,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){let i=this.elements,a=n._x,s=n._y,o=n._z,l=n._w,u=a+a,c=s+s,h=o+o,d=a*u,p=a*c,f=a*h,m=s*c,g=s*h,v=o*h,y=l*u,x=l*c,_=l*h,a=r.x,b=r.y,m=r.z;return i[0]=(1-(m+v))*a,i[1]=(p+_)*a,i[2]=(f-x)*a,i[3]=0,i[4]=(p-_)*b,i[5]=(1-(d+v))*b,i[6]=(g+y)*b,i[7]=0,i[8]=(f+x)*m,i[9]=(g-y)*m,i[10]=(1-(d+m))*m,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){let i=this.elements,a=rg.set(i[0],i[1],i[2]).length(),s=rg.set(i[4],i[5],i[6]).length(),o=rg.set(i[8],i[9],i[10]).length(),l=this.determinant();l<0&&(a=-a),e.x=i[12],e.y=i[13],e.z=i[14],rv.copy(this);let u=1/a,c=1/s,h=1/o;return rv.elements[0]*=u,rv.elements[1]*=u,rv.elements[2]*=u,rv.elements[4]*=c,rv.elements[5]*=c,rv.elements[6]*=c,rv.elements[8]*=h,rv.elements[9]*=h,rv.elements[10]*=h,n.setfromrotationmatrix(rv),r.x=a,r.y=s,r.z=o,this}makeperspective(e,n,r,i,a,s){let o=this.elements;return o[0]=2*a/(n-e),o[4]=0,o[8]=(n+e)/(n-e),o[12]=0,o[1]=0,o[5]=2*a/(r-i),o[9]=(r+i)/(r-i),o[13]=0,o[2]=0,o[6]=0,o[10]=-(s+a)/(s-a),o[14]=-2*s*a/(s-a),o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeorthographic(e,n,r,i,a,s){let o=this.elements,l=1/(n-e),u=1/(r-i),c=1/(s-a);return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-((n+e)*l),o[1]=0,o[5]=2*u,o[9]=0,o[13]=-((r+i)*u),o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-((s+a)*c),o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){let n=this.elements,r=e.elements;for(let e=0;e<16;e++)if(n[e]!==r[e])return!1;return!0}fromarray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toarray(e=[],n=0){let r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}let rg=new ny,rv=new rm,ry=new ny(0,0,0),rx=new ny(1,1,1),r_=new ny,ra=new ny,rb=new ny,rm=new rm,rs=new nk;class rw{constructor(e=0,n=0,r=0,i=rw.default_order){this.iseuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onchangecallback()}get y(){return this._y}set y(e){this._y=e,this._onchangecallback()}get z(){return this._z}set z(e){this._z=e,this._onchangecallback()}get order(){return this._order}set order(e){this._order=e,this._onchangecallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onchangecallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onchangecallback(),this}setfromrotationmatrix(e,n=this._order,r=!0){let i=e.elements,a=i[0],s=i[4],o=i[8],l=i[1],u=i[5],c=i[9],h=i[2],d=i[6],p=i[10];switch(n){case"xyz":this._y=math.asin(nu(o,-1,1)),.9999999>math.abs(o)?(this._x=math.atan2(-c,p),this._z=math.atan2(-s,a)):(this._x=math.atan2(d,u),this._z=0);break;case"yxz":this._x=math.asin(-nu(c,-1,1)),.9999999>math.abs(c)?(this._y=math.atan2(o,p),this._z=math.atan2(l,u)):(this._y=math.atan2(-h,a),this._z=0);break;case"zxy":this._x=math.asin(nu(d,-1,1)),.9999999>math.abs(d)?(this._y=math.atan2(-h,p),this._z=math.atan2(-s,u)):(this._y=0,this._z=math.atan2(l,a));break;case"zyx":this._y=math.asin(-nu(h,-1,1)),.9999999>math.abs(h)?(this._x=math.atan2(d,p),this._z=math.atan2(l,a)):(this._x=0,this._z=math.atan2(-s,u));break;case"yzx":this._z=math.asin(nu(l,-1,1)),.9999999>math.abs(l)?(this._x=math.atan2(-c,u),this._y=math.atan2(-h,a)):(this._x=0,this._y=math.atan2(o,p));break;case"xzy":this._z=math.asin(-nu(s,-1,1)),.9999999>math.abs(s)?(this._x=math.atan2(d,u),this._y=math.atan2(o,a)):(this._x=math.atan2(-c,p),this._y=0);break;default:console.warn("three.euler: .setfromrotationmatrix() encountered an unknown order: "+n)}return this._order=n,!0===r&&this._onchangecallback(),this}setfromquaternion(e,n,r){return rm.makerotationfromquaternion(e),this.setfromrotationmatrix(rm,n,r)}setfromvector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return rs.setfromeuler(this),this.setfromquaternion(rs,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromarray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onchangecallback(),this}toarray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onchange(e){return this._onchangecallback=e,this}_onchangecallback(){}*[symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}rw.default_order="xyz";class rc{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r=r.concat(a))}return r}getworldposition(e){return this.updateworldmatrix(!0,!1),e.setfrommatrixposition(this.matrixworld)}getworldquaternion(e){return this.updateworldmatrix(!0,!1),this.matrixworld.decompose(rl,e,ri),e}getworldscale(e){return this.updateworldmatrix(!0,!1),this.matrixworld.decompose(rl,rd,e),e}getworlddirection(e){this.updateworldmatrix(!0,!1);let n=this.matrixworld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);let n=this.children;for(let r=0,i=n.length;r0&&(i.userdata=this.userdata),i.layers=this.layers.mask,i.matrix=this.matrix.toarray(),!1===this.matrixautoupdate&&(i.matrixautoupdate=!1),this.isinstancedmesh&&(i.type="instancedmesh",i.count=this.count,i.instancematrix=this.instancematrix.tojson(),null!==this.instancecolor&&(i.instancecolor=this.instancecolor.tojson())),this.isscene)this.background&&(this.background.iscolor?i.background=this.background.tojson():this.background.istexture&&(i.background=this.background.tojson(e).uuid)),this.environment&&this.environment.istexture&&!0!==this.environment.isrendertargettexture&&(i.environment=this.environment.tojson(e).uuid);else if(this.ismesh||this.isline||this.ispoints){i.geometry=a(e.geometries,this.geometry);let n=this.geometry.parameters;if(void 0!==n&&void 0!==n.shapes){let r=n.shapes;if(array.isarray(r))for(let n=0,i=r.length;n0){i.children=[];for(let n=0;n0){i.animations=[];for(let n=0;n0&&(r.geometries=n),i.length>0&&(r.materials=i),a.length>0&&(r.textures=a),o.length>0&&(r.images=o),l.length>0&&(r.shapes=l),u.length>0&&(r.skeletons=u),c.length>0&&(r.animations=c),h.length>0&&(r.nodes=h)}return r.object=i,r;function s(e){let n=[];for(let r in e){let i=e[r];delete i.metadata,n.push(i)}return n}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixworld.copy(e.matrixworld),this.matrixautoupdate=e.matrixautoupdate,this.matrixworldneedsupdate=e.matrixworldneedsupdate,this.matrixworldautoupdate=e.matrixworldautoupdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castshadow=e.castshadow,this.receiveshadow=e.receiveshadow,this.frustumculled=e.frustumculled,this.renderorder=e.renderorder,this.userdata=json.parse(json.stringify(e.userdata)),!0===n)for(let n=0;n0?i.multiplyscalar(1/math.sqrt(a)):i.set(0,0,0)}static getbarycoord(e,n,r,i,a){ru.subvectors(i,n),rz.subvectors(r,n),rv.subvectors(e,n);let s=ru.dot(ru),o=ru.dot(rz),l=ru.dot(rv),u=rz.dot(rz),c=rz.dot(rv),h=s*u-o*o;if(0===h)return a.set(-2,-1,-1);let d=1/h,p=(u*l-o*c)*d,f=(s*c-o*l)*d;return a.set(1-p-f,f,p)}static containspoint(e,n,r,i){return this.getbarycoord(e,n,r,i,rj),rj.x>=0&&rj.y>=0&&rj.x+rj.y<=1}static getuv(e,n,r,i,a,s,o,l){return this.getbarycoord(e,n,r,i,rj),l.set(0,0),l.addscaledvector(a,rj.x),l.addscaledvector(s,rj.y),l.addscaledvector(o,rj.z),l}static isfrontfacing(e,n,r,i){return ru.subvectors(r,n),rz.subvectors(e,n),0>ru.cross(rz).dot(i)}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setfrompointsandindices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setfromattributeandindices(e,n,r,i){return this.a.frombufferattribute(e,n),this.b.frombufferattribute(e,r),this.c.frombufferattribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getarea(){return ru.subvectors(this.c,this.b),rz.subvectors(this.a,this.b),.5*ru.cross(rz).length()}getmidpoint(e){return e.addvectors(this.a,this.b).add(this.c).multiplyscalar(1/3)}getnormal(e){return rq.getnormal(this.a,this.b,this.c,e)}getplane(e){return e.setfromcoplanarpoints(this.a,this.b,this.c)}getbarycoord(e,n){return rq.getbarycoord(e,this.a,this.b,this.c,n)}getuv(e,n,r,i,a){return rq.getuv(e,this.a,this.b,this.c,n,r,i,a)}containspoint(e){return rq.containspoint(e,this.a,this.b,this.c)}isfrontfacing(e){return rq.isfrontfacing(this.a,this.b,this.c,e)}intersectsbox(e){return e.intersectstriangle(this)}closestpointtopoint(e,n){let r,i;let a=this.a,s=this.b,o=this.c;rw.subvectors(s,a),rj.subvectors(o,a),rk.subvectors(e,a);let l=rw.dot(rk),u=rj.dot(rk);if(l<=0&&u<=0)return n.copy(a);ry.subvectors(e,s);let c=rw.dot(ry),h=rj.dot(ry);if(c>=0&&h<=c)return n.copy(s);let d=l*h-c*u;if(d<=0&&l>=0&&c<=0)return r=l/(l-c),n.copy(a).addscaledvector(rw,r);rq.subvectors(e,o);let p=rw.dot(rq),f=rj.dot(rq);if(f>=0&&p<=f)return n.copy(o);let m=p*u-l*f;if(m<=0&&u>=0&&f<=0)return i=u/(u-f),n.copy(a).addscaledvector(rj,i);let g=c*f-p*h;if(g<=0&&h-c>=0&&p-f>=0)return rx.subvectors(o,s),i=(h-c)/(h-c+(p-f)),n.copy(s).addscaledvector(rx,i);let v=1/(g+m+d);return r=m*v,i=d*v,n.copy(a).addscaledvector(rw,r).addscaledvector(rj,i)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let rz=0;class r$ extends nr{constructor(){super(),this.ismaterial=!0,object.defineproperty(this,"id",{value:rz++}),this.uuid=nl(),this.name="",this.type="material",this.blending=w,this.side=_,this.vertexcolors=!1,this.opacity=1,this.transparent=!1,this.blendsrc=h,this.blenddst=g,this.blendequation=p,this.blendsrcalpha=null,this.blenddstalpha=null,this.blendequationalpha=null,this.depthfunc=y,this.depthtest=!0,this.depthwrite=!0,this.stencilwritemask=255,this.stencilfunc=t0,this.stencilref=0,this.stencilfuncmask=255,this.stencilfail=tg,this.stencilzfail=tg,this.stencilzpass=tg,this.stencilwrite=!1,this.clippingplanes=null,this.clipintersection=!1,this.clipshadows=!1,this.shadowside=null,this.colorwrite=!0,this.precision=null,this.polygonoffset=!1,this.polygonoffsetfactor=0,this.polygonoffsetunits=0,this.dithering=!1,this.alphatocoverage=!1,this.premultipliedalpha=!1,this.forcesinglepass=!1,this.visible=!0,this.tonemapped=!0,this.userdata={},this.version=0,this._alphatest=0}get alphatest(){return this._alphatest}set alphatest(e){this._alphatest>0!=e>0&&this.version++,this._alphatest=e}onbuild(){}onbeforerender(){}onbeforecompile(){}customprogramcachekey(){return this.onbeforecompile.tostring()}setvalues(e){if(void 0!==e)for(let n in e){let r=e[n];if(void 0===r){console.warn("three.material: '"+n+"' parameter is undefined.");continue}let i=this[n];if(void 0===i){console.warn("three."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.iscolor?i.set(r):i&&i.isvector3&&r&&r.isvector3?i.copy(r):this[n]=r}}tojson(e){let n=void 0===e||"string"==typeof e;n&&(e={textures:{},images:{}});let r={metadata:{version:4.5,type:"material",generator:"material.tojson"}};function i(e){let n=[];for(let r in e){let i=e[r];delete i.metadata,n.push(i)}return n}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.iscolor&&(r.color=this.color.gethex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheencolor&&this.sheencolor.iscolor&&(r.sheencolor=this.sheencolor.gethex()),void 0!==this.sheenroughness&&(r.sheenroughness=this.sheenroughness),this.emissive&&this.emissive.iscolor&&(r.emissive=this.emissive.gethex()),this.emissiveintensity&&1!==this.emissiveintensity&&(r.emissiveintensity=this.emissiveintensity),this.specular&&this.specular.iscolor&&(r.specular=this.specular.gethex()),void 0!==this.specularintensity&&(r.specularintensity=this.specularintensity),this.specularcolor&&this.specularcolor.iscolor&&(r.specularcolor=this.specularcolor.gethex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatroughness&&(r.clearcoatroughness=this.clearcoatroughness),this.clearcoatmap&&this.clearcoatmap.istexture&&(r.clearcoatmap=this.clearcoatmap.tojson(e).uuid),this.clearcoatroughnessmap&&this.clearcoatroughnessmap.istexture&&(r.clearcoatroughnessmap=this.clearcoatroughnessmap.tojson(e).uuid),this.clearcoatnormalmap&&this.clearcoatnormalmap.istexture&&(r.clearcoatnormalmap=this.clearcoatnormalmap.tojson(e).uuid,r.clearcoatnormalscale=this.clearcoatnormalscale.toarray()),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceior&&(r.iridescenceior=this.iridescenceior),void 0!==this.iridescencethicknessrange&&(r.iridescencethicknessrange=this.iridescencethicknessrange),this.iridescencemap&&this.iridescencemap.istexture&&(r.iridescencemap=this.iridescencemap.tojson(e).uuid),this.iridescencethicknessmap&&this.iridescencethicknessmap.istexture&&(r.iridescencethicknessmap=this.iridescencethicknessmap.tojson(e).uuid),this.map&&this.map.istexture&&(r.map=this.map.tojson(e).uuid),this.matcap&&this.matcap.istexture&&(r.matcap=this.matcap.tojson(e).uuid),this.alphamap&&this.alphamap.istexture&&(r.alphamap=this.alphamap.tojson(e).uuid),this.lightmap&&this.lightmap.istexture&&(r.lightmap=this.lightmap.tojson(e).uuid,r.lightmapintensity=this.lightmapintensity),this.aomap&&this.aomap.istexture&&(r.aomap=this.aomap.tojson(e).uuid,r.aomapintensity=this.aomapintensity),this.bumpmap&&this.bumpmap.istexture&&(r.bumpmap=this.bumpmap.tojson(e).uuid,r.bumpscale=this.bumpscale),this.normalmap&&this.normalmap.istexture&&(r.normalmap=this.normalmap.tojson(e).uuid,r.normalmaptype=this.normalmaptype,r.normalscale=this.normalscale.toarray()),this.displacementmap&&this.displacementmap.istexture&&(r.displacementmap=this.displacementmap.tojson(e).uuid,r.displacementscale=this.displacementscale,r.displacementbias=this.displacementbias),this.roughnessmap&&this.roughnessmap.istexture&&(r.roughnessmap=this.roughnessmap.tojson(e).uuid),this.metalnessmap&&this.metalnessmap.istexture&&(r.metalnessmap=this.metalnessmap.tojson(e).uuid),this.emissivemap&&this.emissivemap.istexture&&(r.emissivemap=this.emissivemap.tojson(e).uuid),this.specularmap&&this.specularmap.istexture&&(r.specularmap=this.specularmap.tojson(e).uuid),this.specularintensitymap&&this.specularintensitymap.istexture&&(r.specularintensitymap=this.specularintensitymap.tojson(e).uuid),this.specularcolormap&&this.specularcolormap.istexture&&(r.specularcolormap=this.specularcolormap.tojson(e).uuid),this.envmap&&this.envmap.istexture&&(r.envmap=this.envmap.tojson(e).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envmapintensity&&(r.envmapintensity=this.envmapintensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionratio&&(r.refractionratio=this.refractionratio),this.gradientmap&&this.gradientmap.istexture&&(r.gradientmap=this.gradientmap.tojson(e).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionmap&&this.transmissionmap.istexture&&(r.transmissionmap=this.transmissionmap.tojson(e).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessmap&&this.thicknessmap.istexture&&(r.thicknessmap=this.thicknessmap.tojson(e).uuid),void 0!==this.attenuationdistance&&this.attenuationdistance!==1/0&&(r.attenuationdistance=this.attenuationdistance),void 0!==this.attenuationcolor&&(r.attenuationcolor=this.attenuationcolor.gethex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowside&&(r.shadowside=this.shadowside),void 0!==this.sizeattenuation&&(r.sizeattenuation=this.sizeattenuation),this.blending!==w&&(r.blending=this.blending),this.side!==_&&(r.side=this.side),this.vertexcolors&&(r.vertexcolors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=this.transparent),r.depthfunc=this.depthfunc,r.depthtest=this.depthtest,r.depthwrite=this.depthwrite,r.colorwrite=this.colorwrite,r.stencilwrite=this.stencilwrite,r.stencilwritemask=this.stencilwritemask,r.stencilfunc=this.stencilfunc,r.stencilref=this.stencilref,r.stencilfuncmask=this.stencilfuncmask,r.stencilfail=this.stencilfail,r.stencilzfail=this.stencilzfail,r.stencilzpass=this.stencilzpass,void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonoffset&&(r.polygonoffset=!0),0!==this.polygonoffsetfactor&&(r.polygonoffsetfactor=this.polygonoffsetfactor),0!==this.polygonoffsetunits&&(r.polygonoffsetunits=this.polygonoffsetunits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashsize&&(r.dashsize=this.dashsize),void 0!==this.gapsize&&(r.gapsize=this.gapsize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphatest>0&&(r.alphatest=this.alphatest),!0===this.alphatocoverage&&(r.alphatocoverage=this.alphatocoverage),!0===this.premultipliedalpha&&(r.premultipliedalpha=this.premultipliedalpha),!0===this.forcesinglepass&&(r.forcesinglepass=this.forcesinglepass),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframelinewidth>1&&(r.wireframelinewidth=this.wireframelinewidth),"round"!==this.wireframelinecap&&(r.wireframelinecap=this.wireframelinecap),"round"!==this.wireframelinejoin&&(r.wireframelinejoin=this.wireframelinejoin),!0===this.flatshading&&(r.flatshading=this.flatshading),!1===this.visible&&(r.visible=!1),!1===this.tonemapped&&(r.tonemapped=!1),!1===this.fog&&(r.fog=!1),object.keys(this.userdata).length>0&&(r.userdata=this.userdata),n){let n=i(e.textures),a=i(e.images);n.length>0&&(r.textures=n),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexcolors=e.vertexcolors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendsrc=e.blendsrc,this.blenddst=e.blenddst,this.blendequation=e.blendequation,this.blendsrcalpha=e.blendsrcalpha,this.blenddstalpha=e.blenddstalpha,this.blendequationalpha=e.blendequationalpha,this.depthfunc=e.depthfunc,this.depthtest=e.depthtest,this.depthwrite=e.depthwrite,this.stencilwritemask=e.stencilwritemask,this.stencilfunc=e.stencilfunc,this.stencilref=e.stencilref,this.stencilfuncmask=e.stencilfuncmask,this.stencilfail=e.stencilfail,this.stencilzfail=e.stencilzfail,this.stencilzpass=e.stencilzpass,this.stencilwrite=e.stencilwrite;let n=e.clippingplanes,r=null;if(null!==n){let e=n.length;r=array(e);for(let i=0;i!==e;++i)r[i]=n[i].clone()}return this.clippingplanes=r,this.clipintersection=e.clipintersection,this.clipshadows=e.clipshadows,this.shadowside=e.shadowside,this.colorwrite=e.colorwrite,this.precision=e.precision,this.polygonoffset=e.polygonoffset,this.polygonoffsetfactor=e.polygonoffsetfactor,this.polygonoffsetunits=e.polygonoffsetunits,this.dithering=e.dithering,this.alphatest=e.alphatest,this.alphatocoverage=e.alphatocoverage,this.premultipliedalpha=e.premultipliedalpha,this.forcesinglepass=e.forcesinglepass,this.visible=e.visible,this.tonemapped=e.tonemapped,this.userdata=json.parse(json.stringify(e.userdata)),this}dispose(){this.dispatchevent({type:"dispose"})}set needsupdate(e){!0===e&&this.version++}}class r0 extends r${constructor(e){super(),this.ismeshbasicmaterial=!0,this.type="meshbasicmaterial",this.color=new nf(16777215),this.map=null,this.lightmap=null,this.lightmapintensity=1,this.aomap=null,this.aomapintensity=1,this.specularmap=null,this.alphamap=null,this.envmap=null,this.combine=ee,this.reflectivity=1,this.refractionratio=.98,this.wireframe=!1,this.wireframelinewidth=1,this.wireframelinecap="round",this.wireframelinejoin="round",this.fog=!0,this.setvalues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightmap=e.lightmap,this.lightmapintensity=e.lightmapintensity,this.aomap=e.aomap,this.aomapintensity=e.aomapintensity,this.specularmap=e.specularmap,this.alphamap=e.alphamap,this.envmap=e.envmap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionratio=e.refractionratio,this.wireframe=e.wireframe,this.wireframelinewidth=e.wireframelinewidth,this.wireframelinecap=e.wireframelinecap,this.wireframelinejoin=e.wireframelinejoin,this.fog=e.fog,this}}let r1=new ny,r2=new ny;class r3{constructor(e,n,r=!1){if(array.isarray(e))throw typeerror("three.bufferattribute: array should be a typed array.");this.isbufferattribute=!0,this.name="",this.array=e,this.itemsize=n,this.count=void 0!==e?e.length/n:0,this.normalized=r,this.usage=t1,this.updaterange={offset:0,count:-1},this.version=0}onuploadcallback(){}set needsupdate(e){!0===e&&this.version++}setusage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemsize=e.itemsize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyat(e,n,r){e*=this.itemsize,r*=n.itemsize;for(let i=0,a=this.itemsize;i0&&(e.userdata=this.userdata),void 0!==this.parameters){let n=this.parameters;for(let r in n)void 0!==n[r]&&(e[r]=n[r]);return e}e.data={attributes:{}};let n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:array.prototype.slice.call(n.array)});let r=this.attributes;for(let n in r){let i=r[n];e.data.attributes[n]=i.tojson(e.data)}let i={},a=!1;for(let n in this.morphattributes){let r=this.morphattributes[n],s=[];for(let n=0,i=r.length;n0&&(i[n]=s,a=!0)}a&&(e.data.morphattributes=i,e.data.morphtargetsrelative=this.morphtargetsrelative);let s=this.groups;s.length>0&&(e.data.groups=json.parse(json.stringify(s)));let o=this.boundingsphere;return null!==o&&(e.data.boundingsphere={center:o.center.toarray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphattributes={},this.groups=[],this.boundingbox=null,this.boundingsphere=null;let n={};this.name=e.name;let r=e.index;null!==r&&this.setindex(r.clone(n));let i=e.attributes;for(let e in i){let r=i[e];this.setattribute(e,r.clone(n))}let a=e.morphattributes;for(let e in a){let r=[],i=a[e];for(let e=0,a=i.length;e0){let e=n[r[0]];if(void 0!==e){this.morphtargetinfluences=[],this.morphtargetdictionary={};for(let n=0,r=e.length;nr.far?null:{distance:u,point:ic.clone(),object:e}}(e,n,r,i,iv,iy,ix,iw);if(c){a&&(ib.frombufferattribute(a,o),im.frombufferattribute(a,l),is.frombufferattribute(a,u),c.uv=rq.getuv(iw,iv,iy,ix,ib,im,is,new ny)),s&&(ib.frombufferattribute(s,o),im.frombufferattribute(s,l),is.frombufferattribute(s,u),c.uv2=rq.getuv(iw,iv,iy,ix,ib,im,is,new ny));let e={a:o,b:l,c:u,normal:new ny,materialindex:0};rq.getnormal(iv,iy,ix,e.normal),c.face=e}return c}class ib extends id{constructor(e=1,n=1,r=1,i=1,a=1,s=1){super(),this.type="boxgeometry",this.parameters={width:e,height:n,depth:r,widthsegments:i,heightsegments:a,depthsegments:s};let o=this;i=math.floor(i),a=math.floor(a),s=math.floor(s);let l=[],u=[],c=[],h=[],d=0,p=0;function f(e,n,r,i,a,s,f,m,g,v,y){let x=s/g,_=f/v,a=s/2,b=f/2,m=m/2,s=g+1,w=v+1,c=0,e=0,t=new ny;for(let s=0;s0?1:-1,c.push(t.x,t.y,t.z),h.push(l/g),h.push(1-s/v),c+=1}}for(let e=0;e0&&(n.defines=this.defines),n.vertexshader=this.vertexshader,n.fragmentshader=this.fragmentshader;let r={};for(let e in this.extensions)!0===this.extensions[e]&&(r[e]=!0);return object.keys(r).length>0&&(n.extensions=r),n}}class if extends rg{constructor(){super(),this.iscamera=!0,this.type="camera",this.matrixworldinverse=new rm,this.projectionmatrix=new rm,this.projectionmatrixinverse=new rm}copy(e,n){return super.copy(e,n),this.matrixworldinverse.copy(e.matrixworldinverse),this.projectionmatrix.copy(e.projectionmatrix),this.projectionmatrixinverse.copy(e.projectionmatrixinverse),this}getworlddirection(e){this.updateworldmatrix(!0,!1);let n=this.matrixworld.elements;return e.set(-n[8],-n[9],-n[10]).normalize()}updatematrixworld(e){super.updatematrixworld(e),this.matrixworldinverse.copy(this.matrixworld).invert()}updateworldmatrix(e,n){super.updateworldmatrix(e,n),this.matrixworldinverse.copy(this.matrixworld).invert()}clone(){return new this.constructor().copy(this)}}class io extends if{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isperspectivecamera=!0,this.type="perspectivecamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmgauge=35,this.filmoffset=0,this.updateprojectionmatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:object.assign({},e.view),this.filmgauge=e.filmgauge,this.filmoffset=e.filmoffset,this}setfocallength(e){let n=.5*this.getfilmheight()/e;this.fov=2*no*math.atan(n),this.updateprojectionmatrix()}getfocallength(){let e=math.tan(.5*ns*this.fov);return .5*this.getfilmheight()/e}geteffectivefov(){return 2*no*math.atan(math.tan(.5*ns*this.fov)/this.zoom)}getfilmwidth(){return this.filmgauge*math.min(this.aspect,1)}getfilmheight(){return this.filmgauge/math.max(this.aspect,1)}setviewoffset(e,n,r,i,a,s){this.aspect=e/n,null===this.view&&(this.view={enabled:!0,fullwidth:1,fullheight:1,offsetx:0,offsety:0,width:1,height:1}),this.view.enabled=!0,this.view.fullwidth=e,this.view.fullheight=n,this.view.offsetx=r,this.view.offsety=i,this.view.width=a,this.view.height=s,this.updateprojectionmatrix()}clearviewoffset(){null!==this.view&&(this.view.enabled=!1),this.updateprojectionmatrix()}updateprojectionmatrix(){let e=this.near,n=e*math.tan(.5*ns*this.fov)/this.zoom,r=2*n,i=this.aspect*r,a=-.5*i,s=this.view;if(null!==this.view&&this.view.enabled){let e=s.fullwidth,o=s.fullheight;a+=s.offsetx*i/e,n-=s.offsety*r/o,i*=s.width/e,r*=s.height/o}let o=this.filmoffset;0!==o&&(a+=e*o/this.getfilmwidth()),this.projectionmatrix.makeperspective(a,a+i,n,n-r,e,this.far),this.projectionmatrixinverse.copy(this.projectionmatrix).invert()}tojson(e){let n=super.tojson(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,null!==this.view&&(n.object.view=object.assign({},this.view)),n.object.filmgauge=this.filmgauge,n.object.filmoffset=this.filmoffset,n}}class in extends rg{constructor(e,n,r){super(),this.type="cubecamera",this.rendertarget=r;let i=new io(-90,1,e,n);i.layers=this.layers,i.up.set(0,1,0),i.lookat(1,0,0),this.add(i);let a=new io(-90,1,e,n);a.layers=this.layers,a.up.set(0,1,0),a.lookat(-1,0,0),this.add(a);let s=new io(-90,1,e,n);s.layers=this.layers,s.up.set(0,0,-1),s.lookat(0,1,0),this.add(s);let o=new io(-90,1,e,n);o.layers=this.layers,o.up.set(0,0,1),o.lookat(0,-1,0),this.add(o);let l=new io(-90,1,e,n);l.layers=this.layers,l.up.set(0,1,0),l.lookat(0,0,1),this.add(l);let u=new io(-90,1,e,n);u.layers=this.layers,u.up.set(0,1,0),u.lookat(0,0,-1),this.add(u)}update(e,n){null===this.parent&&this.updatematrixworld();let r=this.rendertarget,[i,a,s,o,l,u]=this.children,c=e.getrendertarget(),h=e.tonemapping,d=e.xr.enabled;e.tonemapping=er,e.xr.enabled=!1;let p=r.texture.generatemipmaps;r.texture.generatemipmaps=!1,e.setrendertarget(r,0),e.render(n,i),e.setrendertarget(r,1),e.render(n,a),e.setrendertarget(r,2),e.render(n,s),e.setrendertarget(r,3),e.render(n,o),e.setrendertarget(r,4),e.render(n,l),r.texture.generatemipmaps=p,e.setrendertarget(r,5),e.render(n,u),e.setrendertarget(c),e.tonemapping=h,e.xr.enabled=d,r.texture.needspmremupdate=!0}}class ik extends ng{constructor(e,n,r,i,a,s,o,l,u,c){super(e=void 0!==e?e:[],n=void 0!==n?n:ec,r,i,a,s,o,l,u,c),this.iscubetexture=!0,this.flipy=!1}get images(){return this.image}set images(e){this.image=e}}class ih extends nz{constructor(e=1,n={}){super(e,e,n),this.iswebglcuberendertarget=!0;let r={width:e,height:e,depth:1};this.texture=new ik([r,r,r,r,r,r],n.mapping,n.wraps,n.wrapt,n.magfilter,n.minfilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isrendertargettexture=!0,this.texture.generatemipmaps=void 0!==n.generatemipmaps&&n.generatemipmaps,this.texture.minfilter=void 0!==n.minfilter?n.minfilter:em}fromequirectangulartexture(e,n){this.texture.type=n.type,this.texture.encoding=n.encoding,this.texture.generatemipmaps=n.generatemipmaps,this.texture.minfilter=n.minfilter,this.texture.magfilter=n.magfilter;let r={uniforms:{tequirect:{value:null}},vertexshader:` varying vec3 vworlddirection; vec3 transformdirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vworlddirection = transformdirection( position, modelmatrix ); #include #include } `,fragmentshader:` uniform sampler2d tequirect; varying vec3 vworlddirection; #include void main() { vec3 direction = normalize( vworlddirection ); vec2 sampleuv = equirectuv( direction ); gl_fragcolor = texture2d( tequirect, sampleuv ); } `},i=new ib(5,5,5),a=new id({name:"cubemapfromequirect",uniforms:ip(r.uniforms),vertexshader:r.vertexshader,fragmentshader:r.fragmentshader,side:a,blending:s});a.uniforms.tequirect.value=n;let s=new ie(i,a),o=n.minfilter;n.minfilter===ec&&(n.minfilter=em);let l=new in(1,10,this);return l.update(e,s),n.minfilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,n,r,i){let a=e.getrendertarget();for(let a=0;a<6;a++)e.setrendertarget(this,a),e.clear(n,r,i);e.setrendertarget(a)}}let ig=new ny,iu=new ny,iz=new nx;class iv{constructor(e=new ny(1,0,0),n=0){this.isplane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setcomponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setfromnormalandcoplanarpoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setfromcoplanarpoints(e,n,r){let i=ig.subvectors(r,n).cross(iu.subvectors(e,n)).normalize();return this.setfromnormalandcoplanarpoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyscalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distancetopoint(e){return this.normal.dot(e)+this.constant}distancetosphere(e){return this.distancetopoint(e.center)-e.radius}projectpoint(e,n){return n.copy(this.normal).multiplyscalar(-this.distancetopoint(e)).add(e)}intersectline(e,n){let r=e.delta(ig),i=this.normal.dot(r);if(0===i)return 0===this.distancetopoint(e.start)?n.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return a<0||a>1?null:n.copy(r).multiplyscalar(a).add(e.start)}intersectsline(e){let n=this.distancetopoint(e.start),r=this.distancetopoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsbox(e){return e.intersectsplane(this)}intersectssphere(e){return e.intersectsplane(this)}coplanarpoint(e){return e.copy(this.normal).multiplyscalar(-this.constant)}applymatrix4(e,n){let r=n||iz.getnormalmatrix(e),i=this.coplanarpoint(ig).applymatrix4(e),a=this.normal.applymatrix3(r).normalize();return this.constant=-i.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}let ij=new rs,iw=new ny;class ij{constructor(e=new iv,n=new iv,r=new iv,i=new iv,a=new iv,s=new iv){this.planes=[e,n,r,i,a,s]}set(e,n,r,i,a,s){let o=this.planes;return o[0].copy(e),o[1].copy(n),o[2].copy(r),o[3].copy(i),o[4].copy(a),o[5].copy(s),this}copy(e){let n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setfromprojectionmatrix(e){let n=this.planes,r=e.elements,i=r[0],a=r[1],s=r[2],o=r[3],l=r[4],u=r[5],c=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15];return n[0].setcomponents(o-i,h-l,m-d,x-g).normalize(),n[1].setcomponents(o+i,h+l,m+d,x+g).normalize(),n[2].setcomponents(o+a,h+u,m+p,x+v).normalize(),n[3].setcomponents(o-a,h-u,m-p,x-v).normalize(),n[4].setcomponents(o-s,h-c,m-f,x-y).normalize(),n[5].setcomponents(o+s,h+c,m+f,x+y).normalize(),this}intersectsobject(e){let n=e.geometry;return null===n.boundingsphere&&n.computeboundingsphere(),ij.copy(n.boundingsphere).applymatrix4(e.matrixworld),this.intersectssphere(ij)}intersectssprite(e){return ij.center.set(0,0,0),ij.radius=.7071067811865476,ij.applymatrix4(e.matrixworld),this.intersectssphere(ij)}intersectssphere(e){let n=this.planes,r=e.center,i=-e.radius;for(let e=0;e<6;e++){let a=n[e].distancetopoint(r);if(a0?e.max.x:e.min.x,iw.y=i.normal.y>0?e.max.y:e.min.y,iw.z=i.normal.z>0?e.max.z:e.min.z,0>i.distancetopoint(iw))return!1}return!0}containspoint(e){let n=this.planes;for(let r=0;r<6;r++)if(0>n[r].distancetopoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}}function ix(){let e=null,n=!1,r=null,i=null;function a(n,s){r(n,s),i=e.requestanimationframe(a)}return{start:function(){!0!==n&&null!==r&&(i=e.requestanimationframe(a),n=!0)},stop:function(){e.cancelanimationframe(i),n=!1},setanimationloop:function(e){r=e},setcontext:function(n){e=n}}}function ik(e,n){let r=n.iswebgl2,i=new weakmap;return{get:function(e){return e.isinterleavedbufferattribute&&(e=e.data),i.get(e)},remove:function(n){n.isinterleavedbufferattribute&&(n=n.data);let r=i.get(n);r&&(e.deletebuffer(r.buffer),i.delete(n))},update:function(n,a){if(n.isglbufferattribute){let e=i.get(n);(!e||e.version 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 ltc_evaluate( const in vec3 n, const in vec3 v, const in vec3 p, const in mat3 minv, const in vec3 rectcoords[ 4 ] ) {\n vec3 v1 = rectcoords[ 1 ] - rectcoords[ 0 ];\n vec3 v2 = rectcoords[ 3 ] - rectcoords[ 0 ];\n vec3 lightnormal = cross( v1, v2 );\n if( dot( lightnormal, p - rectcoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 t1, t2;\n t1 = normalize( v - n * dot( v, n ) );\n t2 = - cross( n, t1 );\n mat3 mat = minv * transposemat3( mat3( t1, t2, n ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectcoords[ 0 ] - p );\n coords[ 1 ] = mat * ( rectcoords[ 1 ] - p );\n coords[ 2 ] = mat * ( rectcoords[ 2 ] - p );\n coords[ 3 ] = mat * ( rectcoords[ 3 ] - p );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorformfactor = vec3( 0.0 );\n vectorformfactor += ltc_edgevectorformfactor( coords[ 0 ], coords[ 1 ] );\n vectorformfactor += ltc_edgevectorformfactor( coords[ 1 ], coords[ 2 ] );\n vectorformfactor += ltc_edgevectorformfactor( coords[ 2 ], coords[ 3 ] );\n vectorformfactor += ltc_edgevectorformfactor( coords[ 3 ], coords[ 0 ] );\n float result = ltc_clippedsphereformfactor( vectorformfactor );\n return vec3( result );\n}\nfloat g_blinnphong_implicit( ) {\n return 0.25;\n}\nfloat d_blinnphong( const in float shininess, const in float dotnh ) {\n return reciprocal_pi * ( shininess * 0.5 + 1.0 ) * pow( dotnh, shininess );\n}\nvec3 brdf_blinnphong( const in vec3 lightdir, const in vec3 viewdir, const in vec3 normal, const in vec3 specularcolor, const in float shininess ) {\n vec3 halfdir = normalize( lightdir + viewdir );\n float dotnh = saturate( dot( normal, halfdir ) );\n float dotvh = saturate( dot( viewdir, halfdir ) );\n vec3 f = f_schlick( specularcolor, 1.0, dotvh );\n float g = g_blinnphong_implicit( );\n float d = d_blinnphong( shininess, dotnh );\n return f * ( g * d );\n}\n#if defined( use_sheen )\nfloat d_charlie( float roughness, float dotnh ) {\n float alpha = pow2( roughness );\n float invalpha = 1.0 / alpha;\n float cos2h = dotnh * dotnh;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invalpha ) * pow( sin2h, invalpha * 0.5 ) / ( 2.0 * pi );\n}\nfloat v_neubelt( float dotnv, float dotnl ) {\n return saturate( 1.0 / ( 4.0 * ( dotnl + dotnv - dotnl * dotnv ) ) );\n}\nvec3 brdf_sheen( const in vec3 lightdir, const in vec3 viewdir, const in vec3 normal, vec3 sheencolor, const in float sheenroughness ) {\n vec3 halfdir = normalize( lightdir + viewdir );\n float dotnl = saturate( dot( normal, lightdir ) );\n float dotnv = saturate( dot( normal, viewdir ) );\n float dotnh = saturate( dot( normal, halfdir ) );\n float d = d_charlie( sheenroughness, dotnh );\n float v = v_neubelt( dotnv, dotnl );\n return sheencolor * ( d * v );\n}\n#endif",iridescence_fragment:"#ifdef use_iridescence\n const mat3 xyz_to_rec709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 fresnel0toior( vec3 fresnel0 ) {\n vec3 sqrtf0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtf0 ) / ( vec3( 1.0 ) - sqrtf0 );\n }\n vec3 iortofresnel0( vec3 transmittedior, float incidentior ) {\n return pow2( ( transmittedior - vec3( incidentior ) ) / ( transmittedior + vec3( incidentior ) ) );\n }\n float iortofresnel0( float transmittedior, float incidentior ) {\n return pow2( ( transmittedior - incidentior ) / ( transmittedior + incidentior ));\n }\n vec3 evalsensitivity( float opd, vec3 shift ) {\n float phase = 2.0 * pi * opd * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * pi * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * pi * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = xyz_to_rec709 * xyz;\n return rgb;\n }\n vec3 evaliridescence( float outsideior, float eta2, float costheta1, float thinfilmthickness, vec3 basef0 ) {\n vec3 i;\n float iridescenceior = mix( outsideior, eta2, smoothstep( 0.0, 0.03, thinfilmthickness ) );\n float sintheta2sq = pow2( outsideior / iridescenceior ) * ( 1.0 - pow2( costheta1 ) );\n float costheta2sq = 1.0 - sintheta2sq;\n if ( costheta2sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float costheta2 = sqrt( costheta2sq );\n float r0 = iortofresnel0( iridescenceior, outsideior );\n float r12 = f_schlick( r0, 1.0, costheta1 );\n float r21 = r12;\n float t121 = 1.0 - r12;\n float phi12 = 0.0;\n if ( iridescenceior < outsideior ) phi12 = pi;\n float phi21 = pi - phi12;\n vec3 baseior = fresnel0toior( clamp( basef0, 0.0, 0.9999 ) ); vec3 r1 = iortofresnel0( baseior, iridescenceior );\n vec3 r23 = f_schlick( r1, 1.0, costheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseior[ 0 ] < iridescenceior ) phi23[ 0 ] = pi;\n if ( baseior[ 1 ] < iridescenceior ) phi23[ 1 ] = pi;\n if ( baseior[ 2 ] < iridescenceior ) phi23[ 2 ] = pi;\n float opd = 2.0 * iridescenceior * thinfilmthickness * costheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 r123 = clamp( r12 * r23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( r123 );\n vec3 rs = pow2( t121 ) * r23 / ( vec3( 1.0 ) - r123 );\n vec3 c0 = r12 + rs;\n i = c0;\n vec3 cm = rs - t121;\n for ( int m = 1; m <= 2; ++ m ) {\n cm *= r123;\n vec3 sm = 2.0 * evalsensitivity( float( m ) * opd, float( m ) * phi );\n i += cm * sm;\n }\n return max( i, vec3( 0.0 ) );\n }\n#endif",bumpmap_pars_fragment:"#ifdef use_bumpmap\n uniform sampler2d bumpmap;\n uniform float bumpscale;\n vec2 dhdxy_fwd() {\n vec2 dstdx = dfdx( vuv );\n vec2 dstdy = dfdy( vuv );\n float hll = bumpscale * texture2d( bumpmap, vuv ).x;\n float dbx = bumpscale * texture2d( bumpmap, vuv + dstdx ).x - hll;\n float dby = bumpscale * texture2d( bumpmap, vuv + dstdy ).x - hll;\n return vec2( dbx, dby );\n }\n vec3 perturbnormalarb( vec3 surf_pos, vec3 surf_norm, vec2 dhdxy, float facedirection ) {\n vec3 vsigmax = dfdx( surf_pos.xyz );\n vec3 vsigmay = dfdy( surf_pos.xyz );\n vec3 vn = surf_norm;\n vec3 r1 = cross( vsigmay, vn );\n vec3 r2 = cross( vn, vsigmax );\n float fdet = dot( vsigmax, r1 ) * facedirection;\n vec3 vgrad = sign( fdet ) * ( dhdxy.x * r1 + dhdxy.y * r2 );\n return normalize( abs( fdet ) * surf_norm - vgrad );\n }\n#endif",clipping_planes_fragment:"#if num_clipping_planes > 0\n vec4 plane;\n #pragma unroll_loop_start\n for ( int i = 0; i < union_clipping_planes; i ++ ) {\n plane = clippingplanes[ i ];\n if ( dot( vclipposition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if union_clipping_planes < num_clipping_planes\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = union_clipping_planes; i < num_clipping_planes; i ++ ) {\n plane = clippingplanes[ i ];\n clipped = ( dot( vclipposition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n#endif",clipping_planes_pars_fragment:"#if num_clipping_planes > 0\n varying vec3 vclipposition;\n uniform vec4 clippingplanes[ num_clipping_planes ];\n#endif",clipping_planes_pars_vertex:"#if num_clipping_planes > 0\n varying vec3 vclipposition;\n#endif",clipping_planes_vertex:"#if num_clipping_planes > 0\n vclipposition = - mvposition.xyz;\n#endif",color_fragment:"#if defined( use_color_alpha )\n diffusecolor *= vcolor;\n#elif defined( use_color )\n diffusecolor.rgb *= vcolor;\n#endif",color_pars_fragment:"#if defined( use_color_alpha )\n varying vec4 vcolor;\n#elif defined( use_color )\n varying vec3 vcolor;\n#endif",color_pars_vertex:"#if defined( use_color_alpha )\n varying vec4 vcolor;\n#elif defined( use_color ) || defined( use_instancing_color )\n varying vec3 vcolor;\n#endif",color_vertex:"#if defined( use_color_alpha )\n vcolor = vec4( 1.0 );\n#elif defined( use_color ) || defined( use_instancing_color )\n vcolor = vec3( 1.0 );\n#endif\n#ifdef use_color\n vcolor *= color;\n#endif\n#ifdef use_instancing_color\n vcolor.xyz *= instancecolor.xyz;\n#endif",common:"#define pi 3.141592653589793\n#define pi2 6.283185307179586\n#define pi_half 1.5707963267948966\n#define reciprocal_pi 0.3183098861837907\n#define reciprocal_pi2 0.15915494309189535\n#define epsilon 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whitecomplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, pi );\n return fract( sin( sn ) * c );\n}\n#ifdef high_precision\n float precisionsafelength( vec3 v ) { return length( v ); }\n#else\n float precisionsafelength( vec3 v ) {\n float maxcomponent = max3( abs( v ) );\n return length( v / maxcomponent ) * maxcomponent;\n }\n#endif\nstruct incidentlight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct reflectedlight {\n vec3 directdiffuse;\n vec3 directspecular;\n vec3 indirectdiffuse;\n vec3 indirectspecular;\n};\nstruct geometriccontext {\n vec3 position;\n vec3 normal;\n vec3 viewdir;\n#ifdef use_clearcoat\n vec3 clearcoatnormal;\n#endif\n};\nvec3 transformdirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inversetransformdirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposemat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n return dot( weights, rgb );\n}\nbool isperspectivematrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectuv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * reciprocal_pi2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * reciprocal_pi + 0.5;\n return vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef envmap_type_cube_uv\n #define cubeuv_minmiplevel 4.0\n #define cubeuv_mintilesize 16.0\n float getface( vec3 direction ) {\n vec3 absdirection = abs( direction );\n float face = - 1.0;\n if ( absdirection.x > absdirection.z ) {\n if ( absdirection.x > absdirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absdirection.z > absdirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getuv( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearcubeuv( sampler2d envmap, vec3 direction, float mipint ) {\n float face = getface( direction );\n float filterint = max( cubeuv_minmiplevel - mipint, 0.0 );\n mipint = max( mipint, cubeuv_minmiplevel );\n float facesize = exp2( mipint );\n highp vec2 uv = getuv( direction, face ) * ( facesize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += facesize;\n face -= 3.0;\n }\n uv.x += face * facesize;\n uv.x += filterint * 3.0 * cubeuv_mintilesize;\n uv.y += 4.0 * ( exp2( cubeuv_max_mip ) - facesize );\n uv.x *= cubeuv_texel_width;\n uv.y *= cubeuv_texel_height;\n #ifdef texture2dgradext\n return texture2dgradext( envmap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2d( envmap, uv ).rgb;\n #endif\n }\n #define cubeuv_r0 1.0\n #define cubeuv_v0 0.339\n #define cubeuv_m0 - 2.0\n #define cubeuv_r1 0.8\n #define cubeuv_v1 0.276\n #define cubeuv_m1 - 1.0\n #define cubeuv_r4 0.4\n #define cubeuv_v4 0.046\n #define cubeuv_m4 2.0\n #define cubeuv_r5 0.305\n #define cubeuv_v5 0.016\n #define cubeuv_m5 3.0\n #define cubeuv_r6 0.21\n #define cubeuv_v6 0.0038\n #define cubeuv_m6 4.0\n float roughnesstomip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeuv_r1 ) {\n mip = ( cubeuv_r0 - roughness ) * ( cubeuv_m1 - cubeuv_m0 ) / ( cubeuv_r0 - cubeuv_r1 ) + cubeuv_m0;\n } else if ( roughness >= cubeuv_r4 ) {\n mip = ( cubeuv_r1 - roughness ) * ( cubeuv_m4 - cubeuv_m1 ) / ( cubeuv_r1 - cubeuv_r4 ) + cubeuv_m1;\n } else if ( roughness >= cubeuv_r5 ) {\n mip = ( cubeuv_r4 - roughness ) * ( cubeuv_m5 - cubeuv_m4 ) / ( cubeuv_r4 - cubeuv_r5 ) + cubeuv_m4;\n } else if ( roughness >= cubeuv_r6 ) {\n mip = ( cubeuv_r5 - roughness ) * ( cubeuv_m6 - cubeuv_m5 ) / ( cubeuv_r5 - cubeuv_r6 ) + cubeuv_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 texturecubeuv( sampler2d envmap, vec3 sampledir, float roughness ) {\n float mip = clamp( roughnesstomip( roughness ), cubeuv_m0, cubeuv_max_mip );\n float mipf = fract( mip );\n float mipint = floor( mip );\n vec3 color0 = bilinearcubeuv( envmap, sampledir, mipint );\n if ( mipf == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearcubeuv( envmap, sampledir, mipint + 1.0 );\n return vec4( mix( color0, color1, mipf ), 1.0 );\n }\n }\n#endif",defaultnormal_vertex:"vec3 transformednormal = objectnormal;\n#ifdef use_instancing\n mat3 m = mat3( instancematrix );\n transformednormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n transformednormal = m * transformednormal;\n#endif\ntransformednormal = normalmatrix * transformednormal;\n#ifdef flip_sided\n transformednormal = - transformednormal;\n#endif\n#ifdef use_tangent\n vec3 transformedtangent = ( modelviewmatrix * vec4( objecttangent, 0.0 ) ).xyz;\n #ifdef flip_sided\n transformedtangent = - transformedtangent;\n #endif\n#endif",displacementmap_pars_vertex:"#ifdef use_displacementmap\n uniform sampler2d displacementmap;\n uniform float displacementscale;\n uniform float displacementbias;\n#endif",displacementmap_vertex:"#ifdef use_displacementmap\n transformed += normalize( objectnormal ) * ( texture2d( displacementmap, vuv ).x * displacementscale + displacementbias );\n#endif",emissivemap_fragment:"#ifdef use_emissivemap\n vec4 emissivecolor = texture2d( emissivemap, vuv );\n totalemissiveradiance *= emissivecolor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef use_emissivemap\n uniform sampler2d emissivemap;\n#endif",encodings_fragment:"gl_fragcolor = lineartooutputtexel( gl_fragcolor );",encodings_pars_fragment:"vec4 lineartolinear( in vec4 value ) {\n return value;\n}\nvec4 lineartosrgb( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessthanequal( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef use_envmap\n #ifdef env_worldpos\n vec3 cameratofrag;\n if ( isorthographic ) {\n cameratofrag = normalize( vec3( - viewmatrix[ 0 ][ 2 ], - viewmatrix[ 1 ][ 2 ], - viewmatrix[ 2 ][ 2 ] ) );\n } else {\n cameratofrag = normalize( vworldposition - cameraposition );\n }\n vec3 worldnormal = inversetransformdirection( normal, viewmatrix );\n #ifdef envmap_mode_reflection\n vec3 reflectvec = reflect( cameratofrag, worldnormal );\n #else\n vec3 reflectvec = refract( cameratofrag, worldnormal, refractionratio );\n #endif\n #else\n vec3 reflectvec = vreflect;\n #endif\n #ifdef envmap_type_cube\n vec4 envcolor = texturecube( envmap, vec3( flipenvmap * reflectvec.x, reflectvec.yz ) );\n #else\n vec4 envcolor = vec4( 0.0 );\n #endif\n #ifdef envmap_blending_multiply\n outgoinglight = mix( outgoinglight, outgoinglight * envcolor.xyz, specularstrength * reflectivity );\n #elif defined( envmap_blending_mix )\n outgoinglight = mix( outgoinglight, envcolor.xyz, specularstrength * reflectivity );\n #elif defined( envmap_blending_add )\n outgoinglight += envcolor.xyz * specularstrength * reflectivity;\n #endif\n#endif",envmap_common_pars_fragment:"#ifdef use_envmap\n uniform float envmapintensity;\n uniform float flipenvmap;\n #ifdef envmap_type_cube\n uniform samplercube envmap;\n #else\n uniform sampler2d envmap;\n #endif\n \n#endif",envmap_pars_fragment:"#ifdef use_envmap\n uniform float reflectivity;\n #if defined( use_bumpmap ) || defined( use_normalmap ) || defined( phong ) || defined( lambert )\n #define env_worldpos\n #endif\n #ifdef env_worldpos\n varying vec3 vworldposition;\n uniform float refractionratio;\n #else\n varying vec3 vreflect;\n #endif\n#endif",envmap_pars_vertex:"#ifdef use_envmap\n #if defined( use_bumpmap ) || defined( use_normalmap ) || defined( phong ) || defined( lambert )\n #define env_worldpos\n #endif\n #ifdef env_worldpos\n \n varying vec3 vworldposition;\n #else\n varying vec3 vreflect;\n uniform float refractionratio;\n #endif\n#endif",envmap_physical_pars_fragment:"#if defined( use_envmap )\n vec3 getiblirradiance( const in vec3 normal ) {\n #if defined( envmap_type_cube_uv )\n vec3 worldnormal = inversetransformdirection( normal, viewmatrix );\n vec4 envmapcolor = texturecubeuv( envmap, worldnormal, 1.0 );\n return pi * envmapcolor.rgb * envmapintensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getiblradiance( const in vec3 viewdir, const in vec3 normal, const in float roughness ) {\n #if defined( envmap_type_cube_uv )\n vec3 reflectvec = reflect( - viewdir, normal );\n reflectvec = normalize( mix( reflectvec, normal, roughness * roughness) );\n reflectvec = inversetransformdirection( reflectvec, viewmatrix );\n vec4 envmapcolor = texturecubeuv( envmap, reflectvec, roughness );\n return envmapcolor.rgb * envmapintensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n#endif",envmap_vertex:"#ifdef use_envmap\n #ifdef env_worldpos\n vworldposition = worldposition.xyz;\n #else\n vec3 cameratovertex;\n if ( isorthographic ) {\n cameratovertex = normalize( vec3( - viewmatrix[ 0 ][ 2 ], - viewmatrix[ 1 ][ 2 ], - viewmatrix[ 2 ][ 2 ] ) );\n } else {\n cameratovertex = normalize( worldposition.xyz - cameraposition );\n }\n vec3 worldnormal = inversetransformdirection( transformednormal, viewmatrix );\n #ifdef envmap_mode_reflection\n vreflect = reflect( cameratovertex, worldnormal );\n #else\n vreflect = refract( cameratovertex, worldnormal, refractionratio );\n #endif\n #endif\n#endif",fog_vertex:"#ifdef use_fog\n vfogdepth = - mvposition.z;\n#endif",fog_pars_vertex:"#ifdef use_fog\n varying float vfogdepth;\n#endif",fog_fragment:"#ifdef use_fog\n #ifdef fog_exp2\n float fogfactor = 1.0 - exp( - fogdensity * fogdensity * vfogdepth * vfogdepth );\n #else\n float fogfactor = smoothstep( fognear, fogfar, vfogdepth );\n #endif\n gl_fragcolor.rgb = mix( gl_fragcolor.rgb, fogcolor, fogfactor );\n#endif",fog_pars_fragment:"#ifdef use_fog\n uniform vec3 fogcolor;\n varying float vfogdepth;\n #ifdef fog_exp2\n uniform float fogdensity;\n #else\n uniform float fognear;\n uniform float fogfar;\n #endif\n#endif",gradientmap_pars_fragment:"#ifdef use_gradientmap\n uniform sampler2d gradientmap;\n#endif\nvec3 getgradientirradiance( vec3 normal, vec3 lightdirection ) {\n float dotnl = dot( normal, lightdirection );\n vec2 coord = vec2( dotnl * 0.5 + 0.5, 0.0 );\n #ifdef use_gradientmap\n return vec3( texture2d( gradientmap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",lightmap_fragment:"#ifdef use_lightmap\n vec4 lightmaptexel = texture2d( lightmap, vuv2 );\n vec3 lightmapirradiance = lightmaptexel.rgb * lightmapintensity;\n reflectedlight.indirectdiffuse += lightmapirradiance;\n#endif",lightmap_pars_fragment:"#ifdef use_lightmap\n uniform sampler2d lightmap;\n uniform float lightmapintensity;\n#endif",lights_lambert_fragment:"lambertmaterial material;\nmaterial.diffusecolor = diffusecolor.rgb;\nmaterial.specularstrength = specularstrength;",lights_lambert_pars_fragment:"varying vec3 vviewposition;\nstruct lambertmaterial {\n vec3 diffusecolor;\n float specularstrength;\n};\nvoid re_direct_lambert( const in incidentlight directlight, const in geometriccontext geometry, const in lambertmaterial material, inout reflectedlight reflectedlight ) {\n float dotnl = saturate( dot( geometry.normal, directlight.direction ) );\n vec3 irradiance = dotnl * directlight.color;\n reflectedlight.directdiffuse += irradiance * brdf_lambert( material.diffusecolor );\n}\nvoid re_indirectdiffuse_lambert( const in vec3 irradiance, const in geometriccontext geometry, const in lambertmaterial material, inout reflectedlight reflectedlight ) {\n reflectedlight.indirectdiffuse += irradiance * brdf_lambert( material.diffusecolor );\n}\n#define re_direct re_direct_lambert\n#define re_indirectdiffuse re_indirectdiffuse_lambert",lights_pars_begin:"uniform bool receiveshadow;\nuniform vec3 ambientlightcolor;\nuniform vec3 lightprobe[ 9 ];\nvec3 shgetirradianceat( in vec3 normal, in vec3 shcoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shcoefficients[ 0 ] * 0.886227;\n result += shcoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shcoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shcoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shcoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shcoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shcoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shcoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shcoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getlightprobeirradiance( const in vec3 lightprobe[ 9 ], const in vec3 normal ) {\n vec3 worldnormal = inversetransformdirection( normal, viewmatrix );\n vec3 irradiance = shgetirradianceat( worldnormal, lightprobe );\n return irradiance;\n}\nvec3 getambientlightirradiance( const in vec3 ambientlightcolor ) {\n vec3 irradiance = ambientlightcolor;\n return irradiance;\n}\nfloat getdistanceattenuation( const in float lightdistance, const in float cutoffdistance, const in float decayexponent ) {\n #if defined ( physically_correct_lights )\n float distancefalloff = 1.0 / max( pow( lightdistance, decayexponent ), 0.01 );\n if ( cutoffdistance > 0.0 ) {\n distancefalloff *= pow2( saturate( 1.0 - pow4( lightdistance / cutoffdistance ) ) );\n }\n return distancefalloff;\n #else\n if ( cutoffdistance > 0.0 && decayexponent > 0.0 ) {\n return pow( saturate( - lightdistance / cutoffdistance + 1.0 ), decayexponent );\n }\n return 1.0;\n #endif\n}\nfloat getspotattenuation( const in float conecosine, const in float penumbracosine, const in float anglecosine ) {\n return smoothstep( conecosine, penumbracosine, anglecosine );\n}\n#if num_dir_lights > 0\n struct directionallight {\n vec3 direction;\n vec3 color;\n };\n uniform directionallight directionallights[ num_dir_lights ];\n void getdirectionallightinfo( const in directionallight directionallight, const in geometriccontext geometry, out incidentlight light ) {\n light.color = directionallight.color;\n light.direction = directionallight.direction;\n light.visible = true;\n }\n#endif\n#if num_point_lights > 0\n struct pointlight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform pointlight pointlights[ num_point_lights ];\n void getpointlightinfo( const in pointlight pointlight, const in geometriccontext geometry, out incidentlight light ) {\n vec3 lvector = pointlight.position - geometry.position;\n light.direction = normalize( lvector );\n float lightdistance = length( lvector );\n light.color = pointlight.color;\n light.color *= getdistanceattenuation( lightdistance, pointlight.distance, pointlight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if num_spot_lights > 0\n struct spotlight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float conecos;\n float penumbracos;\n };\n uniform spotlight spotlights[ num_spot_lights ];\n void getspotlightinfo( const in spotlight spotlight, const in geometriccontext geometry, out incidentlight light ) {\n vec3 lvector = spotlight.position - geometry.position;\n light.direction = normalize( lvector );\n float anglecos = dot( light.direction, spotlight.direction );\n float spotattenuation = getspotattenuation( spotlight.conecos, spotlight.penumbracos, anglecos );\n if ( spotattenuation > 0.0 ) {\n float lightdistance = length( lvector );\n light.color = spotlight.color * spotattenuation;\n light.color *= getdistanceattenuation( lightdistance, spotlight.distance, spotlight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if num_rect_area_lights > 0\n struct rectarealight {\n vec3 color;\n vec3 position;\n vec3 halfwidth;\n vec3 halfheight;\n };\n uniform sampler2d ltc_1; uniform sampler2d ltc_2;\n uniform rectarealight rectarealights[ num_rect_area_lights ];\n#endif\n#if num_hemi_lights > 0\n struct hemispherelight {\n vec3 direction;\n vec3 skycolor;\n vec3 groundcolor;\n };\n uniform hemispherelight hemispherelights[ num_hemi_lights ];\n vec3 gethemispherelightirradiance( const in hemispherelight hemilight, const in vec3 normal ) {\n float dotnl = dot( normal, hemilight.direction );\n float hemidiffuseweight = 0.5 * dotnl + 0.5;\n vec3 irradiance = mix( hemilight.groundcolor, hemilight.skycolor, hemidiffuseweight );\n return irradiance;\n }\n#endif",lights_toon_fragment:"toonmaterial material;\nmaterial.diffusecolor = diffusecolor.rgb;",lights_toon_pars_fragment:"varying vec3 vviewposition;\nstruct toonmaterial {\n vec3 diffusecolor;\n};\nvoid re_direct_toon( const in incidentlight directlight, const in geometriccontext geometry, const in toonmaterial material, inout reflectedlight reflectedlight ) {\n vec3 irradiance = getgradientirradiance( geometry.normal, directlight.direction ) * directlight.color;\n reflectedlight.directdiffuse += irradiance * brdf_lambert( material.diffusecolor );\n}\nvoid re_indirectdiffuse_toon( const in vec3 irradiance, const in geometriccontext geometry, const in toonmaterial material, inout reflectedlight reflectedlight ) {\n reflectedlight.indirectdiffuse += irradiance * brdf_lambert( material.diffusecolor );\n}\n#define re_direct re_direct_toon\n#define re_indirectdiffuse re_indirectdiffuse_toon",lights_phong_fragment:"blinnphongmaterial material;\nmaterial.diffusecolor = diffusecolor.rgb;\nmaterial.specularcolor = specular;\nmaterial.specularshininess = shininess;\nmaterial.specularstrength = specularstrength;",lights_phong_pars_fragment:"varying vec3 vviewposition;\nstruct blinnphongmaterial {\n vec3 diffusecolor;\n vec3 specularcolor;\n float specularshininess;\n float specularstrength;\n};\nvoid re_direct_blinnphong( const in incidentlight directlight, const in geometriccontext geometry, const in blinnphongmaterial material, inout reflectedlight reflectedlight ) {\n float dotnl = saturate( dot( geometry.normal, directlight.direction ) );\n vec3 irradiance = dotnl * directlight.color;\n reflectedlight.directdiffuse += irradiance * brdf_lambert( material.diffusecolor );\n reflectedlight.directspecular += irradiance * brdf_blinnphong( directlight.direction, geometry.viewdir, geometry.normal, material.specularcolor, material.specularshininess ) * material.specularstrength;\n}\nvoid re_indirectdiffuse_blinnphong( const in vec3 irradiance, const in geometriccontext geometry, const in blinnphongmaterial material, inout reflectedlight reflectedlight ) {\n reflectedlight.indirectdiffuse += irradiance * brdf_lambert( material.diffusecolor );\n}\n#define re_direct re_direct_blinnphong\n#define re_indirectdiffuse re_indirectdiffuse_blinnphong",lights_physical_fragment:"physicalmaterial material;\nmaterial.diffusecolor = diffusecolor.rgb * ( 1.0 - metalnessfactor );\nvec3 dxy = max( abs( dfdx( geometrynormal ) ), abs( dfdy( geometrynormal ) ) );\nfloat geometryroughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessfactor, 0.0525 );material.roughness += geometryroughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef ior\n material.ior = ior;\n #ifdef specular\n float specularintensityfactor = specularintensity;\n vec3 specularcolorfactor = specularcolor;\n #ifdef use_specularintensitymap\n specularintensityfactor *= texture2d( specularintensitymap, vuv ).a;\n #endif\n #ifdef use_specularcolormap\n specularcolorfactor *= texture2d( specularcolormap, vuv ).rgb;\n #endif\n material.specularf90 = mix( specularintensityfactor, 1.0, metalnessfactor );\n #else\n float specularintensityfactor = 1.0;\n vec3 specularcolorfactor = vec3( 1.0 );\n material.specularf90 = 1.0;\n #endif\n material.specularcolor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularcolorfactor, vec3( 1.0 ) ) * specularintensityfactor, diffusecolor.rgb, metalnessfactor );\n#else\n material.specularcolor = mix( vec3( 0.04 ), diffusecolor.rgb, metalnessfactor );\n material.specularf90 = 1.0;\n#endif\n#ifdef use_clearcoat\n material.clearcoat = clearcoat;\n material.clearcoatroughness = clearcoatroughness;\n material.clearcoatf0 = vec3( 0.04 );\n material.clearcoatf90 = 1.0;\n #ifdef use_clearcoatmap\n material.clearcoat *= texture2d( clearcoatmap, vuv ).x;\n #endif\n #ifdef use_clearcoat_roughnessmap\n material.clearcoatroughness *= texture2d( clearcoatroughnessmap, vuv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatroughness = max( material.clearcoatroughness, 0.0525 );\n material.clearcoatroughness += geometryroughness;\n material.clearcoatroughness = min( material.clearcoatroughness, 1.0 );\n#endif\n#ifdef use_iridescence\n material.iridescence = iridescence;\n material.iridescenceior = iridescenceior;\n #ifdef use_iridescencemap\n material.iridescence *= texture2d( iridescencemap, vuv ).r;\n #endif\n #ifdef use_iridescence_thicknessmap\n material.iridescencethickness = (iridescencethicknessmaximum - iridescencethicknessminimum) * texture2d( iridescencethicknessmap, vuv ).g + iridescencethicknessminimum;\n #else\n material.iridescencethickness = iridescencethicknessmaximum;\n #endif\n#endif\n#ifdef use_sheen\n material.sheencolor = sheencolor;\n #ifdef use_sheencolormap\n material.sheencolor *= texture2d( sheencolormap, vuv ).rgb;\n #endif\n material.sheenroughness = clamp( sheenroughness, 0.07, 1.0 );\n #ifdef use_sheenroughnessmap\n material.sheenroughness *= texture2d( sheenroughnessmap, vuv ).a;\n #endif\n#endif",lights_physical_pars_fragment:"struct physicalmaterial {\n vec3 diffusecolor;\n float roughness;\n vec3 specularcolor;\n float specularf90;\n #ifdef use_clearcoat\n float clearcoat;\n float clearcoatroughness;\n vec3 clearcoatf0;\n float clearcoatf90;\n #endif\n #ifdef use_iridescence\n float iridescence;\n float iridescenceior;\n float iridescencethickness;\n vec3 iridescencefresnel;\n vec3 iridescencef0;\n #endif\n #ifdef use_sheen\n vec3 sheencolor;\n float sheenroughness;\n #endif\n #ifdef ior\n float ior;\n #endif\n #ifdef use_transmission\n float transmission;\n float transmissionalpha;\n float thickness;\n float attenuationdistance;\n vec3 attenuationcolor;\n #endif\n};\nvec3 clearcoatspecular = vec3( 0.0 );\nvec3 sheenspecular = vec3( 0.0 );\nfloat iblsheenbrdf( const in vec3 normal, const in vec3 viewdir, const in float roughness ) {\n float dotnv = saturate( dot( normal, viewdir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float dg = exp( a * dotnv + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( dg * reciprocal_pi );\n}\nvec2 dfgapprox( const in vec3 normal, const in vec3 viewdir, const in float roughness ) {\n float dotnv = saturate( dot( normal, viewdir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotnv ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 environmentbrdf( const in vec3 normal, const in vec3 viewdir, const in vec3 specularcolor, const in float specularf90, const in float roughness ) {\n vec2 fab = dfgapprox( normal, viewdir, roughness );\n return specularcolor * fab.x + specularf90 * fab.y;\n}\n#ifdef use_iridescence\nvoid computemultiscatteringiridescence( const in vec3 normal, const in vec3 viewdir, const in vec3 specularcolor, const in float specularf90, const in float iridescence, const in vec3 iridescencef0, const in float roughness, inout vec3 singlescatter, inout vec3 multiscatter ) {\n#else\nvoid computemultiscattering( const in vec3 normal, const in vec3 viewdir, const in vec3 specularcolor, const in float specularf90, const in float roughness, inout vec3 singlescatter, inout vec3 multiscatter ) {\n#endif\n vec2 fab = dfgapprox( normal, viewdir, roughness );\n #ifdef use_iridescence\n vec3 fr = mix( specularcolor, iridescencef0, iridescence );\n #else\n vec3 fr = specularcolor;\n #endif\n vec3 fssess = fr * fab.x + specularf90 * fab.y;\n float ess = fab.x + fab.y;\n float ems = 1.0 - ess;\n vec3 favg = fr + ( 1.0 - fr ) * 0.047619; vec3 fms = fssess * favg / ( 1.0 - ems * favg );\n singlescatter += fssess;\n multiscatter += fms * ems;\n}\n#if num_rect_area_lights > 0\n void re_direct_rectarea_physical( const in rectarealight rectarealight, const in geometriccontext geometry, const in physicalmaterial material, inout reflectedlight reflectedlight ) {\n vec3 normal = geometry.normal;\n vec3 viewdir = geometry.viewdir;\n vec3 position = geometry.position;\n vec3 lightpos = rectarealight.position;\n vec3 halfwidth = rectarealight.halfwidth;\n vec3 halfheight = rectarealight.halfheight;\n vec3 lightcolor = rectarealight.color;\n float roughness = material.roughness;\n vec3 rectcoords[ 4 ];\n rectcoords[ 0 ] = lightpos + halfwidth - halfheight; rectcoords[ 1 ] = lightpos - halfwidth - halfheight;\n rectcoords[ 2 ] = lightpos - halfwidth + halfheight;\n rectcoords[ 3 ] = lightpos + halfwidth + halfheight;\n vec2 uv = ltc_uv( normal, viewdir, roughness );\n vec4 t1 = texture2d( ltc_1, uv );\n vec4 t2 = texture2d( ltc_2, uv );\n mat3 minv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularcolor * t2.x + ( vec3( 1.0 ) - material.specularcolor ) * t2.y );\n reflectedlight.directspecular += lightcolor * fresnel * ltc_evaluate( normal, viewdir, position, minv, rectcoords );\n reflectedlight.directdiffuse += lightcolor * material.diffusecolor * ltc_evaluate( normal, viewdir, position, mat3( 1.0 ), rectcoords );\n }\n#endif\nvoid re_direct_physical( const in incidentlight directlight, const in geometriccontext geometry, const in physicalmaterial material, inout reflectedlight reflectedlight ) {\n float dotnl = saturate( dot( geometry.normal, directlight.direction ) );\n vec3 irradiance = dotnl * directlight.color;\n #ifdef use_clearcoat\n float dotnlcc = saturate( dot( geometry.clearcoatnormal, directlight.direction ) );\n vec3 ccirradiance = dotnlcc * directlight.color;\n clearcoatspecular += ccirradiance * brdf_ggx( directlight.direction, geometry.viewdir, geometry.clearcoatnormal, material.clearcoatf0, material.clearcoatf90, material.clearcoatroughness );\n #endif\n #ifdef use_sheen\n sheenspecular += irradiance * brdf_sheen( directlight.direction, geometry.viewdir, geometry.normal, material.sheencolor, material.sheenroughness );\n #endif\n #ifdef use_iridescence\n reflectedlight.directspecular += irradiance * brdf_ggx_iridescence( directlight.direction, geometry.viewdir, geometry.normal, material.specularcolor, material.specularf90, material.iridescence, material.iridescencefresnel, material.roughness );\n #else\n reflectedlight.directspecular += irradiance * brdf_ggx( directlight.direction, geometry.viewdir, geometry.normal, material.specularcolor, material.specularf90, material.roughness );\n #endif\n reflectedlight.directdiffuse += irradiance * brdf_lambert( material.diffusecolor );\n}\nvoid re_indirectdiffuse_physical( const in vec3 irradiance, const in geometriccontext geometry, const in physicalmaterial material, inout reflectedlight reflectedlight ) {\n reflectedlight.indirectdiffuse += irradiance * brdf_lambert( material.diffusecolor );\n}\nvoid re_indirectspecular_physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatradiance, const in geometriccontext geometry, const in physicalmaterial material, inout reflectedlight reflectedlight) {\n #ifdef use_clearcoat\n clearcoatspecular += clearcoatradiance * environmentbrdf( geometry.clearcoatnormal, geometry.viewdir, material.clearcoatf0, material.clearcoatf90, material.clearcoatroughness );\n #endif\n #ifdef use_sheen\n sheenspecular += irradiance * material.sheencolor * iblsheenbrdf( geometry.normal, geometry.viewdir, material.sheenroughness );\n #endif\n vec3 singlescattering = vec3( 0.0 );\n vec3 multiscattering = vec3( 0.0 );\n vec3 cosineweightedirradiance = irradiance * reciprocal_pi;\n #ifdef use_iridescence\n computemultiscatteringiridescence( geometry.normal, geometry.viewdir, material.specularcolor, material.specularf90, material.iridescence, material.iridescencefresnel, material.roughness, singlescattering, multiscattering );\n #else\n computemultiscattering( geometry.normal, geometry.viewdir, material.specularcolor, material.specularf90, material.roughness, singlescattering, multiscattering );\n #endif\n vec3 totalscattering = singlescattering + multiscattering;\n vec3 diffuse = material.diffusecolor * ( 1.0 - max( max( totalscattering.r, totalscattering.g ), totalscattering.b ) );\n reflectedlight.indirectspecular += radiance * singlescattering;\n reflectedlight.indirectspecular += multiscattering * cosineweightedirradiance;\n reflectedlight.indirectdiffuse += diffuse * cosineweightedirradiance;\n}\n#define re_direct re_direct_physical\n#define re_direct_rectarea re_direct_rectarea_physical\n#define re_indirectdiffuse re_indirectdiffuse_physical\n#define re_indirectspecular re_indirectspecular_physical\nfloat computespecularocclusion( const in float dotnv, const in float ambientocclusion, const in float roughness ) {\n return saturate( pow( dotnv + ambientocclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientocclusion );\n}",lights_fragment_begin:"\ngeometriccontext geometry;\ngeometry.position = - vviewposition;\ngeometry.normal = normal;\ngeometry.viewdir = ( isorthographic ) ? vec3( 0, 0, 1 ) : normalize( vviewposition );\n#ifdef use_clearcoat\n geometry.clearcoatnormal = clearcoatnormal;\n#endif\n#ifdef use_iridescence\n float dotnvi = saturate( dot( normal, geometry.viewdir ) );\n if ( material.iridescencethickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescencefresnel = evaliridescence( 1.0, material.iridescenceior, dotnvi, material.iridescencethickness, material.specularcolor );\n material.iridescencef0 = schlick_to_f0( material.iridescencefresnel, 1.0, dotnvi );\n }\n#endif\nincidentlight directlight;\n#if ( num_point_lights > 0 ) && defined( re_direct )\n pointlight pointlight;\n #if defined( use_shadowmap ) && num_point_light_shadows > 0\n pointlightshadow pointlightshadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < num_point_lights; i ++ ) {\n pointlight = pointlights[ i ];\n getpointlightinfo( pointlight, geometry, directlight );\n #if defined( use_shadowmap ) && ( unrolled_loop_index < num_point_light_shadows )\n pointlightshadow = pointlightshadows[ i ];\n directlight.color *= ( directlight.visible && receiveshadow ) ? getpointshadow( pointshadowmap[ i ], pointlightshadow.shadowmapsize, pointlightshadow.shadowbias, pointlightshadow.shadowradius, vpointshadowcoord[ i ], pointlightshadow.shadowcameranear, pointlightshadow.shadowcamerafar ) : 1.0;\n #endif\n re_direct( directlight, geometry, material, reflectedlight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( num_spot_lights > 0 ) && defined( re_direct )\n spotlight spotlight;\n vec4 spotcolor;\n vec3 spotlightcoord;\n bool inspotlightmap;\n #if defined( use_shadowmap ) && num_spot_light_shadows > 0\n spotlightshadow spotlightshadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < num_spot_lights; i ++ ) {\n spotlight = spotlights[ i ];\n getspotlightinfo( spotlight, geometry, directlight );\n #if ( unrolled_loop_index < num_spot_light_shadows_with_maps )\n #define spot_light_map_index unrolled_loop_index\n #elif ( unrolled_loop_index < num_spot_light_shadows )\n #define spot_light_map_index num_spot_light_maps\n #else\n #define spot_light_map_index ( unrolled_loop_index - num_spot_light_shadows + num_spot_light_shadows_with_maps )\n #endif\n #if ( spot_light_map_index < num_spot_light_maps )\n spotlightcoord = vspotlightcoord[ i ].xyz / vspotlightcoord[ i ].w;\n inspotlightmap = all( lessthan( abs( spotlightcoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotcolor = texture2d( spotlightmap[ spot_light_map_index ], spotlightcoord.xy );\n directlight.color = inspotlightmap ? directlight.color * spotcolor.rgb : directlight.color;\n #endif\n #undef spot_light_map_index\n #if defined( use_shadowmap ) && ( unrolled_loop_index < num_spot_light_shadows )\n spotlightshadow = spotlightshadows[ i ];\n directlight.color *= ( directlight.visible && receiveshadow ) ? getshadow( spotshadowmap[ i ], spotlightshadow.shadowmapsize, spotlightshadow.shadowbias, spotlightshadow.shadowradius, vspotlightcoord[ i ] ) : 1.0;\n #endif\n re_direct( directlight, geometry, material, reflectedlight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( num_dir_lights > 0 ) && defined( re_direct )\n directionallight directionallight;\n #if defined( use_shadowmap ) && num_dir_light_shadows > 0\n directionallightshadow directionallightshadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < num_dir_lights; i ++ ) {\n directionallight = directionallights[ i ];\n getdirectionallightinfo( directionallight, geometry, directlight );\n #if defined( use_shadowmap ) && ( unrolled_loop_index < num_dir_light_shadows )\n directionallightshadow = directionallightshadows[ i ];\n directlight.color *= ( directlight.visible && receiveshadow ) ? getshadow( directionalshadowmap[ i ], directionallightshadow.shadowmapsize, directionallightshadow.shadowbias, directionallightshadow.shadowradius, vdirectionalshadowcoord[ i ] ) : 1.0;\n #endif\n re_direct( directlight, geometry, material, reflectedlight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( num_rect_area_lights > 0 ) && defined( re_direct_rectarea )\n rectarealight rectarealight;\n #pragma unroll_loop_start\n for ( int i = 0; i < num_rect_area_lights; i ++ ) {\n rectarealight = rectarealights[ i ];\n re_direct_rectarea( rectarealight, geometry, material, reflectedlight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( re_indirectdiffuse )\n vec3 iblirradiance = vec3( 0.0 );\n vec3 irradiance = getambientlightirradiance( ambientlightcolor );\n irradiance += getlightprobeirradiance( lightprobe, geometry.normal );\n #if ( num_hemi_lights > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < num_hemi_lights; i ++ ) {\n irradiance += gethemispherelightirradiance( hemispherelights[ i ], geometry.normal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( re_indirectspecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatradiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( re_indirectdiffuse )\n #ifdef use_lightmap\n vec4 lightmaptexel = texture2d( lightmap, vuv2 );\n vec3 lightmapirradiance = lightmaptexel.rgb * lightmapintensity;\n irradiance += lightmapirradiance;\n #endif\n #if defined( use_envmap ) && defined( standard ) && defined( envmap_type_cube_uv )\n iblirradiance += getiblirradiance( geometry.normal );\n #endif\n#endif\n#if defined( use_envmap ) && defined( re_indirectspecular )\n radiance += getiblradiance( geometry.viewdir, geometry.normal, material.roughness );\n #ifdef use_clearcoat\n clearcoatradiance += getiblradiance( geometry.viewdir, geometry.clearcoatnormal, material.clearcoatroughness );\n #endif\n#endif",lights_fragment_end:"#if defined( re_indirectdiffuse )\n re_indirectdiffuse( irradiance, geometry, material, reflectedlight );\n#endif\n#if defined( re_indirectspecular )\n re_indirectspecular( radiance, iblirradiance, clearcoatradiance, geometry, material, reflectedlight );\n#endif",logdepthbuf_fragment:"#if defined( use_logdepthbuf ) && defined( use_logdepthbuf_ext )\n gl_fragdepthext = visperspective == 0.0 ? gl_fragcoord.z : log2( vfragdepth ) * logdepthbuffc * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( use_logdepthbuf ) && defined( use_logdepthbuf_ext )\n uniform float logdepthbuffc;\n varying float vfragdepth;\n varying float visperspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef use_logdepthbuf\n #ifdef use_logdepthbuf_ext\n varying float vfragdepth;\n varying float visperspective;\n #else\n uniform float logdepthbuffc;\n #endif\n#endif",logdepthbuf_vertex:"#ifdef use_logdepthbuf\n #ifdef use_logdepthbuf_ext\n vfragdepth = 1.0 + gl_position.w;\n visperspective = float( isperspectivematrix( projectionmatrix ) );\n #else\n if ( isperspectivematrix( projectionmatrix ) ) {\n gl_position.z = log2( max( epsilon, gl_position.w + 1.0 ) ) * logdepthbuffc - 1.0;\n gl_position.z *= gl_position.w;\n }\n #endif\n#endif",map_fragment:"#ifdef use_map\n vec4 sampleddiffusecolor = texture2d( map, vuv );\n #ifdef decode_video_texture\n sampleddiffusecolor = vec4( mix( pow( sampleddiffusecolor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampleddiffusecolor.rgb * 0.0773993808, vec3( lessthanequal( sampleddiffusecolor.rgb, vec3( 0.04045 ) ) ) ), sampleddiffusecolor.w );\n #endif\n diffusecolor *= sampleddiffusecolor;\n#endif",map_pars_fragment:"#ifdef use_map\n uniform sampler2d map;\n#endif",map_particle_fragment:"#if defined( use_map ) || defined( use_alphamap )\n vec2 uv = ( uvtransform * vec3( gl_pointcoord.x, 1.0 - gl_pointcoord.y, 1 ) ).xy;\n#endif\n#ifdef use_map\n diffusecolor *= texture2d( map, uv );\n#endif\n#ifdef use_alphamap\n diffusecolor.a *= texture2d( alphamap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( use_map ) || defined( use_alphamap )\n uniform mat3 uvtransform;\n#endif\n#ifdef use_map\n uniform sampler2d map;\n#endif\n#ifdef use_alphamap\n uniform sampler2d alphamap;\n#endif",metalnessmap_fragment:"float metalnessfactor = metalness;\n#ifdef use_metalnessmap\n vec4 texelmetalness = texture2d( metalnessmap, vuv );\n metalnessfactor *= texelmetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef use_metalnessmap\n uniform sampler2d metalnessmap;\n#endif",morphcolor_vertex:"#if defined( use_morphcolors ) && defined( morphtargets_texture )\n vcolor *= morphtargetbaseinfluence;\n for ( int i = 0; i < morphtargets_count; i ++ ) {\n #if defined( use_color_alpha )\n if ( morphtargetinfluences[ i ] != 0.0 ) vcolor += getmorph( gl_vertexid, i, 2 ) * morphtargetinfluences[ i ];\n #elif defined( use_color )\n if ( morphtargetinfluences[ i ] != 0.0 ) vcolor += getmorph( gl_vertexid, i, 2 ).rgb * morphtargetinfluences[ i ];\n #endif\n }\n#endif",morphnormal_vertex:"#ifdef use_morphnormals\n objectnormal *= morphtargetbaseinfluence;\n #ifdef morphtargets_texture\n for ( int i = 0; i < morphtargets_count; i ++ ) {\n if ( morphtargetinfluences[ i ] != 0.0 ) objectnormal += getmorph( gl_vertexid, i, 1 ).xyz * morphtargetinfluences[ i ];\n }\n #else\n objectnormal += morphnormal0 * morphtargetinfluences[ 0 ];\n objectnormal += morphnormal1 * morphtargetinfluences[ 1 ];\n objectnormal += morphnormal2 * morphtargetinfluences[ 2 ];\n objectnormal += morphnormal3 * morphtargetinfluences[ 3 ];\n #endif\n#endif",morphtarget_pars_vertex:"#ifdef use_morphtargets\n uniform float morphtargetbaseinfluence;\n #ifdef morphtargets_texture\n uniform float morphtargetinfluences[ morphtargets_count ];\n uniform sampler2darray morphtargetstexture;\n uniform ivec2 morphtargetstexturesize;\n vec4 getmorph( const in int vertexindex, const in int morphtargetindex, const in int offset ) {\n int texelindex = vertexindex * morphtargets_texture_stride + offset;\n int y = texelindex / morphtargetstexturesize.x;\n int x = texelindex - y * morphtargetstexturesize.x;\n ivec3 morphuv = ivec3( x, y, morphtargetindex );\n return texelfetch( morphtargetstexture, morphuv, 0 );\n }\n #else\n #ifndef use_morphnormals\n uniform float morphtargetinfluences[ 8 ];\n #else\n uniform float morphtargetinfluences[ 4 ];\n #endif\n #endif\n#endif",morphtarget_vertex:"#ifdef use_morphtargets\n transformed *= morphtargetbaseinfluence;\n #ifdef morphtargets_texture\n for ( int i = 0; i < morphtargets_count; i ++ ) {\n if ( morphtargetinfluences[ i ] != 0.0 ) transformed += getmorph( gl_vertexid, i, 0 ).xyz * morphtargetinfluences[ i ];\n }\n #else\n transformed += morphtarget0 * morphtargetinfluences[ 0 ];\n transformed += morphtarget1 * morphtargetinfluences[ 1 ];\n transformed += morphtarget2 * morphtargetinfluences[ 2 ];\n transformed += morphtarget3 * morphtargetinfluences[ 3 ];\n #ifndef use_morphnormals\n transformed += morphtarget4 * morphtargetinfluences[ 4 ];\n transformed += morphtarget5 * morphtargetinfluences[ 5 ];\n transformed += morphtarget6 * morphtargetinfluences[ 6 ];\n transformed += morphtarget7 * morphtargetinfluences[ 7 ];\n #endif\n #endif\n#endif",normal_fragment_begin:"float facedirection = gl_frontfacing ? 1.0 : - 1.0;\n#ifdef flat_shaded\n vec3 fdx = dfdx( vviewposition );\n vec3 fdy = dfdy( vviewposition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vnormal );\n #ifdef double_sided\n normal = normal * facedirection;\n #endif\n #ifdef use_tangent\n vec3 tangent = normalize( vtangent );\n vec3 bitangent = normalize( vbitangent );\n #ifdef double_sided\n tangent = tangent * facedirection;\n bitangent = bitangent * facedirection;\n #endif\n #if defined( tangentspace_normalmap ) || defined( use_clearcoat_normalmap )\n mat3 vtbn = mat3( tangent, bitangent, normal );\n #endif\n #endif\n#endif\nvec3 geometrynormal = normal;",normal_fragment_maps:"#ifdef objectspace_normalmap\n normal = texture2d( normalmap, vuv ).xyz * 2.0 - 1.0;\n #ifdef flip_sided\n normal = - normal;\n #endif\n #ifdef double_sided\n normal = normal * facedirection;\n #endif\n normal = normalize( normalmatrix * normal );\n#elif defined( tangentspace_normalmap )\n vec3 mapn = texture2d( normalmap, vuv ).xyz * 2.0 - 1.0;\n mapn.xy *= normalscale;\n #ifdef use_tangent\n normal = normalize( vtbn * mapn );\n #else\n normal = perturbnormal2arb( - vviewposition, normal, mapn, facedirection );\n #endif\n#elif defined( use_bumpmap )\n normal = perturbnormalarb( - vviewposition, normal, dhdxy_fwd(), facedirection );\n#endif",normal_pars_fragment:"#ifndef flat_shaded\n varying vec3 vnormal;\n #ifdef use_tangent\n varying vec3 vtangent;\n varying vec3 vbitangent;\n #endif\n#endif",normal_pars_vertex:"#ifndef flat_shaded\n varying vec3 vnormal;\n #ifdef use_tangent\n varying vec3 vtangent;\n varying vec3 vbitangent;\n #endif\n#endif",normal_vertex:"#ifndef flat_shaded\n vnormal = normalize( transformednormal );\n #ifdef use_tangent\n vtangent = normalize( transformedtangent );\n vbitangent = normalize( cross( vnormal, vtangent ) * tangent.w );\n #endif\n#endif",normalmap_pars_fragment:"#ifdef use_normalmap\n uniform sampler2d normalmap;\n uniform vec2 normalscale;\n#endif\n#ifdef objectspace_normalmap\n uniform mat3 normalmatrix;\n#endif\n#if ! defined ( use_tangent ) && ( defined ( tangentspace_normalmap ) || defined ( use_clearcoat_normalmap ) )\n vec3 perturbnormal2arb( vec3 eye_pos, vec3 surf_norm, vec3 mapn, float facedirection ) {\n vec3 q0 = dfdx( eye_pos.xyz );\n vec3 q1 = dfdy( eye_pos.xyz );\n vec2 st0 = dfdx( vuv.st );\n vec2 st1 = dfdy( vuv.st );\n vec3 n = surf_norm;\n vec3 q1perp = cross( q1, n );\n vec3 q0perp = cross( n, q0 );\n vec3 t = q1perp * st0.x + q0perp * st1.x;\n vec3 b = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( t, t ), dot( b, b ) );\n float scale = ( det == 0.0 ) ? 0.0 : facedirection * inversesqrt( det );\n return normalize( t * ( mapn.x * scale ) + b * ( mapn.y * scale ) + n * mapn.z );\n }\n#endif",clearcoat_normal_fragment_begin:"#ifdef use_clearcoat\n vec3 clearcoatnormal = geometrynormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef use_clearcoat_normalmap\n vec3 clearcoatmapn = texture2d( clearcoatnormalmap, vuv ).xyz * 2.0 - 1.0;\n clearcoatmapn.xy *= clearcoatnormalscale;\n #ifdef use_tangent\n clearcoatnormal = normalize( vtbn * clearcoatmapn );\n #else\n clearcoatnormal = perturbnormal2arb( - vviewposition, clearcoatnormal, clearcoatmapn, facedirection );\n #endif\n#endif",clearcoat_pars_fragment:"#ifdef use_clearcoatmap\n uniform sampler2d clearcoatmap;\n#endif\n#ifdef use_clearcoat_roughnessmap\n uniform sampler2d clearcoatroughnessmap;\n#endif\n#ifdef use_clearcoat_normalmap\n uniform sampler2d clearcoatnormalmap;\n uniform vec2 clearcoatnormalscale;\n#endif",iridescence_pars_fragment:"#ifdef use_iridescencemap\n uniform sampler2d iridescencemap;\n#endif\n#ifdef use_iridescence_thicknessmap\n uniform sampler2d iridescencethicknessmap;\n#endif",output_fragment:"#ifdef opaque\ndiffusecolor.a = 1.0;\n#endif\n#ifdef use_transmission\ndiffusecolor.a *= material.transmissionalpha + 0.1;\n#endif\ngl_fragcolor = vec4( outgoinglight, diffusecolor.a );",packing:"vec3 packnormaltorgb( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackrgbtonormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float packupscale = 256. / 255.;const float unpackdownscale = 255. / 256.;\nconst vec3 packfactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 unpackfactors = unpackdownscale / vec4( packfactors, 1. );\nconst float shiftright8 = 1. / 256.;\nvec4 packdepthtorgba( const in float v ) {\n vec4 r = vec4( fract( v * packfactors ), v );\n r.yzw -= r.xyz * shiftright8; return r * packupscale;\n}\nfloat unpackrgbatodepth( const in vec4 v ) {\n return dot( v, unpackfactors );\n}\nvec2 packdepthtorg( in highp float v ) {\n return packdepthtorgba( v ).yx;\n}\nfloat unpackrgtodepth( const in highp vec2 v ) {\n return unpackrgbatodepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2halftorgba( vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackrgbato2half( vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewztoorthographicdepth( const in float viewz, const in float near, const in float far ) {\n return ( viewz + near ) / ( near - far );\n}\nfloat orthographicdepthtoviewz( const in float linearclipz, const in float near, const in float far ) {\n return linearclipz * ( near - far ) - near;\n}\nfloat viewztoperspectivedepth( const in float viewz, const in float near, const in float far ) {\n return ( ( near + viewz ) * far ) / ( ( far - near ) * viewz );\n}\nfloat perspectivedepthtoviewz( const in float invclipz, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invclipz - far );\n}",premultiplied_alpha_fragment:"#ifdef premultiplied_alpha\n gl_fragcolor.rgb *= gl_fragcolor.a;\n#endif",project_vertex:"vec4 mvposition = vec4( transformed, 1.0 );\n#ifdef use_instancing\n mvposition = instancematrix * mvposition;\n#endif\nmvposition = modelviewmatrix * mvposition;\ngl_position = projectionmatrix * mvposition;",dithering_fragment:"#ifdef dithering\n gl_fragcolor.rgb = dithering( gl_fragcolor.rgb );\n#endif",dithering_pars_fragment:"#ifdef dithering\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_fragcoord.xy );\n vec3 dither_shift_rgb = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_rgb = mix( 2.0 * dither_shift_rgb, -2.0 * dither_shift_rgb, grid_position );\n return color + dither_shift_rgb;\n }\n#endif",roughnessmap_fragment:"float roughnessfactor = roughness;\n#ifdef use_roughnessmap\n vec4 texelroughness = texture2d( roughnessmap, vuv );\n roughnessfactor *= texelroughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef use_roughnessmap\n uniform sampler2d roughnessmap;\n#endif",shadowmap_pars_fragment:"#if num_spot_light_coords > 0\n varying vec4 vspotlightcoord[ num_spot_light_coords ];\n#endif\n#if num_spot_light_maps > 0\n uniform sampler2d spotlightmap[ num_spot_light_maps ];\n#endif\n#ifdef use_shadowmap\n #if num_dir_light_shadows > 0\n uniform sampler2d directionalshadowmap[ num_dir_light_shadows ];\n varying vec4 vdirectionalshadowcoord[ num_dir_light_shadows ];\n struct directionallightshadow {\n float shadowbias;\n float shadownormalbias;\n float shadowradius;\n vec2 shadowmapsize;\n };\n uniform directionallightshadow directionallightshadows[ num_dir_light_shadows ];\n #endif\n #if num_spot_light_shadows > 0\n uniform sampler2d spotshadowmap[ num_spot_light_shadows ];\n struct spotlightshadow {\n float shadowbias;\n float shadownormalbias;\n float shadowradius;\n vec2 shadowmapsize;\n };\n uniform spotlightshadow spotlightshadows[ num_spot_light_shadows ];\n #endif\n #if num_point_light_shadows > 0\n uniform sampler2d pointshadowmap[ num_point_light_shadows ];\n varying vec4 vpointshadowcoord[ num_point_light_shadows ];\n struct pointlightshadow {\n float shadowbias;\n float shadownormalbias;\n float shadowradius;\n vec2 shadowmapsize;\n float shadowcameranear;\n float shadowcamerafar;\n };\n uniform pointlightshadow pointlightshadows[ num_point_light_shadows ];\n #endif\n float texture2dcompare( sampler2d depths, vec2 uv, float compare ) {\n return step( compare, unpackrgbatodepth( texture2d( depths, uv ) ) );\n }\n vec2 texture2ddistribution( sampler2d shadow, vec2 uv ) {\n return unpackrgbato2half( texture2d( shadow, uv ) );\n }\n float vsmshadow (sampler2d shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2ddistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getshadow( sampler2d shadowmap, vec2 shadowmapsize, float shadowbias, float shadowradius, vec4 shadowcoord ) {\n float shadow = 1.0;\n shadowcoord.xyz /= shadowcoord.w;\n shadowcoord.z += shadowbias;\n bool infrustum = shadowcoord.x >= 0.0 && shadowcoord.x <= 1.0 && shadowcoord.y >= 0.0 && shadowcoord.y <= 1.0;\n bool frustumtest = infrustum && shadowcoord.z <= 1.0;\n if ( frustumtest ) {\n #if defined( shadowmap_type_pcf )\n vec2 texelsize = vec2( 1.0 ) / shadowmapsize;\n float dx0 = - texelsize.x * shadowradius;\n float dy0 = - texelsize.y * shadowradius;\n float dx1 = + texelsize.x * shadowradius;\n float dy1 = + texelsize.y * shadowradius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx0, dy0 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( 0.0, dy0 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx1, dy0 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx2, dy2 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( 0.0, dy2 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx3, dy2 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx0, 0.0 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx2, 0.0 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy, shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx3, 0.0 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx1, 0.0 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx2, dy3 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( 0.0, dy3 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx3, dy3 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx0, dy1 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( 0.0, dy1 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, shadowcoord.xy + vec2( dx1, dy1 ), shadowcoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( shadowmap_type_pcf_soft )\n vec2 texelsize = vec2( 1.0 ) / shadowmapsize;\n float dx = texelsize.x;\n float dy = texelsize.y;\n vec2 uv = shadowcoord.xy;\n vec2 f = fract( uv * shadowmapsize + 0.5 );\n uv -= f * texelsize;\n shadow = (\n texture2dcompare( shadowmap, uv, shadowcoord.z ) +\n texture2dcompare( shadowmap, uv + vec2( dx, 0.0 ), shadowcoord.z ) +\n texture2dcompare( shadowmap, uv + vec2( 0.0, dy ), shadowcoord.z ) +\n texture2dcompare( shadowmap, uv + texelsize, shadowcoord.z ) +\n mix( texture2dcompare( shadowmap, uv + vec2( -dx, 0.0 ), shadowcoord.z ),\n texture2dcompare( shadowmap, uv + vec2( 2.0 * dx, 0.0 ), shadowcoord.z ),\n f.x ) +\n mix( texture2dcompare( shadowmap, uv + vec2( -dx, dy ), shadowcoord.z ),\n texture2dcompare( shadowmap, uv + vec2( 2.0 * dx, dy ), shadowcoord.z ),\n f.x ) +\n mix( texture2dcompare( shadowmap, uv + vec2( 0.0, -dy ), shadowcoord.z ),\n texture2dcompare( shadowmap, uv + vec2( 0.0, 2.0 * dy ), shadowcoord.z ),\n f.y ) +\n mix( texture2dcompare( shadowmap, uv + vec2( dx, -dy ), shadowcoord.z ),\n texture2dcompare( shadowmap, uv + vec2( dx, 2.0 * dy ), shadowcoord.z ),\n f.y ) +\n mix( mix( texture2dcompare( shadowmap, uv + vec2( -dx, -dy ), shadowcoord.z ),\n texture2dcompare( shadowmap, uv + vec2( 2.0 * dx, -dy ), shadowcoord.z ),\n f.x ),\n mix( texture2dcompare( shadowmap, uv + vec2( -dx, 2.0 * dy ), shadowcoord.z ),\n texture2dcompare( shadowmap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowcoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( shadowmap_type_vsm )\n shadow = vsmshadow( shadowmap, shadowcoord.xy, shadowcoord.z );\n #else\n shadow = texture2dcompare( shadowmap, shadowcoord.xy, shadowcoord.z );\n #endif\n }\n return shadow;\n }\n vec2 cubetouv( vec3 v, float texelsizey ) {\n vec3 absv = abs( v );\n float scaletocube = 1.0 / max( absv.x, max( absv.y, absv.z ) );\n absv *= scaletocube;\n v *= scaletocube * ( 1.0 - 2.0 * texelsizey );\n vec2 planar = v.xy;\n float almostatexel = 1.5 * texelsizey;\n float almostone = 1.0 - almostatexel;\n if ( absv.z >= almostone ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absv.x >= almostone ) {\n float signx = sign( v.x );\n planar.x = v.z * signx + 2.0 * signx;\n } else if ( absv.y >= almostone ) {\n float signy = sign( v.y );\n planar.x = v.x + 2.0 * signy + 2.0;\n planar.y = v.z * signy - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getpointshadow( sampler2d shadowmap, vec2 shadowmapsize, float shadowbias, float shadowradius, vec4 shadowcoord, float shadowcameranear, float shadowcamerafar ) {\n vec2 texelsize = vec2( 1.0 ) / ( shadowmapsize * vec2( 4.0, 2.0 ) );\n vec3 lighttoposition = shadowcoord.xyz;\n float dp = ( length( lighttoposition ) - shadowcameranear ) / ( shadowcamerafar - shadowcameranear ); dp += shadowbias;\n vec3 bd3d = normalize( lighttoposition );\n #if defined( shadowmap_type_pcf ) || defined( shadowmap_type_pcf_soft ) || defined( shadowmap_type_vsm )\n vec2 offset = vec2( - 1, 1 ) * shadowradius * texelsize.y;\n return (\n texture2dcompare( shadowmap, cubetouv( bd3d + offset.xyy, texelsize.y ), dp ) +\n texture2dcompare( shadowmap, cubetouv( bd3d + offset.yyy, texelsize.y ), dp ) +\n texture2dcompare( shadowmap, cubetouv( bd3d + offset.xyx, texelsize.y ), dp ) +\n texture2dcompare( shadowmap, cubetouv( bd3d + offset.yyx, texelsize.y ), dp ) +\n texture2dcompare( shadowmap, cubetouv( bd3d, texelsize.y ), dp ) +\n texture2dcompare( shadowmap, cubetouv( bd3d + offset.xxy, texelsize.y ), dp ) +\n texture2dcompare( shadowmap, cubetouv( bd3d + offset.yxy, texelsize.y ), dp ) +\n texture2dcompare( shadowmap, cubetouv( bd3d + offset.xxx, texelsize.y ), dp ) +\n texture2dcompare( shadowmap, cubetouv( bd3d + offset.yxx, texelsize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2dcompare( shadowmap, cubetouv( bd3d, texelsize.y ), dp );\n #endif\n }\n#endif",shadowmap_pars_vertex:"#if num_spot_light_coords > 0\n uniform mat4 spotlightmatrix[ num_spot_light_coords ];\n varying vec4 vspotlightcoord[ num_spot_light_coords ];\n#endif\n#ifdef use_shadowmap\n #if num_dir_light_shadows > 0\n uniform mat4 directionalshadowmatrix[ num_dir_light_shadows ];\n varying vec4 vdirectionalshadowcoord[ num_dir_light_shadows ];\n struct directionallightshadow {\n float shadowbias;\n float shadownormalbias;\n float shadowradius;\n vec2 shadowmapsize;\n };\n uniform directionallightshadow directionallightshadows[ num_dir_light_shadows ];\n #endif\n #if num_spot_light_shadows > 0\n struct spotlightshadow {\n float shadowbias;\n float shadownormalbias;\n float shadowradius;\n vec2 shadowmapsize;\n };\n uniform spotlightshadow spotlightshadows[ num_spot_light_shadows ];\n #endif\n #if num_point_light_shadows > 0\n uniform mat4 pointshadowmatrix[ num_point_light_shadows ];\n varying vec4 vpointshadowcoord[ num_point_light_shadows ];\n struct pointlightshadow {\n float shadowbias;\n float shadownormalbias;\n float shadowradius;\n vec2 shadowmapsize;\n float shadowcameranear;\n float shadowcamerafar;\n };\n uniform pointlightshadow pointlightshadows[ num_point_light_shadows ];\n #endif\n#endif",shadowmap_vertex:"#if ( defined( use_shadowmap ) && ( num_dir_light_shadows > 0 || num_point_light_shadows > 0 ) ) || ( num_spot_light_coords > 0 )\n vec3 shadowworldnormal = inversetransformdirection( transformednormal, viewmatrix );\n vec4 shadowworldposition;\n#endif\n#if defined( use_shadowmap )\n #if num_dir_light_shadows > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < num_dir_light_shadows; i ++ ) {\n shadowworldposition = worldposition + vec4( shadowworldnormal * directionallightshadows[ i ].shadownormalbias, 0 );\n vdirectionalshadowcoord[ i ] = directionalshadowmatrix[ i ] * shadowworldposition;\n }\n #pragma unroll_loop_end\n #endif\n #if num_point_light_shadows > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < num_point_light_shadows; i ++ ) {\n shadowworldposition = worldposition + vec4( shadowworldnormal * pointlightshadows[ i ].shadownormalbias, 0 );\n vpointshadowcoord[ i ] = pointshadowmatrix[ i ] * shadowworldposition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if num_spot_light_coords > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < num_spot_light_coords; i ++ ) {\n shadowworldposition = worldposition;\n #if ( defined( use_shadowmap ) && unrolled_loop_index < num_spot_light_shadows )\n shadowworldposition.xyz += shadowworldnormal * spotlightshadows[ i ].shadownormalbias;\n #endif\n vspotlightcoord[ i ] = spotlightmatrix[ i ] * shadowworldposition;\n }\n #pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getshadowmask() {\n float shadow = 1.0;\n #ifdef use_shadowmap\n #if num_dir_light_shadows > 0\n directionallightshadow directionallight;\n #pragma unroll_loop_start\n for ( int i = 0; i < num_dir_light_shadows; i ++ ) {\n directionallight = directionallightshadows[ i ];\n shadow *= receiveshadow ? getshadow( directionalshadowmap[ i ], directionallight.shadowmapsize, directionallight.shadowbias, directionallight.shadowradius, vdirectionalshadowcoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if num_spot_light_shadows > 0\n spotlightshadow spotlight;\n #pragma unroll_loop_start\n for ( int i = 0; i < num_spot_light_shadows; i ++ ) {\n spotlight = spotlightshadows[ i ];\n shadow *= receiveshadow ? getshadow( spotshadowmap[ i ], spotlight.shadowmapsize, spotlight.shadowbias, spotlight.shadowradius, vspotlightcoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if num_point_light_shadows > 0\n pointlightshadow pointlight;\n #pragma unroll_loop_start\n for ( int i = 0; i < num_point_light_shadows; i ++ ) {\n pointlight = pointlightshadows[ i ];\n shadow *= receiveshadow ? getpointshadow( pointshadowmap[ i ], pointlight.shadowmapsize, pointlight.shadowbias, pointlight.shadowradius, vpointshadowcoord[ i ], pointlight.shadowcameranear, pointlight.shadowcamerafar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",skinbase_vertex:"#ifdef use_skinning\n mat4 bonematx = getbonematrix( skinindex.x );\n mat4 bonematy = getbonematrix( skinindex.y );\n mat4 bonematz = getbonematrix( skinindex.z );\n mat4 bonematw = getbonematrix( skinindex.w );\n#endif",skinning_pars_vertex:"#ifdef use_skinning\n uniform mat4 bindmatrix;\n uniform mat4 bindmatrixinverse;\n uniform highp sampler2d bonetexture;\n uniform int bonetexturesize;\n mat4 getbonematrix( const in float i ) {\n float j = i * 4.0;\n float x = mod( j, float( bonetexturesize ) );\n float y = floor( j / float( bonetexturesize ) );\n float dx = 1.0 / float( bonetexturesize );\n float dy = 1.0 / float( bonetexturesize );\n y = dy * ( y + 0.5 );\n vec4 v1 = texture2d( bonetexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2d( bonetexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2d( bonetexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2d( bonetexture, vec2( dx * ( x + 3.5 ), y ) );\n mat4 bone = mat4( v1, v2, v3, v4 );\n return bone;\n }\n#endif",skinning_vertex:"#ifdef use_skinning\n vec4 skinvertex = bindmatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += bonematx * skinvertex * skinweight.x;\n skinned += bonematy * skinvertex * skinweight.y;\n skinned += bonematz * skinvertex * skinweight.z;\n skinned += bonematw * skinvertex * skinweight.w;\n transformed = ( bindmatrixinverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef use_skinning\n mat4 skinmatrix = mat4( 0.0 );\n skinmatrix += skinweight.x * bonematx;\n skinmatrix += skinweight.y * bonematy;\n skinmatrix += skinweight.z * bonematz;\n skinmatrix += skinweight.w * bonematw;\n skinmatrix = bindmatrixinverse * skinmatrix * bindmatrix;\n objectnormal = vec4( skinmatrix * vec4( objectnormal, 0.0 ) ).xyz;\n #ifdef use_tangent\n objecttangent = vec4( skinmatrix * vec4( objecttangent, 0.0 ) ).xyz;\n #endif\n#endif",specularmap_fragment:"float specularstrength;\n#ifdef use_specularmap\n vec4 texelspecular = texture2d( specularmap, vuv );\n specularstrength = texelspecular.r;\n#else\n specularstrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef use_specularmap\n uniform sampler2d specularmap;\n#endif",tonemapping_fragment:"#if defined( tone_mapping )\n gl_fragcolor.rgb = tonemapping( gl_fragcolor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float tonemappingexposure;\nvec3 lineartonemapping( vec3 color ) {\n return tonemappingexposure * color;\n}\nvec3 reinhardtonemapping( vec3 color ) {\n color *= tonemappingexposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 optimizedcineontonemapping( vec3 color ) {\n color *= tonemappingexposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 rrtandodtfit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 acesfilmictonemapping( vec3 color ) {\n const mat3 acesinputmat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 acesoutputmat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= tonemappingexposure / 0.6;\n color = acesinputmat * color;\n color = rrtandodtfit( color );\n color = acesoutputmat * color;\n return saturate( color );\n}\nvec3 customtonemapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef use_transmission\n material.transmission = transmission;\n material.transmissionalpha = 1.0;\n material.thickness = thickness;\n material.attenuationdistance = attenuationdistance;\n material.attenuationcolor = attenuationcolor;\n #ifdef use_transmissionmap\n material.transmission *= texture2d( transmissionmap, vuv ).r;\n #endif\n #ifdef use_thicknessmap\n material.thickness *= texture2d( thicknessmap, vuv ).g;\n #endif\n vec3 pos = vworldposition;\n vec3 v = normalize( cameraposition - pos );\n vec3 n = inversetransformdirection( normal, viewmatrix );\n vec4 transmission = getiblvolumerefraction(\n n, v, material.roughness, material.diffusecolor, material.specularcolor, material.specularf90,\n pos, modelmatrix, viewmatrix, projectionmatrix, material.ior, material.thickness,\n material.attenuationcolor, material.attenuationdistance );\n material.transmissionalpha = mix( material.transmissionalpha, transmission.a, material.transmission );\n totaldiffuse = mix( totaldiffuse, transmission.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef use_transmission\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationdistance;\n uniform vec3 attenuationcolor;\n #ifdef use_transmissionmap\n uniform sampler2d transmissionmap;\n #endif\n #ifdef use_thicknessmap\n uniform sampler2d thicknessmap;\n #endif\n uniform vec2 transmissionsamplersize;\n uniform sampler2d transmissionsamplermap;\n uniform mat4 modelmatrix;\n uniform mat4 projectionmatrix;\n varying vec3 vworldposition;\n vec3 getvolumetransmissionray( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelmatrix ) {\n vec3 refractionvector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelscale;\n modelscale.x = length( vec3( modelmatrix[ 0 ].xyz ) );\n modelscale.y = length( vec3( modelmatrix[ 1 ].xyz ) );\n modelscale.z = length( vec3( modelmatrix[ 2 ].xyz ) );\n return normalize( refractionvector ) * thickness * modelscale;\n }\n float applyiortoroughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 gettransmissionsample( const in vec2 fragcoord, const in float roughness, const in float ior ) {\n float framebufferlod = log2( transmissionsamplersize.x ) * applyiortoroughness( roughness, ior );\n #ifdef texture2dlodext\n return texture2dlodext( transmissionsamplermap, fragcoord.xy, framebufferlod );\n #else\n return texture2d( transmissionsamplermap, fragcoord.xy, framebufferlod );\n #endif\n }\n vec3 applyvolumeattenuation( const in vec3 radiance, const in float transmissiondistance, const in vec3 attenuationcolor, const in float attenuationdistance ) {\n if ( isinf( attenuationdistance ) ) {\n return radiance;\n } else {\n vec3 attenuationcoefficient = -log( attenuationcolor ) / attenuationdistance;\n vec3 transmittance = exp( - attenuationcoefficient * transmissiondistance ); return transmittance * radiance;\n }\n }\n vec4 getiblvolumerefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffusecolor,\n const in vec3 specularcolor, const in float specularf90, const in vec3 position, const in mat4 modelmatrix,\n const in mat4 viewmatrix, const in mat4 projmatrix, const in float ior, const in float thickness,\n const in vec3 attenuationcolor, const in float attenuationdistance ) {\n vec3 transmissionray = getvolumetransmissionray( n, v, thickness, ior, modelmatrix );\n vec3 refractedrayexit = position + transmissionray;\n vec4 ndcpos = projmatrix * viewmatrix * vec4( refractedrayexit, 1.0 );\n vec2 refractioncoords = ndcpos.xy / ndcpos.w;\n refractioncoords += 1.0;\n refractioncoords /= 2.0;\n vec4 transmittedlight = gettransmissionsample( refractioncoords, roughness, ior );\n vec3 attenuatedcolor = applyvolumeattenuation( transmittedlight.rgb, length( transmissionray ), attenuationcolor, attenuationdistance );\n vec3 f = environmentbrdf( n, v, specularcolor, specularf90, roughness );\n return vec4( ( 1.0 - f ) * attenuatedcolor * diffusecolor, transmittedlight.a );\n }\n#endif",uv_pars_fragment:"#if ( defined( use_uv ) && ! defined( uvs_vertex_only ) )\n varying vec2 vuv;\n#endif",uv_pars_vertex:"#ifdef use_uv\n #ifdef uvs_vertex_only\n vec2 vuv;\n #else\n varying vec2 vuv;\n #endif\n uniform mat3 uvtransform;\n#endif",uv_vertex:"#ifdef use_uv\n vuv = ( uvtransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( use_lightmap ) || defined( use_aomap )\n varying vec2 vuv2;\n#endif",uv2_pars_vertex:"#if defined( use_lightmap ) || defined( use_aomap )\n attribute vec2 uv2;\n varying vec2 vuv2;\n uniform mat3 uv2transform;\n#endif",uv2_vertex:"#if defined( use_lightmap ) || defined( use_aomap )\n vuv2 = ( uv2transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( use_envmap ) || defined( distance ) || defined ( use_shadowmap ) || defined ( use_transmission ) || num_spot_light_coords > 0\n vec4 worldposition = vec4( transformed, 1.0 );\n #ifdef use_instancing\n worldposition = instancematrix * worldposition;\n #endif\n worldposition = modelmatrix * worldposition;\n#endif",background_vert:"varying vec2 vuv;\nuniform mat3 uvtransform;\nvoid main() {\n vuv = ( uvtransform * vec3( uv, 1 ) ).xy;\n gl_position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2d t2d;\nuniform float backgroundintensity;\nvarying vec2 vuv;\nvoid main() {\n vec4 texcolor = texture2d( t2d, vuv );\n #ifdef decode_video_texture\n texcolor = vec4( mix( pow( texcolor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texcolor.rgb * 0.0773993808, vec3( lessthanequal( texcolor.rgb, vec3( 0.04045 ) ) ) ), texcolor.w );\n #endif\n texcolor.rgb *= backgroundintensity;\n gl_fragcolor = texcolor;\n #include \n #include \n}",backgroundcube_vert:"varying vec3 vworlddirection;\n#include \nvoid main() {\n vworlddirection = transformdirection( position, modelmatrix );\n #include \n #include \n gl_position.z = gl_position.w;\n}",backgroundcube_frag:"#ifdef envmap_type_cube\n uniform samplercube envmap;\n#elif defined( envmap_type_cube_uv )\n uniform sampler2d envmap;\n#endif\nuniform float flipenvmap;\nuniform float backgroundblurriness;\nuniform float backgroundintensity;\nvarying vec3 vworlddirection;\n#include \nvoid main() {\n #ifdef envmap_type_cube\n vec4 texcolor = texturecube( envmap, vec3( flipenvmap * vworlddirection.x, vworlddirection.yz ) );\n #elif defined( envmap_type_cube_uv )\n vec4 texcolor = texturecubeuv( envmap, vworlddirection, backgroundblurriness );\n #else\n vec4 texcolor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texcolor.rgb *= backgroundintensity;\n gl_fragcolor = texcolor;\n #include \n #include \n}",cube_vert:"varying vec3 vworlddirection;\n#include \nvoid main() {\n vworlddirection = transformdirection( position, modelmatrix );\n #include \n #include \n gl_position.z = gl_position.w;\n}",cube_frag:"uniform samplercube tcube;\nuniform float tflip;\nuniform float opacity;\nvarying vec3 vworlddirection;\nvoid main() {\n vec4 texcolor = texturecube( tcube, vec3( tflip * vworlddirection.x, vworlddirection.yz ) );\n gl_fragcolor = texcolor;\n gl_fragcolor.a *= opacity;\n #include \n #include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vhighprecisionzw;\nvoid main() {\n #include \n #include \n #ifdef use_displacementmap\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vhighprecisionzw = gl_position.zw;\n}",depth_frag:"#if depth_packing == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vhighprecisionzw;\nvoid main() {\n #include \n vec4 diffusecolor = vec4( 1.0 );\n #if depth_packing == 3200\n diffusecolor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n float fragcoordz = 0.5 * vhighprecisionzw[0] / vhighprecisionzw[1] + 0.5;\n #if depth_packing == 3200\n gl_fragcolor = vec4( vec3( 1.0 - fragcoordz ), opacity );\n #elif depth_packing == 3201\n gl_fragcolor = packdepthtorgba( fragcoordz );\n #endif\n}",distancergba_vert:"#define distance\nvarying vec3 vworldposition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #ifdef use_displacementmap\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vworldposition = worldposition.xyz;\n}",distancergba_frag:"#define distance\nuniform vec3 referenceposition;\nuniform float neardistance;\nuniform float fardistance;\nvarying vec3 vworldposition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n #include \n vec4 diffusecolor = vec4( 1.0 );\n #include \n #include \n #include \n float dist = length( vworldposition - referenceposition );\n dist = ( dist - neardistance ) / ( fardistance - neardistance );\n dist = saturate( dist );\n gl_fragcolor = packdepthtorgba( dist );\n}",equirect_vert:"varying vec3 vworlddirection;\n#include \nvoid main() {\n vworlddirection = transformdirection( position, modelmatrix );\n #include \n #include \n}",equirect_frag:"uniform sampler2d tequirect;\nvarying vec3 vworlddirection;\n#include \nvoid main() {\n vec3 direction = normalize( vworlddirection );\n vec2 sampleuv = equirectuv( direction );\n gl_fragcolor = texture2d( tequirect, sampleuv );\n #include \n #include \n}",linedashed_vert:"uniform float scale;\nattribute float linedistance;\nvarying float vlinedistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vlinedistance = scale * linedistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashsize;\nuniform float totalsize;\nvarying float vlinedistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n if ( mod( vlinedistance, totalsize ) > dashsize ) {\n discard;\n }\n vec3 outgoinglight = vec3( 0.0 );\n vec4 diffusecolor = vec4( diffuse, opacity );\n #include \n #include \n outgoinglight = diffusecolor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #if defined ( use_envmap ) || defined ( use_skinning )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef flat_shaded\n varying vec3 vnormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffusecolor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n reflectedlight reflectedlight = reflectedlight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef use_lightmap\n vec4 lightmaptexel = texture2d( lightmap, vuv2 );\n reflectedlight.indirectdiffuse += lightmaptexel.rgb * lightmapintensity * reciprocal_pi;\n #else\n reflectedlight.indirectdiffuse += vec3( 1.0 );\n #endif\n #include \n reflectedlight.indirectdiffuse *= diffusecolor.rgb;\n vec3 outgoinglight = reflectedlight.indirectdiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshlambert_vert:"#define lambert\nvarying vec3 vviewposition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vviewposition = - mvposition.xyz;\n #include \n #include \n #include \n #include \n}",meshlambert_frag:"#define lambert\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffusecolor = vec4( diffuse, opacity );\n reflectedlight reflectedlight = reflectedlight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalemissiveradiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoinglight = reflectedlight.directdiffuse + reflectedlight.indirectdiffuse + totalemissiveradiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshmatcap_vert:"#define matcap\nvarying vec3 vviewposition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vviewposition = - mvposition.xyz;\n}",meshmatcap_frag:"#define matcap\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2d matcap;\nvarying vec3 vviewposition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffusecolor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 viewdir = normalize( vviewposition );\n vec3 x = normalize( vec3( viewdir.z, 0.0, - viewdir.x ) );\n vec3 y = cross( viewdir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef use_matcap\n vec4 matcapcolor = texture2d( matcap, uv );\n #else\n vec4 matcapcolor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoinglight = diffusecolor.rgb * matcapcolor.rgb;\n #include \n #include \n #include \n #include \n #include \n #include \n}",meshnormal_vert:"#define normal\n#if defined( flat_shaded ) || defined( use_bumpmap ) || defined( tangentspace_normalmap )\n varying vec3 vviewposition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n#if defined( flat_shaded ) || defined( use_bumpmap ) || defined( tangentspace_normalmap )\n vviewposition = - mvposition.xyz;\n#endif\n}",meshnormal_frag:"#define normal\nuniform float opacity;\n#if defined( flat_shaded ) || defined( use_bumpmap ) || defined( tangentspace_normalmap )\n varying vec3 vviewposition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n gl_fragcolor = vec4( packnormaltorgb( normal ), opacity );\n #ifdef opaque\n gl_fragcolor.a = 1.0;\n #endif\n}",meshphong_vert:"#define phong\nvarying vec3 vviewposition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vviewposition = - mvposition.xyz;\n #include \n #include \n #include \n #include \n}",meshphong_frag:"#define phong\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffusecolor = vec4( diffuse, opacity );\n reflectedlight reflectedlight = reflectedlight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalemissiveradiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoinglight = reflectedlight.directdiffuse + reflectedlight.indirectdiffuse + reflectedlight.directspecular + reflectedlight.indirectspecular + totalemissiveradiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",meshphysical_vert:"#define standard\nvarying vec3 vviewposition;\n#ifdef use_transmission\n varying vec3 vworldposition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vviewposition = - mvposition.xyz;\n #include \n #include \n #include \n#ifdef use_transmission\n vworldposition = worldposition.xyz;\n#endif\n}",meshphysical_frag:"#define standard\n#ifdef physical\n #define ior\n #define specular\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef ior\n uniform float ior;\n#endif\n#ifdef specular\n uniform float specularintensity;\n uniform vec3 specularcolor;\n #ifdef use_specularintensitymap\n uniform sampler2d specularintensitymap;\n #endif\n #ifdef use_specularcolormap\n uniform sampler2d specularcolormap;\n #endif\n#endif\n#ifdef use_clearcoat\n uniform float clearcoat;\n uniform float clearcoatroughness;\n#endif\n#ifdef use_iridescence\n uniform float iridescence;\n uniform float iridescenceior;\n uniform float iridescencethicknessminimum;\n uniform float iridescencethicknessmaximum;\n#endif\n#ifdef use_sheen\n uniform vec3 sheencolor;\n uniform float sheenroughness;\n #ifdef use_sheencolormap\n uniform sampler2d sheencolormap;\n #endif\n #ifdef use_sheenroughnessmap\n uniform sampler2d sheenroughnessmap;\n #endif\n#endif\nvarying vec3 vviewposition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffusecolor = vec4( diffuse, opacity );\n reflectedlight reflectedlight = reflectedlight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalemissiveradiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 totaldiffuse = reflectedlight.directdiffuse + reflectedlight.indirectdiffuse;\n vec3 totalspecular = reflectedlight.directspecular + reflectedlight.indirectspecular;\n #include \n vec3 outgoinglight = totaldiffuse + totalspecular + totalemissiveradiance;\n #ifdef use_sheen\n float sheenenergycomp = 1.0 - 0.157 * max3( material.sheencolor );\n outgoinglight = outgoinglight * sheenenergycomp + sheenspecular;\n #endif\n #ifdef use_clearcoat\n float dotnvcc = saturate( dot( geometry.clearcoatnormal, geometry.viewdir ) );\n vec3 fcc = f_schlick( material.clearcoatf0, material.clearcoatf90, dotnvcc );\n outgoinglight = outgoinglight * ( 1.0 - material.clearcoat * fcc ) + clearcoatspecular * material.clearcoat;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n}",meshtoon_vert:"#define toon\nvarying vec3 vviewposition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vviewposition = - mvposition.xyz;\n #include \n #include \n #include \n}",meshtoon_frag:"#define toon\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 diffusecolor = vec4( diffuse, opacity );\n reflectedlight reflectedlight = reflectedlight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalemissiveradiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoinglight = reflectedlight.directdiffuse + reflectedlight.indirectdiffuse + totalemissiveradiance;\n #include \n #include \n #include \n #include \n #include \n #include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n gl_pointsize = size;\n #ifdef use_sizeattenuation\n bool isperspective = isperspectivematrix( projectionmatrix );\n if ( isperspective ) gl_pointsize *= ( scale / - mvposition.z );\n #endif\n #include \n #include \n #include \n #include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec3 outgoinglight = vec3( 0.0 );\n vec4 diffusecolor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n outgoinglight = diffusecolor.rgb;\n #include \n #include \n #include \n #include \n #include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n gl_fragcolor = vec4( color, opacity * ( 1.0 - getshadowmask() ) );\n #include \n #include \n #include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 mvposition = modelviewmatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelmatrix[ 0 ].x, modelmatrix[ 0 ].y, modelmatrix[ 0 ].z ) );\n scale.y = length( vec3( modelmatrix[ 1 ].x, modelmatrix[ 1 ].y, modelmatrix[ 1 ].z ) );\n #ifndef use_sizeattenuation\n bool isperspective = isperspectivematrix( projectionmatrix );\n if ( isperspective ) scale *= - mvposition.z;\n #endif\n vec2 alignedposition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedposition;\n rotatedposition.x = cos( rotation ) * alignedposition.x - sin( rotation ) * alignedposition.y;\n rotatedposition.y = sin( rotation ) * alignedposition.x + cos( rotation ) * alignedposition.y;\n mvposition.xy += rotatedposition;\n gl_position = projectionmatrix * mvposition;\n #include \n #include \n #include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec3 outgoinglight = vec3( 0.0 );\n vec4 diffusecolor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n outgoinglight = diffusecolor.rgb;\n #include \n #include \n #include \n #include \n}"},iq={common:{diffuse:{value:new nf(16777215)},opacity:{value:1},map:{value:null},uvtransform:{value:new nx},uv2transform:{value:new nx},alphamap:{value:null},alphatest:{value:0}},specularmap:{specularmap:{value:null}},envmap:{envmap:{value:null},flipenvmap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionratio:{value:.98}},aomap:{aomap:{value:null},aomapintensity:{value:1}},lightmap:{lightmap:{value:null},lightmapintensity:{value:1}},emissivemap:{emissivemap:{value:null}},bumpmap:{bumpmap:{value:null},bumpscale:{value:1}},normalmap:{normalmap:{value:null},normalscale:{value:new ny(1,1)}},displacementmap:{displacementmap:{value:null},displacementscale:{value:1},displacementbias:{value:0}},roughnessmap:{roughnessmap:{value:null}},metalnessmap:{metalnessmap:{value:null}},gradientmap:{gradientmap:{value:null}},fog:{fogdensity:{value:25e-5},fognear:{value:1},fogfar:{value:2e3},fogcolor:{value:new nf(16777215)}},lights:{ambientlightcolor:{value:[]},lightprobe:{value:[]},directionallights:{value:[],properties:{direction:{},color:{}}},directionallightshadows:{value:[],properties:{shadowbias:{},shadownormalbias:{},shadowradius:{},shadowmapsize:{}}},directionalshadowmap:{value:[]},directionalshadowmatrix:{value:[]},spotlights:{value:[],properties:{color:{},position:{},direction:{},distance:{},conecos:{},penumbracos:{},decay:{}}},spotlightshadows:{value:[],properties:{shadowbias:{},shadownormalbias:{},shadowradius:{},shadowmapsize:{}}},spotlightmap:{value:[]},spotshadowmap:{value:[]},spotlightmatrix:{value:[]},pointlights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointlightshadows:{value:[],properties:{shadowbias:{},shadownormalbias:{},shadowradius:{},shadowmapsize:{},shadowcameranear:{},shadowcamerafar:{}}},pointshadowmap:{value:[]},pointshadowmatrix:{value:[]},hemispherelights:{value:[],properties:{direction:{},skycolor:{},groundcolor:{}}},rectarealights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new nf(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphamap:{value:null},alphatest:{value:0},uvtransform:{value:new nx}},sprite:{diffuse:{value:new nf(16777215)},opacity:{value:1},center:{value:new ny(.5,.5)},rotation:{value:0},map:{value:null},alphamap:{value:null},alphatest:{value:0},uvtransform:{value:new nx}}},iz={basic:{uniforms:ir([iq.common,iq.specularmap,iq.envmap,iq.aomap,iq.lightmap,iq.fog]),vertexshader:iq.meshbasic_vert,fragmentshader:iq.meshbasic_frag},lambert:{uniforms:ir([iq.common,iq.specularmap,iq.envmap,iq.aomap,iq.lightmap,iq.emissivemap,iq.bumpmap,iq.normalmap,iq.displacementmap,iq.fog,iq.lights,{emissive:{value:new nf(0)}}]),vertexshader:iq.meshlambert_vert,fragmentshader:iq.meshlambert_frag},phong:{uniforms:ir([iq.common,iq.specularmap,iq.envmap,iq.aomap,iq.lightmap,iq.emissivemap,iq.bumpmap,iq.normalmap,iq.displacementmap,iq.fog,iq.lights,{emissive:{value:new nf(0)},specular:{value:new nf(1118481)},shininess:{value:30}}]),vertexshader:iq.meshphong_vert,fragmentshader:iq.meshphong_frag},standard:{uniforms:ir([iq.common,iq.envmap,iq.aomap,iq.lightmap,iq.emissivemap,iq.bumpmap,iq.normalmap,iq.displacementmap,iq.roughnessmap,iq.metalnessmap,iq.fog,iq.lights,{emissive:{value:new nf(0)},roughness:{value:1},metalness:{value:0},envmapintensity:{value:1}}]),vertexshader:iq.meshphysical_vert,fragmentshader:iq.meshphysical_frag},toon:{uniforms:ir([iq.common,iq.aomap,iq.lightmap,iq.emissivemap,iq.bumpmap,iq.normalmap,iq.displacementmap,iq.gradientmap,iq.fog,iq.lights,{emissive:{value:new nf(0)}}]),vertexshader:iq.meshtoon_vert,fragmentshader:iq.meshtoon_frag},matcap:{uniforms:ir([iq.common,iq.bumpmap,iq.normalmap,iq.displacementmap,iq.fog,{matcap:{value:null}}]),vertexshader:iq.meshmatcap_vert,fragmentshader:iq.meshmatcap_frag},points:{uniforms:ir([iq.points,iq.fog]),vertexshader:iq.points_vert,fragmentshader:iq.points_frag},dashed:{uniforms:ir([iq.common,iq.fog,{scale:{value:1},dashsize:{value:1},totalsize:{value:2}}]),vertexshader:iq.linedashed_vert,fragmentshader:iq.linedashed_frag},depth:{uniforms:ir([iq.common,iq.displacementmap]),vertexshader:iq.depth_vert,fragmentshader:iq.depth_frag},normal:{uniforms:ir([iq.common,iq.bumpmap,iq.normalmap,iq.displacementmap,{opacity:{value:1}}]),vertexshader:iq.meshnormal_vert,fragmentshader:iq.meshnormal_frag},sprite:{uniforms:ir([iq.sprite,iq.fog]),vertexshader:iq.sprite_vert,fragmentshader:iq.sprite_frag},background:{uniforms:{uvtransform:{value:new nx},t2d:{value:null},backgroundintensity:{value:1}},vertexshader:iq.background_vert,fragmentshader:iq.background_frag},backgroundcube:{uniforms:{envmap:{value:null},flipenvmap:{value:-1},backgroundblurriness:{value:0},backgroundintensity:{value:1}},vertexshader:iq.backgroundcube_vert,fragmentshader:iq.backgroundcube_frag},cube:{uniforms:{tcube:{value:null},tflip:{value:-1},opacity:{value:1}},vertexshader:iq.cube_vert,fragmentshader:iq.cube_frag},equirect:{uniforms:{tequirect:{value:null}},vertexshader:iq.equirect_vert,fragmentshader:iq.equirect_frag},distancergba:{uniforms:ir([iq.common,iq.displacementmap,{referenceposition:{value:new ny},neardistance:{value:1},fardistance:{value:1e3}}]),vertexshader:iq.distancergba_vert,fragmentshader:iq.distancergba_frag},shadow:{uniforms:ir([iq.lights,iq.fog,{color:{value:new nf(0)},opacity:{value:1}}]),vertexshader:iq.shadow_vert,fragmentshader:iq.shadow_frag}};iz.physical={uniforms:ir([iz.standard.uniforms,{clearcoat:{value:0},clearcoatmap:{value:null},clearcoatroughness:{value:0},clearcoatroughnessmap:{value:null},clearcoatnormalscale:{value:new ny(1,1)},clearcoatnormalmap:{value:null},iridescence:{value:0},iridescencemap:{value:null},iridescenceior:{value:1.3},iridescencethicknessminimum:{value:100},iridescencethicknessmaximum:{value:400},iridescencethicknessmap:{value:null},sheen:{value:0},sheencolor:{value:new nf(0)},sheencolormap:{value:null},sheenroughness:{value:1},sheenroughnessmap:{value:null},transmission:{value:0},transmissionmap:{value:null},transmissionsamplersize:{value:new ny},transmissionsamplermap:{value:null},thickness:{value:0},thicknessmap:{value:null},attenuationdistance:{value:0},attenuationcolor:{value:new nf(0)},specularintensity:{value:1},specularintensitymap:{value:null},specularcolor:{value:new nf(1,1,1)},specularcolormap:{value:null}}]),vertexshader:iq.meshphysical_vert,fragmentshader:iq.meshphysical_frag};let i$={r:0,b:0,g:0};function i0(e,n,r,i,a,s,o){let l,u;let c=new nf(0),h=!0===s?0:1,d=null,p=0,f=null;function m(n,r){n.getrgb(i$,il(e)),i.buffers.color.setclear(i$.r,i$.g,i$.b,r,o)}return{getclearcolor:function(){return c},setclearcolor:function(e,n=1){c.set(e),m(c,h=n)},getclearalpha:function(){return h},setclearalpha:function(e){m(c,h=e)},render:function(i,s){let o=!1,g=!0===s.isscene?s.background:null;if(g&&g.istexture){let e=s.backgroundblurriness>0;g=(e?r:n).get(g)}let v=e.xr,y=v.getsession&&v.getsession();y&&"additive"===y.environmentblendmode&&(g=null),null===g?m(c,h):g&&g.iscolor&&(m(g,1),o=!0),(e.autoclear||o)&&e.clear(e.autoclearcolor,e.autocleardepth,e.autoclearstencil),g&&(g.iscubetexture||g.mapping===ef)?(void 0===u&&((u=new ie(new ib(1,1,1),new id({name:"backgroundcubematerial",uniforms:ip(iz.backgroundcube.uniforms),vertexshader:iz.backgroundcube.vertexshader,fragmentshader:iz.backgroundcube.fragmentshader,side:a,depthtest:!1,depthwrite:!1,fog:!1}))).geometry.deleteattribute("normal"),u.geometry.deleteattribute("uv"),u.onbeforerender=function(e,n,r){this.matrixworld.copyposition(r.matrixworld)},object.defineproperty(u.material,"envmap",{get:function(){return this.uniforms.envmap.value}}),a.update(u)),u.material.uniforms.envmap.value=g,u.material.uniforms.flipenvmap.value=g.iscubetexture&&!1===g.isrendertargettexture?-1:1,u.material.uniforms.backgroundblurriness.value=s.backgroundblurriness,u.material.uniforms.backgroundintensity.value=s.backgroundintensity,u.material.tonemapped=g.encoding!==tr,(d!==g||p!==g.version||f!==e.tonemapping)&&(u.material.needsupdate=!0,d=g,p=g.version,f=e.tonemapping),u.layers.enableall(),i.unshift(u,u.geometry,u.material,0,0,null)):g&&g.istexture&&(void 0===l&&((l=new ie(new iy(2,2),new id({name:"backgroundmaterial",uniforms:ip(iz.background.uniforms),vertexshader:iz.background.vertexshader,fragmentshader:iz.background.fragmentshader,side:_,depthtest:!1,depthwrite:!1,fog:!1}))).geometry.deleteattribute("normal"),object.defineproperty(l.material,"map",{get:function(){return this.uniforms.t2d.value}}),a.update(l)),l.material.uniforms.t2d.value=g,l.material.uniforms.backgroundintensity.value=s.backgroundintensity,l.material.tonemapped=g.encoding!==tr,!0===g.matrixautoupdate&&g.updatematrix(),l.material.uniforms.uvtransform.value.copy(g.matrix),(d!==g||p!==g.version||f!==e.tonemapping)&&(l.material.needsupdate=!0,d=g,p=g.version,f=e.tonemapping),l.layers.enableall(),i.unshift(l,l.geometry,l.material,0,0,null))}}}function i1(e,n,r,i){let a=e.getparameter(34921),s=i.iswebgl2?null:n.get("oes_vertex_array_object"),o=i.iswebgl2||null!==s,l={},u=f(null),c=u,h=!1;function d(n){return i.iswebgl2?e.bindvertexarray(n):s.bindvertexarrayoes(n)}function p(n){return i.iswebgl2?e.deletevertexarray(n):s.deletevertexarrayoes(n)}function f(e){let n=[],r=[],i=[];for(let e=0;e=0){let r=a[n],i=s[n];if(void 0===i&&("instancematrix"===n&&e.instancematrix&&(i=e.instancematrix),"instancecolor"===n&&e.instancecolor&&(i=e.instancecolor)),void 0===r||r.attribute!==i||i&&r.data!==i.data)return!0;o++}}return c.attributesnum!==o||c.index!==i}(a,_,p,a))&&function(e,n,r,i){let a={},s=n.attributes,o=0,l=r.getattributes();for(let n in l){let r=l[n];if(r.location>=0){let r=s[n];void 0===r&&("instancematrix"===n&&e.instancematrix&&(r=e.instancematrix),"instancecolor"===n&&e.instancecolor&&(r=e.instancecolor));let i={};i.attribute=r,r&&r.data&&(i.data=r.data),a[n]=i,o++}}c.attributes=a,c.attributesnum=o,c.index=i}(a,_,p,a)}else{let e=!0===u.wireframe;(c.geometry!==_.id||c.program!==p.id||c.wireframe!==e)&&(c.geometry=_.id,c.program=p.id,c.wireframe=e,b=!0)}null!==a&&r.update(a,34963),(b||h)&&(h=!1,function(a,s,o,l){if(!1===i.iswebgl2&&(a.isinstancedmesh||l.isinstancedbuffergeometry)&&null===n.get("angle_instanced_arrays"))return;m();let u=l.attributes,c=o.getattributes(),h=s.defaultattributevalues;for(let n in c){let i=c[n];if(i.location>=0){let s=u[n];if(void 0===s&&("instancematrix"===n&&a.instancematrix&&(s=a.instancematrix),"instancecolor"===n&&a.instancecolor&&(s=a.instancecolor)),void 0!==s){let n=s.normalized,o=s.itemsize,u=r.get(s);if(void 0===u)continue;let c=u.buffer,h=u.type,d=u.bytesperelement;if(s.isinterleavedbufferattribute){let r=s.data,u=r.stride,p=s.offset;if(r.isinstancedinterleavedbuffer){for(let e=0;e0&&e.getshaderprecisionformat(35632,36338).precision>0)return"highp";n="mediump"}return"mediump"===n&&e.getshaderprecisionformat(35633,36337).precision>0&&e.getshaderprecisionformat(35632,36337).precision>0?"mediump":"lowp"}let s="undefined"!=typeof webgl2renderingcontext&&e instanceof webgl2renderingcontext,o=void 0!==r.precision?r.precision:"highp",l=a(o);l!==o&&(console.warn("three.webglrenderer:",o,"not supported, using",l,"instead."),o=l);let u=s||n.has("webgl_draw_buffers"),c=!0===r.logarithmicdepthbuffer,h=e.getparameter(34930),d=e.getparameter(35660),p=e.getparameter(3379),f=e.getparameter(34076),m=e.getparameter(34921),g=e.getparameter(36347),v=e.getparameter(36348),y=e.getparameter(36349),x=d>0,_=s||n.has("oes_texture_float"),a=s?e.getparameter(36183):0;return{iswebgl2:s,drawbuffers:u,getmaxanisotropy:function(){if(void 0!==i)return i;if(!0===n.has("ext_texture_filter_anisotropic")){let r=n.get("ext_texture_filter_anisotropic");i=e.getparameter(r.max_texture_max_anisotropy_ext)}else i=0;return i},getmaxprecision:a,precision:o,logarithmicdepthbuffer:c,maxtextures:h,maxvertextextures:d,maxtexturesize:p,maxcubemapsize:f,maxattributes:m,maxvertexuniforms:g,maxvaryings:v,maxfragmentuniforms:y,vertextextures:x,floatfragmenttextures:_,floatvertextextures:x&&_,maxsamples:a}}function i4(e){let n=this,r=null,i=0,a=!1,s=!1,o=new iv,l=new nx,u={value:null,needsupdate:!1};function c(e,r,i,a){let s=null!==e?e.length:0,c=null;if(0!==s){if(c=u.value,!0!==a||null===c){let n=i+4*s,a=r.matrixworldinverse;l.getnormalmatrix(a),(null===c||c.length0),n.numplanes=i,n.numintersection=0)}}function i6(e){let n=new weakmap;function r(e,n){return n===ed?e.mapping=ec:n===ep&&(e.mapping=eh),e}function i(e){let r=e.target;r.removeeventlistener("dispose",i);let a=n.get(r);void 0!==a&&(n.delete(r),a.dispose())}return{get:function(a){if(a&&a.istexture&&!1===a.isrendertargettexture){let s=a.mapping;if(s===ed||s===ep){if(n.has(a)){let e=n.get(a).texture;return r(e,a.mapping)}{let s=a.image;if(!s||!(s.height>0))return null;{let o=new ih(s.height/2);return o.fromequirectangulartexture(e,a),n.set(a,o),a.addeventlistener("dispose",i),r(o.texture,a.mapping)}}}}return a},dispose:function(){n=new weakmap}}}class i5 extends if{constructor(e=-1,n=1,r=1,i=-1,a=.1,s=2e3){super(),this.isorthographiccamera=!0,this.type="orthographiccamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=a,this.far=s,this.updateprojectionmatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:object.assign({},e.view),this}setviewoffset(e,n,r,i,a,s){null===this.view&&(this.view={enabled:!0,fullwidth:1,fullheight:1,offsetx:0,offsety:0,width:1,height:1}),this.view.enabled=!0,this.view.fullwidth=e,this.view.fullheight=n,this.view.offsetx=r,this.view.offsety=i,this.view.width=a,this.view.height=s,this.updateprojectionmatrix()}clearviewoffset(){null!==this.view&&(this.view.enabled=!1),this.updateprojectionmatrix()}updateprojectionmatrix(){let e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2,a=r-e,s=r+e,o=i+n,l=i-n;if(null!==this.view&&this.view.enabled){let e=(this.right-this.left)/this.view.fullwidth/this.zoom,n=(this.top-this.bottom)/this.view.fullheight/this.zoom;a+=e*this.view.offsetx,s=a+e*this.view.width,o-=n*this.view.offsety,l=o-n*this.view.height}this.projectionmatrix.makeorthographic(a,s,o,l,this.near,this.far),this.projectionmatrixinverse.copy(this.projectionmatrix).invert()}tojson(e){let n=super.tojson(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,null!==this.view&&(n.object.view=object.assign({},this.view)),n}}let i9=[.125,.215,.35,.446,.526,.582],i8=new i5,i7=new nf,ae=null,at=(1+math.sqrt(5))/2,an=1/at,ar=[new ny(1,1,1),new ny(-1,1,1),new ny(1,1,-1),new ny(-1,1,-1),new ny(0,at,an),new ny(0,at,-an),new ny(an,0,at),new ny(-an,0,at),new ny(at,an,0),new ny(-at,an,0)];class ai{constructor(e){this._renderer=e,this._pingpongrendertarget=null,this._lodmax=0,this._cubesize=0,this._lodplanes=[],this._sizelods=[],this._sigmas=[],this._blurmaterial=null,this._cubemapmaterial=null,this._equirectmaterial=null,this._compilematerial(this._blurmaterial)}fromscene(e,n=0,r=.1,i=100){ae=this._renderer.getrendertarget(),this._setsize(256);let a=this._allocatetargets();return a.depthbuffer=!0,this._scenetocubeuv(e,r,i,a),n>0&&this._blur(a,0,0,n),this._applypmrem(a),this._cleanup(a),a}fromequirectangular(e,n=null){return this._fromtexture(e,n)}fromcubemap(e,n=null){return this._fromtexture(e,n)}compilecubemapshader(){null===this._cubemapmaterial&&(this._cubemapmaterial=al(),this._compilematerial(this._cubemapmaterial))}compileequirectangularshader(){null===this._equirectmaterial&&(this._equirectmaterial=ao(),this._compilematerial(this._equirectmaterial))}dispose(){this._dispose(),null!==this._cubemapmaterial&&this._cubemapmaterial.dispose(),null!==this._equirectmaterial&&this._equirectmaterial.dispose()}_setsize(e){this._lodmax=math.floor(math.log2(e)),this._cubesize=math.pow(2,this._lodmax)}_dispose(){null!==this._blurmaterial&&this._blurmaterial.dispose(),null!==this._pingpongrendertarget&&this._pingpongrendertarget.dispose();for(let e=0;ee-4?l=i9[o-e+4-1]:0===o&&(l=0),i.push(l);let u=1/(s-2),c=-u,h=1+u,d=[c,c,h,c,h,h,c,c,h,h,c,h],p=new float32array(108),f=new float32array(72),m=new float32array(36);for(let e=0;e<6;e++){let n=e%3*2/3-1,r=e>2?0:-1,i=[n,r,0,n+2/3,r,0,n+2/3,r+1,0,n,r,0,n+2/3,r+1,0,n,r+1,0];p.set(i,18*e),f.set(d,12*e);let a=[e,e,e,e,e,e];m.set(a,6*e)}let g=new id;g.setattribute("position",new r3(p,3)),g.setattribute("uv",new r3(f,2)),g.setattribute("faceindex",new r3(m,1)),n.push(g),a>4&&a--}return{lodplanes:n,sizelods:r,sigmas:i}}(i)),this._blurmaterial=function(e,n,r){let i=new float32array(20),a=new ny(0,1,0),s=new id({name:"sphericalgaussianblur",defines:{n:20,cubeuv_texel_width:1/n,cubeuv_texel_height:1/r,cubeuv_max_mip:`${e}.0`},uniforms:{envmap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dtheta:{value:0},mipint:{value:0},poleaxis:{value:a}},vertexshader:au(),fragmentshader:` precision mediump float; precision mediump int; varying vec3 voutputdirection; uniform sampler2d envmap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dtheta; uniform float mipint; uniform vec3 poleaxis; #define envmap_type_cube_uv #include vec3 getsample( float theta, vec3 axis ) { float costheta = cos( theta ); // rodrigues' axis-angle rotation vec3 sampledirection = voutputdirection * costheta + cross( axis, voutputdirection ) * sin( theta ) + axis * dot( axis, voutputdirection ) * ( 1.0 - costheta ); return bilinearcubeuv( envmap, sampledirection, mipint ); } void main() { vec3 axis = latitudinal ? poleaxis : cross( poleaxis, voutputdirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( voutputdirection.z, 0.0, - voutputdirection.x ); } axis = normalize( axis ); gl_fragcolor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_fragcolor.rgb += weights[ 0 ] * getsample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dtheta * float( i ); gl_fragcolor.rgb += weights[ i ] * getsample( -1.0 * theta, axis ); gl_fragcolor.rgb += weights[ i ] * getsample( theta, axis ); } } `,blending:s,depthtest:!1,depthwrite:!1});return s}(i,e,n)}return i}_compilematerial(e){let n=new ie(this._lodplanes[0],e);this._renderer.compile(n,i8)}_scenetocubeuv(e,n,r,i){let a=new io(90,1,n,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoclear,c=l.tonemapping;l.getclearcolor(i7),l.tonemapping=er,l.autoclear=!1;let h=new r0({name:"pmrem.background",side:a,depthwrite:!1,depthtest:!1}),d=new ie(new ib,h),p=!1,f=e.background;f?f.iscolor&&(h.color.copy(f),e.background=null,p=!0):(h.color.copy(i7),p=!0);for(let n=0;n<6;n++){let r=n%3;0===r?(a.up.set(0,s[n],0),a.lookat(o[n],0,0)):1===r?(a.up.set(0,0,s[n]),a.lookat(0,o[n],0)):(a.up.set(0,s[n],0),a.lookat(0,0,o[n]));let u=this._cubesize;as(i,r*u,n>2?u:0,u,u),l.setrendertarget(i),p&&l.render(d,a),l.render(e,a)}d.geometry.dispose(),d.material.dispose(),l.tonemapping=c,l.autoclear=u,e.background=f}_texturetocubeuv(e,n){let r=this._renderer,i=e.mapping===ec||e.mapping===eh;i?(null===this._cubemapmaterial&&(this._cubemapmaterial=al()),this._cubemapmaterial.uniforms.flipenvmap.value=!1===e.isrendertargettexture?-1:1):null===this._equirectmaterial&&(this._equirectmaterial=ao());let a=i?this._cubemapmaterial:this._equirectmaterial,s=new ie(this._lodplanes[0],a),o=a.uniforms;o.envmap.value=e;let l=this._cubesize;as(n,0,0,3*l,2*l),r.setrendertarget(n),r.render(s,i8)}_applypmrem(e){let n=this._renderer,r=n.autoclear;n.autoclear=!1;for(let n=1;n20&&console.warn(`sigmaradians, ${a}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);let g=[],v=0;for(let e=0;e<20;++e){let n=e/f,r=math.exp(-n*n/2);g.push(r),0===e?v+=r:ey-4?i-y+4:0),_,3*x,2*x),l.setrendertarget(n),l.render(c,i8)}}function aa(e,n,r){let i=new nz(e,n,r);return i.texture.mapping=ef,i.texture.name="pmrem.cubeuv",i.scissortest=!0,i}function as(e,n,r,i,a){e.viewport.set(n,r,i,a),e.scissor.set(n,r,i,a)}function ao(){return new id({name:"equirectangulartocubeuv",uniforms:{envmap:{value:null}},vertexshader:au(),fragmentshader:` precision mediump float; precision mediump int; varying vec3 voutputdirection; uniform sampler2d envmap; #include void main() { vec3 outputdirection = normalize( voutputdirection ); vec2 uv = equirectuv( outputdirection ); gl_fragcolor = vec4( texture2d ( envmap, uv ).rgb, 1.0 ); } `,blending:s,depthtest:!1,depthwrite:!1})}function al(){return new id({name:"cubemaptocubeuv",uniforms:{envmap:{value:null},flipenvmap:{value:-1}},vertexshader:au(),fragmentshader:` precision mediump float; precision mediump int; uniform float flipenvmap; varying vec3 voutputdirection; uniform samplercube envmap; void main() { gl_fragcolor = texturecube( envmap, vec3( flipenvmap * voutputdirection.x, voutputdirection.yz ) ); } `,blending:s,depthtest:!1,depthwrite:!1})}function au(){return` precision mediump float; precision mediump int; attribute float faceindex; varying vec3 voutputdirection; // rh coordinate system; pmrem face-indexing convention vec3 getdirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { voutputdirection = getdirection( uv, faceindex ); gl_position = vec4( position, 1.0 ); } `}function ac(e){let n=new weakmap,r=null;function i(e){let r=e.target;r.removeeventlistener("dispose",i);let a=n.get(r);void 0!==a&&(n.delete(r),a.dispose())}return{get:function(a){if(a&&a.istexture){let s=a.mapping,o=s===ed||s===ep,l=s===ec||s===eh;if(o||l){if(a.isrendertargettexture&&!0===a.needspmremupdate){a.needspmremupdate=!1;let i=n.get(a);return null===r&&(r=new ai(e)),i=o?r.fromequirectangular(a,i):r.fromcubemap(a,i),n.set(a,i),i.texture}if(n.has(a))return n.get(a).texture;{let s=a.image;if(!(o&&s&&s.height>0||l&&s&&function(e){let n=0;for(let r=0;r<6;r++)void 0!==e[r]&&n++;return 6===n}(s)))return null;{null===r&&(r=new ai(e));let s=o?r.fromequirectangular(a):r.fromcubemap(a);return n.set(a,s),a.addeventlistener("dispose",i),s.texture}}}}return a},dispose:function(){n=new weakmap,null!==r&&(r.dispose(),r=null)}}}function ah(e){let n={};function r(r){let i;if(void 0!==n[r])return n[r];switch(r){case"webgl_depth_texture":i=e.getextension("webgl_depth_texture")||e.getextension("moz_webgl_depth_texture")||e.getextension("webkit_webgl_depth_texture");break;case"ext_texture_filter_anisotropic":i=e.getextension("ext_texture_filter_anisotropic")||e.getextension("moz_ext_texture_filter_anisotropic")||e.getextension("webkit_ext_texture_filter_anisotropic");break;case"webgl_compressed_texture_s3tc":i=e.getextension("webgl_compressed_texture_s3tc")||e.getextension("moz_webgl_compressed_texture_s3tc")||e.getextension("webkit_webgl_compressed_texture_s3tc");break;case"webgl_compressed_texture_pvrtc":i=e.getextension("webgl_compressed_texture_pvrtc")||e.getextension("webkit_webgl_compressed_texture_pvrtc");break;default:i=e.getextension(r)}return n[r]=i,i}return{has:function(e){return null!==r(e)},init:function(e){e.iswebgl2?r("ext_color_buffer_float"):(r("webgl_depth_texture"),r("oes_texture_float"),r("oes_texture_half_float"),r("oes_texture_half_float_linear"),r("oes_standard_derivatives"),r("oes_element_index_uint"),r("oes_vertex_array_object"),r("angle_instanced_arrays")),r("oes_texture_float_linear"),r("ext_color_buffer_half_float"),r("webgl_multisampled_render_to_texture")},get:function(e){let n=r(e);return null===n&&console.warn("three.webglrenderer: "+e+" extension not supported."),n}}}function ad(e,n,r,i){let a={},s=new weakmap;function o(e){let l=e.target;for(let e in null!==l.index&&n.remove(l.index),l.attributes)n.remove(l.attributes[e]);l.removeeventlistener("dispose",o),delete a[l.id];let u=s.get(l);u&&(n.remove(u),s.delete(l)),i.releasestatesofgeometry(l),!0===l.isinstancedbuffergeometry&&delete l._maxinstancecount,r.memory.geometries--}function l(e){let r=[],i=e.index,a=e.attributes.position,o=0;if(null!==i){let e=i.array;o=i.version;for(let n=0,i=e.length;nn.maxtexturesize&&(m=math.ceil(f/n.maxtexturesize),f=n.maxtexturesize);let g=new float32array(f*m*4*a),v=new nv(g,f,m,a);v.type=ed,v.needsupdate=!0;let y=4*p;for(let n=0;n0)return e;let a=n*r,s=am[a];if(void 0===s&&(s=new float32array(a),am[a]=s),0!==n){i.toarray(s,0);for(let i=1,a=0;i!==n;++i)a+=r,e[i].toarray(s,a)}return s}function ab(e,n){if(e.length!==n.length)return!1;for(let r=0,i=e.length;r":" "} ${a}: ${r[e]}`)}return i.join("\n")}(e.getshadersource(n),i)}}function sm(e){return""!==e}function sg(e,n){let r=n.numspotlightshadows+n.numspotlightmaps-n.numspotlightshadowswithmaps;return e.replace(/num_dir_lights/g,n.numdirlights).replace(/num_spot_lights/g,n.numspotlights).replace(/num_spot_light_maps/g,n.numspotlightmaps).replace(/num_spot_light_coords/g,r).replace(/num_rect_area_lights/g,n.numrectarealights).replace(/num_point_lights/g,n.numpointlights).replace(/num_hemi_lights/g,n.numhemilights).replace(/num_dir_light_shadows/g,n.numdirlightshadows).replace(/num_spot_light_shadows_with_maps/g,n.numspotlightshadowswithmaps).replace(/num_spot_light_shadows/g,n.numspotlightshadows).replace(/num_point_light_shadows/g,n.numpointlightshadows)}function sv(e,n){return e.replace(/num_clipping_planes/g,n.numclippingplanes).replace(/union_clipping_planes/g,n.numclippingplanes-n.numclipintersection)}let sy=/^[ \t]*#include +<([\w\d./]+)>/gm;function sx(e){return e.replace(sy,s_)}function s_(e,n){let r=iq[n];if(void 0===r)throw error("can not resolve #include <"+n+">");return sx(r)}let sa=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\s]+?)}\s+#pragma unroll_loop_end/g;function sb(e){return e.replace(sa,sm)}function sm(e,n,r,i){let a="";for(let e=parseint(n);e0&&(a+="\n"),(s=[m,s].filter(sm).join("\n")).length>0&&(s+="\n")):(a=[ss(r),"#define shader_name "+r.shadername,s,r.instancing?"#define use_instancing":"",r.instancingcolor?"#define use_instancing_color":"",r.supportsvertextextures?"#define vertex_textures":"",r.usefog&&r.fog?"#define use_fog":"",r.usefog&&r.fogexp2?"#define fog_exp2":"",r.map?"#define use_map":"",r.envmap?"#define use_envmap":"",r.envmap?"#define "+_:"",r.lightmap?"#define use_lightmap":"",r.aomap?"#define use_aomap":"",r.emissivemap?"#define use_emissivemap":"",r.bumpmap?"#define use_bumpmap":"",r.normalmap?"#define use_normalmap":"",r.normalmap&&r.objectspacenormalmap?"#define objectspace_normalmap":"",r.normalmap&&r.tangentspacenormalmap?"#define tangentspace_normalmap":"",r.clearcoatmap?"#define use_clearcoatmap":"",r.clearcoatroughnessmap?"#define use_clearcoat_roughnessmap":"",r.clearcoatnormalmap?"#define use_clearcoat_normalmap":"",r.iridescencemap?"#define use_iridescencemap":"",r.iridescencethicknessmap?"#define use_iridescence_thicknessmap":"",r.displacementmap&&r.supportsvertextextures?"#define use_displacementmap":"",r.specularmap?"#define use_specularmap":"",r.specularintensitymap?"#define use_specularintensitymap":"",r.specularcolormap?"#define use_specularcolormap":"",r.roughnessmap?"#define use_roughnessmap":"",r.metalnessmap?"#define use_metalnessmap":"",r.alphamap?"#define use_alphamap":"",r.transmission?"#define use_transmission":"",r.transmissionmap?"#define use_transmissionmap":"",r.thicknessmap?"#define use_thicknessmap":"",r.sheencolormap?"#define use_sheencolormap":"",r.sheenroughnessmap?"#define use_sheenroughnessmap":"",r.vertextangents?"#define use_tangent":"",r.vertexcolors?"#define use_color":"",r.vertexalphas?"#define use_color_alpha":"",r.vertexuvs?"#define use_uv":"",r.uvsvertexonly?"#define uvs_vertex_only":"",r.flatshading?"#define flat_shaded":"",r.skinning?"#define use_skinning":"",r.morphtargets?"#define use_morphtargets":"",r.morphnormals&&!1===r.flatshading?"#define use_morphnormals":"",r.morphcolors&&r.iswebgl2?"#define use_morphcolors":"",r.morphtargetscount>0&&r.iswebgl2?"#define morphtargets_texture":"",r.morphtargetscount>0&&r.iswebgl2?"#define morphtargets_texture_stride "+r.morphtexturestride:"",r.morphtargetscount>0&&r.iswebgl2?"#define morphtargets_count "+r.morphtargetscount:"",r.doublesided?"#define double_sided":"",r.flipsided?"#define flip_sided":"",r.shadowmapenabled?"#define use_shadowmap":"",r.shadowmapenabled?"#define "+m:"",r.sizeattenuation?"#define use_sizeattenuation":"",r.logarithmicdepthbuffer?"#define use_logdepthbuf":"",r.logarithmicdepthbuffer&&r.rendererextensionfragdepth?"#define use_logdepthbuf_ext":"","uniform mat4 modelmatrix;","uniform mat4 modelviewmatrix;","uniform mat4 projectionmatrix;","uniform mat4 viewmatrix;","uniform mat3 normalmatrix;","uniform vec3 cameraposition;","uniform bool isorthographic;","#ifdef use_instancing"," attribute mat4 instancematrix;","#endif","#ifdef use_instancing_color"," attribute vec3 instancecolor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef use_tangent"," attribute vec4 tangent;","#endif","#if defined( use_color_alpha )"," attribute vec4 color;","#elif defined( use_color )"," attribute vec3 color;","#endif","#if ( defined( use_morphtargets ) && ! defined( morphtargets_texture ) )"," 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","\n"].filter(sm).join("\n"),s=[m,ss(r),"#define shader_name "+r.shadername,s,r.usefog&&r.fog?"#define use_fog":"",r.usefog&&r.fogexp2?"#define fog_exp2":"",r.map?"#define use_map":"",r.matcap?"#define use_matcap":"",r.envmap?"#define use_envmap":"",r.envmap?"#define "+g:"",r.envmap?"#define "+_:"",r.envmap?"#define "+a:"",b?"#define cubeuv_texel_width "+b.texelwidth:"",b?"#define cubeuv_texel_height "+b.texelheight:"",b?"#define cubeuv_max_mip "+b.maxmip+".0":"",r.lightmap?"#define use_lightmap":"",r.aomap?"#define use_aomap":"",r.emissivemap?"#define use_emissivemap":"",r.bumpmap?"#define use_bumpmap":"",r.normalmap?"#define use_normalmap":"",r.normalmap&&r.objectspacenormalmap?"#define objectspace_normalmap":"",r.normalmap&&r.tangentspacenormalmap?"#define tangentspace_normalmap":"",r.clearcoat?"#define use_clearcoat":"",r.clearcoatmap?"#define use_clearcoatmap":"",r.clearcoatroughnessmap?"#define use_clearcoat_roughnessmap":"",r.clearcoatnormalmap?"#define use_clearcoat_normalmap":"",r.iridescence?"#define use_iridescence":"",r.iridescencemap?"#define use_iridescencemap":"",r.iridescencethicknessmap?"#define use_iridescence_thicknessmap":"",r.specularmap?"#define use_specularmap":"",r.specularintensitymap?"#define use_specularintensitymap":"",r.specularcolormap?"#define use_specularcolormap":"",r.roughnessmap?"#define use_roughnessmap":"",r.metalnessmap?"#define use_metalnessmap":"",r.alphamap?"#define use_alphamap":"",r.alphatest?"#define use_alphatest":"",r.sheen?"#define use_sheen":"",r.sheencolormap?"#define use_sheencolormap":"",r.sheenroughnessmap?"#define use_sheenroughnessmap":"",r.transmission?"#define use_transmission":"",r.transmissionmap?"#define use_transmissionmap":"",r.thicknessmap?"#define use_thicknessmap":"",r.decodevideotexture?"#define decode_video_texture":"",r.vertextangents?"#define use_tangent":"",r.vertexcolors||r.instancingcolor?"#define use_color":"",r.vertexalphas?"#define use_color_alpha":"",r.vertexuvs?"#define use_uv":"",r.uvsvertexonly?"#define uvs_vertex_only":"",r.gradientmap?"#define use_gradientmap":"",r.flatshading?"#define flat_shaded":"",r.doublesided?"#define double_sided":"",r.flipsided?"#define flip_sided":"",r.shadowmapenabled?"#define use_shadowmap":"",r.shadowmapenabled?"#define "+m:"",r.premultipliedalpha?"#define premultiplied_alpha":"",r.physicallycorrectlights?"#define physically_correct_lights":"",r.logarithmicdepthbuffer?"#define use_logdepthbuf":"",r.logarithmicdepthbuffer&&r.rendererextensionfragdepth?"#define use_logdepthbuf_ext":"","uniform mat4 viewmatrix;","uniform vec3 cameraposition;","uniform bool isorthographic;",r.tonemapping!==er?"#define tone_mapping":"",r.tonemapping!==er?iq.tonemapping_pars_fragment:"",r.tonemapping!==er?function(e,n){let r;switch(n){case ei:r="linear";break;case ea:r="reinhard";break;case es:r="optimizedcineon";break;case eo:r="acesfilmic";break;case el:r="custom";break;default:console.warn("three.webglprogram: unsupported tonemapping:",n),r="linear"}return"vec3 "+e+"( vec3 color ) { return "+r+"tonemapping( color ); }"}("tonemapping",r.tonemapping):"",r.dithering?"#define dithering":"",r.opaque?"#define opaque":"",iq.encodings_pars_fragment,function(e,n){let r=function(e){switch(e){case tp:return["linear","( value )"];case tr:return["srgb","( value )"];default:return console.warn("three.webglprogram: unsupported encoding:",e),["linear","( value )"]}}(n);return"vec4 "+e+"( vec4 value ) { return linearto"+r[0]+r[1]+"; }"}("lineartooutputtexel",r.outputencoding),r.usedepthpacking?"#define depth_packing "+r.depthpacking:"","\n"].filter(sm).join("\n")),p=sv(p=sg(p=sx(p),r),r),f=sv(f=sg(f=sx(f),r),r),p=sb(p),f=sb(f),r.iswebgl2&&!0!==r.israwshadermaterial&&(c="#version 300 es\n",a="precision mediump sampler2darray;\n#define attribute in\n#define varying out\n#define texture2d texture\n"+a,s=["#define varying in",r.glslversion===nt?"":"layout(location = 0) out highp vec4 pc_fragcolor;",r.glslversion===nt?"":"#define gl_fragcolor pc_fragcolor","#define gl_fragdepthext gl_fragdepth","#define texture2d texture","#define texturecube texture","#define texture2dproj textureproj","#define texture2dlodext texturelod","#define texture2dprojlodext textureprojlod","#define texturecubelodext texturelod","#define texture2dgradext texturegrad","#define texture2dprojgradext textureprojgrad","#define texturecubegradext texturegrad"].join("\n")+"\n"+s);let e=c+a+p,t=c+s+f,b=sd(h,35633,e),p=sd(h,35632,t);if(h.attachshader(w,b),h.attachshader(w,p),void 0!==r.index0attributename?h.bindattriblocation(w,0,r.index0attributename):!0===r.morphtargets&&h.bindattriblocation(w,0,"position"),h.linkprogram(w),e.debug.checkshadererrors){let e=h.getprograminfolog(w).trim(),n=h.getshaderinfolog(b).trim(),r=h.getshaderinfolog(p).trim(),i=!0,o=!0;if(!1===h.getprogramparameter(w,35714)){i=!1;let n=sf(h,b,"vertex"),r=sf(h,p,"fragment");console.error("three.webglprogram: shader error "+h.geterror()+" - validate_status "+h.getprogramparameter(w,35715)+"\n\nprogram info log: "+e+"\n"+n+"\n"+r)}else""!==e?console.warn("three.webglprogram: program info log:",e):(""===n||""===r)&&(o=!1);o&&(this.diagnostics={runnable:i,programlog:e,vertexshader:{log:n,prefix:a},fragmentshader:{log:r,prefix:s}})}return h.deleteshader(b),h.deleteshader(p),this.getuniforms=function(){return void 0===o&&(o=new sh(h,w)),o},this.getattributes=function(){return void 0===l&&(l=function(e,n){let r={},i=e.getprogramparameter(n,35721);for(let a=0;a0,o=s.clearcoat>0,n=s.iridescence>0,k={iswebgl2:h,shaderid:p,shadername:s.type,vertexshader:y,fragmentshader:x,defines:s.defines,customvertexshaderid:_,customfragmentshaderid:m,israwshadermaterial:!0===s.israwshadermaterial,glslversion:s.glslversion,precision:f,instancing:!0===v.isinstancedmesh,instancingcolor:!0===v.isinstancedmesh&&null!==v.instancecolor,supportsvertextextures:p,outputencoding:null===d?e.outputencoding:!0===d.isxrrendertarget?d.texture.encoding:tp,map:!!s.map,matcap:!!s.matcap,envmap:!!t,envmapmode:t&&t.mapping,envmapcubeuvheight:b,lightmap:!!s.lightmap,aomap:!!s.aomap,emissivemap:!!s.emissivemap,bumpmap:!!s.bumpmap,normalmap:!!s.normalmap,objectspacenormalmap:s.normalmaptype===tf,tangentspacenormalmap:s.normalmaptype===td,decodevideotexture:!!s.map&&!0===s.map.isvideotexture&&s.map.encoding===tr,clearcoat:o,clearcoatmap:o&&!!s.clearcoatmap,clearcoatroughnessmap:o&&!!s.clearcoatroughnessmap,clearcoatnormalmap:o&&!!s.clearcoatnormalmap,iridescence:n,iridescencemap:n&&!!s.iridescencemap,iridescencethicknessmap:n&&!!s.iridescencethicknessmap,displacementmap:!!s.displacementmap,roughnessmap:!!s.roughnessmap,metalnessmap:!!s.metalnessmap,specularmap:!!s.specularmap,specularintensitymap:!!s.specularintensitymap,specularcolormap:!!s.specularcolormap,opaque:!1===s.transparent&&s.blending===w,alphamap:!!s.alphamap,alphatest:f,gradientmap:!!s.gradientmap,sheen:s.sheen>0,sheencolormap:!!s.sheencolormap,sheenroughnessmap:!!s.sheenroughnessmap,transmission:s.transmission>0,transmissionmap:!!s.transmissionmap,thicknessmap:!!s.thicknessmap,combine:s.combine,vertextangents:!!s.normalmap&&!!c.attributes.tangent,vertexcolors:s.vertexcolors,vertexalphas:!0===s.vertexcolors&&!!c.attributes.color&&4===c.attributes.color.itemsize,vertexuvs:!!s.map||!!s.bumpmap||!!s.normalmap||!!s.specularmap||!!s.alphamap||!!s.emissivemap||!!s.roughnessmap||!!s.metalnessmap||!!s.clearcoatmap||!!s.clearcoatroughnessmap||!!s.clearcoatnormalmap||!!s.iridescencemap||!!s.iridescencethicknessmap||!!s.displacementmap||!!s.transmissionmap||!!s.thicknessmap||!!s.specularintensitymap||!!s.specularcolormap||!!s.sheencolormap||!!s.sheenroughnessmap,uvsvertexonly:!(s.map||s.bumpmap||s.normalmap||s.specularmap||s.alphamap||s.emissivemap||s.roughnessmap||s.metalnessmap||s.clearcoatnormalmap||s.iridescencemap||s.iridescencethicknessmap||s.transmission>0||s.transmissionmap||s.thicknessmap||s.specularintensitymap||s.specularcolormap||s.sheen>0||s.sheencolormap||s.sheenroughnessmap)&&!!s.displacementmap,fog:!!s,usefog:!0===s.fog,fogexp2:s&&s.isfogexp2,flatshading:!!s.flatshading,sizeattenuation:s.sizeattenuation,logarithmicdepthbuffer:d,skinning:!0===v.isskinnedmesh,morphtargets:void 0!==c.morphattributes.position,morphnormals:void 0!==c.morphattributes.normal,morphcolors:void 0!==c.morphattributes.color,morphtargetscount:l,morphtexturestride:i,numdirlights:l.directional.length,numpointlights:l.point.length,numspotlights:l.spot.length,numspotlightmaps:l.spotlightmap.length,numrectarealights:l.rectarea.length,numhemilights:l.hemi.length,numdirlightshadows:l.directionalshadowmap.length,numpointlightshadows:l.pointshadowmap.length,numspotlightshadows:l.spotshadowmap.length,numspotlightshadowswithmaps:l.numspotlightshadowswithmaps,numclippingplanes:o.numplanes,numclipintersection:o.numintersection,dithering:s.dithering,shadowmapenabled:e.shadowmap.enabled&&c.length>0,shadowmaptype:e.shadowmap.type,tonemapping:s.tonemapped?e.tonemapping:er,physicallycorrectlights:e.physicallycorrectlights,premultipliedalpha:s.premultipliedalpha,doublesided:s.side===b,flipsided:s.side===a,usedepthpacking:!!s.depthpacking,depthpacking:s.depthpacking||0,index0attributename:s.index0attributename,extensionderivatives:s.extensions&&s.extensions.derivatives,extensionfragdepth:s.extensions&&s.extensions.fragdepth,extensiondrawbuffers:s.extensions&&s.extensions.drawbuffers,extensionshadertexturelod:s.extensions&&s.extensions.shadertexturelod,rendererextensionfragdepth:h||i.has("ext_frag_depth"),rendererextensiondrawbuffers:h||i.has("webgl_draw_buffers"),rendererextensionshadertexturelod:h||i.has("ext_shader_texture_lod"),customprogramcachekey:s.customprogramcachekey()};return k},getprogramcachekey:function(n){let r=[];if(n.shaderid?r.push(n.shaderid):(r.push(n.customvertexshaderid),r.push(n.customfragmentshaderid)),void 0!==n.defines)for(let e in n.defines)r.push(e),r.push(n.defines[e]);return!1===n.israwshadermaterial&&(r.push(n.precision),r.push(n.outputencoding),r.push(n.envmapmode),r.push(n.envmapcubeuvheight),r.push(n.combine),r.push(n.vertexuvs),r.push(n.fogexp2),r.push(n.sizeattenuation),r.push(n.morphtargetscount),r.push(n.morphattributecount),r.push(n.numdirlights),r.push(n.numpointlights),r.push(n.numspotlights),r.push(n.numspotlightmaps),r.push(n.numhemilights),r.push(n.numrectarealights),r.push(n.numdirlightshadows),r.push(n.numpointlightshadows),r.push(n.numspotlightshadows),r.push(n.numspotlightshadowswithmaps),r.push(n.shadowmaptype),r.push(n.tonemapping),r.push(n.numclippingplanes),r.push(n.numclipintersection),r.push(n.depthpacking),l.disableall(),n.iswebgl2&&l.enable(0),n.supportsvertextextures&&l.enable(1),n.instancing&&l.enable(2),n.instancingcolor&&l.enable(3),n.map&&l.enable(4),n.matcap&&l.enable(5),n.envmap&&l.enable(6),n.lightmap&&l.enable(7),n.aomap&&l.enable(8),n.emissivemap&&l.enable(9),n.bumpmap&&l.enable(10),n.normalmap&&l.enable(11),n.objectspacenormalmap&&l.enable(12),n.tangentspacenormalmap&&l.enable(13),n.clearcoat&&l.enable(14),n.clearcoatmap&&l.enable(15),n.clearcoatroughnessmap&&l.enable(16),n.clearcoatnormalmap&&l.enable(17),n.iridescence&&l.enable(18),n.iridescencemap&&l.enable(19),n.iridescencethicknessmap&&l.enable(20),n.displacementmap&&l.enable(21),n.specularmap&&l.enable(22),n.roughnessmap&&l.enable(23),n.metalnessmap&&l.enable(24),n.gradientmap&&l.enable(25),n.alphamap&&l.enable(26),n.alphatest&&l.enable(27),n.vertexcolors&&l.enable(28),n.vertexalphas&&l.enable(29),n.vertexuvs&&l.enable(30),n.vertextangents&&l.enable(31),n.uvsvertexonly&&l.enable(32),r.push(l.mask),l.disableall(),n.fog&&l.enable(0),n.usefog&&l.enable(1),n.flatshading&&l.enable(2),n.logarithmicdepthbuffer&&l.enable(3),n.skinning&&l.enable(4),n.morphtargets&&l.enable(5),n.morphnormals&&l.enable(6),n.morphcolors&&l.enable(7),n.premultipliedalpha&&l.enable(8),n.shadowmapenabled&&l.enable(9),n.physicallycorrectlights&&l.enable(10),n.doublesided&&l.enable(11),n.flipsided&&l.enable(12),n.usedepthpacking&&l.enable(13),n.dithering&&l.enable(14),n.specularintensitymap&&l.enable(15),n.specularcolormap&&l.enable(16),n.transmission&&l.enable(17),n.transmissionmap&&l.enable(18),n.thicknessmap&&l.enable(19),n.sheen&&l.enable(20),n.sheencolormap&&l.enable(21),n.sheenroughnessmap&&l.enable(22),n.decodevideotexture&&l.enable(23),n.opaque&&l.enable(24),r.push(l.mask),r.push(e.outputencoding)),r.push(n.customprogramcachekey),r.join()},getuniforms:function(e){let n;let r=m[e.type];if(r){let e=iz[r];n=ii.clone(e.uniforms)}else n=e.uniforms;return n},acquireprogram:function(n,r){let i;for(let e=0,n=c.length;e0?i.push(h):!0===o.transparent?a.push(h):r.push(h)},unshift:function(e,n,o,l,u,c){let h=s(e,n,o,l,u,c);o.transmission>0?i.unshift(h):!0===o.transparent?a.unshift(h):r.unshift(h)},finish:function(){for(let r=n,i=e.length;r1&&r.sort(e||sr),i.length>1&&i.sort(n||sl),a.length>1&&a.sort(n||sl)}}}function sd(){let e=new weakmap;return{get:function(n,r){let i;let a=e.get(n);return void 0===a?(i=new si,e.set(n,[i])):r>=a.length?(i=new si,a.push(i)):i=a[r],i},dispose:function(){e=new weakmap}}}function sf(){let e={};return{get:function(n){let r;if(void 0!==e[n.id])return e[n.id];switch(n.type){case"directionallight":r={direction:new ny,color:new nf};break;case"spotlight":r={position:new ny,direction:new ny,color:new nf,distance:0,conecos:0,penumbracos:0,decay:0};break;case"pointlight":r={position:new ny,color:new nf,distance:0,decay:0};break;case"hemispherelight":r={direction:new ny,skycolor:new nf,groundcolor:new nf};break;case"rectarealight":r={color:new nf,position:new ny,halfwidth:new ny,halfheight:new ny}}return e[n.id]=r,r}}}let so=0;function sn(e,n){return(n.castshadow?2:0)-(e.castshadow?2:0)+(n.map?1:0)-(e.map?1:0)}function sk(e,n){let r=new sf,i=function(){let e={};return{get:function(n){let r;if(void 0!==e[n.id])return e[n.id];switch(n.type){case"directionallight":case"spotlight":r={shadowbias:0,shadownormalbias:0,shadowradius:1,shadowmapsize:new ny};break;case"pointlight":r={shadowbias:0,shadownormalbias:0,shadowradius:1,shadowmapsize:new ny,shadowcameranear:1,shadowcamerafar:1e3}}return e[n.id]=r,r}}}(),a={version:0,hash:{directionallength:-1,pointlength:-1,spotlength:-1,rectarealength:-1,hemilength:-1,numdirectionalshadows:-1,numpointshadows:-1,numspotshadows:-1,numspotmaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalshadow:[],directionalshadowmap:[],directionalshadowmatrix:[],spot:[],spotlightmap:[],spotshadow:[],spotshadowmap:[],spotlightmatrix:[],rectarea:[],rectarealtc1:null,rectarealtc2:null,point:[],pointshadow:[],pointshadowmap:[],pointshadowmatrix:[],hemi:[],numspotlightshadowswithmaps:0};for(let e=0;e<9;e++)a.probe.push(new ny);let s=new ny,o=new rm,l=new rm;return{setup:function(s,o){let l=0,u=0,c=0;for(let e=0;e<9;e++)a.probe[e].set(0,0,0);let h=0,d=0,p=0,f=0,m=0,g=0,v=0,y=0,x=0,_=0;s.sort(sn);let a=!0!==o?math.pi:1;for(let e=0,n=s.length;e0&&(n.iswebgl2?(a.rectarealtc1=iq.ltc_float_1,a.rectarealtc2=iq.ltc_float_2):!0===e.has("oes_texture_float_linear")?(a.rectarealtc1=iq.ltc_float_1,a.rectarealtc2=iq.ltc_float_2):!0===e.has("oes_texture_half_float_linear")?(a.rectarealtc1=iq.ltc_half_1,a.rectarealtc2=iq.ltc_half_2):console.error("three.webglrenderer: unable to use rectarealight. missing webgl extensions.")),a.ambient[0]=l,a.ambient[1]=u,a.ambient[2]=c;let b=a.hash;(b.directionallength!==h||b.pointlength!==d||b.spotlength!==p||b.rectarealength!==f||b.hemilength!==m||b.numdirectionalshadows!==g||b.numpointshadows!==v||b.numspotshadows!==y||b.numspotmaps!==x)&&(a.directional.length=h,a.spot.length=p,a.rectarea.length=f,a.point.length=d,a.hemi.length=m,a.directionalshadow.length=g,a.directionalshadowmap.length=g,a.pointshadow.length=v,a.pointshadowmap.length=v,a.spotshadow.length=y,a.spotshadowmap.length=y,a.directionalshadowmatrix.length=g,a.pointshadowmatrix.length=v,a.spotlightmatrix.length=y+x-_,a.spotlightmap.length=x,a.numspotlightshadowswithmaps=_,b.directionallength=h,b.pointlength=d,b.spotlength=p,b.rectarealength=f,b.hemilength=m,b.numdirectionalshadows=g,b.numpointshadows=v,b.numspotshadows=y,b.numspotmaps=x,a.version=so++)},setupview:function(e,n){let r=0,i=0,u=0,c=0,h=0,d=n.matrixworldinverse;for(let n=0,p=e.length;n=o.length?(s=new sh(e,n),o.push(s)):s=o[a],s},dispose:function(){r=new weakmap}}}class su extends r${constructor(e){super(),this.ismeshdepthmaterial=!0,this.type="meshdepthmaterial",this.depthpacking=tl,this.map=null,this.alphamap=null,this.displacementmap=null,this.displacementscale=1,this.displacementbias=0,this.wireframe=!1,this.wireframelinewidth=1,this.setvalues(e)}copy(e){return super.copy(e),this.depthpacking=e.depthpacking,this.map=e.map,this.alphamap=e.alphamap,this.displacementmap=e.displacementmap,this.displacementscale=e.displacementscale,this.displacementbias=e.displacementbias,this.wireframe=e.wireframe,this.wireframelinewidth=e.wireframelinewidth,this}}class sz extends r${constructor(e){super(),this.ismeshdistancematerial=!0,this.type="meshdistancematerial",this.referenceposition=new ny,this.neardistance=1,this.fardistance=1e3,this.map=null,this.alphamap=null,this.displacementmap=null,this.displacementscale=1,this.displacementbias=0,this.setvalues(e)}copy(e){return super.copy(e),this.referenceposition.copy(e.referenceposition),this.neardistance=e.neardistance,this.fardistance=e.fardistance,this.map=e.map,this.alphamap=e.alphamap,this.displacementmap=e.displacementmap,this.displacementscale=e.displacementscale,this.displacementbias=e.displacementbias,this}}function sv(e,n,r){let i=new ij,a=new ny,s=new ny,o=new nu,l=new su({depthpacking:ti}),u=new sz,c={},h=r.maxtexturesize,d={[_]:a,[a]:_,[b]:b},p=new id({defines:{vsm_samples:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ny},radius:{value:4}},vertexshader:"void main() {\n gl_position = vec4( position, 1.0 );\n}",fragmentshader:"uniform sampler2d shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n const float samples = float( vsm_samples );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvstride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvstart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvoffset = uvstart + i * uvstride;\n #ifdef horizontal_pass\n vec2 distribution = unpackrgbato2half( texture2d( shadow_pass, ( gl_fragcoord.xy + vec2( uvoffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackrgbatodepth( texture2d( shadow_pass, ( gl_fragcoord.xy + vec2( 0.0, uvoffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_fragcolor = pack2halftorgba( vec2( mean, std_dev ) );\n}"}),f=p.clone();f.defines.horizontal_pass=1;let m=new id;m.setattribute("position",new r3(new float32array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new ie(m,p),y=this;function m(n,r,i,a,s,o){let h=null,p=!0===i.ispointlight?n.customdistancematerial:n.customdepthmaterial;if(void 0!==p)h=p;else if(h=!0===i.ispointlight?u:l,e.localclippingenabled&&!0===r.clipshadows&&array.isarray(r.clippingplanes)&&0!==r.clippingplanes.length||r.displacementmap&&0!==r.displacementscale||r.alphamap&&r.alphatest>0||r.map&&r.alphatest>0){let e=h.uuid,n=r.uuid,i=c[e];void 0===i&&(i={},c[e]=i);let a=i[n];void 0===a&&(a=h.clone(),i[n]=a),h=a}return h.visible=r.visible,h.wireframe=r.wireframe,o===x?h.side=null!==r.shadowside?r.shadowside:r.side:h.side=null!==r.shadowside?r.shadowside:d[r.side],h.alphamap=r.alphamap,h.alphatest=r.alphatest,h.map=r.map,h.clipshadows=r.clipshadows,h.clippingplanes=r.clippingplanes,h.clipintersection=r.clipintersection,h.displacementmap=r.displacementmap,h.displacementscale=r.displacementscale,h.displacementbias=r.displacementbias,h.wireframelinewidth=r.wireframelinewidth,h.linewidth=r.linewidth,!0===i.ispointlight&&!0===h.ismeshdistancematerial&&(h.referenceposition.setfrommatrixposition(i.matrixworld),h.neardistance=a,h.fardistance=s),h}this.enabled=!1,this.autoupdate=!0,this.needsupdate=!1,this.type=v,this.render=function(r,l,u){if(!1===y.enabled||!1===y.autoupdate&&!1===y.needsupdate||0===r.length)return;let c=e.getrendertarget(),d=e.getactivecubeface(),m=e.getactivemipmaplevel(),v=e.state;v.setblending(s),v.buffers.color.setclear(1,1,1,1),v.buffers.depth.settest(!0),v.setscissortest(!1);for(let c=0,d=r.length;ch||a.y>h)&&(a.x>h&&(s.x=math.floor(h/y.x),a.x=s.x*y.x,m.mapsize.x=s.x),a.y>h&&(s.y=math.floor(h/y.y),a.y=s.y*y.y,m.mapsize.y=s.y)),null===m.map){let e=this.type!==x?{minfilter:ey,magfilter:ey}:{};m.map=new nz(a.x,a.y,e),m.map.texture.name=d.name+".shadowmap",m.camera.updateprojectionmatrix()}e.setrendertarget(m.map),e.clear();let _=m.getviewportcount();for(let r=0;r<_;r++){let a=m.getviewport(r);o.set(s.x*a.x,s.y*a.y,s.x*a.z,s.y*a.w),v.viewport(o),m.updatematrices(d,r),i=m.getfrustum(),function r(a,s,o,l,u){if(!1===a.visible)return;let c=a.layers.test(s.layers);if(c&&(a.ismesh||a.isline||a.ispoints)&&(a.castshadow||a.receiveshadow&&u===x)&&(!a.frustumculled||i.intersectsobject(a))){a.modelviewmatrix.multiplymatrices(o.matrixworldinverse,a.matrixworld);let r=n.update(a),i=a.material;if(array.isarray(i)){let n=r.groups;for(let s=0,c=n.length;s=1:-1!==ed.indexof("opengl es")&&(eh=parsefloat(/^opengl es (\d)/.exec(ed)[1])>=2);let ep=null,ef={},em=e.getparameter(3088),eg=e.getparameter(2978),ev=new nu().fromarray(em),ey=new nu().fromarray(eg);function ex(n,r,i){let a=new uint8array(4),s=e.createtexture();e.bindtexture(n,s),e.texparameteri(n,10241,9728),e.texparameteri(n,10240,9728);for(let n=0;ni||e.height>i)&&(a=i/math.max(e.width,e.height)),a<1||!0===n){if("undefined"!=typeof htmlimageelement&&e instanceof htmlimageelement||"undefined"!=typeof htmlcanvaselement&&e instanceof htmlcanvaselement||"undefined"!=typeof imagebitmap&&e instanceof imagebitmap){let i=n?nf:math.floor,s=i(a*e.width),o=i(a*e.height);void 0===l&&(l=x(s,o));let u=r?x(s,o):l;u.width=s,u.height=o;let c=u.getcontext("2d");return c.drawimage(e,0,0,s,o),console.warn("three.webglrenderer: texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+o+")."),u}"data"in e&&console.warn("three.webglrenderer: image in datatexture is too big ("+e.width+"x"+e.height+").")}return e}function a(e){return nd(e.width)&&nd(e.height)}function b(e,n){return e.generatemipmaps&&n&&e.minfilter!==ey&&e.minfilter!==em}function m(n){e.generatemipmap(n)}function s(r,i,a,s,o=!1){if(!1===u)return i;if(null!==r){if(void 0!==e[r])return e[r];console.warn("three.webglrenderer: attempt to use non-existing webgl internal format '"+r+"'")}let l=i;return 6403===i&&(5126===a&&(l=33326),5131===a&&(l=33325),5121===a&&(l=33321)),33319===i&&(5126===a&&(l=33328),5131===a&&(l=33327),5121===a&&(l=33323)),6408===i&&(5126===a&&(l=34836),5131===a&&(l=34842),5121===a&&(l=s===tr&&!1===o?35907:32856),32819===a&&(l=32854),32820===a&&(l=32855)),(33325===l||33326===l||33327===l||33328===l||34842===l||34836===l)&&n.get("ext_color_buffer_float"),l}function w(e,n,r){return!0===b(e,r)||e.isframebuffertexture&&e.minfilter!==ey&&e.minfilter!==em?math.log2(math.max(n.width,n.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.iscompressedtexture&&array.isarray(e.image)?n.mipmaps.length:1}function c(e){return e===ey||e===ex||e===ea?9728:9729}function e(e){let n=e.target;n.removeeventlistener("dispose",e),function(e){let n=i.get(e);if(void 0===n.__webglinit)return;let r=e.source,a=v.get(r);if(a){let i=a[n.__cachekey];i.usedtimes--,0===i.usedtimes&&b(e),0===object.keys(a).length&&v.delete(r)}i.remove(e)}(n),n.isvideotexture&&g.delete(n)}function t(n){let r=n.target;r.removeeventlistener("dispose",t),function(n){let r=n.texture,a=i.get(n),s=i.get(r);if(void 0!==s.__webgltexture&&(e.deletetexture(s.__webgltexture),o.memory.textures--),n.depthtexture&&n.depthtexture.dispose(),n.iswebglcuberendertarget)for(let n=0;n<6;n++)e.deleteframebuffer(a.__webglframebuffer[n]),a.__webgldepthbuffer&&e.deleterenderbuffer(a.__webgldepthbuffer[n]);else{if(e.deleteframebuffer(a.__webglframebuffer),a.__webgldepthbuffer&&e.deleterenderbuffer(a.__webgldepthbuffer),a.__webglmultisampledframebuffer&&e.deleteframebuffer(a.__webglmultisampledframebuffer),a.__webglcolorrenderbuffer)for(let n=0;n0&&a.__version!==e.version){let r=e.image;if(null===r)console.warn("three.webglrenderer: texture marked for update but no image data found.");else if(!1===r.complete)console.warn("three.webglrenderer: texture marked for update but image is incomplete");else{o(a,e,n);return}}r.bindtexture(3553,a.__webgltexture,33984+n)}let l={[em]:10497,[eg]:33071,[ev]:33648},i={[ey]:9728,[ex]:9984,[ea]:9986,[em]:9729,[es]:9985,[ec]:9987};function d(r,s,o){if(o?(e.texparameteri(r,10242,l[s.wraps]),e.texparameteri(r,10243,l[s.wrapt]),(32879===r||35866===r)&&e.texparameteri(r,32882,l[s.wrapr]),e.texparameteri(r,10240,i[s.magfilter]),e.texparameteri(r,10241,i[s.minfilter])):(e.texparameteri(r,10242,33071),e.texparameteri(r,10243,33071),(32879===r||35866===r)&&e.texparameteri(r,32882,33071),(s.wraps!==eg||s.wrapt!==eg)&&console.warn("three.webglrenderer: texture is not power of two. texture.wraps and texture.wrapt should be set to three.clamptoedgewrapping."),e.texparameteri(r,10240,c(s.magfilter)),e.texparameteri(r,10241,c(s.minfilter)),s.minfilter!==ey&&s.minfilter!==em&&console.warn("three.webglrenderer: texture is not power of two. texture.minfilter should be set to three.nearestfilter or three.linearfilter.")),!0===n.has("ext_texture_filter_anisotropic")){let o=n.get("ext_texture_filter_anisotropic");s.magfilter!==ey&&(s.minfilter===ea||s.minfilter===ec)&&(s.type!==ed||!1!==n.has("oes_texture_float_linear"))&&(!1!==u||s.type!==ef||!1!==n.has("oes_texture_half_float_linear"))&&(s.anisotropy>1||i.get(s).__currentanisotropy)&&(e.texparameterf(r,o.texture_max_anisotropy_ext,math.min(s.anisotropy,a.getmaxanisotropy())),i.get(s).__currentanisotropy=s.anisotropy)}}function f(n,r){let i=!1;void 0===n.__webglinit&&(n.__webglinit=!0,r.addeventlistener("dispose",e));let a=r.source,s=v.get(a);void 0===s&&(s={},v.set(a,s));let l=function(e){let n=[];return n.push(e.wraps),n.push(e.wrapt),n.push(e.wrapr||0),n.push(e.magfilter),n.push(e.minfilter),n.push(e.anisotropy),n.push(e.internalformat),n.push(e.format),n.push(e.type),n.push(e.generatemipmaps),n.push(e.premultiplyalpha),n.push(e.flipy),n.push(e.unpackalignment),n.push(e.encoding),n.join()}(r);if(l!==n.__cachekey){void 0===s[l]&&(s[l]={texture:e.createtexture(),usedtimes:0},o.memory.textures++,i=!0),s[l].usedtimes++;let a=s[n.__cachekey];void 0!==a&&(s[n.__cachekey].usedtimes--,0===a.usedtimes&&b(r)),n.__cachekey=l,n.__webgltexture=s[l].texture}return i}function o(n,a,o){let l=3553;(a.isdataarraytexture||a.iscompressedarraytexture)&&(l=35866),a.isdata3dtexture&&(l=32879);let c=f(n,a),h=a.source;r.bindtexture(l,n.__webgltexture,33984+o);let p=i.get(h);if(h.version!==p.__version||!0===c){let n;r.activetexture(33984+o),e.pixelstorei(37440,a.flipy),e.pixelstorei(37441,a.premultiplyalpha),e.pixelstorei(3317,a.unpackalignment),e.pixelstorei(37443,0);let i=!u&&(a.wraps!==eg||a.wrapt!==eg||a.minfilter!==ey&&a.minfilter!==em)&&!1===a(a.image),f=_(a.image,i,!1,d);f=z(a,f);let m=a(f)||u,g=s.convert(a.format,a.encoding),v=s.convert(a.type),y=s(a.internalformat,g,v,a.encoding,a.isvideotexture);d(l,a,m);let x=a.mipmaps,c=u&&!0!==a.isvideotexture,e=void 0===p.__version||!0===c,t=w(a,f,m);if(a.isdepthtexture)y=6402,u?y=a.type===ed?36012:a.type===ei?33190:a.type===ek?35056:33189:a.type===ed&&console.error("webglrenderer: floating point depth texture requires webgl2."),a.format===ev&&6402===y&&a.type!==er&&a.type!==ei&&(console.warn("three.webglrenderer: use unsignedshorttype or unsignedinttype for depthformat depthtexture."),a.type=ei,v=s.convert(a.type)),a.format===ej&&6402===y&&(y=34041,a.type!==ek&&(console.warn("three.webglrenderer: use unsignedint248type for depthstencilformat depthtexture."),a.type=ek,v=s.convert(a.type))),e&&(c?r.texstorage2d(3553,1,y,f.width,f.height):r.teximage2d(3553,0,y,f.width,f.height,0,g,v,null));else if(a.isdatatexture){if(x.length>0&&m){c&&e&&r.texstorage2d(3553,t,y,x[0].width,x[0].height);for(let e=0,i=x.length;e>=1,n>>=1}}}else if(x.length>0&&m){c&&e&&r.texstorage2d(3553,t,y,x[0].width,x[0].height);for(let e=0,i=x.length;e=34069&&u<=34074)&&e.framebuffertexture2d(36160,l,u,i.get(o).__webgltexture,0),r.bindframebuffer(36160,null)}function k(n,r,i){if(e.bindrenderbuffer(36161,n),r.depthbuffer&&!r.stencilbuffer){let a=33189;if(i||u(r)){let n=r.depthtexture;n&&n.isdepthtexture&&(n.type===ed?a=36012:n.type===ei&&(a=33190));let i=g(r);u(r)?f.renderbufferstoragemultisampleext(36161,i,a,r.width,r.height):e.renderbufferstoragemultisample(36161,i,a,r.width,r.height)}else e.renderbufferstorage(36161,a,r.width,r.height);e.framebufferrenderbuffer(36160,36096,36161,n)}else if(r.depthbuffer&&r.stencilbuffer){let a=g(r);i&&!1===u(r)?e.renderbufferstoragemultisample(36161,a,35056,r.width,r.height):u(r)?f.renderbufferstoragemultisampleext(36161,a,35056,r.width,r.height):e.renderbufferstorage(36161,34041,r.width,r.height),e.framebufferrenderbuffer(36160,33306,36161,n)}else{let n=!0===r.iswebglmultiplerendertargets?r.texture:[r.texture];for(let a=0;a0&&!0===n.has("webgl_multisampled_render_to_texture")&&!1!==r.__userendertotexture}function z(e,r){let i=e.encoding,a=e.format,s=e.type;return!0===e.iscompressedtexture||!0===e.isvideotexture||e.format===nn||i!==tp&&(i===tr?!1===u?!0===n.has("ext_srgb")&&a===eg?(e.format=nn,e.minfilter=em,e.generatemipmaps=!1):r=no.srgbtolinear(r):(a!==eg||s!==et)&&console.warn("three.webgltextures: srgb encoded textures have to use rgbaformat and unsignedbytetype."):console.error("three.webgltextures: unsupported texture encoding:",i)),r}this.allocatetextureunit=function(){let e=p;return e>=c&&console.warn("three.webgltextures: trying to use "+e+" texture units while this gpu supports only "+c),p+=1,e},this.resettextureunits=function(){p=0},this.settexture2d=r,this.settexture2darray=function(e,n){let a=i.get(e);if(e.version>0&&a.__version!==e.version){o(a,e,n);return}r.bindtexture(35866,a.__webgltexture,33984+n)},this.settexture3d=function(e,n){let a=i.get(e);if(e.version>0&&a.__version!==e.version){o(a,e,n);return}r.bindtexture(32879,a.__webgltexture,33984+n)},this.settexturecube=function(n,a){let o=i.get(n);if(n.version>0&&o.__version!==n.version){(function(n,a,o){if(6!==a.image.length)return;let l=f(n,a),c=a.source;r.bindtexture(34067,n.__webgltexture,33984+o);let d=i.get(c);if(c.version!==d.__version||!0===l){let n;r.activetexture(33984+o),e.pixelstorei(37440,a.flipy),e.pixelstorei(37441,a.premultiplyalpha),e.pixelstorei(3317,a.unpackalignment),e.pixelstorei(37443,0);let i=a.iscompressedtexture||a.image[0].iscompressedtexture,p=a.image[0]&&a.image[0].isdatatexture,f=[];for(let e=0;e<6;e++)i||p?f[e]=p?a.image[e].image:a.image[e]:f[e]=_(a.image[e],!1,!0,h),f[e]=z(a,f[e]);let m=f[0],g=a(m)||u,v=s.convert(a.format,a.encoding),y=s.convert(a.type),x=s(a.internalformat,v,y,a.encoding),c=u&&!0!==a.isvideotexture,e=void 0===d.__version||!0===l,t=w(a,m,g);if(d(34067,a,g),i){c&&e&&r.texstorage2d(34067,t,x,m.width,m.height);for(let e=0;e<6;e++){n=f[e].mipmaps;for(let i=0;i0&&t++,r.texstorage2d(34067,t,x,f[0].width,f[0].height));for(let e=0;e<6;e++)if(p){c?r.texsubimage2d(34069+e,0,0,0,f[e].width,f[e].height,v,y,f[e].data):r.teximage2d(34069+e,0,x,f[e].width,f[e].height,0,v,y,f[e].data);for(let i=0;i0&&!1===u(n)){let i=p?l:[l];c.__webglmultisampledframebuffer=e.createframebuffer(),c.__webglcolorrenderbuffer=[],r.bindframebuffer(36160,c.__webglmultisampledframebuffer);for(let r=0;r0&&!1===u(n)){let a=n.iswebglmultiplerendertargets?n.texture:[n.texture],s=n.width,o=n.height,l=16384,u=[],c=n.stencilbuffer?33306:36096,h=i.get(n),d=!0===n.iswebglmultiplerendertargets;if(d)for(let n=0;n.025?(u.inputstate.pinching=!1,this.dispatchevent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputstate.pinching&&o<=.015&&(u.inputstate.pinching=!0,this.dispatchevent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripspace&&null!==(a=n.getpose(e.gripspace,r))&&(l.matrix.fromarray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearvelocity?(l.haslinearvelocity=!0,l.linearvelocity.copy(a.linearvelocity)):l.haslinearvelocity=!1,a.angularvelocity?(l.hasangularvelocity=!0,l.angularvelocity.copy(a.angularvelocity)):l.hasangularvelocity=!1);null!==o&&(null===(i=n.getpose(e.targetrayspace,r))&&null!==a&&(i=a),null!==i&&(o.matrix.fromarray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),i.linearvelocity?(o.haslinearvelocity=!0,o.linearvelocity.copy(i.linearvelocity)):o.haslinearvelocity=!1,i.angularvelocity?(o.hasangularvelocity=!0,o.angularvelocity.copy(i.angularvelocity)):o.hasangularvelocity=!1,this.dispatchevent(sy)))}return null!==o&&(o.visible=null!==i),null!==l&&(l.visible=null!==a),null!==u&&(u.visible=null!==s),this}_gethandjoint(e,n){if(void 0===e.joints[n.jointname]){let r=new sk;r.matrixautoupdate=!1,r.visible=!1,e.joints[n.jointname]=r,e.add(r)}return e.joints[n.jointname]}}class sq extends ng{constructor(e,n,r,i,a,s,o,l,u,c){if((c=void 0!==c?c:ev)!==ev&&c!==ej)throw error("depthtexture format must be either three.depthformat or three.depthstencilformat");void 0===r&&c===ev&&(r=ei),void 0===r&&c===ej&&(r=ek),super(null,i,a,s,o,l,c,r,u),this.isdepthtexture=!0,this.image={width:e,height:n},this.magfilter=void 0!==o?o:ey,this.minfilter=void 0!==l?l:ey,this.flipy=!1,this.generatemipmaps=!1}}class sz extends nr{constructor(e,n){super();let r=this,i=null,a=1,s=null,o="local-floor",l=1,u=null,c=null,h=null,d=null,p=null,f=null,m=n.getcontextattributes(),g=null,v=null,y=[],x=[],_=new set,a=new map,b=new io;b.layers.enable(1),b.viewport=new nu;let m=new io;m.layers.enable(2),m.viewport=new nu;let s=[b,m],w=new sx;w.layers.enable(1),w.layers.enable(2);let c=null,e=null;function t(e){let n=x.indexof(e.inputsource);if(-1===n)return;let r=y[n];void 0!==r&&r.dispatchevent({type:e.type,data:e.inputsource})}function b(){i.removeeventlistener("select",t),i.removeeventlistener("selectstart",t),i.removeeventlistener("selectend",t),i.removeeventlistener("squeeze",t),i.removeeventlistener("squeezestart",t),i.removeeventlistener("squeezeend",t),i.removeeventlistener("end",b),i.removeeventlistener("inputsourceschange",p);for(let e=0;e=0&&(x[i]=null,y[i].disconnect(r))}for(let n=0;n=x.length){x.push(r),i=e;break}if(null===x[e]){x[e]=r,i=e;break}}if(-1===i)break}let a=y[i];a&&a.connect(r)}}this.cameraautoupdate=!0,this.enabled=!1,this.ispresenting=!1,this.getcontroller=function(e){let n=y[e];return void 0===n&&(n=new sq,y[e]=n),n.gettargetrayspace()},this.getcontrollergrip=function(e){let n=y[e];return void 0===n&&(n=new sq,y[e]=n),n.getgripspace()},this.gethand=function(e){let n=y[e];return void 0===n&&(n=new sq,y[e]=n),n.gethandspace()},this.setframebufferscalefactor=function(e){a=e,!0===r.ispresenting&&console.warn("three.webxrmanager: cannot change framebuffer scale while presenting.")},this.setreferencespacetype=function(e){o=e,!0===r.ispresenting&&console.warn("three.webxrmanager: cannot change reference space type while presenting.")},this.getreferencespace=function(){return u||s},this.setreferencespace=function(e){u=e},this.getbaselayer=function(){return null!==d?d:p},this.getbinding=function(){return h},this.getframe=function(){return f},this.getsession=function(){return i},this.setsession=async function(c){if(null!==(i=c)){if(g=e.getrendertarget(),i.addeventlistener("select",t),i.addeventlistener("selectstart",t),i.addeventlistener("selectend",t),i.addeventlistener("squeeze",t),i.addeventlistener("squeezestart",t),i.addeventlistener("squeezeend",t),i.addeventlistener("end",b),i.addeventlistener("inputsourceschange",p),!0!==m.xrcompatible&&await n.makexrcompatible(),void 0===i.renderstate.layers||!1===e.capabilities.iswebgl2){let r={antialias:void 0!==i.renderstate.layers||m.antialias,alpha:m.alpha,depth:m.depth,stencil:m.stencil,framebufferscalefactor:a};p=new xrwebgllayer(i,n,r),i.updaterenderstate({baselayer:p}),v=new nz(p.framebufferwidth,p.framebufferheight,{format:eg,type:et,encoding:e.outputencoding,stencilbuffer:m.stencil})}else{let r=null,s=null,o=null;m.depth&&(o=m.stencil?35056:33190,r=m.stencil?ej:ev,s=m.stencil?ek:ei);let l={colorformat:32856,depthformat:o,scalefactor:a};d=(h=new xrwebglbinding(i,n)).createprojectionlayer(l),i.updaterenderstate({layers:[d]}),v=new nz(d.texturewidth,d.textureheight,{format:eg,type:et,depthtexture:new sq(d.texturewidth,d.textureheight,s,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilbuffer:m.stencil,encoding:e.outputencoding,samples:m.antialias?4:0});let u=e.properties.get(v);u.__ignoredepthvalues=d.ignoredepthvalues}v.isxrrendertarget=!0,this.setfoveation(l),u=null,s=await i.requestreferencespace(o),f.setcontext(i),f.start(),r.ispresenting=!0,r.dispatchevent({type:"sessionstart"})}};let r=new ny,l=new ny;function i(e,n){null===n?e.matrixworld.copy(e.matrix):e.matrixworld.multiplymatrices(n.matrixworld,e.matrix),e.matrixworldinverse.copy(e.matrixworld).invert()}this.updatecamera=function(e){if(null===i)return;w.near=m.near=b.near=e.near,w.far=m.far=b.far=e.far,(c!==w.near||e!==w.far)&&(i.updaterenderstate({depthnear:w.near,depthfar:w.far}),c=w.near,e=w.far);let n=e.parent,r=w.cameras;i(w,n);for(let e=0;en&&(a.set(e,e.lastchangedtime),r.dispatchevent({type:"planechanged",data:e}))}else _.add(e),a.set(e,i.lastchangedtime),r.dispatchevent({type:"planeadded",data:e})}f=null}),this.setanimationloop=function(e){d=e},this.dispose=function(){}}}function s$(e,n){function r(r,i){let a,s;r.opacity.value=i.opacity,i.color&&r.diffuse.value.copy(i.color),i.emissive&&r.emissive.value.copy(i.emissive).multiplyscalar(i.emissiveintensity),i.map&&(r.map.value=i.map),i.alphamap&&(r.alphamap.value=i.alphamap),i.bumpmap&&(r.bumpmap.value=i.bumpmap,r.bumpscale.value=i.bumpscale,i.side===a&&(r.bumpscale.value*=-1)),i.displacementmap&&(r.displacementmap.value=i.displacementmap,r.displacementscale.value=i.displacementscale,r.displacementbias.value=i.displacementbias),i.emissivemap&&(r.emissivemap.value=i.emissivemap),i.normalmap&&(r.normalmap.value=i.normalmap,r.normalscale.value.copy(i.normalscale),i.side===a&&r.normalscale.value.negate()),i.specularmap&&(r.specularmap.value=i.specularmap),i.alphatest>0&&(r.alphatest.value=i.alphatest);let o=n.get(i).envmap;if(o&&(r.envmap.value=o,r.flipenvmap.value=o.iscubetexture&&!1===o.isrendertargettexture?-1:1,r.reflectivity.value=i.reflectivity,r.ior.value=i.ior,r.refractionratio.value=i.refractionratio),i.lightmap){r.lightmap.value=i.lightmap;let n=!0!==e.physicallycorrectlights?math.pi:1;r.lightmapintensity.value=i.lightmapintensity*n}i.aomap&&(r.aomap.value=i.aomap,r.aomapintensity.value=i.aomapintensity),i.map?a=i.map:i.specularmap?a=i.specularmap:i.displacementmap?a=i.displacementmap:i.normalmap?a=i.normalmap:i.bumpmap?a=i.bumpmap:i.roughnessmap?a=i.roughnessmap:i.metalnessmap?a=i.metalnessmap:i.alphamap?a=i.alphamap:i.emissivemap?a=i.emissivemap:i.clearcoatmap?a=i.clearcoatmap:i.clearcoatnormalmap?a=i.clearcoatnormalmap:i.clearcoatroughnessmap?a=i.clearcoatroughnessmap:i.iridescencemap?a=i.iridescencemap:i.iridescencethicknessmap?a=i.iridescencethicknessmap:i.specularintensitymap?a=i.specularintensitymap:i.specularcolormap?a=i.specularcolormap:i.transmissionmap?a=i.transmissionmap:i.thicknessmap?a=i.thicknessmap:i.sheencolormap?a=i.sheencolormap:i.sheenroughnessmap&&(a=i.sheenroughnessmap),void 0!==a&&(a.iswebglrendertarget&&(a=a.texture),!0===a.matrixautoupdate&&a.updatematrix(),r.uvtransform.value.copy(a.matrix)),i.aomap?s=i.aomap:i.lightmap&&(s=i.lightmap),void 0!==s&&(s.iswebglrendertarget&&(s=s.texture),!0===s.matrixautoupdate&&s.updatematrix(),r.uv2transform.value.copy(s.matrix))}return{refreshfoguniforms:function(n,r){r.color.getrgb(n.fogcolor.value,il(e)),r.isfog?(n.fognear.value=r.near,n.fogfar.value=r.far):r.isfogexp2&&(n.fogdensity.value=r.density)},refreshmaterialuniforms:function(e,i,a,s,o){var l,u,c,h,d,p,f,m,g;let v,y;i.ismeshbasicmaterial?r(e,i):i.ismeshlambertmaterial?r(e,i):i.ismeshtoonmaterial?(r(e,i),l=e,i.gradientmap&&(l.gradientmap.value=i.gradientmap)):i.ismeshphongmaterial?(r(e,i),(u=e).specular.value.copy(i.specular),u.shininess.value=math.max(i.shininess,1e-4)):i.ismeshstandardmaterial?(r(e,i),function(e,r){e.roughness.value=r.roughness,e.metalness.value=r.metalness,r.roughnessmap&&(e.roughnessmap.value=r.roughnessmap),r.metalnessmap&&(e.metalnessmap.value=r.metalnessmap);let i=n.get(r).envmap;i&&(e.envmapintensity.value=r.envmapintensity)}(e,i),i.ismeshphysicalmaterial&&((c=e).ior.value=i.ior,i.sheen>0&&(c.sheencolor.value.copy(i.sheencolor).multiplyscalar(i.sheen),c.sheenroughness.value=i.sheenroughness,i.sheencolormap&&(c.sheencolormap.value=i.sheencolormap),i.sheenroughnessmap&&(c.sheenroughnessmap.value=i.sheenroughnessmap)),i.clearcoat>0&&(c.clearcoat.value=i.clearcoat,c.clearcoatroughness.value=i.clearcoatroughness,i.clearcoatmap&&(c.clearcoatmap.value=i.clearcoatmap),i.clearcoatroughnessmap&&(c.clearcoatroughnessmap.value=i.clearcoatroughnessmap),i.clearcoatnormalmap&&(c.clearcoatnormalscale.value.copy(i.clearcoatnormalscale),c.clearcoatnormalmap.value=i.clearcoatnormalmap,i.side===a&&c.clearcoatnormalscale.value.negate())),i.iridescence>0&&(c.iridescence.value=i.iridescence,c.iridescenceior.value=i.iridescenceior,c.iridescencethicknessminimum.value=i.iridescencethicknessrange[0],c.iridescencethicknessmaximum.value=i.iridescencethicknessrange[1],i.iridescencemap&&(c.iridescencemap.value=i.iridescencemap),i.iridescencethicknessmap&&(c.iridescencethicknessmap.value=i.iridescencethicknessmap)),i.transmission>0&&(c.transmission.value=i.transmission,c.transmissionsamplermap.value=o.texture,c.transmissionsamplersize.value.set(o.width,o.height),i.transmissionmap&&(c.transmissionmap.value=i.transmissionmap),c.thickness.value=i.thickness,i.thicknessmap&&(c.thicknessmap.value=i.thicknessmap),c.attenuationdistance.value=i.attenuationdistance,c.attenuationcolor.value.copy(i.attenuationcolor)),c.specularintensity.value=i.specularintensity,c.specularcolor.value.copy(i.specularcolor),i.specularintensitymap&&(c.specularintensitymap.value=i.specularintensitymap),i.specularcolormap&&(c.specularcolormap.value=i.specularcolormap))):i.ismeshmatcapmaterial?(r(e,i),h=e,i.matcap&&(h.matcap.value=i.matcap)):i.ismeshdepthmaterial?r(e,i):i.ismeshdistancematerial?(r(e,i),(d=e).referenceposition.value.copy(i.referenceposition),d.neardistance.value=i.neardistance,d.fardistance.value=i.fardistance):i.ismeshnormalmaterial?r(e,i):i.islinebasicmaterial?((p=e).diffuse.value.copy(i.color),p.opacity.value=i.opacity,i.islinedashedmaterial&&((f=e).dashsize.value=i.dashsize,f.totalsize.value=i.dashsize+i.gapsize,f.scale.value=i.scale)):i.ispointsmaterial?((m=e).diffuse.value.copy(i.color),m.opacity.value=i.opacity,m.size.value=i.size*a,m.scale.value=.5*s,i.map&&(m.map.value=i.map),i.alphamap&&(m.alphamap.value=i.alphamap),i.alphatest>0&&(m.alphatest.value=i.alphatest),i.map?v=i.map:i.alphamap&&(v=i.alphamap),void 0!==v&&(!0===v.matrixautoupdate&&v.updatematrix(),m.uvtransform.value.copy(v.matrix))):i.isspritematerial?((g=e).diffuse.value.copy(i.color),g.opacity.value=i.opacity,g.rotation.value=i.rotation,i.map&&(g.map.value=i.map),i.alphamap&&(g.alphamap.value=i.alphamap),i.alphatest>0&&(g.alphatest.value=i.alphatest),i.map?y=i.map:i.alphamap&&(y=i.alphamap),void 0!==y&&(!0===y.matrixautoupdate&&y.updatematrix(),g.uvtransform.value.copy(y.matrix))):i.isshadowmaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isshadermaterial&&(i.uniformsneedupdate=!1)}}}function s0(e,n,r,i){let a={},s={},o=[],l=r.iswebgl2?e.getparameter(35375):0;function u(e){let n={boundary:0,storage:0};return"number"==typeof e?(n.boundary=4,n.storage=4):e.isvector2?(n.boundary=8,n.storage=8):e.isvector3||e.iscolor?(n.boundary=16,n.storage=12):e.isvector4?(n.boundary=16,n.storage=16):e.ismatrix3?(n.boundary=48,n.storage=48):e.ismatrix4?(n.boundary=64,n.storage=64):e.istexture?console.warn("three.webglrenderer: texture samplers can not be part of an uniforms group."):console.warn("three.webglrenderer: unsupported uniform value type.",e),n}function c(n){let r=n.target;r.removeeventlistener("dispose",c);let i=o.indexof(r.__bindingpointindex);o.splice(i,1),e.deletebuffer(a[r.id]),delete a[r.id],delete s[r.id]}return{bind:function(e,n){let r=n.program;i.uniformblockbinding(e,r)},update:function(r,h){let d=a[r.id];void 0===d&&(function(e){let n=e.uniforms,r=0,i=0;for(let e=0,a=n.length;e0){i=r%16;let e=16-i;0!==i&&e-s.boundary<0&&(r+=16-i,a.__offset=r)}r+=s.storage}(i=r%16)>0&&(r+=16-i),e.__size=r,e.__cache={}}(r),d=function(n){let r=function(){for(let e=0;eu.matrixworld.determinant(),y=function(e,n,r,s,u){var d,p;!0!==n.isscene&&(n=eg),l.resettextureunits();let f=n.fog,m=s.ismeshstandardmaterial?n.environment:null,v=null===k?j.outputencoding:!0===k.isxrrendertarget?k.texture.encoding:tp,y=(s.ismeshstandardmaterial?h:c).get(s.envmap||m),_=!0===s.vertexcolors&&!!r.attributes.color&&4===r.attributes.color.itemsize,a=!!s.normalmap&&!!r.attributes.tangent,b=!!r.morphattributes.position,m=!!r.morphattributes.normal,s=!!r.morphattributes.color,c=s.tonemapped?j.tonemapping:er,e=r.morphattributes.position||r.morphattributes.normal||r.morphattributes.color,t=void 0!==e?e.length:0,b=o.get(s),r=u.state.lights;if(!0===ec&&(!0===eh||e!==q)){let n=e===q&&s.id===y;x.setstate(s,e,n)}let l=!1;s.version===b.__version?b.needslights&&b.lightsstateversion!==r.state.version?l=!0:b.outputencoding!==v?l=!0:u.isinstancedmesh&&!1===b.instancing?l=!0:u.isinstancedmesh||!0!==b.instancing?u.isskinnedmesh&&!1===b.skinning?l=!0:u.isskinnedmesh||!0!==b.skinning?b.envmap!==y?l=!0:!0===s.fog&&b.fog!==f?l=!0:void 0!==b.numclippingplanes&&(b.numclippingplanes!==x.numplanes||b.numintersection!==x.numintersection)?l=!0:b.vertexalphas!==_?l=!0:b.vertextangents!==a?l=!0:b.morphtargets!==b?l=!0:b.morphnormals!==m?l=!0:b.morphcolors!==s?l=!0:b.tonemapping!==c?l=!0:!0===i.iswebgl2&&b.morphtargetscount!==t&&(l=!0):l=!0:l=!0:(l=!0,b.__version=s.version);let i=b.currentprogram;!0===l&&(i=eo(s,n,u));let d=!1,f=!1,o=!1,n=i.getuniforms(),k=b.uniforms;if(a.useprogram(i.program)&&(d=!0,f=!0,o=!0),s.id!==y&&(y=s.id,f=!0),d||q!==e){if(n.setvalue(ey,"projectionmatrix",e.projectionmatrix),i.logarithmicdepthbuffer&&n.setvalue(ey,"logdepthbuffc",2/(math.log(e.far+1)/math.ln2)),q!==e&&(q=e,f=!0,o=!0),s.isshadermaterial||s.ismeshphongmaterial||s.ismeshtoonmaterial||s.ismeshstandardmaterial||s.envmap){let n=n.map.cameraposition;void 0!==n&&n.setvalue(ey,em.setfrommatrixposition(e.matrixworld))}(s.ismeshphongmaterial||s.ismeshtoonmaterial||s.ismeshlambertmaterial||s.ismeshbasicmaterial||s.ismeshstandardmaterial||s.isshadermaterial)&&n.setvalue(ey,"isorthographic",!0===e.isorthographiccamera),(s.ismeshphongmaterial||s.ismeshtoonmaterial||s.ismeshlambertmaterial||s.ismeshbasicmaterial||s.ismeshstandardmaterial||s.isshadermaterial||s.isshadowmaterial||u.isskinnedmesh)&&n.setvalue(ey,"viewmatrix",e.matrixworldinverse)}if(u.isskinnedmesh){n.setoptional(ey,u,"bindmatrix"),n.setoptional(ey,u,"bindmatrixinverse");let e=u.skeleton;e&&(i.floatvertextextures?(null===e.bonetexture&&e.computebonetexture(),n.setvalue(ey,"bonetexture",e.bonetexture,l),n.setvalue(ey,"bonetexturesize",e.bonetexturesize)):console.warn("three.webglrenderer: skinnedmesh can only be used with webgl 2. with webgl 1 oes_texture_float and vertex textures support is required."))}let h=r.morphattributes;if((void 0!==h.position||void 0!==h.normal||void 0!==h.color&&!0===i.iswebgl2)&&w.update(u,r,s,i),(f||b.receiveshadow!==u.receiveshadow)&&(b.receiveshadow=u.receiveshadow,n.setvalue(ey,"receiveshadow",u.receiveshadow)),s.ismeshgouraudmaterial&&null!==s.envmap&&(k.envmap.value=y,k.flipenvmap.value=y.iscubetexture&&!1===y.isrendertargettexture?-1:1),f&&(n.setvalue(ey,"tonemappingexposure",j.tonemappingexposure),b.needslights&&(d=k,p=o,d.ambientlightcolor.needsupdate=p,d.lightprobe.needsupdate=p,d.directionallights.needsupdate=p,d.directionallightshadows.needsupdate=p,d.pointlights.needsupdate=p,d.pointlightshadows.needsupdate=p,d.spotlights.needsupdate=p,d.spotlightshadows.needsupdate=p,d.rectarealights.needsupdate=p,d.hemispherelights.needsupdate=p),f&&!0===s.fog&&g.refreshfoguniforms(k,f),g.refreshmaterialuniforms(k,s,en,et,ed),sh.upload(ey,b.uniformslist,k,l)),s.isshadermaterial&&!0===s.uniformsneedupdate&&(sh.upload(ey,b.uniformslist,k,l),s.uniformsneedupdate=!1),s.isspritematerial&&n.setvalue(ey,"center",u.center),n.setvalue(ey,"modelviewmatrix",u.modelviewmatrix),n.setvalue(ey,"normalmatrix",u.normalmatrix),n.setvalue(ey,"modelmatrix",u.matrixworld),s.isshadermaterial||s.israwshadermaterial){let e=s.uniformsgroups;for(let n=0,r=e.length;n0&&function(e,n,a){let s=i.iswebgl2;null===ed&&(ed=new nz(1,1,{generatemipmaps:!0,type:r.has("ext_color_buffer_half_float")?ef:et,minfilter:ec,samples:s&&!0===f?4:0})),j.getdrawingbuffersize(ef),s?ed.setsize(ef.x,ef.y):ed.setsize(nf(ef.x),nf(ef.y));let o=j.getrendertarget();j.setrendertarget(ed),j.clear();let u=j.tonemapping;j.tonemapping=er,ei(e,n,a),j.tonemapping=u,l.updatemultisamplerendertarget(ed),l.updaterendertargetmipmap(ed),j.setrendertarget(o)}(u,n,s),o&&a.viewport(q.copy(o)),u.length>0&&ei(u,n,s),c.length>0&&ei(c,n,s),h.length>0&&ei(h,n,s),a.buffers.depth.settest(!0),a.buffers.depth.setmask(!0),a.buffers.color.setmask(!0),a.setpolygonoffset(!1)}function ei(e,n,r){let i=!0===n.isscene?n.overridematerial:null;for(let s=0,o=e.length;s0?v[v.length-1]:null,z.pop(),g=z.length>0?z[z.length-1]:null},this.getactivecubeface=function(){return j},this.getactivemipmaplevel=function(){return x},this.getrendertarget=function(){return k},this.setrendertargettextures=function(e,n,i){o.get(e.texture).__webgltexture=n,o.get(e.depthtexture).__webgltexture=i;let a=o.get(e);a.__hasexternaltextures=!0,a.__hasexternaltextures&&(a.__autoallocatedepthbuffer=void 0===i,a.__autoallocatedepthbuffer||!0!==r.has("webgl_multisampled_render_to_texture")||(console.warn("three.webglrenderer: render-to-texture extension was disabled because an external texture was provided"),a.__userendertotexture=!1))},this.setrendertargetframebuffer=function(e,n){let r=o.get(e);r.__webglframebuffer=n,r.__usedefaultframebuffer=void 0===n},this.setrendertarget=function(e,n=0,r=0){k=e,j=n,x=r;let s=!0,u=null,c=!1,h=!1;if(e){let r=o.get(e);void 0!==r.__usedefaultframebuffer?(a.bindframebuffer(36160,null),s=!1):void 0===r.__webglframebuffer?l.setuprendertarget(e):r.__hasexternaltextures&&l.rebindtextures(e,o.get(e.texture).__webgltexture,o.get(e.depthtexture).__webgltexture);let d=e.texture;(d.isdata3dtexture||d.isdataarraytexture||d.iscompressedarraytexture)&&(h=!0);let p=o.get(e).__webglframebuffer;e.iswebglcuberendertarget?(u=p[n],c=!0):u=i.iswebgl2&&e.samples>0&&!1===l.usemultisampledrtt(e)?o.get(e).__webglmultisampledframebuffer:p,q.copy(e.viewport),z.copy(e.scissor),$=e.scissortest}else q.copy(es).multiplyscalar(en).floor(),z.copy(eo).multiplyscalar(en).floor(),$=el;let d=a.bindframebuffer(36160,u);if(d&&i.drawbuffers&&s&&a.drawbuffers(e,u),a.viewport(q),a.scissor(z),a.setscissortest($),c){let i=o.get(e.texture);ey.framebuffertexture2d(36160,36064,34069+n,i.__webgltexture,r)}else if(h){let i=o.get(e.texture);ey.framebuffertexturelayer(36160,36064,i.__webgltexture,r||0,n||0)}y=-1},this.readrendertargetpixels=function(e,n,s,l,u,c,h){if(!(e&&e.iswebglrendertarget)){console.error("three.webglrenderer.readrendertargetpixels: rendertarget is not three.webglrendertarget.");return}let d=o.get(e).__webglframebuffer;if(e.iswebglcuberendertarget&&void 0!==h&&(d=d[h]),d){a.bindframebuffer(36160,d);try{let a=e.texture,o=a.format,h=a.type;if(o!==eg&&t.convert(o)!==ey.getparameter(35739)){console.error("three.webglrenderer.readrendertargetpixels: rendertarget is not in rgba or implementation defined format.");return}let d=h===ef&&(r.has("ext_color_buffer_half_float")||i.iswebgl2&&r.has("ext_color_buffer_float"));if(h!==et&&t.convert(h)!==ey.getparameter(35738)&&!(h===ed&&(i.iswebgl2||r.has("oes_texture_float")||r.has("webgl_color_buffer_float")))&&!d){console.error("three.webglrenderer.readrendertargetpixels: rendertarget is not in unsignedbytetype or implementation defined type.");return}n>=0&&n<=e.width-l&&s>=0&&s<=e.height-u&&ey.readpixels(n,s,l,u,t.convert(o),t.convert(h),c)}finally{let e=null!==k?o.get(k).__webglframebuffer:null;a.bindframebuffer(36160,e)}}},this.copyframebuffertotexture=function(e,n,r=0){let i=math.pow(2,-r),s=math.floor(n.image.width*i),o=math.floor(n.image.height*i);l.settexture2d(n,0),ey.copytexsubimage2d(3553,r,0,0,e.x,e.y,s,o),a.unbindtexture()},this.copytexturetotexture=function(e,n,r,i=0){let s=n.image.width,o=n.image.height,u=t.convert(r.format),c=t.convert(r.type);l.settexture2d(r,0),ey.pixelstorei(37440,r.flipy),ey.pixelstorei(37441,r.premultiplyalpha),ey.pixelstorei(3317,r.unpackalignment),n.isdatatexture?ey.texsubimage2d(3553,i,e.x,e.y,s,o,u,c,n.image.data):n.iscompressedtexture?ey.compressedtexsubimage2d(3553,i,e.x,e.y,n.mipmaps[0].width,n.mipmaps[0].height,u,n.mipmaps[0].data):ey.texsubimage2d(3553,i,e.x,e.y,u,c,n.image),0===i&&r.generatemipmaps&&ey.generatemipmap(3553),a.unbindtexture()},this.copytexturetotexture3d=function(e,n,r,i,s=0){let o;if(j.iswebgl1renderer){console.warn("three.webglrenderer.copytexturetotexture3d: can only be used with webgl2.");return}let u=e.max.x-e.min.x+1,c=e.max.y-e.min.y+1,h=e.max.z-e.min.z+1,d=t.convert(i.format),p=t.convert(i.type);if(i.isdata3dtexture)l.settexture3d(i,0),o=32879;else if(i.isdataarraytexture)l.settexture2darray(i,0),o=35866;else{console.warn("three.webglrenderer.copytexturetotexture3d: only supports three.datatexture3d and three.datatexture2darray.");return}ey.pixelstorei(37440,i.flipy),ey.pixelstorei(37441,i.premultiplyalpha),ey.pixelstorei(3317,i.unpackalignment);let f=ey.getparameter(3314),m=ey.getparameter(32878),g=ey.getparameter(3316),v=ey.getparameter(3315),y=ey.getparameter(32877),x=r.iscompressedtexture?r.mipmaps[0]:r.image;ey.pixelstorei(3314,x.width),ey.pixelstorei(32878,x.height),ey.pixelstorei(3316,e.min.x),ey.pixelstorei(3315,e.min.y),ey.pixelstorei(32877,e.min.z),r.isdatatexture||r.isdata3dtexture?ey.texsubimage3d(o,s,n.x,n.y,n.z,u,c,h,d,p,x.data):r.iscompressedarraytexture?(console.warn("three.webglrenderer.copytexturetotexture3d: untested support for compressed srctexture."),ey.compressedtexsubimage3d(o,s,n.x,n.y,n.z,u,c,h,d,x.data)):ey.texsubimage3d(o,s,n.x,n.y,n.z,u,c,h,d,p,x),ey.pixelstorei(3314,f),ey.pixelstorei(32878,m),ey.pixelstorei(3316,g),ey.pixelstorei(3315,v),ey.pixelstorei(32877,y),0===s&&i.generatemipmaps&&ey.generatemipmap(o),a.unbindtexture()},this.inittexture=function(e){e.iscubetexture?l.settexturecube(e,0):e.isdata3dtexture?l.settexture3d(e,0):e.isdataarraytexture||e.iscompressedarraytexture?l.settexture2darray(e,0):l.settexture2d(e,0),a.unbindtexture()},this.resetstate=function(){j=0,x=0,k=null,a.reset(),b.reset()},"undefined"!=typeof __three_devtools__&&__three_devtools__.dispatchevent(new customevent("observe",{detail:this}))}class s2 extends s1{}s2.prototype.iswebgl1renderer=!0;class s3{constructor(e,n=25e-5){this.isfogexp2=!0,this.name="",this.color=new nf(e),this.density=n}clone(){return new s3(this.color,this.density)}tojson(){return{type:"fogexp2",color:this.color.gethex(),density:this.density}}}class s4{constructor(e,n=1,r=1e3){this.isfog=!0,this.name="",this.color=new nf(e),this.near=n,this.far=r}clone(){return new s4(this.color,this.near,this.far)}tojson(){return{type:"fog",color:this.color.gethex(),near:this.near,far:this.far}}}class s6 extends rg{constructor(){super(),this.isscene=!0,this.type="scene",this.background=null,this.environment=null,this.fog=null,this.backgroundblurriness=0,this.backgroundintensity=1,this.overridematerial=null,"undefined"!=typeof __three_devtools__&&__three_devtools__.dispatchevent(new customevent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundblurriness=e.backgroundblurriness,this.backgroundintensity=e.backgroundintensity,null!==e.overridematerial&&(this.overridematerial=e.overridematerial.clone()),this.matrixautoupdate=e.matrixautoupdate,this}tojson(e){let n=super.tojson(e);return null!==this.fog&&(n.object.fog=this.fog.tojson()),this.backgroundblurriness>0&&(n.object.backgroundblurriness=this.backgroundblurriness),1!==this.backgroundintensity&&(n.object.backgroundintensity=this.backgroundintensity),n}get autoupdate(){return console.warn("three.scene: autoupdate was renamed to matrixworldautoupdate in r144."),this.matrixworldautoupdate}set autoupdate(e){console.warn("three.scene: autoupdate was renamed to matrixworldautoupdate in r144."),this.matrixworldautoupdate=e}}class s5{constructor(e,n){this.isinterleavedbuffer=!0,this.array=e,this.stride=n,this.count=void 0!==e?e.length/n:0,this.usage=t1,this.updaterange={offset:0,count:-1},this.version=0,this.uuid=nl()}onuploadcallback(){}set needsupdate(e){!0===e&&this.version++}setusage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyat(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,a=this.stride;ie.far||n.push({distance:l,point:oe.clone(),uv:rq.getuv(oe,os,oo,ol,ou,oc,oh,new ny),face:null,object:this})}copy(e,n){return super.copy(e,n),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function op(e,n,r,i,a,s){or.subvectors(e,r).addscalar(.5).multiply(i),void 0!==a?(oi.x=s*or.x-a*or.y,oi.y=a*or.x+s*or.y):oi.copy(or),e.copy(n),e.x+=oi.x,e.y+=oi.y,e.applymatrix4(oa)}let of=new ny,om=new ny;class og extends rg{constructor(){super(),this._currentlevel=0,this.type="lod",object.defineproperties(this,{levels:{enumerable:!0,value:[]},islod:{value:!0}}),this.autoupdate=!0}copy(e){super.copy(e,!1);let n=e.levels;for(let e=0,r=n.length;e0){let r,i;for(r=1,i=n.length;r0){of.setfrommatrixposition(this.matrixworld);let r=e.ray.origin.distanceto(of);this.getobjectfordistance(r).raycast(e,n)}}update(e){let n=this.levels;if(n.length>1){let r,i;of.setfrommatrixposition(e.matrixworld),om.setfrommatrixposition(this.matrixworld);let a=of.distanceto(om)/e.zoom;for(r=1,n[0].object.visible=!0,i=n.length;r=e)n[r-1].object.visible=!1,n[r].object.visible=!0;else break}for(this._currentlevel=r-1;rl)continue;d.applymatrix4(this.matrixworld);let o=e.ray.origin.distanceto(d);oe.far||n.push({distance:o,point:h.clone().applymatrix4(this.matrixworld),index:a,face:null,faceindex:null,object:this})}}else{let r=math.max(0,s.start),i=math.min(g.count,s.start+s.count);for(let a=r,s=i-1;al)continue;d.applymatrix4(this.matrixworld);let i=e.ray.origin.distanceto(d);ie.far||n.push({distance:i,point:h.clone().applymatrix4(this.matrixworld),index:a,face:null,faceindex:null,object:this})}}}updatemorphtargets(){let e=this.geometry,n=e.morphattributes,r=object.keys(n);if(r.length>0){let e=n[r[0]];if(void 0!==e){this.morphtargetinfluences=[],this.morphtargetdictionary={};for(let n=0,r=e.length;n0){let e=n[r[0]];if(void 0!==e){this.morphtargetinfluences=[],this.morphtargetdictionary={};for(let n=0,r=e.length;na.far)return;s.push({distance:u,distancetoray:math.sqrt(l),point:r,index:n,face:null,object:o})}}class o$ extends ng{constructor(e,n,r,i,a,s,o,l,u){super(e,n,r,i,a,s,o,l,u),this.isvideotexture=!0,this.minfilter=void 0!==s?s:em,this.magfilter=void 0!==a?a:em,this.generatemipmaps=!1;let c=this;"requestvideoframecallback"in e&&e.requestvideoframecallback(function n(){c.needsupdate=!0,e.requestvideoframecallback(n)})}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!1=="requestvideoframecallback"in e&&e.readystate>=e.have_current_data&&(this.needsupdate=!0)}}class o0 extends ng{constructor(e,n,r){super({width:e,height:n}),this.isframebuffertexture=!0,this.format=r,this.magfilter=ey,this.minfilter=ey,this.generatemipmaps=!1,this.needsupdate=!0}}class o1 extends ng{constructor(e,n,r,i,a,s,o,l,u,c,h,d){super(null,s,o,l,u,c,i,a,h,d),this.iscompressedtexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipy=!1,this.generatemipmaps=!1}}class o2 extends o1{constructor(e,n,r,i,a,s){super(e,n,r,a,s),this.iscompressedarraytexture=!0,this.image.depth=i,this.wrapr=eg}}class o3 extends ng{constructor(e,n,r,i,a,s,o,l,u){super(e,n,r,i,a,s,o,l,u),this.iscanvastexture=!0,this.needsupdate=!0}}class o4{constructor(){this.type="curve",this.arclengthdivisions=200}getpoint(){return console.warn("three.curve: .getpoint() not implemented."),null}getpointat(e,n){let r=this.getutotmapping(e);return this.getpoint(r,n)}getpoints(e=5){let n=[];for(let r=0;r<=e;r++)n.push(this.getpoint(r/e));return n}getspacedpoints(e=5){let n=[];for(let r=0;r<=e;r++)n.push(this.getpointat(r/e));return n}getlength(){let e=this.getlengths();return e[e.length-1]}getlengths(e=this.arclengthdivisions){if(this.cachearclengths&&this.cachearclengths.length===e+1&&!this.needsupdate)return this.cachearclengths;this.needsupdate=!1;let n=[],r,i=this.getpoint(0),a=0;n.push(0);for(let s=1;s<=e;s++)n.push(a+=(r=this.getpoint(s/e)).distanceto(i)),i=r;return this.cachearclengths=n,n}updatearclengths(){this.needsupdate=!0,this.getlengths()}getutotmapping(e,n){let r;let i=this.getlengths(),a=0,s=i.length;r=n||e*i[s-1];let o=0,l=s-1,u;for(;o<=l;)if((u=i[a=math.floor(o+(l-o)/2)]-r)<0)o=a+1;else if(u>0)l=a-1;else{l=a;break}if(i[a=l]===r)return a/(s-1);let c=i[a],h=i[a+1],d=(a+(r-c)/(h-c))/(s-1);return d}gettangent(e,n){let r=e-1e-4,i=e+1e-4;r<0&&(r=0),i>1&&(i=1);let a=this.getpoint(r),s=this.getpoint(i),o=n||(a.isvector2?new ny:new ny);return o.copy(s).sub(a).normalize(),o}gettangentat(e,n){let r=this.getutotmapping(e);return this.gettangent(r,n)}computefrenetframes(e,n){let r=new ny,i=[],a=[],s=[],o=new ny,l=new rm;for(let n=0;n<=e;n++){let r=n/e;i[n]=this.gettangentat(r,new ny)}a[0]=new ny,s[0]=new ny;let u=number.max_value,c=math.abs(i[0].x),h=math.abs(i[0].y),d=math.abs(i[0].z);c<=u&&(u=c,r.set(1,0,0)),h<=u&&(u=h,r.set(0,1,0)),d<=u&&r.set(0,0,1),o.crossvectors(i[0],r).normalize(),a[0].crossvectors(i[0],o),s[0].crossvectors(i[0],a[0]);for(let n=1;n<=e;n++){if(a[n]=a[n-1].clone(),s[n]=s[n-1].clone(),o.crossvectors(i[n-1],i[n]),o.length()>number.epsilon){o.normalize();let e=math.acos(nu(i[n-1].dot(i[n]),-1,1));a[n].applymatrix4(l.makerotationaxis(o,e))}s[n].crossvectors(i[n],a[n])}if(!0===n){let n=math.acos(nu(a[0].dot(a[e]),-1,1));n/=e,i[0].dot(o.crossvectors(a[0],a[e]))>0&&(n=-n);for(let r=1;r<=e;r++)a[r].applymatrix4(l.makerotationaxis(i[r],n*r)),s[r].crossvectors(i[r],a[r])}return{tangents:i,normals:a,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arclengthdivisions=e.arclengthdivisions,this}tojson(){let e={metadata:{version:4.5,type:"curve",generator:"curve.tojson"}};return e.arclengthdivisions=this.arclengthdivisions,e.type=this.type,e}fromjson(e){return this.arclengthdivisions=e.arclengthdivisions,this}}class o6 extends o4{constructor(e=0,n=0,r=1,i=1,a=0,s=2*math.pi,o=!1,l=0){super(),this.isellipsecurve=!0,this.type="ellipsecurve",this.ax=e,this.ay=n,this.xradius=r,this.yradius=i,this.astartangle=a,this.aendangle=s,this.aclockwise=o,this.arotation=l}getpoint(e,n){let r=n||new ny,i=2*math.pi,a=this.aendangle-this.astartangle,s=math.abs(a)i;)a-=i;a0?0:(math.floor(math.abs(l)/s)+1)*s:0===u&&l===s-1&&(l=s-2,u=1),this.closed||l>0?r=a[(l-1)%s]:(o8.subvectors(a[0],a[1]).add(a[0]),r=o8);let c=a[l%s],h=a[(l+1)%s];if(this.closed||l+2r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(lr(s,o.x,l.x,u.x,c.x),lr(s,o.y,l.y,u.y,c.y)),n}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n=r){let e=i[a]-r,s=this.curves[a],o=s.getlength(),l=0===o?0:1-e/o;return s.getpointat(l,n)}a++}return null}getlength(){let e=this.getcurvelengths();return e[e.length-1]}updatearclengths(){this.needsupdate=!0,this.cachelengths=null,this.getcurvelengths()}getcurvelengths(){if(this.cachelengths&&this.cachelengths.length===this.curves.length)return this.cachelengths;let e=[],n=0;for(let r=0,i=this.curves.length;r1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r}copy(e){super.copy(e),this.curves=[];for(let n=0,r=e.curves.length;n0){let e=u.getpoint(0);e.equals(this.currentpoint)||this.lineto(e.x,e.y)}this.curves.push(u);let c=u.getpoint(1);return this.currentpoint.copy(c),this}copy(e){return super.copy(e),this.currentpoint.copy(e.currentpoint),this}tojson(){let e=super.tojson();return e.currentpoint=this.currentpoint.toarray(),e}fromjson(e){return super.fromjson(e),this.currentpoint.fromarray(e.currentpoint),this}}class lg extends id{constructor(e=[new ny(0,-.5),new ny(.5,0),new ny(0,.5)],n=12,r=0,i=2*math.pi){super(),this.type="lathegeometry",this.parameters={points:e,segments:n,phistart:r,philength:i},n=math.floor(n),i=nu(i,0,2*math.pi);let a=[],s=[],o=[],l=[],u=[],c=1/n,h=new ny,d=new ny,p=new ny,f=new ny,m=new ny,g=0,v=0;for(let n=0;n<=e.length-1;n++)switch(n){case 0:g=e[n+1].x-e[n].x,v=e[n+1].y-e[n].y,p.x=1*v,p.y=-g,p.z=0*v,m.copy(p),p.normalize(),l.push(p.x,p.y,p.z);break;case e.length-1:l.push(m.x,m.y,m.z);break;default:g=e[n+1].x-e[n].x,v=e[n+1].y-e[n].y,p.x=1*v,p.y=-g,p.z=0*v,f.copy(p),p.x+=m.x,p.y+=m.y,p.z+=m.z,p.normalize(),l.push(p.x,p.y,p.z),m.copy(f)}for(let a=0;a<=n;a++){let p=r+a*c*i,f=math.sin(p),m=math.cos(p);for(let r=0;r<=e.length-1;r++){h.x=e[r].x*f,h.y=e[r].y,h.z=e[r].x*m,s.push(h.x,h.y,h.z),d.x=a/n,d.y=r/(e.length-1),o.push(d.x,d.y);let i=l[3*r+0]*f,c=l[3*r+1],p=l[3*r+0]*m;u.push(i,c,p)}}for(let r=0;r0&&y(!0),n>0&&y(!1)),this.setindex(c),this.setattribute("position",new ir(h,3)),this.setattribute("normal",new ir(d,3)),this.setattribute("uv",new ir(p,2))}static fromjson(e){return new lx(e.radiustop,e.radiusbottom,e.height,e.radialsegments,e.heightsegments,e.openended,e.thetastart,e.thetalength)}}class l_ extends lx{constructor(e=1,n=1,r=32,i=1,a=!1,s=0,o=2*math.pi){super(0,e,n,r,i,a,s,o),this.type="conegeometry",this.parameters={radius:e,height:n,radialsegments:r,heightsegments:i,openended:a,thetastart:s,thetalength:o}}static fromjson(e){return new l_(e.radius,e.height,e.radialsegments,e.heightsegments,e.openended,e.thetastart,e.thetalength)}}class la extends id{constructor(e=[],n=[],r=1,i=0){super(),this.type="polyhedrongeometry",this.parameters={vertices:e,indices:n,radius:r,detail:i};let a=[],s=[];function o(e){a.push(e.x,e.y,e.z)}function l(n,r){let i=3*n;r.x=e[i+0],r.y=e[i+1],r.z=e[i+2]}function u(e,n,r,i){i<0&&1===e.x&&(s[n]=e.x-1),0===r.x&&0===r.z&&(s[n]=i/2/math.pi+.5)}function c(e){return math.atan2(e.z,-e.x)}(function(e){let r=new ny,i=new ny,a=new ny;for(let s=0;s.9&&o<.1&&(n<.2&&(s[e+0]+=1),r<.2&&(s[e+2]+=1),i<.2&&(s[e+4]+=1))}}()}(),this.setattribute("position",new ir(a,3)),this.setattribute("normal",new ir(a.slice(),3)),this.setattribute("uv",new ir(s,2)),0===i?this.computevertexnormals():this.normalizenormals()}static fromjson(e){return new la(e.vertices,e.indices,e.radius,e.details)}}class lb extends la{constructor(e=1,n=0){let r=(1+math.sqrt(5))/2,i=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,n),this.type="dodecahedrongeometry",this.parameters={radius:e,detail:n}}static fromjson(e){return new lb(e.radius,e.detail)}}let lm=new ny,ls=new ny,lw=new ny,lc=new rq;class le extends id{constructor(e=null,n=1){if(super(),this.type="edgesgeometry",this.parameters={geometry:e,thresholdangle:n},null!==e){let r=math.cos(ns*n),i=e.getindex(),a=e.getattribute("position"),s=i?i.count:a.count,o=[0,0,0],l=["a","b","c"],u=[,,,],c={},h=[];for(let e=0;e=r.next.y&&r.next.y!==r.y){let e=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=s&&e>i&&(i=e,a=r.x=r.x&&r.x>=u&&s!==r.x&&ld(oa.x||r.x===a.x&&(p=a,f=r,0>lf(p.prev,p,f.prev)&&0>lf(f.next,p,p.next))))&&(a=r,h=d)),r=r.next}while(r!==l);return a}(e,n);if(!r)return n;let i=lu(r,e);return lr(i,i.next),lr(r,r.next)}(c[a],r);return r}(e,n,p,r)),e.length>80*r){i=s=e[0],a=o=e[1];for(let n=r;ns&&(s=l),u>o&&(o=u);c=0!==(c=math.max(s-i,o-a))?32767/c:0}return function e(n,r,i,a,s,o,l){if(!n)return;!l&&o&&function(e,n,r,i){let a=e;do 0===a.z&&(a.z=li(a.x,a.y,n,r,i)),a.prevz=a.prev,a.nextz=a.next,a=a.next;while(a!==e);a.prevz.nextz=null,a.prevz=null,function(e){let n,r,i,a,s,o,l,u,c=1;do{for(r=e,e=null,s=null,o=0;r;){for(o++,i=r,l=0,n=0;n0||u>0&&i;)0!==l&&(0===u||!i||r.z<=i.z)?(a=r,r=r.nextz,l--):(a=i,i=i.nextz,u--),s?s.nextz=a:e=a,a.prevz=s,s=a;r=i}s.nextz=null,c*=2}while(o>1)}(a)}(n,a,s,o);let u=n,c,h;for(;n.prev!==n.next;){if(c=n.prev,h=n.next,o?function(e,n,r,i){let a=e.prev,s=e.next;if(lf(a,e,s)>=0)return!1;let o=a.x,l=e.x,u=s.x,c=a.y,h=e.y,d=s.y,p=ol?o>u?o:u:l>u?l:u,g=c>h?c>d?c:d:h>d?h:d,v=li(p,f,n,r,i),y=li(m,g,n,r,i),x=e.prevz,_=e.nextz;for(;x&&x.z>=v&&_&&_.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==a&&x!==s&&ld(o,c,l,h,u,d,x.x,x.y)&&lf(x.prev,x,x.next)>=0||(x=x.prevz,_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==a&&_!==s&&ld(o,c,l,h,u,d,_.x,_.y)&&lf(_.prev,_,_.next)>=0))return!1;_=_.nextz}for(;x&&x.z>=v;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==a&&x!==s&&ld(o,c,l,h,u,d,x.x,x.y)&&lf(x.prev,x,x.next)>=0)return!1;x=x.prevz}for(;_&&_.z<=y;){if(_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==a&&_!==s&&ld(o,c,l,h,u,d,_.x,_.y)&&lf(_.prev,_,_.next)>=0)return!1;_=_.nextz}return!0}(n,a,s,o):function(e){let n=e.prev,r=e.next;if(lf(n,e,r)>=0)return!1;let i=n.x,a=e.x,s=r.x,o=n.y,l=e.y,u=r.y,c=ia?i>s?i:s:a>s?a:s,p=o>l?o>u?o:u:l>u?l:u,f=r.next;for(;f!==n;){if(f.x>=c&&f.x<=d&&f.y>=h&&f.y<=p&&ld(i,o,a,l,s,u,f.x,f.y)&&lf(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}(n)){r.push(c.i/i|0),r.push(n.i/i|0),r.push(h.i/i|0),lv(n),n=h.next,u=h.next;continue}if((n=h)===u){l?1===l?e(n=function(e,n,r){let i=e;do{let a=i.prev,s=i.next.next;!lo(a,s)&&ln(a,i,i.next,s)&&lg(a,s)&&lg(s,a)&&(n.push(a.i/r|0),n.push(i.i/r|0),n.push(s.i/r|0),lv(i),lv(i.next),i=e=s),i=i.next}while(i!==e);return lr(i)}(lr(n),r,i),r,i,a,s,o,2):2===l&&function(n,r,i,a,s,o){let l=n;do{let n=l.next.next;for(;n!==l.prev;){var u,c;if(l.i!==n.i&&(u=l,c=n,u.next.i!==c.i&&u.prev.i!==c.i&&!function(e,n){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==n.i&&r.next.i!==n.i&&ln(r,r.next,e,n))return!0;r=r.next}while(r!==e);return!1}(u,c)&&(lg(u,c)&&lg(c,u)&&function(e,n){let r=e,i=!1,a=(e.x+n.x)/2,s=(e.y+n.y)/2;do r.y>s!=r.next.y>s&&r.next.y!==r.y&&a<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==e);return i}(u,c)&&(lf(u.prev,u,c.prev)||lf(u,c.prev,c))||lo(u,c)&&lf(u.prev,u,u.next)>0&&lf(c.prev,c,c.next)>0))){let u=lu(l,n);l=lr(l,l.next),u=lr(u,u.next),e(l,r,i,a,s,o,0),e(u,r,i,a,s,o,0);return}n=n.next}l=l.next}while(l!==n)}(n,r,i,a,s,o):e(lr(n),r,i,a,s,o,1);break}}}(p,f,r,i,a,c,0),f}};function lp(e,n,r,i,a){let s,o;if(a===function(e,n,r,i){let a=0;for(let s=n,o=r-i;s0)for(s=n;s=n;s-=i)o=lz(s,e[s],e[s+1],o);return o&&lo(o,o.next)&&(lv(o),o=o.next),o}function lr(e,n){if(!e)return e;n||(n=e);let r=e,i;do if(i=!1,!r.steiner&&(lo(r,r.next)||0===lf(r.prev,r,r.next))){if(lv(r),(r=n=r.prev)===r.next)break;i=!0}else r=r.next;while(i||r!==n);return n}function ll(e,n){return e.x-n.x}function li(e,n,r,i,a){return(e=((e=((e=((e=((e=(e-r)*a|0)|e<<8)&16711935)|e<<4)&252645135)|e<<2)&858993459)|e<<1)&1431655765)|(n=((n=((n=((n=((n=(n-i)*a|0)|n<<8)&16711935)|n<<4)&252645135)|n<<2)&858993459)|n<<1)&1431655765)<<1}function ld(e,n,r,i,a,s,o,l){return(a-o)*(n-l)>=(e-o)*(s-l)&&(e-o)*(i-l)>=(r-o)*(n-l)&&(r-o)*(s-l)>=(a-o)*(i-l)}function lf(e,n,r){return(n.y-e.y)*(r.x-n.x)-(n.x-e.x)*(r.y-n.y)}function lo(e,n){return e.x===n.x&&e.y===n.y}function ln(e,n,r,i){let a=lh(lf(e,n,r)),s=lh(lf(e,n,i)),o=lh(lf(r,i,e)),l=lh(lf(r,i,n));return!!(a!==s&&o!==l||0===a&&lk(e,r,n)||0===s&&lk(e,i,n)||0===o&&lk(r,e,i)||0===l&&lk(r,n,i))}function lk(e,n,r){return n.x<=math.max(e.x,r.x)&&n.x>=math.min(e.x,r.x)&&n.y<=math.max(e.y,r.y)&&n.y>=math.min(e.y,r.y)}function lh(e){return e>0?1:e<0?-1:0}function lg(e,n){return 0>lf(e.prev,e,e.next)?lf(e,n,e.next)>=0&&lf(e,e.prev,n)>=0:0>lf(e,n,e.prev)||0>lf(e,e.next,n)}function lu(e,n){let r=new lj(e.i,e.x,e.y),i=new lj(n.i,n.x,n.y),a=e.next,s=n.prev;return e.next=n,n.prev=e,r.next=a,a.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function lz(e,n,r,i){let a=new lj(e,n,r);return i?(a.next=i.next,a.prev=i,i.next.prev=a,i.next=a):(a.prev=a,a.next=a),a}function lv(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevz&&(e.prevz.nextz=e.nextz),e.nextz&&(e.nextz.prevz=e.prevz)}function lj(e,n,r){this.i=e,this.x=n,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevz=null,this.nextz=null,this.steiner=!1}class lw{static area(e){let n=e.length,r=0;for(let i=n-1,a=0;alw.area(e)}static triangulateshape(e,n){let r=[],i=[],a=[];lj(e),lx(r,e);let s=e.length;n.foreach(lj);for(let e=0;e2&&e[n-1].equals(e[0])&&e.pop()}function lx(e,n){for(let r=0;rnumber.epsilon){let d=math.sqrt(h),p=math.sqrt(u*u+c*c),f=n.x-l/d,m=n.y+o/d,g=r.x-c/p,v=r.y+u/p,y=((g-f)*c-(v-m)*u)/(o*c-l*u);i=f+o*y-e.x,a=m+l*y-e.y;let x=i*i+a*a;if(x<=2)return new ny(i,a);s=math.sqrt(x/2)}else{let e=!1;o>number.epsilon?u>number.epsilon&&(e=!0):o<-number.epsilon?u<-number.epsilon&&(e=!0):math.sign(l)===math.sign(c)&&(e=!0),e?(i=-l,a=o,s=math.sqrt(h)):(i=o,a=l,s=math.sqrt(h/2))}return new ny(i/s,a/s)}let i=[];for(let e=0,n=t.length,r=n-1,i=e+1;e=0;e--){let n=e/y,r=m*math.cos(n*math.pi/2),i=g*math.sin(n*math.pi/2)+v;for(let e=0,n=t.length;e=0;){let s=a,o=a-1;o<0&&(o=e.length-1);for(let e=0,a=d+2*y;e0)&&p.push(n,a,u),(e!==r-1||l0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={standard:"",physical:""},this.clearcoat=e.clearcoat,this.clearcoatmap=e.clearcoatmap,this.clearcoatroughness=e.clearcoatroughness,this.clearcoatroughnessmap=e.clearcoatroughnessmap,this.clearcoatnormalmap=e.clearcoatnormalmap,this.clearcoatnormalscale.copy(e.clearcoatnormalscale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescencemap=e.iridescencemap,this.iridescenceior=e.iridescenceior,this.iridescencethicknessrange=[...e.iridescencethicknessrange],this.iridescencethicknessmap=e.iridescencethicknessmap,this.sheen=e.sheen,this.sheencolor.copy(e.sheencolor),this.sheencolormap=e.sheencolormap,this.sheenroughness=e.sheenroughness,this.sheenroughnessmap=e.sheenroughnessmap,this.transmission=e.transmission,this.transmissionmap=e.transmissionmap,this.thickness=e.thickness,this.thicknessmap=e.thicknessmap,this.attenuationdistance=e.attenuationdistance,this.attenuationcolor.copy(e.attenuationcolor),this.specularintensity=e.specularintensity,this.specularintensitymap=e.specularintensitymap,this.specularcolor.copy(e.specularcolor),this.specularcolormap=e.specularcolormap,this}}class un extends r${constructor(e){super(),this.ismeshphongmaterial=!0,this.type="meshphongmaterial",this.color=new nf(16777215),this.specular=new nf(1118481),this.shininess=30,this.map=null,this.lightmap=null,this.lightmapintensity=1,this.aomap=null,this.aomapintensity=1,this.emissive=new nf(0),this.emissiveintensity=1,this.emissivemap=null,this.bumpmap=null,this.bumpscale=1,this.normalmap=null,this.normalmaptype=td,this.normalscale=new ny(1,1),this.displacementmap=null,this.displacementscale=1,this.displacementbias=0,this.specularmap=null,this.alphamap=null,this.envmap=null,this.combine=ee,this.reflectivity=1,this.refractionratio=.98,this.wireframe=!1,this.wireframelinewidth=1,this.wireframelinecap="round",this.wireframelinejoin="round",this.flatshading=!1,this.fog=!0,this.setvalues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightmap=e.lightmap,this.lightmapintensity=e.lightmapintensity,this.aomap=e.aomap,this.aomapintensity=e.aomapintensity,this.emissive.copy(e.emissive),this.emissivemap=e.emissivemap,this.emissiveintensity=e.emissiveintensity,this.bumpmap=e.bumpmap,this.bumpscale=e.bumpscale,this.normalmap=e.normalmap,this.normalmaptype=e.normalmaptype,this.normalscale.copy(e.normalscale),this.displacementmap=e.displacementmap,this.displacementscale=e.displacementscale,this.displacementbias=e.displacementbias,this.specularmap=e.specularmap,this.alphamap=e.alphamap,this.envmap=e.envmap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionratio=e.refractionratio,this.wireframe=e.wireframe,this.wireframelinewidth=e.wireframelinewidth,this.wireframelinecap=e.wireframelinecap,this.wireframelinejoin=e.wireframelinejoin,this.flatshading=e.flatshading,this.fog=e.fog,this}}class ur extends r${constructor(e){super(),this.ismeshtoonmaterial=!0,this.defines={toon:""},this.type="meshtoonmaterial",this.color=new nf(16777215),this.map=null,this.gradientmap=null,this.lightmap=null,this.lightmapintensity=1,this.aomap=null,this.aomapintensity=1,this.emissive=new nf(0),this.emissiveintensity=1,this.emissivemap=null,this.bumpmap=null,this.bumpscale=1,this.normalmap=null,this.normalmaptype=td,this.normalscale=new ny(1,1),this.displacementmap=null,this.displacementscale=1,this.displacementbias=0,this.alphamap=null,this.wireframe=!1,this.wireframelinewidth=1,this.wireframelinecap="round",this.wireframelinejoin="round",this.fog=!0,this.setvalues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientmap=e.gradientmap,this.lightmap=e.lightmap,this.lightmapintensity=e.lightmapintensity,this.aomap=e.aomap,this.aomapintensity=e.aomapintensity,this.emissive.copy(e.emissive),this.emissivemap=e.emissivemap,this.emissiveintensity=e.emissiveintensity,this.bumpmap=e.bumpmap,this.bumpscale=e.bumpscale,this.normalmap=e.normalmap,this.normalmaptype=e.normalmaptype,this.normalscale.copy(e.normalscale),this.displacementmap=e.displacementmap,this.displacementscale=e.displacementscale,this.displacementbias=e.displacementbias,this.alphamap=e.alphamap,this.wireframe=e.wireframe,this.wireframelinewidth=e.wireframelinewidth,this.wireframelinecap=e.wireframelinecap,this.wireframelinejoin=e.wireframelinejoin,this.fog=e.fog,this}}class ui extends r${constructor(e){super(),this.ismeshnormalmaterial=!0,this.type="meshnormalmaterial",this.bumpmap=null,this.bumpscale=1,this.normalmap=null,this.normalmaptype=td,this.normalscale=new ny(1,1),this.displacementmap=null,this.displacementscale=1,this.displacementbias=0,this.wireframe=!1,this.wireframelinewidth=1,this.flatshading=!1,this.setvalues(e)}copy(e){return super.copy(e),this.bumpmap=e.bumpmap,this.bumpscale=e.bumpscale,this.normalmap=e.normalmap,this.normalmaptype=e.normalmaptype,this.normalscale.copy(e.normalscale),this.displacementmap=e.displacementmap,this.displacementscale=e.displacementscale,this.displacementbias=e.displacementbias,this.wireframe=e.wireframe,this.wireframelinewidth=e.wireframelinewidth,this.flatshading=e.flatshading,this}}class ua extends r${constructor(e){super(),this.ismeshlambertmaterial=!0,this.type="meshlambertmaterial",this.color=new nf(16777215),this.map=null,this.lightmap=null,this.lightmapintensity=1,this.aomap=null,this.aomapintensity=1,this.emissive=new nf(0),this.emissiveintensity=1,this.emissivemap=null,this.bumpmap=null,this.bumpscale=1,this.normalmap=null,this.normalmaptype=td,this.normalscale=new ny(1,1),this.displacementmap=null,this.displacementscale=1,this.displacementbias=0,this.specularmap=null,this.alphamap=null,this.envmap=null,this.combine=ee,this.reflectivity=1,this.refractionratio=.98,this.wireframe=!1,this.wireframelinewidth=1,this.wireframelinecap="round",this.wireframelinejoin="round",this.flatshading=!1,this.fog=!0,this.setvalues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightmap=e.lightmap,this.lightmapintensity=e.lightmapintensity,this.aomap=e.aomap,this.aomapintensity=e.aomapintensity,this.emissive.copy(e.emissive),this.emissivemap=e.emissivemap,this.emissiveintensity=e.emissiveintensity,this.bumpmap=e.bumpmap,this.bumpscale=e.bumpscale,this.normalmap=e.normalmap,this.normalmaptype=e.normalmaptype,this.normalscale.copy(e.normalscale),this.displacementmap=e.displacementmap,this.displacementscale=e.displacementscale,this.displacementbias=e.displacementbias,this.specularmap=e.specularmap,this.alphamap=e.alphamap,this.envmap=e.envmap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionratio=e.refractionratio,this.wireframe=e.wireframe,this.wireframelinewidth=e.wireframelinewidth,this.wireframelinecap=e.wireframelinecap,this.wireframelinejoin=e.wireframelinejoin,this.flatshading=e.flatshading,this.fog=e.fog,this}}class us extends r${constructor(e){super(),this.ismeshmatcapmaterial=!0,this.defines={matcap:""},this.type="meshmatcapmaterial",this.color=new nf(16777215),this.matcap=null,this.map=null,this.bumpmap=null,this.bumpscale=1,this.normalmap=null,this.normalmaptype=td,this.normalscale=new ny(1,1),this.displacementmap=null,this.displacementscale=1,this.displacementbias=0,this.alphamap=null,this.flatshading=!1,this.fog=!0,this.setvalues(e)}copy(e){return super.copy(e),this.defines={matcap:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpmap=e.bumpmap,this.bumpscale=e.bumpscale,this.normalmap=e.normalmap,this.normalmaptype=e.normalmaptype,this.normalscale.copy(e.normalscale),this.displacementmap=e.displacementmap,this.displacementscale=e.displacementscale,this.displacementbias=e.displacementbias,this.alphamap=e.alphamap,this.flatshading=e.flatshading,this.fog=e.fog,this}}class uo extends of{constructor(e){super(),this.islinedashedmaterial=!0,this.type="linedashedmaterial",this.scale=1,this.dashsize=3,this.gapsize=1,this.setvalues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashsize=e.dashsize,this.gapsize=e.gapsize,this}}function ul(e,n,r){return uc(e)?new e.constructor(e.subarray(n,void 0!==r?r:e.length)):e.slice(n,r)}function uu(e,n,r){return e&&(r||e.constructor!==n)?"number"==typeof n.bytes_per_element?new n(e):array.prototype.slice.call(e):e}function uc(e){return arraybuffer.isview(e)&&!(e instanceof dataview)}function uh(e){let n=e.length,r=array(n);for(let e=0;e!==n;++e)r[e]=e;return r.sort(function(n,r){return e[n]-e[r]}),r}function ud(e,n,r){let i=e.length,a=new e.constructor(i);for(let s=0,o=0;o!==i;++s){let i=r[s]*n;for(let r=0;r!==n;++r)a[o++]=e[i+r]}return a}function up(e,n,r,i){let a=1,s=e[0];for(;void 0!==s&&void 0===s[i];)s=e[a++];if(void 0===s)return;let o=s[i];if(void 0!==o){if(array.isarray(o))do void 0!==(o=s[i])&&(n.push(s.time),r.push.apply(r,o)),s=e[a++];while(void 0!==s);else if(void 0!==o.toarray)do void 0!==(o=s[i])&&(n.push(s.time),o.toarray(r,r.length)),s=e[a++];while(void 0!==s);else do void 0!==(o=s[i])&&(n.push(s.time),r.push(o)),s=e[a++];while(void 0!==s)}}var uf=object.freeze({__proto__:null,arrayslice:ul,convertarray:uu,flattenjson:up,getkeyframeorder:uh,istypedarray:uc,makeclipadditive:function(e,n=0,r=e,i=30){i<=0&&(i=30);let a=r.tracks.length,s=n/i;for(let n=0;n=a.times[p]){let e=p*c+u,n=e+c-u;i=ul(a.values,e,n)}else{let e=a.createinterpolant(),n=u,r=c-u;e.evaluate(s),i=ul(e.resultbuffer,n,r)}if("quaternion"===o){let e=new nk().fromarray(i).normalize().conjugate();e.toarray(i)}let f=l.times.length;for(let e=0;e=i)){u.push(n.times[e]);for(let r=0;rs.tracks[e].times[0]&&(l=s.tracks[e].times[0]);for(let e=0;e=a)){let o=n[1];e=(a=n[--r-1]))break r}s=r,r=0;break i}break n}for(;r>>1;en;)--s;if(++s,0!==a||s!==i){a>=s&&(a=(s=math.max(s,1))-1);let e=this.getvaluesize();this.times=ul(r,a,s),this.values=ul(this.values,a*e,s*e)}return this}validate(){let e=!0,n=this.getvaluesize();n-math.floor(n)!=0&&(console.error("three.keyframetrack: invalid value size in track.",this),e=!1);let r=this.times,i=this.values,a=r.length;0===a&&(console.error("three.keyframetrack: track is empty.",this),e=!1);let s=null;for(let n=0;n!==a;n++){let i=r[n];if("number"==typeof i&&isnan(i)){console.error("three.keyframetrack: time is not a valid number.",this,n,i),e=!1;break}if(null!==s&&s>i){console.error("three.keyframetrack: out of order keys.",this,n,i,s),e=!1;break}s=i}if(void 0!==i&&uc(i))for(let n=0,r=i.length;n!==r;++n){let r=i[n];if(isnan(r)){console.error("three.keyframetrack: value is not a valid number.",this,n,r),e=!1;break}}return e}optimize(){let e=ul(this.times),n=ul(this.values),r=this.getvaluesize(),i=this.getinterpolation()===ta,a=e.length-1,s=1;for(let o=1;o0){e[s]=e[a];for(let e=a*r,i=s*r,o=0;o!==r;++o)n[i+o]=n[e+o];++s}return s!==e.length?(this.times=ul(e,0,s),this.values=ul(n,0,s*r)):(this.times=e,this.values=n),this}clone(){let e=ul(this.times,0),n=ul(this.values,0),r=this.constructor,i=new r(this.name,e,n);return i.createinterpolant=this.createinterpolant,i}}ux.prototype.timebuffertype=float32array,ux.prototype.valuebuffertype=float32array,ux.prototype.defaultinterpolation=t_;class u_ extends ux{}u_.prototype.valuetypename="bool",u_.prototype.valuebuffertype=array,u_.prototype.defaultinterpolation=tx,u_.prototype.interpolantfactorymethodlinear=void 0,u_.prototype.interpolantfactorymethodsmooth=void 0;class ua extends ux{}ua.prototype.valuetypename="color";class ub extends ux{}ub.prototype.valuetypename="number";class um extends um{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){let a=this.resultbuffer,s=this.samplevalues,o=this.valuesize,l=(r-n)/(i-n),u=e*o;for(let e=u+o;u!==e;u+=4)nk.slerpflat(a,0,s,u-o,s,u,l);return a}}class us extends ux{interpolantfactorymethodlinear(e){return new um(this.times,this.values,this.getvaluesize(),e)}}us.prototype.valuetypename="quaternion",us.prototype.defaultinterpolation=t_,us.prototype.interpolantfactorymethodsmooth=void 0;class uw extends ux{}uw.prototype.valuetypename="string",uw.prototype.valuebuffertype=array,uw.prototype.defaultinterpolation=tx,uw.prototype.interpolantfactorymethodlinear=void 0,uw.prototype.interpolantfactorymethodsmooth=void 0;class uc extends ux{}uc.prototype.valuetypename="vector";class ue{constructor(e,n=-1,r,i=tw){this.name=e,this.tracks=r,this.duration=n,this.blendmode=i,this.uuid=nl(),this.duration<0&&this.resetduration()}static parse(e){let n=[],r=e.tracks,i=1/(e.fps||1);for(let e=0,a=r.length;e!==a;++e)n.push((function(e){if(void 0===e.type)throw error("three.keyframetrack: track type undefined, can not parse");let n=function(e){switch(e.tolowercase()){case"scalar":case"double":case"float":case"number":case"integer":return ub;case"vector":case"vector2":case"vector3":case"vector4":return uc;case"color":return ua;case"quaternion":return us;case"bool":case"boolean":return u_;case"string":return uw}throw error("three.keyframetrack: unsupported typename: "+e)}(e.type);if(void 0===e.times){let n=[],r=[];up(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==n.parse?n.parse(e):new n(e.name,e.times,e.values,e.interpolation)})(r[e]).scale(i));let a=new this(e.name,e.duration,n,e.blendmode);return a.uuid=e.uuid,a}static tojson(e){let n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendmode:e.blendmode};for(let e=0,i=r.length;e!==i;++e)n.push(ux.tojson(r[e]));return i}static createfrommorphtargetsequence(e,n,r,i){let a=n.length,s=[];for(let e=0;e1){let e=s[1],n=i[e];n||(i[e]=n=[]),n.push(r)}}let s=[];for(let e in i)s.push(this.createfrommorphtargetsequence(e,i[e],n,r));return s}static parseanimation(e,n){if(!e)return console.error("three.animationclip: no animation in jsonloader data."),null;let r=function(e,n,r,i,a){if(0!==r.length){let s=[],o=[];up(r,s,o,i),0!==s.length&&a.push(new e(n,s,o))}},i=[],a=e.name||"default",s=e.fps||30,o=e.blendmode,l=e.length||-1,u=e.hierarchy||[];for(let e=0;e{n&&n(a),this.manager.itemend(e)},0),a;if(void 0!==ul[e]){ul[e].push({onload:n,onprogress:r,onerror:i});return}ul[e]=[],ul[e].push({onload:n,onprogress:r,onerror:i});let s=new request(e,{headers:new headers(this.requestheader),credentials:this.withcredentials?"include":"same-origin"}),o=this.mimetype,l=this.responsetype;fetch(s).then(n=>{if(200===n.status||0===n.status){if(0===n.status&&console.warn("three.fileloader: http status 0 received."),"undefined"==typeof readablestream||void 0===n.body||void 0===n.body.getreader)return n;let r=ul[e],i=n.body.getreader(),a=n.headers.get("content-length")||n.headers.get("x-file-size"),s=a?parseint(a):0,o=0!==s,l=0,u=new readablestream({start(e){(function n(){i.read().then(({done:i,value:a})=>{if(i)e.close();else{l+=a.bytelength;let i=new progressevent("progress",{lengthcomputable:o,loaded:l,total:s});for(let e=0,n=r.length;e{switch(l){case"arraybuffer":return e.arraybuffer();case"blob":return e.blob();case"document":return e.text().then(e=>{let n=new domparser;return n.parsefromstring(e,o)});case"json":return e.json();default:if(void 0===o)return e.text();{let n=/charset="?([^;"\s]*)"?/i.exec(o),r=n&&n[1]?n[1].tolowercase():void 0,i=new textdecoder(r);return e.arraybuffer().then(e=>i.decode(e))}}}).then(n=>{ut.add(e,n);let r=ul[e];delete ul[e];for(let e=0,i=r.length;e{let r=ul[e];if(void 0===r)throw this.manager.itemerror(e),n;delete ul[e];for(let e=0,i=r.length;e{this.manager.itemend(e)}),this.manager.itemstart(e)}setresponsetype(e){return this.responsetype=e,this}setmimetype(e){return this.mimetype=e,this}}class uf extends ur{constructor(e){super(e)}load(e,n,r,i){let a=this,s=new ud(this.manager);s.setpath(this.path),s.setrequestheader(this.requestheader),s.setwithcredentials(this.withcredentials),s.load(e,function(r){try{n(a.parse(json.parse(r)))}catch(n){i?i(n):console.error(n),a.manager.itemerror(e)}},r,i)}parse(e){let n=[];for(let r=0;r0:i.vertexcolors=e.vertexcolors),void 0!==e.uniforms)for(let n in e.uniforms){let a=e.uniforms[n];switch(i.uniforms[n]={},a.type){case"t":i.uniforms[n].value=r(a.value);break;case"c":i.uniforms[n].value=new nf().sethex(a.value);break;case"v2":i.uniforms[n].value=new ny().fromarray(a.value);break;case"v3":i.uniforms[n].value=new ny().fromarray(a.value);break;case"v4":i.uniforms[n].value=new nu().fromarray(a.value);break;case"m3":i.uniforms[n].value=new nx().fromarray(a.value);break;case"m4":i.uniforms[n].value=new rm().fromarray(a.value);break;default:i.uniforms[n].value=a.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexshader&&(i.vertexshader=e.vertexshader),void 0!==e.fragmentshader&&(i.fragmentshader=e.fragmentshader),void 0!==e.glslversion&&(i.glslversion=e.glslversion),void 0!==e.extensions)for(let n in e.extensions)i.extensions[n]=e.extensions[n];if(void 0!==e.size&&(i.size=e.size),void 0!==e.sizeattenuation&&(i.sizeattenuation=e.sizeattenuation),void 0!==e.map&&(i.map=r(e.map)),void 0!==e.matcap&&(i.matcap=r(e.matcap)),void 0!==e.alphamap&&(i.alphamap=r(e.alphamap)),void 0!==e.bumpmap&&(i.bumpmap=r(e.bumpmap)),void 0!==e.bumpscale&&(i.bumpscale=e.bumpscale),void 0!==e.normalmap&&(i.normalmap=r(e.normalmap)),void 0!==e.normalmaptype&&(i.normalmaptype=e.normalmaptype),void 0!==e.normalscale){let n=e.normalscale;!1===array.isarray(n)&&(n=[n,n]),i.normalscale=new ny().fromarray(n)}return void 0!==e.displacementmap&&(i.displacementmap=r(e.displacementmap)),void 0!==e.displacementscale&&(i.displacementscale=e.displacementscale),void 0!==e.displacementbias&&(i.displacementbias=e.displacementbias),void 0!==e.roughnessmap&&(i.roughnessmap=r(e.roughnessmap)),void 0!==e.metalnessmap&&(i.metalnessmap=r(e.metalnessmap)),void 0!==e.emissivemap&&(i.emissivemap=r(e.emissivemap)),void 0!==e.emissiveintensity&&(i.emissiveintensity=e.emissiveintensity),void 0!==e.specularmap&&(i.specularmap=r(e.specularmap)),void 0!==e.specularintensitymap&&(i.specularintensitymap=r(e.specularintensitymap)),void 0!==e.specularcolormap&&(i.specularcolormap=r(e.specularcolormap)),void 0!==e.envmap&&(i.envmap=r(e.envmap)),void 0!==e.envmapintensity&&(i.envmapintensity=e.envmapintensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionratio&&(i.refractionratio=e.refractionratio),void 0!==e.lightmap&&(i.lightmap=r(e.lightmap)),void 0!==e.lightmapintensity&&(i.lightmapintensity=e.lightmapintensity),void 0!==e.aomap&&(i.aomap=r(e.aomap)),void 0!==e.aomapintensity&&(i.aomapintensity=e.aomapintensity),void 0!==e.gradientmap&&(i.gradientmap=r(e.gradientmap)),void 0!==e.clearcoatmap&&(i.clearcoatmap=r(e.clearcoatmap)),void 0!==e.clearcoatroughnessmap&&(i.clearcoatroughnessmap=r(e.clearcoatroughnessmap)),void 0!==e.clearcoatnormalmap&&(i.clearcoatnormalmap=r(e.clearcoatnormalmap)),void 0!==e.clearcoatnormalscale&&(i.clearcoatnormalscale=new ny().fromarray(e.clearcoatnormalscale)),void 0!==e.iridescencemap&&(i.iridescencemap=r(e.iridescencemap)),void 0!==e.iridescencethicknessmap&&(i.iridescencethicknessmap=r(e.iridescencethicknessmap)),void 0!==e.transmissionmap&&(i.transmissionmap=r(e.transmissionmap)),void 0!==e.thicknessmap&&(i.thicknessmap=r(e.thicknessmap)),void 0!==e.sheencolormap&&(i.sheencolormap=r(e.sheencolormap)),void 0!==e.sheenroughnessmap&&(i.sheenroughnessmap=r(e.sheenroughnessmap)),i}settextures(e){return this.textures=e,this}static creatematerialfromtype(e){return new({shadowmaterial:l8,spritematerial:s7,rawshadermaterial:l7,shadermaterial:id,pointsmaterial:oj,meshphysicalmaterial:ut,meshstandardmaterial:ue,meshphongmaterial:un,meshtoonmaterial:ur,meshnormalmaterial:ui,meshlambertmaterial:ua,meshdepthmaterial:su,meshdistancematerial:sz,meshbasicmaterial:r0,meshmatcapmaterial:us,linedashedmaterial:uo,linebasicmaterial:of,material:r$})[e]}}class u9{static decodetext(e){if("undefined"!=typeof textdecoder)return new textdecoder().decode(e);let n="";for(let r=0,i=e.length;r0){let i=new ub(n);(r=new un(i)).setcrossorigin(this.crossorigin);for(let n=0,r=e.length;n0){(n=new un(this.manager)).setcrossorigin(this.crossorigin);for(let n=0,r=e.length;n0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e0&&this._mixbufferregionadditive(r,i,this._addindex*n,1,n);for(let e=n,a=n+n;e!==a;++e)if(r[e]!==r[e+n]){o.setvalue(r,i);break}}saveoriginalstate(){let e=this.binding,n=this.buffer,r=this.valuesize,i=r*this._origindex;e.getvalue(n,i);for(let e=r;e!==i;++e)n[e]=n[i+e%r];this._setidentity(),this.cumulativeweight=0,this.cumulativeweightadditive=0}restoreoriginalstate(){let e=3*this.valuesize;this.binding.setvalue(this.buffer,e)}_setadditiveidentitynumeric(){let e=this._addindex*this.valuesize,n=e+this.valuesize;for(let r=e;r=.5)for(let i=0;i!==a;++i)e[n+i]=e[r+i]}_slerp(e,n,r,i){nk.slerpflat(e,n,e,n,e,r,i)}_slerpadditive(e,n,r,i,a){let s=this._workindex*a;nk.multiplyquaternionsflat(e,s,e,n,e,r),nk.slerpflat(e,n,e,n,e,s,i)}_lerp(e,n,r,i,a){let s=1-i;for(let o=0;o!==a;++o){let a=n+o;e[a]=e[a]*s+e[r+o]*i}}_lerpadditive(e,n,r,i,a){for(let s=0;s!==a;++s){let a=n+s;e[a]=e[a]+e[r+s]*i}}}let ct="\\[\\]\\.:\\/",cb=regexp("["+ct+"]","g"),cp="[^"+ct+"]",cr="[^"+ct.replace("\\.","")+"]",cl=/((?:wc+[\/:])*)/.source.replace("wc",cp),ci=/(wcod+)?/.source.replace("wcod",cr),cd=/(?:\.(wc+)(?:\[(.+)\])?)?/.source.replace("wc",cp),cf=/\.(wc+)(?:\[(.+)\])?/.source.replace("wc",cp),co=regexp("^"+cl+ci+cd+cf+"$"),cn=["material","materials","bones","map"];class ck{constructor(e,n,r){this.path=n,this.parsedpath=r||ck.parsetrackname(n),this.node=ck.findnode(e,this.parsedpath.nodename)||e,this.rootnode=e,this.getvalue=this._getvalue_unbound,this.setvalue=this._setvalue_unbound}static create(e,n,r){return e&&e.isanimationobjectgroup?new ck.composite(e,n,r):new ck(e,n,r)}static sanitizenodename(e){return e.replace(/\s/g,"_").replace(cb,"")}static parsetrackname(e){let n=co.exec(e);if(null===n)throw error("propertybinding: cannot parse trackname: "+e);let r={nodename:n[2],objectname:n[3],objectindex:n[4],propertyname:n[5],propertyindex:n[6]},i=r.nodename&&r.nodename.lastindexof(".");if(void 0!==i&&-1!==i){let e=r.nodename.substring(i+1);-1!==cn.indexof(e)&&(r.nodename=r.nodename.substring(0,i),r.objectname=e)}if(null===r.propertyname||0===r.propertyname.length)throw error("propertybinding: can not parse propertyname from trackname: "+e);return r}static findnode(e,n){if(void 0===n||""===n||"."===n||-1===n||n===e.name||n===e.uuid)return e;if(e.skeleton){let r=e.skeleton.getbonebyname(n);if(void 0!==r)return r}if(e.children){let r=function(e){for(let i=0;i=a){let s=a++,c=e[s];n[c.uuid]=u,e[u]=c,n[l]=s,e[s]=o;for(let e=0;e!==i;++e){let n=r[e],i=n[s],a=n[u];n[u]=i,n[s]=a}}}this.ncachedobjects_=a}uncache(){let e=this._objects,n=this._indicesbyuuid,r=this._bindings,i=r.length,a=this.ncachedobjects_,s=e.length;for(let o=0,l=arguments.length;o!==l;++o){let l=arguments[o],u=l.uuid,c=n[u];if(void 0!==c){if(delete n[u],c0&&(n[o.uuid]=c),e[c]=o,e.pop();for(let e=0;e!==i;++e){let n=r[e];n[c]=n[a],n.pop()}}}}this.ncachedobjects_=a}subscribe_(e,n){let r=this._bindingsindicesbypath,i=r[e],a=this._bindings;if(void 0!==i)return a[i];let s=this._paths,o=this._parsedpaths,l=this._objects,u=l.length,c=this.ncachedobjects_,h=array(u);i=a.length,r[e]=i,s.push(e),o.push(n),a.push(h);for(let r=c,i=l.length;r!==i;++r){let i=l[r];h[r]=new ck(i,e,n)}return h}unsubscribe_(e){let n=this._bindingsindicesbypath,r=n[e];if(void 0!==r){let i=this._paths,a=this._parsedpaths,s=this._bindings,o=s.length-1,l=s[o],u=e[o];n[u]=r,s[r]=l,s.pop(),a[r]=a[o],a.pop(),i[r]=i[o],i.pop()}}}class cg{constructor(e,n,r=null,i=n.blendmode){this._mixer=e,this._clip=n,this._localroot=r,this.blendmode=i;let a=n.tracks,s=a.length,o=array(s),l={endingstart:tb,endingend:tb};for(let e=0;e!==s;++e){let n=a[e].createinterpolant(null);o[e]=n,n.settings=l}this._interpolantsettings=l,this._interpolants=o,this._propertybindings=array(s),this._cacheindex=null,this._byclipcacheindex=null,this._timescaleinterpolant=null,this._weightinterpolant=null,this.loop=tv,this._loopcount=-1,this._starttime=null,this.time=0,this.timescale=1,this._effectivetimescale=1,this.weight=1,this._effectiveweight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampwhenfinished=!1,this.zeroslopeatstart=!0,this.zeroslopeatend=!0}play(){return this._mixer._activateaction(this),this}stop(){return this._mixer._deactivateaction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopcount=-1,this._starttime=null,this.stopfading().stopwarping()}isrunning(){return this.enabled&&!this.paused&&0!==this.timescale&&null===this._starttime&&this._mixer._isactiveaction(this)}isscheduled(){return this._mixer._isactiveaction(this)}startat(e){return this._starttime=e,this}setloop(e,n){return this.loop=e,this.repetitions=n,this}seteffectiveweight(e){return this.weight=e,this._effectiveweight=this.enabled?e:0,this.stopfading()}geteffectiveweight(){return this._effectiveweight}fadein(e){return this._schedulefading(e,0,1)}fadeout(e){return this._schedulefading(e,1,0)}crossfadefrom(e,n,r){if(e.fadeout(n),this.fadein(n),r){let r=this._clip.duration,i=e._clip.duration;e.warp(1,i/r,n),this.warp(r/i,1,n)}return this}crossfadeto(e,n,r){return e.crossfadefrom(this,n,r)}stopfading(){let e=this._weightinterpolant;return null!==e&&(this._weightinterpolant=null,this._mixer._takebackcontrolinterpolant(e)),this}seteffectivetimescale(e){return this.timescale=e,this._effectivetimescale=this.paused?0:e,this.stopwarping()}geteffectivetimescale(){return this._effectivetimescale}setduration(e){return this.timescale=this._clip.duration/e,this.stopwarping()}syncwith(e){return this.time=e.time,this.timescale=e.timescale,this.stopwarping()}halt(e){return this.warp(this._effectivetimescale,0,e)}warp(e,n,r){let i=this._mixer,a=i.time,s=this.timescale,o=this._timescaleinterpolant;null===o&&(o=i._lendcontrolinterpolant(),this._timescaleinterpolant=o);let l=o.parameterpositions,u=o.samplevalues;return l[0]=a,l[1]=a+r,u[0]=e/s,u[1]=n/s,this}stopwarping(){let e=this._timescaleinterpolant;return null!==e&&(this._timescaleinterpolant=null,this._mixer._takebackcontrolinterpolant(e)),this}getmixer(){return this._mixer}getclip(){return this._clip}getroot(){return this._localroot||this._mixer._root}_update(e,n,r,i){if(!this.enabled){this._updateweight(e);return}let a=this._starttime;if(null!==a){let i=(e-a)*r;i<0||0===r?n=0:(this._starttime=null,n=r*i)}n*=this._updatetimescale(e);let s=this._updatetime(n),o=this._updateweight(e);if(o>0){let e=this._interpolants,n=this._propertybindings;if(this.blendmode===tc)for(let r=0,i=e.length;r!==i;++r)e[r].evaluate(s),n[r].accumulateadditive(o);else for(let r=0,a=e.length;r!==a;++r)e[r].evaluate(s),n[r].accumulate(i,o)}}_updateweight(e){let n=0;if(this.enabled){n=this.weight;let r=this._weightinterpolant;if(null!==r){let i=r.evaluate(e)[0];n*=i,e>r.parameterpositions[1]&&(this.stopfading(),0===i&&(this.enabled=!1))}}return this._effectiveweight=n,n}_updatetimescale(e){let n=0;if(!this.paused){n=this.timescale;let r=this._timescaleinterpolant;if(null!==r){let i=r.evaluate(e)[0];n*=i,e>r.parameterpositions[1]&&(this.stopwarping(),0===n?this.paused=!0:this.timescale=n)}}return this._effectivetimescale=n,n}_updatetime(e){let n=this._clip.duration,r=this.loop,i=this.time+e,a=this._loopcount,s=r===ty;if(0===e)return -1===a?i:s&&(1&a)==1?n-i:i;if(r===tg){-1===a&&(this._loopcount=0,this._setendings(!0,!0,!1));s:{if(i>=n)i=n;else if(i<0)i=0;else{this.time=i;break s}this.clampwhenfinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchevent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===a&&(e>=0?(a=0,this._setendings(!0,0===this.repetitions,s)):this._setendings(0===this.repetitions,!0,s)),i>=n||i<0){let r=math.floor(i/n);i-=n*r,a+=math.abs(r);let o=this.repetitions-a;if(o<=0)this.clampwhenfinished?this.paused=!0:this.enabled=!1,i=e>0?n:0,this.time=i,this._mixer.dispatchevent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){let n=e<0;this._setendings(n,!n,s)}else this._setendings(!1,!1,s);this._loopcount=a,this.time=i,this._mixer.dispatchevent({type:"loop",action:this,loopdelta:r})}}else this.time=i;if(s&&(1&a)==1)return n-i}return i}_setendings(e,n,r){let i=this._interpolantsettings;r?(i.endingstart=tm,i.endingend=tm):(e?i.endingstart=this.zeroslopeatstart?tm:tb:i.endingstart=ts,n?i.endingend=this.zeroslopeatend?tm:tb:i.endingend=ts)}_schedulefading(e,n,r){let i=this._mixer,a=i.time,s=this._weightinterpolant;null===s&&(s=i._lendcontrolinterpolant(),this._weightinterpolant=s);let o=s.parameterpositions,l=s.samplevalues;return o[0]=a,l[0]=n,o[1]=a+e,l[1]=r,this}}let cu=new float32array(1);class cz extends nr{constructor(e){super(),this._root=e,this._initmemorymanager(),this._accuindex=0,this.time=0,this.timescale=1}_bindaction(e,n){let r=e._localroot||this._root,i=e._clip.tracks,a=i.length,s=e._propertybindings,o=e._interpolants,l=r.uuid,u=this._bindingsbyrootandname,c=u[l];void 0===c&&(c={},u[l]=c);for(let e=0;e!==a;++e){let a=i[e],u=a.name,h=c[u];if(void 0!==h)++h.referencecount,s[e]=h;else{if(void 0!==(h=s[e])){null===h._cacheindex&&(++h.referencecount,this._addinactivebinding(h,l,u));continue}let i=n&&n._propertybindings[e].binding.parsedpath;h=new ce(ck.create(r,u,i),a.valuetypename,a.getvaluesize()),++h.referencecount,this._addinactivebinding(h,l,u),s[e]=h}o[e].resultbuffer=h.buffer}}_activateaction(e){if(!this._isactiveaction(e)){if(null===e._cacheindex){let n=(e._localroot||this._root).uuid,r=e._clip.uuid,i=this._actionsbyclip[r];this._bindaction(e,i&&i.knownactions[0]),this._addinactiveaction(e,r,n)}let n=e._propertybindings;for(let e=0,r=n.length;e!==r;++e){let r=n[e];0==r.usecount++&&(this._lendbinding(r),r.saveoriginalstate())}this._lendaction(e)}}_deactivateaction(e){if(this._isactiveaction(e)){let n=e._propertybindings;for(let e=0,r=n.length;e!==r;++e){let r=n[e];0==--r.usecount&&(r.restoreoriginalstate(),this._takebackbinding(r))}this._takebackaction(e)}}_initmemorymanager(){this._actions=[],this._nactiveactions=0,this._actionsbyclip={},this._bindings=[],this._nactivebindings=0,this._bindingsbyrootandname={},this._controlinterpolants=[],this._nactivecontrolinterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inuse(){return e._nactiveactions}},bindings:{get total(){return e._bindings.length},get inuse(){return e._nactivebindings}},controlinterpolants:{get total(){return e._controlinterpolants.length},get inuse(){return e._nactivecontrolinterpolants}}}}_isactiveaction(e){let n=e._cacheindex;return null!==n&&n=0;--r)e[r].stop();return this}update(e){e*=this.timescale;let n=this._actions,r=this._nactiveactions,i=this.time+=e,a=math.sign(e),s=this._accuindex^=1;for(let o=0;o!==r;++o){let r=n[o];r._update(i,e,a,s)}let o=this._bindings,l=this._nactivebindings;for(let e=0;e!==l;++e)o[e].apply(s);return this}settime(e){this.time=0;for(let e=0;ethis.max.x)&&!(e.ythis.max.y)}containsbox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getparameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsbox(e){return!(e.max.xthis.max.x)&&!(e.max.ythis.max.y)}clamppoint(e,n){return n.copy(e).clamp(this.min,this.max)}distancetopoint(e){let n=c$.copy(e).clamp(this.min,this.max);return n.sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}let c1=new ny,c2=new ny;class c3{constructor(e=new ny,n=new ny){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getcenter(e){return e.addvectors(this.start,this.end).multiplyscalar(.5)}delta(e){return e.subvectors(this.end,this.start)}distancesq(){return this.start.distancetosquared(this.end)}distance(){return this.start.distanceto(this.end)}at(e,n){return this.delta(n).multiplyscalar(e).add(this.start)}closestpointtopointparameter(e,n){c1.subvectors(e,this.start),c2.subvectors(this.end,this.start);let r=c2.dot(c2),i=c2.dot(c1),a=i/r;return n&&(a=nu(a,0,1)),a}closestpointtopoint(e,n,r){let i=this.closestpointtopointparameter(e,n);return this.delta(r).multiplyscalar(i).add(this.start)}applymatrix4(e){return this.start.applymatrix4(e),this.end.applymatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}let c4=new ny;class c6 extends rg{constructor(e,n){super(),this.light=e,this.matrix=e.matrixworld,this.matrixautoupdate=!1,this.color=n,this.type="spotlighthelper";let r=new id,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,n=1;e<32;e++,n++){let r=e/32*math.pi*2,a=n/32*math.pi*2;i.push(math.cos(r),math.sin(r),1,math.cos(a),math.sin(a),1)}r.setattribute("position",new ir(i,3));let a=new of({fog:!1,tonemapped:!1});this.cone=new oj(r,a),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateworldmatrix(!0,!1),this.light.target.updateworldmatrix(!0,!1);let e=this.light.distance?this.light.distance:1e3,n=e*math.tan(this.light.angle);this.cone.scale.set(n,n,e),c4.setfrommatrixposition(this.light.target.matrixworld),this.cone.lookat(c4),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}let c5=new ny,c9=new rm,c8=new rm;class c7 extends oj{constructor(e){let n=function e(n){let r=[];!0===n.isbone&&r.push(n);for(let i=0;i1)for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{hx.set(e.z,0,-e.x).normalize();let n=math.acos(e.y);this.quaternion.setfromaxisangle(hx,n)}}setlength(e,n=.2*e,r=.2*n){this.line.scale.set(1,math.max(1e-4,e-n),1),this.line.updatematrix(),this.cone.scale.set(r,n,r),this.cone.position.y=e,this.cone.updatematrix()}setcolor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class ha extends oj{constructor(e=1){let n=new id;n.setattribute("position",new ir([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],3)),n.setattribute("color",new ir([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));let r=new of({vertexcolors:!0,tonemapped:!1});super(n,r),this.type="axeshelper"}setcolors(e,n,r){let i=new nf,a=this.geometry.attributes.color.array;return i.set(e),i.toarray(a,0),i.toarray(a,3),i.set(n),i.toarray(a,6),i.toarray(a,9),i.set(r),i.toarray(a,12),i.toarray(a,15),this.geometry.attributes.color.needsupdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class hb{constructor(){this.type="shapepath",this.color=new nf,this.subpaths=[],this.currentpath=null}moveto(e,n){return this.currentpath=new lm,this.subpaths.push(this.currentpath),this.currentpath.moveto(e,n),this}lineto(e,n){return this.currentpath.lineto(e,n),this}quadraticcurveto(e,n,r,i){return this.currentpath.quadraticcurveto(e,n,r,i),this}beziercurveto(e,n,r,i,a,s){return this.currentpath.beziercurveto(e,n,r,i,a,s),this}splinethru(e){return this.currentpath.splinethru(e),this}toshapes(e){let n,r,i,a,s;let o=lw.isclockwise,l=this.subpaths;if(0===l.length)return[];let u=[];if(1===l.length)return r=l[0],(i=new lt).curves=r.curves,u.push(i),u;let c=!o(l[0].getpoints());c=e?!c:c;let h=[],d=[],p=[],f=0;d[0]=void 0,p[f]=[];for(let i=0,s=l.length;i1){let e=!1,n=0;for(let e=0,n=d.length;enumber.epsilon){if(u<0&&(r=n[s],l=-l,o=n[a],u=-u),e.yo.y)continue;if(e.y===r.y){if(e.x===r.x)return!0}else{let n=u*(e.x-r.x)-l*(e.y-r.y);if(0===n)return!0;if(n<0)continue;i=!i}}else{if(e.y!==r.y)continue;if(o.x<=e.x&&e.x<=r.x||r.x<=e.x&&e.x<=o.x)return!0}}return i})(s.p,d[i].p)&&(r!==i&&n++,o?(o=!1,h[i].push(s)):e=!0);o&&h[r].push(s)}}n>0&&!1===e&&(p=h)}for(let e=0,n=d.length;e>-n-14,i[256|e]=1024>>-n-14|32768,a[e]=-n-1,a[256|e]=-n-1):n<=15?(i[e]=n+15<<10,i[256|e]=n+15<<10|32768,a[e]=13,a[256|e]=13):n<128?(i[e]=31744,i[256|e]=64512,a[e]=24,a[256|e]=24):(i[e]=31744,i[256|e]=64512,a[e]=13,a[256|e]=13)}let s=new uint32array(2048),o=new uint32array(64),l=new uint32array(64);for(let e=1;e<1024;++e){let n=e<<13,r=0;for(;(8388608&n)==0;)n<<=1,r-=8388608;n&=-8388609,r+=947912704,s[e]=n|r}for(let e=1024;e<2048;++e)s[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(l[e]=1024);return{floatview:n,uint32view:r,basetable:i,shifttable:a,mantissatable:s,exponenttable:o,offsettable:l}}();var hs=object.freeze({__proto__:null,fromhalffloat:function(e){let n=e>>10;return hm.uint32view[0]=hm.mantissatable[hm.offsettable[n]+(1023&e)]+hm.exponenttable[n],hm.floatview[0]},tohalffloat:function(e){math.abs(e)>65504&&console.warn("three.datautils.tohalffloat(): value out of range."),e=nu(e,-65504,65504),hm.floatview[0]=e;let n=hm.uint32view[0],r=n>>23&511;return hm.basetable[r]+((8388607&n)>>hm.shifttable[r])}});class hw extends ib{constructor(e,n,r,i,a,s){console.warn("three.boxbuffergeometry has been renamed to three.boxgeometry."),super(e,n,r,i,a,s)}}class hc extends lv{constructor(e,n,r,i){console.warn("three.capsulebuffergeometry has been renamed to three.capsulegeometry."),super(e,n,r,i)}}class he extends ly{constructor(e,n,r,i){console.warn("three.circlebuffergeometry has been renamed to three.circlegeometry."),super(e,n,r,i)}}class ht extends l_{constructor(e,n,r,i,a,s,o){console.warn("three.conebuffergeometry has been renamed to three.conegeometry."),super(e,n,r,i,a,s,o)}}class hb extends lx{constructor(e,n,r,i,a,s,o,l){console.warn("three.cylinderbuffergeometry has been renamed to three.cylindergeometry."),super(e,n,r,i,a,s,o,l)}}class hp extends lb{constructor(e,n){console.warn("three.dodecahedronbuffergeometry has been renamed to three.dodecahedrongeometry."),super(e,n)}}class hr extends lk{constructor(e,n){console.warn("three.extrudebuffergeometry has been renamed to three.extrudegeometry."),super(e,n)}}class hl extends lq{constructor(e,n){console.warn("three.icosahedronbuffergeometry has been renamed to three.icosahedrongeometry."),super(e,n)}}class hi extends lg{constructor(e,n,r,i){console.warn("three.lathebuffergeometry has been renamed to three.lathegeometry."),super(e,n,r,i)}}class hd extends lq{constructor(e,n){console.warn("three.octahedronbuffergeometry has been renamed to three.octahedrongeometry."),super(e,n)}}class hf extends iy{constructor(e,n,r,i){console.warn("three.planebuffergeometry has been renamed to three.planegeometry."),super(e,n,r,i)}}class ho extends la{constructor(e,n,r,i){console.warn("three.polyhedronbuffergeometry has been renamed to three.polyhedrongeometry."),super(e,n,r,i)}}class hn extends lz{constructor(e,n,r,i,a,s){console.warn("three.ringbuffergeometry has been renamed to three.ringgeometry."),super(e,n,r,i,a,s)}}class hk extends l${constructor(e,n){console.warn("three.shapebuffergeometry has been renamed to three.shapegeometry."),super(e,n)}}class hh extends l0{constructor(e,n,r,i,a,s,o){console.warn("three.spherebuffergeometry has been renamed to three.spheregeometry."),super(e,n,r,i,a,s,o)}}class hg extends l1{constructor(e,n){console.warn("three.tetrahedronbuffergeometry has been renamed to three.tetrahedrongeometry."),super(e,n)}}class hu extends l2{constructor(e,n,r,i,a){console.warn("three.torusbuffergeometry has been renamed to three.torusgeometry."),super(e,n,r,i,a)}}class hz extends l3{constructor(e,n,r,i,a,s){console.warn("three.torusknotbuffergeometry has been renamed to three.torusknotgeometry."),super(e,n,r,i,a,s)}}class hv extends l4{constructor(e,n,r,i,a){console.warn("three.tubebuffergeometry has been renamed to three.tubegeometry."),super(e,n,r,i,a)}}"undefined"!=typeof __three_devtools__&&__three_devtools__.dispatchevent(new customevent("register",{detail:{revision:u}})),"undefined"!=typeof window&&(window.__three__?console.warn("warning: multiple instances of three.js being imported."):window.__three__=u)}},function(e){var n=function(n){return e(e.s=n)};e.o(0,[774,179],function(){return n(6840),n(880)}),_n_e=e.o()}]);